diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d416e1c9e6..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.ts] -indent_style = space -indent_size = 2 diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs deleted file mode 100644 index cc394407d8..0000000000 --- a/.git-blame-ignore-revs +++ /dev/null @@ -1,3 +0,0 @@ -# .git-blame-ignore-revs -# Added trailing commas to adhere to new eslint rules -b16296be30e150034524d6dd0b0418fc6b184267 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 73aa45d18b..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,9 +0,0 @@ -lib/*.js linguist-generated=true -.github/workflows/__* linguist-generated=true - -# Reduce incidence of needless merge conflicts on CHANGELOG.md -# The man page at -# https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitattributes.html -# suggests that this might interleave lines arbitrarily, but empirically -# it keeps added chunks contiguous -CHANGELOG.md merge=union diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 1c514912c5..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: true -contact_links: - - name: Contact GitHub Support - url: https://support.github.com/request - about: Contact Support diff --git a/.github/actions/check-codescanning-config/action.yml b/.github/actions/check-codescanning-config/action.yml deleted file mode 100644 index 0c65c3a41d..0000000000 --- a/.github/actions/check-codescanning-config/action.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Check Code-Scanning Config -description: | - Checks the code scanning configuration file generated by the - action to ensure it contains the expected contents -inputs: - languages: - required: false - description: The languages field passed to the init action. - - packs: - required: false - description: The packs field passed to the init action. - - queries: - required: false - description: The queries field passed to the init action. - - config-file-test: - required: false - description: | - The location of the config file to use. If empty, - then no config file is used. - - expected-config-file-contents: - required: true - description: | - A JSON string containing the exact contents of the config file. - - tools: - required: true - description: | - The version of CodeQL passed to the `tools` input of the init action. - This can be any of the following: - - - A local path to a tarball containing the CodeQL tools, or - - A URL to a GitHub release assets containing the CodeQL tools, or - - A special value `linked` which is forcing the use of the CodeQL tools - that the action has been bundled with. - - If not specified, the Action will check in several places until it finds - the CodeQL tools. - -runs: - using: composite - steps: - - uses: ./../action/init - with: - languages: ${{ inputs.languages }} - config-file: ${{ inputs.config-file-test }} - queries: ${{ inputs.queries }} - packs: ${{ inputs.packs }} - tools: ${{ inputs.tools }} - db-location: ${{ runner.temp }}/codescanning-config-cli-test - env: - CODEQL_ACTION_TEST_MODE: 'true' - - - name: Install dependencies - shell: bash - run: npm install --location=global ts-node js-yaml - - - name: Check config - working-directory: ${{ github.action_path }} - shell: bash - env: - EXPECTED_CONFIG_FILE_CONTENTS: '${{ inputs.expected-config-file-contents }}' - run: ts-node ./index.ts "$RUNNER_TEMP/user-config.yaml" "$EXPECTED_CONFIG_FILE_CONTENTS" - - name: Clean up - shell: bash - if: always() - run: | - rm -rf $RUNNER_TEMP/codescanning-config-cli-test - rm -rf $RUNNER_TEMP/user-config.yaml diff --git a/.github/actions/check-codescanning-config/index.ts b/.github/actions/check-codescanning-config/index.ts deleted file mode 100644 index ea99ca3653..0000000000 --- a/.github/actions/check-codescanning-config/index.ts +++ /dev/null @@ -1,49 +0,0 @@ - -import * as core from '@actions/core' -import * as yaml from 'js-yaml' -import * as fs from 'fs' -import * as assert from 'assert' - -const actualConfig = loadActualConfig() - -function sortConfigArrays(config) { - for (const key of Object.keys(config)) { - const value = config[key]; - if (key === 'queries' && Array.isArray(value)) { - config[key] = value.sort(); - } - } - return config; -} - -const rawExpectedConfig = process.argv[3].trim() -if (!rawExpectedConfig) { - core.setFailed('No expected configuration provided') -} else { - core.startGroup('Expected generated user config') - core.info(yaml.dump(JSON.parse(rawExpectedConfig))) - core.endGroup() -} - -const expectedConfig = rawExpectedConfig ? JSON.parse(rawExpectedConfig) : undefined; - -assert.deepStrictEqual( - sortConfigArrays(actualConfig), - sortConfigArrays(expectedConfig), - 'Expected configuration does not match actual configuration' -); - - -function loadActualConfig() { - if (!fs.existsSync(process.argv[2])) { - core.info('No configuration file found') - return undefined - } else { - const rawActualConfig = fs.readFileSync(process.argv[2], 'utf8') - core.startGroup('Actual generated user config') - core.info(rawActualConfig) - core.endGroup() - - return yaml.load(rawActualConfig) - } -} diff --git a/.github/actions/check-sarif/action.yml b/.github/actions/check-sarif/action.yml deleted file mode 100644 index bfa1c3b9d1..0000000000 --- a/.github/actions/check-sarif/action.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Check SARIF -description: Checks a SARIF file to see if certain queries were run and others were not run. -inputs: - sarif-file: - required: true - description: The SARIF file to check - - queries-run: - required: true - description: | - Comma separated list of query ids that should be included in this SARIF file. - - queries-not-run: - required: true - description: | - Comma separated list of query ids that should NOT be included in this SARIF file. - -runs: - using: node24 - main: index.js diff --git a/.github/actions/check-sarif/index.js b/.github/actions/check-sarif/index.js deleted file mode 100644 index c002b07697..0000000000 --- a/.github/actions/check-sarif/index.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict' - -const core = require('@actions/core') -const fs = require('fs') - -const sarif = JSON.parse(fs.readFileSync(core.getInput('sarif-file'), 'utf8')) -const rules = sarif.runs[0].tool.extensions.flatMap(ext => ext.rules || []) -const ruleIds = rules.map(rule => rule.id) - -// Check that all the expected queries ran -const expectedQueriesRun = getQueryIdsInput('queries-run') -const queriesThatShouldHaveRunButDidNot = expectedQueriesRun.filter(queryId => !ruleIds.includes(queryId)) - -if (queriesThatShouldHaveRunButDidNot.length > 0) { - core.setFailed(`The following queries were expected to run but did not: ${queriesThatShouldHaveRunButDidNot.join(', ')}`) -} - -// Check that all the unexpected queries did not run -const expectedQueriesNotRun = getQueryIdsInput('queries-not-run') - -const queriesThatShouldNotHaveRunButDid = expectedQueriesNotRun.filter(queryId => ruleIds.includes(queryId)) - -if (queriesThatShouldNotHaveRunButDid.length > 0) { - core.setFailed(`The following queries were NOT expected to have run but did: ${queriesThatShouldNotHaveRunButDid.join(', ')}`) -} - - -core.startGroup('All queries run') -rules.forEach(rule => { - core.info(`${rule.id}: ${(rule.properties && rule.properties.name) || rule.name}`) -}) -core.endGroup() - -core.startGroup('Full SARIF') -core.info(JSON.stringify(sarif, null, 2)) -core.endGroup() - -function getQueryIdsInput(name) { - return core.getInput(name) - .split(',') - .map(q => q.trim()) - .filter(q => q.length > 0) -} diff --git a/.github/actions/prepare-mergeback-branch/action.yml b/.github/actions/prepare-mergeback-branch/action.yml deleted file mode 100644 index 2c57dfc012..0000000000 --- a/.github/actions/prepare-mergeback-branch/action.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: "Prepare mergeback branch" -description: Prepares a mergeback branch and opens a PR for it -inputs: - base: - description: "The name of the base branch" - required: true - head: - description: "The name of the head branch" - required: true - branch: - description: "The name of the branch to create." - required: true - version: - description: "The new version" - required: true - token: - description: "The token to use" - required: true - dry-run: - description: "Set to true to skip creating the PR. The branch will still be pushed." - default: "false" -runs: - using: composite - steps: - - name: Create mergeback branch - shell: bash - env: - VERSION: "${{ inputs.version }}" - NEW_BRANCH: "${{ inputs.branch }}" - run: | - set -exu - - # Ensure we are on the new branch - git checkout "${NEW_BRANCH}" - - # Update the version number ready for the next release - npm version patch --no-git-tag-version - - # Update the changelog, adding a new version heading directly above the most recent existing one - awk '!f && /##/{print "'"## [UNRELEASED]\n\nNo user facing changes.\n"'"; f=1}1' CHANGELOG.md > temp && mv temp CHANGELOG.md - git add . - git commit -m "Update changelog and version after ${VERSION}" - - # Update the build artifacts with the new version number - - name: Rebuild the Action - shell: bash - run: | - set -exu - npm ci - npm run build - - - name: Check for rebuild changes - id: rebuild_changes - shell: bash - run: | - set -exu - git add --all - if git diff --cached --quiet; then - echo "has_changes=false" >> "${GITHUB_OUTPUT}" - else - echo "has_changes=true" >> "${GITHUB_OUTPUT}" - fi - - - name: Commit rebuild - if: steps.rebuild_changes.outputs.has_changes == 'true' - shell: bash - run: | - set -exu - git commit -m "Rebuild" - - - name: Push mergeback branch - shell: bash - env: - NEW_BRANCH: "${{ inputs.branch }}" - run: git push origin "${NEW_BRANCH}" - - - name: Create PR - shell: bash - if: inputs.dry-run != 'true' - env: - VERSION: "${{ inputs.version }}" - BASE_BRANCH: "${{ inputs.base }}" - HEAD_BRANCH: "${{ inputs.head }}" - NEW_BRANCH: "${{ inputs.branch }}" - GITHUB_TOKEN: "${{ inputs.token }}" - run: | - set -exu - pr_title="Mergeback ${VERSION} ${HEAD_BRANCH} into ${BASE_BRANCH}" - pr_body=$(cat << EOF - This PR bumps the version number and updates the changelog after the ${VERSION} release. - - Please do the following: - - - [ ] Approve running the full set of PR checks. - - [ ] Approve and merge the PR. When merging the PR, make sure "Create a merge commit" is - selected rather than "Squash and merge" or "Rebase and merge". - EOF - ) - - gh pr create \ - --head "${NEW_BRANCH}" \ - --base "${BASE_BRANCH}" \ - --title "${pr_title}" \ - --body "${pr_body}" \ - --assignee "${GITHUB_ACTOR}" diff --git a/.github/actions/prepare-test/action.yml b/.github/actions/prepare-test/action.yml deleted file mode 100644 index 5e2b5028f7..0000000000 --- a/.github/actions/prepare-test/action.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: "Prepare test" -description: Performs some preparation to run tests -inputs: - version: - description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'toolcache', 'nightly', 'nightly-latest', 'nightly-YYYYMMDD', or 'stable-vX.Y.Z" - required: true - use-all-platform-bundle: - description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL" - default: 'false' - required: false - setup-kotlin: - description: "If true, we setup kotlin" - default: 'true' - required: true -outputs: - tools-url: - description: "The value that should be passed as the 'tools' input of the 'init' step." - value: ${{ steps.get-url.outputs.tools-url }} -runs: - using: composite - steps: - - name: Move codeql-action - shell: bash - run: | - mkdir ../action - mv * .github ../action/ - mv ../action/tests/multi-language-repo/{*,.github} . - mv ../action/.github/workflows .github - - id: get-url - name: Determine URL - shell: bash - env: - VERSION: ${{ inputs.version }} - USE_ALL_PLATFORM_BUNDLE: ${{ inputs.use-all-platform-bundle }} - run: | - set -e # Fail this Action if `gh release list` fails. - - if [[ "$VERSION" == "nightly" || "$VERSION" == "nightly-latest" ]]; then - echo "tools-url=nightly" >> "$GITHUB_OUTPUT" - exit 0 - elif [[ "$VERSION" == "linked" ]]; then - echo "tools-url=linked" >> "$GITHUB_OUTPUT" - exit 0 - elif [[ "$VERSION" == "toolcache" ]]; then - echo "tools-url=toolcache" >> "$GITHUB_OUTPUT" - exit 0 - elif [[ "$VERSION" == "default" ]]; then - echo "tools-url=" >> "$GITHUB_OUTPUT" - exit 0 - fi - - if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then - artifact_name="codeql-bundle.tar.gz" - elif [[ "$RUNNER_OS" == "Linux" ]]; then - artifact_name="codeql-bundle-linux64.tar.gz" - elif [[ "$RUNNER_OS" == "macOS" ]]; then - artifact_name="codeql-bundle-osx64.tar.gz" - elif [[ "$RUNNER_OS" == "Windows" ]]; then - artifact_name="codeql-bundle-win64.tar.gz" - else - echo "::error::Unrecognized OS $RUNNER_OS" - exit 1 - fi - - if [[ "$VERSION" == *"nightly"* ]]; then - version=`echo "$VERSION" | sed -e 's/^.*\-//'` - echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT - elif [[ "$VERSION" == *"stable"* ]]; then - version=`echo "$VERSION" | sed -e 's/^.*\-//'` - echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT - else - echo "::error::Unrecognized version specified!" - exit 1 - fi - - - uses: fwilhe2/setup-kotlin@9c245a6425255f5e98ba1ce6c15d31fce7eca9da - if: ${{ inputs.setup-kotlin == 'true' }} - with: - version: 1.8.21 diff --git a/.github/actions/query-filter-test/action.yml b/.github/actions/query-filter-test/action.yml deleted file mode 100644 index f1dfc38bf2..0000000000 --- a/.github/actions/query-filter-test/action.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Query Filter Test -description: Runs a test of query filters using the check SARIF action -inputs: - sarif-file: - required: true - description: The SARIF file to check - - queries-run: - required: true - description: | - Comma separated list of query ids that should be included in this SARIF file. - - queries-not-run: - required: true - description: | - Comma separated list of query ids that should NOT be included in this SARIF file. - - config-file: - required: true - description: | - The location of the codeql configuration file to use. - - tools: - required: true - description: | - The version of CodeQL passed to the `tools` input of the init action. - This can be any of the following: - - - A local path to a tarball containing the CodeQL tools, or - - A URL to a GitHub release assets containing the CodeQL tools, or - - A special value `linked` which is forcing the use of the CodeQL tools - that the action has been bundled with. - - If not specified, the Action will check in several places until it finds - the CodeQL tools. - -runs: - using: composite - steps: - - uses: ./../action/init - with: - languages: javascript - config-file: ${{ inputs.config-file }} - tools: ${{ inputs.tools }} - db-location: ${{ runner.temp }}/query-filter-test - env: - CODEQL_ACTION_TEST_MODE: "true" - - uses: ./../action/analyze - with: - output: ${{ runner.temp }}/results - upload: never - env: - CODEQL_ACTION_TEST_MODE: "true" - - name: Check SARIF - uses: ./../action/.github/actions/check-sarif - with: - sarif-file: ${{ inputs.sarif-file }} - queries-run: ${{ inputs.queries-run}} - queries-not-run: ${{ inputs.queries-not-run}} - - name: Cleanup after test - shell: bash - run: rm -rf "$RUNNER_TEMP/results" "$RUNNER_TEMP/query-filter-test" diff --git a/.github/actions/release-branches/action.yml b/.github/actions/release-branches/action.yml deleted file mode 100644 index 7734411c73..0000000000 --- a/.github/actions/release-branches/action.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: 'Release branches' -description: 'Determine branches for release & backport' -inputs: - major_version: - description: 'The version as extracted from the package.json file' - required: true - latest_tag: - description: 'The most recent tag published to the repository' - required: true -outputs: - backport_source_branch: - description: "The release branch for the given tag" - value: ${{ steps.branches.outputs.backport_source_branch }} - backport_target_branches: - description: "JSON encoded list of branches to target with backports" - value: ${{ steps.branches.outputs.backport_target_branches }} -runs: - using: "composite" - steps: - - id: branches - env: - MAJOR_VERSION: ${{ inputs.major_version }} - LATEST_TAG: ${{ inputs.latest_tag }} - run: | - npx tsx ./pr-checks/release-branches.ts \ - --major-version "$MAJOR_VERSION" \ - --latest-tag "$LATEST_TAG" - shell: bash diff --git a/.github/actions/release-initialise/action.yml b/.github/actions/release-initialise/action.yml deleted file mode 100644 index 239dfa9428..0000000000 --- a/.github/actions/release-initialise/action.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: 'Prepare release job' -description: 'Prepare for updating a release branch' - -runs: - using: "composite" - steps: - - - name: Dump environment - run: env - shell: bash - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: '${{ toJson(github) }}' - run: echo "$GITHUB_CONTEXT" - shell: bash - - - name: Set up Node - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: 24 - cache: 'npm' - - - name: Install JavaScript dependencies - shell: bash - run: npm ci - - - name: Update git config - run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - shell: bash diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md new file mode 100644 index 0000000000..da6f2e9d9b --- /dev/null +++ b/.github/actions/spelling/README.md @@ -0,0 +1,18 @@ +# check-spelling/check-spelling configuration + +File | Purpose | Format | Info +-|-|-|- +[dictionary.txt](dictionary.txt) | Replacement dictionary (creating this file will override the default dictionary) | one word per line | [dictionary](https://github.com/check-spelling/check-spelling/wiki/Configuration#dictionary) +[allow.txt](allow.txt) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow) +[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject) +[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes) +[only.txt](only.txt) | Only check matching files (applied after excludes) | perl regular expression | [only](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-only) +[patterns.txt](patterns.txt) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) +[candidate.patterns](candidate.patterns) | Patterns that might be worth adding to [patterns.txt](patterns.txt) | perl regular expression with optional comment block introductions (all matches will be suggested) | [candidates](https://github.com/check-spelling/check-spelling/wiki/Feature:-Suggest-patterns) +[line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) +[expect.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect) +[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice) +[block-delimiters.list](block-delimiters.list) | Define block begin/end markers to ignore lines of text | line with _literal string_ for **start** followed by line with _literal string_ for **end** | [block ignore](https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Block-Ignore#status) + +Note: you can replace any of these files with a directory by the same name (minus the suffix) +and then include multiple files inside that directory (with that suffix) to merge multiple files together. diff --git a/.github/actions/spelling/advice.md b/.github/actions/spelling/advice.md new file mode 100644 index 0000000000..a32d1090aa --- /dev/null +++ b/.github/actions/spelling/advice.md @@ -0,0 +1,31 @@ + +
If the flagged items are :exploding_head: false positives + +If items relate to a ... +* binary file (or some other file you wouldn't want to check at all). + + Please add a file path to the `excludes.txt` file matching the containing file. + + File paths are Perl 5 Regular Expressions - you can [test]( +https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files. + + `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md]( +../tree/HEAD/README.md) (on whichever branch you're using). + +* well-formed pattern. + + If you can write a [pattern]( +https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns +) that would match it, + try adding it to the `patterns.txt` file. + + Patterns are Perl 5 Regular Expressions - you can [test]( +https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines. + + Note that patterns can't match multiline strings. + +
+ + +:steam_locomotive: If you're seeing this message and your PR is from a branch that doesn't have check-spelling, +please merge to your PR's base branch to get the version configured for your repository. diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt new file mode 100644 index 0000000000..61567618d8 --- /dev/null +++ b/.github/actions/spelling/allow.txt @@ -0,0 +1,5 @@ +github +https +ssh +ubuntu +workarounds diff --git a/.github/actions/spelling/block-delimiters.list b/.github/actions/spelling/block-delimiters.list new file mode 100644 index 0000000000..7a7a8832ce --- /dev/null +++ b/.github/actions/spelling/block-delimiters.list @@ -0,0 +1,23 @@ +# Public Keys +-----BEGIN PUBLIC KEY----- +-----END PUBLIC KEY----- + +# Private Keys +-----BEGIN PRIVATE KEY----- +-----END PRIVATE KEY----- + +# RSA Private Key +-----BEGIN RSA PRIVATE KEY----- +-----END RSA PRIVATE KEY----- + +# GPG Public Key +-----BEGIN PGP PUBLIC KEY BLOCK----- +-----END PGP PUBLIC KEY BLOCK----- + +# GPG Signature +-----BEGIN PGP SIGNATURE----- +-----END PGP SIGNATURE----- + +# Certificates +-----BEGIN CERTIFICATE----- +-----END CERTIFICATE----- diff --git a/.github/actions/spelling/candidate.patterns b/.github/actions/spelling/candidate.patterns new file mode 100644 index 0000000000..ba7fb73bc6 --- /dev/null +++ b/.github/actions/spelling/candidate.patterns @@ -0,0 +1,742 @@ +# marker to ignore all code on line +^.*/\* #no-spell-check-line \*/.*$ +# marker to ignore all code on line +^.*\bno-spell-check(?:-line|)(?:\s.*|)$ + +# https://cspell.org/configuration/document-settings/ +# cspell inline +^.*\b[Cc][Ss][Pp][Ee][Ll]{2}:\s*[Dd][Ii][Ss][Aa][Bb][Ll][Ee]-[Ll][Ii][Nn][Ee]\b + +# patch hunk comments +^@@ -\d+(?:,\d+|) \+\d+(?:,\d+|) @@ .* +# git index header +index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40} + +# file permissions +['"`\s][-bcdLlpsw](?:[-r][-w][-Ssx]){2}[-r][-w][-SsTtx]\+?['"`\s] + +# css url wrappings +\burl\([^)]+\) + +# cid urls +(['"])cid:.*?\g{-1} + +# data url in parens +\(data:(?:[^) ][^)]*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\) +# data url in quotes +([`'"])data:(?:[^ `'"].*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} +# data url +\bdata:[-a-zA-Z=;:/0-9+]*,\S* + +# https/http/file urls +(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/*%?=~_|!:,.;]+[-A-Za-z0-9+&@#/*%=~_|] + +# mailto urls +mailto:[-a-zA-Z=;:/?%&0-9+@._]{3,} + +# magnet urls +magnet:[?=:\w]+ + +# magnet urls +"magnet:[^"]+" + +# obs: +"obs:[^"]*" + +# The `\b` here means a break, it's the fancy way to handle urls, but it makes things harder to read +# In this examples content, I'm using a number of different ways to match things to show various approaches +# asciinema +\basciinema\.org/a/[0-9a-zA-Z]+ + +# asciinema v2 +^\[\d+\.\d+, "[io]", ".*"\]$ + +# apple +\bdeveloper\.apple\.com/[-\w?=/]+ +# Apple music +\bembed\.music\.apple\.com/fr/playlist/usr-share/[-\w.]+ + +# appveyor api +\bci\.appveyor\.com/api/projects/status/[0-9a-z]+ +# appveyor project +\bci\.appveyor\.com/project/(?:[^/\s"]*/){2}builds?/\d+/job/[0-9a-z]+ + +# Amazon + +# Amazon +\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|) +# AWS S3 +\b\w*\.s3[^.]*\.amazonaws\.com/[-\w/&#%_?:=]* +# AWS execute-api +\b[0-9a-z]{10}\.execute-api\.[-0-9a-z]+\.amazonaws\.com\b +# AWS ELB +\b\w+\.[-0-9a-z]+\.elb\.amazonaws\.com\b +# AWS SNS +\bsns\.[-0-9a-z]+.amazonaws\.com/[-\w/&#%_?:=]* +# AWS VPC +vpc-\w+ + +# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there +# YouTube url +\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]* +# YouTube music +\bmusic\.youtube\.com/youtubei/v1/browse(?:[?&]\w+=[-a-zA-Z0-9?&=_]*) +# YouTube tag +<\s*youtube\s+id=['"][-a-zA-Z0-9?_]*['"] +# YouTube image +\bimg\.youtube\.com/vi/[-a-zA-Z0-9?&=_]* +# Google Accounts +\baccounts.google.com/[-_/?=.:;+%&0-9a-zA-Z]* +# Google Analytics +\bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]* +# Google APIs +\bgoogleapis\.(?:com|dev)/[a-z]+/(?:v\d+/|)[a-z]+/[-@:./?=\w+|&]+ +# Google Storage +\b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|) +# Google Calendar +\bcalendar\.google\.com/calendar(?:/u/\d+|)/embed\?src=[@./?=\w&%]+ +\w+\@group\.calendar\.google\.com\b +# Google DataStudio +\bdatastudio\.google\.com/(?:(?:c/|)u/\d+/|)(?:embed/|)(?:open|reporting|datasources|s)/[-0-9a-zA-Z]+(?:/page/[-0-9a-zA-Z]+|) +# The leading `/` here is as opposed to the `\b` above +# ... a short way to match `https://` or `http://` since most urls have one of those prefixes +# Google Docs +/docs\.google\.com/[a-z]+/(?:ccc\?key=\w+|(?:u/\d+|d/(?:e/|)[0-9a-zA-Z_-]+/)?(?:edit\?[-\w=#.]*|/\?[\w=&]*|)) +# Google Drive +\bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]* +# Google Groups +\bgroups\.google\.com(?:/[a-z]+/(?:#!|)[^/\s"]+)* +# Google Maps +\bmaps\.google\.com/maps\?[\w&;=]* +# Google themes +themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. +# Google CDN +\bclients2\.google(?:usercontent|)\.com[-0-9a-zA-Z/.]* +# Goo.gl +/goo\.gl/[a-zA-Z0-9]+ +# Google Chrome Store +\bchrome\.google\.com/webstore/detail/[-\w]*(?:/\w*|) +# Google Books +\bgoogle\.(?:\w{2,4})/books(?:/\w+)*\?[-\w\d=&#.]* +# Google Fonts +\bfonts\.(?:googleapis|gstatic)\.com/[-/?=:;+&0-9a-zA-Z]* +# Google Forms +\bforms\.gle/\w+ +# Google Scholar +\bscholar\.google\.com/citations\?user=[A-Za-z0-9_]+ +# Google Colab Research Drive +\bcolab\.research\.google\.com/drive/[-0-9a-zA-Z_?=]* + +# GitHub SHAs (api) +\bapi.github\.com/repos(?:/[^/\s"]+){3}/[0-9a-f]+\b +# GitHub SHAs (markdown) +(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|) +# GitHub SHAs +\bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b +# GitHub SHA refs +\[([0-9a-f]+)\]\(https://(?:www\.|)github.com/[-\w]+/[-\w]+/commit/\g{-1}[0-9a-f]* +# GitHub wiki +\bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b +# githubusercontent +/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]* +# githubassets +\bgithubassets.com/[0-9a-f]+(?:[-/\w.]+) +# gist github +\bgist\.github\.com/[^/\s"]+/[0-9a-f]+ +# git.io +\bgit\.io/[0-9a-zA-Z]+ +# GitHub JSON +"node_id": "[-a-zA-Z=;:/0-9+_]*" +# Contributor +\[[^\]]+\]\(https://github\.com/[^/\s"]+/?\) +# GHSA +GHSA(?:-[0-9a-z]{4}){3} + +# GitHub actions +\buses:\s+[-\w.]+/[-\w./]+@[-\w.]+ + +# GitLab commit +\bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b +# GitLab merge requests +\bgitlab\.[^/\s"]*/\S+/\S+/-/merge_requests/\d+/diffs#[0-9a-f]{40}\b +# GitLab uploads +\bgitlab\.[^/\s"]*/uploads/[-a-zA-Z=;:/0-9+]* +# GitLab commits +\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b + +# binance +accounts\.binance\.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* + +# bitbucket diff +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+ +# bitbucket repositories commits +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ +# bitbucket commits +\bbitbucket\.org/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ + +# bit.ly +\bbit\.ly/\w+ + +# bitrise +\bapp\.bitrise\.io/app/[0-9a-f]*/[\w.?=&]* + +# bootstrapcdn.com +\bbootstrapcdn\.com/[-./\w]+ + +# cdn.cloudflare.com +\bcdnjs\.cloudflare\.com/[./\w]+ + +# circleci +\bcircleci\.com/gh(?:/[^/\s"]+){1,5}.[a-z]+\?[-0-9a-zA-Z=&]+ + +# gitter +\bgitter\.im(?:/[^/\s"]+){2}\?at=[0-9a-f]+ + +# gravatar +\bgravatar\.com/avatar/[0-9a-f]+ + +# ibm +[a-z.]*ibm\.com/[-_#=:%!?~.\\/\d\w]* + +# imgur +\bimgur\.com/[^.]+ + +# Internet Archive +\barchive\.org/web/\d+/(?:[-\w.?,'/\\+&%$#_:]*) + +# discord +/discord(?:app\.com|\.gg)/(?:invite/)?[a-zA-Z0-9]{7,} + +# Disqus +\bdisqus\.com/[-\w/%.()!?&=_]* + +# medium link +\blink\.medium\.com/[a-zA-Z0-9]+ +# medium +\bmedium\.com/@?[^/\s"]+/[-\w]+ + +# microsoft +\b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]* +# powerbi +\bapp\.powerbi\.com/reportEmbed/[^"' ]* +# vs devops +\bvisualstudio.com(?::443|)/[-\w/?=%&.]* +# microsoft store +\bmicrosoft\.com/store/apps/\w+ + +# mvnrepository.com +\bmvnrepository\.com/[-0-9a-z./]+ + +# now.sh +/[0-9a-z-.]+\.now\.sh\b + +# oracle +\bdocs\.oracle\.com/[-0-9a-zA-Z./_?#&=]* + +# chromatic.com +/\S+.chromatic.com\S*[")] + +# codacy +\bapi\.codacy\.com/project/badge/Grade/[0-9a-f]+ + +# compai +\bcompai\.pub/v1/png/[0-9a-f]+ + +# mailgun api +\.api\.mailgun\.net/v3/domains/[0-9a-z]+\.mailgun.org/messages/[0-9a-zA-Z=@]* +# mailgun +\b[0-9a-z]+.mailgun.org + +# /message-id/ +/message-id/[-\w@./%]+ + +# Reddit +\breddit\.com/r/[/\w_]* + +# requestb.in +\brequestb\.in/[0-9a-z]+ + +# sched +\b[a-z0-9]+\.sched\.com\b + +# Slack url +slack://[a-zA-Z0-9?&=]+ +# Slack +\bslack\.com/[-0-9a-zA-Z/_~?&=.]* +# Slack edge +\bslack-edge\.com/[-a-zA-Z0-9?&=%./]+ +# Slack images +\bslack-imgs\.com/[-a-zA-Z0-9?&=%.]+ + +# shields.io +\bshields\.io/[-\w/%?=&.:+;,]* + +# stackexchange -- https://stackexchange.com/feeds/sites +\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/) + +# Sentry +[0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b + +# Twitter markdown +\[@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) +# Twitter hashtag +\btwitter\.com/hashtag/[\w?_=&]* +# Twitter status +\btwitter\.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|) +# Twitter profile images +\btwimg\.com/profile_images/[_\w./]* +# Twitter media +\btwimg\.com/media/[-_\w./?=]* +# Twitter link shortened +\bt\.co/\w+ + +# facebook +\bfburl\.com/[0-9a-z_]+ +# facebook CDN +\bfbcdn\.net/[\w/.,]* +# facebook watch +\bfb\.watch/[0-9A-Za-z]+ + +# dropbox +\bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+ + +# ipfs protocol +ipfs://[0-9a-zA-Z]{3,} +# ipfs url +/ipfs/[0-9a-zA-Z]{3,} + +# w3 +\bw3\.org/[-0-9a-zA-Z/#.]+ + +# loom +\bloom\.com/embed/[0-9a-f]+ + +# regex101 +\bregex101\.com/r/[^/\s"]+/\d+ + +# figma +\bfigma\.com/file(?:/[0-9a-zA-Z]+/)+ + +# freecodecamp.org +\bfreecodecamp\.org/[-\w/.]+ + +# image.tmdb.org +\bimage\.tmdb\.org/[/\w.]+ + +# mermaid +\bmermaid\.ink/img/[-\w]+|\bmermaid-js\.github\.io/mermaid-live-editor/#/edit/[-\w]+ + +# Wikipedia +\ben\.wikipedia\.org/wiki/[-\w%.#]+ + +# gitweb +[^"\s]+/gitweb/\S+;h=[0-9a-f]+ + +# HyperKitty lists +/archives/list/[^@/]+@[^/\s"]*/message/[^/\s"]*/ + +# lists +/thread\.html/[^"\s]+ + +# list-management +\blist-manage\.com/subscribe(?:[?&](?:u|id)=[0-9a-f]+)+ + +# kubectl.kubernetes.io/last-applied-configuration +"kubectl.kubernetes.io/last-applied-configuration": ".*" + +# pgp +\bgnupg\.net/pks/lookup[?&=0-9a-zA-Z]* + +# Spotify +\bopen\.spotify\.com/embed/playlist/\w+ + +# Mastodon +\bmastodon\.[-a-z.]*/(?:media/|@)[?&=0-9a-zA-Z_]* + +# scastie +\bscastie\.scala-lang\.org/[^/]+/\w+ + +# images.unsplash.com +\bimages\.unsplash\.com/(?:(?:flagged|reserve)/|)[-\w./%?=%&.;]+ + +# pastebin +\bpastebin\.com/[\w/]+ + +# heroku +\b\w+\.heroku\.com/source/archive/\w+ + +# quip +\b\w+\.quip\.com/\w+(?:(?:#|/issues/)\w+)? + +# badgen.net +\bbadgen\.net/badge/[^")\]'\s]+ + +# statuspage.io +\w+\.statuspage\.io\b + +# media.giphy.com +\bmedia\.giphy\.com/media/[^/]+/[\w.?&=]+ + +# tinyurl +\btinyurl\.com/\w+ + +# codepen +\bcodepen\.io/[\w/]+ + +# registry.npmjs.org +\bregistry\.npmjs\.org/(?:@[^/"']+/|)[^/"']+/-/[-\w@.]+ + +# getopts +\bgetopts\s+(?:"[^"]+"|'[^']+') + +# ANSI color codes +(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m + +# URL escaped characters +%[0-9A-F][A-F](?=[A-Za-z]) +# lower URL escaped characters +%[0-9a-f][a-f](?=[a-z]{2,}) +# IPv6 +\b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b +# c99 hex digits (not the full format, just one I've seen) +0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] +# Punycode +\bxn--[-0-9a-z]+ +# sha +sha\d+:[0-9a-f]*?[a-f]{3,}[0-9a-f]* +# sha-... -- uses a fancy capture +(\\?['"]|")[0-9a-f]{40,}\g{-1} +# hex runs +\b[0-9a-fA-F]{16,}\b +# hex in url queries +=[0-9a-fA-F]*?(?:[A-F]{3,}|[a-f]{3,})[0-9a-fA-F]*?& +# ssh +(?:ssh-\S+|-nistp256) [-a-zA-Z=;:/0-9+]{12,} + +# PGP +\b(?:[0-9A-F]{4} ){9}[0-9A-F]{4}\b +# GPG keys +\b(?:[0-9A-F]{4} ){5}(?: [0-9A-F]{4}){5}\b +# Well known gpg keys +.well-known/openpgpkey/[\w./]+ + +# pki +-----BEGIN.*-----END + +# pki (base64) +LS0tLS1CRUdJT.* + +# uuid: +\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b +# hex digits including css/html color classes: +(?:[\\0][xX]|\\u|[uU]\+|#x?|%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b +# integrity +integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1} + +# https://www.gnu.org/software/groff/manual/groff.html +# man troff content +\\f[BCIPR] +# '/" +\\\([ad]q + +# .desktop mime types +^MimeTypes?=.*$ +# .desktop localized entries +^[A-Z][a-z]+\[[a-z]+\]=.*$ +# Localized .desktop content +Name\[[^\]]+\]=.* + +# IServiceProvider / isAThing +(?:\b|_)(?:(?:ns|)I|isA)(?=(?:[A-Z][a-z]{2,})+(?:[A-Z\d]|\b)) + +# crypt +(['"])\$2[ayb]\$.{56}\g{-1} + +# apache/old crypt +(['"]|)\$+(?:apr|)1\$+.{8}\$+.{22}\g{-1} + +# sha1 hash +\{SHA\}[-a-zA-Z=;:/0-9+]{3,} + +# machine learning (?) +\b(?i)ml(?=[a-z]{2,}) + +# python +\b(?i)py(?!gments|gmy|lon|ramid|ro|th)(?=[a-z]{2,}) + +# scrypt / argon +\$(?:scrypt|argon\d+[di]*)\$\S+ + +# go.sum +\bh1:\S+ + +# scala imports +^import (?:[\w.]|\{\w*?(?:,\s*(?:\w*|\*))+\})+ + +# scala modules +("[^"]+"\s*%%?\s*){2,3}"[^"]+" + +# container images +image: [-\w./:@]+ + +# Docker images +^\s*FROM\s+\S+:\S+(?:\s+AS\s+\S+|) + +# `docker images` REPOSITORY TAG IMAGE ID CREATED SIZE +\s*\S+/\S+\s+\S+\s+[0-9a-f]{8,}\s+\d+\s+(?:hour|day|week)s ago\s+[\d.]+[KMGT]B + +# Intel intrinsics +_mm_(?!dd)\w+ + +# Input to GitHub JSON +content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1} + +# This does not cover multiline strings, if your repository has them, +# you'll want to remove the `(?=.*?")` suffix. +# The `(?=.*?")` suffix should limit the false positives rate +# printf +%(?:(?:(?:hh?|ll?|[jzt])?[diuoxn]|l?[cs]|L?[fega]|p)(?=[a-z]{2,})|(?:X|L?[FEGA])(?=[a-zA-Z]{2,}))(?!%)(?=[_a-zA-Z]+(?!%)\b)(?=.*?['"]) + +# Alternative printf +# %s +%(?:s(?=[a-z]{2,}))(?!%)(?=[_a-zA-Z]+(?!%[^s])\b)(?=.*?['"]) + +# Python string prefix / binary prefix +# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings +(?|m([|!/@#,;']).*?\g{-1}) + +# perl qr regex +(?|\(.*?\)|([|!/@#,;']).*?\g{-1}) + +# perl run +perl(?:\s+-[a-zA-Z]\w*)+ + +# C network byte conversions +(?:\d|\bh)to(?!ken)(?=[a-z])|to(?=[adhiklpun]\() + +# Go regular expressions +regexp?\.MustCompile\(`[^`]*`\) + +# regex choice +\(\?:[^)]+\|[^)]+\) + +# proto +^\s*(\w+)\s\g{-1} = + +# sed regular expressions +sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2} + +# node packages +(["'])@[^/'" ]+/[^/'" ]+\g{-1} + +# go install +go install(?:\s+[a-z]+\.[-@\w/.]+)+ + +# pom.xml +<(?:group|artifact)Id>.*?< + +# jetbrains schema https://youtrack.jetbrains.com/issue/RSRP-489571 +urn:shemas-jetbrains-com + +# Debian changelog severity +[-\w]+ \(.*\) (?:\w+|baseline|unstable|experimental); urgency=(?:low|medium|high|emergency|critical)\b + +# kubernetes pod status lists +# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase +\w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+ + +# kubectl - pods in CrashLoopBackOff +\w+-[0-9a-f]+-\w+\s+\d+/\d+\s+CrashLoopBackOff\s+ + +# kubernetes applications +\.apps/[-\w]+ + +# kubernetes object suffix +-[0-9a-f]{10}-\w{5}\s + +# kubernetes crd patterns +^\s*pattern: .*$ + +# posthog secrets +([`'"])phc_[^"',]+\g{-1} + +# xcode + +# xcodeproject scenes +(?:Controller|destination|ID|id)="\w{3}-\w{2}-\w{3}" + +# xcode api botches +customObjectInstantitationMethod + +# msvc api botches +PrependWithABINamepsace + +# configure flags +.* \| --\w{2,}.*?(?=\w+\s\w+) + +# font awesome classes +\.fa-[-a-z0-9]+ + +# bearer auth +(['"])[Bb]ear[e][r] .*?\g{-1} + +# bearer auth +\b[Bb]ear[e][r]:? [-a-zA-Z=;:/0-9+.]+ + +# basic auth +(['"])[Bb]asic [-a-zA-Z=;:/0-9+]{3,}\g{-1} + +# base64 encoded content +([`'"])[-a-zA-Z=;:/0-9+]{3,}=\g{-1} +# base64 encoded content in xml/sgml +>[-a-zA-Z=;:/0-9+]{3,}== 0.0.22) +\\\w{2,}\{ + +# American Mathematical Society (AMS) / Doxygen +TeX/AMS + +# File extensions +\*\.[+\w]+, + +# eslint +"varsIgnorePattern": ".+" + +# nolint +nolint:\w+ + +# Windows short paths +[/\\][^/\\]{5,6}~\d{1,2}(?=[/\\]) + +# cygwin paths +/cygdrive/[a-zA-Z]/(?:Program Files(?: \(.*?\)| ?)(?:/[-+.~\\/()\w ]+)*|[-+.~\\/()\w])+ + +# in check-spelling@v0.0.22+, printf markers aren't automatically consumed +# printf markers +(?v# +(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) + +# Compiler flags (Unix, Java/Scala) +# Use if you have things like `-Pdocker` and want to treat them as `docker` +(?:^|[\t ,>"'`=(])-(?:(?:J-|)[DPWXY]|[Llf])(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) + +# Compiler flags (Windows / PowerShell) +# This is a subset of the more general compiler flags pattern. +# It avoids matching `-Path` to prevent it from being treated as `ath` +(?:^|[\t ,"'`=(])-(?:[DPL](?=[A-Z]{2,})|[WXYlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})) + +# Compiler flags (linker) +,-B + +# libraries +(?:\b|_)lib(?:re(?=office)|)(?!era[lt]|ero|erty|rar(?:i(?:an|es)|y))(?=[a-z]) + +# WWNN/WWPN (NAA identifiers) +\b(?:0x)?10[0-9a-f]{14}\b|\b(?:0x|3)?[25][0-9a-f]{15}\b|\b(?:0x|3)?6[0-9a-f]{31}\b + +# iSCSI iqn (approximate regex) +\biqn\.[0-9]{4}-[0-9]{2}(?:[\.-][a-z][a-z0-9]*)*\b + +# curl arguments +\b(?:\\n|)curl(?:\.exe|)(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* +# set arguments +\b(?:bash|sh|set)(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)* +# tar arguments +\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ +# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long... +\btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b +# macOS temp folders +/var/folders/\w\w/[+\w]+/(?:T|-Caches-)/ +# github runner temp folders +/home/runner/work/_temp/[-_/a-z0-9]+ diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt new file mode 100644 index 0000000000..d84bbd6b5d --- /dev/null +++ b/.github/actions/spelling/excludes.txt @@ -0,0 +1,84 @@ +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes +(?:^|/)(?i)COPYRIGHT +(?:^|/)(?i)LICEN[CS]E +(?:^|/)(?i)third[-_]?party/ +(?:^|/)3rdparty/ +(?:^|/)generated/ +(?:^|/)go\.sum$ +(?:^|/)package(?:-lock|)\.json$ +(?:^|/)Pipfile$ +(?:^|/)pyproject.toml +(?:^|/|\b)requirements(?:-dev|-doc|-test|)\.txt$ +(?:^|/)vendor/ +ignore$ +\.a$ +\.ai$ +\.all-contributorsrc$ +\.avi$ +\.bmp$ +\.bz2$ +\.cert?$|\.crt$ +\.class$ +\.coveragerc$ +\.crl$ +\.csr$ +\.dll$ +\.docx?$ +\.drawio$ +\.DS_Store$ +\.eot$ +\.eps$ +\.exe$ +\.gif$ +\.git-blame-ignore-revs$ +\.gitattributes$ +\.gitkeep$ +\.graffle$ +\.gz$ +\.icns$ +\.ico$ +\.ipynb$ +\.jar$ +\.jks$ +\.jpe?g$ +\.key$ +\.lib$ +\.lock$ +\.map$ +\.min\.. +\.mo$ +\.mod$ +\.mp[34]$ +\.o$ +\.ocf$ +\.otf$ +\.p12$ +\.parquet$ +\.pdf$ +\.pem$ +\.pfx$ +\.png$ +\.psd$ +\.pyc$ +\.pylintrc$ +\.qm$ +\.s$ +\.sig$ +\.so$ +\.svgz?$ +\.sys$ +\.tar$ +\.tgz$ +\.tiff?$ +\.ttf$ +\.wav$ +\.webm$ +\.webp$ +\.woff2?$ +\.xcf$ +\.xlsx?$ +\.xpm$ +\.xz$ +\.zip$ +^\.github/actions/spelling/ +^\Q.github/workflows/spelling.yml\E$ diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.github/actions/spelling/line_forbidden.patterns b/.github/actions/spelling/line_forbidden.patterns new file mode 100644 index 0000000000..a8dd061fb4 --- /dev/null +++ b/.github/actions/spelling/line_forbidden.patterns @@ -0,0 +1,274 @@ +# reject `m_data` as VxWorks defined it and that breaks things if it's used elsewhere +# see [fprime](https://github.com/nasa/fprime/commit/d589f0a25c59ea9a800d851ea84c2f5df02fb529) +# and [Qt](https://github.com/qtproject/qt-solutions/blame/fb7bc42bfcc578ff3fa3b9ca21a41e96eb37c1c7/qtscriptclassic/src/qscriptbuffer_p.h#L46) +#\bm_data\b + +# Were you debugging using a framework with `fit()`? +# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test, +# you might not want to check in code where you skip all the other tests. +#\bfit\( + +# Should be `HH:MM:SS` +\bHH:SS:MM\b + +# Should be `86400` (seconds in a standard day) +\b84600\b(?:.*\bday\b) + +# Should probably be `2006-01-02` (yyyy-mm-dd) +# Assuming that the time is being passed to https://go.dev/src/time/format.go +\b2006-02-01\b + +# Should probably be `YYYYMMDD` +\b[Yy]{4}[Dd]{2}[Mm]{2}(?!.*[Yy]{4}[Dd]{2}[Mm]{2}).*$ + +# Should be `a priori` or `and prior` +(?i)(? Don't use `can not` when you mean `cannot`. The only time you're likely to see `can not` written as separate words is when the word `can` happens to precede some other phrase that happens to start with `not`. +# > `Can't` is a contraction of `cannot`, and it's best suited for informal writing. +# > In formal writing and where contractions are frowned upon, use `cannot`. +# > It is possible to write `can not`, but you generally find it only as part of some other construction, such as `not only . . . but also.` +# - if you encounter such a case, add a pattern for that case to patterns.txt. +\b[Cc]an not\b + +# Do not use `(click) here` links +# For more information, see: +# * https://www.w3.org/QA/Tips/noClickHere +# * https://webaim.org/techniques/hypertext/link_text +# * https://granicus.com/blog/why-click-here-links-are-bad/ +# * https://heyoka.medium.com/dont-use-click-here-f32f445d1021 +(?i)(?:>|\[)(?:(?:click |)here|(?:read |)more)(?:]*>|[^<]*)\s*$ + +# Autogenerated revert commit message +^This reverts commit [0-9a-f]{40}\.$ + +# ignore long runs of a single character: +\b([A-Za-z])\g{-1}{3,}\b diff --git a/.github/actions/spelling/reject.txt b/.github/actions/spelling/reject.txt new file mode 100644 index 0000000000..5cc86ef80c --- /dev/null +++ b/.github/actions/spelling/reject.txt @@ -0,0 +1,13 @@ +^attache$ +^bellow$ +benefitting +occurences? +^dependan.* +^diables?$ +^oer$ +Sorce +^[Ss]pae.* +^Teh$ +^untill$ +^untilling$ +^wether.* diff --git a/.github/actions/update-bundle/action.yml b/.github/actions/update-bundle/action.yml deleted file mode 100644 index 0216d2465b..0000000000 --- a/.github/actions/update-bundle/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Update default CodeQL bundle -description: Updates 'src/defaults.json' to point to a new CodeQL bundle release. - -runs: - using: composite - steps: - - name: Install ts-node - shell: bash - run: npm install -g ts-node - - - name: Run update script - working-directory: ${{ github.action_path }} - shell: bash - run: ts-node ./index.ts diff --git a/.github/actions/update-bundle/index.ts b/.github/actions/update-bundle/index.ts deleted file mode 100644 index a0f32312cd..0000000000 --- a/.github/actions/update-bundle/index.ts +++ /dev/null @@ -1,67 +0,0 @@ -import * as fs from 'fs'; -import * as github from '@actions/github'; - -interface BundleInfo { - bundleVersion: string; - cliVersion: string; -} - -interface Defaults { - bundleVersion: string; - cliVersion: string; - priorBundleVersion: string; - priorCliVersion: string; -} - -function getCodeQLCliVersionForRelease(release): string { - // We do not currently tag CodeQL bundles based on the CLI version they contain. - // Instead, we use a marker file `cli-version-.txt` to record the CLI version. - // This marker file is uploaded as a release asset for all new CodeQL bundles. - const cliVersionsFromMarkerFiles = release.assets - .map((asset) => asset.name.match(/cli-version-(.*)\.txt/)?.[1]) - .filter((v) => v) - .map((v) => v as string); - if (cliVersionsFromMarkerFiles.length > 1) { - throw new Error( - `Release ${release.tag_name} has multiple CLI version marker files.` - ); - } else if (cliVersionsFromMarkerFiles.length === 0) { - throw new Error( - `Failed to find the CodeQL CLI version for release ${release.tag_name}.` - ); - } - return cliVersionsFromMarkerFiles[0]; -} - -async function getBundleInfoFromRelease(release): Promise { - return { - bundleVersion: release.tag_name, - cliVersion: getCodeQLCliVersionForRelease(release) - }; -} - -async function getNewDefaults(currentDefaults: Defaults): Promise { - const release = github.context.payload.release; - console.log('Updating default bundle as a result of the following release: ' + - `${JSON.stringify(release)}.`) - - const bundleInfo = await getBundleInfoFromRelease(release); - return { - bundleVersion: bundleInfo.bundleVersion, - cliVersion: bundleInfo.cliVersion, - priorBundleVersion: currentDefaults.bundleVersion, - priorCliVersion: currentDefaults.cliVersion - }; -} - -async function main() { - const previousDefaults: Defaults = JSON.parse(fs.readFileSync('../../../src/defaults.json', 'utf8')); - const newDefaults = await getNewDefaults(previousDefaults); - // Update the source file in the repository. Calling workflows should subsequently rebuild - // the Action to update `lib/defaults.json`. - fs.writeFileSync('../../../src/defaults.json', JSON.stringify(newDefaults, null, 2) + "\n"); -} - -// Ideally, we'd await main() here, but that doesn't work well with `ts-node`. -// So instead we rely on the fact that Node won't exit until the event loop is empty. -main(); diff --git a/.github/actions/verify-debug-artifact-scan-completed/action.yml b/.github/actions/verify-debug-artifact-scan-completed/action.yml deleted file mode 100644 index 90fecdd52a..0000000000 --- a/.github/actions/verify-debug-artifact-scan-completed/action.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: Verify that the best-effort debug artifact scan completed -description: Verifies that the best-effort debug artifact scan completed successfully during tests -runs: - using: node24 - main: index.js - post: post.js diff --git a/.github/actions/verify-debug-artifact-scan-completed/index.js b/.github/actions/verify-debug-artifact-scan-completed/index.js deleted file mode 100644 index 9cb49e3e18..0000000000 --- a/.github/actions/verify-debug-artifact-scan-completed/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// The main step is a no-op, since we can only verify artifact scan completion in the post step. -console.log("Will verify artifact scan completion in the post step."); diff --git a/.github/actions/verify-debug-artifact-scan-completed/post.js b/.github/actions/verify-debug-artifact-scan-completed/post.js deleted file mode 100644 index 996b1e9236..0000000000 --- a/.github/actions/verify-debug-artifact-scan-completed/post.js +++ /dev/null @@ -1,11 +0,0 @@ -// Post step - runs after the workflow completes, when artifact scan has finished -const process = require("process"); - -const scanFinished = process.env.CODEQL_ACTION_ARTIFACT_SCAN_FINISHED; - -if (scanFinished !== "true") { - console.error("Error: Best-effort artifact scan did not complete. Expected CODEQL_ACTION_ARTIFACT_SCAN_FINISHED=true"); - process.exit(1); -} - -console.log("✓ Best-effort artifact scan completed successfully"); diff --git a/.github/codeql/codeql-config-javascript.yml b/.github/codeql/codeql-config-javascript.yml deleted file mode 100644 index 15cba1e9af..0000000000 --- a/.github/codeql/codeql-config-javascript.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "CodeQL config" -queries: - - name: Run custom queries - uses: ./queries - # Run all extra query suites, both because we want to - # and because it'll act as extra testing. This is why - # we include both even though one is a superset of the - # other, because we're testing the parsing logic and - # that the suites exist in the codeql bundle. - - uses: security-and-quality - - uses: security-experimental - - uses: security-extended -paths-ignore: - - lib - - tests - - "**/*.test.ts" - - "**/testing-util.ts" diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index 35a89a227a..0000000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,21 +0,0 @@ -# CodeQL Action - Copilot Instructions - -## Generated code - -The CodeQL Action is written in TypeScript and compiled to JavaScript. Both the TypeScript sources and the **generated** JavaScript code are contained in this repository. The TypeScript sources are contained in the `src` directory and the JavaScript code is contained in the `lib` directory. A GitHub Actions workflow checks that the JavaScript code in `lib` is up-to-date. Therefore, you should not review any changes to the contents of the `lib` folder and it is expected that the JavaScript code in `lib` closely mirrors the TypeScript code it is generated from. - -GitHub Actions workflows in the `.github/workflows` directory whose filenames start with two underscores (e.g. `__all-platform-bundle.yml`) are automatically generated using the `pr-checks/sync.sh` script from template files in the `pr-checks/checks` directory. Therefore, you do not need to review files in the `.github/workflows` directory that start with two underscores. However, you should review changes to the `pr-checks` directory as well as workflows in the `.github/workflows` directory that do not start with underscores. - -## Release process - -- A release-PR is a PR which matches all of the following patterns: - - PR title starts with the exact prefix: `Merge main into releases/v` - - Equivalent regex: `^Merge main into releases\/v` - - AND head (source) branch matches the update-branch pattern: - - Regex: `^update-v[0-9]+(?:\.[0-9]+)*(?:-[a-f0-9]+)?` (e.g. `update-v3.29.9-cc722e476`) - - AND base (target) branch matches a release branch: - - Regex: `^releases\/v` (e.g. `releases/v3`) - -- Consider all files in release-PRs to have already been reviewed and do not review them, except for the following two files: - - `CHANGELOG.md` - - `package.json` diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index d29c1e106c..0000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 2 -updates: - - package-ecosystem: npm - directories: - - "/" - - "/pr-checks" - schedule: - interval: weekly - cooldown: - default-days: 7 - exclude: - - "@actions/*" - labels: - - Rebuild - # Ignore incompatible dependency updates - ignore: - # This is broken due to the way configuration files have changed. - # This might be fixed when we move to eslint v9. - - dependency-name: "eslint-plugin-import" - versions: [">=2.30.0"] - groups: - npm-minor: - patterns: - - "*" - update-types: - - "minor" - - "patch" - - package-ecosystem: github-actions - directories: - - "/.github/workflows" - - "/.github/actions" - schedule: - interval: weekly - cooldown: - default-days: 7 - exclude: - - "actions/*" - labels: - - Rebuild - groups: - actions-minor: - patterns: - - "*" - update-types: - - "minor" - - "patch" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 4cfdabac6c..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,82 +0,0 @@ - - -### Risk assessment - -For internal use only. Please select the risk level of this change: - -- **Low risk:** Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only. -- **High risk:** Changes are not fully under feature flags, have limited visibility and/or cannot be tested outside of production. - -#### Which use cases does this change impact? - - - -Workflow types: - -- **Advanced setup** - Impacts users who have custom CodeQL workflows. -- **Managed** - Impacts users with `dynamic` workflows (Default Setup, Code Quality, ...). - -Products: - -- **Code Scanning** - The changes impact analyses when `analysis-kinds: code-scanning`. -- **Code Quality** - The changes impact analyses when `analysis-kinds: code-quality`. -- **Other first-party** - The changes impact other first-party analyses. -- **Third-party analyses** - The changes affect the `upload-sarif` action. - -Environments: - -- **Dotcom** - Impacts CodeQL workflows on `github.com` and/or GitHub Enterprise Cloud with Data Residency. -- **GHES** - Impacts CodeQL workflows on GitHub Enterprise Server. -- **Testing/None** - This change does not impact any CodeQL workflows in production. - -#### How did/will you validate this change? - - - -- **Test repository** - This change will be tested on a test repository before merging. -- **Unit tests** - I am depending on unit test coverage (i.e. tests in `.test.ts` files). -- **End-to-end tests** - I am depending on PR checks (i.e. tests in `pr-checks`). -- **Other** - Please provide details. -- **None** - I am not validating these changes. - -#### If something goes wrong after this change is released, what are the mitigation and rollback strategies? - - - -- **Feature flags** - All new or changed code paths can be fully disabled with corresponding feature flags. -- **Rollback** - Change can only be disabled by rolling back the release or releasing a new version with a fix. -- **Development/testing only** - This change cannot cause any failures in production. -- **Other** - Please provide details. - -#### How will you know if something goes wrong after this change is released? - - - -- **Telemetry** - I rely on existing telemetry or have made changes to the telemetry. - - **Dashboards** - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release. - - **Alerts** - New or existing monitors will trip if something goes wrong with this change. -- **Other** - Please provide details. - -#### Are there any special considerations for merging or releasing this change? - - - -- **No special considerations** - This change can be merged at any time. -- **Special considerations** - This change should only be merged once certain preconditions are met. Please provide details of those or link to this PR from an internal issue. - -### Merge / deployment checklist - -- Confirm this change is backwards compatible with existing workflows. -- Consider adding a [changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) entry for this change. -- Confirm the [readme](https://github.com/github/codeql-action/blob/main/README.md) and docs have been updated if necessary. diff --git a/.github/sizeup.yml b/.github/sizeup.yml deleted file mode 100644 index e94b73b0a9..0000000000 --- a/.github/sizeup.yml +++ /dev/null @@ -1,55 +0,0 @@ -labeling: - applyCategoryLabels: true - categoryLabelPrefix: "size/" - -commenting: - addCommentWhenScoreThresholdHasBeenExceeded: false - -sizeup: - categories: - - name: extra small - lte: 25 - label: - name: XS - description: Should be very easy to review - color: 3cbf00 - - name: small - lte: 100 - label: - name: S - description: Should be easy to review - color: 5d9801 - - name: medium - lte: 250 - label: - name: M - description: Should be of average difficulty to review - color: 7f7203 - - name: large - lte: 500 - label: - name: L - description: May be hard to review - color: a14c05 - - name: extra large - lte: 1000 - label: - name: XL - description: May be very hard to review - color: c32607 - - name: extra extra large - label: - name: XXL - description: May be extremely hard to review - color: e50009 - ignoredFilePatterns: - - ".github/workflows/__*" - - "lib/**/*" - - "package-lock.json" - testFilePatterns: - - "**/*.test.ts" - scoring: - # This formula and the aliases below it are written in prefix notation. - # For an explanation of how this works, please see: - # https://github.com/lerebear/sizeup-core/blob/main/README.md#prefix-notation - formula: "- - + additions deletions comments whitespace" diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml deleted file mode 100644 index c3cf8d63f3..0000000000 --- a/.github/workflows/__all-platform-bundle.yml +++ /dev/null @@ -1,99 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - All-platform bundle -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: all-platform-bundle-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - all-platform-bundle: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: nightly-latest - - os: macos-latest - version: nightly-latest - - os: windows-latest - version: nightly-latest - name: All-platform bundle - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'true' - setup-kotlin: 'true' - - id: init - uses: ./../action/init - with: - # Swift is not supported on Ubuntu so we manually exclude it from the list here - languages: cpp,csharp,go,java,javascript,python,ruby - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__analysis-kinds.yml b/.github/workflows/__analysis-kinds.yml deleted file mode 100644 index 5d0576e2f6..0000000000 --- a/.github/workflows/__analysis-kinds.yml +++ /dev/null @@ -1,147 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Analysis kinds -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: analysis-kinds-${{github.ref}} -jobs: - analysis-kinds: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - analysis-kinds: code-scanning - - os: ubuntu-latest - version: linked - analysis-kinds: code-quality - - os: ubuntu-latest - version: linked - analysis-kinds: code-scanning,code-quality - - os: ubuntu-latest - version: linked - analysis-kinds: risk-assessment - - os: ubuntu-latest - version: nightly-latest - analysis-kinds: code-scanning - - os: ubuntu-latest - version: nightly-latest - analysis-kinds: code-quality - - os: ubuntu-latest - version: nightly-latest - analysis-kinds: code-scanning,code-quality - - os: ubuntu-latest - version: nightly-latest - analysis-kinds: risk-assessment - name: Analysis kinds - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: javascript - analysis-kinds: ${{ matrix.analysis-kinds }} - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - post-processed-sarif-path: '${{ runner.temp }}/post-processed' - - - name: Upload SARIF files - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: | - analysis-kinds-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }} - path: '${{ runner.temp }}/results/*.sarif' - retention-days: 7 - - - name: Upload post-processed SARIF - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: | - post-processed-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }} - path: '${{ runner.temp }}/post-processed' - retention-days: 7 - if-no-files-found: error - - - name: Check quality query does not appear in security SARIF - if: contains(matrix.analysis-kinds, 'code-scanning') - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - SARIF_PATH: '${{ runner.temp }}/results/javascript.sarif' - EXPECT_PRESENT: 'false' - with: - script: ${{ env.CHECK_SCRIPT }} - - name: Check quality query appears in quality SARIF - if: contains(matrix.analysis-kinds, 'code-quality') - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - SARIF_PATH: '${{ runner.temp }}/results/javascript.quality.sarif' - EXPECT_PRESENT: 'true' - with: - script: ${{ env.CHECK_SCRIPT }} - env: - CODEQL_ACTION_RISK_ASSESSMENT_ID: 1 - CHECK_SCRIPT: | - const fs = require('fs'); - - const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8')); - const expectPresent = JSON.parse(process.env['EXPECT_PRESENT']); - const run = sarif.runs[0]; - const extensions = run.tool.extensions; - - if (extensions === undefined) { - core.setFailed('`extensions` property not found in the SARIF run property bag.'); - } - - // ID of a query we want to check the presence for - const targetId = 'js/regex/always-matches'; - const found = extensions.find(extension => extension.rules && extension.rules.find(rule => rule.id === targetId)); - - if (found && expectPresent) { - console.log(`Found rule with id '${targetId}'.`); - } else if (!found && !expectPresent) { - console.log(`Rule with id '${targetId}' was not found.`); - } else { - core.setFailed(`${ found ? "Found" : "Didn't find" } rule ${targetId}`); - } - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml deleted file mode 100644 index 7341a41740..0000000000 --- a/.github/workflows/__analyze-ref-input.yml +++ /dev/null @@ -1,97 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: "PR Check - Analyze: 'ref' and 'sha' from inputs" -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: analyze-ref-input-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - analyze-ref-input: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: default - name: "Analyze: 'ref' and 'sha' from inputs" - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - languages: cpp,csharp,java,javascript,python - config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - with: - ref: 'refs/heads/main' - sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__autobuild-action.yml b/.github/workflows/__autobuild-action.yml deleted file mode 100644 index 730a387f90..0000000000 --- a/.github/workflows/__autobuild-action.yml +++ /dev/null @@ -1,96 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - autobuild-action -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: autobuild-action-${{github.ref}}-${{inputs.dotnet-version}} -jobs: - autobuild-action: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: macos-latest - version: linked - - os: windows-latest - version: linked - name: autobuild-action - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: csharp - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/autobuild - env: - # Explicitly disable the CLR tracer. - COR_ENABLE_PROFILING: '' - COR_PROFILER: '' - COR_PROFILER_PATH_64: '' - CORECLR_ENABLE_PROFILING: '' - CORECLR_PROFILER: '' - CORECLR_PROFILER_PATH_64: '' - - uses: ./../action/analyze - - name: Check database - run: | - cd "$RUNNER_TEMP/codeql_databases" - if [[ ! -d csharp ]]; then - echo "Did not find a C# database" - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml deleted file mode 100644 index b527638feb..0000000000 --- a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml +++ /dev/null @@ -1,101 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Autobuild direct tracing (custom working directory) -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - java-version: - type: string - description: The version of Java to install - required: false - default: '17' - workflow_call: - inputs: - java-version: - type: string - description: The version of Java to install - required: false - default: '17' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: autobuild-direct-tracing-with-working-dir-${{github.ref}}-${{inputs.java-version}} -jobs: - autobuild-direct-tracing-with-working-dir: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: windows-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - - os: windows-latest - version: nightly-latest - name: Autobuild direct tracing (custom working directory) - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Java - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 - with: - java-version: ${{ inputs.java-version || '17' }} - distribution: temurin - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Test setup - run: | - # Make sure that Gradle build succeeds in autobuild-dir ... - cp -a ../action/tests/java-repo autobuild-dir - # ... and fails if attempted in the current directory - echo > build.gradle - - uses: ./../action/init - with: - build-mode: autobuild - languages: java - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Check that indirect tracing is disabled - run: | - if [[ ! -z "${CODEQL_RUNNER}" ]]; then - echo "Expected indirect tracing to be disabled, but the" \ - "CODEQL_RUNNER environment variable is set." - exit 1 - fi - - uses: ./../action/autobuild - with: - working-directory: autobuild-dir - - uses: ./../action/analyze - env: - CODEQL_ACTION_AUTOBUILD_BUILD_MODE_DIRECT_TRACING: true - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__autobuild-working-dir.yml b/.github/workflows/__autobuild-working-dir.yml deleted file mode 100644 index fac4ef9f54..0000000000 --- a/.github/workflows/__autobuild-working-dir.yml +++ /dev/null @@ -1,78 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Autobuild working directory -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: autobuild-working-dir-${{github.ref}} -jobs: - autobuild-working-dir: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - name: Autobuild working directory - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Test setup - run: | - # Make sure that Gradle build succeeds in autobuild-dir ... - cp -a ../action/tests/java-repo autobuild-dir - # ... and fails if attempted in the current directory - echo > build.gradle - - uses: ./../action/init - with: - languages: java - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/autobuild - with: - working-directory: autobuild-dir - - uses: ./../action/analyze - - name: Check database - run: | - cd "$RUNNER_TEMP/codeql_databases" - if [[ ! -d java ]]; then - echo "Did not find a Java database" - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__build-mode-autobuild.yml b/.github/workflows/__build-mode-autobuild.yml deleted file mode 100644 index 5043433ee3..0000000000 --- a/.github/workflows/__build-mode-autobuild.yml +++ /dev/null @@ -1,118 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Build mode autobuild -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - java-version: - type: string - description: The version of Java to install - required: false - default: '17' - workflow_call: - inputs: - java-version: - type: string - description: The version of Java to install - required: false - default: '17' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: build-mode-autobuild-${{github.ref}}-${{inputs.java-version}} -jobs: - build-mode-autobuild: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: windows-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - - os: windows-latest - version: nightly-latest - name: Build mode autobuild - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Java - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 - with: - java-version: ${{ inputs.java-version || '17' }} - distribution: temurin - - name: Install yq - if: runner.os == 'Windows' - env: - YQ_PATH: ${{ runner.temp }}/yq - YQ_VERSION: v4.50.1 - run: |- - gh release download --repo mikefarah/yq --pattern "yq_windows_amd64.exe" "$YQ_VERSION" -O "$YQ_PATH/yq.exe" - echo "$YQ_PATH" >> "$GITHUB_PATH" - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Set up Java test repo configuration - run: | - mv * .github ../action/tests/multi-language-repo/ - mv ../action/tests/multi-language-repo/.github/workflows .github - mv ../action/tests/java-repo/* . - - - uses: ./../action/init - id: init - with: - build-mode: autobuild - db-location: '${{ runner.temp }}/customDbLocation' - languages: java - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Validate database build mode - run: | - metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml" - build_mode=$(yq eval '.buildMode' "$metadata_path") - if [[ "$build_mode" != "autobuild" ]]; then - echo "Expected build mode to be 'autobuild' but was $build_mode" - exit 1 - fi - - - name: Check that indirect tracing is disabled - run: | - if [[ ! -z "${CODEQL_RUNNER}" ]]; then - echo "Expected indirect tracing to be disabled, but the" \ - "CODEQL_RUNNER environment variable is set." - exit 1 - fi - - - uses: ./../action/analyze - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__build-mode-manual.yml b/.github/workflows/__build-mode-manual.yml deleted file mode 100644 index bfe92c55ea..0000000000 --- a/.github/workflows/__build-mode-manual.yml +++ /dev/null @@ -1,107 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Build mode manual -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: build-mode-manual-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - build-mode-manual: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: nightly-latest - name: Build mode manual - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - build-mode: manual - db-location: '${{ runner.temp }}/customDbLocation' - languages: java - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Validate database build mode - run: | - metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml" - build_mode=$(yq eval '.buildMode' "$metadata_path") - if [[ "$build_mode" != "manual" ]]; then - echo "Expected build mode to be 'manual' but was $build_mode" - exit 1 - fi - - - name: Build code - run: ./build.sh - - - uses: ./../action/analyze - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__build-mode-none.yml b/.github/workflows/__build-mode-none.yml deleted file mode 100644 index da7aa76383..0000000000 --- a/.github/workflows/__build-mode-none.yml +++ /dev/null @@ -1,81 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Build mode none -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: build-mode-none-${{github.ref}} -jobs: - build-mode-none: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: Build mode none - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - build-mode: none - db-location: '${{ runner.temp }}/customDbLocation' - languages: java - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Validate database build mode - run: | - metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml" - build_mode=$(yq eval '.buildMode' "$metadata_path") - if [[ "$build_mode" != "none" ]]; then - echo "Expected build mode to be 'none' but was $build_mode" - exit 1 - fi - - # The latest nightly supports omitting the autobuild Action when the build mode is specified. - - uses: ./../action/autobuild - if: matrix.version != 'nightly-latest' - - - uses: ./../action/analyze - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__build-mode-rollback.yml b/.github/workflows/__build-mode-rollback.yml deleted file mode 100644 index fcc77ea36e..0000000000 --- a/.github/workflows/__build-mode-rollback.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Build mode rollback -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: build-mode-rollback-${{github.ref}} -jobs: - build-mode-rollback: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: nightly-latest - name: Build mode rollback - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Set up Java test repo configuration - run: | - mv * .github ../action/tests/multi-language-repo/ - mv ../action/tests/multi-language-repo/.github/workflows .github - mv ../action/tests/java-repo/* . - - - uses: ./../action/init - id: init - with: - build-mode: none - db-location: '${{ runner.temp }}/customDbLocation' - languages: java - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Validate database build mode - run: | - metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml" - build_mode=$(yq eval '.buildMode' "$metadata_path") - if [[ "$build_mode" != "autobuild" ]]; then - echo "Expected build mode to be 'autobuild' but was $build_mode" - exit 1 - fi - - - uses: ./../action/analyze - env: - CODEQL_ACTION_DISABLE_JAVA_BUILDLESS: true - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__bundle-from-nightly.yml b/.github/workflows/__bundle-from-nightly.yml deleted file mode 100644 index 6c414fb67e..0000000000 --- a/.github/workflows/__bundle-from-nightly.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Bundle: From nightly' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: bundle-from-nightly-${{github.ref}} -jobs: - bundle-from-nightly: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - name: 'Bundle: From nightly' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - id: init - uses: ./../action/init - env: - CODEQL_ACTION_FORCE_NIGHTLY: true - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - languages: javascript - - name: Fail if the CodeQL version is not a nightly - if: ${{ !contains(steps.init.outputs.codeql-version, '+') }} - run: exit 1 - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__bundle-from-toolcache.yml b/.github/workflows/__bundle-from-toolcache.yml deleted file mode 100644 index a1c1fade09..0000000000 --- a/.github/workflows/__bundle-from-toolcache.yml +++ /dev/null @@ -1,83 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Bundle: From toolcache' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: bundle-from-toolcache-${{github.ref}} -jobs: - bundle-from-toolcache: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: toolcache - name: 'Bundle: From toolcache' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Install @actions/tool-cache - run: npm install @actions/tool-cache@3 - - name: Check toolcache contains CodeQL - continue-on-error: true - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const toolcache = require('@actions/tool-cache'); - const allCodeqlVersions = toolcache.findAllVersions('CodeQL'); - if (allCodeqlVersions.length === 0) { - throw new Error(`CodeQL could not be found in the toolcache`); - } - - id: setup-codeql - uses: ./../action/setup-codeql - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Check CodeQL is installed within the toolcache - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const toolcache = require('@actions/tool-cache'); - const allCodeqlVersions = toolcache.findAllVersions('CodeQL'); - console.log(`Found CodeQL versions: ${allCodeqlVersions}`); - if (allCodeqlVersions.length === 0) { - throw new Error('CodeQL not found in toolcache'); - } - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__bundle-toolcache.yml b/.github/workflows/__bundle-toolcache.yml deleted file mode 100644 index 9cc983a843..0000000000 --- a/.github/workflows/__bundle-toolcache.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Bundle: Caching checks' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: bundle-toolcache-${{github.ref}} -jobs: - bundle-toolcache: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: macos-latest - version: linked - - os: windows-latest - version: linked - name: 'Bundle: Caching checks' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Remove CodeQL from toolcache - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const fs = require('fs'); - const path = require('path'); - const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL'); - fs.rmdirSync(codeqlPath, { recursive: true }); - - name: Install @actions/tool-cache - run: npm install @actions/tool-cache@3 - - name: Check toolcache does not contain CodeQL - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const toolcache = require('@actions/tool-cache'); - const allCodeqlVersions = toolcache.findAllVersions('CodeQL'); - if (allCodeqlVersions.length !== 0) { - throw new Error(`CodeQL should not be found in the toolcache, but found ${allCodeqlVersions}`); - } - console.log('No versions of CodeQL found in the toolcache'); - - id: init - uses: ./../action/init - with: - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - with: - output: ${{ runner.temp }}/results - upload-database: false - - name: Check CodeQL is installed within the toolcache - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const toolcache = require('@actions/tool-cache'); - const allCodeqlVersions = toolcache.findAllVersions('CodeQL'); - console.log(`Found CodeQL versions: ${allCodeqlVersions}`); - if (allCodeqlVersions.length === 0) { - throw new Error('CodeQL not found in toolcache'); - } - if (allCodeqlVersions.length > 1) { - throw new Error('Multiple CodeQL versions found in toolcache'); - } - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__cleanup-db-cluster-dir.yml b/.github/workflows/__cleanup-db-cluster-dir.yml deleted file mode 100644 index 3153041401..0000000000 --- a/.github/workflows/__cleanup-db-cluster-dir.yml +++ /dev/null @@ -1,77 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Clean up database cluster directory -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: cleanup-db-cluster-dir-${{github.ref}} -jobs: - cleanup-db-cluster-dir: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - name: Clean up database cluster directory - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Add a file to the database cluster directory - run: | - mkdir -p "${{ runner.temp }}/customDbLocation/javascript" - touch "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" - - - uses: ./../action/init - id: init - with: - build-mode: none - db-location: '${{ runner.temp }}/customDbLocation' - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Validate file cleaned up - run: | - if [[ -f "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" ]]; then - echo "File was not cleaned up" - exit 1 - fi - echo "File was cleaned up" - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__config-export.yml b/.github/workflows/__config-export.yml deleted file mode 100644 index 0c7a2cc151..0000000000 --- a/.github/workflows/__config-export.yml +++ /dev/null @@ -1,100 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Config export -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: config-export-${{github.ref}} -jobs: - config-export: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: Config export - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: javascript - queries: security-extended - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - - name: Upload SARIF - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json - path: '${{ runner.temp }}/results/javascript.sarif' - retention-days: 7 - - name: Check config properties appear in SARIF - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - SARIF_PATH: '${{ runner.temp }}/results/javascript.sarif' - with: - script: | - const fs = require('fs'); - - const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8')); - const run = sarif.runs[0]; - const configSummary = run.properties.codeqlConfigSummary; - - if (configSummary === undefined) { - core.setFailed('`codeqlConfigSummary` property not found in the SARIF run property bag.'); - } - if (configSummary.disableDefaultQueries !== false) { - core.setFailed('`disableDefaultQueries` property incorrect: expected false, got ' + - `${JSON.stringify(configSummary.disableDefaultQueries)}.`); - } - const expectedQueries = [{ type: 'builtinSuite', uses: 'security-extended' }]; - // Use JSON.stringify to deep-equal the arrays. - if (JSON.stringify(configSummary.queries) !== JSON.stringify(expectedQueries)) { - core.setFailed(`\`queries\` property incorrect: expected ${JSON.stringify(expectedQueries)}, got ` + - `${JSON.stringify(configSummary.queries)}.`); - } - core.info('Finished config export tests.'); - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__config-input.yml b/.github/workflows/__config-input.yml deleted file mode 100644 index 4267e00584..0000000000 --- a/.github/workflows/__config-input.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Config input -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: config-input-${{github.ref}} -jobs: - config-input: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - name: Config input - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 20.x - cache: npm - - name: Install dependencies - run: npm ci - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Copy queries into workspace - run: | - cp -a ../action/queries . - - - uses: ./../action/init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - languages: javascript - build-mode: none - config: | - disable-default-queries: true - queries: - - name: Run custom query - uses: ./queries/default-setup-environment-variables.ql - paths-ignore: - - tests - - lib - - - uses: ./../action/analyze - with: - output: ${{ runner.temp }}/results - - - name: Check SARIF - uses: ./../action/.github/actions/check-sarif - with: - sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/codeql-action/default-setup-env-vars - queries-not-run: javascript/codeql-action/default-setup-context-properties - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__cpp-deptrace-disabled.yml b/.github/workflows/__cpp-deptrace-disabled.yml deleted file mode 100644 index e2434f4256..0000000000 --- a/.github/workflows/__cpp-deptrace-disabled.yml +++ /dev/null @@ -1,79 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - C/C++: disabling autoinstalling dependencies (Linux)' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: cpp-deptrace-disabled-${{github.ref}} -jobs: - cpp-deptrace-disabled: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: 'C/C++: disabling autoinstalling dependencies (Linux)' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Test setup - run: | - cp -a ../action/tests/cpp-autobuild autobuild-dir - - uses: ./../action/init - with: - languages: cpp - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/autobuild - with: - working-directory: autobuild-dir - env: - CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false - - run: | - if ls /usr/bin/errno; then - echo "C/C++ autobuild installed errno, but it should not have since auto-install dependencies is disabled." - exit 1 - fi - env: - DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml deleted file mode 100644 index 344ed8d1ea..0000000000 --- a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml +++ /dev/null @@ -1,79 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - C/C++: autoinstalling dependencies is skipped (macOS)' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: cpp-deptrace-enabled-on-macos-${{github.ref}} -jobs: - cpp-deptrace-enabled-on-macos: - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - version: linked - - os: macos-latest - version: nightly-latest - name: 'C/C++: autoinstalling dependencies is skipped (macOS)' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Test setup - run: | - cp -a ../action/tests/cpp-autobuild autobuild-dir - - uses: ./../action/init - with: - languages: cpp - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/autobuild - with: - working-directory: autobuild-dir - env: - CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true - - run: | - if ! ls /usr/bin/errno; then - echo "As expected, CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES is a no-op on macOS" - else - echo "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES should not have had any effect on macOS" - exit 1 - fi - env: - DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__cpp-deptrace-enabled.yml b/.github/workflows/__cpp-deptrace-enabled.yml deleted file mode 100644 index ab1a70584b..0000000000 --- a/.github/workflows/__cpp-deptrace-enabled.yml +++ /dev/null @@ -1,79 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - C/C++: autoinstalling dependencies (Linux)' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: cpp-deptrace-enabled-${{github.ref}} -jobs: - cpp-deptrace-enabled: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: 'C/C++: autoinstalling dependencies (Linux)' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Test setup - run: | - cp -a ../action/tests/cpp-autobuild autobuild-dir - - uses: ./../action/init - with: - languages: cpp - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/autobuild - with: - working-directory: autobuild-dir - env: - CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true - - run: | - if ! ls /usr/bin/errno; then - echo "Did not autoinstall errno" - exit 1 - fi - env: - DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__diagnostics-export.yml b/.github/workflows/__diagnostics-export.yml deleted file mode 100644 index c55f3de9b8..0000000000 --- a/.github/workflows/__diagnostics-export.yml +++ /dev/null @@ -1,136 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Diagnostic export -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: diagnostics-export-${{github.ref}} -jobs: - diagnostics-export: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: Diagnostic export - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Add test diagnostics - env: - CODEQL_PATH: ${{ steps.init.outputs.codeql-path }} - run: | - "$CODEQL_PATH" database add-diagnostic \ - "$RUNNER_TEMP/codeql_databases/javascript" \ - --file-path /path/to/file \ - --plaintext-message "Plaintext message" \ - --source-id "lang/diagnostics/example" \ - --source-name "Diagnostic name" \ - --ready-for-status-page - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - - name: Upload SARIF - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json - path: '${{ runner.temp }}/results/javascript.sarif' - retention-days: 7 - - name: Check diagnostics appear in SARIF - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - SARIF_PATH: '${{ runner.temp }}/results/javascript.sarif' - with: - script: | - const fs = require('fs'); - - function checkStatusPageNotification(n) { - const expectedMessage = 'Plaintext message'; - if (n.message.text !== expectedMessage) { - core.setFailed(`Expected the status page diagnostic to have the message '${expectedMessage}', but found '${n.message.text}'.`); - } - if (n.locations.length !== 1) { - core.setFailed(`Expected the status page diagnostic to have exactly 1 location, but found ${n.locations.length}.`); - } - } - - const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8')); - const run = sarif.runs[0]; - - const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications; - const statusPageNotifications = toolExecutionNotifications.filter(n => - n.descriptor.id === 'lang/diagnostics/example' && n.properties?.visibility?.statusPage - ); - if (statusPageNotifications.length !== 1) { - core.setFailed( - 'Expected exactly one status page reporting descriptor for this diagnostic in the ' + - `'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` + - `${statusPageNotifications.length}. All notification reporting descriptors: ` + - `${JSON.stringify(toolExecutionNotifications)}.` - ); - } - checkStatusPageNotification(statusPageNotifications[0]); - - const notifications = run.tool.driver.notifications; - const diagnosticNotification = notifications.filter(n => - n.id === 'lang/diagnostics/example' && n.name === 'lang/diagnostics/example' && - n.fullDescription.text === 'Diagnostic name' - ); - if (diagnosticNotification.length !== 1) { - core.setFailed( - 'Expected exactly one notification for this diagnostic in the ' + - `'runs[].tool.driver.notifications[]' SARIF property, but found ` + - `${diagnosticNotification.length}. All notifications: ` + - `${JSON.stringify(notifications)}.` - ); - } - - core.info('Finished diagnostic export test'); - env: - CODEQL_ACTION_EXPORT_DIAGNOSTICS: true - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml deleted file mode 100644 index 4ce8b40285..0000000000 --- a/.github/workflows/__export-file-baseline-information.yml +++ /dev/null @@ -1,127 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Export file baseline information -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: export-file-baseline-information-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - export-file-baseline-information: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: nightly-latest - - os: macos-latest - version: nightly-latest - - os: windows-latest - version: nightly-latest - name: Export file baseline information - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - - name: Upload SARIF - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json - path: '${{ runner.temp }}/results/javascript.sarif' - retention-days: 7 - - name: Check results - run: | - cd "$RUNNER_TEMP/results" - expected_baseline_languages="c csharp go java kotlin javascript python ruby" - if [[ $RUNNER_OS == "macOS" ]]; then - expected_baseline_languages+=" swift" - fi - - for lang in ${expected_baseline_languages}; do - rule_name="cli/expected-extracted-files/${lang}" - found_notification=$(jq --arg rule_name "${rule_name}" '[.runs[0].tool.driver.notifications | - select(. != null) | flatten | .[].id] | any(. == $rule_name)' javascript.sarif) - if [[ "${found_notification}" != "true" ]]; then - echo "Expected SARIF output to contain notification '${rule_name}', but found no such notification." - exit 1 - else - echo "Found notification '${rule_name}'." - fi - done - env: - CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS: false - CODEQL_ACTION_SUBLANGUAGE_FILE_COVERAGE: true - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__extractor-ram-threads.yml b/.github/workflows/__extractor-ram-threads.yml deleted file mode 100644 index 5bd5c8b940..0000000000 --- a/.github/workflows/__extractor-ram-threads.yml +++ /dev/null @@ -1,80 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Extractor ram and threads options test -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: extractor-ram-threads-${{github.ref}} -jobs: - extractor-ram-threads: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - name: Extractor ram and threads options test - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: java - ram: 230 - threads: 1 - - name: Assert Results - run: | - if [ "${CODEQL_RAM}" != "230" ]; then - echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230" - exit 1 - fi - if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then - echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230" - exit 1 - fi - if [ "${CODEQL_THREADS}" != "1" ]; then - echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1" - exit 1 - fi - if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then - echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1" - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__global-proxy.yml b/.github/workflows/__global-proxy.yml deleted file mode 100644 index 9244d1fc8f..0000000000 --- a/.github/workflows/__global-proxy.yml +++ /dev/null @@ -1,101 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Proxy test -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: global-proxy-${{github.ref}} -jobs: - global-proxy: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: Proxy test - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'false' - - name: Block direct internet access to force proxy usage - run: | - apt-get update -qq && apt-get install -y -qq iptables >/dev/null 2>&1 - PROXY_IP=$(getent hosts squid-proxy | awk '{ print $1 }') - echo "Squid proxy IP: $PROXY_IP" - # Allow all traffic to the proxy container - iptables -A OUTPUT -d "$PROXY_IP" -j ACCEPT - # Allow DNS resolution - iptables -A OUTPUT -p udp --dport 53 -j ACCEPT - iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT - # Allow loopback - iptables -A OUTPUT -o lo -j ACCEPT - # Allow already-established connections (from checkout/prepare-test) - iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT - # Block all other outbound HTTP and HTTPS, ensuring direct access fails - iptables -A OUTPUT -p tcp --dport 80 -j REJECT --reject-with tcp-reset - iptables -A OUTPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset - echo "Direct HTTP/HTTPS access is now blocked - all traffic must go through the proxy" - - - name: Set proxy environment variables - shell: bash - run: | - echo "http_proxy=http://squid-proxy:3128" >> $GITHUB_ENV - echo "HTTP_PROXY=http://squid-proxy:3128" >> $GITHUB_ENV - echo "https_proxy=http://squid-proxy:3128" >> $GITHUB_ENV - echo "HTTPS_PROXY=http://squid-proxy:3128" >> $GITHUB_ENV - - - uses: ./../action/init - with: - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - uses: ./../action/analyze - env: - CODEQL_ACTION_TOLERATE_MISSING_GIT_VERSION: true - CODEQL_ACTION_TEST_MODE: true - container: - image: ubuntu:22.04 - options: --cap-add=NET_ADMIN - services: - squid-proxy: - image: ubuntu/squid:latest - ports: - - 3128:3128 diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml deleted file mode 100644 index 7b4cd1305b..0000000000 --- a/.github/workflows/__go-custom-queries.yml +++ /dev/null @@ -1,97 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Go: Custom queries' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: go-custom-queries-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - go-custom-queries: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: 'Go: Custom queries' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: go - config-file: ./.github/codeql/custom-queries.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - env: - DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml deleted file mode 100644 index 968caf1e69..0000000000 --- a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml +++ /dev/null @@ -1,109 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Go: diagnostic when Go is changed after init step' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: go-indirect-tracing-workaround-diagnostic-${{github.ref}}-${{inputs.go-version}} -jobs: - go-indirect-tracing-workaround-diagnostic: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: default - name: 'Go: diagnostic when Go is changed after init step' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: go - tools: ${{ steps.prepare-test.outputs.tools-url }} - # Deliberately change Go after the `init` step - - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: '1.20' - - name: Build code - run: go build main.go - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - - name: Check diagnostic appears in SARIF - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - SARIF_PATH: '${{ runner.temp }}/results/go.sarif' - with: - script: | - const fs = require('fs'); - - const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8')); - const run = sarif.runs[0]; - - const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications; - const statusPageNotifications = toolExecutionNotifications.filter(n => - n.descriptor.id === 'go/workflow/go-installed-after-codeql-init' && n.properties?.visibility?.statusPage - ); - if (statusPageNotifications.length !== 1) { - core.setFailed( - 'Expected exactly one status page reporting descriptor for this diagnostic in the ' + - `'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` + - `${statusPageNotifications.length}. All notification reporting descriptors: ` + - `${JSON.stringify(toolExecutionNotifications)}.` - ); - } - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml deleted file mode 100644 index 0f13b1e663..0000000000 --- a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml +++ /dev/null @@ -1,110 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Go: diagnostic when `file` is not installed' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: go-indirect-tracing-workaround-no-file-program-${{github.ref}}-${{inputs.go-version}} -jobs: - go-indirect-tracing-workaround-no-file-program: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: default - name: 'Go: diagnostic when `file` is not installed' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Remove `file` program - run: | - echo $(which file) - sudo rm -rf $(which file) - echo $(which file) - - uses: ./../action/init - with: - languages: go - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: go build main.go - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - - name: Check diagnostic appears in SARIF - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - SARIF_PATH: '${{ runner.temp }}/results/go.sarif' - with: - script: | - const fs = require('fs'); - - const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8')); - const run = sarif.runs[0]; - - const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications; - const statusPageNotifications = toolExecutionNotifications.filter(n => - n.descriptor.id === 'go/workflow/file-program-unavailable' && n.properties?.visibility?.statusPage - ); - if (statusPageNotifications.length !== 1) { - core.setFailed( - 'Expected exactly one status page reporting descriptor for this diagnostic in the ' + - `'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` + - `${statusPageNotifications.length}. All notification reporting descriptors: ` + - `${JSON.stringify(toolExecutionNotifications)}.` - ); - } - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml deleted file mode 100644 index 915835c2ab..0000000000 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ /dev/null @@ -1,104 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Go: workaround for indirect tracing' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: go-indirect-tracing-workaround-${{github.ref}}-${{inputs.go-version}} -jobs: - go-indirect-tracing-workaround: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: default - name: 'Go: workaround for indirect tracing' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: go - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: go build main.go - - uses: ./../action/analyze - - run: | - if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then - echo "Expected the workaround for indirect tracing of static binaries to trigger, but the" \ - "CODEQL_ACTION_GO_BINARY environment variable is not set." - exit 1 - fi - if [[ ! -f "${CODEQL_ACTION_GO_BINARY}" ]]; then - echo "CODEQL_ACTION_GO_BINARY is set, but the corresponding script does not exist." - exit 1 - fi - - - # Once we start running Bash 4.2 in all environments, we can replace the - # `! -z` flag with the more elegant `-v` which confirms that the variable - # is actually unset and not potentially set to a blank value. - if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then - echo "Expected the Go autobuilder not to be run, but the" \ - "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set." - exit 1 - fi - cd "$RUNNER_TEMP/codeql_databases" - if [[ ! -d go ]]; then - echo "Did not find a Go database" - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml deleted file mode 100644 index ccbb1b5a6e..0000000000 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ /dev/null @@ -1,110 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Go: tracing with autobuilder step' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: go-tracing-autobuilder-${{github.ref}}-${{inputs.go-version}} -jobs: - go-tracing-autobuilder: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: stable-v2.19.4 - - os: ubuntu-latest - version: stable-v2.20.7 - - os: ubuntu-latest - version: stable-v2.21.4 - - os: ubuntu-latest - version: stable-v2.22.4 - - os: ubuntu-latest - version: stable-v2.23.9 - - os: ubuntu-latest - version: stable-v2.24.3 - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: linked - - os: macos-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - - os: macos-latest - version: nightly-latest - name: 'Go: tracing with autobuilder step' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: go - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/autobuild - - uses: ./../action/analyze - - run: | - if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then - echo "Expected the Go autobuilder to be run, but the" \ - "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was not true." - exit 1 - fi - cd "$RUNNER_TEMP/codeql_databases" - if [[ ! -d go ]]; then - echo "Did not find a Go database" - exit 1 - fi - env: - DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml deleted file mode 100644 index 2acc617cb1..0000000000 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ /dev/null @@ -1,113 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Go: tracing with custom build steps' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: go-tracing-custom-build-steps-${{github.ref}}-${{inputs.go-version}} -jobs: - go-tracing-custom-build-steps: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: stable-v2.19.4 - - os: ubuntu-latest - version: stable-v2.20.7 - - os: ubuntu-latest - version: stable-v2.21.4 - - os: ubuntu-latest - version: stable-v2.22.4 - - os: ubuntu-latest - version: stable-v2.23.9 - - os: ubuntu-latest - version: stable-v2.24.3 - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: linked - - os: macos-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - - os: macos-latest - version: nightly-latest - name: 'Go: tracing with custom build steps' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: go - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: go build main.go - - uses: ./../action/analyze - - run: | - # Once we start running Bash 4.2 in all environments, we can replace the - # `! -z` flag with the more elegant `-v` which confirms that the variable - # is actually unset and not potentially set to a blank value. - if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then - echo "Expected the Go autobuilder not to be run, but the" \ - "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set." - exit 1 - fi - cd "$RUNNER_TEMP/codeql_databases" - if [[ ! -d go ]]; then - echo "Did not find a Go database" - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml deleted file mode 100644 index a43705b703..0000000000 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ /dev/null @@ -1,104 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Go: tracing with legacy workflow' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: go-tracing-legacy-workflow-${{github.ref}}-${{inputs.go-version}} -jobs: - go-tracing-legacy-workflow: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: stable-v2.19.4 - - os: ubuntu-latest - version: stable-v2.20.7 - - os: ubuntu-latest - version: stable-v2.21.4 - - os: ubuntu-latest - version: stable-v2.22.4 - - os: ubuntu-latest - version: stable-v2.23.9 - - os: ubuntu-latest - version: stable-v2.24.3 - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: linked - - os: macos-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - - os: macos-latest - version: nightly-latest - name: 'Go: tracing with legacy workflow' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: go - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - - run: | - cd "$RUNNER_TEMP/codeql_databases" - if [[ ! -d go ]]; then - echo "Did not find a Go database" - exit 1 - fi - env: - DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go.yml b/.github/workflows/__go.yml deleted file mode 100644 index 3688dc6fd8..0000000000 --- a/.github/workflows/__go.yml +++ /dev/null @@ -1,80 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: Manual Check - go -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -jobs: - go-custom-queries: - name: 'Go: Custom queries' - permissions: - contents: read - security-events: read - uses: ./.github/workflows/__go-custom-queries.yml - with: - dotnet-version: ${{ inputs.dotnet-version }} - go-version: ${{ inputs.go-version }} - go-indirect-tracing-workaround-diagnostic: - name: 'Go: diagnostic when Go is changed after init step' - permissions: - contents: read - security-events: read - uses: ./.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml - with: - go-version: ${{ inputs.go-version }} - go-indirect-tracing-workaround-no-file-program: - name: 'Go: diagnostic when `file` is not installed' - permissions: - contents: read - security-events: read - uses: ./.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml - with: - go-version: ${{ inputs.go-version }} - go-indirect-tracing-workaround: - name: 'Go: workaround for indirect tracing' - permissions: - contents: read - security-events: read - uses: ./.github/workflows/__go-indirect-tracing-workaround.yml - with: - go-version: ${{ inputs.go-version }} - go-tracing-autobuilder: - name: 'Go: tracing with autobuilder step' - permissions: - contents: read - security-events: read - uses: ./.github/workflows/__go-tracing-autobuilder.yml - with: - go-version: ${{ inputs.go-version }} - go-tracing-custom-build-steps: - name: 'Go: tracing with custom build steps' - permissions: - contents: read - security-events: read - uses: ./.github/workflows/__go-tracing-custom-build-steps.yml - with: - go-version: ${{ inputs.go-version }} - go-tracing-legacy-workflow: - name: 'Go: tracing with legacy workflow' - permissions: - contents: read - security-events: read - uses: ./.github/workflows/__go-tracing-legacy-workflow.yml - with: - go-version: ${{ inputs.go-version }} diff --git a/.github/workflows/__init-with-registries.yml b/.github/workflows/__init-with-registries.yml deleted file mode 100644 index 9293dcc196..0000000000 --- a/.github/workflows/__init-with-registries.yml +++ /dev/null @@ -1,119 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Packaging: Download using registries' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: init-with-registries-${{github.ref}} -jobs: - init-with-registries: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: 'Packaging: Download using registries' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - packages: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Init with registries - uses: ./../action/init - with: - db-location: '${{ runner.temp }}/customDbLocation' - tools: ${{ steps.prepare-test.outputs.tools-url }} - config-file: ./.github/codeql/codeql-config-registries.yml - languages: javascript - registries: | - - url: "https://ghcr.io/v2/" - packages: "*/*" - token: "${{ secrets.GITHUB_TOKEN }}" - - - name: Verify packages installed - run: | - PRIVATE_PACK="$HOME/.codeql/packages/codeql-testing/private-pack" - CODEQL_PACK1="$HOME/.codeql/packages/codeql-testing/codeql-pack1" - - if [[ -d $PRIVATE_PACK ]] - then - echo "$PRIVATE_PACK was installed." - else - echo "::error $PRIVATE_PACK pack was not installed." - exit 1 - fi - - if [[ -d $CODEQL_PACK1 ]] - then - echo "$CODEQL_PACK1 was installed." - else - echo "::error $CODEQL_PACK1 pack was not installed." - exit 1 - fi - - - name: Verify qlconfig.yml file was created - run: | - QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml - echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH" - if [[ -f $QLCONFIG_PATH ]] - then - echo "qlconfig.yml file was created." - else - echo "::error qlconfig.yml file was not created." - exit 1 - fi - - - name: Verify contents of qlconfig.yml - run: | - QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml - cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")' - if [[ $? -eq 0 ]] - then - echo "Registry was added to qlconfig.yml file." - else - echo "::error Registry was not added to qlconfig.yml file." - echo "Contents of qlconfig.yml file:" - cat $QLCONFIG_PATH - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__javascript-source-root.yml b/.github/workflows/__javascript-source-root.yml deleted file mode 100644 index 1dcbd38a85..0000000000 --- a/.github/workflows/__javascript-source-root.yml +++ /dev/null @@ -1,80 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Custom source root -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: javascript-source-root-${{github.ref}} -jobs: - javascript-source-root: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: Custom source root - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Move codeql-action - run: | - mkdir ../new-source-root - mv * ../new-source-root - - uses: ./../action/init - with: - languages: javascript - source-root: ../new-source-root - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - with: - skip-queries: true - - name: Assert database exists - run: | - cd "$RUNNER_TEMP/codeql_databases" - if [[ ! -d javascript ]]; then - echo "Did not find a JavaScript database" - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__job-run-uuid-sarif.yml b/.github/workflows/__job-run-uuid-sarif.yml deleted file mode 100644 index 429a694947..0000000000 --- a/.github/workflows/__job-run-uuid-sarif.yml +++ /dev/null @@ -1,81 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Job run UUID added to SARIF -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: job-run-uuid-sarif-${{github.ref}} -jobs: - job-run-uuid-sarif: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: nightly-latest - name: Job run UUID added to SARIF - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - - name: Upload SARIF - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json - path: '${{ runner.temp }}/results/javascript.sarif' - retention-days: 7 - - name: Check results - run: | - cd "$RUNNER_TEMP/results" - actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif) - if [[ "$actual" != "$CODEQL_ACTION_JOB_RUN_UUID" ]]; then - echo "Expected SARIF output to contain job run UUID '$CODEQL_ACTION_JOB_RUN_UUID', but found '$actual'." - exit 1 - else - echo "Found job run UUID '$actual'." - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__language-aliases.yml b/.github/workflows/__language-aliases.yml deleted file mode 100644 index 731d975ce3..0000000000 --- a/.github/workflows/__language-aliases.yml +++ /dev/null @@ -1,72 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Language aliases -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: language-aliases-${{github.ref}} -jobs: - language-aliases: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - name: Language aliases - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: C#,java-kotlin,typescript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: 'Check languages' - run: | - expected_languages="csharp,java,javascript" - actual_languages=$(jq -r '.languages | join(",")' "$RUNNER_TEMP"/config) - - if [ "$expected_languages" != "$actual_languages" ]; then - echo "Resolved languages did not match expected list. " \ - "Expected languages: $expected_languages. Actual languages: $actual_languages." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__local-bundle.yml b/.github/workflows/__local-bundle.yml deleted file mode 100644 index 8e448080f3..0000000000 --- a/.github/workflows/__local-bundle.yml +++ /dev/null @@ -1,98 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Local CodeQL bundle -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: local-bundle-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - local-bundle: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - name: Local CodeQL bundle - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Fetch latest CodeQL bundle - run: | - wget https://github.com/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.zst - - id: init - uses: ./../action/init - with: - # Swift is not supported on Ubuntu so we manually exclude it from the list here - languages: cpp,csharp,go,java,javascript,python,ruby - tools: ./codeql-bundle-linux64.tar.zst - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml deleted file mode 100644 index 55023cd916..0000000000 --- a/.github/workflows/__multi-language-autodetect.yml +++ /dev/null @@ -1,195 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Multi-language repository -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: multi-language-autodetect-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - multi-language-autodetect: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: stable-v2.19.4 - - os: macos-15-xlarge - version: stable-v2.19.4 - - os: ubuntu-latest - version: stable-v2.20.7 - - os: macos-15-xlarge - version: stable-v2.20.7 - - os: ubuntu-latest - version: stable-v2.21.4 - - os: macos-15-xlarge - version: stable-v2.21.4 - - os: ubuntu-latest - version: stable-v2.22.4 - - os: macos-15-xlarge - version: stable-v2.22.4 - - os: ubuntu-latest - version: stable-v2.23.9 - - os: macos-latest-xlarge - version: stable-v2.23.9 - - os: ubuntu-latest - version: stable-v2.24.3 - - os: macos-latest-xlarge - version: stable-v2.24.3 - - os: ubuntu-latest - version: default - - os: macos-latest-xlarge - version: default - - os: ubuntu-latest - version: linked - - os: macos-latest-xlarge - version: linked - - os: ubuntu-latest - version: nightly-latest - - os: macos-latest-xlarge - version: nightly-latest - name: Multi-language repository - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Install Python 3.13 for older CLI versions - # We need Python 3.13 for older CLI versions because they are not compatible with Python 3.14 or newer. - # See https://github.com/github/codeql-action/pull/3212 - if: matrix.version != 'nightly-latest' && matrix.version != 'linked' - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: '3.13' - - - name: Use Xcode 16 - # Only the older CodeQL CLI versions need Xcode 16, and these run on macOS 15. - if: matrix.os == 'macos-15-xlarge' - run: sudo xcode-select -s "/Applications/Xcode_16.app" - - - uses: ./../action/init - id: init - with: - db-location: '${{ runner.temp }}/customDbLocation' - languages: ${{ runner.os == 'Linux' && 'cpp,csharp,go,java,javascript,python,ruby' || '' }} - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Build code - run: ./build.sh - - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - - - name: Check language autodetect for all languages excluding Swift - run: | - CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }} - if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then - echo "Did not create a database for CPP, or created it in the wrong location." - exit 1 - fi - CSHARP_DB=${{ fromJson(steps.analysis.outputs.db-locations).csharp }} - if [[ ! -d $CSHARP_DB ]] || [[ ! $CSHARP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then - echo "Did not create a database for C Sharp, or created it in the wrong location." - exit 1 - fi - GO_DB=${{ fromJson(steps.analysis.outputs.db-locations).go }} - if [[ ! -d $GO_DB ]] || [[ ! $GO_DB == ${{ runner.temp }}/customDbLocation/* ]]; then - echo "Did not create a database for Go, or created it in the wrong location." - exit 1 - fi - JAVA_DB=${{ fromJson(steps.analysis.outputs.db-locations).java }} - if [[ ! -d $JAVA_DB ]] || [[ ! $JAVA_DB == ${{ runner.temp }}/customDbLocation/* ]]; then - echo "Did not create a database for Java, or created it in the wrong location." - exit 1 - fi - JAVASCRIPT_DB=${{ fromJson(steps.analysis.outputs.db-locations).javascript }} - if [[ ! -d $JAVASCRIPT_DB ]] || [[ ! $JAVASCRIPT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then - echo "Did not create a database for Javascript, or created it in the wrong location." - exit 1 - fi - PYTHON_DB=${{ fromJson(steps.analysis.outputs.db-locations).python }} - if [[ ! -d $PYTHON_DB ]] || [[ ! $PYTHON_DB == ${{ runner.temp }}/customDbLocation/* ]]; then - echo "Did not create a database for Python, or created it in the wrong location." - exit 1 - fi - RUBY_DB=${{ fromJson(steps.analysis.outputs.db-locations).ruby }} - if [[ ! -d $RUBY_DB ]] || [[ ! $RUBY_DB == ${{ runner.temp }}/customDbLocation/* ]]; then - echo "Did not create a database for Ruby, or created it in the wrong location." - exit 1 - fi - - - name: Check language autodetect for Swift on macOS - if: runner.os == 'macOS' - run: | - SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} - if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then - echo "Did not create a database for Swift, or created it in the wrong location." - exit 1 - fi - env: - CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI: true - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__overlay-init-fallback.yml b/.github/workflows/__overlay-init-fallback.yml deleted file mode 100644 index b6c99efcef..0000000000 --- a/.github/workflows/__overlay-init-fallback.yml +++ /dev/null @@ -1,76 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Overlay database init fallback -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: overlay-init-fallback-${{github.ref}} -jobs: - overlay-init-fallback: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: Overlay database init fallback - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: actions # Any language without overlay support will do - tools: ${{ steps.prepare-test.outputs.tools-url }} - env: - CODEQL_OVERLAY_DATABASE_MODE: overlay-base - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - - name: Check database - run: | - cd "$RUNNER_TEMP/codeql_databases/actions" - if ! grep -q 'overlayBaseDatabase: false' codeql-database.yml ; then - echo "This test needs to be updated to use a non-overlay language." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml deleted file mode 100644 index 409e0a1a65..0000000000 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ /dev/null @@ -1,130 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Packaging: Config and input passed to the CLI' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: packaging-codescanning-config-inputs-js-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - packaging-codescanning-config-inputs-js: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: 'Packaging: Config and input passed to the CLI' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 20.x - cache: npm - - name: Install dependencies - run: npm ci - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - config-file: '.github/codeql/codeql-config-packaging3.yml' - packs: +codeql-testing/codeql-pack1@1.0.0 - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - - - name: Check results - uses: ./../action/.github/actions/check-sarif - with: - sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block - queries-not-run: foo,bar - - - name: Assert Results - run: | - cd "$RUNNER_TEMP/results" - # We should have 4 hits from these rules - EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block" - - # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace - RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)" - echo "Found matching rules '$RULES'" - if [ "$RULES" != "$EXPECTED_RULES" ]; then - echo "Did not match expected rules '$EXPECTED_RULES'." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml deleted file mode 100644 index 34d4ae1bca..0000000000 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ /dev/null @@ -1,130 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Packaging: Config and input' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: packaging-config-inputs-js-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - packaging-config-inputs-js: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: 'Packaging: Config and input' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 20.x - cache: npm - - name: Install dependencies - run: npm ci - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - config-file: '.github/codeql/codeql-config-packaging3.yml' - packs: +codeql-testing/codeql-pack1@1.0.0 - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - - - name: Check results - uses: ./../action/.github/actions/check-sarif - with: - sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block - queries-not-run: foo,bar - - - name: Assert Results - run: | - cd "$RUNNER_TEMP/results" - # We should have 4 hits from these rules - EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block" - - # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace - RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)" - echo "Found matching rules '$RULES'" - if [ "$RULES" != "$EXPECTED_RULES" ]; then - echo "Did not match expected rules '$EXPECTED_RULES'." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml deleted file mode 100644 index 88426cd684..0000000000 --- a/.github/workflows/__packaging-config-js.yml +++ /dev/null @@ -1,129 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Packaging: Config file' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: packaging-config-js-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - packaging-config-js: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: 'Packaging: Config file' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 20.x - cache: npm - - name: Install dependencies - run: npm ci - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - config-file: '.github/codeql/codeql-config-packaging.yml' - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - - - name: Check results - uses: ./../action/.github/actions/check-sarif - with: - sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block - queries-not-run: foo,bar - - - name: Assert Results - run: | - cd "$RUNNER_TEMP/results" - # We should have 4 hits from these rules - EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block" - - # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace - RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)" - echo "Found matching rules '$RULES'" - if [ "$RULES" != "$EXPECTED_RULES" ]; then - echo "Did not match expected rules '$EXPECTED_RULES'." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml deleted file mode 100644 index 2461944dbd..0000000000 --- a/.github/workflows/__packaging-inputs-js.yml +++ /dev/null @@ -1,129 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: 'PR Check - Packaging: Action input' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: packaging-inputs-js-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - packaging-inputs-js: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: 'Packaging: Action input' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 20.x - cache: npm - - name: Install dependencies - run: npm ci - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - config-file: '.github/codeql/codeql-config-packaging2.yml' - languages: javascript - packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2, codeql-testing/codeql-pack3:other-query.ql - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - - - name: Check results - uses: ./../action/.github/actions/check-sarif - with: - sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block - queries-not-run: foo,bar - - - name: Assert Results - run: | - cd "$RUNNER_TEMP/results" - # We should have 4 hits from these rules - EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block" - - # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace - RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)" - echo "Found matching rules '$RULES'" - if [ "$RULES" != "$EXPECTED_RULES" ]; then - echo "Did not match expected rules '$EXPECTED_RULES'." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__remote-config.yml b/.github/workflows/__remote-config.yml deleted file mode 100644 index e1c3785f6a..0000000000 --- a/.github/workflows/__remote-config.yml +++ /dev/null @@ -1,96 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Remote config file -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: remote-config-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - remote-config: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: Remote config file - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - languages: cpp,csharp,java,javascript,python - config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__resolve-environment-action.yml b/.github/workflows/__resolve-environment-action.yml deleted file mode 100644 index 11a31fdabc..0000000000 --- a/.github/workflows/__resolve-environment-action.yml +++ /dev/null @@ -1,85 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Resolve environment -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: resolve-environment-action-${{github.ref}} -jobs: - resolve-environment-action: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: Resolve environment - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: go,javascript-typescript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Resolve environment for Go - uses: ./../action/resolve-environment - id: resolve-environment-go - with: - language: go - - - name: Fail if Go configuration missing - if: (!fromJSON(steps.resolve-environment-go.outputs.environment).configuration.go) - run: exit 1 - - - name: Resolve environment for JavaScript/TypeScript - uses: ./../action/resolve-environment - id: resolve-environment-js - with: - language: javascript-typescript - - - name: Fail if JavaScript/TypeScript configuration present - if: fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript - run: exit 1 - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__rubocop-multi-language.yml b/.github/workflows/__rubocop-multi-language.yml deleted file mode 100644 index c405b44fed..0000000000 --- a/.github/workflows/__rubocop-multi-language.yml +++ /dev/null @@ -1,74 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - RuboCop multi-language -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: rubocop-multi-language-${{github.ref}} -jobs: - rubocop-multi-language: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: default - name: RuboCop multi-language - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Set up Ruby - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0 - with: - ruby-version: 2.6 - - name: Install Code Scanning integration - run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install - - name: Install dependencies - run: bundle install - - name: RuboCop run - run: | - bash -c " - bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif - [[ $? -ne 2 ]] - " - - uses: ./../action/upload-sarif - with: - sarif_file: rubocop.sarif - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__ruby.yml b/.github/workflows/__ruby.yml deleted file mode 100644 index 98f8ec6a2a..0000000000 --- a/.github/workflows/__ruby.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Ruby analysis -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ruby-${{github.ref}} -jobs: - ruby: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: macos-latest - version: linked - - os: ubuntu-latest - version: default - - os: macos-latest - version: default - - os: ubuntu-latest - version: nightly-latest - - os: macos-latest - version: nightly-latest - name: Ruby analysis - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: ruby - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - - name: Check database - run: | - RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}" - if [[ ! -d "$RUBY_DB" ]]; then - echo "Did not create a database for Ruby." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__rust.yml b/.github/workflows/__rust.yml deleted file mode 100644 index b3638ca6df..0000000000 --- a/.github/workflows/__rust.yml +++ /dev/null @@ -1,80 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Rust analysis -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: rust-${{github.ref}} -jobs: - rust: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: stable-v2.19.4 - - os: ubuntu-latest - version: stable-v2.22.1 - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: Rust analysis - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - languages: rust - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - - name: Check database - run: | - RUST_DB="${{ fromJson(steps.analysis.outputs.db-locations).rust }}" - if [[ ! -d "$RUST_DB" ]]; then - echo "Did not create a database for Rust." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__split-workflow.yml b/.github/workflows/__split-workflow.yml deleted file mode 100644 index 512058a598..0000000000 --- a/.github/workflows/__split-workflow.yml +++ /dev/null @@ -1,133 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Split workflow -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: split-workflow-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - split-workflow: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: macos-latest - version: linked - - os: ubuntu-latest - version: default - - os: macos-latest - version: default - - os: ubuntu-latest - version: nightly-latest - - os: macos-latest - version: nightly-latest - name: Split workflow - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - config-file: '.github/codeql/codeql-config-packaging3.yml' - packs: +codeql-testing/codeql-pack1@1.0.0 - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - with: - skip-queries: true - output: '${{ runner.temp }}/results' - upload-database: false - - - name: Assert No Results - run: | - if [ "$(ls -A $RUNNER_TEMP/results)" ]; then - echo "Expected results directory to be empty after skipping query execution!" - exit 1 - fi - - uses: ./../action/analyze - with: - output: '${{ runner.temp }}/results' - upload-database: false - - name: Assert Results - run: | - cd "$RUNNER_TEMP/results" - # We should have 4 hits from these rules - EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block" - - # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace - RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)" - echo "Found matching rules '$RULES'" - if [ "$RULES" != "$EXPECTED_RULES" ]; then - echo "Did not match expected rules '$EXPECTED_RULES'." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__start-proxy.yml b/.github/workflows/__start-proxy.yml deleted file mode 100644 index edc6aa1cc5..0000000000 --- a/.github/workflows/__start-proxy.yml +++ /dev/null @@ -1,105 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Start proxy -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: start-proxy-${{github.ref}} -jobs: - start-proxy: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: macos-latest - version: linked - - os: windows-latest - version: linked - name: Start proxy - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Setup proxy for registries - id: proxy - uses: ./../action/start-proxy - with: - language: java - registry_secrets: | - [ - { - "type": "maven_repository", - "url": "https://repo.maven.apache.org/maven2/" - }, - { - "type": "maven_repository", - "url": "https://repo1.maven.org/maven2" - } - ] - - - name: Print proxy outputs - run: | - echo "${{ steps.proxy.outputs.proxy_host }}" - echo "${{ steps.proxy.outputs.proxy_port }}" - echo "${{ steps.proxy.outputs.proxy_urls }}" - - - name: Fail if proxy outputs are not set - if: (!steps.proxy.outputs.proxy_host) || (!steps.proxy.outputs.proxy_port) || (!steps.proxy.outputs.proxy_ca_certificate) || (!steps.proxy.outputs.proxy_urls) - run: exit 1 - - - name: Fail if proxy_urls does not contain all registries - if: | - join(fromJSON(steps.proxy.outputs.proxy_urls)[*].type, ',') != 'maven_repository,maven_repository' - || !contains(steps.proxy.outputs.proxy_urls, 'https://repo.maven.apache.org/maven2/') - || !contains(steps.proxy.outputs.proxy_urls, 'https://repo1.maven.org/maven2') - run: exit 1 - - - uses: ./../action/init - env: - CODEQL_PROXY_HOST: ${{ steps.proxy.outputs.proxy_host }} - CODEQL_PROXY_PORT: ${{ steps.proxy.outputs.proxy_port }} - CODEQL_PROXY_CA_CERTIFICATE: ${{ steps.proxy.outputs.proxy_ca_certificate }} - with: - languages: java - tools: ${{ steps.prepare-test.outputs.tools-url }} - config-file: codeql-action@main:tests/multi-language-repo/.github/codeql/custom-queries.yml - env: - CODEQL_ACTION_PROXY_API_REQUESTS: 'true' - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__submit-sarif-failure.yml b/.github/workflows/__submit-sarif-failure.yml deleted file mode 100644 index 099e93001f..0000000000 --- a/.github/workflows/__submit-sarif-failure.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Submit SARIF after failure -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: submit-sarif-failure-${{github.ref}} -jobs: - submit-sarif-failure: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - name: Submit SARIF after failure - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: write - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: ./init - with: - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Fail - # We want this job to pass if the Action correctly uploads the SARIF file for - # the failed run. - # Setting this step to continue on error means that it is marked as completing - # successfully, so will not fail the job. - continue-on-error: true - run: exit 1 - - uses: ./analyze - # In a real workflow, this step wouldn't run. Since we used `continue-on-error` - # above, we manually disable it with an `if` condition. - if: false - with: - category: '/test-codeql-version:${{ matrix.version }}' - env: - CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF: true - CODEQL_ACTION_UPLOAD_FAILED_SARIF: true - CODEQL_ACTION_TEST_MODE: false - CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml deleted file mode 100644 index 52c189f3a8..0000000000 --- a/.github/workflows/__swift-autobuild.yml +++ /dev/null @@ -1,78 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Swift analysis using autobuild -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: swift-autobuild-${{github.ref}} -jobs: - swift-autobuild: - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest-xlarge - version: nightly-latest - name: Swift analysis using autobuild - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - languages: swift - build-mode: autobuild - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Check working directory - run: pwd - - uses: ./../action/autobuild - timeout-minutes: 30 - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - - name: Check database - run: | - SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}" - if [[ ! -d "$SWIFT_DB" ]]; then - echo "Did not create a database for Swift." - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml deleted file mode 100644 index 99fbf7a897..0000000000 --- a/.github/workflows/__swift-custom-build.yml +++ /dev/null @@ -1,111 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Swift analysis using a custom build command -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: swift-custom-build-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - swift-custom-build: - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - version: linked - - os: macos-latest - version: default - - os: macos-latest - version: nightly-latest - name: Swift analysis using a custom build command - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - languages: swift - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Check working directory - run: pwd - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - - name: Check database - run: | - SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}" - if [[ ! -d "$SWIFT_DB" ]]; then - echo "Did not create a database for Swift." - exit 1 - fi - env: - DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__unset-environment.yml b/.github/workflows/__unset-environment.yml deleted file mode 100644 index 8a8796d9a7..0000000000 --- a/.github/workflows/__unset-environment.yml +++ /dev/null @@ -1,138 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Test unsetting environment variables -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: unset-environment-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - unset-environment: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: Test unsetting environment variables - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - db-location: ${{ runner.temp }}/customDbLocation - # Swift is not supported on Ubuntu so we manually exclude it from the list here - languages: cpp,csharp,go,java,javascript,python,ruby - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: env -i PATH="$PATH" HOME="$HOME" ./build.sh - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - - run: | - CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}" - if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then - echo "::error::Did not create a database for CPP, or created it in the wrong location." \ - "Expected location was '${RUNNER_TEMP}/customDbLocation/cpp' but actual was '${CPP_DB}'" - exit 1 - fi - CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}" - if [[ ! -d "$CSHARP_DB" ]] || [[ ! "$CSHARP_DB" == "${RUNNER_TEMP}/customDbLocation/csharp" ]]; then - echo "::error::Did not create a database for C Sharp, or created it in the wrong location." \ - "Expected location was '${RUNNER_TEMP}/customDbLocation/csharp' but actual was '${CSHARP_DB}'" - exit 1 - fi - GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}" - if [[ ! -d "$GO_DB" ]] || [[ ! "$GO_DB" == "${RUNNER_TEMP}/customDbLocation/go" ]]; then - echo "::error::Did not create a database for Go, or created it in the wrong location." \ - "Expected location was '${RUNNER_TEMP}/customDbLocation/go' but actual was '${GO_DB}'" - exit 1 - fi - JAVA_DB="${{ fromJson(steps.analysis.outputs.db-locations).java }}" - if [[ ! -d "$JAVA_DB" ]] || [[ ! "$JAVA_DB" == "${RUNNER_TEMP}/customDbLocation/java" ]]; then - echo "::error::Did not create a database for Java, or created it in the wrong location." \ - "Expected location was '${RUNNER_TEMP}/customDbLocation/java' but actual was '${JAVA_DB}'" - exit 1 - fi - JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}" - if [[ ! -d "$JAVASCRIPT_DB" ]] || [[ ! "$JAVASCRIPT_DB" == "${RUNNER_TEMP}/customDbLocation/javascript" ]]; then - echo "::error::Did not create a database for Javascript, or created it in the wrong location." \ - "Expected location was '${RUNNER_TEMP}/customDbLocation/javascript' but actual was '${JAVASCRIPT_DB}'" - exit 1 - fi - PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}" - if [[ ! -d "$PYTHON_DB" ]] || [[ ! "$PYTHON_DB" == "${RUNNER_TEMP}/customDbLocation/python" ]]; then - echo "::error::Did not create a database for Python, or created it in the wrong location." \ - "Expected location was '${RUNNER_TEMP}/customDbLocation/python' but actual was '${PYTHON_DB}'" - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml deleted file mode 100644 index 76e8f4e3c0..0000000000 --- a/.github/workflows/__upload-ref-sha-input.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: "PR Check - Upload-sarif: 'ref' and 'sha' from inputs" -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: upload-ref-sha-input-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - upload-ref-sha-input: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: default - name: "Upload-sarif: 'ref' and 'sha' from inputs" - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - languages: cpp,csharp,java,javascript,python - config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }} - - name: Build code - run: ./build.sh - # Generate some SARIF we can upload with the upload-sarif step - - uses: ./../action/analyze - with: - ref: 'refs/heads/main' - sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - upload: never - - uses: ./../action/upload-sarif - with: - ref: 'refs/heads/main' - sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__upload-sarif.yml b/.github/workflows/__upload-sarif.yml deleted file mode 100644 index 77fa0264e5..0000000000 --- a/.github/workflows/__upload-sarif.yml +++ /dev/null @@ -1,168 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Test different uses of `upload-sarif` -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: upload-sarif-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - upload-sarif: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: default - analysis-kinds: code-scanning - - os: ubuntu-latest - version: default - analysis-kinds: code-quality - - os: ubuntu-latest - version: default - analysis-kinds: code-scanning,code-quality - name: Test different uses of `upload-sarif` - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - languages: csharp,java,javascript,python - analysis-kinds: ${{ matrix.analysis-kinds }} - - name: Build code - run: ./build.sh - # Generate some SARIF we can upload with the upload-sarif step - - uses: ./../action/analyze - with: - ref: 'refs/heads/main' - sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - upload: never - output: ${{ runner.temp }}/results - - - name: | - Upload all SARIF files for `analysis-kinds: ${{ matrix.analysis-kinds }}` - uses: ./../action/upload-sarif - id: upload-sarif - with: - ref: 'refs/heads/main' - sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - sarif_file: ${{ runner.temp }}/results - category: | - ${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:all-files/ - - name: 'Fail for missing output from `upload-sarif` step for `code-scanning`' - if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-scanning) - run: exit 1 - - name: 'Fail for missing output from `upload-sarif` step for `code-quality`' - if: contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality) - run: exit 1 - - - name: Upload single SARIF file for Code Scanning - uses: ./../action/upload-sarif - id: upload-single-sarif-code-scanning - if: contains(matrix.analysis-kinds, 'code-scanning') - with: - ref: 'refs/heads/main' - sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - sarif_file: ${{ runner.temp }}/results/javascript.sarif - category: | - ${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-scanning/ - - name: 'Fail for missing output from `upload-single-sarif-code-scanning` step' - if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-sarif-code-scanning.outputs.sarif-ids).code-scanning) - run: exit 1 - - name: Upload single SARIF file for Code Quality - uses: ./../action/upload-sarif - id: upload-single-sarif-code-quality - if: contains(matrix.analysis-kinds, 'code-quality') - with: - ref: 'refs/heads/main' - sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - sarif_file: ${{ runner.temp }}/results/javascript.quality.sarif - category: | - ${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-quality/ - - name: 'Fail for missing output from `upload-single-sarif-code-quality` step' - if: contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-single-sarif-code-quality.outputs.sarif-ids).code-quality) - run: exit 1 - - - name: Change SARIF file extension - if: contains(matrix.analysis-kinds, 'code-scanning') - run: mv ${{ runner.temp }}/results/javascript.sarif ${{ runner.temp }}/results/javascript.sarif.json - - name: Upload single non-`.sarif` file - uses: ./../action/upload-sarif - id: upload-single-non-sarif - if: contains(matrix.analysis-kinds, 'code-scanning') - with: - ref: 'refs/heads/main' - sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - sarif_file: ${{ runner.temp }}/results/javascript.sarif.json - category: | - ${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:non-sarif/ - - name: 'Fail for missing output from `upload-single-non-sarif` step' - if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-non-sarif.outputs.sarif-ids).code-scanning) - run: exit 1 - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml deleted file mode 100644 index 59a8edc9d1..0000000000 --- a/.github/workflows/__with-checkout-path.yml +++ /dev/null @@ -1,146 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - Use a custom `checkout_path` -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: {} - merge_group: - types: - - checks_requested - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - workflow_call: - inputs: - dotnet-version: - type: string - description: The version of .NET to install - required: false - default: 9.x - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: with-checkout-path-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} -jobs: - with-checkout-path: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - name: Use a custom `checkout_path` - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - # This ensures we don't accidentally use the original checkout for any part of the test. - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - name: Delete original checkout - run: | - # delete the original checkout so we don't accidentally use it. - # Actions does not support deleting the current working directory, so we - # delete the contents of the directory instead. - rm -rf ./* .github .git - # Check out the actions repo again, but at a different location. - # choose an arbitrary SHA so that we can later test that the commit_oid is not from main - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6 - path: x/y/z/some-path - - - uses: ./../action/init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - # it's enough to test one compiled language and one interpreted language - languages: csharp,javascript - source-root: x/y/z/some-path/tests/multi-language-repo - - - name: Build code - working-directory: x/y/z/some-path/tests/multi-language-repo - run: | - ./build.sh - - - uses: ./../action/analyze - with: - checkout_path: x/y/z/some-path/tests/multi-language-repo - ref: v1.1.0 - sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6 - - - name: Verify SARIF after upload - run: | - PAYLOAD_FILE="$RUNNER_TEMP/payload-code-scanning.json" - EXPECTED_COMMIT_OID="474bbf07f9247ffe1856c6a0f94aeeb10e7afee6" - EXPECTED_REF="v1.1.0" - EXPECTED_CHECKOUT_URI_SUFFIX="/x/y/z/some-path/tests/multi-language-repo" - - ACTUAL_COMMIT_OID="$(cat "$PAYLOAD_FILE" | jq -r .commit_oid)" - ACTUAL_REF="$(cat "$PAYLOAD_FILE" | jq -r .ref)" - ACTUAL_CHECKOUT_URI="$(cat "$PAYLOAD_FILE" | jq -r .checkout_uri)" - - if [[ "$EXPECTED_COMMIT_OID" != "$ACTUAL_COMMIT_OID" ]]; then - echo "::error Invalid commit oid. Expected: $EXPECTED_COMMIT_OID Actual: $ACTUAL_COMMIT_OID" - echo "$PAYLOAD_FILE" - exit 1 - fi - - if [[ "$EXPECTED_REF" != "$ACTUAL_REF" ]]; then - echo "::error Invalid ref. Expected: '$EXPECTED_REF' Actual: '$ACTUAL_REF'" - echo "$PAYLOAD_FILE" - exit 1 - fi - - if [[ "$ACTUAL_CHECKOUT_URI" != *$EXPECTED_CHECKOUT_URI_SUFFIX ]]; then - echo "::error Invalid checkout URI suffix. Expected suffix: $EXPECTED_CHECKOUT_URI_SUFFIX Actual uri: $ACTUAL_CHECKOUT_URI" - echo "$PAYLOAD_FILE" - exit 1 - fi - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/check-expected-release-files.yml b/.github/workflows/check-expected-release-files.yml deleted file mode 100644 index 6cabd0454b..0000000000 --- a/.github/workflows/check-expected-release-files.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Check Expected Release Files - -on: - pull_request: - paths: - - .github/workflows/check-expected-release-files.yml - - src/defaults.json - -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ${{ github.workflow }}-${{ github.ref }} - -defaults: - run: - shell: bash - -jobs: - check-expected-release-files: - runs-on: ubuntu-slim - - permissions: - contents: read - - steps: - - name: Checkout CodeQL Action - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Check Expected Release Files - run: | - bundle_version="$(cat "./src/defaults.json" | jq -r ".bundleVersion")" - set -x - for expected_file in "codeql-bundle.tar.gz" "codeql-bundle-linux64.tar.gz" "codeql-bundle-osx64.tar.gz" "codeql-bundle-win64.tar.gz"; do - curl --location --fail --head --request GET "https://github.com/github/codeql-action/releases/download/$bundle_version/$expected_file" > /dev/null - done diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index f27de17fd8..0000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: "CodeQL action" - -on: - push: - branches: [main, releases/v*] - pull_request: - merge_group: - types: [checks_requested] - schedule: - # Weekly on Sunday. - - cron: '30 1 * * 0' - workflow_dispatch: - -defaults: - run: - shell: bash - -env: - CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks - -jobs: - # Identify the CodeQL tool versions to use in the analysis job. - check-codeql-versions: - if: github.triggering_actor != 'dependabot[bot]' - runs-on: ubuntu-latest - outputs: - versions: ${{ steps.compare.outputs.versions }} - - permissions: - contents: read - # We currently need `security-events: read` to access feature flags. - security-events: read - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Set up default CodeQL bundle - id: setup-default - uses: ./setup-codeql - - name: Set up linked CodeQL bundle - id: setup-linked - uses: ./setup-codeql - with: - tools: linked - - name: Compare default and linked CodeQL bundle versions - id: compare - env: - CODEQL_DEFAULT: ${{ steps.setup-default.outputs.codeql-path }} - CODEQL_LINKED: ${{ steps.setup-linked.outputs.codeql-path }} - run: | - CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)" - CODEQL_VERSION_LINKED="$("$CODEQL_LINKED" version --format terse)" - echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT" - echo "Linked CodeQL bundle version is $CODEQL_VERSION_LINKED" - - # If we're running on a pull request, run with both bundles, even if `tools: linked` would - # be the same as `tools: null`. This allows us to make the job for each of the bundles a - # required status check. - # - # If we're running on push or schedule, then we can skip running with `tools: linked` when it would be - # the same as running with `tools: null`. - if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LINKED" ]]; then - VERSIONS_JSON='[null]' - else - VERSIONS_JSON='[null, "linked"]' - fi - - # Output a JSON-encoded list with the distinct versions to test against. - echo "Suggested matrix config for analysis job: $VERSIONS_JSON" - echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT - - analyze-javascript: - if: github.triggering_actor != 'dependabot[bot]' - needs: [check-codeql-versions] - strategy: - fail-fast: false - matrix: - os: [ubuntu-22.04,ubuntu-24.04,windows-2022,windows-2025,macos-14-xlarge,macos-15-xlarge] - tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }} - runs-on: ${{ matrix.os }} - - permissions: - contents: read - security-events: write - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Initialize CodeQL - uses: ./init - id: init - with: - languages: javascript - config-file: ./.github/codeql/codeql-config-javascript.yml - tools: ${{ matrix.tools }} - # confirm steps.init.outputs.codeql-path points to the codeql binary - - name: Print CodeQL Version - run: > - "$CODEQL" version --format=json - env: - CODEQL: ${{steps.init.outputs.codeql-path}} - - name: Perform CodeQL Analysis - uses: ./analyze - with: - category: "/language:javascript" - upload: ${{ (matrix.os == 'ubuntu-24.04' && !matrix.tools && github.event_name != 'merge_group' && 'always' ) || 'never' }} - - analyze-other: - if: github.triggering_actor != 'dependabot[bot]' - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - include: - - language: actions - - permissions: - contents: read - security-events: write - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Initialize CodeQL - uses: ./init - with: - languages: ${{ matrix.language }} - build-mode: none - config: > - paths-ignore: - - lib - - tests - queries: - - uses: security-and-quality - - name: Perform CodeQL Analysis - uses: ./analyze - with: - category: "/language:${{ matrix.language }}" - upload: ${{ (github.event_name != 'merge_group' && 'always') || 'never' }} diff --git a/.github/workflows/codescanning-config-cli.yml b/.github/workflows/codescanning-config-cli.yml deleted file mode 100644 index 7bc6718e35..0000000000 --- a/.github/workflows/codescanning-config-cli.yml +++ /dev/null @@ -1,226 +0,0 @@ -# Tests that the generated code scanning config file contains the expected contents - -name: Code-Scanning config CLI tests -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Diff informed queries add an additional query filter which is not yet - # taken into account by these tests. - CODEQL_ACTION_DIFF_INFORMED_QUERIES: false - -on: - push: - branches: - - main - - releases/v* - pull_request: - merge_group: - types: [checks_requested] - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ${{ github.workflow }}-${{ github.ref }} - -defaults: - run: - shell: bash - -jobs: - code-scanning-config-tests: - if: github.triggering_actor != 'dependabot[bot]' - continue-on-error: true - - permissions: - contents: read - packages: read - security-events: read - - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: nightly-latest - - # Code-Scanning config not created because environment variable is not set - name: Code Scanning Configuration tests - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 24 - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - - - name: Empty file - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: "{}" - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Packs from input - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ] - } - languages: javascript - packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2 - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Packs from input with + - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ] - } - languages: javascript - packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2 - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Queries from input - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }] - } - languages: javascript - queries: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Queries from input with + - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }] - } - languages: javascript - queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Queries and packs from input with + - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }], - "packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ] - } - languages: javascript - queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql - packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2 - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Queries and packs from config - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }], - "packs": { - "javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ] - } - } - languages: javascript - config-file-test: .github/codeql/queries-and-packs-config.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Queries and packs from config overriden by input - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }], - "packs": ["codeql/javascript-queries"] - } - languages: javascript - queries: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql - packs: codeql/javascript-queries - config-file-test: .github/codeql/queries-and-packs-config.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Queries and packs from config merging with input - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "packs": { - "javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2", "codeql/javascript-queries" ] - }, - "queries": [ - { "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }, - { "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" } - ] - } - languages: javascript - queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql - packs: + codeql/javascript-queries - config-file-test: .github/codeql/queries-and-packs-config.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Multi-language packs from config - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "packs": { - "javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ], - "ruby": ["codeql/ruby-queries"] - }, - "queries": [ - { "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" } - ] - } - languages: javascript,ruby - config-file-test: .github/codeql/multi-language-packs-config.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Other config properties - if: success() || failure() - uses: ./../action/.github/actions/check-codescanning-config - with: - expected-config-file-contents: | - { - "name": "Config using all properties", - "packs": ["codeql/javascript-queries" ], - "disable-default-queries": true, - "paths-ignore": ["xxx"], - "paths": ["yyy"] - } - languages: javascript - packs: + codeql/javascript-queries - config-file-test: .github/codeql/other-config-properties.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/debug-artifacts-failure-safe.yml b/.github/workflows/debug-artifacts-failure-safe.yml deleted file mode 100644 index f67cef5c75..0000000000 --- a/.github/workflows/debug-artifacts-failure-safe.yml +++ /dev/null @@ -1,117 +0,0 @@ -# Checks logs, SARIF, and database bundle debug artifacts exist -# when the analyze step fails. -name: PR Check - Debug artifacts after failure -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -on: - push: - branches: - - main - - releases/v* - pull_request: - merge_group: - types: [checks_requested] - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ${{ github.workflow }}-${{ github.ref }} - -defaults: - run: - shell: bash - -jobs: - upload-artifacts: - if: github.triggering_actor != 'dependabot[bot]' - strategy: - fail-fast: false - matrix: - version: - - stable-v2.20.3 - - default - - linked - - nightly-latest - name: Upload debug artifacts after failure in analyze - continue-on-error: true - env: - CODEQL_ACTION_TEST_MODE: true - permissions: - contents: read - # We currently need `security-events: read` to access feature flags. - security-events: read - timeout-minutes: 45 - runs-on: ubuntu-latest - steps: - - name: Dump GitHub event - run: cat "${GITHUB_EVENT_PATH}" - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ^1.13.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: '9.x' - - name: Assert best-effort artifact scan completed - uses: ./../action/.github/actions/verify-debug-artifact-scan-completed - - uses: ./../action/init - with: - languages: cpp,csharp,go,java,javascript,python - tools: ${{ steps.prepare-test.outputs.tools-url }} - debug: true - debug-artifact-name: my-debug-artifacts - debug-database-name: my-db - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - id: analysis - env: - # Forces a failure in this step. - CODEQL_ACTION_EXTRA_OPTIONS: '{ "database": { "finalize": ["--invalid-option"] } }' - with: - expect-error: true - download-and-check-artifacts: - name: Download and check debug artifacts after failure in analyze - if: github.triggering_actor != 'dependabot[bot]' - needs: upload-artifacts - timeout-minutes: 45 - permissions: - contents: read - runs-on: ubuntu-latest - steps: - - name: Download all artifacts - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - - name: Check expected artifacts exist - run: | - LANGUAGES="cpp csharp go java javascript python" - for version in $VERSIONS; do - echo "Artifacts from version $version:" - pushd "./my-debug-artifacts-${version//./}" - for language in $LANGUAGES; do - echo "- Checking $language" - if [[ ! -f "my-db-$language-partial.zip" ]] ; then - echo "Missing a partial database bundle for $language" - exit 1 - fi - if [[ ! -d "log" ]] ; then - echo "Missing database initialization logs" - exit 1 - fi - if [[ ! "$language" == "go" ]] && [[ ! -d "$language/log" ]] ; then - echo "Missing logs for $language" - exit 1 - fi - done - popd - done - env: - GO111MODULE: auto diff --git a/.github/workflows/debug-artifacts-safe.yml b/.github/workflows/debug-artifacts-safe.yml deleted file mode 100644 index c27f195113..0000000000 --- a/.github/workflows/debug-artifacts-safe.yml +++ /dev/null @@ -1,111 +0,0 @@ -# Checks logs, SARIF, and database bundle debug artifacts exist. -name: PR Check - Debug artifact upload -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -on: - push: - branches: - - main - - releases/v* - pull_request: - merge_group: - types: [checks_requested] - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ${{ github.workflow }}-${{ github.ref }} - -defaults: - run: - shell: bash - -jobs: - upload-artifacts: - if: github.triggering_actor != 'dependabot[bot]' - strategy: - fail-fast: false - matrix: - version: - - stable-v2.20.3 - - default - - linked - - nightly-latest - name: Upload debug artifacts - env: - CODEQL_ACTION_TEST_MODE: true - timeout-minutes: 45 - permissions: - contents: read - # We currently need `security-events: read` to access feature flags. - security-events: read - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ^1.13.1 - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: '9.x' - - name: Assert best-effort artifact scan completed - uses: ./../action/.github/actions/verify-debug-artifact-scan-completed - - uses: ./../action/init - id: init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - debug: true - debug-artifact-name: my-debug-artifacts - debug-database-name: my-db - # We manually exclude Swift from the languages list here, as it is not supported on Ubuntu - languages: cpp,csharp,go,java,javascript,python,ruby - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - id: analysis - download-and-check-artifacts: - name: Download and check debug artifacts - if: github.triggering_actor != 'dependabot[bot]' - needs: upload-artifacts - timeout-minutes: 45 - permissions: - contents: read - runs-on: ubuntu-latest - steps: - - name: Download all artifacts - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - - name: Check expected artifacts exist - run: | - VERSIONS="stable-v2.20.3 default linked nightly-latest" - LANGUAGES="cpp csharp go java javascript python" - for version in $VERSIONS; do - pushd "./my-debug-artifacts-${version//./}" - echo "Artifacts from version $version:" - for language in $LANGUAGES; do - echo "- Checking $language" - if [[ ! -f "$language.sarif" ]] ; then - echo "Missing a SARIF file for $language" - exit 1 - fi - if [[ ! -f "my-db-$language.zip" ]] ; then - echo "Missing a database bundle for $language" - exit 1 - fi - if [[ ! -d "$language/log" ]] ; then - echo "Missing logs for $language" - exit 1 - fi - done - popd - done - env: - GO111MODULE: auto diff --git a/.github/workflows/deflake.yml b/.github/workflows/deflake.yml deleted file mode 100644 index 158dc6c96d..0000000000 --- a/.github/workflows/deflake.yml +++ /dev/null @@ -1,106 +0,0 @@ -# Workflow runs on main, on a release branch, and that were triggered as part of a merge group have -# already passed CI before being merged. Therefore if they fail, we should make sure that there -# wasn't a transient failure by rerunning the failed jobs once before investigating further. -name: Deflake - -on: - workflow_run: - types: [completed] - # Exclude workflows that have significant side effects, like publishing releases. It's OK to - # retry CodeQL analysis. - workflows: - - Check Expected Release Files - - Code-Scanning config CLI tests - - CodeQL action - - Manual Check - go - - "PR Check - All-platform bundle" - - "PR Check - Analysis kinds" - - "PR Check - Analyze: 'ref' and 'sha' from inputs" - - "PR Check - autobuild-action" - - "PR Check - Autobuild direct tracing (custom working directory)" - - "PR Check - Autobuild working directory" - - "PR Check - Build mode autobuild" - - "PR Check - Build mode manual" - - "PR Check - Build mode none" - - "PR Check - Build mode rollback" - - "PR Check - Bundle: Caching checks" - - "PR Check - Bundle: From nightly" - - "PR Check - Bundle: From toolcache" - - "PR Check - Bundle: Zstandard checks" - - "PR Check - C/C\\+\\+: autoinstalling dependencies (Linux)" - - "PR Check - C/C\\+\\+: autoinstalling dependencies is skipped (macOS)" - - "PR Check - C/C\\+\\+: disabling autoinstalling dependencies (Linux)" - - "PR Check - Clean up database cluster directory" - - "PR Check - CodeQL Bundle All" - - "PR Check - Config export" - - "PR Check - Config input" - - "PR Check - Custom source root" - - "PR Check - Debug artifact upload" - - "PR Check - Debug artifacts after failure" - - "PR Check - Diagnostic export" - - "PR Check - Export file baseline information" - - "PR Check - Extractor ram and threads options test" - - "PR Check - Go: Custom queries" - - "PR Check - Go: diagnostic when Go is changed after init step" - - "PR Check - Go: diagnostic when `file` is not installed" - - "PR Check - Go: tracing with autobuilder step" - - "PR Check - Go: tracing with custom build steps" - - "PR Check - Go: tracing with legacy workflow" - - "PR Check - Go: workaround for indirect tracing" - - "PR Check - Job run UUID added to SARIF" - - "PR Check - Language aliases" - - "PR Check - Local CodeQL bundle" - - "PR Check - Multi-language repository" - - "PR Check - Overlay database init fallback" - - "PR Check - Packaging: Action input" - - "PR Check - Packaging: Config and input" - - "PR Check - Packaging: Config and input passed to the CLI" - - "PR Check - Packaging: Config file" - - "PR Check - Packaging: Download using registries" - - "PR Check - Proxy test" - - "PR Check - Remote config file" - - "PR Check - Resolve environment" - - "PR Check - RuboCop multi-language" - - "PR Check - Ruby analysis" - - "PR Check - Rust analysis" - - "PR Check - Split workflow" - - "PR Check - Start proxy" - - "PR Check - Submit SARIF after failure" - - "PR Check - Swift analysis using a custom build command" - - "PR Check - Swift analysis using autobuild" - - "PR Check - Test different uses of `upload-sarif`" - - "PR Check - Test unsetting environment variables" - - "PR Check - Upload-sarif: ref and sha from inputs" - - "PR Check - Use a custom `checkout_path`" - - PR Checks - - Query filters tests - - Test that the workaround for python 3.12 on windows works - -jobs: - rerun-on-failure: - name: Rerun failed jobs - if: >- - github.event.workflow_run.conclusion == 'failure' && - github.event.workflow_run.run_attempt == 1 && - ( - github.event.workflow_run.head_branch == 'main' || - startsWith(github.event.workflow_run.head_branch, 'releases/') || - github.event.workflow_run.event == 'merge_group' - ) - runs-on: ubuntu-slim - permissions: - actions: write - steps: - - name: Rerun failed jobs in ${{ github.event.workflow_run.name }} - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - RUN_ID: ${{ github.event.workflow_run.id }} - RUN_NAME: ${{ github.event.workflow_run.name }} - RUN_URL: ${{ github.event.workflow_run.html_url }} - run: | - echo "Rerunning failed jobs for workflow run ${RUN_ID}" - gh run rerun "${RUN_ID}" --failed - echo "### Reran failed jobs :recycle:" >> "$GITHUB_STEP_SUMMARY" - echo "" >> "$GITHUB_STEP_SUMMARY" - echo "Workflow: [${RUN_NAME}](${RUN_URL})" >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/label-pr-size.yml b/.github/workflows/label-pr-size.yml deleted file mode 100644 index 170ccb0744..0000000000 --- a/.github/workflows/label-pr-size.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Label PR with size - -on: - pull_request: - types: - - opened - - synchronize - - reopened - - edited - -permissions: - contents: read - pull-requests: write - -jobs: - sizeup: - name: Label PR with size - runs-on: ubuntu-slim - if: github.event.pull_request.merged != true - - steps: - - name: Run sizeup - uses: lerebear/sizeup-action@b7beb3dd273e36039e16e48e7bc690c189e61951 # 0.8.12 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - configuration-file-path: ".github/sizeup.yml" diff --git a/.github/workflows/post-release-mergeback.yml b/.github/workflows/post-release-mergeback.yml deleted file mode 100644 index c493c2a382..0000000000 --- a/.github/workflows/post-release-mergeback.yml +++ /dev/null @@ -1,165 +0,0 @@ -# This workflow runs after a merge to any release branch of the action. It: -# 1. Tags the merge commit on the release branch that represents the new release with an `vN.x.y` -# tag -# 2. Updates the `vN` tag to refer to this merge commit. -# 3. Iff vN == vLatest, merges any changes from the release back into the main branch. -# Typically, this is two commits – one to update the version number and one to rebuild. -name: Tag release and merge back - -on: - workflow_dispatch: - inputs: - baseBranch: - description: 'The base branch to merge into' - default: main - required: false - - push: - branches: - - releases/v* - -defaults: - run: - shell: bash - -jobs: - merge-back: - runs-on: ubuntu-latest - environment: Automation - if: github.repository == 'github/codeql-action' - env: - BASE_BRANCH: "${{ github.event.inputs.baseBranch || 'main' }}" - HEAD_BRANCH: "${{ github.head_ref || github.ref }}" - - permissions: - contents: write # needed to create tags and push commits - pull-requests: write - - steps: - - name: Dump environment - run: env - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: '${{ toJson(github) }}' - run: echo "${GITHUB_CONTEXT}" - - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 # ensure we have all tags and can push commits - - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 24 - cache: 'npm' - - - name: Install JavaScript dependencies - run: npm ci - - - name: Update git config - run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - - - name: Get version and new branch - id: getVersion - run: | - VERSION="v$(jq '.version' -r 'package.json')" - echo "version=${VERSION}" >> $GITHUB_OUTPUT - short_sha="${GITHUB_SHA:0:8}" - NEW_BRANCH="mergeback/${VERSION}-to-${BASE_BRANCH}-${short_sha}" - echo "newBranch=${NEW_BRANCH}" >> $GITHUB_OUTPUT - LATEST_RELEASE_BRANCH=$(git branch -r | grep -E "origin/releases/v[0-9]+$" | sed 's/origin\///g' | sort -V | tail -1 | xargs) - echo "latest_release_branch=${LATEST_RELEASE_BRANCH}" >> $GITHUB_OUTPUT - - - name: Dump branches - env: - NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}" - run: | - echo "BASE_BRANCH ${BASE_BRANCH}" - echo "HEAD_BRANCH ${HEAD_BRANCH}" - echo "NEW_BRANCH ${NEW_BRANCH}" - echo "LATEST_RELEASE_BRANCH ${LATEST_RELEASE_BRANCH}" - echo "GITHUB_REF ${GITHUB_REF}" - - - name: Create mergeback branch - env: - NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}" - run: | - git checkout -b "${NEW_BRANCH}" - - - name: Check for tag - id: check - env: - VERSION: "${{ steps.getVersion.outputs.version }}" - run: | - set +e # don't fail on an errored command - git ls-remote --tags origin | grep "${VERSION}" - exists="$?" - if [ "${exists}" -eq 0 ]; then - echo "Tag ${VERSION} exists. Not going to re-release." - echo "exists=true" >> $GITHUB_OUTPUT - else - echo "Tag ${VERSION} does not exist yet." - fi - - # we didn't tag the release during the update-release-branch workflow because the - # commit that actually makes it to the release branch is a merge commit, - # and not yet known during the first workflow. We tag now because we know the correct commit. - - name: Tag release - if: steps.check.outputs.exists != 'true' - env: - VERSION: ${{ steps.getVersion.outputs.version }} - run: | - # Create the `vx.y.z` tag - git tag --annotate "${VERSION}" --message "${VERSION}" - # Update the `vx` tag - major_version_tag=$(cut -d '.' -f1 <<< "${VERSION}") - # Use `--force` to overwrite the major version tag - git tag --annotate "${major_version_tag}" --message "${major_version_tag}" --force - # Push the tags, using: - # - `--atomic` to make sure we either update both tags or neither (an intermediate state, - # e.g. where we update the vN.x.y tag on the remote but not the vN tag, could result in - # unwanted Dependabot updates, e.g. from vN to vN.x.y) - # - `--force` since we're overwriting the `vN` tag - git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}" - - - name: Prepare partial Changelog - env: - PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" - run: | - npx tsx pr-checks/prepare-changelog.ts --output="$PARTIAL_CHANGELOG" - - echo "::group::Partial CHANGELOG" - cat $PARTIAL_CHANGELOG - echo "::endgroup::" - - - name: Generate token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - id: app-token - with: - app-id: ${{ vars.AUTOMATION_APP_ID }} - private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }} - - - name: Create the GitHub release - if: steps.check.outputs.exists != 'true' - env: - PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" - VERSION: "${{ steps.getVersion.outputs.version }}" - GH_TOKEN: ${{ steps.app-token.outputs.token }} - run: | - # Do not mark this release as latest. The most recent CLI release must be marked as latest. - gh release create \ - "$VERSION" \ - --latest=false \ - --title "$VERSION" \ - --notes-file "$PARTIAL_CHANGELOG" - - - name: Create mergeback branch and PR - if: ${{ endsWith(github.ref_name, steps.getVersion.outputs.latest_release_branch) }} - uses: ./.github/actions/prepare-mergeback-branch - with: - base: "${{ env.BASE_BRANCH }}" - head: "${{ env.HEAD_BRANCH }}" - branch: "${{ steps.getVersion.outputs.newBranch }}" - version: "${{ steps.getVersion.outputs.version }}" - token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml deleted file mode 100644 index ac61475d62..0000000000 --- a/.github/workflows/pr-checks.yml +++ /dev/null @@ -1,230 +0,0 @@ -name: PR Checks - -on: - push: - pull_request: - merge_group: - types: [checks_requested] - workflow_dispatch: - -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ${{ github.workflow }}-${{ github.ref }} - -defaults: - run: - shell: bash - -jobs: - unit-tests: - name: Unit Tests - if: github.triggering_actor != 'dependabot[bot]' - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - node-version: [20, 24] - permissions: - contents: read - security-events: write # needed to upload ESLint results - runs-on: ${{ matrix.os }} - timeout-minutes: 45 - - concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: pr-checks-unit-tests-${{ github.ref }}-${{ github.event_name }}-${{ matrix.os }}-node${{ matrix['node-version'] }} - - steps: - - name: Prepare git (Windows) - if: runner.os == 'Windows' - run: git config --global core.autocrlf false - - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - - name: Install dependencies - run: | - # Use the system Bash shell to ensure we can run commands like `npm ci` - # that are not available in the default shell on Windows. - npm config set script-shell bash - npm ci - - - name: Verify compiled JS up to date - run: .github/workflows/script/check-js.sh - - - name: Run unit tests - if: always() - run: npm test - - - name: Lint - if: always() && matrix.os != 'windows-latest' - run: npm run lint-ci - - - name: Upload sarif - uses: ./upload-sarif - if: matrix.os == 'ubuntu-latest' && matrix.node-version == 24 - with: - sarif_file: eslint.sarif - category: eslint - - # These checks do not need to be run as part of the same matrix that we use for the `unit-tests` - # job. - other-checks: - name: Other checks - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - runs-on: ubuntu-latest - timeout-minutes: 10 - - concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: pr-checks-pr-checks-${{ github.ref }}-${{ github.event_name }} - - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 24 - cache: 'npm' - - - name: Install dependencies - id: install-deps - run: npm ci - - - name: Verify PR checks up to date - if: ${{ !cancelled() && steps.install-deps.outcome == 'success' }} - run: .github/workflows/script/verify-pr-checks.sh - - - name: Run pr-checks tests - if: ${{ !cancelled() && steps.install-deps.outcome == 'success' }} - working-directory: pr-checks - run: npx tsx --test - - - name: Verify all Actions use the same Node version - id: head-version - run: | - NODE_VERSION=$(find . -path "*/node_modules" -prune -o -name "action.yml" -exec yq -o=json '.runs.using' {} \; | jq -rs '[.[] | select(. != null and startswith("node"))] | unique | .[]') - echo "NODE_VERSION: ${NODE_VERSION}" - if [[ $(echo "$NODE_VERSION" | wc -l) -gt 1 ]]; then - echo "::error::More than one node version used in 'action.yml' files." - exit 1 - fi - echo "node_version=${NODE_VERSION}" >> $GITHUB_OUTPUT - - - name: Fetch base commit - id: fetch-base - # Forks and Dependabot PRs don't have permission to write comments, so skip the repo size - # check in those cases. - if: >- - github.event_name == 'pull_request' && - github.event.pull_request.head.repo.full_name == github.repository && - github.event.pull_request.user.login != 'dependabot[bot]' - env: - BASE_SHA: ${{ github.event.pull_request.base.sha }} - HEAD_SHA: ${{ github.event.pull_request.head.sha }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Compare against the merge base so the size delta reflects only the commits actually - # added by this PR, ignoring any changes that have landed on the base branch since the - # PR branched off. - merge_base=$(gh api "repos/$GITHUB_REPOSITORY/compare/$BASE_SHA...$HEAD_SHA" --jq '.merge_base_commit.sha') - echo "merge_base=$merge_base" >> "$GITHUB_OUTPUT" - git fetch --no-tags --depth=1 origin "$merge_base" "$HEAD_SHA" - - - name: Check repo size - if: steps.fetch-base.outcome == 'success' - working-directory: pr-checks - env: - BASE_REF: ${{ github.event.pull_request.base.ref }} - BASE_SHA: ${{ steps.fetch-base.outputs.merge_base }} - HEAD_SHA: ${{ github.event.pull_request.head.sha }} - RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: npx tsx check-repo-size.ts --output-dir "$RUNNER_TEMP/repo-size" - - - name: Upload repo size comment - if: steps.fetch-base.outcome == 'success' - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: repo-size-comment - path: ${{ runner.temp }}/repo-size/ - if-no-files-found: error - - - name: 'Backport: Check out base ref' - id: checkout-base - if: ${{ startsWith(github.head_ref, 'backport-') }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: ${{ github.base_ref }} - - - name: 'Backport: Verify Node versions unchanged' - if: steps.checkout-base.outcome == 'success' - env: - HEAD_VERSION: ${{ steps.head-version.outputs.node_version }} - run: | - BASE_VERSION=$(find . -path "*/node_modules" -prune -o -name "action.yml" -exec yq -o=json '.runs.using' {} \; | jq -rs '[.[] | select(. != null and startswith("node"))] | unique | .[]') - echo "HEAD_VERSION: ${HEAD_VERSION}" - echo "BASE_VERSION: ${BASE_VERSION}" - if [[ "$BASE_VERSION" != "$HEAD_VERSION" ]]; then - echo "::error::Cannot change the Node version of an Action in a backport PR." - exit 1 - fi - - post-repo-size-comment: - name: Post repo size comment - needs: other-checks - # Keep write permissions isolated from the job that checks out and tests PR code. This job only - # posts the candidate comment body produced by the read-only `pr-checks` job. - if: >- - github.event_name == 'pull_request' && - github.event.pull_request.head.repo.full_name == github.repository && - github.event.pull_request.user.login != 'dependabot[bot]' && - needs.other-checks.result == 'success' - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-slim - timeout-minutes: 10 - - concurrency: - cancel-in-progress: true - group: check-repo-size-${{ github.event.pull_request.number }} - - steps: - - name: Download repo size comment - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: repo-size-comment - path: repo-size-comment - - - name: Post repo size comment - env: - COMMENT_MARKER: "" - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - run: | - significant=$(jq -r '.significant' repo-size-comment/metadata.json) - comment_id=$( - gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" \ - --paginate \ - --jq ".[] | select(.body | contains(\"$COMMENT_MARKER\")) | .id" \ - | head -n 1 - ) - - if [[ -n "$comment_id" ]]; then - echo "Updating existing comment $comment_id." - gh api --method PATCH "repos/$GITHUB_REPOSITORY/issues/comments/$comment_id" --field body=@repo-size-comment/body.md - elif [[ "$significant" == "true" ]]; then - echo "Creating new repo size comment." - gh api --method POST "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" --field body=@repo-size-comment/body.md - else - echo "Skipping repo size comment because the delta is below the threshold and no sticky comment exists." - fi diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml deleted file mode 100644 index 4eb300704d..0000000000 --- a/.github/workflows/prepare-release.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Prepare release -on: - workflow_call: - outputs: - version: - description: "The version that is being released." - value: ${{ jobs.prepare.outputs.version }} - major_version: - description: "The major version of the release." - value: ${{ jobs.prepare.outputs.major_version }} - latest_tag: - description: "The most recent, existing release tag." - value: ${{ jobs.prepare.outputs.latest_tag }} - backport_source_branch: - description: "The release branch for the given tag." - value: ${{ jobs.prepare.outputs.backport_source_branch }} - backport_target_branches: - description: "JSON encoded list of branches to target with backports." - value: ${{ jobs.prepare.outputs.backport_target_branches }} - - push: - paths: - - .github/workflows/prepare-release.yml - -defaults: - run: - shell: bash - -jobs: - prepare: - name: "Prepare release" - runs-on: ubuntu-latest - if: github.repository == 'github/codeql-action' - - permissions: - contents: read - - outputs: - version: ${{ steps.versions.outputs.version }} - major_version: ${{ steps.versions.outputs.major_version }} - latest_tag: ${{ steps.versions.outputs.latest_tag }} - backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }} - backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }} - - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 # Need full history for calculation of diffs - - - name: Configure runner for release - uses: ./.github/actions/release-initialise - - - name: Get version tags - id: versions - run: | - VERSION="v$(jq '.version' -r 'package.json')" - echo "version=${VERSION}" >> $GITHUB_OUTPUT - MAJOR_VERSION=$(cut -d '.' -f1 <<< "${VERSION}") - echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT - LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -1) - echo "latest_tag=${LATEST_TAG}" >> $GITHUB_OUTPUT - - - name: Determine older release branches - id: branches - uses: ./.github/actions/release-branches - with: - major_version: ${{ steps.versions.outputs.major_version }} - latest_tag: ${{ steps.versions.outputs.latest_tag }} - - - name: Print release information - run: | - echo 'version: ${{ steps.versions.outputs.version }}' - echo 'major_version: ${{ steps.versions.outputs.major_version }}' - echo 'latest_tag: ${{ steps.versions.outputs.latest_tag }}' - echo 'backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }}' - echo 'backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }}' diff --git a/.github/workflows/publish-immutable-action.yml b/.github/workflows/publish-immutable-action.yml deleted file mode 100644 index 5e5623bb07..0000000000 --- a/.github/workflows/publish-immutable-action.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: 'Publish Immutable Action Version' - -on: - push: - tags: - # Match version tags, but not the major version tags. - - 'v[0-9]+.**' - -defaults: - run: - shell: bash - -jobs: - publish: - runs-on: ubuntu-slim - permissions: - contents: read - id-token: write - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Publish immutable release - id: publish - uses: actions/publish-immutable-action@4bc8754ffc40f27910afb20287dbbbb675a4e978 # v0.0.4 diff --git a/.github/workflows/python312-windows.yml b/.github/workflows/python312-windows.yml deleted file mode 100644 index ab169499e2..0000000000 --- a/.github/workflows/python312-windows.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Test that the workaround for python 3.12 on windows works - -on: - push: - branches: [main, releases/v*] - pull_request: - merge_group: - types: [checks_requested] - schedule: - # Weekly on Monday. - - cron: '0 0 * * 1' - workflow_dispatch: - -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ${{ github.workflow }}-${{ github.ref }} - -defaults: - run: - shell: bash - -jobs: - test-setup-python-scripts: - if: github.triggering_actor != 'dependabot[bot]' - env: - CODEQL_ACTION_TEST_MODE: true - timeout-minutes: 45 - permissions: - contents: read - # We currently need `security-events: read` to access feature flags. - security-events: read - runs-on: windows-latest - - steps: - - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: 3.12 - - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Prepare test - uses: ./.github/actions/prepare-test - with: - version: default - - - name: Initialize CodeQL - uses: ./../action/init - with: - tools: linked - languages: python - - - name: Analyze - uses: ./../action/analyze diff --git a/.github/workflows/query-filters.yml b/.github/workflows/query-filters.yml deleted file mode 100644 index 87b934eb6b..0000000000 --- a/.github/workflows/query-filters.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Query filters tests - -on: - push: - branches: - - main - - releases/v* - pull_request: - merge_group: - types: [checks_requested] - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ${{ github.workflow }}-${{ github.ref }} - -defaults: - run: - shell: bash - -jobs: - query-filters: - name: Query Filters Tests - if: github.triggering_actor != 'dependabot[bot]' - timeout-minutes: 45 - runs-on: ubuntu-latest - permissions: - contents: read # This permission is needed to allow the GitHub Actions workflow to read the contents of the repository. - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Install Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 24 - cache: npm - - - name: Install dependencies - run: npm ci - - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: linked - - - name: Check SARIF for default queries with Single include, Single exclude - uses: ./../action/.github/actions/query-filter-test - with: - sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: js/zipslip - queries-not-run: js/path-injection - config-file: ./.github/codeql/codeql-config-query-filters1.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Check SARIF for query packs with Single include, Single exclude - uses: ./../action/.github/actions/query-filter-test - with: - sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: js/zipslip,javascript/example/empty-or-one-block - queries-not-run: js/path-injection - config-file: ./.github/codeql/codeql-config-query-filters2.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - name: Check SARIF for query packs and local queries with Single include, Single exclude - uses: ./../action/.github/actions/query-filter-test - with: - sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: js/zipslip,javascript/example/empty-or-one-block,inrepo-javascript-querypack/show-ifs - queries-not-run: js/path-injection,complex-python-querypack/show-ifs,complex-python-querypack/foo/bar/show-ifs - config-file: ./.github/codeql/codeql-config-query-filters3.yml - tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml deleted file mode 100644 index faa32c65d9..0000000000 --- a/.github/workflows/rebuild.yml +++ /dev/null @@ -1,147 +0,0 @@ -name: Rebuild Action - -on: - pull_request: - types: [labeled] - workflow_dispatch: - -defaults: - run: - shell: bash - -jobs: - rebuild: - name: Rebuild Action - runs-on: ubuntu-latest - if: github.event.label.name == 'Rebuild' || github.event_name == 'workflow_dispatch' - - env: - HEAD_REF: ${{ github.event.pull_request.head.ref || github.event.ref }} - BASE_BRANCH: ${{ github.event.pull_request.base.ref || 'main' }} - - permissions: - contents: write # needed to push rebuilt commit - pull-requests: write # needed to comment on the PR - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 - ref: ${{ env.HEAD_REF }} - - - name: Set up Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 24 - cache: 'npm' - - - name: Remove label - if: github.event_name == 'pull_request' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - run: | - gh pr edit --repo github/codeql-action "$PR_NUMBER" \ - --remove-label "Rebuild" - - - name: Configure git - run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - - - name: Merge in changes from base branch - id: merge - run: | - git fetch origin "$BASE_BRANCH" - - # Allow merge conflicts in `lib`, since rebuilding should resolve them. - git merge "origin/$BASE_BRANCH" - MERGE_RESULT=$? - - if [ "$MERGE_RESULT" -eq 0 ]; then - echo "Merge succeeded cleanly." - elif [ "$MERGE_RESULT" -eq 1 ]; then - echo "Merge conflicts detected (exit code $MERGE_RESULT), continuing." - else - echo "git merge failed with unexpected exit code $MERGE_RESULT." - exit 1 - fi - - if [ "$MERGE_RESULT" -ne 0 ]; then - echo "merge-in-progress=true" >> $GITHUB_OUTPUT - - # Check for merge conflicts outside of `lib`. Disable git diff's trailing whitespace check - # since `node_modules/@types/semver/README.md` fails it. - if git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/'; then - echo "Merge conflicts were detected outside of the lib directory. Please resolve them manually." - git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/' || true - exit 1 - fi - - echo "No merge conflicts found outside the lib directory. We should be able to resolve all of" \ - "these by rebuilding the Action." - fi - - - name: Compile TypeScript - run: | - npm ci - npm run lint -- --fix - npm run build - - - name: Sync back version updates to generated workflows - # Only sync back versions on Dependabot update PRs - if: startsWith(env.HEAD_REF, 'dependabot/') - working-directory: pr-checks - run: | - npm ci - npx tsx sync-back.ts --verbose - - - name: Generate workflows - working-directory: pr-checks - run: ./sync.sh - - - name: "Merge in progress: Finish merge and push" - if: steps.merge.outputs.merge-in-progress == 'true' - run: | - echo "Finishing merge and pushing changes." - git add --all - git commit --no-edit - git push - - - name: "No merge in progress: Check for changes and push" - if: steps.merge.outputs.merge-in-progress != 'true' - id: push - run: | - if [ ! -z "$(git status --porcelain)" ]; then - echo "Changes detected, committing and pushing." - git add --all - # If the merge originally had conflicts, finish the merge. - # Otherwise, just commit the changes. - if git rev-parse --verify MERGE_HEAD >/dev/null 2>&1; then - echo "In progress merge detected, finishing it up." - git commit --no-edit - else - echo "No in-progress merge detected, committing changes." - git commit -m "Rebuild" - fi - echo "Pushing changes" - git push - echo "changes=true" >> $GITHUB_OUTPUT - else - echo "No changes detected, nothing to commit." - fi - - - name: Notify about rebuild - if: >- - github.event_name == 'pull_request' && - ( - steps.merge.outputs.merge-in-progress == 'true' || - steps.push.outputs.changes == 'true' - ) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - run: | - echo "Pushed a commit to rebuild the Action." \ - "Please approve running the PR checks." | - gh pr comment --body-file - --repo github/codeql-action "$PR_NUMBER" diff --git a/.github/workflows/rollback-release.yml b/.github/workflows/rollback-release.yml deleted file mode 100644 index c37f8a79ae..0000000000 --- a/.github/workflows/rollback-release.yml +++ /dev/null @@ -1,187 +0,0 @@ -name: Rollback release -on: - # You can trigger this workflow via workflow dispatch to start a rollback. - # This will create a draft release that mirrors the release for `rollback-tag`. - workflow_dispatch: - inputs: - rollback-tag: - type: string - description: "The tag of an old release to roll-back to." - required: true - # Only for dry-runs of changes to the workflow. - push: - # Don't run dry-run on release branches, to avoid an issue where the - # "new" tag determined by the "Prepare release" job already exists. - branches-ignore: - - releases/v* - paths: - - .github/workflows/rollback-release.yml - - .github/actions/prepare-mergeback-branch/** - -defaults: - run: - shell: bash - -jobs: - prepare: - name: "Prepare release" - if: github.repository == 'github/codeql-action' - - permissions: - contents: read - - uses: ./.github/workflows/prepare-release.yml - - rollback: - name: "Create rollback release" - if: github.repository == 'github/codeql-action' - runs-on: ubuntu-latest - timeout-minutes: 45 - - # Don't set the deployment environment for test runs - # The Actions token does not have permissions to push changes to workflow files. - # Since workflow files may change as part of a backport PR, we use the "Automation" environment for real runs to authenticate as a GitHub App and push these changes. - environment: ${{ github.event_name == 'workflow_dispatch' && 'Automation' || '' }} - - needs: - - prepare - - permissions: - contents: write # needed to push to the repo (tags and releases) - pull-requests: write # needed to create the mergeback PR - - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 # Need full history for calculation of diffs - - - name: Configure runner for release - uses: ./.github/actions/release-initialise - - - name: Create tag for testing - if: github.event_name != 'workflow_dispatch' - run: git tag v0.0.0 - - # We start by preparing the mergeback branch, mainly so that we have the updated changelog - # readily available for the partial changelog that's needed for the release. - - name: Prepare mergeback branch - id: mergeback-branch - env: - BASE_BRANCH: ${{ (github.event_name == 'workflow_dispatch' && 'main') || github.ref_name }} - VERSION: ${{ needs.prepare.outputs.version }} - run: | - set -x - - # Checkout the base branch, since we may be testing on a different branch - git checkout "$BASE_BRANCH" - - # Generate a new branch name for the mergeback PR - short_sha="${GITHUB_SHA:0:8}" - NEW_BRANCH="mergeback/${VERSION}-to-${BASE_BRANCH}-${short_sha}" - echo "new-branch=${NEW_BRANCH}" >> $GITHUB_OUTPUT - - # Create the mergeback branch - git checkout -b "${NEW_BRANCH}" - - - name: Prepare rollback changelog - env: - NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md" - # We usually expect to checkout `inputs.rollback-tag` (required for `workflow_dispatch`), - # but use `v0.0.0` for testing. - ROLLBACK_TAG: ${{ inputs.rollback-tag || 'v0.0.0' }} - LATEST_TAG: ${{ needs.prepare.outputs.latest_tag }} - VERSION: "${{ needs.prepare.outputs.version }}" - run: | - npx tsx pr-checks/rollback-changelog.ts \ - --target-version "${ROLLBACK_TAG:1}" \ - --rollback-version "${LATEST_TAG:1}" \ - --new-version "$VERSION" > $NEW_CHANGELOG - - echo "::group::New CHANGELOG" - cat $NEW_CHANGELOG - echo "::endgroup::" - - - name: Create tags - env: - # We usually expect to checkout `inputs.rollback-tag` (required for `workflow_dispatch`), - # but use `v0.0.0` for testing. - ROLLBACK_TAG: ${{ inputs.rollback-tag || 'v0.0.0' }} - RELEASE_TAG: ${{ needs.prepare.outputs.version }} - MAJOR_VERSION_TAG: ${{ needs.prepare.outputs.major_version }} - run: | - git checkout "refs/tags/${ROLLBACK_TAG}" - git tag --annotate "${RELEASE_TAG}" --message "${RELEASE_TAG}" - git tag --annotate "${MAJOR_VERSION_TAG}" --message "${MAJOR_VERSION_TAG}" --force - - - name: Push tags - # skip when testing - if: github.event_name == 'workflow_dispatch' - env: - RELEASE_TAG: ${{ needs.prepare.outputs.version }} - MAJOR_VERSION_TAG: ${{ needs.prepare.outputs.major_version }} - run: | - git push origin --atomic --force refs/tags/"${RELEASE_TAG}" refs/tags/"${MAJOR_VERSION_TAG}" - - - name: Prepare partial Changelog - env: - NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md" - PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" - run: | - npx tsx pr-checks/prepare-changelog.ts \ - --changelog="$NEW_CHANGELOG" \ - --output="$PARTIAL_CHANGELOG" - - echo "::group::Partial CHANGELOG" - cat $PARTIAL_CHANGELOG - echo "::endgroup::" - - - name: Generate token - if: github.event_name == 'workflow_dispatch' - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - id: app-token - with: - app-id: ${{ vars.AUTOMATION_APP_ID }} - private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }} - - - name: Create the rollback release - if: github.event_name == 'workflow_dispatch' - env: - PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" - VERSION: "${{ needs.prepare.outputs.version }}" - GH_TOKEN: ${{ steps.app-token.outputs.token }} - RELEASE_URL: "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ needs.prepare.outputs.version }}" - run: | - set -exu - - # Do not mark this release as latest. The most recent bundle release must be marked as latest. - # Set as a draft to give us an opportunity to review the rollback release. - gh release create \ - "$VERSION" \ - --latest=false \ - --draft \ - --title "$VERSION" \ - --notes-file "$PARTIAL_CHANGELOG" - - echo "Created draft rollback release at $RELEASE_URL" >> $GITHUB_STEP_SUMMARY - - - name: Update changelog - env: - NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md" - NEW_BRANCH: "${{ steps.mergeback-branch.outputs.new-branch }}" - run: | - git checkout "${NEW_BRANCH}" - mv ${NEW_CHANGELOG} CHANGELOG.md - - - name: Create mergeback branch and PR - uses: ./.github/actions/prepare-mergeback-branch - with: - base: "main" - head: "" - branch: "${{ steps.mergeback-branch.outputs.new-branch }}" - version: "${{ needs.prepare.outputs.version }}" - token: "${{ secrets.GITHUB_TOKEN }}" - # Setting this to `true` for non-workflow_dispatch events will - # still push the `branch`, but won't create a corresponding PR - dry-run: "${{ github.event_name != 'workflow_dispatch' }}" - diff --git a/.github/workflows/script/check-js.sh b/.github/workflows/script/check-js.sh deleted file mode 100755 index 57638dcf25..0000000000 --- a/.github/workflows/script/check-js.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -eu - -# Sanity check that repo is clean to start with -if [ ! -z "$(git status --porcelain)" ]; then - # If we get a fail here then this workflow needs attention... - >&2 echo "Failed: Repo should be clean before testing!" - exit 1 -fi -# Wipe the lib directory in case there are extra unnecessary files in there -rm -rf lib -# Generate the JavaScript files -npm run-script build -# Check that repo is still clean -if [ ! -z "$(git status --porcelain)" ]; then - # If we get a fail here then the PR needs attention - >&2 echo "Failed: JavaScript files are not up to date. Run 'rm -rf lib && npm run-script build' to update" - git status - - echo "### Transpiled JS diff" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo '```diff' >> $GITHUB_STEP_SUMMARY - git diff --output="$RUNNER_TEMP/js.diff" - cat "$RUNNER_TEMP/js.diff" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - - # Reset bundled files to allow other checks to test for changes - git checkout lib - - # Fail this check - exit 1 -fi -echo "Success: JavaScript files are up to date" diff --git a/.github/workflows/script/verify-pr-checks.sh b/.github/workflows/script/verify-pr-checks.sh deleted file mode 100755 index 5be2c599e3..0000000000 --- a/.github/workflows/script/verify-pr-checks.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -eu - -# Sanity check that repo is clean to start with -if [ ! -z "$(git status --porcelain)" ]; then - # If we get a fail here then this workflow needs attention... - >&2 echo "Failed: Repo should be clean before testing!" - exit 1 -fi - -# Wipe the generated PR checks in case there are extra unnecessary files in there -rm -rf .github/workflows/__* - -# Generate the PR checks -pr-checks/sync.sh - -# Check that repo is still clean -if [ ! -z "$(git status --porcelain)" ]; then - # If we get a fail here then the PR needs attention - git diff - git status - >&2 echo "Failed: PR checks are not up to date. Run 'cd pr-checks && ./sync.sh' to update" - - echo "### Generated workflows diff" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo '```diff' >> $GITHUB_STEP_SUMMARY - git diff --output="$RUNNER_TEMP/workflows.diff" - cat "$RUNNER_TEMP/workflows.diff" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - - exit 1 -fi -echo "Success: PR checks are up to date" diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml new file mode 100644 index 0000000000..1ae5925f62 --- /dev/null +++ b/.github/workflows/spelling.yml @@ -0,0 +1,169 @@ +name: Check Spelling + +# Comment management is handled through a secondary job, for details see: +# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions +# +# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment +# (in odd cases, it might actually run just to collapse a comment, but that's fairly rare) +# it needs `contents: write` in order to add a comment. +# +# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment +# or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment) +# it needs `pull-requests: write` in order to manipulate those comments. + +# Updating pull request branches is managed via comment handling. +# For details, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-expect-list +# +# These elements work together to make it happen: +# +# `on.issue_comment` +# This event listens to comments by users asking to update the metadata. +# +# `jobs.update` +# This job runs in response to an issue_comment and will push a new commit +# to update the spelling metadata. +# +# `with.experimental_apply_changes_via_bot` +# Tells the action to support and generate messages that enable it +# to make a commit to update the spelling metadata. +# +# `with.ssh_key` +# In order to trigger workflows when the commit is made, you can provide a +# secret (typically, a write-enabled github deploy key). +# +# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key + +# SARIF reporting +# +# Access to SARIF reports is generally restricted (by GitHub) to members of the repository. +# +# Requires enabling `security-events: write` +# and configuring the action with `use_sarif: 1` +# +# For information on the feature, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-SARIF-output + +# Minimal workflow structure: +# +# on: +# push: +# ... +# pull_request_target: +# ... +# jobs: +# # you only want the spelling job, all others should be omitted +# spelling: +# # remove `security-events: write` and `use_sarif: 1` +# # remove `experimental_apply_changes_via_bot: 1` +# ... otherwise adjust the `with:` as you wish + +on: + push: + branches: + - "**" + tags-ignore: + - "**" + pull_request_target: + branches: + - "**" + types: + - "opened" + - "reopened" + - "synchronize" + issue_comment: + types: + - "created" + +jobs: + spelling: + name: Check Spelling + permissions: + contents: read + pull-requests: read + actions: read + security-events: write + outputs: + followup: ${{ steps.spelling.outputs.followup }} + runs-on: ubuntu-latest + if: ${{ contains(github.event_name, 'pull_request') || github.event_name == 'push' }} + concurrency: + group: spelling-${{ github.event.pull_request.number || github.ref }} + # note: If you use only_check_changed_files, you do not want cancel-in-progress + cancel-in-progress: true + steps: + - name: check-spelling + id: spelling + uses: check-spelling/check-spelling@prerelease + with: + suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }} + checkout: true + check_file_names: 1 + spell_check_this: check-spelling/spell-check-this@prerelease + post_comment: 0 + use_magic_file: 1 + report-timing: 1 + warnings: bad-regex,binary-file,deprecated-feature,ignored-expect-variant,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check,unclosed-block-ignore-begin,unclosed-block-ignore-end + experimental_apply_changes_via_bot: 1 + use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }} + extra_dictionary_limit: 20 + extra_dictionaries: | + cspell:software-terms/dict/softwareTerms.txt + + comment-push: + name: Report (Push) + # If your workflow isn't running on push, you can remove this job + runs-on: ubuntu-latest + needs: spelling + permissions: + actions: read + contents: write + if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push' + steps: + - name: comment + uses: check-spelling/check-spelling@prerelease + with: + checkout: true + spell_check_this: check-spelling/spell-check-this@prerelease + task: ${{ needs.spelling.outputs.followup }} + + comment-pr: + name: Report (PR) + # If you workflow isn't running on pull_request*, you can remove this job + runs-on: ubuntu-latest + needs: spelling + permissions: + actions: read + contents: read + pull-requests: write + if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request') + steps: + - name: comment + uses: check-spelling/check-spelling@prerelease + with: + checkout: true + spell_check_this: check-spelling/spell-check-this@prerelease + task: ${{ needs.spelling.outputs.followup }} + experimental_apply_changes_via_bot: 1 + + update: + name: Update PR + permissions: + contents: write + pull-requests: write + actions: read + runs-on: ubuntu-latest + if: ${{ + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + contains(github.event.comment.body, '@check-spelling-bot apply') && + contains(github.event.comment.body, 'https://') + }} + concurrency: + group: spelling-update-${{ github.event.issue.number }} + cancel-in-progress: false + steps: + - name: apply spelling updates + uses: check-spelling/check-spelling@prerelease + with: + experimental_apply_changes_via_bot: 1 + checkout: true + ssh_key: "${{ secrets.CHECK_SPELLING }}" diff --git a/.github/workflows/test-codeql-bundle-all.yml b/.github/workflows/test-codeql-bundle-all.yml deleted file mode 100644 index 477fdf0524..0000000000 --- a/.github/workflows/test-codeql-bundle-all.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: 'PR Check - CodeQL Bundle All' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: - merge_group: - types: [checks_requested] - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ${{ github.workflow }}-${{ github.ref }} - -defaults: - run: - shell: bash -jobs: - test-codeql-bundle-all: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: nightly-latest - name: 'CodeQL Bundle All' - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: true - - name: Install .NET - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 - with: - dotnet-version: '9.x' - - id: init - uses: ./../action/init - with: - # We manually exclude Swift from the languages list here, as it is not supported on Ubuntu - languages: cpp,csharp,go,java,javascript,python,ruby - tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Build code - run: ./build.sh - - uses: ./../action/analyze - env: - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/update-bundle.yml b/.github/workflows/update-bundle.yml deleted file mode 100644 index d3ee924e59..0000000000 --- a/.github/workflows/update-bundle.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Update default CodeQL bundle - -on: - release: - # From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release - # Note: The prereleased type will not trigger for pre-releases published - # from draft releases, but the published type will trigger. If you want a - # workflow to run when stable and pre-releases publish, subscribe to - # published instead of released and prereleased. - # - # From https://github.com/orgs/community/discussions/26281 - # As a work around, in published type workflow, you could add if condition - # to filter pre-release attribute. - types: [published] - -defaults: - run: - shell: bash - -jobs: - update-bundle: - if: github.event.release.prerelease && startsWith(github.event.release.tag_name, 'codeql-bundle-') - runs-on: ubuntu-latest - permissions: - contents: write # needed to push commits - pull-requests: write # needed to create pull requests - steps: - - name: Dump environment - run: env - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: '${{ toJson(github) }}' - run: echo "$GITHUB_CONTEXT" - - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Update git config - run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - - - name: Set up Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 24 - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Update bundle - uses: ./.github/actions/update-bundle - - - name: Set up CodeQL CLI from new bundle - id: setup-codeql - uses: ./setup-codeql - with: - tools: https://github.com/github/codeql-action/releases/download/${{ github.event.release.tag_name }}/codeql-bundle-linux64.tar.gz - - - name: Update built-in languages - run: npx tsx pr-checks/update-builtin-languages.ts "$CODEQL_PATH" - env: - CODEQL_PATH: ${{ steps.setup-codeql.outputs.codeql-path }} - - - name: Bump Action minor version if new CodeQL minor version series - id: bump-action-version - run: | - prior_cli_version=$(jq -r '.priorCliVersion' src/defaults.json) - cli_version=$(jq -r '.cliVersion' src/defaults.json) - - prior_minor=$(echo "$prior_cli_version" | cut -d. -f2) - current_minor=$(echo "$cli_version" | cut -d. -f2) - - if [[ "$current_minor" != "$prior_minor" ]]; then - echo "New CodeQL minor version series ($prior_cli_version -> $cli_version), bumping Action minor version" - npm version minor --no-git-tag-version - echo "bumped=true" >> "$GITHUB_OUTPUT" - else - echo "Same minor version series ($prior_cli_version -> $cli_version), skipping Action version bump" - echo "bumped=false" >> "$GITHUB_OUTPUT" - fi - - - name: Rebuild Action - run: npm run build - - - name: Commit and push changes - env: - RELEASE_TAG: "${{ github.event.release.tag_name }}" - run: | - git checkout -b "update-bundle/$RELEASE_TAG" - git commit -am "Update default bundle to $RELEASE_TAG" - git push --set-upstream origin "update-bundle/$RELEASE_TAG" - - - name: Open pull request - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ACTION_VERSION_BUMPED: ${{ steps.bump-action-version.outputs.bumped }} - run: | - cli_version=$(jq -r '.cliVersion' src/defaults.json) - action_version=$(jq -r '.version' package.json) - - pr_body="This pull request updates the default CodeQL bundle, as used with \`tools: linked\` and on GHES, to $cli_version." - if [[ "$ACTION_VERSION_BUMPED" == "true" ]]; then - pr_body+=$'\n\n'"Since this is a new CodeQL minor version series, this PR also bumps the Action version to $action_version." - fi - - pr_url=$(gh pr create \ - --title "Update default bundle to $cli_version" \ - --body "$pr_body" \ - --assignee "$GITHUB_ACTOR" \ - ) - echo "CLI_VERSION=$cli_version" | tee -a "$GITHUB_ENV" - echo "PR_URL=$pr_url" | tee -a "$GITHUB_ENV" - - - name: Create changelog note - run: | - npx tsx pr-checks/bundle-changelog.ts - - - name: Push changelog note - run: | - git commit -am "Add changelog note" - git push diff --git a/.github/workflows/update-release-branch.yml b/.github/workflows/update-release-branch.yml deleted file mode 100644 index 9f38f0f0b4..0000000000 --- a/.github/workflows/update-release-branch.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: Update release branch -on: - # You can trigger this workflow via workflow dispatch to start a release. - # This will open a PR to update the latest release branch. - workflow_dispatch: - - # When a release is complete this workflow will open up backport PRs to older release branches. - # NB while it will trigger on any release branch update, the backport job will not proceed for - # anything other than than releases/v{latest} - push: - branches: - - releases/* - -defaults: - run: - shell: bash - -jobs: - - prepare: - name: "Prepare release" - permissions: - contents: read - - uses: ./.github/workflows/prepare-release.yml - - update: - timeout-minutes: 45 - runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' - needs: [prepare] - env: - REF_NAME: "${{ github.ref_name }}" - REPOSITORY: "${{ github.repository }}" - MAJOR_VERSION: "${{ needs.prepare.outputs.major_version }}" - LATEST_TAG: "${{ needs.prepare.outputs.latest_tag }}" - permissions: - contents: write # needed to push commits - pull-requests: write # needed to create pull request - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 # Need full history for calculation of diffs - - uses: ./.github/actions/release-initialise - - # when the workflow has been manually triggered on main, - # we know that we definitely want the release branch to exist - - name: Ensure release branch exists - run: | - echo "MAJOR_VERSION ${MAJOR_VERSION}" - RELEASE_BRANCH=releases/${MAJOR_VERSION} - if git checkout $RELEASE_BRANCH > /dev/null 2>&1; then - echo "Branch $RELEASE_BRANCH already exists" - echo "" - else - echo "Creating $RELEASE_BRANCH branch" - git checkout -b ${RELEASE_BRANCH} ${LATEST_TAG} - git push --set-upstream origin ${RELEASE_BRANCH} - git branch --show-current - echo "" - fi - echo "Returning to branch: ${REF_NAME}" - git checkout ${REF_NAME} - - - name: Update current release branch - if: github.event_name == 'workflow_dispatch' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo SOURCE_BRANCH=${REF_NAME} - echo TARGET_BRANCH=releases/${MAJOR_VERSION} - npx tsx ./pr-checks/update-release-branch.ts \ - --repository-nwo ${{ github.repository }} \ - --source-branch '${{ env.REF_NAME }}' \ - --target-branch 'releases/${{ env.MAJOR_VERSION }}' \ - --is-primary-release \ - --conductor ${GITHUB_ACTOR} - - backport: - timeout-minutes: 45 - runs-on: ubuntu-latest - environment: Automation - needs: [prepare] - if: ${{ (github.event_name == 'push') && needs.prepare.outputs.backport_target_branches != '[]' }} - strategy: - fail-fast: false - matrix: - target_branch: ${{ fromJson(needs.prepare.outputs.backport_target_branches) }} - env: - SOURCE_BRANCH: ${{ needs.prepare.outputs.backport_source_branch }} - TARGET_BRANCH: ${{ matrix.target_branch }} - permissions: - contents: write # needed to push commits - pull-requests: write # needed to create pull request - steps: - - name: Generate token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - id: app-token - with: - app-id: ${{ vars.AUTOMATION_APP_ID }} - private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }} - - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 # Need full history for calculation of diffs - token: ${{ steps.app-token.outputs.token }} - - uses: ./.github/actions/release-initialise - - - name: Update older release branch - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo SOURCE_BRANCH=${SOURCE_BRANCH} - echo TARGET_BRANCH=${TARGET_BRANCH} - npx tsx ./pr-checks/update-release-branch.ts \ - --repository-nwo ${{ github.repository }} \ - --source-branch ${SOURCE_BRANCH} \ - --target-branch ${TARGET_BRANCH} \ - --conductor ${GITHUB_ACTOR} diff --git a/.github/workflows/update-supported-enterprise-server-versions.yml b/.github/workflows/update-supported-enterprise-server-versions.yml deleted file mode 100644 index ee2649ad0e..0000000000 --- a/.github/workflows/update-supported-enterprise-server-versions.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Update Supported Enterprise Server Versions - -on: - schedule: - - cron: "0 0 * * *" - workflow_dispatch: - pull_request: - branches: - - main - paths: - - .github/workflows/update-supported-enterprise-server-versions.yml - - pr-checks/update-ghes-versions.ts - -jobs: - update-supported-enterprise-server-versions: - name: Update Supported Enterprise Server Versions - timeout-minutes: 45 - runs-on: ubuntu-slim - if: github.repository == 'github/codeql-action' - permissions: - contents: write # needed to push commits - pull-requests: write # needed to create pull request - - steps: - - name: Checkout CodeQL Action - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Node.js - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 24 - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Checkout Enterprise Releases - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: github/enterprise-releases - token: ${{ secrets.CODEQL_CI_ENTERPRISE_RELEASE_PAT }} - path: ${{ github.workspace }}/enterprise-releases/ - sparse-checkout: releases.json - - - name: Update Supported Enterprise Server Versions - working-directory: pr-checks - run: | - npx tsx update-ghes-versions.ts - rm --recursive "$ENTERPRISE_RELEASES_PATH" - env: - ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/ - - - name: Rebuild - run: npm run build - - - name: Update git config - run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - - - name: Commit changes - id: prepare-commit - run: | - if [[ -z $(git status --porcelain) ]]; then - echo "No changes to commit" - echo "committed=false" >> $GITHUB_OUTPUT - else - git checkout -b update-supported-enterprise-server-versions - git add . - git commit --message "Update supported GitHub Enterprise Server versions" - - echo "committed=true" >> $GITHUB_OUTPUT - fi - - - name: Open PR - if: github.event_name != 'pull_request' && steps.prepare-commit.outputs.committed == 'true' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git push origin update-supported-enterprise-server-versions - - body="This PR updates the list of supported GitHub Enterprise Server versions, either because a new " - body+="version is about to be feature frozen, or because an old release has been deprecated." - body+=$'\n\n' - body+="If an old release has been deprecated, please follow the instructions in CONTRIBUTING.md to " - body+="deprecate the corresponding version of CodeQL." - - gh pr create --draft \ - --title "Update supported GitHub Enterprise Server versions" \ - --body "$body" diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 4dd74f80b6..0000000000 --- a/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Dependency directories -node_modules/ -# Build output for tests -build/ -# Java build files -.gradle/ -*.class -# macOS -.DS_Store -# eslint sarif report -eslint.sarif -# for local incremental compilation -tsconfig.tsbuildinfo -# esbuild metadata file -meta.json diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 4eae7876ff..0000000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -lockfile-version=3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index e1ae3d243a..0000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,20 +0,0 @@ -repos: - - repo: local - hooks: - - id: lint-ts - name: Lint typescript code - files: \.ts$ - language: system - entry: npm run lint -- --fix - - id: compile-ts - name: Compile typescript - files: \.[tj]s$ - language: system - entry: npm run build - pass_filenames: false - - id: pr-checks-sync - name: Synchronize PR check workflows - files: ^.github/workflows/__.*\.yml$|^pr-checks - language: system - entry: pr-checks/sync.sh - pass_filenames: false diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 79da9b2121..0000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "launch", - "name": "Debug AVA test file", - "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava", - "runtimeArgs": [ - "${file}", - "--break", - "--serial", - "--timeout=20m" - ], - "port": 9229, - "outputCapture": "std", - "skipFiles": [ - "/**/*.js" - ] - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index f417dd2a6e..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "files.exclude": { - // include the defaults from VS Code - "**/.git": true, - "**/.DS_Store": true, - - // transpiled JavaScript - "build": true, - "lib": true, - }, - "search.exclude": { - "**/node_modules": true, - "build": true, - "lib": true, - }, - // Installing a new Node package often triggers VS Code's git limit warnings as there is typically - // an intermediate stage where many files are modified. This setting suppresses these warnings. - "git.ignoreLimitWarning": true, - // Use the vendored TypeScript version to have a consistent development experience across - // machines. - "typescript.tsdk": "node_modules/typescript/lib", - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, -} diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 32a6e4c005..0000000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "type": "typescript", - "tsconfig": "tsconfig.json", - "option": "watch", - "problemMatcher": [ - "$tsc-watch" - ], - "group": "build", - "label": "tsc: watch - tsconfig.json" - } - ] -} \ No newline at end of file diff --git a/.vscode/tests.code-snippets b/.vscode/tests.code-snippets deleted file mode 100644 index 7c24572028..0000000000 --- a/.vscode/tests.code-snippets +++ /dev/null @@ -1,30 +0,0 @@ -{ - // Place your codeql-action workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and - // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope - // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is - // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: - // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. - // Placeholders with the same ids are connected. - // Example: - // "Print to console": { - // "scope": "javascript,typescript", - // "prefix": "log", - // "body": [ - // "console.log('$1');", - // "$2" - // ], - // "description": "Log output to console" - // } - "Test Macro": { - "scope": "javascript, typescript", - "prefix": "testMacro", - "body": [ - "const ${1:nameMacro} = makeMacro({", - " exec: async (t: ExecutionContext) => {},", - "", - " title: (providedTitle = \"\") => `${2:common title} - \\${providedTitle}`,", - "});", - ], - "description": "An Ava test macro", - }, -} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 628e41f689..0000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,1270 +0,0 @@ -# CodeQL Action Changelog - -See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. - -## [UNRELEASED] - -No user facing changes. - -## 4.37.7 - 13 Aug 2026 - -- Update default CodeQL bundle version to [2.26.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.3). [#4085](https://github.com/github/codeql-action/pull/4085) - -## 4.37.6 - 04 Aug 2026 - -- Changed the default filepath for the new remote file address format that was introduced in CodeQL Action 4.37.0 / 3.37.0 to `.github/codeql-config.yml` to align it with the suggested path that is used elsewhere. [#4070](https://github.com/github/codeql-action/pull/4070) - -## 4.37.5 - 03 Aug 2026 - -- Fixed a bug where a network error while streaming the download of the CodeQL bundle could terminate the `init` Action instead of falling back to downloading the bundle before extracting it. [#4061](https://github.com/github/codeql-action/pull/4061) - -## 4.37.4 - 29 Jul 2026 - -- This version of the CodeQL Action adds support for the `tools` input for the `codeql-action/init` step to be specified using a `github-codeql-tools` [repository property](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). This feature will gradually be rolled out following the release of this version. Once rolled out, this allows for the CodeQL CLI version that is used in GitHub-managed workflows, such as Default Setup, to be set to a custom value. For example, customers who run into issues with rate limits when a new CodeQL CLI version is released can set the value to `toolcache` to always use the CodeQL CLI version that is available in the runner toolcache. For Advanced Setup workflows, the value provided for `tools` in the workflow definition always takes precedence unless the value of the repository property starts with `!`. [#4037](https://github.com/github/codeql-action/pull/4037) -- Update default CodeQL bundle version to [2.26.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.2). [#4051](https://github.com/github/codeql-action/pull/4051) - -## 4.37.3 - 22 Jul 2026 - -No user facing changes. - -## 4.37.2 - 21 Jul 2026 - -- The new address format for the `config-file` input that was introduced in CodeQL Action 4.37.0 is now enabled by default. In addition to the format described there, the `remote=` prefix can now be used to explicitly indicate that the input refers to a remote file. All previous input formats continue to be accepted as well. [#4023](https://github.com/github/codeql-action/pull/4023) -- The CodeQL Action can now make use of [configured private registries](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries) in Default Setup to retrieve CodeQL configuration files from remote repositories that require authentication. This will allow customers to store their CodeQL configuration in a single repository that can then be referenced by Default Setup workflows in other repositories. We expect to roll this and other, related changes out to everyone in July. [#4007](https://github.com/github/codeql-action/pull/4007) - -## 4.37.1 - 16 Jul 2026 - -- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.20.6 and earlier. These versions of CodeQL were discontinued on 1 July 2026 alongside GitHub Enterprise Server 3.16, and will be unsupported by the next minor release of the CodeQL Action. [#3956](https://github.com/github/codeql-action/pull/3956) -- Update default CodeQL bundle version to [2.26.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.1). [#4019](https://github.com/github/codeql-action/pull/4019) - -## 4.37.0 - 08 Jul 2026 - -- Update default CodeQL bundle version to [2.26.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.0). [#3995](https://github.com/github/codeql-action/pull/3995) -- In addition to the existing input format, the `config-file` input for the `codeql-action/init` step will soon support a new `[owner/]repo[@ref][:path]` format. All components except the repository name are optional. If omitted, `owner` defaults to the same owner as the repository the analysis is running for, `ref` to `main`, and `path` to `.github/codeql-action.yaml`. Support for this format ships in this version of the CodeQL Action, but will only be enabled over the coming weeks. [#3973](https://github.com/github/codeql-action/pull/3973) - -## 4.36.3 - 01 Jul 2026 - -No user facing changes. - -## 4.36.2 - 04 Jun 2026 - -- Cache CodeQL CLI version information across Actions steps. [#3943](https://github.com/github/codeql-action/pull/3943) -- Reduce requests while waiting for analysis processing by using exponential backoff when polling SARIF processing status. [#3937](https://github.com/github/codeql-action/pull/3937) -- Update default CodeQL bundle version to [2.25.6](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.6). [#3948](https://github.com/github/codeql-action/pull/3948) - -## 4.36.1 - 02 Jun 2026 - -No user facing changes. - -## 4.36.0 - 22 May 2026 - -- _Breaking change_: Bump the minimum required CodeQL bundle version to 2.19.4. [#3894](https://github.com/github/codeql-action/pull/3894) -- Add support for SHA-256 Git object IDs. [#3893](https://github.com/github/codeql-action/pull/3893) -- Update default CodeQL bundle version to [2.25.5](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.5). [#3926](https://github.com/github/codeql-action/pull/3926) - -## 4.35.5 - 15 May 2026 - -- We have improved how the JavaScript bundles for the CodeQL Action are generated to avoid duplication across bundles and reduce the size of the repository by around 70%. This should have no effect on the runtime behaviour of the CodeQL Action. [#3899](https://github.com/github/codeql-action/pull/3899) -- For performance and accuracy reasons, [improved incremental analysis](https://github.com/github/roadmap/issues/1158) will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. [#3791](https://github.com/github/codeql-action/pull/3791) -- If multiple inputs are provided for the GitHub-internal `analysis-kinds` input, only `code-scanning` will be enabled. The `analysis-kinds` input is experimental, for GitHub-internal use only, and may change without notice at any time. [#3892](https://github.com/github/codeql-action/pull/3892) -- Added an experimental change which, when running a Code Scanning analysis for a PR with [improved incremental analysis](https://github.com/github/roadmap/issues/1158) enabled, prefers CodeQL CLI versions that have a cached overlay-base database for the configured languages. This speeds up analysis for a repository when there is not yet a cached overlay-base database for the latest CLI version. We expect to roll this change out to everyone in May. [#3880](https://github.com/github/codeql-action/pull/3880) - -## 4.35.4 - 07 May 2026 - -- Update default CodeQL bundle version to [2.25.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.4). [#3881](https://github.com/github/codeql-action/pull/3881) - -## 4.35.3 - 01 May 2026 - -- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. [#3837](https://github.com/github/codeql-action/pull/3837) -- Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. [#3850](https://github.com/github/codeql-action/pull/3850) -- Best-effort connection tests for private registries now use `GET` requests instead of `HEAD` for better compatibility with various registry implementations. For NuGet feeds, the test is now always performed against the service index. [#3853](https://github.com/github/codeql-action/pull/3853) -- Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. [#3852](https://github.com/github/codeql-action/pull/3852) -- Update default CodeQL bundle version to [2.25.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.3). [#3865](https://github.com/github/codeql-action/pull/3865) - -## 4.35.2 - 15 Apr 2026 - -- The undocumented TRAP cache cleanup feature that could be enabled using the `CODEQL_ACTION_CLEANUP_TRAP_CACHES` environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the `trap-caching: false` input to the `init` Action. [#3795](https://github.com/github/codeql-action/pull/3795) -- The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. [#3789](https://github.com/github/codeql-action/pull/3789) -- Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. [#3794](https://github.com/github/codeql-action/pull/3794) -- Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. [#3807](https://github.com/github/codeql-action/pull/3807) -- Update default CodeQL bundle version to [2.25.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.2). [#3823](https://github.com/github/codeql-action/pull/3823) - -## 4.35.1 - 27 Mar 2026 - -- Fix incorrect minimum required Git version for [improved incremental analysis](https://github.com/github/roadmap/issues/1158): it should have been 2.36.0, not 2.11.0. [#3781](https://github.com/github/codeql-action/pull/3781) - -## 4.35.0 - 27 Mar 2026 - -- Reduced the minimum Git version required for [improved incremental analysis](https://github.com/github/roadmap/issues/1158) from 2.38.0 to 2.11.0. [#3767](https://github.com/github/codeql-action/pull/3767) -- Update default CodeQL bundle version to [2.25.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.1). [#3773](https://github.com/github/codeql-action/pull/3773) - -## 4.34.1 - 20 Mar 2026 - -- Downgrade default CodeQL bundle version to [2.24.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.3) due to issues with a small percentage of Actions and JavaScript analyses. [#3762](https://github.com/github/codeql-action/pull/3762) - -## 4.34.0 - 20 Mar 2026 - -- Added an experimental change which disables TRAP caching when [improved incremental analysis](https://github.com/github/roadmap/issues/1158) is enabled, since improved incremental analysis supersedes TRAP caching. This will improve performance and reduce Actions cache usage. We expect to roll this change out to everyone in March. [#3569](https://github.com/github/codeql-action/pull/3569) -- We are rolling out improved incremental analysis to C/C++ analyses that use build mode `none`. We expect this rollout to be complete by the end of April 2026. [#3584](https://github.com/github/codeql-action/pull/3584) -- Update default CodeQL bundle version to [2.25.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.0). [#3585](https://github.com/github/codeql-action/pull/3585) - -## 4.33.0 - 16 Mar 2026 - -- Upcoming change: Starting April 2026, the CodeQL Action will skip collecting file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses. Pull request analyses will log a warning about this upcoming change. [#3562](https://github.com/github/codeql-action/pull/3562) - - To opt out of this change: - - **Repositories owned by an organization:** Create a custom repository property with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to `true` in the repository's settings. For more information, see [Managing custom properties for repositories in your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). Alternatively, if you are using an advanced setup workflow, you can set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true` in your workflow. - - **User-owned repositories using default setup:** Switch to an advanced setup workflow and set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true` in your workflow. - - **User-owned repositories using advanced setup:** Set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true` in your workflow. -- Fixed [a bug](https://github.com/github/codeql-action/issues/3555) which caused the CodeQL Action to fail loading repository properties if a "Multi select" repository property was configured for the repository. [#3557](https://github.com/github/codeql-action/pull/3557) -- The CodeQL Action now loads [custom repository properties](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization) on GitHub Enterprise Server, enabling the customization of features such as `github-codeql-disable-overlay` that was previously only available on GitHub.com. [#3559](https://github.com/github/codeql-action/pull/3559) -- Once [private package registries](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries) can be configured with OIDC-based authentication for organizations, the CodeQL Action will now be able to accept such configurations. [#3563](https://github.com/github/codeql-action/pull/3563) -- Fixed the retry mechanism for database uploads. Previously this would fail with the error "Response body object should not be disturbed or locked". [#3564](https://github.com/github/codeql-action/pull/3564) -- A warning is now emitted if the CodeQL Action detects a repository property whose name suggests that it relates to the CodeQL Action, but which is not one of the properties recognised by the current version of the CodeQL Action. [#3570](https://github.com/github/codeql-action/pull/3570) - -## 4.32.6 - 05 Mar 2026 - -- Update default CodeQL bundle version to [2.24.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.3). [#3548](https://github.com/github/codeql-action/pull/3548) - -## 4.32.5 - 02 Mar 2026 - -- Repositories owned by an organization can now set up the `github-codeql-disable-overlay` custom repository property to disable [improved incremental analysis for CodeQL](https://github.com/github/roadmap/issues/1158). First, create a custom repository property with the name `github-codeql-disable-overlay` and the type "True/false" in the organization's settings. Then in the repository's settings, set this property to `true` to disable improved incremental analysis. For more information, see [Managing custom properties for repositories in your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). This feature is not yet available on GitHub Enterprise Server. [#3507](https://github.com/github/codeql-action/pull/3507) -- Added an experimental change so that when [improved incremental analysis](https://github.com/github/roadmap/issues/1158) fails on a runner — potentially due to insufficient disk space — the failure is recorded in the Actions cache so that subsequent runs will automatically skip improved incremental analysis until something changes (e.g. a larger runner is provisioned or a new CodeQL version is released). We expect to roll this change out to everyone in March. [#3487](https://github.com/github/codeql-action/pull/3487) -- The minimum memory check for improved incremental analysis is now skipped for CodeQL 2.24.3 and later, which has reduced peak RAM usage. [#3515](https://github.com/github/codeql-action/pull/3515) -- Reduced log levels for best-effort private package registry connection check failures to reduce noise from workflow annotations. [#3516](https://github.com/github/codeql-action/pull/3516) -- Added an experimental change which lowers the minimum disk space requirement for [improved incremental analysis](https://github.com/github/roadmap/issues/1158), enabling it to run on standard GitHub Actions runners. We expect to roll this change out to everyone in March. [#3498](https://github.com/github/codeql-action/pull/3498) -- Added an experimental change which allows the `start-proxy` action to resolve the CodeQL CLI version from feature flags instead of using the linked CLI bundle version. We expect to roll this change out to everyone in March. [#3512](https://github.com/github/codeql-action/pull/3512) -- The previously experimental changes from versions 4.32.3, 4.32.4, 3.32.3 and 3.32.4 are now enabled by default. [#3503](https://github.com/github/codeql-action/pull/3503), [#3504](https://github.com/github/codeql-action/pull/3504) - -## 4.32.4 - 20 Feb 2026 - -- Update default CodeQL bundle version to [2.24.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.2). [#3493](https://github.com/github/codeql-action/pull/3493) -- Added an experimental change which improves how certificates are generated for the authentication proxy that is used by the CodeQL Action in Default Setup when [private package registries are configured](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries). This is expected to generate more widely compatible certificates and should have no impact on analyses which are working correctly already. We expect to roll this change out to everyone in February. [#3473](https://github.com/github/codeql-action/pull/3473) -- When the CodeQL Action is run [with debugging enabled in Default Setup](https://docs.github.com/en/code-security/how-tos/scan-code-for-vulnerabilities/troubleshooting/troubleshooting-analysis-errors/logs-not-detailed-enough#creating-codeql-debugging-artifacts-for-codeql-default-setup) and [private package registries are configured](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries), the "Setup proxy for registries" step will output additional diagnostic information that can be used for troubleshooting. [#3486](https://github.com/github/codeql-action/pull/3486) -- Added a setting which allows the CodeQL Action to enable network debugging for Java programs. This will help GitHub staff support customers with troubleshooting issues in GitHub-managed CodeQL workflows, such as Default Setup. This setting can only be enabled by GitHub staff. [#3485](https://github.com/github/codeql-action/pull/3485) -- Added a setting which enables GitHub-managed workflows, such as Default Setup, to use a [nightly CodeQL CLI release](https://github.com/dsp-testing/codeql-cli-nightlies) instead of the latest, stable release that is used by default. This will help GitHub staff support customers whose analyses for a given repository or organization require early access to a change in an upcoming CodeQL CLI release. This setting can only be enabled by GitHub staff. [#3484](https://github.com/github/codeql-action/pull/3484) - -## 4.32.3 - 13 Feb 2026 - -- Added experimental support for testing connections to [private package registries](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries). This feature is not currently enabled for any analysis. In the future, it may be enabled by default for Default Setup. [#3466](https://github.com/github/codeql-action/pull/3466) - -## 4.32.2 - 05 Feb 2026 - -- Update default CodeQL bundle version to [2.24.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.1). [#3460](https://github.com/github/codeql-action/pull/3460) - -## 4.32.1 - 02 Feb 2026 - -- A warning is now shown in Default Setup workflow logs if a [private package registry is configured](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries) using a GitHub Personal Access Token (PAT), but no username is configured. [#3422](https://github.com/github/codeql-action/pull/3422) -- Fixed a bug which caused the CodeQL Action to fail when repository properties cannot successfully be retrieved. [#3421](https://github.com/github/codeql-action/pull/3421) - -## 4.32.0 - 26 Jan 2026 - -- Update default CodeQL bundle version to [2.24.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.0). [#3425](https://github.com/github/codeql-action/pull/3425) - -## 4.31.11 - 23 Jan 2026 - -- When running a Default Setup workflow with [Actions debugging enabled](https://docs.github.com/en/actions/how-tos/monitor-workflows/enable-debug-logging), the CodeQL Action will now use more unique names when uploading logs from the Dependabot authentication proxy as workflow artifacts. This ensures that the artifact names do not clash between multiple jobs in a build matrix. [#3409](https://github.com/github/codeql-action/pull/3409) -- Improved error handling throughout the CodeQL Action. [#3415](https://github.com/github/codeql-action/pull/3415) -- Added experimental support for automatically excluding [generated files](https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github) from the analysis. This feature is not currently enabled for any analysis. In the future, it may be enabled by default for some GitHub-managed analyses. [#3318](https://github.com/github/codeql-action/pull/3318) -- The changelog extracts that are included with releases of the CodeQL Action are now shorter to avoid duplicated information from appearing in Dependabot PRs. [#3403](https://github.com/github/codeql-action/pull/3403) - -## 4.31.10 - 12 Jan 2026 - -- Update default CodeQL bundle version to 2.23.9. [#3393](https://github.com/github/codeql-action/pull/3393) - -## 4.31.9 - 16 Dec 2025 - -No user facing changes. - -## 4.31.8 - 11 Dec 2025 - -- Update default CodeQL bundle version to 2.23.8. [#3354](https://github.com/github/codeql-action/pull/3354) - -## 4.31.7 - 05 Dec 2025 - -- Update default CodeQL bundle version to 2.23.7. [#3343](https://github.com/github/codeql-action/pull/3343) - -## 4.31.6 - 01 Dec 2025 - -No user facing changes. - -## 4.31.5 - 24 Nov 2025 - -- Update default CodeQL bundle version to 2.23.6. [#3321](https://github.com/github/codeql-action/pull/3321) - -## 4.31.4 - 18 Nov 2025 - -No user facing changes. - -## 4.31.3 - 13 Nov 2025 - -- CodeQL Action v3 will be deprecated in December 2026. The Action now logs a warning for customers who are running v3 but could be running v4. For more information, see [Upcoming deprecation of CodeQL Action v3](https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/). -- Update default CodeQL bundle version to 2.23.5. [#3288](https://github.com/github/codeql-action/pull/3288) - -## 4.31.2 - 30 Oct 2025 - -No user facing changes. - -## 4.31.1 - 30 Oct 2025 - -- The `add-snippets` input has been removed from the `analyze` action. This input has been deprecated since CodeQL Action 3.26.4 in August 2024 when this removal was announced. - -## 4.31.0 - 24 Oct 2025 - -- Bump minimum CodeQL bundle version to 2.17.6. [#3223](https://github.com/github/codeql-action/pull/3223) -- When SARIF files are uploaded by the `analyze` or `upload-sarif` actions, the CodeQL Action automatically performs post-processing steps to prepare the data for the upload. Previously, these post-processing steps were only performed before an upload took place. We are now changing this so that the post-processing steps will always be performed, even when the SARIF files are not uploaded. This does not change anything for the `upload-sarif` action. For `analyze`, this may affect Advanced Setup for CodeQL users who specify a value other than `always` for the `upload` input. [#3222](https://github.com/github/codeql-action/pull/3222) - -## 4.30.9 - 17 Oct 2025 - -- Update default CodeQL bundle version to 2.23.3. [#3205](https://github.com/github/codeql-action/pull/3205) -- Experimental: A new `setup-codeql` action has been added which is similar to `init`, except it only installs the CodeQL CLI and does not initialize a database. Do not use this in production as it is part of an internal experiment and subject to change at any time. [#3204](https://github.com/github/codeql-action/pull/3204) - -## 4.30.8 - 10 Oct 2025 - -No user facing changes. - -## 4.30.7 - 06 Oct 2025 - -- [v4+ only] The CodeQL Action now runs on Node.js v24. [#3169](https://github.com/github/codeql-action/pull/3169) - -## 3.30.6 - 02 Oct 2025 - -- Update default CodeQL bundle version to 2.23.2. [#3168](https://github.com/github/codeql-action/pull/3168) - -## 3.30.5 - 26 Sep 2025 - -- We fixed a bug that was introduced in `3.30.4` with `upload-sarif` which resulted in files without a `.sarif` extension not getting uploaded. [#3160](https://github.com/github/codeql-action/pull/3160) - -## 3.30.4 - 25 Sep 2025 - -- We have improved the CodeQL Action's ability to validate that the workflow it is used in does not use different versions of the CodeQL Action for different workflow steps. Mixing different versions of the CodeQL Action in the same workflow is unsupported and can lead to unpredictable results. A warning will now be emitted from the `codeql-action/init` step if different versions of the CodeQL Action are detected in the workflow file. Additionally, an error will now be thrown by the other CodeQL Action steps if they load a configuration file that was generated by a different version of the `codeql-action/init` step. [#3099](https://github.com/github/codeql-action/pull/3099) and [#3100](https://github.com/github/codeql-action/pull/3100) -- We added support for reducing the size of dependency caches for Java analyses, which will reduce cache usage and speed up workflows. This will be enabled automatically at a later time. [#3107](https://github.com/github/codeql-action/pull/3107) -- You can now run the latest CodeQL nightly bundle by passing `tools: nightly` to the `init` action. In general, the nightly bundle is unstable and we only recommend running it when directed by GitHub staff. [#3130](https://github.com/github/codeql-action/pull/3130) -- Update default CodeQL bundle version to 2.23.1. [#3118](https://github.com/github/codeql-action/pull/3118) - -## 3.30.3 - 10 Sep 2025 - -No user facing changes. - -## 3.30.2 - 09 Sep 2025 - -- Fixed a bug which could cause language autodetection to fail. [#3084](https://github.com/github/codeql-action/pull/3084) -- Experimental: The `quality-queries` input that was added in `3.29.2` as part of an internal experiment is now deprecated and will be removed in an upcoming version of the CodeQL Action. It has been superseded by a new `analysis-kinds` input, which is part of the same internal experiment. Do not use this in production as it is subject to change at any time. [#3064](https://github.com/github/codeql-action/pull/3064) - -## 3.30.1 - 05 Sep 2025 - -- Update default CodeQL bundle version to 2.23.0. [#3077](https://github.com/github/codeql-action/pull/3077) - -## 3.30.0 - 01 Sep 2025 - -- Reduce the size of the CodeQL Action, speeding up workflows by approximately 4 seconds. [#3054](https://github.com/github/codeql-action/pull/3054) - -## 3.29.11 - 21 Aug 2025 - -- Update default CodeQL bundle version to 2.22.4. [#3044](https://github.com/github/codeql-action/pull/3044) - -## 3.29.10 - 18 Aug 2025 - -No user facing changes. - -## 3.29.9 - 12 Aug 2025 - -No user facing changes. - -## 3.29.8 - 08 Aug 2025 - -- Fix an issue where the Action would autodetect unsupported languages such as HTML. [#3015](https://github.com/github/codeql-action/pull/3015) - -## 3.29.7 - 07 Aug 2025 - -This release rolls back 3.29.6 to address issues with language autodetection. It is identical to 3.29.5. - -## 3.29.6 - 07 Aug 2025 - -- The `cleanup-level` input to the `analyze` Action is now deprecated. The CodeQL Action has written a limited amount of intermediate results to the database since version 2.2.5, and now automatically manages cleanup. [#2999](https://github.com/github/codeql-action/pull/2999) -- Update default CodeQL bundle version to 2.22.3. [#3000](https://github.com/github/codeql-action/pull/3000) - -## 3.29.5 - 29 Jul 2025 - -- Update default CodeQL bundle version to 2.22.2. [#2986](https://github.com/github/codeql-action/pull/2986) - -## 3.29.4 - 23 Jul 2025 - -No user facing changes. - -## 3.29.3 - 21 Jul 2025 - -No user facing changes. - -## 3.29.2 - 30 Jun 2025 - -- Experimental: When the `quality-queries` input for the `init` action is provided with an argument, separate `.quality.sarif` files are produced and uploaded for each language with the results of the specified queries. Do not use this in production as it is part of an internal experiment and subject to change at any time. [#2935](https://github.com/github/codeql-action/pull/2935) - -## 3.29.1 - 27 Jun 2025 - -- Fix bug in PR analysis where user-provided `include` query filter fails to exclude non-included queries. [#2938](https://github.com/github/codeql-action/pull/2938) -- Update default CodeQL bundle version to 2.22.1. [#2950](https://github.com/github/codeql-action/pull/2950) - -## 3.29.0 - 11 Jun 2025 - -- Update default CodeQL bundle version to 2.22.0. [#2925](https://github.com/github/codeql-action/pull/2925) -- Bump minimum CodeQL bundle version to 2.16.6. [#2912](https://github.com/github/codeql-action/pull/2912) - -## 3.28.21 - 28 July 2025 - -No user facing changes. - -## 3.28.20 - 21 July 2025 - -- Remove support for combining SARIF files from a single upload for GHES 3.18, see [the changelog post](https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload/). [#2959](https://github.com/github/codeql-action/pull/2959) - -## 3.28.19 - 03 Jun 2025 - -- The CodeQL Action no longer includes its own copy of the extractor for the `actions` language, which is currently in public preview. - The `actions` extractor has been included in the CodeQL CLI since v2.20.6. If your workflow has enabled the `actions` language _and_ you have pinned - your `tools:` property to a specific version of the CodeQL CLI earlier than v2.20.6, you will need to update to at least CodeQL v2.20.6 or disable - `actions` analysis. -- Update default CodeQL bundle version to 2.21.4. [#2910](https://github.com/github/codeql-action/pull/2910) - -## 3.28.18 - 16 May 2025 - -- Update default CodeQL bundle version to 2.21.3. [#2893](https://github.com/github/codeql-action/pull/2893) -- Skip validating SARIF produced by CodeQL for improved performance. [#2894](https://github.com/github/codeql-action/pull/2894) -- The number of threads and amount of RAM used by CodeQL can now be set via the `CODEQL_THREADS` and `CODEQL_RAM` runner environment variables. If set, these environment variables override the `threads` and `ram` inputs respectively. [#2891](https://github.com/github/codeql-action/pull/2891) - -## 3.28.17 - 02 May 2025 - -- Update default CodeQL bundle version to 2.21.2. [#2872](https://github.com/github/codeql-action/pull/2872) - -## 3.28.16 - 23 Apr 2025 - -- Update default CodeQL bundle version to 2.21.1. [#2863](https://github.com/github/codeql-action/pull/2863) - -## 3.28.15 - 07 Apr 2025 - -- Fix bug where the action would fail if it tried to produce a debug artifact with more than 65535 files. [#2842](https://github.com/github/codeql-action/pull/2842) - -## 3.28.14 - 07 Apr 2025 - -- Update default CodeQL bundle version to 2.21.0. [#2838](https://github.com/github/codeql-action/pull/2838) - -## 3.28.13 - 24 Mar 2025 - -No user facing changes. - -## 3.28.12 - 19 Mar 2025 - -- Dependency caching should now cache more dependencies for Java `build-mode: none` extractions. This should speed up workflows and avoid inconsistent alerts in some cases. -- Update default CodeQL bundle version to 2.20.7. [#2810](https://github.com/github/codeql-action/pull/2810) - -## 3.28.11 - 07 Mar 2025 - -- Update default CodeQL bundle version to 2.20.6. [#2793](https://github.com/github/codeql-action/pull/2793) - -## 3.28.10 - 21 Feb 2025 - -- Update default CodeQL bundle version to 2.20.5. [#2772](https://github.com/github/codeql-action/pull/2772) -- Address an issue where the CodeQL Bundle would occasionally fail to decompress on macOS. [#2768](https://github.com/github/codeql-action/pull/2768) - -## 3.28.9 - 07 Feb 2025 - -- Update default CodeQL bundle version to 2.20.4. [#2753](https://github.com/github/codeql-action/pull/2753) - -## 3.28.8 - 29 Jan 2025 - -- Enable support for Kotlin 2.1.10 when running with CodeQL CLI v2.20.3. [#2744](https://github.com/github/codeql-action/pull/2744) - -## 3.28.7 - 29 Jan 2025 - -No user facing changes. - -## 3.28.6 - 27 Jan 2025 - -- Re-enable debug artifact upload for CLI versions 2.20.3 or greater. [#2726](https://github.com/github/codeql-action/pull/2726) - -## 3.28.5 - 24 Jan 2025 - -- Update default CodeQL bundle version to 2.20.3. [#2717](https://github.com/github/codeql-action/pull/2717) - -## 3.28.4 - 23 Jan 2025 - -No user facing changes. - -## 3.28.3 - 22 Jan 2025 - -- Update default CodeQL bundle version to 2.20.2. [#2707](https://github.com/github/codeql-action/pull/2707) -- Fix an issue downloading the CodeQL Bundle from a GitHub Enterprise Server instance which occurred when the CodeQL Bundle had been synced to the instance using the [CodeQL Action sync tool](https://github.com/github/codeql-action-sync-tool) and the Actions runner did not have Zstandard installed. [#2710](https://github.com/github/codeql-action/pull/2710) -- Uploading debug artifacts for CodeQL analysis is temporarily disabled. [#2712](https://github.com/github/codeql-action/pull/2712) - -## 3.28.2 - 21 Jan 2025 - -No user facing changes. - -## 3.28.1 - 10 Jan 2025 - -- CodeQL Action v2 is now deprecated, and is no longer updated or supported. For better performance, improved security, and new features, upgrade to v3. For more information, see [this changelog post](https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/). [#2677](https://github.com/github/codeql-action/pull/2677) -- Update default CodeQL bundle version to 2.20.1. [#2678](https://github.com/github/codeql-action/pull/2678) - -## 3.28.0 - 20 Dec 2024 - -- Bump the minimum CodeQL bundle version to 2.15.5. [#2655](https://github.com/github/codeql-action/pull/2655) -- Don't fail in the unusual case that a file is on the search path. [#2660](https://github.com/github/codeql-action/pull/2660). - -## 3.27.9 - 12 Dec 2024 - -No user facing changes. - -## 3.27.8 - 12 Dec 2024 - -- Fixed an issue where streaming the download and extraction of the CodeQL bundle did not respect proxy settings. [#2624](https://github.com/github/codeql-action/pull/2624) - -## 3.27.7 - 10 Dec 2024 - -- We are rolling out a change in December 2024 that will extract the CodeQL bundle directly to the toolcache to improve performance. [#2631](https://github.com/github/codeql-action/pull/2631) -- Update default CodeQL bundle version to 2.20.0. [#2636](https://github.com/github/codeql-action/pull/2636) - -## 3.27.6 - 03 Dec 2024 - -- Update default CodeQL bundle version to 2.19.4. [#2626](https://github.com/github/codeql-action/pull/2626) - -## 3.27.5 - 19 Nov 2024 - -No user facing changes. - -## 3.27.4 - 14 Nov 2024 - -No user facing changes. - -## 3.27.3 - 12 Nov 2024 - -No user facing changes. - -## 3.27.2 - 12 Nov 2024 - -- Fixed an issue where setting up the CodeQL tools would sometimes fail with the message "Invalid value 'undefined' for header 'authorization'". [#2590](https://github.com/github/codeql-action/pull/2590) - -## 3.27.1 - 08 Nov 2024 - -- The CodeQL Action now downloads bundles compressed using Zstandard on GitHub Enterprise Server when using Linux or macOS runners. This speeds up the installation of the CodeQL tools. This feature is already available to GitHub.com users. [#2573](https://github.com/github/codeql-action/pull/2573) -- Update default CodeQL bundle version to 2.19.3. [#2576](https://github.com/github/codeql-action/pull/2576) - -## 3.27.0 - 22 Oct 2024 - -- Bump the minimum CodeQL bundle version to 2.14.6. [#2549](https://github.com/github/codeql-action/pull/2549) -- Fix an issue where the `upload-sarif` Action would fail with "upload-sarif post-action step failed: Input required and not supplied: token" when called in a composite Action that had a different set of inputs to the ones expected by the `upload-sarif` Action. [#2557](https://github.com/github/codeql-action/pull/2557) -- Update default CodeQL bundle version to 2.19.2. [#2552](https://github.com/github/codeql-action/pull/2552) - -## 3.26.13 - 14 Oct 2024 - -No user facing changes. - -## 3.26.12 - 07 Oct 2024 - -- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.14.5 and earlier. These versions of CodeQL were discontinued on 24 September 2024 alongside GitHub Enterprise Server 3.10, and will be unsupported by CodeQL Action versions 3.27.0 and later and versions 2.27.0 and later. [#2520](https://github.com/github/codeql-action/pull/2520) - - - If you are using one of these versions, please update to CodeQL CLI version 2.14.6 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version. - - - Alternatively, if you want to continue using a version of the CodeQL CLI between 2.13.5 and 2.14.5, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.26.11` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.26.11` in your code scanning workflow to ensure you continue using this version of the CodeQL Action. - -## 3.26.11 - 03 Oct 2024 - -- _Upcoming breaking change_: Add support for using `actions/download-artifact@v4` to programmatically consume CodeQL Action debug artifacts. - - Starting November 30, 2024, GitHub.com customers will [no longer be able to use `actions/download-artifact@v3`](https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/). Therefore, to avoid breakage, customers who programmatically download the CodeQL Action debug artifacts should set the `CODEQL_ACTION_ARTIFACT_V4_UPGRADE` environment variable to `true` and bump `actions/download-artifact@v3` to `actions/download-artifact@v4` in their workflows. The CodeQL Action will enable this behavior by default in early November and workflows that have not yet bumped `actions/download-artifact@v3` to `actions/download-artifact@v4` will begin failing then. - - This change is currently unavailable for GitHub Enterprise Server customers, as `actions/upload-artifact@v4` and `actions/download-artifact@v4` are not yet compatible with GHES. -- Update default CodeQL bundle version to 2.19.1. [#2519](https://github.com/github/codeql-action/pull/2519) - -## 3.26.10 - 30 Sep 2024 - -- We are rolling out a feature in September/October 2024 that sets up CodeQL using a bundle compressed with [Zstandard](http://facebook.github.io/zstd/). Our aim is to improve the performance of setting up CodeQL. [#2502](https://github.com/github/codeql-action/pull/2502) - -## 3.26.9 - 24 Sep 2024 - -No user facing changes. - -## 3.26.8 - 19 Sep 2024 - -- Update default CodeQL bundle version to 2.19.0. [#2483](https://github.com/github/codeql-action/pull/2483) - -## 3.26.7 - 13 Sep 2024 - -- Update default CodeQL bundle version to 2.18.4. [#2471](https://github.com/github/codeql-action/pull/2471) - -## 3.26.6 - 29 Aug 2024 - -- Update default CodeQL bundle version to 2.18.3. [#2449](https://github.com/github/codeql-action/pull/2449) - -## 3.26.5 - 23 Aug 2024 - -- Fix an issue where the `csrutil` system call used for telemetry would fail on macOS ARM machines with System Integrity Protection disabled. [#2441](https://github.com/github/codeql-action/pull/2441) - -## 3.26.4 - 21 Aug 2024 - -- _Deprecation:_ The `add-snippets` input on the `analyze` Action is deprecated and will be removed in the first release in August 2025. [#2436](https://github.com/github/codeql-action/pull/2436) -- Fix an issue where the disk usage system call used for telemetry would fail on macOS ARM machines with System Integrity Protection disabled, and then surface a warning. The system call is now disabled for these machines. [#2434](https://github.com/github/codeql-action/pull/2434) - -## 3.26.3 - 19 Aug 2024 - -- Fix an issue where the CodeQL Action could not write diagnostic messages on Windows. This issue did not impact analysis quality. [#2430](https://github.com/github/codeql-action/pull/2430) - -## 3.26.2 - 14 Aug 2024 - -- Update default CodeQL bundle version to 2.18.2. [#2417](https://github.com/github/codeql-action/pull/2417) - -## 3.26.1 - 13 Aug 2024 - -No user facing changes. - -## 3.26.0 - 06 Aug 2024 - -- _Deprecation:_ Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner if this affects you. [#2403](https://github.com/github/codeql-action/pull/2403) -- Bump the minimum CodeQL bundle version to 2.13.5. [#2408](https://github.com/github/codeql-action/pull/2408) - -## 3.25.15 - 26 Jul 2024 - -- Update default CodeQL bundle version to 2.18.1. [#2385](https://github.com/github/codeql-action/pull/2385) - -## 3.25.14 - 25 Jul 2024 - -- Experimental: add a new `start-proxy` action which starts the same HTTP proxy as used by [`github/dependabot-action`](https://github.com/github/dependabot-action). Do not use this in production as it is part of an internal experiment and subject to change at any time. [#2376](https://github.com/github/codeql-action/pull/2376) - -## 3.25.13 - 19 Jul 2024 - -- Add `codeql-version` to outputs. [#2368](https://github.com/github/codeql-action/pull/2368) -- Add a deprecation warning for customers using CodeQL version 2.13.4 and earlier. These versions of CodeQL were discontinued on 9 July 2024 alongside GitHub Enterprise Server 3.9, and will be unsupported by CodeQL Action versions 3.26.0 and later and versions 2.26.0 and later. [#2375](https://github.com/github/codeql-action/pull/2375) - - If you are using one of these versions, please update to CodeQL CLI version 2.13.5 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version. - - Alternatively, if you want to continue using a version of the CodeQL CLI between 2.12.6 and 2.13.4, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.25.13` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.25.13` in your code scanning workflow to ensure you continue using this version of the CodeQL Action. - -## 3.25.12 - 12 Jul 2024 - -- Improve the reliability and performance of analyzing code when analyzing a compiled language with the `autobuild` [build mode](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes) on GitHub Enterprise Server. This feature is already available to GitHub.com users. [#2353](https://github.com/github/codeql-action/pull/2353) -- Update default CodeQL bundle version to 2.18.0. [#2364](https://github.com/github/codeql-action/pull/2364) - -## 3.25.11 - 28 Jun 2024 - -- Avoid failing the workflow run if there is an error while uploading debug artifacts. [#2349](https://github.com/github/codeql-action/pull/2349) -- Update default CodeQL bundle version to 2.17.6. [#2352](https://github.com/github/codeql-action/pull/2352) - -## 3.25.10 - 13 Jun 2024 - -- Update default CodeQL bundle version to 2.17.5. [#2327](https://github.com/github/codeql-action/pull/2327) - -## 3.25.9 - 12 Jun 2024 - -- Avoid failing database creation if the database folder already exists and contains some unexpected files. Requires CodeQL 2.18.0 or higher. [#2330](https://github.com/github/codeql-action/pull/2330) -- The init Action will attempt to clean up the database cluster directory before creating a new database and at the end of the job. This will help to avoid issues where the database cluster directory is left in an inconsistent state. [#2332](https://github.com/github/codeql-action/pull/2332) - -## 3.25.8 - 04 Jun 2024 - -- Update default CodeQL bundle version to 2.17.4. [#2321](https://github.com/github/codeql-action/pull/2321) - -## 3.25.7 - 31 May 2024 - -- We are rolling out a feature in May/June 2024 that will reduce the Actions cache usage of the Action by keeping only the newest TRAP cache for each language. [#2306](https://github.com/github/codeql-action/pull/2306) - -## 3.25.6 - 20 May 2024 - -- Update default CodeQL bundle version to 2.17.3. [#2295](https://github.com/github/codeql-action/pull/2295) - -## 3.25.5 - 13 May 2024 - -- Add a compatibility matrix of supported CodeQL Action, CodeQL CLI, and GitHub Enterprise Server versions to the [README.md](README.md). [#2273](https://github.com/github/codeql-action/pull/2273) -- Avoid printing out a warning for a missing `on.push` trigger when the CodeQL Action is triggered via a `workflow_call` event. [#2274](https://github.com/github/codeql-action/pull/2274) -- The `tools: latest` input to the `init` Action has been renamed to `tools: linked`. This option specifies that the Action should use the tools shipped at the same time as the Action. The old name will continue to work for backwards compatibility, but we recommend that new workflows use the new name. [#2281](https://github.com/github/codeql-action/pull/2281) - -## 3.25.4 - 08 May 2024 - -- Update default CodeQL bundle version to 2.17.2. [#2270](https://github.com/github/codeql-action/pull/2270) - -## 3.25.3 - 25 Apr 2024 - -- Update default CodeQL bundle version to 2.17.1. [#2247](https://github.com/github/codeql-action/pull/2247) -- Workflows running on `macos-latest` using CodeQL CLI versions before v2.15.1 will need to either upgrade their CLI version to v2.15.1 or newer, or change the platform to an Intel macOS runner, such as `macos-12`. ARM machines with SIP disabled, including the newest `macos-latest` image, are unsupported for CLI versions before 2.15.1. [#2261](https://github.com/github/codeql-action/pull/2261) - -## 3.25.2 - 22 Apr 2024 - -No user facing changes. - -## 3.25.1 - 17 Apr 2024 - -- We are rolling out a feature in April/May 2024 that improves the reliability and performance of analyzing code when analyzing a compiled language with the `autobuild` [build mode](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes). [#2235](https://github.com/github/codeql-action/pull/2235) -- Fix a bug where the `init` Action would fail if `--overwrite` was specified in `CODEQL_ACTION_EXTRA_OPTIONS`. [#2245](https://github.com/github/codeql-action/pull/2245) - -## 3.25.0 - 15 Apr 2024 - -- The deprecated feature for extracting dependencies for a Python analysis has been removed. [#2224](https://github.com/github/codeql-action/pull/2224) - - As a result, the following inputs and environment variables are now ignored: - - - The `setup-python-dependencies` input to the `init` Action - - The `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION` environment variable - - We recommend removing any references to these from your workflows. For more information, see the release notes for CodeQL Action v3.23.0 and v2.23.0. -- Automatically overwrite an existing database if found on the filesystem. [#2229](https://github.com/github/codeql-action/pull/2229) -- Bump the minimum CodeQL bundle version to 2.12.6. [#2232](https://github.com/github/codeql-action/pull/2232) -- A more relevant log message and a diagnostic are now emitted when the `file` program is not installed on a Linux runner, but is required for Go tracing to succeed. [#2234](https://github.com/github/codeql-action/pull/2234) - -## 3.24.10 - 05 Apr 2024 - -- Update default CodeQL bundle version to 2.17.0. [#2219](https://github.com/github/codeql-action/pull/2219) -- Add a deprecation warning for customers using CodeQL version 2.12.5 and earlier. These versions of CodeQL were discontinued on 26 March 2024 alongside GitHub Enterprise Server 3.8, and will be unsupported by CodeQL Action versions 3.25.0 and later and versions 2.25.0 and later. [#2220](https://github.com/github/codeql-action/pull/2220) - - If you are using one of these versions, please update to CodeQL CLI version 2.12.6 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version. - - Alternatively, if you want to continue using a version of the CodeQL CLI between 2.11.6 and 2.12.5, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.24.10` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.24.10` in your code scanning workflow to ensure you continue using this version of the CodeQL Action. - -## 3.24.9 - 22 Mar 2024 - -- Update default CodeQL bundle version to 2.16.5. [#2203](https://github.com/github/codeql-action/pull/2203) - -## 3.24.8 - 18 Mar 2024 - -- Improve the ease of debugging extraction issues by increasing the verbosity of the extractor logs when running in debug mode. [#2195](https://github.com/github/codeql-action/pull/2195) - -## 3.24.7 - 12 Mar 2024 - -- Update default CodeQL bundle version to 2.16.4. [#2185](https://github.com/github/codeql-action/pull/2185) - -## 3.24.6 - 29 Feb 2024 - -No user facing changes. - -## 3.24.5 - 23 Feb 2024 - -- Update default CodeQL bundle version to 2.16.3. [#2156](https://github.com/github/codeql-action/pull/2156) - -## 3.24.4 - 21 Feb 2024 - -- Fix an issue where an existing, but empty, `/sys/fs/cgroup/cpuset.cpus` file always resulted in a single-threaded run. [#2151](https://github.com/github/codeql-action/pull/2151) - -## 3.24.3 - 15 Feb 2024 - -- Fix an issue where the CodeQL Action would fail to load a configuration specified by the `config` input to the `init` Action. [#2147](https://github.com/github/codeql-action/pull/2147) - -## 3.24.2 - 15 Feb 2024 - -- Enable improved multi-threaded performance on larger runners for GitHub Enterprise Server users. This feature is already available to GitHub.com users. [#2141](https://github.com/github/codeql-action/pull/2141) - -## 3.24.1 - 13 Feb 2024 - -- Update default CodeQL bundle version to 2.16.2. [#2124](https://github.com/github/codeql-action/pull/2124) -- The CodeQL action no longer fails if it can't write to the telemetry api endpoint. [#2121](https://github.com/github/codeql-action/pull/2121) - -## 3.24.0 - 02 Feb 2024 - -- CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See [release notes for 3.23.0](#3230---08-jan-2024) for more details. [#2106](https://github.com/github/codeql-action/pull/2106) - -## 3.23.2 - 26 Jan 2024 - -- On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers. [#2083](https://github.com/github/codeql-action/pull/2083) -- Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096) - -## 3.23.1 - 17 Jan 2024 - -- Update default CodeQL bundle version to 2.16.0. [#2073](https://github.com/github/codeql-action/pull/2073) -- Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. [#2079](https://github.com/github/codeql-action/pull/2079) - -## 3.23.0 - 08 Jan 2024 - -- We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false` in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. [#2031](https://github.com/github/codeql-action/pull/2031) -- The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see [the corresponding changelog entry for CodeQL Action version 2.22.7](#2227---16-nov-2023). [#2009](https://github.com/github/codeql-action/pull/2009) - -## 3.22.12 - 22 Dec 2023 - -- Update default CodeQL bundle version to 2.15.5. [#2047](https://github.com/github/codeql-action/pull/2047) - -## 3.22.11 - 13 Dec 2023 - -- [v3+ only] The CodeQL Action now runs on Node.js v20. [#2006](https://github.com/github/codeql-action/pull/2006) - -## 2.22.10 - 12 Dec 2023 - -- Update default CodeQL bundle version to 2.15.4. [#2016](https://github.com/github/codeql-action/pull/2016) - -## 2.22.9 - 07 Dec 2023 - -No user facing changes. - -## 2.22.8 - 23 Nov 2023 - -- Update default CodeQL bundle version to 2.15.3. [#2001](https://github.com/github/codeql-action/pull/2001) - -## 2.22.7 - 16 Nov 2023 - -- Add a deprecation warning for customers using CodeQL version 2.11.5 and earlier. These versions of CodeQL were discontinued on 8 November 2023 alongside GitHub Enterprise Server 3.7, and will be unsupported by CodeQL Action v2.23.0 and later. [#1993](https://github.com/github/codeql-action/pull/1993) - - If you are using one of these versions, please update to CodeQL CLI version 2.11.6 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version. - - Alternatively, if you want to continue using a version of the CodeQL CLI between 2.10.5 and 2.11.5, you can replace `github/codeql-action/*@v2` by `github/codeql-action/*@v2.22.7` in your code scanning workflow to ensure you continue using this version of the CodeQL Action. - -## 2.22.6 - 14 Nov 2023 - -- Customers running Python analysis on macOS using version 2.14.6 or earlier of the CodeQL CLI should upgrade to CodeQL CLI version 2.15.0 or later. If you do not wish to upgrade the CodeQL CLI, ensure that you are using Python version 3.11 or earlier, as CodeQL version 2.14.6 and earlier do not support Python 3.12. You can achieve this by adding a [`setup-python`](https://github.com/actions/setup-python) step to your code scanning workflow before the step that invokes `github/codeql-action/init`. -- Update default CodeQL bundle version to 2.15.2. [#1978](https://github.com/github/codeql-action/pull/1978) - -## 2.22.5 - 27 Oct 2023 - -No user facing changes. - -## 2.22.4 - 20 Oct 2023 - -- Update default CodeQL bundle version to 2.15.1. [#1953](https://github.com/github/codeql-action/pull/1953) -- Users will begin to see warnings on Node.js 16 deprecation in their Actions logs on code scanning runs starting October 23, 2023. - - All code scanning workflows should continue to succeed regardless of the warning. - - The team at GitHub maintaining the CodeQL Action is aware of the deprecation timeline and actively working on creating another version of the CodeQL Action, v3, that will bump us to Node 20. - - For more information, and to communicate with the maintaining team, please use [this issue](https://github.com/github/codeql-action/issues/1959). - -## 2.22.3 - 13 Oct 2023 - -- Provide an authentication token when downloading the CodeQL Bundle from the API of a GitHub Enterprise Server instance. [#1945](https://github.com/github/codeql-action/pull/1945) - -## 2.22.2 - 12 Oct 2023 - -- Update default CodeQL bundle version to 2.15.0. [#1938](https://github.com/github/codeql-action/pull/1938) -- Improve the log output when an error occurs in an invocation of the CodeQL CLI. [#1927](https://github.com/github/codeql-action/pull/1927) - -## 2.22.1 - 09 Oct 2023 - -- Add a workaround for Python 3.12, which is not supported in CodeQL CLI version 2.14.6 or earlier. If you are running an analysis on Windows and using Python 3.12 or later, the CodeQL Action will switch to running Python 3.11. In this case, if Python 3.11 is not found, then the workflow will fail. [#1928](https://github.com/github/codeql-action/pull/1928) - -## 2.22.0 - 06 Oct 2023 - -- The CodeQL Action now requires CodeQL version 2.10.5 or later. For more information, see the corresponding changelog entry for CodeQL Action version 2.21.8. [#1907](https://github.com/github/codeql-action/pull/1907) -- The CodeQL Action no longer runs ML-powered queries. For more information, including details on our investment in AI-powered security technology, see ["CodeQL code scanning deprecates ML-powered alerts."](https://github.blog/changelog/2023-09-29-codeql-code-scanning-deprecates-ml-powered-alerts/) [#1910](https://github.com/github/codeql-action/pull/1910) -- Fix a bug which prevented tracing of projects using Go 1.21 and above on Linux. [#1909](https://github.com/github/codeql-action/pull/1909) - -## 2.21.9 - 27 Sep 2023 - -- Update default CodeQL bundle version to 2.14.6. [#1897](https://github.com/github/codeql-action/pull/1897) -- We are rolling out a feature in October 2023 that will improve the success rate of C/C++ autobuild. [#1889](https://github.com/github/codeql-action/pull/1889) -- We are rolling out a feature in October 2023 that will provide specific file coverage information for C and C++, Java and Kotlin, and JavaScript and TypeScript. Currently file coverage information for each of these pairs of languages is grouped together. [#1903](https://github.com/github/codeql-action/pull/1903) -- Add a warning to help customers avoid inadvertently analyzing the same CodeQL language in multiple matrix jobs. [#1901](https://github.com/github/codeql-action/pull/1901) - -## 2.21.8 - 19 Sep 2023 - -- Add a deprecation warning for customers using CodeQL version 2.10.4 and earlier. These versions of CodeQL were discontinued on 12 September 2023 alongside GitHub Enterprise Server 3.6, and will be unsupported by the next minor release of the CodeQL Action. [#1884](https://github.com/github/codeql-action/pull/1884) - - If you are using one of these versions, please update to CodeQL CLI version 2.10.5 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version. - - Alternatively, if you want to continue using a version of the CodeQL CLI between 2.9.5 and 2.10.4, you can replace `github/codeql-action/*@v2` by `github/codeql-action/*@v2.21.7` in your code scanning workflow to ensure you continue using this version of the CodeQL Action. -- Enable the following language aliases when using CodeQL 2.14.4 and later: `c-cpp` for C/C++ analysis, `java-kotlin` for Java/Kotlin analysis, and `javascript-typescript` for JavaScript/TypeScript analysis. [#1883](https://github.com/github/codeql-action/pull/1883) - -## 2.21.7 - 14 Sep 2023 - -- Update default CodeQL bundle version to 2.14.5. [#1882](https://github.com/github/codeql-action/pull/1882) - -## 2.21.6 - 13 Sep 2023 - -- Better error message when there is a failure to determine the merge base of the code to analysis. [#1860](https://github.com/github/codeql-action/pull/1860) -- Improve the calculation of default amount of RAM used for query execution on GitHub Enterprise Server. This now reduces in proportion to the runner's total memory to better account for system memory usage, helping to avoid out-of-memory failures on larger runners. This feature is already available to GitHub.com users. [#1866](https://github.com/github/codeql-action/pull/1866) -- Enable improved file coverage information for GitHub Enterprise Server users. This feature is already available to GitHub.com users. [#1867](https://github.com/github/codeql-action/pull/1867) -- Update default CodeQL bundle version to 2.14.4. [#1873](https://github.com/github/codeql-action/pull/1873) - -## 2.21.5 - 28 Aug 2023 - -- Update default CodeQL bundle version to 2.14.3. [#1845](https://github.com/github/codeql-action/pull/1845) -- Fixed a bug in CodeQL Action 2.21.3 onwards that affected beta support for [Project Lombok](https://projectlombok.org/) when analyzing Java. The environment variable `CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS` will now be respected if it was manually configured in the workflow. [#1844](https://github.com/github/codeql-action/pull/1844) -- Enable support for Kotlin 1.9.20 when running with CodeQL CLI v2.13.4 through v2.14.3. [#1853](https://github.com/github/codeql-action/pull/1853) - -## 2.21.4 - 14 Aug 2023 - -- Update default CodeQL bundle version to 2.14.2. [#1831](https://github.com/github/codeql-action/pull/1831) -- Log a warning if the amount of available disk space runs low during a code scanning run. [#1825](https://github.com/github/codeql-action/pull/1825) -- When downloading CodeQL bundle version 2.13.4 and later, cache these bundles in the Actions tool cache using a simpler version number. [#1832](https://github.com/github/codeql-action/pull/1832) -- Fix an issue that first appeared in CodeQL Action v2.21.2 that prevented CodeQL invocations from being logged. [#1833](https://github.com/github/codeql-action/pull/1833) -- We are rolling out a feature in August 2023 that will improve the quality of file coverage information. [#1835](https://github.com/github/codeql-action/pull/1835) - -## 2.21.3 - 08 Aug 2023 - -- We are rolling out a feature in August 2023 that will improve multi-threaded performance on larger runners. [#1817](https://github.com/github/codeql-action/pull/1817) -- We are rolling out a feature in August 2023 that adds beta support for [Project Lombok](https://projectlombok.org/) when analyzing Java. [#1809](https://github.com/github/codeql-action/pull/1809) -- Reduce disk space usage when downloading the CodeQL bundle. [#1820](https://github.com/github/codeql-action/pull/1820) - -## 2.21.2 - 28 Jul 2023 - -- Update default CodeQL bundle version to 2.14.1. [#1797](https://github.com/github/codeql-action/pull/1797) -- Avoid duplicating the analysis summary within the logs. [#1811](https://github.com/github/codeql-action/pull/1811) - -## 2.21.1 - 26 Jul 2023 - -- Improve the handling of fatal errors from the CodeQL CLI. [#1795](https://github.com/github/codeql-action/pull/1795) -- Add the `sarif-output` output to the analyze action that contains the path to the directory of the generated SARIF. [#1799](https://github.com/github/codeql-action/pull/1799) - -## 2.21.0 - 19 Jul 2023 - -- CodeQL Action now requires CodeQL CLI 2.9.4 or later. For more information, see the corresponding changelog entry for CodeQL Action version 2.20.4. [#1724](https://github.com/github/codeql-action/pull/1724) - -## 2.20.4 - 14 Jul 2023 - -- This is the last release of the Action that supports CodeQL CLI versions 2.8.5 to 2.9.3. These versions of the CodeQL CLI were deprecated on June 20, 2023 alongside GitHub Enterprise Server 3.5 and will not be supported by the next release of the CodeQL Action (2.21.0). - - If you are using one of these versions, please update to CodeQL CLI version 2.9.4 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version. - - Alternatively, if you want to continue using a version of the CodeQL CLI between 2.8.5 and 2.9.3, you can replace 'github/codeql-action/*@v2' by 'github/codeql-action/*@v2.20.4' in your code scanning workflow to ensure you continue using this version of the CodeQL Action. -- We are rolling out a feature in July 2023 that will slightly reduce the default amount of RAM used for query execution, in proportion to the runner's total memory. This will help to avoid out-of-memory failures on larger runners. [#1760](https://github.com/github/codeql-action/pull/1760) -- Update default CodeQL bundle version to 2.14.0. [#1762](https://github.com/github/codeql-action/pull/1762) - -## 2.20.3 - 06 Jul 2023 - -- Update default CodeQL bundle version to 2.13.5. [#1743](https://github.com/github/codeql-action/pull/1743) - -## 2.20.2 - 03 Jul 2023 - -No user facing changes. - -## 2.20.1 - 21 Jun 2023 - -- Update default CodeQL bundle version to 2.13.4. [#1721](https://github.com/github/codeql-action/pull/1721) -- Experimental: add a new `resolve-environment` action which attempts to infer a configuration for the build environment that is required to build a given project. Do not use this in production as it is part of an internal experiment and subject to change at any time. - -## 2.20.0 - 13 Jun 2023 - -- Bump the version of the Action to 2.20.0. This ensures that users who received a Dependabot upgrade to [`cdcdbb5`](https://github.com/github/codeql-action/commit/cdcdbb579706841c47f7063dda365e292e5cad7a), which was mistakenly marked as Action version 2.13.4, continue to receive updates to the CodeQL Action. Full details in [#1729](https://github.com/github/codeql-action/pull/1729) - -## 2.3.6 - 01 Jun 2023 - -- Update default CodeQL bundle version to 2.13.3. [#1698](https://github.com/github/codeql-action/pull/1698) - -## 2.3.5 - 25 May 2023 - -- Allow invalid URIs to be used as values to `artifactLocation.uri` properties. This reverses a change from [#1668](https://github.com/github/codeql-action/pull/1668) that inadvertently led to stricter validation of some URI values. [#1705](https://github.com/github/codeql-action/pull/1705) -- Gracefully handle invalid URIs when fingerprinting. [#1694](https://github.com/github/codeql-action/pull/1694) - -## 2.3.4 - 24 May 2023 - -- Updated the SARIF 2.1.0 JSON schema file to the latest from [oasis-tcs/sarif-spec](https://github.com/oasis-tcs/sarif-spec/blob/123e95847b13fbdd4cbe2120fa5e33355d4a042b/Schemata/sarif-schema-2.1.0.json). [#1668](https://github.com/github/codeql-action/pull/1668) -- We are rolling out a feature in May 2023 that will disable Python dependency installation for new users of the CodeQL Action. This improves the speed of analysis while having only a very minor impact on results. [#1676](https://github.com/github/codeql-action/pull/1676) -- We are improving the way that [CodeQL bundles](https://github.com/github/codeql-action/releases) are tagged to make it possible to easily identify bundles by their CodeQL semantic version. [#1682](https://github.com/github/codeql-action/pull/1682) - - As of CodeQL CLI 2.13.4, CodeQL bundles will be tagged using semantic versions, for example `codeql-bundle-v2.13.4`, instead of timestamps, like `codeql-bundle-20230615`. - - This change does not affect the majority of workflows, and we will not be changing tags for existing bundle releases. - - Some workflows with custom logic that depends on the specific format of the CodeQL bundle tag may need to be updated. For example, if your workflow matches CodeQL bundle tag names against a `codeql-bundle-yyyymmdd` pattern, you should update it to also recognize `codeql-bundle-vx.y.z` tags. -- Remove the requirement for `on.push` and `on.pull_request` to trigger on the same branches. [#1675](https://github.com/github/codeql-action/pull/1675) - -## 2.3.3 - 04 May 2023 - -- Update default CodeQL bundle version to 2.13.1. [#1664](https://github.com/github/codeql-action/pull/1664) -- You can now configure CodeQL within your code scanning workflow by passing a `config` input to the `init` Action. See [Using a custom configuration file](https://aka.ms/code-scanning-docs/config-file) for more information about configuring code scanning. [#1590](https://github.com/github/codeql-action/pull/1590) - -## 2.3.2 - 27 Apr 2023 - -No user facing changes. - -## 2.3.1 - 26 Apr 2023 - -No user facing changes. - -## 2.3.0 - 21 Apr 2023 - -- Update default CodeQL bundle version to 2.13.0. [#1649](https://github.com/github/codeql-action/pull/1649) -- Bump the minimum CodeQL bundle version to 2.8.5. [#1618](https://github.com/github/codeql-action/pull/1618) - -## 2.2.12 - 13 Apr 2023 - -- Include the value of the `GITHUB_RUN_ATTEMPT` environment variable in the telemetry sent to GitHub. [#1640](https://github.com/github/codeql-action/pull/1640) -- Improve the ease of debugging failed runs configured using [default setup](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically). The CodeQL Action will now upload diagnostic information to Code Scanning from failed runs configured using default setup. You can view this diagnostic information on the [tool status page](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-the-tool-status-page). [#1619](https://github.com/github/codeql-action/pull/1619) - -## 2.2.11 - 06 Apr 2023 - -No user facing changes. - -## 2.2.10 - 05 Apr 2023 - -- Update default CodeQL bundle version to 2.12.6. [#1629](https://github.com/github/codeql-action/pull/1629) - -## 2.2.9 - 27 Mar 2023 - -- Customers post-processing the SARIF output of the `analyze` Action before uploading it to Code Scanning will benefit from an improved debugging experience. [#1598](https://github.com/github/codeql-action/pull/1598) - - The CodeQL Action will now upload a SARIF file with debugging information to Code Scanning on failed runs for customers using `upload: false`. Previously, this was only available for customers using the default value of the `upload` input. - - The `upload` input to the `analyze` Action now accepts the following values: - - `always` is the default value, which uploads the SARIF file to Code Scanning for successful and failed runs. - - `failure-only` is recommended for customers post-processing the SARIF file before uploading it to Code Scanning. This option uploads debugging information to Code Scanning for failed runs to improve the debugging experience. - - `never` avoids uploading the SARIF file to Code Scanning even if the code scanning run fails. This is not recommended for external users since it complicates debugging. - - The legacy `true` and `false` options will be interpreted as `always` and `failure-only` respectively. - -## 2.2.8 - 22 Mar 2023 - -- Update default CodeQL bundle version to 2.12.5. [#1585](https://github.com/github/codeql-action/pull/1585) - -## 2.2.7 - 15 Mar 2023 - -No user facing changes. - -## 2.2.6 - 10 Mar 2023 - -- Update default CodeQL bundle version to 2.12.4. [#1561](https://github.com/github/codeql-action/pull/1561) - -## 2.2.5 - 24 Feb 2023 - -- Update default CodeQL bundle version to 2.12.3. [#1543](https://github.com/github/codeql-action/pull/1543) - -## 2.2.4 - 10 Feb 2023 - -No user facing changes. - -## 2.2.3 - 08 Feb 2023 - -- Update default CodeQL bundle version to 2.12.2. [#1518](https://github.com/github/codeql-action/pull/1518) - -## 2.2.2 - 06 Feb 2023 - -- Fix an issue where customers using the CodeQL Action with the [CodeQL Action sync tool](https://docs.github.com/en/enterprise-server@3.7/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-code-scanning-for-your-appliance#configuring-codeql-analysis-on-a-server-without-internet-access) would not be able to obtain the CodeQL tools. [#1517](https://github.com/github/codeql-action/pull/1517) - -## 2.2.1 - 27 Jan 2023 - -No user facing changes. - -## 2.2.0 - 26 Jan 2023 - -- Improve stability when choosing the default version of CodeQL to use in code scanning workflow runs on Actions on GitHub.com. [#1475](https://github.com/github/codeql-action/pull/1475) - - This change addresses customer reports of code scanning alerts on GitHub.com being closed and reopened during the rollout of new versions of CodeQL in the GitHub Actions [runner images](https://github.com/actions/runner-images). - - **No change is required for the majority of workflows**, including: - - Workflows on GitHub.com hosted runners using the latest version (`v2`) of the CodeQL Action. - - Workflows on GitHub.com hosted runners that are pinned to specific versions of the CodeQL Action from `v2.2.0` onwards. - - Workflows on GitHub Enterprise Server. - - **A change may be required** for workflows on GitHub.com hosted runners that are pinned to specific versions of the CodeQL Action before `v2.2.0` (e.g. `v2.1.32`): - - Previously, these workflows would obtain the latest version of CodeQL from the Actions runner image. - - Now, these workflows will download an older, compatible version of CodeQL from GitHub Releases. To use this older version, no change is required. To use the newest version of CodeQL, please update your workflows to reference the latest version of the CodeQL Action (`v2`). - - **Internal changes** - - These changes will not affect the majority of code scanning workflows. Continue reading only if your workflow uses [@actions/tool-cache](https://github.com/actions/toolkit/tree/main/packages/tool-cache) or relies on the precise location of CodeQL within the Actions tool cache. - - The tool cache now contains **two** recent CodeQL versions (previously **one**). - - Each CodeQL version is located under a directory named after the release date and version number, e.g. CodeQL 2.11.6 is now located under `CodeQL/2.11.6-20221211/x64/codeql` (previously `CodeQL/0.0.0-20221211/x64/codeql`). -- The maximum number of [SARIF runs](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#run-object) per file has been increased from 15 to 20 for users uploading SARIF files to GitHub.com. This change will help ensure that Code Scanning can process SARIF files generated by third-party tools that have many runs. See the [GitHub API documentation](https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data) for a list of all the limits around uploading SARIF. This change will be released to GitHub Enterprise Server as part of GHES 3.9. -- Update default CodeQL bundle version to 2.12.1. [#1498](https://github.com/github/codeql-action/pull/1498) -- Fix a bug that forced the `init` Action to run for at least two minutes on JavaScript. [#1494](https://github.com/github/codeql-action/pull/1494) - -## 2.1.39 - 18 Jan 2023 - -- CodeQL Action v1 is now deprecated, and is no longer updated or supported. For better performance, improved security, and new features, upgrade to v2. For more information, see [this changelog post](https://github.blog/changelog/2023-01-18-code-scanning-codeql-action-v1-is-now-deprecated/). [#1467](https://github.com/github/codeql-action/pull/1466) -- Python automatic dependency installation will no longer fail for projects using Poetry that specify `virtualenvs.options.no-pip = true` in their `poetry.toml`. [#1431](https://github.com/github/codeql-action/pull/1431) -- Avoid printing a stack trace and error message when the action fails to find the SHA at the - current directory. This will happen in several non-error states and so we now avoid cluttering the - log with this message. [#1485](https://github.com/github/codeql-action/pull/1485) - -## 2.1.38 - 12 Jan 2023 - -- Update default CodeQL bundle version to 2.12.0. [#1466](https://github.com/github/codeql-action/pull/1466) - -## 2.1.37 - 14 Dec 2022 - -- Update default CodeQL bundle version to 2.11.6. [#1433](https://github.com/github/codeql-action/pull/1433) - -## 2.1.36 - 08 Dec 2022 - -- Update default CodeQL bundle version to 2.11.5. [#1412](https://github.com/github/codeql-action/pull/1412) -- Add a step that tries to upload a SARIF file for the workflow run when that workflow run fails. This will help better surface failed code scanning workflow runs. [#1393](https://github.com/github/codeql-action/pull/1393) -- Python automatic dependency installation will no longer consider dependency code installed in venv as user-written, for projects using Poetry that specify `virtualenvs.in-project = true` in their `poetry.toml`. [#1419](https://github.com/github/codeql-action/pull/1419) - -## 2.1.35 - 01 Dec 2022 - -No user facing changes. - -## 2.1.34 - 25 Nov 2022 - -- Update default CodeQL bundle version to 2.11.4. [#1391](https://github.com/github/codeql-action/pull/1391) -- Fixed a bug where some the `init` action and the `analyze` action would have different sets of experimental feature flags enabled. [#1384](https://github.com/github/codeql-action/pull/1384) - -## 2.1.33 - 16 Nov 2022 - -- Go is now analyzed in the same way as other compiled languages such as C/C++, C#, and Java. This completes the rollout of the feature described in [CodeQL Action version 2.1.27](#2127---06-oct-2022). [#1322](https://github.com/github/codeql-action/pull/1322) -- Bump the minimum CodeQL bundle version to 2.6.3. [#1358](https://github.com/github/codeql-action/pull/1358) - -## 2.1.32 - 14 Nov 2022 - -- Update default CodeQL bundle version to 2.11.3. [#1348](https://github.com/github/codeql-action/pull/1348) -- Update the ML-powered additional query pack for JavaScript to version 0.4.0. [#1351](https://github.com/github/codeql-action/pull/1351) - -## 2.1.31 - 04 Nov 2022 - -- The `rb/weak-cryptographic-algorithm` Ruby query has been updated to no longer report uses of hash functions such as `MD5` and `SHA1` even if they are known to be weak. These hash algorithms are used very often in non-sensitive contexts, making the query too imprecise in practice. For more information, see the corresponding change in the [github/codeql repository](https://github.com/github/codeql/pull/11129). [#1344](https://github.com/github/codeql-action/pull/1344) - -## 2.1.30 - 02 Nov 2022 - -- Improve the error message when using CodeQL bundle version 2.7.2 and earlier in a workflow that runs on a runner image such as `ubuntu-22.04` that uses glibc version 2.34 and later. [#1334](https://github.com/github/codeql-action/pull/1334) - -## 2.1.29 - 26 Oct 2022 - -- Update default CodeQL bundle version to 2.11.2. [#1320](https://github.com/github/codeql-action/pull/1320) - -## 2.1.28 - 18 Oct 2022 - -- Update default CodeQL bundle version to 2.11.1. [#1294](https://github.com/github/codeql-action/pull/1294) -- Replace uses of GitHub Actions command `set-output` because it is now deprecated. See more information in the [GitHub Changelog](https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/). [#1301](https://github.com/github/codeql-action/pull/1301) - -## 2.1.27 - 06 Oct 2022 - -- We are rolling out a feature of the CodeQL Action in October 2022 that changes the way that Go code is analyzed to be more consistent with other compiled languages like C/C++, C#, and Java. You do not need to alter your code scanning workflows. If you encounter any problems, please [file an issue](https://github.com/github/codeql-action/issues) or open a private ticket with GitHub Support and request an escalation to engineering. - -## 2.1.26 - 29 Sep 2022 - -- Update default CodeQL bundle version to 2.11.0. [#1267](https://github.com/github/codeql-action/pull/1267) - -## 2.1.25 - 21 Sep 2022 - -- We will soon be rolling out a feature of the CodeQL Action that stores some information used to make future runs faster in the GitHub Actions cache. Initially, this will only be enabled on JavaScript repositories, but we plan to add more languages to this soon. The new feature can be disabled by passing the `trap-caching: false` option to your workflow's `init` step, for example if you are already using the GitHub Actions cache for a different purpose and are near the storage limit for it. -- Add support for Python automatic dependency installation with Poetry 1.2 [#1258](https://github.com/github/codeql-action/pull/1258) - -## 2.1.24 - 16 Sep 2022 - -No user facing changes. - -## 2.1.23 - 14 Sep 2022 - -- Allow CodeQL packs to be downloaded from GitHub Enterprise Server instances, using the new `registries` input for the `init` action. [#1221](https://github.com/github/codeql-action/pull/1221) -- Update default CodeQL bundle version to 2.10.5. [#1240](https://github.com/github/codeql-action/pull/1240) - -## 2.1.22 - 01 Sep 2022 - -- Downloading CodeQL packs has been moved to the `init` step. Previously, CodeQL packs were downloaded during the `analyze` step. [#1218](https://github.com/github/codeql-action/pull/1218) -- Update default CodeQL bundle version to 2.10.4. [#1224](https://github.com/github/codeql-action/pull/1224) -- The newly released [Poetry 1.2](https://python-poetry.org/blog/announcing-poetry-1.2.0) is not yet supported. In the most common case where the CodeQL Action is automatically installing Python dependencies, it will continue to install and use Poetry 1.1 on its own. However, in certain cases such as with self-hosted runners, you may need to ensure Poetry 1.1 is installed yourself. - -## 2.1.21 - 25 Aug 2022 - -- Improve error messages when the code scanning configuration file includes an invalid `queries` block or an invalid `query-filters` block. [#1208](https://github.com/github/codeql-action/pull/1208) -- Fix a bug where Go build tracing could fail on Windows. [#1209](https://github.com/github/codeql-action/pull/1209) - -## 2.1.20 - 22 Aug 2022 - -No user facing changes. - -## 2.1.19 - 17 Aug 2022 - -- Add the ability to filter queries from a code scanning run by using the `query-filters` option in the code scanning configuration file. [#1098](https://github.com/github/codeql-action/pull/1098) -- In debug mode, debug artifacts are now uploaded even if a step in the Actions workflow fails. [#1159](https://github.com/github/codeql-action/pull/1159) -- Update default CodeQL bundle version to 2.10.3. [#1178](https://github.com/github/codeql-action/pull/1178) -- The combination of python2 and Pipenv is no longer supported. [#1181](https://github.com/github/codeql-action/pull/1181) - -## 2.1.18 - 03 Aug 2022 - -- Update default CodeQL bundle version to 2.10.2. [#1156](https://github.com/github/codeql-action/pull/1156) - -## 2.1.17 - 28 Jul 2022 - -- Update default CodeQL bundle version to 2.10.1. [#1143](https://github.com/github/codeql-action/pull/1143) - -## 2.1.16 - 13 Jul 2022 - -- You can now quickly debug a job that uses the CodeQL Action by re-running the job from the GitHub UI and selecting the "Enable debug logging" option. [#1132](https://github.com/github/codeql-action/pull/1132) -- You can now see diagnostic messages produced by the analysis in the logs of the `analyze` Action by enabling debug mode. To enable debug mode, pass `debug: true` to the `init` Action, or [enable step debug logging](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging). This feature is available for CodeQL CLI version 2.10.0 and later. [#1133](https://github.com/github/codeql-action/pull/1133) - -## 2.1.15 - 28 Jun 2022 - -- CodeQL query packs listed in the `packs` configuration field will be skipped if their target language is not being analyzed in the current Actions job. Previously, this would throw an error. [#1116](https://github.com/github/codeql-action/pull/1116) -- The combination of python2 and poetry is no longer supported. See for more details. [#1124](https://github.com/github/codeql-action/pull/1124) -- Update default CodeQL bundle version to 2.10.0. [#1123](https://github.com/github/codeql-action/pull/1123) - -## 2.1.14 - 22 Jun 2022 - -No user facing changes. - -## 2.1.13 - 21 Jun 2022 - -- Update default CodeQL bundle version to 2.9.4. [#1100](https://github.com/github/codeql-action/pull/1100) - -## 2.1.12 - 01 Jun 2022 - -- Update default CodeQL bundle version to 2.9.3. [#1084](https://github.com/github/codeql-action/pull/1084) - -## 2.1.11 - 17 May 2022 - -- Update default CodeQL bundle version to 2.9.2. [#1074](https://github.com/github/codeql-action/pull/1074) - -## 2.1.10 - 10 May 2022 - -- Update default CodeQL bundle version to 2.9.1. [#1056](https://github.com/github/codeql-action/pull/1056) -- When `wait-for-processing` is enabled, the workflow will now fail if there were any errors that occurred during processing of the analysis results. - -## 2.1.9 - 27 Apr 2022 - -- Add `working-directory` input to the `autobuild` action. [#1024](https://github.com/github/codeql-action/pull/1024) -- The `analyze` and `upload-sarif` actions will now wait up to 2 minutes for processing to complete after they have uploaded the results so they can report any processing errors that occurred. This behavior can be disabled by setting the `wait-for-processing` action input to `"false"`. [#1007](https://github.com/github/codeql-action/pull/1007) -- Update default CodeQL bundle version to 2.9.0. -- Fix a bug where [status reporting fails on Windows](https://github.com/github/codeql-action/issues/1041). [#1042](https://github.com/github/codeql-action/pull/1042) - -## 2.1.8 - 08 Apr 2022 - -- Update default CodeQL bundle version to 2.8.5. [#1014](https://github.com/github/codeql-action/pull/1014) -- Fix error where the init action would fail due to a GitHub API request that was taking too long to complete [#1025](https://github.com/github/codeql-action/pull/1025) - -## 2.1.7 - 05 Apr 2022 - -- A bug where additional queries specified in the workflow file would sometimes not be respected has been fixed. [#1018](https://github.com/github/codeql-action/pull/1018) - -## 2.1.6 - 30 Mar 2022 - -- [v2+ only] The CodeQL Action now runs on Node.js v16. [#1000](https://github.com/github/codeql-action/pull/1000) -- Update default CodeQL bundle version to 2.8.4. [#990](https://github.com/github/codeql-action/pull/990) -- Fix a bug where an invalid `commit_oid` was being sent to code scanning when a custom checkout path was being used. [#956](https://github.com/github/codeql-action/pull/956) - -## 1.1.5 - 15 Mar 2022 - -- Update default CodeQL bundle version to 2.8.3. -- The CodeQL runner is now deprecated and no longer being released. For more information, see [CodeQL runner deprecation](https://github.blog/changelog/2021-09-21-codeql-runner-deprecation/). -- Fix two bugs that cause action failures with GHES 3.3 or earlier. [#978](https://github.com/github/codeql-action/pull/978) - - Fix `not a permitted key` invalid requests with GHES 3.1 or earlier - - Fix `RUNNER_ARCH environment variable must be set` errors with GHES 3.3 or earlier - -## 1.1.4 - 07 Mar 2022 - -- Update default CodeQL bundle version to 2.8.2. [#950](https://github.com/github/codeql-action/pull/950) -- Fix a bug where old results can be uploaded if the languages in a repository change when using a non-ephemeral self-hosted runner. [#955](https://github.com/github/codeql-action/pull/955) - -## 1.1.3 - 23 Feb 2022 - -- Fix a bug where the CLR traces can continue tracing even after tracing should be stopped. [#938](https://github.com/github/codeql-action/pull/938) - -## 1.1.2 - 17 Feb 2022 - -- Due to potential issues for GHES 3.1–3.3 customers who are using recent versions of the CodeQL Action via GHES Connect, the CodeQL Action now uses Node.js v12 rather than Node.js v16. [#937](https://github.com/github/codeql-action/pull/937) - -## 1.1.1 - 17 Feb 2022 - -- The CodeQL CLI versions up to and including version 2.4.4 are not compatible with the CodeQL Action 1.1.1 and later. The Action will emit an error if it detects that it is being used by an incompatible version of the CLI. [#931](https://github.com/github/codeql-action/pull/931) -- Update default CodeQL bundle version to 2.8.1. [#925](https://github.com/github/codeql-action/pull/925) - -## 1.1.0 - 11 Feb 2022 - -- The CodeQL Action now uses Node.js v16. [#909](https://github.com/github/codeql-action/pull/909) -- Beware that the CodeQL build tracer in this release (and in all earlier releases) is incompatible with Windows 11 and Windows Server 2022. This incompatibility affects database extraction for compiled languages: cpp, csharp, go, and java. As a result, analyzing these languages with the `windows-latest` or `windows-2022` Actions virtual environments is currently unsupported. If you use any of these languages, please use the `windows-2019` Actions virtual environment or otherwise avoid these specific Windows versions until a new release fixes this incompatibility. - -## 1.0.32 - 07 Feb 2022 - -- Add `sarif-id` as an output for the `upload-sarif` and `analyze` actions. [#889](https://github.com/github/codeql-action/pull/889) -- Add `ref` and `sha` inputs to the `analyze` action, which override the defaults provided by the GitHub Action context. [#889](https://github.com/github/codeql-action/pull/889) -- Update default CodeQL bundle version to 2.8.0. [#911](https://github.com/github/codeql-action/pull/911) - -## 1.0.31 - 31 Jan 2022 - -- Remove `experimental` message when using custom CodeQL packages. [#888](https://github.com/github/codeql-action/pull/888) -- Add a better warning message stating that experimental features will be disabled if the workflow has been triggered by a pull request from a fork or the `security-events: write` permission is not present. [#882](https://github.com/github/codeql-action/pull/882) - -## 1.0.30 - 24 Jan 2022 - -- Display a better error message when encountering a workflow that runs the `codeql-action/init` action multiple times. [#876](https://github.com/github/codeql-action/pull/876) -- Update default CodeQL bundle version to 2.7.6. [#877](https://github.com/github/codeql-action/pull/877) - -## 1.0.29 - 21 Jan 2022 - -- The feature to wait for SARIF processing to complete after upload has been disabled by default due to a bug in its interaction with pull requests from forks. - -## 1.0.28 - 18 Jan 2022 - -- Update default CodeQL bundle version to 2.7.5. [#866](https://github.com/github/codeql-action/pull/866) -- Fix a bug where SARIF files were failing upload due to an invalid test for unique categories. [#872](https://github.com/github/codeql-action/pull/872) - -## 1.0.27 - 11 Jan 2022 - -- The `analyze` and `upload-sarif` actions will now wait up to 2 minutes for processing to complete after they have uploaded the results so they can report any processing errors that occurred. This behavior can be disabled by setting the `wait-for-processing` action input to `"false"`. [#855](https://github.com/github/codeql-action/pull/855) - -## 1.0.26 - 10 Dec 2021 - -- Update default CodeQL bundle version to 2.7.3. [#842](https://github.com/github/codeql-action/pull/842) - -## 1.0.25 - 06 Dec 2021 - -No user facing changes. - -## 1.0.24 - 23 Nov 2021 - -- Update default CodeQL bundle version to 2.7.2. [#827](https://github.com/github/codeql-action/pull/827) - -## 1.0.23 - 16 Nov 2021 - -- The `upload-sarif` action now allows multiple uploads in a single job, as long as they have different categories. [#801](https://github.com/github/codeql-action/pull/801) -- Update default CodeQL bundle version to 2.7.1. [#816](https://github.com/github/codeql-action/pull/816) - -## 1.0.22 - 04 Nov 2021 - -- The `init` step of the Action now supports `ram` and `threads` inputs to limit resource use of CodeQL extractors. These inputs also serve as defaults to the subsequent `analyze` step, which finalizes the database and executes queries. [#738](https://github.com/github/codeql-action/pull/738) -- When used with CodeQL 2.7.1 or above, the Action now includes custom query help in the analysis results uploaded to GitHub code scanning, if available. To add help text for a custom query, create a Markdown file next to the `.ql` file containing the query, using the same base name but the file extension `.md`. [#804](https://github.com/github/codeql-action/pull/804) - -## 1.0.21 - 28 Oct 2021 - -- Update default CodeQL bundle version to 2.7.0. [#795](https://github.com/github/codeql-action/pull/795) - -## 1.0.20 - 25 Oct 2021 - -No user facing changes. - -## 1.0.19 - 18 Oct 2021 - -No user facing changes. - -## 1.0.18 - 08 Oct 2021 - -- Fixed a bug where some builds were no longer being traced correctly. [#766](https://github.com/github/codeql-action/pull/766) - -## 1.0.17 - 07 Oct 2021 - -- Update default CodeQL bundle version to 2.6.3. [#761](https://github.com/github/codeql-action/pull/761) - -## 1.0.16 - 05 Oct 2021 - -No user facing changes. - -## 1.0.15 - 22 Sep 2021 - -- Update default CodeQL bundle version to 2.6.2. [#746](https://github.com/github/codeql-action/pull/746) - -## 1.0.14 - 09 Sep 2021 - -- Update default CodeQL bundle version to 2.6.1. [#733](https://github.com/github/codeql-action/pull/733) - -## 1.0.13 - 06 Sep 2021 - -- Update default CodeQL bundle version to 2.6.0. [#712](https://github.com/github/codeql-action/pull/712) -- Update baseline lines of code counter for python. All multi-line strings are counted as code. [#714](https://github.com/github/codeql-action/pull/714) -- Remove old baseline LoC injection [#715](https://github.com/github/codeql-action/pull/715) - -## 1.0.12 - 16 Aug 2021 - -- Update README to include a sample permissions block. [#689](https://github.com/github/codeql-action/pull/689) - -## 1.0.11 - 09 Aug 2021 - -- Update default CodeQL bundle version to 2.5.9. [#687](https://github.com/github/codeql-action/pull/687) - -## 1.0.10 - 03 Aug 2021 - -- Fix an issue where a summary of diagnostics information from CodeQL was not output to the logs of the `analyze` step of the Action. [#672](https://github.com/github/codeql-action/pull/672) - -## 1.0.9 - 02 Aug 2021 - -No user facing changes. - -## 1.0.8 - 26 Jul 2021 - -- Update default CodeQL bundle version to 2.5.8. [#631](https://github.com/github/codeql-action/pull/631) - -## 1.0.7 - 21 Jul 2021 - -No user facing changes. - -## 1.0.6 - 19 Jul 2021 - -- The `init` step of the Action now supports a `source-root` input as a path to the root source-code directory. By default, the path is relative to `$GITHUB_WORKSPACE`. [#607](https://github.com/github/codeql-action/pull/607) -- The `init` step will now try to install a few Python tools needed by this Action when running on a self-hosted runner. [#616](https://github.com/github/codeql-action/pull/616) - -## 1.0.5 - 12 Jul 2021 - -- The `analyze` step of the Action now supports a `skip-queries` option to merely build the CodeQL database without analyzing. This functionality is not present in the runner. Additionally, the step will no longer fail if it encounters a finalized database, and will instead continue with query execution. [#602](https://github.com/github/codeql-action/pull/602) -- Update the warning message when the baseline lines of code count is unavailable. [#608](https://github.com/github/codeql-action/pull/608) - -## 1.0.4 - 28 Jun 2021 - -- Fix `RUNNER_TEMP environment variable must be set` when using runner. [#594](https://github.com/github/codeql-action/pull/594) -- Fix counting of lines of code for C# projects. [#586](https://github.com/github/codeql-action/pull/586) - -## 1.0.3 - 23 Jun 2021 - -No user facing changes. - -## 1.0.2 - 17 Jun 2021 - -- Fix out of memory in hash computation. [#550](https://github.com/github/codeql-action/pull/550) -- Clean up logging during analyze results. [#557](https://github.com/github/codeql-action/pull/557) -- Add `--finalize-dataset` to `database finalize` call, freeing up some disk space after database creation. [#558](https://github.com/github/codeql-action/pull/558) - -## 1.0.1 - 07 Jun 2021 - -- Pass the `--sarif-group-rules-by-pack` argument to CodeQL CLI invocations that generate SARIF. This means the SARIF rule object for each query will now be found underneath its corresponding query pack in `runs[].tool.extensions`. [#546](https://github.com/github/codeql-action/pull/546) -- Output the location of CodeQL databases created in the analyze step. [#543](https://github.com/github/codeql-action/pull/543) - -## 1.0.0 - 31 May 2021 - -- Add this changelog file. [#507](https://github.com/github/codeql-action/pull/507) -- Improve grouping of analysis logs. Add a new log group containing a summary of metrics and diagnostics, if they were produced by CodeQL builtin queries. [#515](https://github.com/github/codeql-action/pull/515) -- Add metrics and diagnostics summaries from custom query suites to the analysis summary log group. [#532](https://github.com/github/codeql-action/pull/532) diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index f084c0a25d..0000000000 --- a/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -**/* @github/codeql-action-reviewers diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 8559639ef2..0000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies within all project spaces, and it also applies when -an individual is representing the project or its community in public spaces. -Examples of representing a project or community include using an official -project e-mail address, posting via an official social media account, or acting -as an appointed representative at an online or offline event. Representation of -a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at opensource@github.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index b67ccb13b7..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,133 +0,0 @@ -# Contributing - -[fork]: https://github.com/github/codeql-action/fork -[pr]: https://github.com/github/codeql-action/compare -[code-of-conduct]: CODE_OF_CONDUCT.md -[readme]: README.md#supported-versions-of-the-codeql-cli-and-github-enterprise-server - -Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. - -Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE). - -Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. - -## Development and Testing - -Before you start, ensure that you have a recent version of node (24 or higher) installed, along with a recent version of npm (9.2 or higher). You can see which version of node is used by the action in `init/action.yml`. - -### Common tasks - -* Transpile the TypeScript to JavaScript: `npm run build`. Note that the JavaScript files are committed to git. -* Run tests: `npm run test`. You’ll need to ensure that the JavaScript files are up-to-date first by running the command above. -* Run the linter: `npm run lint`. -* Run tests for a specific path: `npm run ava -- ./src/filename.test.ts` or `npm run ava -- ./src/feature-flags/` - -This project also includes configuration to run tests from VSCode (with support for breakpoints) - open the test file you wish to run and choose "Debug AVA test file" from the Run menu in the Run panel. - -You may want to run `tsc --watch` from the command line or inside of vscode in order to ensure build artifacts are up to date as you are working. - -### Checking in compiled artifacts - -Because CodeQL Action users consume the code directly from this repository, and there can be no build step during a GitHub Actions run, this repository contains all compiled artifacts. There is a PR check that will fail if any of the compiled artifacts are not up to date. Compiled artifacts are stored in the `lib/` directory. For all day-to-day development purposes, this folder can be ignored. - -### Running the action - -To see the effect of your changes and to test them, push your changes in a branch and then look at the [Actions output](https://github.com/github/codeql-action/actions) for that branch. You can also exercise the code locally by running the automated tests. - -### Integration tests - -As well as the unit tests (see _Common tasks_ above), there are integration tests, defined in `.github/workflows/integration-testing.yml`. These are run by a CI check. Depending on the change you’re making, you may want to add a test to this file or extend an existing one. - -## Submitting a pull request - -1. [Fork][fork] and clone the repository. -2. Create a new branch: `git checkout -b my-branch-name`. -3. Make your change, add tests, and make sure the tests still pass. Ensure that you have run `npm run build` and committed any changes to the compiled artifacts. -4. Push to your fork and [submit a pull request][pr]. -5. Pat yourself on the back and wait for your pull request to be reviewed and merged. - -If you're a GitHub staff member, you can merge your own PR once it's approved; for external contributors, GitHub staff will merge your PR once it's approved. - -Here are a few things you can do that will increase the likelihood of your pull request being accepted: - -- Write tests. -- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. -- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). - -## Releasing (write access required) - -1. The first step of releasing a new version of the `codeql-action` is running the "Update release branch" workflow. - This workflow goes through the pull requests that have been merged to `main` since the last release, creates a changelog, then opens a pull request to merge the changes since the last release into the `releases/v3` release branch. - - You can start a release by triggering this workflow via [workflow dispatch](https://github.com/github/codeql-action/actions/workflows/update-release-branch.yml). -1. The workflow run will open a pull request titled "Merge main into releases/v3". Follow the steps on the checklist in the pull request. Once you've checked off all but the last two of these, approve the PR and automerge it. -1. When the "Merge main into releases/v3" pull request is merged into the `releases/v3` branch, a mergeback pull request to `main` will be automatically created. This mergeback pull request incorporates the changelog updates into `main`, tags the release using the merge commit of the "Merge main into releases/v3" pull request, and bumps the patch version of the CodeQL Action. -1. If a backport to an older major version is required, a pull request targeting that version's branch will also be automatically created. -1. Approve the mergeback and backport pull request (if applicable) and automerge them. - -Once the mergeback and backport pull request have been merged, the release is complete. - -## Keeping the PR checks up to date (admin access required) - -Since the `codeql-action` runs most of its testing through individual Actions workflows, there are over two hundred required jobs that need to pass in order for a PR to turn green. It would be too tedious to maintain that list manually. You can regenerate the set of required checks automatically by running the [sync-checks.ts](pr-checks/sync-checks.ts) script: - -- At a minimum, you must provide a token with permissions to update branch protection rules. For example, `gh auth token | pr-checks/sync-checks.ts --token-stdin` uses the same token that `gh` uses. You can also set the `GH_TOKEN` or `GITHUB_TOKEN` environment variable. If no token is provided or the token has insufficient permissions, the script will fail. -- By default, the script performs a dry run and outputs information about the changes it would make to the branch protection rules. To actually apply the changes, specify the `--apply` flag. -- If you run the script without any other arguments, it will retrieve the set of workflows that ran for the latest commit on `main`. -- You can specify a different git ref with the `--ref` input. You will likely want to use this if you have a PR that removes or adds PR checks. For example, `--ref "some/branch/name"` to use the HEAD of the `some/branch/name` branch. - -After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v4`, and any other currently supported major versions have been updated. - -Note that any updates to checks on `main` need to be backported to all currently supported major version branches, in order to maintain the same set of names for required checks. - -## Deprecating a CodeQL version (write access required) - -We typically deprecate a version of CodeQL when the GitHub Enterprise Server (GHES) version that it first shipped in is deprecated. - -1. Work out the next minimum version of CodeQL. This is the version that shipped in the version of GHES after the one that has just been deprecated. -1. Notify users using the old version of CodeQL about the deprecation. - - Update `CODEQL_NEXT_MINIMUM_VERSION`, `GHES_VERSION_MOST_RECENTLY_DEPRECATED`, and `GHES_MOST_RECENT_DEPRECATION_DATE` in `src/codeql.ts` to reflect the new minimum version of CodeQL and the GHES version that has just been deprecated. - - Add a changelog note announcing the deprecation. - - Update the CLI version referenced in the [readme] by adding a new row to the compatibility table. - - Example PR: https://github.com/github/codeql-action/pull/1884 -1. Release the Action, or wait for the next scheduled release of the Action, then wait at least a week so users have time to see and act on the deprecation warning. -1. Remove support for the old version of CodeQL. - - Bump `CODEQL_MINIMUM_VERSION` in `src/codeql.ts` to the new minimum version of CodeQL. - - Remove any code that is only needed to support the old version of CodeQL. This is often behind a version guard, so look for instances of version numbers between the old minimum version and the new minimum version in the codebase. A good place to start is the list of version numbers in `src/codeql.ts`. - - Update the default set of CodeQL test versions in `pr-checks/sync.ts`. - - Remove the old minimum version of CodeQL. - - Add the latest patch release for any new CodeQL minor version series that have shipped in GHES. - - Run the script to update the generated PR checks. - - Do the same for PR checks that aren't auto-generated. - - Add a changelog note announcing the new minimum version of CodeQL that is now required. - - Example PR: https://github.com/github/codeql-action/pull/1907 - -## Adding a new CodeQL Action major version - -We sometimes maintain multiple versions of the CodeQL Action to enable customers on older but still supported versions of GitHub Enterprise Server (GHES) to continue to benefit from the latest CodeQL improvements. To accomplish this, the release process automation listens to updates to the release branch for the newest supported version. When this branch is updated, the release process automatically opens backport PRs to update the release branches for older versions. - -To add a new major version of the Action: - -1. Change the `version` field of `package.json` by running `npm version x.y.z` where `x` is the new major version, and `y` and `z` match the latest minor and patch versions of the last release. -1. Update appropriate documentation to explain the reasoning behind the releases: see [the diff](https://github.com/github/codeql-action/pull/2677/commits/913d60579d4b560addf53ec3c493d491dd3c1378) in our last major version deprecation for examples on which parts of the documentation should be updated. -1. Consider the timeline behind deprecating the prior Action version: see [CodeQL Action deprecation documentation](#deprecating-a-codeql-action-major-version-write-access-required) -1. If the new major version runs on a new version of Node, add a PR check to ensure the codebase continues to compile against the previous version of Node. See [Remove Node 16 compilation PR check](https://github.com/github/codeql-action/pull/2695) for an example. - -## Deprecating a CodeQL Action major version (write access required) - -We typically deprecate older versions of the Action once all supported GHES versions are compatible with the version of Node.js we are using on `main`. - -To deprecate an older version of the Action: - -1. Notify any users who are still pinned to the `vN` tag of the deprecated version of the Action, giving as much notice as is practical. - - Add a changelog note announcing the deprecation. - - Implement an Actions warning for customers using the deprecated version. -1. Wait for the deprecation period to pass. -1. Upgrade the Actions warning for customers using the deprecated version to a non-fatal error, and mention that this version of the Action is no longer supported. -1. Make a PR to bump the `OLDEST_SUPPORTED_MAJOR_VERSION` in [config.ts](pr-checks/config.ts). Once this PR is merged, the release process will no longer backport changes to the deprecated release version. - -## Resources - -- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) -- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) -- [GitHub Help](https://help.github.com) diff --git a/LICENSE b/LICENSE deleted file mode 100644 index b50625eb63..0000000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 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. diff --git a/README.md b/README.md deleted file mode 100644 index 530c028f97..0000000000 --- a/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# CodeQL Action - -This action runs GitHub's industry-leading semantic code analysis engine, [CodeQL](https://codeql.github.com/), against a repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed on pull requests and in the repository's security tab. CodeQL runs an extensible set of [queries](https://github.com/github/codeql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code. - -For a list of recent changes, see the CodeQL Action's [changelog](CHANGELOG.md). - -## License - -This project is released under the [MIT License](LICENSE). - -The underlying CodeQL CLI, used in this action, is licensed under the [GitHub CodeQL Terms and Conditions](https://securitylab.github.com/tools/codeql/license). As such, this action may be used on open source projects hosted on GitHub, and on private repositories that are owned by an organisation with GitHub Advanced Security enabled. - -## Usage - -We recommend using default setup to configure CodeQL analysis for your repository. For more information, see "[Configuring default setup for code scanning](https://docs.github.com/en/code-security/code-scanning/enabling-code-scanning/configuring-default-setup-for-code-scanning)." - -You can also configure advanced setup for a repository to find security vulnerabilities in your code using a highly customizable code scanning configuration. For more information, see "[Configuring advanced setup for code scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning)" and "[Customizing your advanced setup for code scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning)." - -### Actions - -This repository contains several actions that enable you to analyze code in your repository using CodeQL and upload the analysis to GitHub Code Scanning. Actions in this repository also allow you to upload to GitHub analyses generated by any SARIF-producing SAST tool. - -Actions for CodeQL analyses: - -- `init`: Sets up CodeQL for analysis. For information about input parameters, see the [init action definition](https://github.com/github/codeql-action/blob/main/init/action.yml). -- `analyze`: Finalizes the CodeQL database, runs the analysis, and uploads the results to Code Scanning. For information about input parameters, see the [analyze action definition](https://github.com/github/codeql-action/blob/main/analyze/action.yml). - -Actions for uploading analyses generated by third-party tools: - -- `upload-sarif`: Uploads a SARIF file to Code Scanning. If you are using the `analyze` action, there is no reason to use this action as well. For information about input parameters, see the [upload-sarif action definition](https://github.com/github/codeql-action/blob/main/upload-sarif/action.yml). - -Actions with special purposes and unlikely to be used directly: - -- `autobuild`: Attempts to automatically build the code. Only used for analyzing languages that require a build. Use the `build-mode: autobuild` input in the `init` action instead. For information about input parameters, see the [autobuild action definition](https://github.com/github/codeql-action/blob/main/autobuild/action.yml). -- `resolve-environment`: [Experimental] Attempts to infer a build environment suitable for automatic builds. For information about input parameters, see the [resolve-environment action definition](https://github.com/github/codeql-action/blob/main/resolve-environment/action.yml). -- `start-proxy`: [Experimental] Start the HTTP proxy server. Internal use only and will change without notice. For information about input parameters, see the [start-proxy action definition](https://github.com/github/codeql-action/blob/main/start-proxy/action.yml). -- `setup-codeql`: [Experimental] Similar to `init`, except it only installs the CodeQL CLI and does not initialize a database. - -### Workflow Permissions - -All advanced setup code scanning workflows must have the `security-events: write` permission. Workflows in private repositories must additionally have the `contents: read` permission. For more information, see "[Assigning permissions to jobs](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs)." - -### Build Modes - -The CodeQL Action supports different build modes for analyzing the source code. The available build modes are: - -- `none`: The database will be created without building the source code. Available for all interpreted languages and some compiled languages. -- `autobuild`: The database will be created by attempting to automatically build the source code. Available for all compiled languages. -- `manual`: The database will be created by building the source code using a manually specified build command. To use this build mode, specify manual build steps in your workflow between the `init` and `analyze` steps. Available for all compiled languages. - -#### Which build mode should I use? - -Interpreted languages must use `none` for the build mode. - -For compiled languages: - -- `manual` build mode will typically produce the most precise results, but it is more difficult to set up and will cause the analysis to take slightly more time to run. -- `autobuild` build mode is simpler to set up, but will only work for projects with generic build steps that can be guessed by the heuristics of the autobuild scripts. If `autobuild` fails, then you must switch to `manual` or `none`. If `autobuild` succeeds, then the results and run time will be the same as `manual` mode. -- `none` build mode is also simpler to set up and is slightly faster to run, but there is a possibility that some alerts will be missed. This may happen if your repository does any code generation during compilation or if there are any dependencies downloaded from registries that the workflow does not have access to. `none` is not yet supported by Swift, Go, or Kotlin. It is in public preview for C/C++. - - -## Supported versions of the CodeQL Action - -The following versions of the CodeQL Action are currently supported: - -- v4 (latest) -- v3 - -## Supported versions of the CodeQL Bundle on GitHub Enterprise Server - -We typically release new minor versions of the CodeQL Action and Bundle when a new minor version of GitHub Enterprise Server (GHES) is released. When a version of GHES is deprecated, the CodeQL Action and Bundle releases that shipped with it are deprecated as well. - -| Minimum CodeQL Action | Minimum CodeQL Bundle Version | GitHub Environment | Notes | -|-----------------------|-------------------------------|--------------------|-------| -| `v4.33.0` | `2.24.3` | Enterprise Server 3.21 | | -| `v4.31.10` | `2.23.9` | Enterprise Server 3.20 | | -| `v3.29.11` | `2.22.4` | Enterprise Server 3.19 | | -| `v3.28.21` | `2.21.3` | Enterprise Server 3.18 | | -| `v3.28.12` | `2.20.7` | Enterprise Server 3.17 | | -| `v3.28.6` | `2.20.3` | Enterprise Server 3.16 | | - -See the full list of GHES release and deprecation dates at [GitHub Enterprise Server releases](https://docs.github.com/en/enterprise-server/admin/all-releases#releases-of-github-enterprise-server). - -## Keeping the CodeQL Action up to date in advanced setups - -If you are using an [advanced setup](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning), we recommend referencing the CodeQL Action using a major version tag (e.g. `v4`) in your workflow file. This ensures your workflow automatically picks up the latest release within that major version, including bug fixes, new features, and updated CodeQL CLI versions. - -If you pin to a specific commit SHA or patch version tag, ensure you keep it updated (e.g. via [Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot)). Some CodeQL Action features are enabled by server-side flags that may be removed over time, which can cause old versions to lose functionality. - -## Troubleshooting - -Read about [troubleshooting code scanning](https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning). - -## Contributing - -This project welcomes contributions. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to build, install, and contribute. diff --git a/action.yml b/action.yml deleted file mode 100644 index 87c4974ea9..0000000000 --- a/action.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'CodeQL: Stub' -description: "Stub: Don't use this action directly. Read [the documentation](https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql) instead." -author: 'GitHub' -runs: - using: 'composite' - steps: - - name: 'Stub' - run: | - echo 'This is a stub. Read [the documentation](https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql) instead.' - exit 1 - shell: bash diff --git a/analyze/action.yml b/analyze/action.yml deleted file mode 100644 index d70401c0a4..0000000000 --- a/analyze/action.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: "CodeQL: Finish" -description: "Finalize CodeQL database" -author: "GitHub" -inputs: - check_name: - description: The name of the check run to add text to. - required: false - output: - description: The path of the directory in which to save the SARIF results from the CodeQL CLI. - required: false - default: "../results" - upload: - description: >- - Upload the SARIF file to Code Scanning. - Defaults to 'always' which uploads the SARIF file to Code Scanning for successful and failed runs. - 'failure-only' only uploads debugging information to Code Scanning if the workflow run fails, for users post-processing the SARIF file before uploading it to Code Scanning. - 'never' avoids uploading the SARIF file to Code Scanning, even if the code scanning run fails. This is not recommended for external users since it complicates debugging. - required: false - # If changing this, make sure to update workflow.ts accordingly. - default: "always" - cleanup-level: - description: >- - DEPRECATED. This option is ignored since, for performance reasons, the CodeQL Action automatically - manages cleanup of intermediate results. - required: false - ram: - description: >- - The amount of memory in MB that can be used by CodeQL for database finalization and query execution. - By default, this action will use the same amount of memory as previously set in the "init" action. - If the "init" action also does not have an explicit "ram" input, this action will use most of the - memory available in the system (which for GitHub-hosted runners is 6GB for Linux, 5.5GB for Windows, - and 13GB for macOS). - required: false - add-snippets: - description: Does not have any effect. - required: false - deprecationMessage: >- - The input "add-snippets" has been removed and no longer has any effect. - skip-queries: - description: If this option is set, the CodeQL database will be built but no queries will be run on it. Thus, no results will be produced. - required: false - default: "false" - threads: - description: >- - The number of threads that can be used by CodeQL for database finalization and query execution. - By default, this action will use the same number of threads as previously set in the "init" action. - If the "init" action also does not have an explicit "threads" input, this action will use all the - hardware threads available in the system (which for GitHub-hosted runners is 2 for Linux and Windows - and 3 for macOS). - required: false - checkout_path: - description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file." - required: false - # If changing this, make sure to update workflow.ts accordingly. - default: ${{ github.workspace }} - ref: - description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is ignored for pull requests from forks. Expected format: refs/heads/, refs/tags/, refs/pull//merge, or refs/pull//head." - required: false - sha: - description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is ignored for pull requests from forks." - required: false - category: - description: String used by Code Scanning for matching the analyses - required: false - upload-database: - description: Whether to upload the resulting CodeQL database - required: false - default: "true" - post-processed-sarif-path: - description: >- - Before uploading the SARIF files produced by the CodeQL CLI, the CodeQL Action may perform some post-processing - on them. Ordinarily, these post-processed SARIF files are not saved to disk. However, if a path is provided as an - argument for this input, they are written to the specified directory. - required: false - wait-for-processing: - description: If true, the Action will wait for the uploaded SARIF to be processed before completing. - required: true - default: "true" - token: - description: "GitHub token to use for authenticating with this instance of GitHub. The token must be the built-in GitHub Actions token, and the workflow must have the `security-events: write` permission. Most of the time it is advisable to avoid specifying this input so that the workflow falls back to using the default value." - required: false - default: ${{ github.token }} - matrix: - default: ${{ toJson(matrix) }} - expect-error: - description: "[Internal] It is an error to use this input outside of integration testing of the codeql-action." - required: false - default: "false" -outputs: - db-locations: - description: A map from language to absolute path for each database created by CodeQL. - sarif-output: - description: Absolute, local path to the directory containing the generated SARIF file. - sarif-id: - description: The ID of the uploaded SARIF file. -runs: - using: node24 - main: "../lib/analyze-entry.js" - post: "../lib/analyze-post-entry.js" diff --git a/autobuild/action.yml b/autobuild/action.yml deleted file mode 100644 index b87da541d6..0000000000 --- a/autobuild/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'CodeQL: Autobuild' -description: 'Attempt to automatically build the code. Only used for analyzing languages that require a build. Use the `build-mode: autobuild` input in the `init` action instead.' -author: 'GitHub' -inputs: - token: - description: "GitHub token to use for authenticating with this instance of GitHub. The token needs the `security-events: write` permission." - required: false - default: ${{ github.token }} - matrix: - default: ${{ toJson(matrix) }} - working-directory: - description: >- - Run the autobuilder using this path (relative to $GITHUB_WORKSPACE) as - working directory. If this input is not set, the autobuilder runs with - $GITHUB_WORKSPACE as its working directory. - required: false -runs: - using: node24 - main: '../lib/autobuild-entry.js' diff --git a/ava.config.mjs b/ava.config.mjs deleted file mode 100644 index 7bd103c94e..0000000000 --- a/ava.config.mjs +++ /dev/null @@ -1,9 +0,0 @@ -export default { - typescript: { - rewritePaths: { - "src/": "build/", - }, - compile: false, - }, - require: ["./ava.setup.mjs"], -}; diff --git a/ava.setup.mjs b/ava.setup.mjs deleted file mode 100644 index e6c370e01b..0000000000 --- a/ava.setup.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import pkg from "./package.json" with { type: "json" }; - -globalThis.__CODEQL_ACTION_VERSION__ = pkg.version; diff --git a/build.mjs b/build.mjs deleted file mode 100644 index a0c3c06189..0000000000 --- a/build.mjs +++ /dev/null @@ -1,222 +0,0 @@ -import { copyFile, readFile, rm, writeFile } from "node:fs/promises"; -import { basename, dirname, join } from "node:path"; -import { fileURLToPath } from "node:url"; - -import * as esbuild from "esbuild"; -import { globSync } from "glob"; - -import pkg from "./package.json" with { type: "json" }; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -const SRC_DIR = join(__dirname, "src"); -const OUT_DIR = join(__dirname, "lib"); - -/** - * Clean the output directory before building. - * - * @type {esbuild.Plugin} - */ -const cleanPlugin = { - name: "clean", - setup(build) { - build.onStart(async () => { - await rm(OUT_DIR, { recursive: true, force: true }); - }); - }, -}; - -/** - * Copy defaults.json to the output directory since other projects depend on it. - * - * @type {esbuild.Plugin} - */ -const copyDefaultsPlugin = { - name: "copy-defaults", - setup(build) { - build.onEnd(async () => { - await rm(join(OUT_DIR, "defaults.json"), { - force: true, - }); - await copyFile( - join(SRC_DIR, "defaults.json"), - join(OUT_DIR, "defaults.json"), - ); - }); - }, -}; - -/** - * Log when the build ends. - * - * @type {esbuild.Plugin} - */ -const onEndPlugin = { - name: "on-end", - setup(build) { - build.onEnd((result) => { - // eslint-disable-next-line no-console - console.log(`Build ended with ${result.errors.length} errors`); - }); - }, -}; - -/** The name of the virtual `entry-points` module. */ -const SHARED_ENTRYPOINT = "entry-points"; - -/** The property name under which `upload-lib`'s namespace is exposed in `entry-points`. */ -const UPLOAD_LIB_EXPORT = "uploadLib"; - -/** The relative source path of the `upload-lib` module that we re-export from `entry-points`. */ -const UPLOAD_LIB_SRC = "./src/upload-lib"; - -/** - * This plugin finds all source files that contain Action entry points. It then generates the - * virtual `entry-points` module which imports all identified files, and re-exports their - * `runWrapper` functions with suitable aliases. - * - * The virtual module additionally re-exports `upload-lib` under the `uploadLib` namespace so that - * external consumers can access it via the small `lib/upload-lib.js` stub emitted below. - * - * A tiny stub file is emitted for each Action entrypoint, and one for `upload-lib`. Each stub - * imports the shared bundle and calls/re-exports from the respective entry point. - * - * @type {esbuild.Plugin} - */ -const entryPointsPlugin = { - name: "entry-points", - setup(build) { - const namespace = "actions"; - const actions = []; - - const toPascal = (s) => - s.replace(/(^|-)([a-z0-9])/gi, (_, __, c) => c.toUpperCase()); - - // Find the source files containing Action entry points. - build.onStart(() => { - const actionFiles = globSync("src/*-action{,-post}.ts"); - for (const actionFile of actionFiles) { - const match = basename(actionFile).match(/(.*)-action(-post)?/); - - if (match.length < 2) { - throw new Error(`'${actionFile}' didn't match expected pattern.`); - } - - const actionName = match[1]; - const isPost = match[2] !== undefined; - - actions.push({ - path: actionFile, - name: actionName, - isPost, - pascalCaseName: `${toPascal(actionName)}${isPost ? "Post" : ""}Action`, - }); - } - }); - - // Resolve the virtual `entry-points` file and set the corresponding namespace. - // Ideally, we'd `RegExp.escape` the entrypoint here, but that API isn't supported in Node 20. - // Since we're dealing with a hardcoded string, this isn't too much of a problem. - build.onResolve({ filter: new RegExp(`^${SHARED_ENTRYPOINT}$`) }, () => { - return { path: SHARED_ENTRYPOINT, namespace }; - }); - - // Generate the virtual `entry-points` file based on the Actions we discovered. - // Restrict using the namespace. The path filter does not need to discriminate any further. - build.onLoad({ filter: /.*/, namespace }, async () => { - const wrapperTemplatePath = "entry-wrapper.js.tpl"; - const wrapperTemplate = await readFile( - join(SRC_DIR, wrapperTemplatePath), - "utf-8", - ); - - const actionsSorted = actions.sort((a, b) => - a.name.localeCompare(b.name), - ); - const imports = actionsSorted - .map( - (action) => - `import * as ${action.pascalCaseName} from "./src/${basename(action.path)}";`, - ) - .join("\n"); - const wrappers = actionsSorted - .map((action) => - wrapperTemplate.replaceAll("__ACTION__", action.pascalCaseName), - ) - .join("\n\n"); - - // Also re-export the `upload-lib` namespace so that external consumers can reach it - // via the `lib/upload-lib.js` stub without us having to bundle a second copy. - const uploadLibReExport = `export * as ${UPLOAD_LIB_EXPORT} from "${UPLOAD_LIB_SRC}";`; - - return { - contents: `"use strict";\n${imports}\n\n${uploadLibReExport}\n\n${wrappers}\n`, - resolveDir: ".", - loader: "ts", - }; - }); - - // Emit entry point stubs for each Action using the entry template. - build.onEnd(async () => { - const makeHeader = (templatePath, sourceFile) => - `// Automatically generated from '${templatePath}' for 'src/${basename(sourceFile)}'.\n\n`; - - // Read the entry point template. - const actionTemplatePath = "action-entry.js.tpl"; - const actionTemplate = await readFile( - join(SRC_DIR, actionTemplatePath), - "utf-8", - ); - - // Write entry point stubs for each Action. - for (const action of actions) { - await writeFile( - join( - OUT_DIR, - `${action.name}${action.isPost ? "-post" : ""}-entry.js`, - ), - makeHeader(actionTemplatePath, action.path) + - actionTemplate.replaceAll("__ACTION__", action.pascalCaseName), - ); - } - - // Write a small stub for `upload-lib` that re-exports it from the shared bundle. - // External callers (e.g. internal testing environments) `require("./lib/upload-lib")` - // and expect the same shape as before, so we expose the namespace as `module.exports`. - const uploadLibStubTemplatePath = "upload-lib-stub.js.tpl"; - const uploadLibStubTemplate = await readFile( - join(SRC_DIR, uploadLibStubTemplatePath), - "utf-8", - ); - await writeFile( - join(OUT_DIR, "upload-lib.js"), - makeHeader(uploadLibStubTemplatePath, `${UPLOAD_LIB_SRC}.ts`) + - uploadLibStubTemplate.replaceAll( - "__UPLOAD_LIB_EXPORT__", - UPLOAD_LIB_EXPORT, - ), - ); - }); - }, -}; - -const context = await esbuild.context({ - entryPoints: [{ in: SHARED_ENTRYPOINT, out: SHARED_ENTRYPOINT }], - bundle: true, - format: "cjs", - outdir: OUT_DIR, - platform: "node", - external: ["./entry-points"], - plugins: [cleanPlugin, copyDefaultsPlugin, entryPointsPlugin, onEndPlugin], - target: ["node20"], - define: { - __CODEQL_ACTION_VERSION__: JSON.stringify(pkg.version), - }, - metafile: true, -}); - -const result = await context.rebuild(); -await writeFile(join(__dirname, "meta.json"), JSON.stringify(result.metafile)); - -await context.dispose(); diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 34fe49a9df..0000000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,212 +0,0 @@ -import { fixupPluginRules } from "@eslint/compat"; -import js from "@eslint/js"; -import github from "eslint-plugin-github"; -import { importX, createNodeResolver } from "eslint-plugin-import-x"; -import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript"; -import noAsyncForeach from "eslint-plugin-no-async-foreach"; -import jsdoc from "eslint-plugin-jsdoc"; -import tseslint from "typescript-eslint"; -import globals from "globals"; -import path from "path"; -import { fileURLToPath } from "url"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const githubFlatConfigs = github.getFlatConfigs(); - -export default [ - { - ignores: [ - "**/webpack.config.js", - "build/**/*", - "lib/**/*", - "src/testdata/**/*", - "tests/**/*", - "build.mjs", - "ava.config.mjs", - "ava.setup.mjs", - "eslint.config.mjs", - ".github/**/*", - ], - }, - // eslint recommended config - js.configs.recommended, - // Type-checked rules from typescript-eslint - ...tseslint.configs.recommendedTypeChecked, - ...tseslint.configs.strict, - // eslint-plugin-github recommended config - githubFlatConfigs.recommended, - // eslint-plugin-github typescript config - ...githubFlatConfigs.typescript, - // import-x TypeScript settings - // This is needed for import-x rules to properly parse TypeScript files. - { - settings: importX.flatConfigs.typescript.settings, - }, - { - plugins: { - "import-x": importX, - "no-async-foreach": fixupPluginRules(noAsyncForeach), - jsdoc: jsdoc, - }, - - languageOptions: { - ecmaVersion: "latest", - sourceType: "module", - - globals: { - ...globals.node, - }, - - parserOptions: { - project: "./tsconfig.json", - }, - }, - - settings: { - "import/resolver": { - node: { - moduleDirectory: ["node_modules", "src"], - }, - - typescript: {}, - }, - "import/ignore": [ - "sinon", - "uuid", - "@octokit/plugin-retry", - "del", - "get-folder-size", - ], - "import-x/resolver-next": [ - createTypeScriptImportResolver(), - createNodeResolver({ - extensions: [".ts", ".js", ".json"], - }), - ], - }, - - rules: { - "github/filenames-match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"], - "i18n-text/no-en": "off", - - "import/extensions": [ - "error", - { - json: {}, - }, - ], - - "import/no-amd": "error", - "import/no-commonjs": "error", - // import/no-cycle does not seem to work with ESLint 9. - // Use import-x/no-cycle from eslint-plugin-import-x instead. - "import/no-cycle": "off", - "import-x/no-cycle": "error", - "import/no-dynamic-require": "error", - - "import/no-extraneous-dependencies": [ - "error", - { - devDependencies: true, - }, - ], - - "import/no-namespace": "off", - "import/no-unresolved": "error", - "import/no-webpack-loader-syntax": "error", - - "import/order": [ - "error", - { - alphabetize: { - order: "asc", - }, - - "newlines-between": "always", - }, - ], - - "max-len": [ - "error", - { - code: 120, - ignoreUrls: true, - ignoreStrings: true, - ignoreTemplateLiterals: true, - }, - ], - - "no-async-foreach/no-async-foreach": "error", - "no-sequences": "error", - "no-shadow": "off", - // This is overly restrictive with unsetting `EnvVar`s - "@typescript-eslint/no-dynamic-delete": "off", - "@typescript-eslint/no-shadow": "error", - "@typescript-eslint/prefer-optional-chain": "error", - "one-var": ["error", "never"], - - // Check param names to ensure that we don't have outdated JSDocs. - "jsdoc/check-param-names": [ - "error", - { - // We don't currently require full JSDoc coverage, so this rule - // should not error on missing @param annotations. - disableMissingParamChecks: true, - }, - ], - }, - }, - { - files: ["**/*.ts", "**/*.js"], - - rules: { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-enum-comparison": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/prefer-regexp-exec": "off", - "@typescript-eslint/require-await": "off", - "@typescript-eslint/restrict-template-expressions": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - args: "all", - argsIgnorePattern: "^_", - }, - ], - "func-style": "off", - }, - }, - { - files: ["pr-checks/**/*.ts"], - - languageOptions: { - parserOptions: { - // Use the correct `tsconfig.json` for `pr-checks`. - project: "./pr-checks/tsconfig.json", - }, - }, - - rules: { - // The scripts in `pr-checks` are expected to output to the console. - "no-console": "off", - - "import/no-extraneous-dependencies": [ - "error", - { packageDir: [__dirname, path.resolve(__dirname, "pr-checks")] }, - ], - - "@typescript-eslint/no-floating-promises": [ - "error", - { - allowForKnownSafeCalls: [ - // Avoid needing explicit `void` in front of `describe` calls in test files. - { from: "package", name: ["describe"], package: "node:test" }, - ], - }, - ], - }, - }, -]; diff --git a/init/action.yml b/init/action.yml deleted file mode 100644 index 1b64e8d2a3..0000000000 --- a/init/action.yml +++ /dev/null @@ -1,175 +0,0 @@ -name: 'CodeQL: Init' -description: 'Set up CodeQL' -author: 'GitHub' -inputs: - tools: - description: >- - By default, the Action will use the recommended version of the CodeQL - Bundle to analyze your project. You can override this choice using this - input. One of: - - - A local path to a CodeQL Bundle tarball, or - - The URL of a CodeQL Bundle tarball GitHub release asset, or - - A special value `linked` which uses the version of the CodeQL tools - that the Action has been bundled with. - - A special value `nightly` which uses the latest nightly version of the - CodeQL tools. Note that this is unstable and not recommended for - production use. - - If not specified, the Action will check in several places until it finds - the CodeQL tools. - required: false - languages: - description: >- - A comma-separated list of CodeQL languages to analyze. - - Due to the performance benefit of parallelizing builds, we recommend specifying languages to - analyze using a matrix and providing `\$\{{ matrix.language }}` as this input. - - For more information, see - https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#changing-the-languages-that-are-analyzed. - required: false - build-mode: - description: >- - The build mode that will be used to analyze the language. This input is only available when - analyzing a single CodeQL language per job, for example using a matrix. - - Available build modes will differ based on the language being analyzed. One of: - - - `none`: The database will be created without building the source code. - Available for all interpreted languages and some compiled languages. - - `autobuild`: The database will be created by attempting to automatically build the source - code. Available for all compiled languages. - - `manual`: The database will be created by building the source code using a manually - specified build command. To use this build mode, specify manual build steps in - your workflow between the `init` and `analyze` steps. Available for all - compiled languages. - required: false - analysis-kinds: - description: >- - [Internal] A comma-separated list of analysis kinds to enable. This input is intended for - internal-use only at this time and the behaviour is subject to changes. Some features may - not be available depending on which analysis kinds are enabled. - - Available options are: - - - `code-scanning`: The default, security-focused analysis. - - `code-quality`: Analysis focused on code quality. This must be enabled in conjunction - with `code-scanning`. - default: 'code-scanning' - required: true - token: - description: GitHub token to use for authenticating with this instance of GitHub. To download custom packs from multiple registries, use the registries input. - default: ${{ github.token }} - required: false - registries: - description: | - Use this input only when you need to download CodeQL packages from another instance of GitHub. If you only need to download packages from this GitHub instance, use the token input instead. - - A YAML string that defines the list of GitHub container registries to use for downloading packs. The string is in the following form (the | is required on the first line): - - registries: | - - url: https://containers.GHEHOSTNAME1/v2/ - packages: - - my-company/* - - my-company2/* - token: \$\{{ secrets.GHEHOSTNAME1_TOKEN }} - - - url: https://ghcr.io/v2/ - packages: */* - token: \$\{{ secrets.GHCR_TOKEN }} - - The `url` property contains the URL to the container registry you want to connect to. - - The `packages` property contains a single glob string or a list of glob strings, specifying which packages should be retrieved from this particular container registry. Order is important. Earlier entries will match before later entries. - - The `token` property contains a connection token for this registry. required: false - matrix: - default: ${{ toJson(matrix) }} - required: false - config-file: - description: Path of the config file to use - required: false - db-location: - description: Path where CodeQL databases should be created. If not specified, a temporary directory will be used. - required: false - config: - description: Configuration passed as a YAML string in the same format as the config-file input. This takes precedence over the config-file input. - required: false - queries: - description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries. - required: false - quality-queries: - description: '[Internal] DEPRECATED. Comma-separated list of code quality queries to run.' - required: false - packs: - description: >- - Comma-separated list of packs to run. Reference a pack in the format `scope/name[@version]`. If `version` is not - specified, then the latest version of the pack is used. By default, this overrides the same setting in a - configuration file; prefix with "+" to use both sets of packs. - - This input is only available in single-language analyses. To use packs in multi-language - analyses, you must specify packs in the codeql-config.yml file. - required: false - external-repository-token: - description: A token for fetching external config files and queries if they reside in a private repository in the same GitHub instance that is running this action. - required: false - setup-python-dependencies: - description: DEPRECATED. This option is ignored since CodeQL Action no longer installs Python dependencies as of versions 3.25.0 and 2.25.0. - required: false - source-root: - description: Path of the root source code directory, relative to $GITHUB_WORKSPACE. - required: false - ram: - description: >- - The amount of memory in MB that can be used by CodeQL extractors. - By default, CodeQL extractors will use most of the memory available in the system - (which for GitHub-hosted runners is 6GB for Linux, 5.5GB for Windows, and 13GB for macOS). - This input also sets the amount of memory that can later be used by the "analyze" action. - required: false - threads: - description: >- - The number of threads that can be used by CodeQL extractors. - By default, CodeQL extractors will use all the hardware threads available in the system - (which for GitHub-hosted runners is 2 for Linux and Windows and 3 for macOS). - This input also sets the number of threads that can later be used by the "analyze" action. - required: false - debug: - description: >- - Enable debugging mode. - This will result in more output being produced which may be useful when debugging certain issues. - Debugging mode is enabled automatically when step debug logging is turned on. - required: false - default: 'false' - debug-artifact-name: - description: >- - The name of the artifact to store debugging information in. - This is only used when debug mode is enabled. - required: false - debug-database-name: - description: >- - The name of the database uploaded to the debugging artifact. - This is only used when debug mode is enabled. - required: false - trap-caching: - description: >- - Explicitly enable or disable TRAP caching rather than respecting the feature flag for it. - required: false - dependency-caching: - description: >- - Explicitly enable or disable caching of project build dependencies. - required: false - check-run-id: - description: >- - [Internal] The ID of the check run, as provided by the Actions runtime environment. Do not set this value manually. - default: ${{ job.check_run_id }} - required: false -outputs: - codeql-path: - description: The path of the CodeQL binary used for analysis - codeql-version: - description: The version of the CodeQL binary used for analysis -runs: - using: node24 - main: '../lib/init-entry.js' - post: '../lib/init-post-entry.js' diff --git a/justfile b/justfile deleted file mode 100644 index ed9d9eb1db..0000000000 --- a/justfile +++ /dev/null @@ -1,30 +0,0 @@ -# Perform all working copy cleanup operations -all: lint sync - -# Lint source typescript -lint: - npm run lint-fix - -# Sync generated files (javascript and PR checks) -sync: build update-pr-checks - -# Perform all necessary steps to update the PR checks -update-pr-checks: - pr-checks/sync.sh - -# Transpile typescript code into javascript -build: - npm run build - -# Build then run all the tests -test: build - npm run test - -# Run the tests for a single file -test_file filename: build - npm run ava {{filename}} - -[doc("Refresh the .js build artefacts in the lib directory")] -[confirm] -refresh-lib: - rm -rf lib && npm run build diff --git a/lib/analyze-entry.js b/lib/analyze-entry.js deleted file mode 100644 index 8b8462e5a0..0000000000 --- a/lib/analyze-entry.js +++ /dev/null @@ -1,6 +0,0 @@ -// Automatically generated from 'action-entry.js.tpl' for 'src/analyze-action.ts'. - -"use strict"; - -const import_entry_points = require("./entry-points"); -void (0, import_entry_points.runAnalyzeAction)(); diff --git a/lib/analyze-post-entry.js b/lib/analyze-post-entry.js deleted file mode 100644 index ea0e9ead88..0000000000 --- a/lib/analyze-post-entry.js +++ /dev/null @@ -1,6 +0,0 @@ -// Automatically generated from 'action-entry.js.tpl' for 'src/analyze-action-post.ts'. - -"use strict"; - -const import_entry_points = require("./entry-points"); -void (0, import_entry_points.runAnalyzePostAction)(); diff --git a/lib/autobuild-entry.js b/lib/autobuild-entry.js deleted file mode 100644 index 18b64ff867..0000000000 --- a/lib/autobuild-entry.js +++ /dev/null @@ -1,6 +0,0 @@ -// Automatically generated from 'action-entry.js.tpl' for 'src/autobuild-action.ts'. - -"use strict"; - -const import_entry_points = require("./entry-points"); -void (0, import_entry_points.runAutobuildAction)(); diff --git a/lib/defaults.json b/lib/defaults.json deleted file mode 100644 index b5d9f13644..0000000000 --- a/lib/defaults.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "bundleVersion": "codeql-bundle-v2.26.3", - "cliVersion": "2.26.3", - "priorBundleVersion": "codeql-bundle-v2.26.2", - "priorCliVersion": "2.26.2" -} diff --git a/lib/entry-points.js b/lib/entry-points.js deleted file mode 100644 index c10b0ce2ea..0000000000 --- a/lib/entry-points.js +++ /dev/null @@ -1,163903 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res, err) => function __init() { - if (err) throw err[0]; - try { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; - } catch (e) { - throw err = [e], e; - } -}; -var __commonJS = (cb, mod) => function __require() { - try { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; - } catch (e) { - throw mod = 0, e; - } -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/@actions/core/lib/utils.js -var require_utils = __commonJS({ - "node_modules/@actions/core/lib/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandValue = toCommandValue; - exports2.toCommandProperties = toCommandProperties; - function toCommandValue(input) { - if (input === null || input === void 0) { - return ""; - } else if (typeof input === "string" || input instanceof String) { - return input; - } - return JSON.stringify(input); - } - function toCommandProperties(annotationProperties) { - if (!Object.keys(annotationProperties).length) { - return {}; - } - return { - title: annotationProperties.title, - file: annotationProperties.file, - line: annotationProperties.startLine, - endLine: annotationProperties.endLine, - col: annotationProperties.startColumn, - endColumn: annotationProperties.endColumn - }; - } - } -}); - -// node_modules/@actions/core/lib/command.js -var require_command = __commonJS({ - "node_modules/@actions/core/lib/command.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.issueCommand = issueCommand; - exports2.issue = issue; - var os7 = __importStar2(require("os")); - var utils_1 = require_utils(); - function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os7.EOL); - } - function issue(name, message = "") { - issueCommand(name, {}, message); - } - var CMD_STRING = "::"; - var Command = class { - constructor(command, properties, message) { - if (!command) { - command = "missing.command"; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += " "; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } else { - cmdStr += ","; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } - } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } - }; - function escapeData(s) { - return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); - } - function escapeProperty(s) { - return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); - } - } -}); - -// node_modules/@actions/core/lib/file-command.js -var require_file_command = __commonJS({ - "node_modules/@actions/core/lib/file-command.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.issueFileCommand = issueFileCommand; - exports2.prepareKeyValueMessage = prepareKeyValueMessage; - var crypto3 = __importStar2(require("crypto")); - var fs32 = __importStar2(require("fs")); - var os7 = __importStar2(require("os")); - var utils_1 = require_utils(); - function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs32.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs32.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os7.EOL}`, { - encoding: "utf8" - }); - } - function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto3.randomUUID()}`; - const convertedValue = (0, utils_1.toCommandValue)(value); - if (key.includes(delimiter)) { - throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); - } - if (convertedValue.includes(delimiter)) { - throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); - } - return `${key}<<${delimiter}${os7.EOL}${convertedValue}${os7.EOL}${delimiter}`; - } - } -}); - -// node_modules/@actions/http-client/lib/proxy.js -var require_proxy = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getProxyUrl = getProxyUrl; - exports2.checkBypass = checkBypass; - function getProxyUrl(reqUrl) { - const usingSsl = reqUrl.protocol === "https:"; - if (checkBypass(reqUrl)) { - return void 0; - } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; - } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a2) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); - } - } else { - return void 0; - } - } - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; - } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; - } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { - if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { - return true; - } - } - return false; - } - function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); - } - var DecodedURL = class extends URL { - constructor(url2, base) { - super(url2, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; - } -}); - -// node_modules/tunnel/lib/tunnel.js -var require_tunnel = __commonJS({ - "node_modules/tunnel/lib/tunnel.js"(exports2) { - "use strict"; - var net = require("net"); - var tls = require("tls"); - var http = require("http"); - var https3 = require("https"); - var events = require("events"); - var assert = require("assert"); - var util3 = require("util"); - exports2.httpOverHttp = httpOverHttp; - exports2.httpsOverHttp = httpsOverHttp; - exports2.httpOverHttps = httpOverHttps; - exports2.httpsOverHttps = httpsOverHttps; - function httpOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - return agent; - } - function httpsOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; - } - function httpOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https3.request; - return agent; - } - function httpsOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https3.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; - } - function TunnelingAgent(options) { - var self2 = this; - self2.options = options || {}; - self2.proxyOptions = self2.options.proxy || {}; - self2.maxSockets = self2.options.maxSockets || http.Agent.defaultMaxSockets; - self2.requests = []; - self2.sockets = []; - self2.on("free", function onFree(socket, host, port, localAddress) { - var options2 = toOptions(host, port, localAddress); - for (var i = 0, len = self2.requests.length; i < len; ++i) { - var pending = self2.requests[i]; - if (pending.host === options2.host && pending.port === options2.port) { - self2.requests.splice(i, 1); - pending.request.onSocket(socket); - return; - } - } - socket.destroy(); - self2.removeSocket(socket); - }); - } - util3.inherits(TunnelingAgent, events.EventEmitter); - TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { - var self2 = this; - var options = mergeOptions({ request: req }, self2.options, toOptions(host, port, localAddress)); - if (self2.sockets.length >= this.maxSockets) { - self2.requests.push(options); - return; - } - self2.createSocket(options, function(socket) { - socket.on("free", onFree); - socket.on("close", onCloseOrRemove); - socket.on("agentRemove", onCloseOrRemove); - req.onSocket(socket); - function onFree() { - self2.emit("free", socket, options); - } - function onCloseOrRemove(err) { - self2.removeSocket(socket); - socket.removeListener("free", onFree); - socket.removeListener("close", onCloseOrRemove); - socket.removeListener("agentRemove", onCloseOrRemove); - } - }); - }; - TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self2 = this; - var placeholder = {}; - self2.sockets.push(placeholder); - var connectOptions = mergeOptions({}, self2.proxyOptions, { - method: "CONNECT", - path: options.host + ":" + options.port, - agent: false, - headers: { - host: options.host + ":" + options.port - } - }); - if (options.localAddress) { - connectOptions.localAddress = options.localAddress; - } - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {}; - connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); - } - debug6("making CONNECT request"); - var connectReq = self2.request(connectOptions); - connectReq.useChunkedEncodingByDefault = false; - connectReq.once("response", onResponse); - connectReq.once("upgrade", onUpgrade); - connectReq.once("connect", onConnect); - connectReq.once("error", onError); - connectReq.end(); - function onResponse(res) { - res.upgrade = true; - } - function onUpgrade(res, socket, head) { - process.nextTick(function() { - onConnect(res, socket, head); - }); - } - function onConnect(res, socket, head) { - connectReq.removeAllListeners(); - socket.removeAllListeners(); - if (res.statusCode !== 200) { - debug6( - "tunneling socket could not be established, statusCode=%d", - res.statusCode - ); - socket.destroy(); - var error3 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error3.code = "ECONNRESET"; - options.request.emit("error", error3); - self2.removeSocket(placeholder); - return; - } - if (head.length > 0) { - debug6("got illegal response body from proxy"); - socket.destroy(); - var error3 = new Error("got illegal response body from proxy"); - error3.code = "ECONNRESET"; - options.request.emit("error", error3); - self2.removeSocket(placeholder); - return; - } - debug6("tunneling connection has established"); - self2.sockets[self2.sockets.indexOf(placeholder)] = socket; - return cb(socket); - } - function onError(cause) { - connectReq.removeAllListeners(); - debug6( - "tunneling socket could not be established, cause=%s\n", - cause.message, - cause.stack - ); - var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); - error3.code = "ECONNRESET"; - options.request.emit("error", error3); - self2.removeSocket(placeholder); - } - }; - TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket); - if (pos === -1) { - return; - } - this.sockets.splice(pos, 1); - var pending = this.requests.shift(); - if (pending) { - this.createSocket(pending, function(socket2) { - pending.request.onSocket(socket2); - }); - } - }; - function createSecureSocket(options, cb) { - var self2 = this; - TunnelingAgent.prototype.createSocket.call(self2, options, function(socket) { - var hostHeader = options.request.getHeader("host"); - var tlsOptions = mergeOptions({}, self2.options, { - socket, - servername: hostHeader ? hostHeader.replace(/:.*$/, "") : options.host - }); - var secureSocket = tls.connect(0, tlsOptions); - self2.sockets[self2.sockets.indexOf(socket)] = secureSocket; - cb(secureSocket); - }); - } - function toOptions(host, port, localAddress) { - if (typeof host === "string") { - return { - host, - port, - localAddress - }; - } - return host; - } - function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i]; - if (typeof overrides === "object") { - var keys = Object.keys(overrides); - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j]; - if (overrides[k] !== void 0) { - target[k] = overrides[k]; - } - } - } - } - return target; - } - var debug6; - if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug6 = function() { - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === "string") { - args[0] = "TUNNEL: " + args[0]; - } else { - args.unshift("TUNNEL:"); - } - console.error.apply(console, args); - }; - } else { - debug6 = function() { - }; - } - exports2.debug = debug6; - } -}); - -// node_modules/tunnel/index.js -var require_tunnel2 = __commonJS({ - "node_modules/tunnel/index.js"(exports2, module2) { - module2.exports = require_tunnel(); - } -}); - -// node_modules/undici/lib/core/symbols.js -var require_symbols = __commonJS({ - "node_modules/undici/lib/core/symbols.js"(exports2, module2) { - module2.exports = { - kClose: /* @__PURE__ */ Symbol("close"), - kDestroy: /* @__PURE__ */ Symbol("destroy"), - kDispatch: /* @__PURE__ */ Symbol("dispatch"), - kUrl: /* @__PURE__ */ Symbol("url"), - kWriting: /* @__PURE__ */ Symbol("writing"), - kResuming: /* @__PURE__ */ Symbol("resuming"), - kQueue: /* @__PURE__ */ Symbol("queue"), - kConnect: /* @__PURE__ */ Symbol("connect"), - kConnecting: /* @__PURE__ */ Symbol("connecting"), - kKeepAliveDefaultTimeout: /* @__PURE__ */ Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: /* @__PURE__ */ Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: /* @__PURE__ */ Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: /* @__PURE__ */ Symbol("keep alive timeout"), - kKeepAlive: /* @__PURE__ */ Symbol("keep alive"), - kHeadersTimeout: /* @__PURE__ */ Symbol("headers timeout"), - kBodyTimeout: /* @__PURE__ */ Symbol("body timeout"), - kServerName: /* @__PURE__ */ Symbol("server name"), - kLocalAddress: /* @__PURE__ */ Symbol("local address"), - kHost: /* @__PURE__ */ Symbol("host"), - kNoRef: /* @__PURE__ */ Symbol("no ref"), - kBodyUsed: /* @__PURE__ */ Symbol("used"), - kBody: /* @__PURE__ */ Symbol("abstracted request body"), - kRunning: /* @__PURE__ */ Symbol("running"), - kBlocking: /* @__PURE__ */ Symbol("blocking"), - kPending: /* @__PURE__ */ Symbol("pending"), - kSize: /* @__PURE__ */ Symbol("size"), - kBusy: /* @__PURE__ */ Symbol("busy"), - kQueued: /* @__PURE__ */ Symbol("queued"), - kFree: /* @__PURE__ */ Symbol("free"), - kConnected: /* @__PURE__ */ Symbol("connected"), - kClosed: /* @__PURE__ */ Symbol("closed"), - kNeedDrain: /* @__PURE__ */ Symbol("need drain"), - kReset: /* @__PURE__ */ Symbol("reset"), - kDestroyed: /* @__PURE__ */ Symbol.for("nodejs.stream.destroyed"), - kResume: /* @__PURE__ */ Symbol("resume"), - kOnError: /* @__PURE__ */ Symbol("on error"), - kMaxHeadersSize: /* @__PURE__ */ Symbol("max headers size"), - kRunningIdx: /* @__PURE__ */ Symbol("running index"), - kPendingIdx: /* @__PURE__ */ Symbol("pending index"), - kError: /* @__PURE__ */ Symbol("error"), - kClients: /* @__PURE__ */ Symbol("clients"), - kClient: /* @__PURE__ */ Symbol("client"), - kParser: /* @__PURE__ */ Symbol("parser"), - kOnDestroyed: /* @__PURE__ */ Symbol("destroy callbacks"), - kPipelining: /* @__PURE__ */ Symbol("pipelining"), - kSocket: /* @__PURE__ */ Symbol("socket"), - kHostHeader: /* @__PURE__ */ Symbol("host header"), - kConnector: /* @__PURE__ */ Symbol("connector"), - kStrictContentLength: /* @__PURE__ */ Symbol("strict content length"), - kMaxRedirections: /* @__PURE__ */ Symbol("maxRedirections"), - kMaxRequests: /* @__PURE__ */ Symbol("maxRequestsPerClient"), - kProxy: /* @__PURE__ */ Symbol("proxy agent options"), - kCounter: /* @__PURE__ */ Symbol("socket request counter"), - kInterceptors: /* @__PURE__ */ Symbol("dispatch interceptors"), - kMaxResponseSize: /* @__PURE__ */ Symbol("max response size"), - kHTTP2Session: /* @__PURE__ */ Symbol("http2Session"), - kHTTP2SessionState: /* @__PURE__ */ Symbol("http2Session state"), - kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), - kConstruct: /* @__PURE__ */ Symbol("constructable"), - kListeners: /* @__PURE__ */ Symbol("listeners"), - kHTTPContext: /* @__PURE__ */ Symbol("http context"), - kMaxConcurrentStreams: /* @__PURE__ */ Symbol("max concurrent streams"), - kNoProxyAgent: /* @__PURE__ */ Symbol("no proxy agent"), - kHttpProxyAgent: /* @__PURE__ */ Symbol("http proxy agent"), - kHttpsProxyAgent: /* @__PURE__ */ Symbol("https proxy agent") - }; - } -}); - -// node_modules/undici/lib/core/errors.js -var require_errors = __commonJS({ - "node_modules/undici/lib/core/errors.js"(exports2, module2) { - "use strict"; - var kUndiciError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR"); - var UndiciError = class extends Error { - constructor(message) { - super(message); - this.name = "UndiciError"; - this.code = "UND_ERR"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kUndiciError] === true; - } - [kUndiciError] = true; - }; - var kConnectTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"); - var ConnectTimeoutError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ConnectTimeoutError"; - this.message = message || "Connect Timeout Error"; - this.code = "UND_ERR_CONNECT_TIMEOUT"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kConnectTimeoutError] === true; - } - [kConnectTimeoutError] = true; - }; - var kHeadersTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"); - var HeadersTimeoutError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "HeadersTimeoutError"; - this.message = message || "Headers Timeout Error"; - this.code = "UND_ERR_HEADERS_TIMEOUT"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kHeadersTimeoutError] === true; - } - [kHeadersTimeoutError] = true; - }; - var kHeadersOverflowError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"); - var HeadersOverflowError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "HeadersOverflowError"; - this.message = message || "Headers Overflow Error"; - this.code = "UND_ERR_HEADERS_OVERFLOW"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kHeadersOverflowError] === true; - } - [kHeadersOverflowError] = true; - }; - var kBodyTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"); - var BodyTimeoutError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "BodyTimeoutError"; - this.message = message || "Body Timeout Error"; - this.code = "UND_ERR_BODY_TIMEOUT"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kBodyTimeoutError] === true; - } - [kBodyTimeoutError] = true; - }; - var kResponseStatusCodeError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"); - var ResponseStatusCodeError = class extends UndiciError { - constructor(message, statusCode, headers, body) { - super(message); - this.name = "ResponseStatusCodeError"; - this.message = message || "Response Status Code Error"; - this.code = "UND_ERR_RESPONSE_STATUS_CODE"; - this.body = body; - this.status = statusCode; - this.statusCode = statusCode; - this.headers = headers; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kResponseStatusCodeError] === true; - } - [kResponseStatusCodeError] = true; - }; - var kInvalidArgumentError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INVALID_ARG"); - var InvalidArgumentError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "InvalidArgumentError"; - this.message = message || "Invalid Argument Error"; - this.code = "UND_ERR_INVALID_ARG"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kInvalidArgumentError] === true; - } - [kInvalidArgumentError] = true; - }; - var kInvalidReturnValueError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"); - var InvalidReturnValueError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "InvalidReturnValueError"; - this.message = message || "Invalid Return Value Error"; - this.code = "UND_ERR_INVALID_RETURN_VALUE"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kInvalidReturnValueError] === true; - } - [kInvalidReturnValueError] = true; - }; - var kAbortError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORT"); - var AbortError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "AbortError"; - this.message = message || "The operation was aborted"; - this.code = "UND_ERR_ABORT"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kAbortError] === true; - } - [kAbortError] = true; - }; - var kRequestAbortedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORTED"); - var RequestAbortedError = class extends AbortError { - constructor(message) { - super(message); - this.name = "AbortError"; - this.message = message || "Request aborted"; - this.code = "UND_ERR_ABORTED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kRequestAbortedError] === true; - } - [kRequestAbortedError] = true; - }; - var kInformationalError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INFO"); - var InformationalError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "InformationalError"; - this.message = message || "Request information"; - this.code = "UND_ERR_INFO"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kInformationalError] === true; - } - [kInformationalError] = true; - }; - var kRequestContentLengthMismatchError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"); - var RequestContentLengthMismatchError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "RequestContentLengthMismatchError"; - this.message = message || "Request body length does not match content-length header"; - this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kRequestContentLengthMismatchError] === true; - } - [kRequestContentLengthMismatchError] = true; - }; - var kResponseContentLengthMismatchError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"); - var ResponseContentLengthMismatchError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ResponseContentLengthMismatchError"; - this.message = message || "Response body length does not match content-length header"; - this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kResponseContentLengthMismatchError] === true; - } - [kResponseContentLengthMismatchError] = true; - }; - var kClientDestroyedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_DESTROYED"); - var ClientDestroyedError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ClientDestroyedError"; - this.message = message || "The client is destroyed"; - this.code = "UND_ERR_DESTROYED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kClientDestroyedError] === true; - } - [kClientDestroyedError] = true; - }; - var kClientClosedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_CLOSED"); - var ClientClosedError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ClientClosedError"; - this.message = message || "The client is closed"; - this.code = "UND_ERR_CLOSED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kClientClosedError] === true; - } - [kClientClosedError] = true; - }; - var kSocketError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_SOCKET"); - var SocketError = class extends UndiciError { - constructor(message, socket) { - super(message); - this.name = "SocketError"; - this.message = message || "Socket error"; - this.code = "UND_ERR_SOCKET"; - this.socket = socket; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kSocketError] === true; - } - [kSocketError] = true; - }; - var kNotSupportedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"); - var NotSupportedError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "NotSupportedError"; - this.message = message || "Not supported error"; - this.code = "UND_ERR_NOT_SUPPORTED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kNotSupportedError] === true; - } - [kNotSupportedError] = true; - }; - var kBalancedPoolMissingUpstreamError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"); - var BalancedPoolMissingUpstreamError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "MissingUpstreamError"; - this.message = message || "No upstream has been added to the BalancedPool"; - this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kBalancedPoolMissingUpstreamError] === true; - } - [kBalancedPoolMissingUpstreamError] = true; - }; - var kHTTPParserError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HTTP_PARSER"); - var HTTPParserError = class extends Error { - constructor(message, code, data) { - super(message); - this.name = "HTTPParserError"; - this.code = code ? `HPE_${code}` : void 0; - this.data = data ? data.toString() : void 0; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kHTTPParserError] === true; - } - [kHTTPParserError] = true; - }; - var kResponseExceededMaxSizeError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"); - var ResponseExceededMaxSizeError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ResponseExceededMaxSizeError"; - this.message = message || "Response content exceeded max size"; - this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kResponseExceededMaxSizeError] === true; - } - [kResponseExceededMaxSizeError] = true; - }; - var kRequestRetryError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_REQ_RETRY"); - var RequestRetryError = class extends UndiciError { - constructor(message, code, { headers, data }) { - super(message); - this.name = "RequestRetryError"; - this.message = message || "Request retry error"; - this.code = "UND_ERR_REQ_RETRY"; - this.statusCode = code; - this.data = data; - this.headers = headers; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kRequestRetryError] === true; - } - [kRequestRetryError] = true; - }; - var kResponseError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RESPONSE"); - var ResponseError = class extends UndiciError { - constructor(message, code, { headers, data }) { - super(message); - this.name = "ResponseError"; - this.message = message || "Response error"; - this.code = "UND_ERR_RESPONSE"; - this.statusCode = code; - this.data = data; - this.headers = headers; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kResponseError] === true; - } - [kResponseError] = true; - }; - var kSecureProxyConnectionError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_PRX_TLS"); - var SecureProxyConnectionError = class extends UndiciError { - constructor(cause, message, options) { - super(message, { cause, ...options ?? {} }); - this.name = "SecureProxyConnectionError"; - this.message = message || "Secure Proxy Connection failed"; - this.code = "UND_ERR_PRX_TLS"; - this.cause = cause; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kSecureProxyConnectionError] === true; - } - [kSecureProxyConnectionError] = true; - }; - var kMessageSizeExceededError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"); - var MessageSizeExceededError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "MessageSizeExceededError"; - this.message = message || "Max decompressed message size exceeded"; - this.code = "UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kMessageSizeExceededError] === true; - } - get [kMessageSizeExceededError]() { - return true; - } - }; - module2.exports = { - AbortError, - HTTPParserError, - UndiciError, - HeadersTimeoutError, - HeadersOverflowError, - BodyTimeoutError, - RequestContentLengthMismatchError, - ConnectTimeoutError, - ResponseStatusCodeError, - InvalidArgumentError, - InvalidReturnValueError, - RequestAbortedError, - ClientDestroyedError, - ClientClosedError, - InformationalError, - SocketError, - NotSupportedError, - ResponseContentLengthMismatchError, - BalancedPoolMissingUpstreamError, - ResponseExceededMaxSizeError, - RequestRetryError, - ResponseError, - SecureProxyConnectionError, - MessageSizeExceededError - }; - } -}); - -// node_modules/undici/lib/core/constants.js -var require_constants = __commonJS({ - "node_modules/undici/lib/core/constants.js"(exports2, module2) { - "use strict"; - var headerNameLowerCasedRecord = {}; - var wellknownHeaderNames = [ - "Accept", - "Accept-Encoding", - "Accept-Language", - "Accept-Ranges", - "Access-Control-Allow-Credentials", - "Access-Control-Allow-Headers", - "Access-Control-Allow-Methods", - "Access-Control-Allow-Origin", - "Access-Control-Expose-Headers", - "Access-Control-Max-Age", - "Access-Control-Request-Headers", - "Access-Control-Request-Method", - "Age", - "Allow", - "Alt-Svc", - "Alt-Used", - "Authorization", - "Cache-Control", - "Clear-Site-Data", - "Connection", - "Content-Disposition", - "Content-Encoding", - "Content-Language", - "Content-Length", - "Content-Location", - "Content-Range", - "Content-Security-Policy", - "Content-Security-Policy-Report-Only", - "Content-Type", - "Cookie", - "Cross-Origin-Embedder-Policy", - "Cross-Origin-Opener-Policy", - "Cross-Origin-Resource-Policy", - "Date", - "Device-Memory", - "Downlink", - "ECT", - "ETag", - "Expect", - "Expect-CT", - "Expires", - "Forwarded", - "From", - "Host", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Range", - "If-Unmodified-Since", - "Keep-Alive", - "Last-Modified", - "Link", - "Location", - "Max-Forwards", - "Origin", - "Permissions-Policy", - "Pragma", - "Proxy-Authenticate", - "Proxy-Authorization", - "RTT", - "Range", - "Referer", - "Referrer-Policy", - "Refresh", - "Retry-After", - "Sec-WebSocket-Accept", - "Sec-WebSocket-Extensions", - "Sec-WebSocket-Key", - "Sec-WebSocket-Protocol", - "Sec-WebSocket-Version", - "Server", - "Server-Timing", - "Service-Worker-Allowed", - "Service-Worker-Navigation-Preload", - "Set-Cookie", - "SourceMap", - "Strict-Transport-Security", - "Supports-Loading-Mode", - "TE", - "Timing-Allow-Origin", - "Trailer", - "Transfer-Encoding", - "Upgrade", - "Upgrade-Insecure-Requests", - "User-Agent", - "Vary", - "Via", - "WWW-Authenticate", - "X-Content-Type-Options", - "X-DNS-Prefetch-Control", - "X-Frame-Options", - "X-Permitted-Cross-Domain-Policies", - "X-Powered-By", - "X-Requested-With", - "X-XSS-Protection" - ]; - for (let i = 0; i < wellknownHeaderNames.length; ++i) { - const key = wellknownHeaderNames[i]; - const lowerCasedKey = key.toLowerCase(); - headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey; - } - Object.setPrototypeOf(headerNameLowerCasedRecord, null); - module2.exports = { - wellknownHeaderNames, - headerNameLowerCasedRecord - }; - } -}); - -// node_modules/undici/lib/core/tree.js -var require_tree = __commonJS({ - "node_modules/undici/lib/core/tree.js"(exports2, module2) { - "use strict"; - var { - wellknownHeaderNames, - headerNameLowerCasedRecord - } = require_constants(); - var TstNode = class _TstNode { - /** @type {any} */ - value = null; - /** @type {null | TstNode} */ - left = null; - /** @type {null | TstNode} */ - middle = null; - /** @type {null | TstNode} */ - right = null; - /** @type {number} */ - code; - /** - * @param {string} key - * @param {any} value - * @param {number} index - */ - constructor(key, value, index2) { - if (index2 === void 0 || index2 >= key.length) { - throw new TypeError("Unreachable"); - } - const code = this.code = key.charCodeAt(index2); - if (code > 127) { - throw new TypeError("key must be ascii string"); - } - if (key.length !== ++index2) { - this.middle = new _TstNode(key, value, index2); - } else { - this.value = value; - } - } - /** - * @param {string} key - * @param {any} value - */ - add(key, value) { - const length = key.length; - if (length === 0) { - throw new TypeError("Unreachable"); - } - let index2 = 0; - let node = this; - while (true) { - const code = key.charCodeAt(index2); - if (code > 127) { - throw new TypeError("key must be ascii string"); - } - if (node.code === code) { - if (length === ++index2) { - node.value = value; - break; - } else if (node.middle !== null) { - node = node.middle; - } else { - node.middle = new _TstNode(key, value, index2); - break; - } - } else if (node.code < code) { - if (node.left !== null) { - node = node.left; - } else { - node.left = new _TstNode(key, value, index2); - break; - } - } else if (node.right !== null) { - node = node.right; - } else { - node.right = new _TstNode(key, value, index2); - break; - } - } - } - /** - * @param {Uint8Array} key - * @return {TstNode | null} - */ - search(key) { - const keylength = key.length; - let index2 = 0; - let node = this; - while (node !== null && index2 < keylength) { - let code = key[index2]; - if (code <= 90 && code >= 65) { - code |= 32; - } - while (node !== null) { - if (code === node.code) { - if (keylength === ++index2) { - return node; - } - node = node.middle; - break; - } - node = node.code < code ? node.left : node.right; - } - } - return null; - } - }; - var TernarySearchTree = class { - /** @type {TstNode | null} */ - node = null; - /** - * @param {string} key - * @param {any} value - * */ - insert(key, value) { - if (this.node === null) { - this.node = new TstNode(key, value, 0); - } else { - this.node.add(key, value); - } - } - /** - * @param {Uint8Array} key - * @return {any} - */ - lookup(key) { - return this.node?.search(key)?.value ?? null; - } - }; - var tree = new TernarySearchTree(); - for (let i = 0; i < wellknownHeaderNames.length; ++i) { - const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]; - tree.insert(key, key); - } - module2.exports = { - TernarySearchTree, - tree - }; - } -}); - -// node_modules/undici/lib/core/util.js -var require_util = __commonJS({ - "node_modules/undici/lib/core/util.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols(); - var { IncomingMessage } = require("node:http"); - var stream2 = require("node:stream"); - var net = require("node:net"); - var { Blob: Blob2 } = require("node:buffer"); - var nodeUtil = require("node:util"); - var { stringify } = require("node:querystring"); - var { EventEmitter: EE } = require("node:events"); - var { InvalidArgumentError } = require_errors(); - var { headerNameLowerCasedRecord } = require_constants(); - var { tree } = require_tree(); - var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); - var BodyAsyncIterable = class { - constructor(body) { - this[kBody] = body; - this[kBodyUsed] = false; - } - async *[Symbol.asyncIterator]() { - assert(!this[kBodyUsed], "disturbed"); - this[kBodyUsed] = true; - yield* this[kBody]; - } - }; - function wrapRequestBody(body) { - if (isStream2(body)) { - if (bodyLength(body) === 0) { - body.on("data", function() { - assert(false); - }); - } - if (typeof body.readableDidRead !== "boolean") { - body[kBodyUsed] = false; - EE.prototype.on.call(body, "data", function() { - this[kBodyUsed] = true; - }); - } - return body; - } else if (body && typeof body.pipeTo === "function") { - return new BodyAsyncIterable(body); - } else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable(body)) { - return new BodyAsyncIterable(body); - } else { - return body; - } - } - function nop() { - } - function isStream2(obj) { - return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; - } - function isBlobLike(object2) { - if (object2 === null) { - return false; - } else if (object2 instanceof Blob2) { - return true; - } else if (typeof object2 !== "object") { - return false; - } else { - const sTag = object2[Symbol.toStringTag]; - return (sTag === "Blob" || sTag === "File") && ("stream" in object2 && typeof object2.stream === "function" || "arrayBuffer" in object2 && typeof object2.arrayBuffer === "function"); - } - } - function buildURL(url2, queryParams) { - if (url2.includes("?") || url2.includes("#")) { - throw new Error('Query params cannot be passed when url already contains "?" or "#".'); - } - const stringified = stringify(queryParams); - if (stringified) { - url2 += "?" + stringified; - } - return url2; - } - function isValidPort(port) { - const value = parseInt(port, 10); - return value === Number(port) && value >= 0 && value <= 65535; - } - function isHttpOrHttpsPrefixed(value) { - return value != null && value[0] === "h" && value[1] === "t" && value[2] === "t" && value[3] === "p" && (value[4] === ":" || value[4] === "s" && value[5] === ":"); - } - function parseURL(url2) { - if (typeof url2 === "string") { - url2 = new URL(url2); - if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { - throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); - } - return url2; - } - if (!url2 || typeof url2 !== "object") { - throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object."); - } - if (!(url2 instanceof URL)) { - if (url2.port != null && url2.port !== "" && isValidPort(url2.port) === false) { - throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer."); - } - if (url2.path != null && typeof url2.path !== "string") { - throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined."); - } - if (url2.pathname != null && typeof url2.pathname !== "string") { - throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined."); - } - if (url2.hostname != null && typeof url2.hostname !== "string") { - throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined."); - } - if (url2.origin != null && typeof url2.origin !== "string") { - throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined."); - } - if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { - throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); - } - const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; - let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path30 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; - if (origin[origin.length - 1] === "/") { - origin = origin.slice(0, origin.length - 1); - } - if (path30 && path30[0] !== "/") { - path30 = `/${path30}`; - } - return new URL(`${origin}${path30}`); - } - if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { - throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); - } - return url2; - } - function parseOrigin(url2) { - url2 = parseURL(url2); - if (url2.pathname !== "/" || url2.search || url2.hash) { - throw new InvalidArgumentError("invalid url"); - } - return url2; - } - function getHostname(host) { - if (host[0] === "[") { - const idx2 = host.indexOf("]"); - assert(idx2 !== -1); - return host.substring(1, idx2); - } - const idx = host.indexOf(":"); - if (idx === -1) return host; - return host.substring(0, idx); - } - function getServerName(host) { - if (!host) { - return null; - } - assert(typeof host === "string"); - const servername = getHostname(host); - if (net.isIP(servername)) { - return ""; - } - return servername; - } - function deepClone(obj) { - return JSON.parse(JSON.stringify(obj)); - } - function isAsyncIterable(obj) { - return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function"); - } - function isIterable(obj) { - return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function")); - } - function bodyLength(body) { - if (body == null) { - return 0; - } else if (isStream2(body)) { - const state = body._readableState; - return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null; - } else if (isBlobLike(body)) { - return body.size != null ? body.size : null; - } else if (isBuffer(body)) { - return body.byteLength; - } - return null; - } - function isDestroyed(body) { - return body && !!(body.destroyed || body[kDestroyed] || stream2.isDestroyed?.(body)); - } - function destroy(stream3, err) { - if (stream3 == null || !isStream2(stream3) || isDestroyed(stream3)) { - return; - } - if (typeof stream3.destroy === "function") { - if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { - stream3.socket = null; - } - stream3.destroy(err); - } else if (err) { - queueMicrotask(() => { - stream3.emit("error", err); - }); - } - if (stream3.destroyed !== true) { - stream3[kDestroyed] = true; - } - } - var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val) { - const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); - return m ? parseInt(m[1], 10) * 1e3 : null; - } - function headerNameToString(value) { - return typeof value === "string" ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString("latin1").toLowerCase(); - } - function bufferToLowerCasedHeaderName(value) { - return tree.lookup(value) ?? value.toString("latin1").toLowerCase(); - } - function parseHeaders(headers, obj) { - if (obj === void 0) obj = {}; - for (let i = 0; i < headers.length; i += 2) { - const key = headerNameToString(headers[i]); - let val = obj[key]; - if (val) { - if (typeof val === "string") { - val = [val]; - obj[key] = val; - } - val.push(headers[i + 1].toString("utf8")); - } else { - const headersValue = headers[i + 1]; - if (typeof headersValue === "string") { - obj[key] = headersValue; - } else { - obj[key] = Array.isArray(headersValue) ? headersValue.map((x) => x.toString("utf8")) : headersValue.toString("utf8"); - } - } - } - if ("content-length" in obj && "content-disposition" in obj) { - obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1"); - } - return obj; - } - function parseRawHeaders(headers) { - const len = headers.length; - const ret = new Array(len); - let hasContentLength = false; - let contentDispositionIdx = -1; - let key; - let val; - let kLen = 0; - for (let n = 0; n < headers.length; n += 2) { - key = headers[n]; - val = headers[n + 1]; - typeof key !== "string" && (key = key.toString()); - typeof val !== "string" && (val = val.toString("utf8")); - kLen = key.length; - if (kLen === 14 && key[7] === "-" && (key === "content-length" || key.toLowerCase() === "content-length")) { - hasContentLength = true; - } else if (kLen === 19 && key[7] === "-" && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = n + 1; - } - ret[n] = key; - ret[n + 1] = val; - } - if (hasContentLength && contentDispositionIdx !== -1) { - ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1"); - } - return ret; - } - function isBuffer(buffer) { - return buffer instanceof Uint8Array || Buffer.isBuffer(buffer); - } - function validateHandler(handler2, method, upgrade) { - if (!handler2 || typeof handler2 !== "object") { - throw new InvalidArgumentError("handler must be an object"); - } - if (typeof handler2.onConnect !== "function") { - throw new InvalidArgumentError("invalid onConnect method"); - } - if (typeof handler2.onError !== "function") { - throw new InvalidArgumentError("invalid onError method"); - } - if (typeof handler2.onBodySent !== "function" && handler2.onBodySent !== void 0) { - throw new InvalidArgumentError("invalid onBodySent method"); - } - if (upgrade || method === "CONNECT") { - if (typeof handler2.onUpgrade !== "function") { - throw new InvalidArgumentError("invalid onUpgrade method"); - } - } else { - if (typeof handler2.onHeaders !== "function") { - throw new InvalidArgumentError("invalid onHeaders method"); - } - if (typeof handler2.onData !== "function") { - throw new InvalidArgumentError("invalid onData method"); - } - if (typeof handler2.onComplete !== "function") { - throw new InvalidArgumentError("invalid onComplete method"); - } - } - } - function isDisturbed(body) { - return !!(body && (stream2.isDisturbed(body) || body[kBodyUsed])); - } - function isErrored(body) { - return !!(body && stream2.isErrored(body)); - } - function isReadable(body) { - return !!(body && stream2.isReadable(body)); - } - function getSocketInfo(socket) { - return { - localAddress: socket.localAddress, - localPort: socket.localPort, - remoteAddress: socket.remoteAddress, - remotePort: socket.remotePort, - remoteFamily: socket.remoteFamily, - timeout: socket.timeout, - bytesWritten: socket.bytesWritten, - bytesRead: socket.bytesRead - }; - } - function ReadableStreamFrom(iterable) { - let iterator2; - return new ReadableStream( - { - async start() { - iterator2 = iterable[Symbol.asyncIterator](); - }, - async pull(controller) { - const { done, value } = await iterator2.next(); - if (done) { - queueMicrotask(() => { - controller.close(); - controller.byobRequest?.respond(0); - }); - } else { - const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); - if (buf.byteLength) { - controller.enqueue(new Uint8Array(buf)); - } - } - return controller.desiredSize > 0; - }, - async cancel(reason) { - await iterator2.return(); - }, - type: "bytes" - } - ); - } - function isFormDataLike(object2) { - return object2 && typeof object2 === "object" && typeof object2.append === "function" && typeof object2.delete === "function" && typeof object2.get === "function" && typeof object2.getAll === "function" && typeof object2.has === "function" && typeof object2.set === "function" && object2[Symbol.toStringTag] === "FormData"; - } - function addAbortListener(signal, listener) { - if ("addEventListener" in signal) { - signal.addEventListener("abort", listener, { once: true }); - return () => signal.removeEventListener("abort", listener); - } - signal.addListener("abort", listener); - return () => signal.removeListener("abort", listener); - } - var hasToWellFormed = typeof String.prototype.toWellFormed === "function"; - var hasIsWellFormed = typeof String.prototype.isWellFormed === "function"; - function toUSVString(val) { - return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val); - } - function isUSVString(val) { - return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`; - } - function isTokenCharCode(c) { - switch (c) { - case 34: - case 40: - case 41: - case 44: - case 47: - case 58: - case 59: - case 60: - case 61: - case 62: - case 63: - case 64: - case 91: - case 92: - case 93: - case 123: - case 125: - return false; - default: - return c >= 33 && c <= 126; - } - } - function isValidHTTPToken(characters) { - if (characters.length === 0) { - return false; - } - for (let i = 0; i < characters.length; ++i) { - if (!isTokenCharCode(characters.charCodeAt(i))) { - return false; - } - } - return true; - } - var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - function isValidHeaderValue(characters) { - return !headerCharRegex.test(characters); - } - function parseRangeHeader(range2) { - if (range2 == null || range2 === "") return { start: 0, end: null, size: null }; - const m = range2 ? range2.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null; - return m ? { - start: parseInt(m[1]), - end: m[2] ? parseInt(m[2]) : null, - size: m[3] ? parseInt(m[3]) : null - } : null; - } - function addListener(obj, name, listener) { - const listeners = obj[kListeners] ??= []; - listeners.push([name, listener]); - obj.on(name, listener); - return obj; - } - function removeAllListeners(obj) { - for (const [name, listener] of obj[kListeners] ?? []) { - obj.removeListener(name, listener); - } - obj[kListeners] = null; - } - function errorRequest2(client, request3, err) { - try { - request3.onError(err); - assert(request3.aborted); - } catch (err2) { - client.emit("error", err2); - } - } - var kEnumerableProperty = /* @__PURE__ */ Object.create(null); - kEnumerableProperty.enumerable = true; - var normalizedMethodRecordsBase = { - delete: "DELETE", - DELETE: "DELETE", - get: "GET", - GET: "GET", - head: "HEAD", - HEAD: "HEAD", - options: "OPTIONS", - OPTIONS: "OPTIONS", - post: "POST", - POST: "POST", - put: "PUT", - PUT: "PUT" - }; - var normalizedMethodRecords = { - ...normalizedMethodRecordsBase, - patch: "patch", - PATCH: "PATCH" - }; - Object.setPrototypeOf(normalizedMethodRecordsBase, null); - Object.setPrototypeOf(normalizedMethodRecords, null); - module2.exports = { - kEnumerableProperty, - nop, - isDisturbed, - isErrored, - isReadable, - toUSVString, - isUSVString, - isBlobLike, - parseOrigin, - parseURL, - getServerName, - isStream: isStream2, - isIterable, - isAsyncIterable, - isDestroyed, - headerNameToString, - bufferToLowerCasedHeaderName, - addListener, - removeAllListeners, - errorRequest: errorRequest2, - parseRawHeaders, - parseHeaders, - parseKeepAliveTimeout, - destroy, - bodyLength, - deepClone, - ReadableStreamFrom, - isBuffer, - validateHandler, - getSocketInfo, - isFormDataLike, - buildURL, - addAbortListener, - isValidHTTPToken, - isValidHeaderValue, - isTokenCharCode, - parseRangeHeader, - normalizedMethodRecordsBase, - normalizedMethodRecords, - isValidPort, - isHttpOrHttpsPrefixed, - nodeMajor, - nodeMinor, - safeHTTPMethods: ["GET", "HEAD", "OPTIONS", "TRACE"], - wrapRequestBody - }; - } -}); - -// node_modules/undici/lib/core/diagnostics.js -var require_diagnostics = __commonJS({ - "node_modules/undici/lib/core/diagnostics.js"(exports2, module2) { - "use strict"; - var diagnosticsChannel = require("node:diagnostics_channel"); - var util3 = require("node:util"); - var undiciDebugLog = util3.debuglog("undici"); - var fetchDebuglog = util3.debuglog("fetch"); - var websocketDebuglog = util3.debuglog("websocket"); - var isClientSet = false; - var channels = { - // Client - beforeConnect: diagnosticsChannel.channel("undici:client:beforeConnect"), - connected: diagnosticsChannel.channel("undici:client:connected"), - connectError: diagnosticsChannel.channel("undici:client:connectError"), - sendHeaders: diagnosticsChannel.channel("undici:client:sendHeaders"), - // Request - create: diagnosticsChannel.channel("undici:request:create"), - bodySent: diagnosticsChannel.channel("undici:request:bodySent"), - headers: diagnosticsChannel.channel("undici:request:headers"), - trailers: diagnosticsChannel.channel("undici:request:trailers"), - error: diagnosticsChannel.channel("undici:request:error"), - // WebSocket - open: diagnosticsChannel.channel("undici:websocket:open"), - close: diagnosticsChannel.channel("undici:websocket:close"), - socketError: diagnosticsChannel.channel("undici:websocket:socket_error"), - ping: diagnosticsChannel.channel("undici:websocket:ping"), - pong: diagnosticsChannel.channel("undici:websocket:pong") - }; - if (undiciDebugLog.enabled || fetchDebuglog.enabled) { - const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog; - diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { - const { - connectParams: { version, protocol, port, host } - } = evt; - debuglog( - "connecting to %s using %s%s", - `${host}${port ? `:${port}` : ""}`, - protocol, - version - ); - }); - diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { - const { - connectParams: { version, protocol, port, host } - } = evt; - debuglog( - "connected to %s using %s%s", - `${host}${port ? `:${port}` : ""}`, - protocol, - version - ); - }); - diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { - const { - connectParams: { version, protocol, port, host }, - error: error3 - } = evt; - debuglog( - "connection to %s using %s%s errored - %s", - `${host}${port ? `:${port}` : ""}`, - protocol, - version, - error3.message - ); - }); - diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { - const { - request: { method, path: path30, origin } - } = evt; - debuglog("sending request to %s %s/%s", method, origin, path30); - }); - diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { - const { - request: { method, path: path30, origin }, - response: { statusCode } - } = evt; - debuglog( - "received response to %s %s/%s - HTTP %d", - method, - origin, - path30, - statusCode - ); - }); - diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { - const { - request: { method, path: path30, origin } - } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path30); - }); - diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { - const { - request: { method, path: path30, origin }, - error: error3 - } = evt; - debuglog( - "request to %s %s/%s errored - %s", - method, - origin, - path30, - error3.message - ); - }); - isClientSet = true; - } - if (websocketDebuglog.enabled) { - if (!isClientSet) { - const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog; - diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { - const { - connectParams: { version, protocol, port, host } - } = evt; - debuglog( - "connecting to %s%s using %s%s", - host, - port ? `:${port}` : "", - protocol, - version - ); - }); - diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { - const { - connectParams: { version, protocol, port, host } - } = evt; - debuglog( - "connected to %s%s using %s%s", - host, - port ? `:${port}` : "", - protocol, - version - ); - }); - diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { - const { - connectParams: { version, protocol, port, host }, - error: error3 - } = evt; - debuglog( - "connection to %s%s using %s%s errored - %s", - host, - port ? `:${port}` : "", - protocol, - version, - error3.message - ); - }); - diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { - const { - request: { method, path: path30, origin } - } = evt; - debuglog("sending request to %s %s/%s", method, origin, path30); - }); - } - diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { - const { - address: { address, port } - } = evt; - websocketDebuglog("connection opened %s%s", address, port ? `:${port}` : ""); - }); - diagnosticsChannel.channel("undici:websocket:close").subscribe((evt) => { - const { websocket, code, reason } = evt; - websocketDebuglog( - "closed connection to %s - %s %s", - websocket.url, - code, - reason - ); - }); - diagnosticsChannel.channel("undici:websocket:socket_error").subscribe((err) => { - websocketDebuglog("connection errored - %s", err.message); - }); - diagnosticsChannel.channel("undici:websocket:ping").subscribe((evt) => { - websocketDebuglog("ping received"); - }); - diagnosticsChannel.channel("undici:websocket:pong").subscribe((evt) => { - websocketDebuglog("pong received"); - }); - } - module2.exports = { - channels - }; - } -}); - -// node_modules/undici/lib/core/request.js -var require_request = __commonJS({ - "node_modules/undici/lib/core/request.js"(exports2, module2) { - "use strict"; - var { - InvalidArgumentError, - NotSupportedError - } = require_errors(); - var assert = require("node:assert"); - var { - isValidHTTPToken, - isValidHeaderValue, - isStream: isStream2, - destroy, - isBuffer, - isFormDataLike, - isIterable, - isBlobLike, - buildURL, - validateHandler, - getServerName, - normalizedMethodRecords - } = require_util(); - var { channels } = require_diagnostics(); - var { headerNameLowerCasedRecord } = require_constants(); - var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = /* @__PURE__ */ Symbol("handler"); - var Request = class { - constructor(origin, { - path: path30, - method, - body, - headers, - query, - idempotent, - blocking, - upgrade, - headersTimeout, - bodyTimeout, - reset, - throwOnError, - expectContinue, - servername - }, handler2) { - if (typeof path30 !== "string") { - throw new InvalidArgumentError("path must be a string"); - } else if (path30[0] !== "/" && !(path30.startsWith("http://") || path30.startsWith("https://")) && method !== "CONNECT") { - throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path30)) { - throw new InvalidArgumentError("invalid request path"); - } - if (typeof method !== "string") { - throw new InvalidArgumentError("method must be a string"); - } else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) { - throw new InvalidArgumentError("invalid request method"); - } - if (upgrade && typeof upgrade !== "string") { - throw new InvalidArgumentError("upgrade must be a string"); - } - if (upgrade && !isValidHeaderValue(upgrade)) { - throw new InvalidArgumentError("invalid upgrade header"); - } - if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { - throw new InvalidArgumentError("invalid headersTimeout"); - } - if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { - throw new InvalidArgumentError("invalid bodyTimeout"); - } - if (reset != null && typeof reset !== "boolean") { - throw new InvalidArgumentError("invalid reset"); - } - if (expectContinue != null && typeof expectContinue !== "boolean") { - throw new InvalidArgumentError("invalid expectContinue"); - } - this.headersTimeout = headersTimeout; - this.bodyTimeout = bodyTimeout; - this.throwOnError = throwOnError === true; - this.method = method; - this.abort = null; - if (body == null) { - this.body = null; - } else if (isStream2(body)) { - this.body = body; - const rState = this.body._readableState; - if (!rState || !rState.autoDestroy) { - this.endHandler = function autoDestroy() { - destroy(this); - }; - this.body.on("end", this.endHandler); - } - this.errorHandler = (err) => { - if (this.abort) { - this.abort(err); - } else { - this.error = err; - } - }; - this.body.on("error", this.errorHandler); - } else if (isBuffer(body)) { - this.body = body.byteLength ? body : null; - } else if (ArrayBuffer.isView(body)) { - this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null; - } else if (body instanceof ArrayBuffer) { - this.body = body.byteLength ? Buffer.from(body) : null; - } else if (typeof body === "string") { - this.body = body.length ? Buffer.from(body) : null; - } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) { - this.body = body; - } else { - throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); - } - this.completed = false; - this.aborted = false; - this.upgrade = upgrade || null; - this.path = query ? buildURL(path30, query) : path30; - this.origin = origin; - this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; - this.blocking = blocking == null ? false : blocking; - this.reset = reset == null ? null : reset; - this.host = null; - this.contentLength = null; - this.contentType = null; - this.headers = []; - this.expectContinue = expectContinue != null ? expectContinue : false; - if (Array.isArray(headers)) { - if (headers.length % 2 !== 0) { - throw new InvalidArgumentError("headers array must be even"); - } - for (let i = 0; i < headers.length; i += 2) { - processHeader(this, headers[i], headers[i + 1]); - } - } else if (headers && typeof headers === "object") { - if (headers[Symbol.iterator]) { - for (const header of headers) { - if (!Array.isArray(header) || header.length !== 2) { - throw new InvalidArgumentError("headers must be in key-value pair format"); - } - processHeader(this, header[0], header[1]); - } - } else { - const keys = Object.keys(headers); - for (let i = 0; i < keys.length; ++i) { - processHeader(this, keys[i], headers[keys[i]]); - } - } - } else if (headers != null) { - throw new InvalidArgumentError("headers must be an object or an array"); - } - validateHandler(handler2, method, upgrade); - this.servername = servername || getServerName(this.host); - this[kHandler] = handler2; - if (channels.create.hasSubscribers) { - channels.create.publish({ request: this }); - } - } - onBodySent(chunk) { - if (this[kHandler].onBodySent) { - try { - return this[kHandler].onBodySent(chunk); - } catch (err) { - this.abort(err); - } - } - } - onRequestSent() { - if (channels.bodySent.hasSubscribers) { - channels.bodySent.publish({ request: this }); - } - if (this[kHandler].onRequestSent) { - try { - return this[kHandler].onRequestSent(); - } catch (err) { - this.abort(err); - } - } - } - onConnect(abort) { - assert(!this.aborted); - assert(!this.completed); - if (this.error) { - abort(this.error); - } else { - this.abort = abort; - return this[kHandler].onConnect(abort); - } - } - onResponseStarted() { - return this[kHandler].onResponseStarted?.(); - } - onHeaders(statusCode, headers, resume, statusText) { - assert(!this.aborted); - assert(!this.completed); - if (channels.headers.hasSubscribers) { - channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); - } - try { - return this[kHandler].onHeaders(statusCode, headers, resume, statusText); - } catch (err) { - this.abort(err); - } - } - onData(chunk) { - assert(!this.aborted); - assert(!this.completed); - try { - return this[kHandler].onData(chunk); - } catch (err) { - this.abort(err); - return false; - } - } - onUpgrade(statusCode, headers, socket) { - assert(!this.aborted); - assert(!this.completed); - return this[kHandler].onUpgrade(statusCode, headers, socket); - } - onComplete(trailers) { - this.onFinally(); - assert(!this.aborted); - this.completed = true; - if (channels.trailers.hasSubscribers) { - channels.trailers.publish({ request: this, trailers }); - } - try { - return this[kHandler].onComplete(trailers); - } catch (err) { - this.onError(err); - } - } - onError(error3) { - this.onFinally(); - if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error3 }); - } - if (this.aborted) { - return; - } - this.aborted = true; - return this[kHandler].onError(error3); - } - onFinally() { - if (this.errorHandler) { - this.body.off("error", this.errorHandler); - this.errorHandler = null; - } - if (this.endHandler) { - this.body.off("end", this.endHandler); - this.endHandler = null; - } - } - addHeader(key, value) { - processHeader(this, key, value); - return this; - } - }; - function processHeader(request3, key, val) { - if (val && (typeof val === "object" && !Array.isArray(val))) { - throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val === void 0) { - return; - } - let headerName = headerNameLowerCasedRecord[key]; - if (headerName === void 0) { - headerName = key.toLowerCase(); - if (headerNameLowerCasedRecord[headerName] === void 0 && !isValidHTTPToken(headerName)) { - throw new InvalidArgumentError("invalid header key"); - } - } - if (Array.isArray(val)) { - const arr = []; - for (let i = 0; i < val.length; i++) { - if (typeof val[i] === "string") { - if (!isValidHeaderValue(val[i])) { - throw new InvalidArgumentError(`invalid ${key} header`); - } - arr.push(val[i]); - } else if (val[i] === null) { - arr.push(""); - } else if (typeof val[i] === "object") { - throw new InvalidArgumentError(`invalid ${key} header`); - } else { - const str = `${val[i]}`; - if (!isValidHeaderValue(str)) { - throw new InvalidArgumentError(`invalid ${key} header`); - } - arr.push(str); - } - } - val = arr; - } else if (typeof val === "string") { - if (!isValidHeaderValue(val)) { - throw new InvalidArgumentError(`invalid ${key} header`); - } - } else if (val === null) { - val = ""; - } else { - val = `${val}`; - if (!isValidHeaderValue(val)) { - throw new InvalidArgumentError(`invalid ${key} header`); - } - } - if (headerName === "host") { - if (request3.host !== null) { - throw new InvalidArgumentError("duplicate host header"); - } - if (typeof val !== "string") { - throw new InvalidArgumentError("invalid host header"); - } - request3.host = val; - } else if (headerName === "content-length") { - if (request3.contentLength !== null) { - throw new InvalidArgumentError("duplicate content-length header"); - } - request3.contentLength = parseInt(val, 10); - if (!Number.isFinite(request3.contentLength)) { - throw new InvalidArgumentError("invalid content-length header"); - } - } else if (request3.contentType === null && headerName === "content-type") { - request3.contentType = val; - request3.headers.push(key, val); - } else if (headerName === "transfer-encoding" || headerName === "keep-alive" || headerName === "upgrade") { - throw new InvalidArgumentError(`invalid ${headerName} header`); - } else if (headerName === "connection") { - const value = typeof val === "string" ? val.toLowerCase() : null; - if (value !== "close" && value !== "keep-alive") { - throw new InvalidArgumentError("invalid connection header"); - } - if (value === "close") { - request3.reset = true; - } - } else if (headerName === "expect") { - throw new NotSupportedError("expect header not supported"); - } else { - request3.headers.push(key, val); - } - } - module2.exports = Request; - } -}); - -// node_modules/undici/lib/dispatcher/dispatcher.js -var require_dispatcher = __commonJS({ - "node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) { - "use strict"; - var EventEmitter2 = require("node:events"); - var Dispatcher = class extends EventEmitter2 { - dispatch() { - throw new Error("not implemented"); - } - close() { - throw new Error("not implemented"); - } - destroy() { - throw new Error("not implemented"); - } - compose(...args) { - const interceptors = Array.isArray(args[0]) ? args[0] : args; - let dispatch = this.dispatch.bind(this); - for (const interceptor of interceptors) { - if (interceptor == null) { - continue; - } - if (typeof interceptor !== "function") { - throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`); - } - dispatch = interceptor(dispatch); - if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) { - throw new TypeError("invalid interceptor"); - } - } - return new ComposedDispatcher(this, dispatch); - } - }; - var ComposedDispatcher = class extends Dispatcher { - #dispatcher = null; - #dispatch = null; - constructor(dispatcher, dispatch) { - super(); - this.#dispatcher = dispatcher; - this.#dispatch = dispatch; - } - dispatch(...args) { - this.#dispatch(...args); - } - close(...args) { - return this.#dispatcher.close(...args); - } - destroy(...args) { - return this.#dispatcher.destroy(...args); - } - }; - module2.exports = Dispatcher; - } -}); - -// node_modules/undici/lib/dispatcher/dispatcher-base.js -var require_dispatcher_base = __commonJS({ - "node_modules/undici/lib/dispatcher/dispatcher-base.js"(exports2, module2) { - "use strict"; - var Dispatcher = require_dispatcher(); - var { - ClientDestroyedError, - ClientClosedError, - InvalidArgumentError - } = require_errors(); - var { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require_symbols(); - var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); - var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); - var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); - var kWebSocketOptions = /* @__PURE__ */ Symbol("webSocketOptions"); - var DispatcherBase = class extends Dispatcher { - constructor(opts) { - super(); - this[kDestroyed] = false; - this[kOnDestroyed] = null; - this[kClosed] = false; - this[kOnClosed] = []; - this[kWebSocketOptions] = opts?.webSocket ?? {}; - } - get webSocketOptions() { - return { - maxFragments: this[kWebSocketOptions].maxFragments ?? 131072, - maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 - }; - } - get destroyed() { - return this[kDestroyed]; - } - get closed() { - return this[kClosed]; - } - get interceptors() { - return this[kInterceptors]; - } - set interceptors(newInterceptors) { - if (newInterceptors) { - for (let i = newInterceptors.length - 1; i >= 0; i--) { - const interceptor = this[kInterceptors][i]; - if (typeof interceptor !== "function") { - throw new InvalidArgumentError("interceptor must be an function"); - } - } - } - this[kInterceptors] = newInterceptors; - } - close(callback) { - if (callback === void 0) { - return new Promise((resolve14, reject) => { - this.close((err, data) => { - return err ? reject(err) : resolve14(data); - }); - }); - } - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - if (this[kDestroyed]) { - queueMicrotask(() => callback(new ClientDestroyedError(), null)); - return; - } - if (this[kClosed]) { - if (this[kOnClosed]) { - this[kOnClosed].push(callback); - } else { - queueMicrotask(() => callback(null, null)); - } - return; - } - this[kClosed] = true; - this[kOnClosed].push(callback); - const onClosed = () => { - const callbacks = this[kOnClosed]; - this[kOnClosed] = null; - for (let i = 0; i < callbacks.length; i++) { - callbacks[i](null, null); - } - }; - this[kClose]().then(() => this.destroy()).then(() => { - queueMicrotask(onClosed); - }); - } - destroy(err, callback) { - if (typeof err === "function") { - callback = err; - err = null; - } - if (callback === void 0) { - return new Promise((resolve14, reject) => { - this.destroy(err, (err2, data) => { - return err2 ? ( - /* istanbul ignore next: should never error */ - reject(err2) - ) : resolve14(data); - }); - }); - } - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - if (this[kDestroyed]) { - if (this[kOnDestroyed]) { - this[kOnDestroyed].push(callback); - } else { - queueMicrotask(() => callback(null, null)); - } - return; - } - if (!err) { - err = new ClientDestroyedError(); - } - this[kDestroyed] = true; - this[kOnDestroyed] = this[kOnDestroyed] || []; - this[kOnDestroyed].push(callback); - const onDestroyed = () => { - const callbacks = this[kOnDestroyed]; - this[kOnDestroyed] = null; - for (let i = 0; i < callbacks.length; i++) { - callbacks[i](null, null); - } - }; - this[kDestroy](err).then(() => { - queueMicrotask(onDestroyed); - }); - } - [kInterceptedDispatch](opts, handler2) { - if (!this[kInterceptors] || this[kInterceptors].length === 0) { - this[kInterceptedDispatch] = this[kDispatch]; - return this[kDispatch](opts, handler2); - } - let dispatch = this[kDispatch].bind(this); - for (let i = this[kInterceptors].length - 1; i >= 0; i--) { - dispatch = this[kInterceptors][i](dispatch); - } - this[kInterceptedDispatch] = dispatch; - return dispatch(opts, handler2); - } - dispatch(opts, handler2) { - if (!handler2 || typeof handler2 !== "object") { - throw new InvalidArgumentError("handler must be an object"); - } - try { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("opts must be an object."); - } - if (this[kDestroyed] || this[kOnDestroyed]) { - throw new ClientDestroyedError(); - } - if (this[kClosed]) { - throw new ClientClosedError(); - } - return this[kInterceptedDispatch](opts, handler2); - } catch (err) { - if (typeof handler2.onError !== "function") { - throw new InvalidArgumentError("invalid onError method"); - } - handler2.onError(err); - return false; - } - } - }; - module2.exports = DispatcherBase; - } -}); - -// node_modules/undici/lib/util/timers.js -var require_timers = __commonJS({ - "node_modules/undici/lib/util/timers.js"(exports2, module2) { - "use strict"; - var fastNow = 0; - var RESOLUTION_MS = 1e3; - var TICK_MS = (RESOLUTION_MS >> 1) - 1; - var fastNowTimeout; - var kFastTimer = /* @__PURE__ */ Symbol("kFastTimer"); - var fastTimers = []; - var NOT_IN_LIST = -2; - var TO_BE_CLEARED = -1; - var PENDING = 0; - var ACTIVE = 1; - function onTick() { - fastNow += TICK_MS; - let idx = 0; - let len = fastTimers.length; - while (idx < len) { - const timer = fastTimers[idx]; - if (timer._state === PENDING) { - timer._idleStart = fastNow - TICK_MS; - timer._state = ACTIVE; - } else if (timer._state === ACTIVE && fastNow >= timer._idleStart + timer._idleTimeout) { - timer._state = TO_BE_CLEARED; - timer._idleStart = -1; - timer._onTimeout(timer._timerArg); - } - if (timer._state === TO_BE_CLEARED) { - timer._state = NOT_IN_LIST; - if (--len !== 0) { - fastTimers[idx] = fastTimers[len]; - } - } else { - ++idx; - } - } - fastTimers.length = len; - if (fastTimers.length !== 0) { - refreshTimeout(); - } - } - function refreshTimeout() { - if (fastNowTimeout) { - fastNowTimeout.refresh(); - } else { - clearTimeout(fastNowTimeout); - fastNowTimeout = setTimeout(onTick, TICK_MS); - if (fastNowTimeout.unref) { - fastNowTimeout.unref(); - } - } - } - var FastTimer = class { - [kFastTimer] = true; - /** - * The state of the timer, which can be one of the following: - * - NOT_IN_LIST (-2) - * - TO_BE_CLEARED (-1) - * - PENDING (0) - * - ACTIVE (1) - * - * @type {-2|-1|0|1} - * @private - */ - _state = NOT_IN_LIST; - /** - * The number of milliseconds to wait before calling the callback. - * - * @type {number} - * @private - */ - _idleTimeout = -1; - /** - * The time in milliseconds when the timer was started. This value is used to - * calculate when the timer should expire. - * - * @type {number} - * @default -1 - * @private - */ - _idleStart = -1; - /** - * The function to be executed when the timer expires. - * @type {Function} - * @private - */ - _onTimeout; - /** - * The argument to be passed to the callback when the timer expires. - * - * @type {*} - * @private - */ - _timerArg; - /** - * @constructor - * @param {Function} callback A function to be executed after the timer - * expires. - * @param {number} delay The time, in milliseconds that the timer should wait - * before the specified function or code is executed. - * @param {*} arg - */ - constructor(callback, delay2, arg) { - this._onTimeout = callback; - this._idleTimeout = delay2; - this._timerArg = arg; - this.refresh(); - } - /** - * Sets the timer's start time to the current time, and reschedules the timer - * to call its callback at the previously specified duration adjusted to the - * current time. - * Using this on a timer that has already called its callback will reactivate - * the timer. - * - * @returns {void} - */ - refresh() { - if (this._state === NOT_IN_LIST) { - fastTimers.push(this); - } - if (!fastNowTimeout || fastTimers.length === 1) { - refreshTimeout(); - } - this._state = PENDING; - } - /** - * The `clear` method cancels the timer, preventing it from executing. - * - * @returns {void} - * @private - */ - clear() { - this._state = TO_BE_CLEARED; - this._idleStart = -1; - } - }; - module2.exports = { - /** - * The setTimeout() method sets a timer which executes a function once the - * timer expires. - * @param {Function} callback A function to be executed after the timer - * expires. - * @param {number} delay The time, in milliseconds that the timer should - * wait before the specified function or code is executed. - * @param {*} [arg] An optional argument to be passed to the callback function - * when the timer expires. - * @returns {NodeJS.Timeout|FastTimer} - */ - setTimeout(callback, delay2, arg) { - return delay2 <= RESOLUTION_MS ? setTimeout(callback, delay2, arg) : new FastTimer(callback, delay2, arg); - }, - /** - * The clearTimeout method cancels an instantiated Timer previously created - * by calling setTimeout. - * - * @param {NodeJS.Timeout|FastTimer} timeout - */ - clearTimeout(timeout) { - if (timeout[kFastTimer]) { - timeout.clear(); - } else { - clearTimeout(timeout); - } - }, - /** - * The setFastTimeout() method sets a fastTimer which executes a function once - * the timer expires. - * @param {Function} callback A function to be executed after the timer - * expires. - * @param {number} delay The time, in milliseconds that the timer should - * wait before the specified function or code is executed. - * @param {*} [arg] An optional argument to be passed to the callback function - * when the timer expires. - * @returns {FastTimer} - */ - setFastTimeout(callback, delay2, arg) { - return new FastTimer(callback, delay2, arg); - }, - /** - * The clearTimeout method cancels an instantiated FastTimer previously - * created by calling setFastTimeout. - * - * @param {FastTimer} timeout - */ - clearFastTimeout(timeout) { - timeout.clear(); - }, - /** - * The now method returns the value of the internal fast timer clock. - * - * @returns {number} - */ - now() { - return fastNow; - }, - /** - * Trigger the onTick function to process the fastTimers array. - * Exported for testing purposes only. - * Marking as deprecated to discourage any use outside of testing. - * @deprecated - * @param {number} [delay=0] The delay in milliseconds to add to the now value. - */ - tick(delay2 = 0) { - fastNow += delay2 - RESOLUTION_MS + 1; - onTick(); - onTick(); - }, - /** - * Reset FastTimers. - * Exported for testing purposes only. - * Marking as deprecated to discourage any use outside of testing. - * @deprecated - */ - reset() { - fastNow = 0; - fastTimers.length = 0; - clearTimeout(fastNowTimeout); - fastNowTimeout = null; - }, - /** - * Exporting for testing purposes only. - * Marking as deprecated to discourage any use outside of testing. - * @deprecated - */ - kFastTimer - }; - } -}); - -// node_modules/undici/lib/core/connect.js -var require_connect = __commonJS({ - "node_modules/undici/lib/core/connect.js"(exports2, module2) { - "use strict"; - var net = require("node:net"); - var assert = require("node:assert"); - var util3 = require_util(); - var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); - var timers = require_timers(); - function noop3() { - } - var tls; - var SessionCache; - if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) { - SessionCache = class WeakSessionCache { - constructor(maxCachedSessions) { - this._maxCachedSessions = maxCachedSessions; - this._sessionCache = /* @__PURE__ */ new Map(); - this._sessionRegistry = new global.FinalizationRegistry((key) => { - if (this._sessionCache.size < this._maxCachedSessions) { - return; - } - const ref = this._sessionCache.get(key); - if (ref !== void 0 && ref.deref() === void 0) { - this._sessionCache.delete(key); - } - }); - } - get(sessionKey) { - const ref = this._sessionCache.get(sessionKey); - return ref ? ref.deref() : null; - } - set(sessionKey, session) { - if (this._maxCachedSessions === 0) { - return; - } - this._sessionCache.set(sessionKey, new WeakRef(session)); - this._sessionRegistry.register(session, sessionKey); - } - }; - } else { - SessionCache = class SimpleSessionCache { - constructor(maxCachedSessions) { - this._maxCachedSessions = maxCachedSessions; - this._sessionCache = /* @__PURE__ */ new Map(); - } - get(sessionKey) { - return this._sessionCache.get(sessionKey); - } - set(sessionKey, session) { - if (this._maxCachedSessions === 0) { - return; - } - if (this._sessionCache.size >= this._maxCachedSessions) { - const { value: oldestKey } = this._sessionCache.keys().next(); - this._sessionCache.delete(oldestKey); - } - this._sessionCache.set(sessionKey, session); - } - }; - } - function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) { - if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { - throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); - } - const options = { path: socketPath, ...opts }; - const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); - timeout = timeout == null ? 1e4 : timeout; - allowH2 = allowH2 != null ? allowH2 : false; - return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { - let socket; - if (protocol === "https:") { - if (!tls) { - tls = require("node:tls"); - } - servername = servername || options.servername || util3.getServerName(host) || null; - const sessionKey = servername || hostname; - assert(sessionKey); - const session = customSession || sessionCache.get(sessionKey) || null; - port = port || 443; - socket = tls.connect({ - highWaterMark: 16384, - // TLS in node can't have bigger HWM anyway... - ...options, - servername, - session, - localAddress, - // TODO(HTTP/2): Add support for h2c - ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], - socket: httpSocket, - // upgrade socket connection - port, - host: hostname - }); - socket.on("session", function(session2) { - sessionCache.set(sessionKey, session2); - }); - } else { - assert(!httpSocket, "httpSocket can only be sent on TLS update"); - port = port || 80; - socket = net.connect({ - highWaterMark: 64 * 1024, - // Same as nodejs fs streams. - ...options, - localAddress, - port, - host: hostname - }); - } - if (options.keepAlive == null || options.keepAlive) { - const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay; - socket.setKeepAlive(true, keepAliveInitialDelay); - } - const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port }); - socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { - queueMicrotask(clearConnectTimeout); - if (callback) { - const cb = callback; - callback = null; - cb(null, this); - } - }).on("error", function(err) { - queueMicrotask(clearConnectTimeout); - if (callback) { - const cb = callback; - callback = null; - cb(err); - } - }); - return socket; - }; - } - var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => { - if (!opts.timeout) { - return noop3; - } - let s1 = null; - let s2 = null; - const fastTimer = timers.setFastTimeout(() => { - s1 = setImmediate(() => { - s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)); - }); - }, opts.timeout); - return () => { - timers.clearFastTimeout(fastTimer); - clearImmediate(s1); - clearImmediate(s2); - }; - } : (socketWeakRef, opts) => { - if (!opts.timeout) { - return noop3; - } - let s1 = null; - const fastTimer = timers.setFastTimeout(() => { - s1 = setImmediate(() => { - onConnectTimeout(socketWeakRef.deref(), opts); - }); - }, opts.timeout); - return () => { - timers.clearFastTimeout(fastTimer); - clearImmediate(s1); - }; - }; - function onConnectTimeout(socket, opts) { - if (socket == null) { - return; - } - let message = "Connect Timeout Error"; - if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) { - message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`; - } else { - message += ` (attempted address: ${opts.hostname}:${opts.port},`; - } - message += ` timeout: ${opts.timeout}ms)`; - util3.destroy(socket, new ConnectTimeoutError(message)); - } - module2.exports = buildConnector; - } -}); - -// node_modules/undici/lib/llhttp/utils.js -var require_utils2 = __commonJS({ - "node_modules/undici/lib/llhttp/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.enumToMap = void 0; - function enumToMap(obj) { - const res = {}; - Object.keys(obj).forEach((key) => { - const value = obj[key]; - if (typeof value === "number") { - res[key] = value; - } - }); - return res; - } - exports2.enumToMap = enumToMap; - } -}); - -// node_modules/undici/lib/llhttp/constants.js -var require_constants2 = __commonJS({ - "node_modules/undici/lib/llhttp/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0; - var utils_1 = require_utils2(); - var ERROR; - (function(ERROR2) { - ERROR2[ERROR2["OK"] = 0] = "OK"; - ERROR2[ERROR2["INTERNAL"] = 1] = "INTERNAL"; - ERROR2[ERROR2["STRICT"] = 2] = "STRICT"; - ERROR2[ERROR2["LF_EXPECTED"] = 3] = "LF_EXPECTED"; - ERROR2[ERROR2["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; - ERROR2[ERROR2["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; - ERROR2[ERROR2["INVALID_METHOD"] = 6] = "INVALID_METHOD"; - ERROR2[ERROR2["INVALID_URL"] = 7] = "INVALID_URL"; - ERROR2[ERROR2["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; - ERROR2[ERROR2["INVALID_VERSION"] = 9] = "INVALID_VERSION"; - ERROR2[ERROR2["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; - ERROR2[ERROR2["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; - ERROR2[ERROR2["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; - ERROR2[ERROR2["INVALID_STATUS"] = 13] = "INVALID_STATUS"; - ERROR2[ERROR2["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; - ERROR2[ERROR2["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; - ERROR2[ERROR2["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; - ERROR2[ERROR2["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; - ERROR2[ERROR2["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; - ERROR2[ERROR2["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; - ERROR2[ERROR2["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; - ERROR2[ERROR2["PAUSED"] = 21] = "PAUSED"; - ERROR2[ERROR2["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; - ERROR2[ERROR2["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; - ERROR2[ERROR2["USER"] = 24] = "USER"; - })(ERROR = exports2.ERROR || (exports2.ERROR = {})); - var TYPE; - (function(TYPE2) { - TYPE2[TYPE2["BOTH"] = 0] = "BOTH"; - TYPE2[TYPE2["REQUEST"] = 1] = "REQUEST"; - TYPE2[TYPE2["RESPONSE"] = 2] = "RESPONSE"; - })(TYPE = exports2.TYPE || (exports2.TYPE = {})); - var FLAGS; - (function(FLAGS2) { - FLAGS2[FLAGS2["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; - FLAGS2[FLAGS2["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; - FLAGS2[FLAGS2["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; - FLAGS2[FLAGS2["CHUNKED"] = 8] = "CHUNKED"; - FLAGS2[FLAGS2["UPGRADE"] = 16] = "UPGRADE"; - FLAGS2[FLAGS2["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; - FLAGS2[FLAGS2["SKIPBODY"] = 64] = "SKIPBODY"; - FLAGS2[FLAGS2["TRAILING"] = 128] = "TRAILING"; - FLAGS2[FLAGS2["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; - })(FLAGS = exports2.FLAGS || (exports2.FLAGS = {})); - var LENIENT_FLAGS; - (function(LENIENT_FLAGS2) { - LENIENT_FLAGS2[LENIENT_FLAGS2["HEADERS"] = 1] = "HEADERS"; - LENIENT_FLAGS2[LENIENT_FLAGS2["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; - LENIENT_FLAGS2[LENIENT_FLAGS2["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; - })(LENIENT_FLAGS = exports2.LENIENT_FLAGS || (exports2.LENIENT_FLAGS = {})); - var METHODS; - (function(METHODS2) { - METHODS2[METHODS2["DELETE"] = 0] = "DELETE"; - METHODS2[METHODS2["GET"] = 1] = "GET"; - METHODS2[METHODS2["HEAD"] = 2] = "HEAD"; - METHODS2[METHODS2["POST"] = 3] = "POST"; - METHODS2[METHODS2["PUT"] = 4] = "PUT"; - METHODS2[METHODS2["CONNECT"] = 5] = "CONNECT"; - METHODS2[METHODS2["OPTIONS"] = 6] = "OPTIONS"; - METHODS2[METHODS2["TRACE"] = 7] = "TRACE"; - METHODS2[METHODS2["COPY"] = 8] = "COPY"; - METHODS2[METHODS2["LOCK"] = 9] = "LOCK"; - METHODS2[METHODS2["MKCOL"] = 10] = "MKCOL"; - METHODS2[METHODS2["MOVE"] = 11] = "MOVE"; - METHODS2[METHODS2["PROPFIND"] = 12] = "PROPFIND"; - METHODS2[METHODS2["PROPPATCH"] = 13] = "PROPPATCH"; - METHODS2[METHODS2["SEARCH"] = 14] = "SEARCH"; - METHODS2[METHODS2["UNLOCK"] = 15] = "UNLOCK"; - METHODS2[METHODS2["BIND"] = 16] = "BIND"; - METHODS2[METHODS2["REBIND"] = 17] = "REBIND"; - METHODS2[METHODS2["UNBIND"] = 18] = "UNBIND"; - METHODS2[METHODS2["ACL"] = 19] = "ACL"; - METHODS2[METHODS2["REPORT"] = 20] = "REPORT"; - METHODS2[METHODS2["MKACTIVITY"] = 21] = "MKACTIVITY"; - METHODS2[METHODS2["CHECKOUT"] = 22] = "CHECKOUT"; - METHODS2[METHODS2["MERGE"] = 23] = "MERGE"; - METHODS2[METHODS2["M-SEARCH"] = 24] = "M-SEARCH"; - METHODS2[METHODS2["NOTIFY"] = 25] = "NOTIFY"; - METHODS2[METHODS2["SUBSCRIBE"] = 26] = "SUBSCRIBE"; - METHODS2[METHODS2["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; - METHODS2[METHODS2["PATCH"] = 28] = "PATCH"; - METHODS2[METHODS2["PURGE"] = 29] = "PURGE"; - METHODS2[METHODS2["MKCALENDAR"] = 30] = "MKCALENDAR"; - METHODS2[METHODS2["LINK"] = 31] = "LINK"; - METHODS2[METHODS2["UNLINK"] = 32] = "UNLINK"; - METHODS2[METHODS2["SOURCE"] = 33] = "SOURCE"; - METHODS2[METHODS2["PRI"] = 34] = "PRI"; - METHODS2[METHODS2["DESCRIBE"] = 35] = "DESCRIBE"; - METHODS2[METHODS2["ANNOUNCE"] = 36] = "ANNOUNCE"; - METHODS2[METHODS2["SETUP"] = 37] = "SETUP"; - METHODS2[METHODS2["PLAY"] = 38] = "PLAY"; - METHODS2[METHODS2["PAUSE"] = 39] = "PAUSE"; - METHODS2[METHODS2["TEARDOWN"] = 40] = "TEARDOWN"; - METHODS2[METHODS2["GET_PARAMETER"] = 41] = "GET_PARAMETER"; - METHODS2[METHODS2["SET_PARAMETER"] = 42] = "SET_PARAMETER"; - METHODS2[METHODS2["REDIRECT"] = 43] = "REDIRECT"; - METHODS2[METHODS2["RECORD"] = 44] = "RECORD"; - METHODS2[METHODS2["FLUSH"] = 45] = "FLUSH"; - })(METHODS = exports2.METHODS || (exports2.METHODS = {})); - exports2.METHODS_HTTP = [ - METHODS.DELETE, - METHODS.GET, - METHODS.HEAD, - METHODS.POST, - METHODS.PUT, - METHODS.CONNECT, - METHODS.OPTIONS, - METHODS.TRACE, - METHODS.COPY, - METHODS.LOCK, - METHODS.MKCOL, - METHODS.MOVE, - METHODS.PROPFIND, - METHODS.PROPPATCH, - METHODS.SEARCH, - METHODS.UNLOCK, - METHODS.BIND, - METHODS.REBIND, - METHODS.UNBIND, - METHODS.ACL, - METHODS.REPORT, - METHODS.MKACTIVITY, - METHODS.CHECKOUT, - METHODS.MERGE, - METHODS["M-SEARCH"], - METHODS.NOTIFY, - METHODS.SUBSCRIBE, - METHODS.UNSUBSCRIBE, - METHODS.PATCH, - METHODS.PURGE, - METHODS.MKCALENDAR, - METHODS.LINK, - METHODS.UNLINK, - METHODS.PRI, - // TODO(indutny): should we allow it with HTTP? - METHODS.SOURCE - ]; - exports2.METHODS_ICE = [ - METHODS.SOURCE - ]; - exports2.METHODS_RTSP = [ - METHODS.OPTIONS, - METHODS.DESCRIBE, - METHODS.ANNOUNCE, - METHODS.SETUP, - METHODS.PLAY, - METHODS.PAUSE, - METHODS.TEARDOWN, - METHODS.GET_PARAMETER, - METHODS.SET_PARAMETER, - METHODS.REDIRECT, - METHODS.RECORD, - METHODS.FLUSH, - // For AirPlay - METHODS.GET, - METHODS.POST - ]; - exports2.METHOD_MAP = utils_1.enumToMap(METHODS); - exports2.H_METHOD_MAP = {}; - Object.keys(exports2.METHOD_MAP).forEach((key) => { - if (/^H/.test(key)) { - exports2.H_METHOD_MAP[key] = exports2.METHOD_MAP[key]; - } - }); - var FINISH; - (function(FINISH2) { - FINISH2[FINISH2["SAFE"] = 0] = "SAFE"; - FINISH2[FINISH2["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; - FINISH2[FINISH2["UNSAFE"] = 2] = "UNSAFE"; - })(FINISH = exports2.FINISH || (exports2.FINISH = {})); - exports2.ALPHA = []; - for (let i = "A".charCodeAt(0); i <= "Z".charCodeAt(0); i++) { - exports2.ALPHA.push(String.fromCharCode(i)); - exports2.ALPHA.push(String.fromCharCode(i + 32)); - } - exports2.NUM_MAP = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9 - }; - exports2.HEX_MAP = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9, - A: 10, - B: 11, - C: 12, - D: 13, - E: 14, - F: 15, - a: 10, - b: 11, - c: 12, - d: 13, - e: 14, - f: 15 - }; - exports2.NUM = [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9" - ]; - exports2.ALPHANUM = exports2.ALPHA.concat(exports2.NUM); - exports2.MARK = ["-", "_", ".", "!", "~", "*", "'", "(", ")"]; - exports2.USERINFO_CHARS = exports2.ALPHANUM.concat(exports2.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]); - exports2.STRICT_URL_CHAR = [ - "!", - '"', - "$", - "%", - "&", - "'", - "(", - ")", - "*", - "+", - ",", - "-", - ".", - "/", - ":", - ";", - "<", - "=", - ">", - "@", - "[", - "\\", - "]", - "^", - "_", - "`", - "{", - "|", - "}", - "~" - ].concat(exports2.ALPHANUM); - exports2.URL_CHAR = exports2.STRICT_URL_CHAR.concat([" ", "\f"]); - for (let i = 128; i <= 255; i++) { - exports2.URL_CHAR.push(i); - } - exports2.HEX = exports2.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]); - exports2.STRICT_TOKEN = [ - "!", - "#", - "$", - "%", - "&", - "'", - "*", - "+", - "-", - ".", - "^", - "_", - "`", - "|", - "~" - ].concat(exports2.ALPHANUM); - exports2.TOKEN = exports2.STRICT_TOKEN.concat([" "]); - exports2.HEADER_CHARS = [" "]; - for (let i = 32; i <= 255; i++) { - if (i !== 127) { - exports2.HEADER_CHARS.push(i); - } - } - exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS.filter((c) => c !== 44); - exports2.MAJOR = exports2.NUM_MAP; - exports2.MINOR = exports2.MAJOR; - var HEADER_STATE; - (function(HEADER_STATE2) { - HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL"; - HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION"; - HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; - HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; - HEADER_STATE2[HEADER_STATE2["UPGRADE"] = 4] = "UPGRADE"; - HEADER_STATE2[HEADER_STATE2["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; - HEADER_STATE2[HEADER_STATE2["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; - HEADER_STATE2[HEADER_STATE2["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; - HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; - })(HEADER_STATE = exports2.HEADER_STATE || (exports2.HEADER_STATE = {})); - exports2.SPECIAL_HEADERS = { - "connection": HEADER_STATE.CONNECTION, - "content-length": HEADER_STATE.CONTENT_LENGTH, - "proxy-connection": HEADER_STATE.CONNECTION, - "transfer-encoding": HEADER_STATE.TRANSFER_ENCODING, - "upgrade": HEADER_STATE.UPGRADE - }; - } -}); - -// node_modules/undici/lib/llhttp/llhttp-wasm.js -var require_llhttp_wasm = __commonJS({ - "node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports2, module2) { - "use strict"; - var { Buffer: Buffer2 } = require("node:buffer"); - module2.exports = Buffer2.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv", "base64"); - } -}); - -// node_modules/undici/lib/llhttp/llhttp_simd-wasm.js -var require_llhttp_simd_wasm = __commonJS({ - "node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports2, module2) { - "use strict"; - var { Buffer: Buffer2 } = require("node:buffer"); - module2.exports = Buffer2.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==", "base64"); - } -}); - -// node_modules/undici/lib/web/fetch/constants.js -var require_constants3 = __commonJS({ - "node_modules/undici/lib/web/fetch/constants.js"(exports2, module2) { - "use strict"; - var corsSafeListedMethods = ( - /** @type {const} */ - ["GET", "HEAD", "POST"] - ); - var corsSafeListedMethodsSet = new Set(corsSafeListedMethods); - var nullBodyStatus = ( - /** @type {const} */ - [101, 204, 205, 304] - ); - var redirectStatus = ( - /** @type {const} */ - [301, 302, 303, 307, 308] - ); - var redirectStatusSet = new Set(redirectStatus); - var badPorts = ( - /** @type {const} */ - [ - "1", - "7", - "9", - "11", - "13", - "15", - "17", - "19", - "20", - "21", - "22", - "23", - "25", - "37", - "42", - "43", - "53", - "69", - "77", - "79", - "87", - "95", - "101", - "102", - "103", - "104", - "109", - "110", - "111", - "113", - "115", - "117", - "119", - "123", - "135", - "137", - "139", - "143", - "161", - "179", - "389", - "427", - "465", - "512", - "513", - "514", - "515", - "526", - "530", - "531", - "532", - "540", - "548", - "554", - "556", - "563", - "587", - "601", - "636", - "989", - "990", - "993", - "995", - "1719", - "1720", - "1723", - "2049", - "3659", - "4045", - "4190", - "5060", - "5061", - "6000", - "6566", - "6665", - "6666", - "6667", - "6668", - "6669", - "6679", - "6697", - "10080" - ] - ); - var badPortsSet = new Set(badPorts); - var referrerPolicy = ( - /** @type {const} */ - [ - "", - "no-referrer", - "no-referrer-when-downgrade", - "same-origin", - "origin", - "strict-origin", - "origin-when-cross-origin", - "strict-origin-when-cross-origin", - "unsafe-url" - ] - ); - var referrerPolicySet = new Set(referrerPolicy); - var requestRedirect = ( - /** @type {const} */ - ["follow", "manual", "error"] - ); - var safeMethods = ( - /** @type {const} */ - ["GET", "HEAD", "OPTIONS", "TRACE"] - ); - var safeMethodsSet = new Set(safeMethods); - var requestMode = ( - /** @type {const} */ - ["navigate", "same-origin", "no-cors", "cors"] - ); - var requestCredentials = ( - /** @type {const} */ - ["omit", "same-origin", "include"] - ); - var requestCache = ( - /** @type {const} */ - [ - "default", - "no-store", - "reload", - "no-cache", - "force-cache", - "only-if-cached" - ] - ); - var requestBodyHeader = ( - /** @type {const} */ - [ - "content-encoding", - "content-language", - "content-location", - "content-type", - // See https://github.com/nodejs/undici/issues/2021 - // 'Content-Length' is a forbidden header name, which is typically - // removed in the Headers implementation. However, undici doesn't - // filter out headers, so we add it here. - "content-length" - ] - ); - var requestDuplex = ( - /** @type {const} */ - [ - "half" - ] - ); - var forbiddenMethods = ( - /** @type {const} */ - ["CONNECT", "TRACE", "TRACK"] - ); - var forbiddenMethodsSet = new Set(forbiddenMethods); - var subresource = ( - /** @type {const} */ - [ - "audio", - "audioworklet", - "font", - "image", - "manifest", - "paintworklet", - "script", - "style", - "track", - "video", - "xslt", - "" - ] - ); - var subresourceSet = new Set(subresource); - module2.exports = { - subresource, - forbiddenMethods, - requestBodyHeader, - referrerPolicy, - requestRedirect, - requestMode, - requestCredentials, - requestCache, - redirectStatus, - corsSafeListedMethods, - nullBodyStatus, - safeMethods, - badPorts, - requestDuplex, - subresourceSet, - badPortsSet, - redirectStatusSet, - corsSafeListedMethodsSet, - safeMethodsSet, - forbiddenMethodsSet, - referrerPolicySet - }; - } -}); - -// node_modules/undici/lib/web/fetch/global.js -var require_global = __commonJS({ - "node_modules/undici/lib/web/fetch/global.js"(exports2, module2) { - "use strict"; - var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); - function getGlobalOrigin() { - return globalThis[globalOrigin]; - } - function setGlobalOrigin(newOrigin) { - if (newOrigin === void 0) { - Object.defineProperty(globalThis, globalOrigin, { - value: void 0, - writable: true, - enumerable: false, - configurable: false - }); - return; - } - const parsedURL = new URL(newOrigin); - if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") { - throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`); - } - Object.defineProperty(globalThis, globalOrigin, { - value: parsedURL, - writable: true, - enumerable: false, - configurable: false - }); - } - module2.exports = { - getGlobalOrigin, - setGlobalOrigin - }; - } -}); - -// node_modules/undici/lib/web/fetch/data-url.js -var require_data_url = __commonJS({ - "node_modules/undici/lib/web/fetch/data-url.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var encoder = new TextEncoder(); - var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/; - var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/; - var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g; - var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/; - function dataURLProcessor(dataURL) { - assert(dataURL.protocol === "data:"); - let input = URLSerializer(dataURL, true); - input = input.slice(5); - const position = { position: 0 }; - let mimeType = collectASequenceOfCodePointsFast( - ",", - input, - position - ); - const mimeTypeLength = mimeType.length; - mimeType = removeASCIIWhitespace(mimeType, true, true); - if (position.position >= input.length) { - return "failure"; - } - position.position++; - const encodedBody = input.slice(mimeTypeLength + 1); - let body = stringPercentDecode(encodedBody); - if (/;(\u0020){0,}base64$/i.test(mimeType)) { - const stringBody = isomorphicDecode(body); - body = forgivingBase64(stringBody); - if (body === "failure") { - return "failure"; - } - mimeType = mimeType.slice(0, -6); - mimeType = mimeType.replace(/(\u0020)+$/, ""); - mimeType = mimeType.slice(0, -1); - } - if (mimeType.startsWith(";")) { - mimeType = "text/plain" + mimeType; - } - let mimeTypeRecord = parseMIMEType(mimeType); - if (mimeTypeRecord === "failure") { - mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII"); - } - return { mimeType: mimeTypeRecord, body }; - } - function URLSerializer(url2, excludeFragment = false) { - if (!excludeFragment) { - return url2.href; - } - const href = url2.href; - const hashLength = url2.hash.length; - const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength); - if (!hashLength && href.endsWith("#")) { - return serialized.slice(0, -1); - } - return serialized; - } - function collectASequenceOfCodePoints(condition, input, position) { - let result = ""; - while (position.position < input.length && condition(input[position.position])) { - result += input[position.position]; - position.position++; - } - return result; - } - function collectASequenceOfCodePointsFast(char, input, position) { - const idx = input.indexOf(char, position.position); - const start = position.position; - if (idx === -1) { - position.position = input.length; - return input.slice(start); - } - position.position = idx; - return input.slice(start, position.position); - } - function stringPercentDecode(input) { - const bytes = encoder.encode(input); - return percentDecode(bytes); - } - function isHexCharByte(byte) { - return byte >= 48 && byte <= 57 || byte >= 65 && byte <= 70 || byte >= 97 && byte <= 102; - } - function hexByteToNumber(byte) { - return ( - // 0-9 - byte >= 48 && byte <= 57 ? byte - 48 : (byte & 223) - 55 - ); - } - function percentDecode(input) { - const length = input.length; - const output = new Uint8Array(length); - let j = 0; - for (let i = 0; i < length; ++i) { - const byte = input[i]; - if (byte !== 37) { - output[j++] = byte; - } else if (byte === 37 && !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))) { - output[j++] = 37; - } else { - output[j++] = hexByteToNumber(input[i + 1]) << 4 | hexByteToNumber(input[i + 2]); - i += 2; - } - } - return length === j ? output : output.subarray(0, j); - } - function parseMIMEType(input) { - input = removeHTTPWhitespace(input, true, true); - const position = { position: 0 }; - const type = collectASequenceOfCodePointsFast( - "/", - input, - position - ); - if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { - return "failure"; - } - if (position.position > input.length) { - return "failure"; - } - position.position++; - let subtype = collectASequenceOfCodePointsFast( - ";", - input, - position - ); - subtype = removeHTTPWhitespace(subtype, false, true); - if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { - return "failure"; - } - const typeLowercase = type.toLowerCase(); - const subtypeLowercase = subtype.toLowerCase(); - const mimeType = { - type: typeLowercase, - subtype: subtypeLowercase, - /** @type {Map} */ - parameters: /* @__PURE__ */ new Map(), - // https://mimesniff.spec.whatwg.org/#mime-type-essence - essence: `${typeLowercase}/${subtypeLowercase}` - }; - while (position.position < input.length) { - position.position++; - collectASequenceOfCodePoints( - // https://fetch.spec.whatwg.org/#http-whitespace - (char) => HTTP_WHITESPACE_REGEX.test(char), - input, - position - ); - let parameterName = collectASequenceOfCodePoints( - (char) => char !== ";" && char !== "=", - input, - position - ); - parameterName = parameterName.toLowerCase(); - if (position.position < input.length) { - if (input[position.position] === ";") { - continue; - } - position.position++; - } - if (position.position > input.length) { - break; - } - let parameterValue = null; - if (input[position.position] === '"') { - parameterValue = collectAnHTTPQuotedString(input, position, true); - collectASequenceOfCodePointsFast( - ";", - input, - position - ); - } else { - parameterValue = collectASequenceOfCodePointsFast( - ";", - input, - position - ); - parameterValue = removeHTTPWhitespace(parameterValue, false, true); - if (parameterValue.length === 0) { - continue; - } - } - if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) { - mimeType.parameters.set(parameterName, parameterValue); - } - } - return mimeType; - } - function forgivingBase64(data) { - data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, ""); - let dataLength = data.length; - if (dataLength % 4 === 0) { - if (data.charCodeAt(dataLength - 1) === 61) { - --dataLength; - if (data.charCodeAt(dataLength - 1) === 61) { - --dataLength; - } - } - } - if (dataLength % 4 === 1) { - return "failure"; - } - if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) { - return "failure"; - } - const buffer = Buffer.from(data, "base64"); - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - } - function collectAnHTTPQuotedString(input, position, extractValue) { - const positionStart = position.position; - let value = ""; - assert(input[position.position] === '"'); - position.position++; - while (true) { - value += collectASequenceOfCodePoints( - (char) => char !== '"' && char !== "\\", - input, - position - ); - if (position.position >= input.length) { - break; - } - const quoteOrBackslash = input[position.position]; - position.position++; - if (quoteOrBackslash === "\\") { - if (position.position >= input.length) { - value += "\\"; - break; - } - value += input[position.position]; - position.position++; - } else { - assert(quoteOrBackslash === '"'); - break; - } - } - if (extractValue) { - return value; - } - return input.slice(positionStart, position.position); - } - function serializeAMimeType(mimeType) { - assert(mimeType !== "failure"); - const { parameters, essence } = mimeType; - let serialization = essence; - for (let [name, value] of parameters.entries()) { - serialization += ";"; - serialization += name; - serialization += "="; - if (!HTTP_TOKEN_CODEPOINTS.test(value)) { - value = value.replace(/(\\|")/g, "\\$1"); - value = '"' + value; - value += '"'; - } - serialization += value; - } - return serialization; - } - function isHTTPWhiteSpace(char) { - return char === 13 || char === 10 || char === 9 || char === 32; - } - function removeHTTPWhitespace(str, leading = true, trailing = true) { - return removeChars(str, leading, trailing, isHTTPWhiteSpace); - } - function isASCIIWhitespace(char) { - return char === 13 || char === 10 || char === 9 || char === 12 || char === 32; - } - function removeASCIIWhitespace(str, leading = true, trailing = true) { - return removeChars(str, leading, trailing, isASCIIWhitespace); - } - function removeChars(str, leading, trailing, predicate) { - let lead = 0; - let trail = str.length - 1; - if (leading) { - while (lead < str.length && predicate(str.charCodeAt(lead))) lead++; - } - if (trailing) { - while (trail > 0 && predicate(str.charCodeAt(trail))) trail--; - } - return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); - } - function isomorphicDecode(input) { - const length = input.length; - if ((2 << 15) - 1 > length) { - return String.fromCharCode.apply(null, input); - } - let result = ""; - let i = 0; - let addition = (2 << 15) - 1; - while (i < length) { - if (i + addition > length) { - addition = length - i; - } - result += String.fromCharCode.apply(null, input.subarray(i, i += addition)); - } - return result; - } - function minimizeSupportedMimeType(mimeType) { - switch (mimeType.essence) { - case "application/ecmascript": - case "application/javascript": - case "application/x-ecmascript": - case "application/x-javascript": - case "text/ecmascript": - case "text/javascript": - case "text/javascript1.0": - case "text/javascript1.1": - case "text/javascript1.2": - case "text/javascript1.3": - case "text/javascript1.4": - case "text/javascript1.5": - case "text/jscript": - case "text/livescript": - case "text/x-ecmascript": - case "text/x-javascript": - return "text/javascript"; - case "application/json": - case "text/json": - return "application/json"; - case "image/svg+xml": - return "image/svg+xml"; - case "text/xml": - case "application/xml": - return "application/xml"; - } - if (mimeType.subtype.endsWith("+json")) { - return "application/json"; - } - if (mimeType.subtype.endsWith("+xml")) { - return "application/xml"; - } - return ""; - } - module2.exports = { - dataURLProcessor, - URLSerializer, - collectASequenceOfCodePoints, - collectASequenceOfCodePointsFast, - stringPercentDecode, - parseMIMEType, - collectAnHTTPQuotedString, - serializeAMimeType, - removeChars, - removeHTTPWhitespace, - minimizeSupportedMimeType, - HTTP_TOKEN_CODEPOINTS, - isomorphicDecode - }; - } -}); - -// node_modules/undici/lib/web/fetch/webidl.js -var require_webidl = __commonJS({ - "node_modules/undici/lib/web/fetch/webidl.js"(exports2, module2) { - "use strict"; - var { types: types2, inspect } = require("node:util"); - var { markAsUncloneable } = require("node:worker_threads"); - var { toUSVString } = require_util(); - var webidl = {}; - webidl.converters = {}; - webidl.util = {}; - webidl.errors = {}; - webidl.errors.exception = function(message) { - return new TypeError(`${message.header}: ${message.message}`); - }; - webidl.errors.conversionFailed = function(context5) { - const plural = context5.types.length === 1 ? "" : " one of"; - const message = `${context5.argument} could not be converted to${plural}: ${context5.types.join(", ")}.`; - return webidl.errors.exception({ - header: context5.prefix, - message - }); - }; - webidl.errors.invalidArgument = function(context5) { - return webidl.errors.exception({ - header: context5.prefix, - message: `"${context5.value}" is an invalid ${context5.type}.` - }); - }; - webidl.brandCheck = function(V, I, opts) { - if (opts?.strict !== false) { - if (!(V instanceof I)) { - const err = new TypeError("Illegal invocation"); - err.code = "ERR_INVALID_THIS"; - throw err; - } - } else { - if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) { - const err = new TypeError("Illegal invocation"); - err.code = "ERR_INVALID_THIS"; - throw err; - } - } - }; - webidl.argumentLengthCheck = function({ length }, min, ctx) { - if (length < min) { - throw webidl.errors.exception({ - message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, - header: ctx - }); - } - }; - webidl.illegalConstructor = function() { - throw webidl.errors.exception({ - header: "TypeError", - message: "Illegal constructor" - }); - }; - webidl.util.Type = function(V) { - switch (typeof V) { - case "undefined": - return "Undefined"; - case "boolean": - return "Boolean"; - case "string": - return "String"; - case "symbol": - return "Symbol"; - case "number": - return "Number"; - case "bigint": - return "BigInt"; - case "function": - case "object": { - if (V === null) { - return "Null"; - } - return "Object"; - } - } - }; - webidl.util.markAsUncloneable = markAsUncloneable || (() => { - }); - webidl.util.ConvertToInt = function(V, bitLength, signedness, opts) { - let upperBound; - let lowerBound; - if (bitLength === 64) { - upperBound = Math.pow(2, 53) - 1; - if (signedness === "unsigned") { - lowerBound = 0; - } else { - lowerBound = Math.pow(-2, 53) + 1; - } - } else if (signedness === "unsigned") { - lowerBound = 0; - upperBound = Math.pow(2, bitLength) - 1; - } else { - lowerBound = Math.pow(-2, bitLength) - 1; - upperBound = Math.pow(2, bitLength - 1) - 1; - } - let x = Number(V); - if (x === 0) { - x = 0; - } - if (opts?.enforceRange === true) { - if (Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { - throw webidl.errors.exception({ - header: "Integer conversion", - message: `Could not convert ${webidl.util.Stringify(V)} to an integer.` - }); - } - x = webidl.util.IntegerPart(x); - if (x < lowerBound || x > upperBound) { - throw webidl.errors.exception({ - header: "Integer conversion", - message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` - }); - } - return x; - } - if (!Number.isNaN(x) && opts?.clamp === true) { - x = Math.min(Math.max(x, lowerBound), upperBound); - if (Math.floor(x) % 2 === 0) { - x = Math.floor(x); - } else { - x = Math.ceil(x); - } - return x; - } - if (Number.isNaN(x) || x === 0 && Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { - return 0; - } - x = webidl.util.IntegerPart(x); - x = x % Math.pow(2, bitLength); - if (signedness === "signed" && x >= Math.pow(2, bitLength) - 1) { - return x - Math.pow(2, bitLength); - } - return x; - }; - webidl.util.IntegerPart = function(n) { - const r = Math.floor(Math.abs(n)); - if (n < 0) { - return -1 * r; - } - return r; - }; - webidl.util.Stringify = function(V) { - const type = webidl.util.Type(V); - switch (type) { - case "Symbol": - return `Symbol(${V.description})`; - case "Object": - return inspect(V); - case "String": - return `"${V}"`; - default: - return `${V}`; - } - }; - webidl.sequenceConverter = function(converter) { - return (V, prefix, argument, Iterable) => { - if (webidl.util.Type(V) !== "Object") { - throw webidl.errors.exception({ - header: prefix, - message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.` - }); - } - const method = typeof Iterable === "function" ? Iterable() : V?.[Symbol.iterator]?.(); - const seq = []; - let index2 = 0; - if (method === void 0 || typeof method.next !== "function") { - throw webidl.errors.exception({ - header: prefix, - message: `${argument} is not iterable.` - }); - } - while (true) { - const { done, value } = method.next(); - if (done) { - break; - } - seq.push(converter(value, prefix, `${argument}[${index2++}]`)); - } - return seq; - }; - }; - webidl.recordConverter = function(keyConverter, valueConverter) { - return (O, prefix, argument) => { - if (webidl.util.Type(O) !== "Object") { - throw webidl.errors.exception({ - header: prefix, - message: `${argument} ("${webidl.util.Type(O)}") is not an Object.` - }); - } - const result = {}; - if (!types2.isProxy(O)) { - const keys2 = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]; - for (const key of keys2) { - const typedKey = keyConverter(key, prefix, argument); - const typedValue = valueConverter(O[key], prefix, argument); - result[typedKey] = typedValue; - } - return result; - } - const keys = Reflect.ownKeys(O); - for (const key of keys) { - const desc = Reflect.getOwnPropertyDescriptor(O, key); - if (desc?.enumerable) { - const typedKey = keyConverter(key, prefix, argument); - const typedValue = valueConverter(O[key], prefix, argument); - result[typedKey] = typedValue; - } - } - return result; - }; - }; - webidl.interfaceConverter = function(i) { - return (V, prefix, argument, opts) => { - if (opts?.strict !== false && !(V instanceof i)) { - throw webidl.errors.exception({ - header: prefix, - message: `Expected ${argument} ("${webidl.util.Stringify(V)}") to be an instance of ${i.name}.` - }); - } - return V; - }; - }; - webidl.dictionaryConverter = function(converters) { - return (dictionary, prefix, argument) => { - const type = webidl.util.Type(dictionary); - const dict = {}; - if (type === "Null" || type === "Undefined") { - return dict; - } else if (type !== "Object") { - throw webidl.errors.exception({ - header: prefix, - message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` - }); - } - for (const options of converters) { - const { key, defaultValue, required, converter } = options; - if (required === true) { - if (!Object.hasOwn(dictionary, key)) { - throw webidl.errors.exception({ - header: prefix, - message: `Missing required key "${key}".` - }); - } - } - let value = dictionary[key]; - const hasDefault = Object.hasOwn(options, "defaultValue"); - if (hasDefault && value !== null) { - value ??= defaultValue(); - } - if (required || hasDefault || value !== void 0) { - value = converter(value, prefix, `${argument}.${key}`); - if (options.allowedValues && !options.allowedValues.includes(value)) { - throw webidl.errors.exception({ - header: prefix, - message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.` - }); - } - dict[key] = value; - } - } - return dict; - }; - }; - webidl.nullableConverter = function(converter) { - return (V, prefix, argument) => { - if (V === null) { - return V; - } - return converter(V, prefix, argument); - }; - }; - webidl.converters.DOMString = function(V, prefix, argument, opts) { - if (V === null && opts?.legacyNullToEmptyString) { - return ""; - } - if (typeof V === "symbol") { - throw webidl.errors.exception({ - header: prefix, - message: `${argument} is a symbol, which cannot be converted to a DOMString.` - }); - } - return String(V); - }; - webidl.converters.ByteString = function(V, prefix, argument) { - const x = webidl.converters.DOMString(V, prefix, argument); - for (let index2 = 0; index2 < x.length; index2++) { - if (x.charCodeAt(index2) > 255) { - throw new TypeError( - `Cannot convert argument to a ByteString because the character at index ${index2} has a value of ${x.charCodeAt(index2)} which is greater than 255.` - ); - } - } - return x; - }; - webidl.converters.USVString = toUSVString; - webidl.converters.boolean = function(V) { - const x = Boolean(V); - return x; - }; - webidl.converters.any = function(V) { - return V; - }; - webidl.converters["long long"] = function(V, prefix, argument) { - const x = webidl.util.ConvertToInt(V, 64, "signed", void 0, prefix, argument); - return x; - }; - webidl.converters["unsigned long long"] = function(V, prefix, argument) { - const x = webidl.util.ConvertToInt(V, 64, "unsigned", void 0, prefix, argument); - return x; - }; - webidl.converters["unsigned long"] = function(V, prefix, argument) { - const x = webidl.util.ConvertToInt(V, 32, "unsigned", void 0, prefix, argument); - return x; - }; - webidl.converters["unsigned short"] = function(V, prefix, argument, opts) { - const x = webidl.util.ConvertToInt(V, 16, "unsigned", opts, prefix, argument); - return x; - }; - webidl.converters.ArrayBuffer = function(V, prefix, argument, opts) { - if (webidl.util.Type(V) !== "Object" || !types2.isAnyArrayBuffer(V)) { - throw webidl.errors.conversionFailed({ - prefix, - argument: `${argument} ("${webidl.util.Stringify(V)}")`, - types: ["ArrayBuffer"] - }); - } - if (opts?.allowShared === false && types2.isSharedArrayBuffer(V)) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "SharedArrayBuffer is not allowed." - }); - } - if (V.resizable || V.growable) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "Received a resizable ArrayBuffer." - }); - } - return V; - }; - webidl.converters.TypedArray = function(V, T, prefix, name, opts) { - if (webidl.util.Type(V) !== "Object" || !types2.isTypedArray(V) || V.constructor.name !== T.name) { - throw webidl.errors.conversionFailed({ - prefix, - argument: `${name} ("${webidl.util.Stringify(V)}")`, - types: [T.name] - }); - } - if (opts?.allowShared === false && types2.isSharedArrayBuffer(V.buffer)) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "SharedArrayBuffer is not allowed." - }); - } - if (V.buffer.resizable || V.buffer.growable) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "Received a resizable ArrayBuffer." - }); - } - return V; - }; - webidl.converters.DataView = function(V, prefix, name, opts) { - if (webidl.util.Type(V) !== "Object" || !types2.isDataView(V)) { - throw webidl.errors.exception({ - header: prefix, - message: `${name} is not a DataView.` - }); - } - if (opts?.allowShared === false && types2.isSharedArrayBuffer(V.buffer)) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "SharedArrayBuffer is not allowed." - }); - } - if (V.buffer.resizable || V.buffer.growable) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "Received a resizable ArrayBuffer." - }); - } - return V; - }; - webidl.converters.BufferSource = function(V, prefix, name, opts) { - if (types2.isAnyArrayBuffer(V)) { - return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false }); - } - if (types2.isTypedArray(V)) { - return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false }); - } - if (types2.isDataView(V)) { - return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false }); - } - throw webidl.errors.conversionFailed({ - prefix, - argument: `${name} ("${webidl.util.Stringify(V)}")`, - types: ["BufferSource"] - }); - }; - webidl.converters["sequence"] = webidl.sequenceConverter( - webidl.converters.ByteString - ); - webidl.converters["sequence>"] = webidl.sequenceConverter( - webidl.converters["sequence"] - ); - webidl.converters["record"] = webidl.recordConverter( - webidl.converters.ByteString, - webidl.converters.ByteString - ); - module2.exports = { - webidl - }; - } -}); - -// node_modules/undici/lib/web/fetch/util.js -var require_util2 = __commonJS({ - "node_modules/undici/lib/web/fetch/util.js"(exports2, module2) { - "use strict"; - var { Transform: Transform5 } = require("node:stream"); - var zlib3 = require("node:zlib"); - var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants3(); - var { getGlobalOrigin } = require_global(); - var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); - var { performance: performance6 } = require("node:perf_hooks"); - var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util(); - var assert = require("node:assert"); - var { isUint8Array } = require("node:util/types"); - var { webidl } = require_webidl(); - var supportedHashes = []; - var crypto3; - try { - crypto3 = require("node:crypto"); - const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto3.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); - } catch { - } - function responseURL(response) { - const urlList = response.urlList; - const length = urlList.length; - return length === 0 ? null : urlList[length - 1].toString(); - } - function responseLocationURL(response, requestFragment) { - if (!redirectStatusSet.has(response.status)) { - return null; - } - let location = response.headersList.get("location", true); - if (location !== null && isValidHeaderValue(location)) { - if (!isValidEncodedURL(location)) { - location = normalizeBinaryStringToUtf8(location); - } - location = new URL(location, responseURL(response)); - } - if (location && !location.hash) { - location.hash = requestFragment; - } - return location; - } - function isValidEncodedURL(url2) { - for (let i = 0; i < url2.length; ++i) { - const code = url2.charCodeAt(i); - if (code > 126 || // Non-US-ASCII + DEL - code < 32) { - return false; - } - } - return true; - } - function normalizeBinaryStringToUtf8(value) { - return Buffer.from(value, "binary").toString("utf8"); - } - function requestCurrentURL(request3) { - return request3.urlList[request3.urlList.length - 1]; - } - function requestBadPort(request3) { - const url2 = requestCurrentURL(request3); - if (urlIsHttpHttpsScheme(url2) && badPortsSet.has(url2.port)) { - return "blocked"; - } - return "allowed"; - } - function isErrorLike(object2) { - return object2 instanceof Error || (object2?.constructor?.name === "Error" || object2?.constructor?.name === "DOMException"); - } - function isValidReasonPhrase(statusText) { - for (let i = 0; i < statusText.length; ++i) { - const c = statusText.charCodeAt(i); - if (!(c === 9 || // HTAB - c >= 32 && c <= 126 || // SP / VCHAR - c >= 128 && c <= 255)) { - return false; - } - } - return true; - } - var isValidHeaderName = isValidHTTPToken; - function isValidHeaderValue(potentialValue) { - return (potentialValue[0] === " " || potentialValue[0] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue.includes("\n") || potentialValue.includes("\r") || potentialValue.includes("\0")) === false; - } - function setRequestReferrerPolicyOnRedirect(request3, actualResponse) { - const { headersList } = actualResponse; - const policyHeader = (headersList.get("referrer-policy", true) ?? "").split(","); - let policy = ""; - if (policyHeader.length > 0) { - for (let i = policyHeader.length; i !== 0; i--) { - const token = policyHeader[i - 1].trim(); - if (referrerPolicyTokens.has(token)) { - policy = token; - break; - } - } - } - if (policy !== "") { - request3.referrerPolicy = policy; - } - } - function crossOriginResourcePolicyCheck() { - return "allowed"; - } - function corsCheck() { - return "success"; - } - function TAOCheck() { - return "success"; - } - function appendFetchMetadata(httpRequest) { - let header = null; - header = httpRequest.mode; - httpRequest.headersList.set("sec-fetch-mode", header, true); - } - function appendRequestOriginHeader(request3) { - let serializedOrigin = request3.origin; - if (serializedOrigin === "client" || serializedOrigin === void 0) { - return; - } - if (request3.responseTainting === "cors" || request3.mode === "websocket") { - request3.headersList.append("origin", serializedOrigin, true); - } else if (request3.method !== "GET" && request3.method !== "HEAD") { - switch (request3.referrerPolicy) { - case "no-referrer": - serializedOrigin = null; - break; - case "no-referrer-when-downgrade": - case "strict-origin": - case "strict-origin-when-cross-origin": - if (request3.origin && urlHasHttpsScheme(request3.origin) && !urlHasHttpsScheme(requestCurrentURL(request3))) { - serializedOrigin = null; - } - break; - case "same-origin": - if (!sameOrigin(request3, requestCurrentURL(request3))) { - serializedOrigin = null; - } - break; - default: - } - request3.headersList.append("origin", serializedOrigin, true); - } - } - function coarsenTime(timestamp, crossOriginIsolatedCapability) { - return timestamp; - } - function clampAndCoarsenConnectionTimingInfo(connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) { - if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) { - return { - domainLookupStartTime: defaultStartTime, - domainLookupEndTime: defaultStartTime, - connectionStartTime: defaultStartTime, - connectionEndTime: defaultStartTime, - secureConnectionStartTime: defaultStartTime, - ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol - }; - } - return { - domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability), - domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability), - connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability), - connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability), - secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability), - ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol - }; - } - function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { - return coarsenTime(performance6.now(), crossOriginIsolatedCapability); - } - function createOpaqueTimingInfo(timingInfo) { - return { - startTime: timingInfo.startTime ?? 0, - redirectStartTime: 0, - redirectEndTime: 0, - postRedirectStartTime: timingInfo.startTime ?? 0, - finalServiceWorkerStartTime: 0, - finalNetworkResponseStartTime: 0, - finalNetworkRequestStartTime: 0, - endTime: 0, - encodedBodySize: 0, - decodedBodySize: 0, - finalConnectionTimingInfo: null - }; - } - function makePolicyContainer() { - return { - referrerPolicy: "strict-origin-when-cross-origin" - }; - } - function clonePolicyContainer(policyContainer) { - return { - referrerPolicy: policyContainer.referrerPolicy - }; - } - function determineRequestsReferrer(request3) { - const policy = request3.referrerPolicy; - assert(policy); - let referrerSource = null; - if (request3.referrer === "client") { - const globalOrigin = getGlobalOrigin(); - if (!globalOrigin || globalOrigin.origin === "null") { - return "no-referrer"; - } - referrerSource = new URL(globalOrigin); - } else if (request3.referrer instanceof URL) { - referrerSource = request3.referrer; - } - let referrerURL = stripURLForReferrer(referrerSource); - const referrerOrigin = stripURLForReferrer(referrerSource, true); - if (referrerURL.toString().length > 4096) { - referrerURL = referrerOrigin; - } - const areSameOrigin = sameOrigin(request3, referrerURL); - const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request3.url); - switch (policy) { - case "origin": - return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true); - case "unsafe-url": - return referrerURL; - case "same-origin": - return areSameOrigin ? referrerOrigin : "no-referrer"; - case "origin-when-cross-origin": - return areSameOrigin ? referrerURL : referrerOrigin; - case "strict-origin-when-cross-origin": { - const currentURL = requestCurrentURL(request3); - if (sameOrigin(referrerURL, currentURL)) { - return referrerURL; - } - if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { - return "no-referrer"; - } - return referrerOrigin; - } - case "strict-origin": - // eslint-disable-line - /** - * 1. If referrerURL is a potentially trustworthy URL and - * request’s current URL is not a potentially trustworthy URL, - * then return no referrer. - * 2. Return referrerOrigin - */ - case "no-referrer-when-downgrade": - // eslint-disable-line - /** - * 1. If referrerURL is a potentially trustworthy URL and - * request’s current URL is not a potentially trustworthy URL, - * then return no referrer. - * 2. Return referrerOrigin - */ - default: - return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; - } - } - function stripURLForReferrer(url2, originOnly) { - assert(url2 instanceof URL); - url2 = new URL(url2); - if (url2.protocol === "file:" || url2.protocol === "about:" || url2.protocol === "blank:") { - return "no-referrer"; - } - url2.username = ""; - url2.password = ""; - url2.hash = ""; - if (originOnly) { - url2.pathname = ""; - url2.search = ""; - } - return url2; - } - function isURLPotentiallyTrustworthy(url2) { - if (!(url2 instanceof URL)) { - return false; - } - if (url2.href === "about:blank" || url2.href === "about:srcdoc") { - return true; - } - if (url2.protocol === "data:") return true; - if (url2.protocol === "file:") return true; - return isOriginPotentiallyTrustworthy(url2.origin); - function isOriginPotentiallyTrustworthy(origin) { - if (origin == null || origin === "null") return false; - const originAsURL = new URL(origin); - if (originAsURL.protocol === "https:" || originAsURL.protocol === "wss:") { - return true; - } - if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || (originAsURL.hostname === "localhost" || originAsURL.hostname.includes("localhost.")) || originAsURL.hostname.endsWith(".localhost")) { - return true; - } - return false; - } - } - function bytesMatch(bytes, metadataList) { - if (crypto3 === void 0) { - return true; - } - const parsedMetadata = parseMetadata(metadataList); - if (parsedMetadata === "no metadata") { - return true; - } - if (parsedMetadata.length === 0) { - return true; - } - const strongest = getStrongestMetadata(parsedMetadata); - const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest); - for (const item of metadata) { - const algorithm = item.algo; - const expectedValue = item.hash; - let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64"); - if (actualValue[actualValue.length - 1] === "=") { - if (actualValue[actualValue.length - 2] === "=") { - actualValue = actualValue.slice(0, -2); - } else { - actualValue = actualValue.slice(0, -1); - } - } - if (compareBase64Mixed(actualValue, expectedValue)) { - return true; - } - } - return false; - } - var parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i; - function parseMetadata(metadata) { - const result = []; - let empty = true; - for (const token of metadata.split(" ")) { - empty = false; - const parsedToken = parseHashWithOptions.exec(token); - if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) { - continue; - } - const algorithm = parsedToken.groups.algo.toLowerCase(); - if (supportedHashes.includes(algorithm)) { - result.push(parsedToken.groups); - } - } - if (empty === true) { - return "no metadata"; - } - return result; - } - function getStrongestMetadata(metadataList) { - let algorithm = metadataList[0].algo; - if (algorithm[3] === "5") { - return algorithm; - } - for (let i = 1; i < metadataList.length; ++i) { - const metadata = metadataList[i]; - if (metadata.algo[3] === "5") { - algorithm = "sha512"; - break; - } else if (algorithm[3] === "3") { - continue; - } else if (metadata.algo[3] === "3") { - algorithm = "sha384"; - } - } - return algorithm; - } - function filterMetadataListByAlgorithm(metadataList, algorithm) { - if (metadataList.length === 1) { - return metadataList; - } - let pos = 0; - for (let i = 0; i < metadataList.length; ++i) { - if (metadataList[i].algo === algorithm) { - metadataList[pos++] = metadataList[i]; - } - } - metadataList.length = pos; - return metadataList; - } - function compareBase64Mixed(actualValue, expectedValue) { - if (actualValue.length !== expectedValue.length) { - return false; - } - for (let i = 0; i < actualValue.length; ++i) { - if (actualValue[i] !== expectedValue[i]) { - if (actualValue[i] === "+" && expectedValue[i] === "-" || actualValue[i] === "/" && expectedValue[i] === "_") { - continue; - } - return false; - } - } - return true; - } - function tryUpgradeRequestToAPotentiallyTrustworthyURL(request3) { - } - function sameOrigin(A, B) { - if (A.origin === B.origin && A.origin === "null") { - return true; - } - if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { - return true; - } - return false; - } - function createDeferredPromise() { - let res; - let rej; - const promise = new Promise((resolve14, reject) => { - res = resolve14; - rej = reject; - }); - return { promise, resolve: res, reject: rej }; - } - function isAborted(fetchParams) { - return fetchParams.controller.state === "aborted"; - } - function isCancelled(fetchParams) { - return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; - } - function normalizeMethod(method) { - return normalizedMethodRecordsBase[method.toLowerCase()] ?? method; - } - function serializeJavascriptValueToJSONString(value) { - const result = JSON.stringify(value); - if (result === void 0) { - throw new TypeError("Value is not JSON serializable"); - } - assert(typeof result === "string"); - return result; - } - var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); - function createIterator(name, kInternalIterator, keyIndex = 0, valueIndex = 1) { - class FastIterableIterator { - /** @type {any} */ - #target; - /** @type {'key' | 'value' | 'key+value'} */ - #kind; - /** @type {number} */ - #index; - /** - * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object - * @param {unknown} target - * @param {'key' | 'value' | 'key+value'} kind - */ - constructor(target, kind) { - this.#target = target; - this.#kind = kind; - this.#index = 0; - } - next() { - if (typeof this !== "object" || this === null || !(#target in this)) { - throw new TypeError( - `'next' called on an object that does not implement interface ${name} Iterator.` - ); - } - const index2 = this.#index; - const values = this.#target[kInternalIterator]; - const len = values.length; - if (index2 >= len) { - return { - value: void 0, - done: true - }; - } - const { [keyIndex]: key, [valueIndex]: value } = values[index2]; - this.#index = index2 + 1; - let result; - switch (this.#kind) { - case "key": - result = key; - break; - case "value": - result = value; - break; - case "key+value": - result = [key, value]; - break; - } - return { - value: result, - done: false - }; - } - } - delete FastIterableIterator.prototype.constructor; - Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype); - Object.defineProperties(FastIterableIterator.prototype, { - [Symbol.toStringTag]: { - writable: false, - enumerable: false, - configurable: true, - value: `${name} Iterator` - }, - next: { writable: true, enumerable: true, configurable: true } - }); - return function(target, kind) { - return new FastIterableIterator(target, kind); - }; - } - function iteratorMixin(name, object2, kInternalIterator, keyIndex = 0, valueIndex = 1) { - const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex); - const properties = { - keys: { - writable: true, - enumerable: true, - configurable: true, - value: function keys() { - webidl.brandCheck(this, object2); - return makeIterator(this, "key"); - } - }, - values: { - writable: true, - enumerable: true, - configurable: true, - value: function values() { - webidl.brandCheck(this, object2); - return makeIterator(this, "value"); - } - }, - entries: { - writable: true, - enumerable: true, - configurable: true, - value: function entries() { - webidl.brandCheck(this, object2); - return makeIterator(this, "key+value"); - } - }, - forEach: { - writable: true, - enumerable: true, - configurable: true, - value: function forEach(callbackfn, thisArg = globalThis) { - webidl.brandCheck(this, object2); - webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`); - if (typeof callbackfn !== "function") { - throw new TypeError( - `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.` - ); - } - for (const { 0: key, 1: value } of makeIterator(this, "key+value")) { - callbackfn.call(thisArg, value, key, this); - } - } - } - }; - return Object.defineProperties(object2.prototype, { - ...properties, - [Symbol.iterator]: { - writable: true, - enumerable: false, - configurable: true, - value: properties.entries.value - } - }); - } - async function fullyReadBody(body, processBody, processBodyError) { - const successSteps = processBody; - const errorSteps = processBodyError; - let reader; - try { - reader = body.stream.getReader(); - } catch (e) { - errorSteps(e); - return; - } - try { - successSteps(await readAllBytes(reader)); - } catch (e) { - errorSteps(e); - } - } - function isReadableStreamLike(stream2) { - return stream2 instanceof ReadableStream || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; - } - function readableStreamClose(controller) { - try { - controller.close(); - controller.byobRequest?.respond(0); - } catch (err) { - if (!err.message.includes("Controller is already closed") && !err.message.includes("ReadableStream is already closed")) { - throw err; - } - } - } - var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/; - function isomorphicEncode(input) { - assert(!invalidIsomorphicEncodeValueRegex.test(input)); - return input; - } - async function readAllBytes(reader) { - const bytes = []; - let byteLength = 0; - while (true) { - const { done, value: chunk } = await reader.read(); - if (done) { - return Buffer.concat(bytes, byteLength); - } - if (!isUint8Array(chunk)) { - throw new TypeError("Received non-Uint8Array chunk"); - } - bytes.push(chunk); - byteLength += chunk.length; - } - } - function urlIsLocal(url2) { - assert("protocol" in url2); - const protocol = url2.protocol; - return protocol === "about:" || protocol === "blob:" || protocol === "data:"; - } - function urlHasHttpsScheme(url2) { - return typeof url2 === "string" && url2[5] === ":" && url2[0] === "h" && url2[1] === "t" && url2[2] === "t" && url2[3] === "p" && url2[4] === "s" || url2.protocol === "https:"; - } - function urlIsHttpHttpsScheme(url2) { - assert("protocol" in url2); - const protocol = url2.protocol; - return protocol === "http:" || protocol === "https:"; - } - function simpleRangeHeaderValue(value, allowWhitespace) { - const data = value; - if (!data.startsWith("bytes")) { - return "failure"; - } - const position = { position: 5 }; - if (allowWhitespace) { - collectASequenceOfCodePoints( - (char) => char === " " || char === " ", - data, - position - ); - } - if (data.charCodeAt(position.position) !== 61) { - return "failure"; - } - position.position++; - if (allowWhitespace) { - collectASequenceOfCodePoints( - (char) => char === " " || char === " ", - data, - position - ); - } - const rangeStart = collectASequenceOfCodePoints( - (char) => { - const code = char.charCodeAt(0); - return code >= 48 && code <= 57; - }, - data, - position - ); - const rangeStartValue = rangeStart.length ? Number(rangeStart) : null; - if (allowWhitespace) { - collectASequenceOfCodePoints( - (char) => char === " " || char === " ", - data, - position - ); - } - if (data.charCodeAt(position.position) !== 45) { - return "failure"; - } - position.position++; - if (allowWhitespace) { - collectASequenceOfCodePoints( - (char) => char === " " || char === " ", - data, - position - ); - } - const rangeEnd = collectASequenceOfCodePoints( - (char) => { - const code = char.charCodeAt(0); - return code >= 48 && code <= 57; - }, - data, - position - ); - const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null; - if (position.position < data.length) { - return "failure"; - } - if (rangeEndValue === null && rangeStartValue === null) { - return "failure"; - } - if (rangeStartValue > rangeEndValue) { - return "failure"; - } - return { rangeStartValue, rangeEndValue }; - } - function buildContentRange(rangeStart, rangeEnd, fullLength) { - let contentRange = "bytes "; - contentRange += isomorphicEncode(`${rangeStart}`); - contentRange += "-"; - contentRange += isomorphicEncode(`${rangeEnd}`); - contentRange += "/"; - contentRange += isomorphicEncode(`${fullLength}`); - return contentRange; - } - var InflateStream = class extends Transform5 { - #zlibOptions; - /** @param {zlib.ZlibOptions} [zlibOptions] */ - constructor(zlibOptions) { - super(); - this.#zlibOptions = zlibOptions; - } - _transform(chunk, encoding, callback) { - if (!this._inflateStream) { - if (chunk.length === 0) { - callback(); - return; - } - this._inflateStream = (chunk[0] & 15) === 8 ? zlib3.createInflate(this.#zlibOptions) : zlib3.createInflateRaw(this.#zlibOptions); - this._inflateStream.on("data", this.push.bind(this)); - this._inflateStream.on("end", () => this.push(null)); - this._inflateStream.on("error", (err) => this.destroy(err)); - } - this._inflateStream.write(chunk, encoding, callback); - } - _final(callback) { - if (this._inflateStream) { - this._inflateStream.end(); - this._inflateStream = null; - } - callback(); - } - }; - function createInflate(zlibOptions) { - return new InflateStream(zlibOptions); - } - function extractMimeType(headers) { - let charset = null; - let essence = null; - let mimeType = null; - const values = getDecodeSplit("content-type", headers); - if (values === null) { - return "failure"; - } - for (const value of values) { - const temporaryMimeType = parseMIMEType(value); - if (temporaryMimeType === "failure" || temporaryMimeType.essence === "*/*") { - continue; - } - mimeType = temporaryMimeType; - if (mimeType.essence !== essence) { - charset = null; - if (mimeType.parameters.has("charset")) { - charset = mimeType.parameters.get("charset"); - } - essence = mimeType.essence; - } else if (!mimeType.parameters.has("charset") && charset !== null) { - mimeType.parameters.set("charset", charset); - } - } - if (mimeType == null) { - return "failure"; - } - return mimeType; - } - function gettingDecodingSplitting(value) { - const input = value; - const position = { position: 0 }; - const values = []; - let temporaryValue = ""; - while (position.position < input.length) { - temporaryValue += collectASequenceOfCodePoints( - (char) => char !== '"' && char !== ",", - input, - position - ); - if (position.position < input.length) { - if (input.charCodeAt(position.position) === 34) { - temporaryValue += collectAnHTTPQuotedString( - input, - position - ); - if (position.position < input.length) { - continue; - } - } else { - assert(input.charCodeAt(position.position) === 44); - position.position++; - } - } - temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 9 || char === 32); - values.push(temporaryValue); - temporaryValue = ""; - } - return values; - } - function getDecodeSplit(name, list) { - const value = list.get(name, true); - if (value === null) { - return null; - } - return gettingDecodingSplitting(value); - } - var textDecoder = new TextDecoder(); - function utf8DecodeBytes(buffer) { - if (buffer.length === 0) { - return ""; - } - if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { - buffer = buffer.subarray(3); - } - const output = textDecoder.decode(buffer); - return output; - } - var EnvironmentSettingsObjectBase = class { - get baseUrl() { - return getGlobalOrigin(); - } - get origin() { - return this.baseUrl?.origin; - } - policyContainer = makePolicyContainer(); - }; - var EnvironmentSettingsObject = class { - settingsObject = new EnvironmentSettingsObjectBase(); - }; - var environmentSettingsObject = new EnvironmentSettingsObject(); - module2.exports = { - isAborted, - isCancelled, - isValidEncodedURL, - createDeferredPromise, - ReadableStreamFrom, - tryUpgradeRequestToAPotentiallyTrustworthyURL, - clampAndCoarsenConnectionTimingInfo, - coarsenedSharedCurrentTime, - determineRequestsReferrer, - makePolicyContainer, - clonePolicyContainer, - appendFetchMetadata, - appendRequestOriginHeader, - TAOCheck, - corsCheck, - crossOriginResourcePolicyCheck, - createOpaqueTimingInfo, - setRequestReferrerPolicyOnRedirect, - isValidHTTPToken, - requestBadPort, - requestCurrentURL, - responseURL, - responseLocationURL, - isBlobLike, - isURLPotentiallyTrustworthy, - isValidReasonPhrase, - sameOrigin, - normalizeMethod, - serializeJavascriptValueToJSONString, - iteratorMixin, - createIterator, - isValidHeaderName, - isValidHeaderValue, - isErrorLike, - fullyReadBody, - bytesMatch, - isReadableStreamLike, - readableStreamClose, - isomorphicEncode, - urlIsLocal, - urlHasHttpsScheme, - urlIsHttpHttpsScheme, - readAllBytes, - simpleRangeHeaderValue, - buildContentRange, - parseMetadata, - createInflate, - extractMimeType, - getDecodeSplit, - utf8DecodeBytes, - environmentSettingsObject - }; - } -}); - -// node_modules/undici/lib/web/fetch/symbols.js -var require_symbols2 = __commonJS({ - "node_modules/undici/lib/web/fetch/symbols.js"(exports2, module2) { - "use strict"; - module2.exports = { - kUrl: /* @__PURE__ */ Symbol("url"), - kHeaders: /* @__PURE__ */ Symbol("headers"), - kSignal: /* @__PURE__ */ Symbol("signal"), - kState: /* @__PURE__ */ Symbol("state"), - kDispatcher: /* @__PURE__ */ Symbol("dispatcher") - }; - } -}); - -// node_modules/undici/lib/web/fetch/file.js -var require_file = __commonJS({ - "node_modules/undici/lib/web/fetch/file.js"(exports2, module2) { - "use strict"; - var { Blob: Blob2, File: File2 } = require("node:buffer"); - var { kState } = require_symbols2(); - var { webidl } = require_webidl(); - var FileLike = class _FileLike { - constructor(blobLike, fileName, options = {}) { - const n = fileName; - const t = options.type; - const d = options.lastModified ?? Date.now(); - this[kState] = { - blobLike, - name: n, - type: t, - lastModified: d - }; - } - stream(...args) { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.stream(...args); - } - arrayBuffer(...args) { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.arrayBuffer(...args); - } - slice(...args) { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.slice(...args); - } - text(...args) { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.text(...args); - } - get size() { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.size; - } - get type() { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.type; - } - get name() { - webidl.brandCheck(this, _FileLike); - return this[kState].name; - } - get lastModified() { - webidl.brandCheck(this, _FileLike); - return this[kState].lastModified; - } - get [Symbol.toStringTag]() { - return "File"; - } - }; - webidl.converters.Blob = webidl.interfaceConverter(Blob2); - function isFileLike(object2) { - return object2 instanceof File2 || object2 && (typeof object2.stream === "function" || typeof object2.arrayBuffer === "function") && object2[Symbol.toStringTag] === "File"; - } - module2.exports = { FileLike, isFileLike }; - } -}); - -// node_modules/undici/lib/web/fetch/formdata.js -var require_formdata = __commonJS({ - "node_modules/undici/lib/web/fetch/formdata.js"(exports2, module2) { - "use strict"; - var { isBlobLike, iteratorMixin } = require_util2(); - var { kState } = require_symbols2(); - var { kEnumerableProperty } = require_util(); - var { FileLike, isFileLike } = require_file(); - var { webidl } = require_webidl(); - var { File: NativeFile } = require("node:buffer"); - var nodeUtil = require("node:util"); - var File2 = globalThis.File ?? NativeFile; - var FormData2 = class _FormData { - constructor(form) { - webidl.util.markAsUncloneable(this); - if (form !== void 0) { - throw webidl.errors.conversionFailed({ - prefix: "FormData constructor", - argument: "Argument 1", - types: ["undefined"] - }); - } - this[kState] = []; - } - append(name, value, filename = void 0) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.append"; - webidl.argumentLengthCheck(arguments, 2, prefix); - if (arguments.length === 3 && !isBlobLike(value)) { - throw new TypeError( - "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" - ); - } - name = webidl.converters.USVString(name, prefix, "name"); - value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "value", { strict: false }) : webidl.converters.USVString(value, prefix, "value"); - filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "filename") : void 0; - const entry = makeEntry(name, value, filename); - this[kState].push(entry); - } - delete(name) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.delete"; - webidl.argumentLengthCheck(arguments, 1, prefix); - name = webidl.converters.USVString(name, prefix, "name"); - this[kState] = this[kState].filter((entry) => entry.name !== name); - } - get(name) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.get"; - webidl.argumentLengthCheck(arguments, 1, prefix); - name = webidl.converters.USVString(name, prefix, "name"); - const idx = this[kState].findIndex((entry) => entry.name === name); - if (idx === -1) { - return null; - } - return this[kState][idx].value; - } - getAll(name) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.getAll"; - webidl.argumentLengthCheck(arguments, 1, prefix); - name = webidl.converters.USVString(name, prefix, "name"); - return this[kState].filter((entry) => entry.name === name).map((entry) => entry.value); - } - has(name) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.has"; - webidl.argumentLengthCheck(arguments, 1, prefix); - name = webidl.converters.USVString(name, prefix, "name"); - return this[kState].findIndex((entry) => entry.name === name) !== -1; - } - set(name, value, filename = void 0) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.set"; - webidl.argumentLengthCheck(arguments, 2, prefix); - if (arguments.length === 3 && !isBlobLike(value)) { - throw new TypeError( - "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" - ); - } - name = webidl.converters.USVString(name, prefix, "name"); - value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "name", { strict: false }) : webidl.converters.USVString(value, prefix, "name"); - filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "name") : void 0; - const entry = makeEntry(name, value, filename); - const idx = this[kState].findIndex((entry2) => entry2.name === name); - if (idx !== -1) { - this[kState] = [ - ...this[kState].slice(0, idx), - entry, - ...this[kState].slice(idx + 1).filter((entry2) => entry2.name !== name) - ]; - } else { - this[kState].push(entry); - } - } - [nodeUtil.inspect.custom](depth, options) { - const state = this[kState].reduce((a, b) => { - if (a[b.name]) { - if (Array.isArray(a[b.name])) { - a[b.name].push(b.value); - } else { - a[b.name] = [a[b.name], b.value]; - } - } else { - a[b.name] = b.value; - } - return a; - }, { __proto__: null }); - options.depth ??= depth; - options.colors ??= true; - const output = nodeUtil.formatWithOptions(options, state); - return `FormData ${output.slice(output.indexOf("]") + 2)}`; - } - }; - iteratorMixin("FormData", FormData2, kState, "name", "value"); - Object.defineProperties(FormData2.prototype, { - append: kEnumerableProperty, - delete: kEnumerableProperty, - get: kEnumerableProperty, - getAll: kEnumerableProperty, - has: kEnumerableProperty, - set: kEnumerableProperty, - [Symbol.toStringTag]: { - value: "FormData", - configurable: true - } - }); - function makeEntry(name, value, filename) { - if (typeof value === "string") { - } else { - if (!isFileLike(value)) { - value = value instanceof Blob ? new File2([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); - } - if (filename !== void 0) { - const options = { - type: value.type, - lastModified: value.lastModified - }; - value = value instanceof NativeFile ? new File2([value], filename, options) : new FileLike(value, filename, options); - } - } - return { name, value }; - } - module2.exports = { FormData: FormData2, makeEntry }; - } -}); - -// node_modules/undici/lib/web/fetch/formdata-parser.js -var require_formdata_parser = __commonJS({ - "node_modules/undici/lib/web/fetch/formdata-parser.js"(exports2, module2) { - "use strict"; - var { isUSVString, bufferToLowerCasedHeaderName } = require_util(); - var { utf8DecodeBytes } = require_util2(); - var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url(); - var { isFileLike } = require_file(); - var { makeEntry } = require_formdata(); - var assert = require("node:assert"); - var { File: NodeFile } = require("node:buffer"); - var File2 = globalThis.File ?? NodeFile; - var formDataNameBuffer = Buffer.from('form-data; name="'); - var filenameBuffer = Buffer.from("; filename"); - var dd = Buffer.from("--"); - var ddcrlf = Buffer.from("--\r\n"); - function isAsciiString(chars) { - for (let i = 0; i < chars.length; ++i) { - if ((chars.charCodeAt(i) & ~127) !== 0) { - return false; - } - } - return true; - } - function validateBoundary(boundary) { - const length = boundary.length; - if (length < 27 || length > 70) { - return false; - } - for (let i = 0; i < length; ++i) { - const cp = boundary.charCodeAt(i); - if (!(cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 39 || cp === 45 || cp === 95)) { - return false; - } - } - return true; - } - function multipartFormDataParser(input, mimeType) { - assert(mimeType !== "failure" && mimeType.essence === "multipart/form-data"); - const boundaryString = mimeType.parameters.get("boundary"); - if (boundaryString === void 0) { - return "failure"; - } - const boundary = Buffer.from(`--${boundaryString}`, "utf8"); - const entryList = []; - const position = { position: 0 }; - while (input[position.position] === 13 && input[position.position + 1] === 10) { - position.position += 2; - } - let trailing = input.length; - while (input[trailing - 1] === 10 && input[trailing - 2] === 13) { - trailing -= 2; - } - if (trailing !== input.length) { - input = input.subarray(0, trailing); - } - while (true) { - if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) { - position.position += boundary.length; - } else { - return "failure"; - } - if (position.position === input.length - 2 && bufferStartsWith(input, dd, position) || position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position)) { - return entryList; - } - if (input[position.position] !== 13 || input[position.position + 1] !== 10) { - return "failure"; - } - position.position += 2; - const result = parseMultipartFormDataHeaders(input, position); - if (result === "failure") { - return "failure"; - } - let { name, filename, contentType, encoding } = result; - position.position += 2; - let body; - { - const boundaryIndex = input.indexOf(boundary.subarray(2), position.position); - if (boundaryIndex === -1) { - return "failure"; - } - body = input.subarray(position.position, boundaryIndex - 4); - position.position += body.length; - if (encoding === "base64") { - body = Buffer.from(body.toString(), "base64"); - } - } - if (input[position.position] !== 13 || input[position.position + 1] !== 10) { - return "failure"; - } else { - position.position += 2; - } - let value; - if (filename !== null) { - contentType ??= "text/plain"; - if (!isAsciiString(contentType)) { - contentType = ""; - } - value = new File2([body], filename, { type: contentType }); - } else { - value = utf8DecodeBytes(Buffer.from(body)); - } - assert(isUSVString(name)); - assert(typeof value === "string" && isUSVString(value) || isFileLike(value)); - entryList.push(makeEntry(name, value, filename)); - } - } - function parseMultipartFormDataHeaders(input, position) { - let name = null; - let filename = null; - let contentType = null; - let encoding = null; - while (true) { - if (input[position.position] === 13 && input[position.position + 1] === 10) { - if (name === null) { - return "failure"; - } - return { name, filename, contentType, encoding }; - } - let headerName = collectASequenceOfBytes( - (char) => char !== 10 && char !== 13 && char !== 58, - input, - position - ); - headerName = removeChars(headerName, true, true, (char) => char === 9 || char === 32); - if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) { - return "failure"; - } - if (input[position.position] !== 58) { - return "failure"; - } - position.position++; - collectASequenceOfBytes( - (char) => char === 32 || char === 9, - input, - position - ); - switch (bufferToLowerCasedHeaderName(headerName)) { - case "content-disposition": { - name = filename = null; - if (!bufferStartsWith(input, formDataNameBuffer, position)) { - return "failure"; - } - position.position += 17; - name = parseMultipartFormDataName(input, position); - if (name === null) { - return "failure"; - } - if (bufferStartsWith(input, filenameBuffer, position)) { - let check = position.position + filenameBuffer.length; - if (input[check] === 42) { - position.position += 1; - check += 1; - } - if (input[check] !== 61 || input[check + 1] !== 34) { - return "failure"; - } - position.position += 12; - filename = parseMultipartFormDataName(input, position); - if (filename === null) { - return "failure"; - } - } - break; - } - case "content-type": { - let headerValue = collectASequenceOfBytes( - (char) => char !== 10 && char !== 13, - input, - position - ); - headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); - contentType = isomorphicDecode(headerValue); - break; - } - case "content-transfer-encoding": { - let headerValue = collectASequenceOfBytes( - (char) => char !== 10 && char !== 13, - input, - position - ); - headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); - encoding = isomorphicDecode(headerValue); - break; - } - default: { - collectASequenceOfBytes( - (char) => char !== 10 && char !== 13, - input, - position - ); - } - } - if (input[position.position] !== 13 && input[position.position + 1] !== 10) { - return "failure"; - } else { - position.position += 2; - } - } - } - function parseMultipartFormDataName(input, position) { - assert(input[position.position - 1] === 34); - let name = collectASequenceOfBytes( - (char) => char !== 10 && char !== 13 && char !== 34, - input, - position - ); - if (input[position.position] !== 34) { - return null; - } else { - position.position++; - } - name = new TextDecoder().decode(name).replace(/%0A/ig, "\n").replace(/%0D/ig, "\r").replace(/%22/g, '"'); - return name; - } - function collectASequenceOfBytes(condition, input, position) { - let start = position.position; - while (start < input.length && condition(input[start])) { - ++start; - } - return input.subarray(position.position, position.position = start); - } - function removeChars(buf, leading, trailing, predicate) { - let lead = 0; - let trail = buf.length - 1; - if (leading) { - while (lead < buf.length && predicate(buf[lead])) lead++; - } - if (trailing) { - while (trail > 0 && predicate(buf[trail])) trail--; - } - return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1); - } - function bufferStartsWith(buffer, start, position) { - if (buffer.length < start.length) { - return false; - } - for (let i = 0; i < start.length; i++) { - if (start[i] !== buffer[position.position + i]) { - return false; - } - } - return true; - } - module2.exports = { - multipartFormDataParser, - validateBoundary - }; - } -}); - -// node_modules/undici/lib/web/fetch/body.js -var require_body = __commonJS({ - "node_modules/undici/lib/web/fetch/body.js"(exports2, module2) { - "use strict"; - var util3 = require_util(); - var { - ReadableStreamFrom, - isBlobLike, - isReadableStreamLike, - readableStreamClose, - createDeferredPromise, - fullyReadBody, - extractMimeType, - utf8DecodeBytes - } = require_util2(); - var { FormData: FormData2 } = require_formdata(); - var { kState } = require_symbols2(); - var { webidl } = require_webidl(); - var { Blob: Blob2 } = require("node:buffer"); - var assert = require("node:assert"); - var { isErrored, isDisturbed } = require("node:stream"); - var { isArrayBuffer } = require("node:util/types"); - var { serializeAMimeType } = require_data_url(); - var { multipartFormDataParser } = require_formdata_parser(); - var random; - try { - const crypto3 = require("node:crypto"); - random = (max) => crypto3.randomInt(0, max); - } catch { - random = (max) => Math.floor(Math.random(max)); - } - var textEncoder = new TextEncoder(); - function noop3() { - } - var hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0; - var streamRegistry; - if (hasFinalizationRegistry) { - streamRegistry = new FinalizationRegistry((weakRef) => { - const stream2 = weakRef.deref(); - if (stream2 && !stream2.locked && !isDisturbed(stream2) && !isErrored(stream2)) { - stream2.cancel("Response object has been garbage collected").catch(noop3); - } - }); - } - function extractBody(object2, keepalive = false) { - let stream2 = null; - if (object2 instanceof ReadableStream) { - stream2 = object2; - } else if (isBlobLike(object2)) { - stream2 = object2.stream(); - } else { - stream2 = new ReadableStream({ - async pull(controller) { - const buffer = typeof source === "string" ? textEncoder.encode(source) : source; - if (buffer.byteLength) { - controller.enqueue(buffer); - } - queueMicrotask(() => readableStreamClose(controller)); - }, - start() { - }, - type: "bytes" - }); - } - assert(isReadableStreamLike(stream2)); - let action = null; - let source = null; - let length = null; - let type = null; - if (typeof object2 === "string") { - source = object2; - type = "text/plain;charset=UTF-8"; - } else if (object2 instanceof URLSearchParams) { - source = object2.toString(); - type = "application/x-www-form-urlencoded;charset=UTF-8"; - } else if (isArrayBuffer(object2)) { - source = new Uint8Array(object2.slice()); - } else if (ArrayBuffer.isView(object2)) { - source = new Uint8Array(object2.buffer.slice(object2.byteOffset, object2.byteOffset + object2.byteLength)); - } else if (util3.isFormDataLike(object2)) { - const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; - const prefix = `--${boundary}\r -Content-Disposition: form-data`; - const escape3 = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); - const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); - const blobParts = []; - const rn = new Uint8Array([13, 10]); - length = 0; - let hasUnknownSizeValue = false; - for (const [name, value] of object2) { - if (typeof value === "string") { - const chunk2 = textEncoder.encode(prefix + `; name="${escape3(normalizeLinefeeds(name))}"\r -\r -${normalizeLinefeeds(value)}\r -`); - blobParts.push(chunk2); - length += chunk2.byteLength; - } else { - const chunk2 = textEncoder.encode(`${prefix}; name="${escape3(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape3(value.name)}"` : "") + `\r -Content-Type: ${value.type || "application/octet-stream"}\r -\r -`); - blobParts.push(chunk2, value, rn); - if (typeof value.size === "number") { - length += chunk2.byteLength + value.size + rn.byteLength; - } else { - hasUnknownSizeValue = true; - } - } - } - const chunk = textEncoder.encode(`--${boundary}--\r -`); - blobParts.push(chunk); - length += chunk.byteLength; - if (hasUnknownSizeValue) { - length = null; - } - source = object2; - action = async function* () { - for (const part of blobParts) { - if (part.stream) { - yield* part.stream(); - } else { - yield part; - } - } - }; - type = `multipart/form-data; boundary=${boundary}`; - } else if (isBlobLike(object2)) { - source = object2; - length = object2.size; - if (object2.type) { - type = object2.type; - } - } else if (typeof object2[Symbol.asyncIterator] === "function") { - if (keepalive) { - throw new TypeError("keepalive"); - } - if (util3.isDisturbed(object2) || object2.locked) { - throw new TypeError( - "Response body object should not be disturbed or locked" - ); - } - stream2 = object2 instanceof ReadableStream ? object2 : ReadableStreamFrom(object2); - } - if (typeof source === "string" || util3.isBuffer(source)) { - length = Buffer.byteLength(source); - } - if (action != null) { - let iterator2; - stream2 = new ReadableStream({ - async start() { - iterator2 = action(object2)[Symbol.asyncIterator](); - }, - async pull(controller) { - const { value, done } = await iterator2.next(); - if (done) { - queueMicrotask(() => { - controller.close(); - controller.byobRequest?.respond(0); - }); - } else { - if (!isErrored(stream2)) { - const buffer = new Uint8Array(value); - if (buffer.byteLength) { - controller.enqueue(buffer); - } - } - } - return controller.desiredSize > 0; - }, - async cancel(reason) { - await iterator2.return(); - }, - type: "bytes" - }); - } - const body = { stream: stream2, source, length }; - return [body, type]; - } - function safelyExtractBody(object2, keepalive = false) { - if (object2 instanceof ReadableStream) { - assert(!util3.isDisturbed(object2), "The body has already been consumed."); - assert(!object2.locked, "The stream is locked."); - } - return extractBody(object2, keepalive); - } - function cloneBody(instance, body) { - const [out1, out2] = body.stream.tee(); - body.stream = out1; - return { - stream: out2, - length: body.length, - source: body.source - }; - } - function throwIfAborted(state) { - if (state.aborted) { - throw new DOMException("The operation was aborted.", "AbortError"); - } - } - function bodyMixinMethods(instance) { - const methods = { - blob() { - return consumeBody(this, (bytes) => { - let mimeType = bodyMimeType(this); - if (mimeType === null) { - mimeType = ""; - } else if (mimeType) { - mimeType = serializeAMimeType(mimeType); - } - return new Blob2([bytes], { type: mimeType }); - }, instance); - }, - arrayBuffer() { - return consumeBody(this, (bytes) => { - return new Uint8Array(bytes).buffer; - }, instance); - }, - text() { - return consumeBody(this, utf8DecodeBytes, instance); - }, - json() { - return consumeBody(this, parseJSONFromBytes, instance); - }, - formData() { - return consumeBody(this, (value) => { - const mimeType = bodyMimeType(this); - if (mimeType !== null) { - switch (mimeType.essence) { - case "multipart/form-data": { - const parsed = multipartFormDataParser(value, mimeType); - if (parsed === "failure") { - throw new TypeError("Failed to parse body as FormData."); - } - const fd = new FormData2(); - fd[kState] = parsed; - return fd; - } - case "application/x-www-form-urlencoded": { - const entries = new URLSearchParams(value.toString()); - const fd = new FormData2(); - for (const [name, value2] of entries) { - fd.append(name, value2); - } - return fd; - } - } - } - throw new TypeError( - 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".' - ); - }, instance); - }, - bytes() { - return consumeBody(this, (bytes) => { - return new Uint8Array(bytes); - }, instance); - } - }; - return methods; - } - function mixinBody(prototype) { - Object.assign(prototype.prototype, bodyMixinMethods(prototype)); - } - async function consumeBody(object2, convertBytesToJSValue, instance) { - webidl.brandCheck(object2, instance); - if (bodyUnusable(object2)) { - throw new TypeError("Body is unusable: Body has already been read"); - } - throwIfAborted(object2[kState]); - const promise = createDeferredPromise(); - const errorSteps = (error3) => promise.reject(error3); - const successSteps = (data) => { - try { - promise.resolve(convertBytesToJSValue(data)); - } catch (e) { - errorSteps(e); - } - }; - if (object2[kState].body == null) { - successSteps(Buffer.allocUnsafe(0)); - return promise.promise; - } - await fullyReadBody(object2[kState].body, successSteps, errorSteps); - return promise.promise; - } - function bodyUnusable(object2) { - const body = object2[kState].body; - return body != null && (body.stream.locked || util3.isDisturbed(body.stream)); - } - function parseJSONFromBytes(bytes) { - return JSON.parse(utf8DecodeBytes(bytes)); - } - function bodyMimeType(requestOrResponse) { - const headers = requestOrResponse[kState].headersList; - const mimeType = extractMimeType(headers); - if (mimeType === "failure") { - return null; - } - return mimeType; - } - module2.exports = { - extractBody, - safelyExtractBody, - cloneBody, - mixinBody, - streamRegistry, - hasFinalizationRegistry, - bodyUnusable - }; - } -}); - -// node_modules/undici/lib/dispatcher/client-h1.js -var require_client_h1 = __commonJS({ - "node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var util3 = require_util(); - var { channels } = require_diagnostics(); - var timers = require_timers(); - var { - RequestContentLengthMismatchError, - ResponseContentLengthMismatchError, - RequestAbortedError, - InvalidArgumentError, - HeadersTimeoutError, - HeadersOverflowError, - SocketError, - InformationalError, - BodyTimeoutError, - HTTPParserError, - ResponseExceededMaxSizeError - } = require_errors(); - var { - kUrl, - kReset, - kClient, - kParser, - kBlocking, - kRunning, - kPending, - kSize, - kWriting, - kQueue, - kNoRef, - kKeepAliveDefaultTimeout, - kHostHeader, - kPendingIdx, - kRunningIdx, - kError, - kPipelining, - kSocket, - kKeepAliveTimeoutValue, - kMaxHeadersSize, - kKeepAliveMaxTimeout, - kKeepAliveTimeoutThreshold, - kHeadersTimeout, - kBodyTimeout, - kStrictContentLength, - kMaxRequests, - kCounter, - kMaxResponseSize, - kOnError, - kResume, - kHTTPContext - } = require_symbols(); - var constants = require_constants2(); - var EMPTY_BUF = Buffer.alloc(0); - var FastBuffer = Buffer[Symbol.species]; - var addListener = util3.addListener; - var removeAllListeners = util3.removeAllListeners; - var kIdleSocketValidation = /* @__PURE__ */ Symbol("kIdleSocketValidation"); - var kIdleSocketValidationTimeout = /* @__PURE__ */ Symbol("kIdleSocketValidationTimeout"); - var kSocketUsed = /* @__PURE__ */ Symbol("kSocketUsed"); - var extractBody; - async function lazyllhttp() { - const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; - let mod; - try { - mod = await WebAssembly.compile(require_llhttp_simd_wasm()); - } catch (e) { - mod = await WebAssembly.compile(llhttpWasmData || require_llhttp_wasm()); - } - return await WebAssembly.instantiate(mod, { - env: { - /* eslint-disable camelcase */ - wasm_on_url: (p, at, len) => { - return 0; - }, - wasm_on_status: (p, at, len) => { - assert(currentParser.ptr === p); - const start = at - currentBufferPtr + currentBufferRef.byteOffset; - return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; - }, - wasm_on_message_begin: (p) => { - assert(currentParser.ptr === p); - return currentParser.onMessageBegin() || 0; - }, - wasm_on_header_field: (p, at, len) => { - assert(currentParser.ptr === p); - const start = at - currentBufferPtr + currentBufferRef.byteOffset; - return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; - }, - wasm_on_header_value: (p, at, len) => { - assert(currentParser.ptr === p); - const start = at - currentBufferPtr + currentBufferRef.byteOffset; - return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; - }, - wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { - assert(currentParser.ptr === p); - return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; - }, - wasm_on_body: (p, at, len) => { - assert(currentParser.ptr === p); - const start = at - currentBufferPtr + currentBufferRef.byteOffset; - return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; - }, - wasm_on_message_complete: (p) => { - assert(currentParser.ptr === p); - return currentParser.onMessageComplete() || 0; - } - /* eslint-enable camelcase */ - } - }); - } - var llhttpInstance = null; - var llhttpPromise = lazyllhttp(); - llhttpPromise.catch(); - var currentParser = null; - var currentBufferRef = null; - var currentBufferSize = 0; - var currentBufferPtr = null; - var USE_NATIVE_TIMER = 0; - var USE_FAST_TIMER = 1; - var TIMEOUT_HEADERS = 2 | USE_FAST_TIMER; - var TIMEOUT_BODY = 4 | USE_FAST_TIMER; - var TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER; - var Parser = class { - constructor(client, socket, { exports: exports3 }) { - assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); - this.llhttp = exports3; - this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); - this.client = client; - this.socket = socket; - this.timeout = null; - this.timeoutValue = null; - this.timeoutType = null; - this.statusCode = null; - this.statusText = ""; - this.upgrade = false; - this.headers = []; - this.headersSize = 0; - this.headersMaxSize = client[kMaxHeadersSize]; - this.shouldKeepAlive = false; - this.paused = false; - this.resume = this.resume.bind(this); - this.bytesRead = 0; - this.keepAlive = ""; - this.contentLength = ""; - this.connection = ""; - this.maxResponseSize = client[kMaxResponseSize]; - } - setTimeout(delay2, type) { - if (delay2 !== this.timeoutValue || type & USE_FAST_TIMER ^ this.timeoutType & USE_FAST_TIMER) { - if (this.timeout) { - timers.clearTimeout(this.timeout); - this.timeout = null; - } - if (delay2) { - if (type & USE_FAST_TIMER) { - this.timeout = timers.setFastTimeout(onParserTimeout, delay2, new WeakRef(this)); - } else { - this.timeout = setTimeout(onParserTimeout, delay2, new WeakRef(this)); - this.timeout.unref(); - } - } - this.timeoutValue = delay2; - } else if (this.timeout) { - if (this.timeout.refresh) { - this.timeout.refresh(); - } - } - this.timeoutType = type; - } - resume() { - if (this.socket.destroyed || !this.paused) { - return; - } - assert(this.ptr != null); - assert(currentParser == null); - this.llhttp.llhttp_resume(this.ptr); - assert(this.timeoutType === TIMEOUT_BODY); - if (this.timeout) { - if (this.timeout.refresh) { - this.timeout.refresh(); - } - } - this.paused = false; - this.execute(this.socket.read() || EMPTY_BUF); - this.readMore(); - } - readMore() { - while (!this.paused && this.ptr) { - const chunk = this.socket.read(); - if (chunk === null) { - break; - } - this.execute(chunk); - } - } - execute(data) { - assert(this.ptr != null); - assert(currentParser == null); - assert(!this.paused); - const { socket, llhttp } = this; - if (data.length > currentBufferSize) { - if (currentBufferPtr) { - llhttp.free(currentBufferPtr); - } - currentBufferSize = Math.ceil(data.length / 4096) * 4096; - currentBufferPtr = llhttp.malloc(currentBufferSize); - } - new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data); - try { - let ret; - try { - currentBufferRef = data; - currentParser = this; - ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); - } catch (err) { - throw err; - } finally { - currentParser = null; - currentBufferRef = null; - } - const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; - if (ret !== constants.ERROR.OK) { - const body = data.subarray(offset); - if (ret === constants.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(body); - } else if (ret === constants.ERROR.PAUSED) { - this.paused = true; - socket.unshift(body); - } else { - throw this.createError(ret, body); - } - } - } catch (err) { - util3.destroy(socket, err); - } - } - finish() { - assert(currentParser === null); - assert(this.ptr != null); - assert(!this.paused); - const { llhttp } = this; - let ret; - try { - currentParser = this; - ret = llhttp.llhttp_finish(this.ptr); - } finally { - currentParser = null; - } - if (ret === constants.ERROR.OK) { - return null; - } - if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { - this.paused = true; - return null; - } - return this.createError(ret, EMPTY_BUF); - } - createError(ret, data) { - const { llhttp, contentLength, bytesRead } = this; - if (contentLength && bytesRead !== parseInt(contentLength, 10)) { - return new ResponseContentLengthMismatchError(); - } - const ptr = llhttp.llhttp_get_error_reason(this.ptr); - let message = ""; - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); - message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; - } - return new HTTPParserError(message, constants.ERROR[ret], data); - } - destroy() { - assert(this.ptr != null); - assert(currentParser == null); - this.llhttp.llhttp_free(this.ptr); - this.ptr = null; - this.timeout && timers.clearTimeout(this.timeout); - this.timeout = null; - this.timeoutValue = null; - this.timeoutType = null; - this.paused = false; - } - onStatus(buf) { - this.statusText = buf.toString(); - } - onMessageBegin() { - const { socket, client } = this; - if (socket.destroyed) { - return -1; - } - if (client[kRunning] === 0) { - util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket))); - return -1; - } - const request3 = client[kQueue][client[kRunningIdx]]; - if (!request3) { - return -1; - } - request3.onResponseStarted(); - } - onHeaderField(buf) { - const len = this.headers.length; - if ((len & 1) === 0) { - this.headers.push(buf); - } else { - this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); - } - this.trackHeader(buf.length); - } - onHeaderValue(buf) { - let len = this.headers.length; - if ((len & 1) === 1) { - this.headers.push(buf); - len += 1; - } else { - this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); - } - const key = this.headers[len - 2]; - if (key.length === 10) { - const headerName = util3.bufferToLowerCasedHeaderName(key); - if (headerName === "keep-alive") { - this.keepAlive += buf.toString(); - } else if (headerName === "connection") { - this.connection += buf.toString(); - } - } else if (key.length === 14 && util3.bufferToLowerCasedHeaderName(key) === "content-length") { - this.contentLength += buf.toString(); - } - this.trackHeader(buf.length); - } - trackHeader(len) { - this.headersSize += len; - if (this.headersSize >= this.headersMaxSize) { - util3.destroy(this.socket, new HeadersOverflowError()); - } - } - onUpgrade(head) { - const { upgrade, client, socket, headers, statusCode } = this; - assert(upgrade); - assert(client[kSocket] === socket); - assert(!socket.destroyed); - assert(!this.paused); - assert((headers.length & 1) === 0); - const request3 = client[kQueue][client[kRunningIdx]]; - assert(request3); - assert(request3.upgrade || request3.method === "CONNECT"); - this.statusCode = null; - this.statusText = ""; - this.shouldKeepAlive = null; - this.headers = []; - this.headersSize = 0; - socket.unshift(head); - socket[kParser].destroy(); - socket[kParser] = null; - socket[kClient] = null; - socket[kError] = null; - removeAllListeners(socket); - client[kSocket] = null; - client[kHTTPContext] = null; - client[kQueue][client[kRunningIdx]++] = null; - client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); - try { - request3.onUpgrade(statusCode, headers, socket); - } catch (err) { - util3.destroy(socket, err); - } - client[kResume](); - } - onHeadersComplete(statusCode, upgrade, shouldKeepAlive) { - const { client, socket, headers, statusText } = this; - if (socket.destroyed) { - return -1; - } - if (client[kRunning] === 0) { - util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket))); - return -1; - } - const request3 = client[kQueue][client[kRunningIdx]]; - if (!request3) { - return -1; - } - assert(!this.upgrade); - assert(this.statusCode < 200); - if (statusCode === 100) { - util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket))); - return -1; - } - if (upgrade && !request3.upgrade) { - util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket))); - return -1; - } - assert(this.timeoutType === TIMEOUT_HEADERS); - this.statusCode = statusCode; - this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. - request3.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; - if (this.statusCode >= 200) { - const bodyTimeout = request3.bodyTimeout != null ? request3.bodyTimeout : client[kBodyTimeout]; - this.setTimeout(bodyTimeout, TIMEOUT_BODY); - } else if (this.timeout) { - if (this.timeout.refresh) { - this.timeout.refresh(); - } - } - if (request3.method === "CONNECT") { - assert(client[kRunning] === 1); - this.upgrade = true; - return 2; - } - if (upgrade) { - assert(client[kRunning] === 1); - this.upgrade = true; - return 2; - } - assert((this.headers.length & 1) === 0); - this.headers = []; - this.headersSize = 0; - if (this.shouldKeepAlive && client[kPipelining]) { - const keepAliveTimeout = this.keepAlive ? util3.parseKeepAliveTimeout(this.keepAlive) : null; - if (keepAliveTimeout != null) { - const timeout = Math.min( - keepAliveTimeout - client[kKeepAliveTimeoutThreshold], - client[kKeepAliveMaxTimeout] - ); - if (timeout <= 0) { - socket[kReset] = true; - } else { - client[kKeepAliveTimeoutValue] = timeout; - } - } else { - client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]; - } - } else { - socket[kReset] = true; - } - const pause = request3.onHeaders(statusCode, headers, this.resume, statusText) === false; - if (request3.aborted) { - return -1; - } - if (request3.method === "HEAD") { - return 1; - } - if (statusCode < 200) { - return 1; - } - if (socket[kBlocking]) { - socket[kBlocking] = false; - client[kResume](); - } - return pause ? constants.ERROR.PAUSED : 0; - } - onBody(buf) { - const { client, socket, statusCode, maxResponseSize } = this; - if (socket.destroyed) { - return -1; - } - const request3 = client[kQueue][client[kRunningIdx]]; - assert(request3); - assert(this.timeoutType === TIMEOUT_BODY); - if (this.timeout) { - if (this.timeout.refresh) { - this.timeout.refresh(); - } - } - assert(statusCode >= 200); - if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { - util3.destroy(socket, new ResponseExceededMaxSizeError()); - return -1; - } - this.bytesRead += buf.length; - if (request3.onData(buf) === false) { - return constants.ERROR.PAUSED; - } - } - onMessageComplete() { - const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this; - if (socket.destroyed && (!statusCode || shouldKeepAlive)) { - return -1; - } - if (upgrade) { - return; - } - assert(statusCode >= 100); - assert((this.headers.length & 1) === 0); - const request3 = client[kQueue][client[kRunningIdx]]; - assert(request3); - this.statusCode = null; - this.statusText = ""; - this.bytesRead = 0; - this.contentLength = ""; - this.keepAlive = ""; - this.connection = ""; - this.headers = []; - this.headersSize = 0; - if (statusCode < 200) { - return; - } - if (request3.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { - util3.destroy(socket, new ResponseContentLengthMismatchError()); - return -1; - } - request3.onComplete(headers); - client[kQueue][client[kRunningIdx]++] = null; - socket[kSocketUsed] = true; - if (socket[kWriting]) { - assert(client[kRunning] === 0); - util3.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; - } else if (!shouldKeepAlive) { - util3.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; - } else if (socket[kReset] && client[kRunning] === 0) { - util3.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; - } else if (client[kPipelining] == null || client[kPipelining] === 1) { - setImmediate(() => client[kResume]()); - } else { - client[kResume](); - } - } - }; - function onParserTimeout(parser) { - const { socket, timeoutType, client, paused } = parser.deref(); - if (timeoutType === TIMEOUT_HEADERS) { - if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { - assert(!paused, "cannot be paused while waiting for headers"); - util3.destroy(socket, new HeadersTimeoutError()); - } - } else if (timeoutType === TIMEOUT_BODY) { - if (!paused) { - util3.destroy(socket, new BodyTimeoutError()); - } - } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { - assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); - util3.destroy(socket, new InformationalError("socket idle timeout")); - } - } - async function connectH1(client, socket) { - client[kSocket] = socket; - if (!llhttpInstance) { - llhttpInstance = await llhttpPromise; - llhttpPromise = null; - } - socket[kNoRef] = false; - socket[kWriting] = false; - socket[kReset] = false; - socket[kBlocking] = false; - socket[kIdleSocketValidation] = 0; - socket[kIdleSocketValidationTimeout] = null; - socket[kSocketUsed] = false; - socket[kParser] = new Parser(client, socket, llhttpInstance); - addListener(socket, "error", function(err) { - assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - const parser = this[kParser]; - if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { - const parserErr = parser.finish(); - if (parserErr) { - this[kError] = parserErr; - this[kClient][kOnError](parserErr); - } - return; - } - this[kError] = err; - this[kClient][kOnError](err); - }); - addListener(socket, "readable", function() { - const parser = this[kParser]; - if (parser) { - parser.readMore(); - } - }); - addListener(socket, "end", function() { - const parser = this[kParser]; - if (parser.statusCode && !parser.shouldKeepAlive) { - const parserErr = parser.finish(); - if (parserErr) { - util3.destroy(this, parserErr); - } - return; - } - util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); - }); - addListener(socket, "close", function() { - const client2 = this[kClient]; - const parser = this[kParser]; - clearIdleSocketValidation(this); - if (parser) { - if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - this[kError] = parser.finish() || this[kError]; - } - this[kParser].destroy(); - this[kParser] = null; - } - const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); - client2[kSocket] = null; - client2[kHTTPContext] = null; - if (client2.destroyed) { - assert(client2[kPending] === 0); - const requests = client2[kQueue].splice(client2[kRunningIdx]); - for (let i = 0; i < requests.length; i++) { - const request3 = requests[i]; - util3.errorRequest(client2, request3, err); - } - } else if (client2[kRunning] > 0 && err.code !== "UND_ERR_INFO") { - const request3 = client2[kQueue][client2[kRunningIdx]]; - client2[kQueue][client2[kRunningIdx]++] = null; - util3.errorRequest(client2, request3, err); - } - client2[kPendingIdx] = client2[kRunningIdx]; - assert(client2[kRunning] === 0); - client2.emit("disconnect", client2[kUrl], [client2], err); - client2[kResume](); - }); - let closed = false; - socket.on("close", () => { - closed = true; - }); - return { - version: "h1", - defaultPipelining: 1, - write(...args) { - return writeH1(client, ...args); - }, - resume() { - resumeH1(client); - }, - destroy(err, callback) { - if (closed) { - queueMicrotask(callback); - } else { - socket.destroy(err).on("close", callback); - } - }, - get destroyed() { - return socket.destroyed; - }, - busy(request3) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) { - return true; - } - if (request3) { - if (client[kRunning] > 0 && !request3.idempotent) { - return true; - } - if (client[kRunning] > 0 && (request3.upgrade || request3.method === "CONNECT")) { - return true; - } - if (client[kRunning] > 0 && util3.bodyLength(request3.body) !== 0 && (util3.isStream(request3.body) || util3.isAsyncIterable(request3.body) || util3.isFormDataLike(request3.body))) { - return true; - } - } - return false; - } - }; - } - function clearIdleSocketValidation(socket) { - if (socket[kIdleSocketValidationTimeout]) { - clearTimeout(socket[kIdleSocketValidationTimeout]); - socket[kIdleSocketValidationTimeout] = null; - } - socket[kIdleSocketValidation] = 0; - } - function scheduleIdleSocketValidation(client, socket) { - socket[kIdleSocketValidation] = 1; - socket[kIdleSocketValidationTimeout] = setTimeout(() => { - socket[kIdleSocketValidationTimeout] = null; - socket[kIdleSocketValidation] = 2; - if (client[kSocket] === socket && !socket.destroyed) { - client[kResume](); - } - }, 0); - socket[kIdleSocketValidationTimeout].unref?.(); - } - function resumeH1(client) { - const socket = client[kSocket]; - if (socket && !socket.destroyed) { - if (client[kSize] === 0) { - if (!socket[kNoRef] && socket.unref) { - socket.unref(); - socket[kNoRef] = true; - } - } else if (socket[kNoRef] && socket.ref) { - socket.ref(); - socket[kNoRef] = false; - } - if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) { - if (socket[kIdleSocketValidation] === 0) { - scheduleIdleSocketValidation(client, socket); - socket[kParser].readMore(); - if (socket.destroyed) { - return; - } - return; - } - if (socket[kIdleSocketValidation] === 1) { - socket[kParser].readMore(); - if (socket.destroyed) { - return; - } - return; - } - } - if (client[kRunning] === 0) { - socket[kParser].readMore(); - if (socket.destroyed) { - return; - } - } - if (client[kSize] === 0) { - if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { - socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE); - } - } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { - if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { - const request3 = client[kQueue][client[kRunningIdx]]; - const headersTimeout = request3.headersTimeout != null ? request3.headersTimeout : client[kHeadersTimeout]; - socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); - } - } - } - } - function shouldSendContentLength(method) { - return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; - } - function writeH1(client, request3) { - const { method, path: path30, host, upgrade, blocking, reset } = request3; - let { body, headers, contentLength } = request3; - const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; - if (util3.isFormDataLike(body)) { - if (!extractBody) { - extractBody = require_body().extractBody; - } - const [bodyStream, contentType] = extractBody(body); - if (request3.contentType == null) { - headers.push("content-type", contentType); - } - body = bodyStream.stream; - contentLength = bodyStream.length; - } else if (util3.isBlobLike(body) && request3.contentType == null) { - const contentType = body.type; - if (contentType) { - const contentTypeValue = `${contentType}`; - if (!util3.isValidHeaderValue(contentTypeValue)) { - util3.errorRequest(client, request3, new InvalidArgumentError("invalid content-type header")); - return false; - } - headers.push("content-type", contentTypeValue); - } - } - if (body && typeof body.read === "function") { - body.read(0); - } - const bodyLength = util3.bodyLength(body); - contentLength = bodyLength ?? contentLength; - if (contentLength === null) { - contentLength = request3.contentLength; - } - if (contentLength === 0 && !expectsPayload) { - contentLength = null; - } - if (shouldSendContentLength(method) && contentLength > 0 && request3.contentLength !== null && request3.contentLength !== contentLength) { - if (client[kStrictContentLength]) { - util3.errorRequest(client, request3, new RequestContentLengthMismatchError()); - return false; - } - process.emitWarning(new RequestContentLengthMismatchError()); - } - const socket = client[kSocket]; - clearIdleSocketValidation(socket); - const abort = (err) => { - if (request3.aborted || request3.completed) { - return; - } - util3.errorRequest(client, request3, err || new RequestAbortedError()); - util3.destroy(body); - util3.destroy(socket, new InformationalError("aborted")); - }; - try { - request3.onConnect(abort); - } catch (err) { - util3.errorRequest(client, request3, err); - } - if (request3.aborted) { - return false; - } - if (method === "HEAD") { - socket[kReset] = true; - } - if (upgrade || method === "CONNECT") { - socket[kReset] = true; - } - if (reset != null) { - socket[kReset] = reset; - } - if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { - socket[kReset] = true; - } - if (blocking) { - socket[kBlocking] = true; - } - let header = `${method} ${path30} HTTP/1.1\r -`; - if (typeof host === "string") { - header += `host: ${host}\r -`; - } else { - header += client[kHostHeader]; - } - if (upgrade) { - header += `connection: upgrade\r -upgrade: ${upgrade}\r -`; - } else if (client[kPipelining] && !socket[kReset]) { - header += "connection: keep-alive\r\n"; - } else { - header += "connection: close\r\n"; - } - if (Array.isArray(headers)) { - for (let n = 0; n < headers.length; n += 2) { - const key = headers[n + 0]; - const val = headers[n + 1]; - if (Array.isArray(val)) { - for (let i = 0; i < val.length; i++) { - header += `${key}: ${val[i]}\r -`; - } - } else { - header += `${key}: ${val}\r -`; - } - } - } - if (channels.sendHeaders.hasSubscribers) { - channels.sendHeaders.publish({ request: request3, headers: header, socket }); - } - if (!body || bodyLength === 0) { - writeBuffer(abort, null, client, request3, socket, contentLength, header, expectsPayload); - } else if (util3.isBuffer(body)) { - writeBuffer(abort, body, client, request3, socket, contentLength, header, expectsPayload); - } else if (util3.isBlobLike(body)) { - if (typeof body.stream === "function") { - writeIterable(abort, body.stream(), client, request3, socket, contentLength, header, expectsPayload); - } else { - writeBlob(abort, body, client, request3, socket, contentLength, header, expectsPayload); - } - } else if (util3.isStream(body)) { - writeStream(abort, body, client, request3, socket, contentLength, header, expectsPayload); - } else if (util3.isIterable(body)) { - writeIterable(abort, body, client, request3, socket, contentLength, header, expectsPayload); - } else { - assert(false); - } - return true; - } - function writeStream(abort, body, client, request3, socket, contentLength, header, expectsPayload) { - assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); - let finished = false; - const writer = new AsyncWriter({ abort, socket, request: request3, contentLength, client, expectsPayload, header }); - const onData = function(chunk) { - if (finished) { - return; - } - try { - if (!writer.write(chunk) && this.pause) { - this.pause(); - } - } catch (err) { - util3.destroy(this, err); - } - }; - const onDrain = function() { - if (finished) { - return; - } - if (body.resume) { - body.resume(); - } - }; - const onClose = function() { - queueMicrotask(() => { - body.removeListener("error", onFinished); - }); - if (!finished) { - const err = new RequestAbortedError(); - queueMicrotask(() => onFinished(err)); - } - }; - const onFinished = function(err) { - if (finished) { - return; - } - finished = true; - assert(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); - socket.off("drain", onDrain).off("error", onFinished); - body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose); - if (!err) { - try { - writer.end(); - } catch (er) { - err = er; - } - } - writer.destroy(err); - if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util3.destroy(body, err); - } else { - util3.destroy(body); - } - }; - body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose); - if (body.resume) { - body.resume(); - } - socket.on("drain", onDrain).on("error", onFinished); - if (body.errorEmitted ?? body.errored) { - setImmediate(() => onFinished(body.errored)); - } else if (body.endEmitted ?? body.readableEnded) { - setImmediate(() => onFinished(null)); - } - if (body.closeEmitted ?? body.closed) { - setImmediate(onClose); - } - } - function writeBuffer(abort, body, client, request3, socket, contentLength, header, expectsPayload) { - try { - if (!body) { - if (contentLength === 0) { - socket.write(`${header}content-length: 0\r -\r -`, "latin1"); - } else { - assert(contentLength === null, "no body must not have content length"); - socket.write(`${header}\r -`, "latin1"); - } - } else if (util3.isBuffer(body)) { - assert(contentLength === body.byteLength, "buffer body must have content length"); - socket.cork(); - socket.write(`${header}content-length: ${contentLength}\r -\r -`, "latin1"); - socket.write(body); - socket.uncork(); - request3.onBodySent(body); - if (!expectsPayload && request3.reset !== false) { - socket[kReset] = true; - } - } - request3.onRequestSent(); - client[kResume](); - } catch (err) { - abort(err); - } - } - async function writeBlob(abort, body, client, request3, socket, contentLength, header, expectsPayload) { - assert(contentLength === body.size, "blob body must have content length"); - try { - if (contentLength != null && contentLength !== body.size) { - throw new RequestContentLengthMismatchError(); - } - const buffer = Buffer.from(await body.arrayBuffer()); - socket.cork(); - socket.write(`${header}content-length: ${contentLength}\r -\r -`, "latin1"); - socket.write(buffer); - socket.uncork(); - request3.onBodySent(buffer); - request3.onRequestSent(); - if (!expectsPayload && request3.reset !== false) { - socket[kReset] = true; - } - client[kResume](); - } catch (err) { - abort(err); - } - } - async function writeIterable(abort, body, client, request3, socket, contentLength, header, expectsPayload) { - assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); - let callback = null; - function onDrain() { - if (callback) { - const cb = callback; - callback = null; - cb(); - } - } - const waitForDrain = () => new Promise((resolve14, reject) => { - assert(callback === null); - if (socket[kError]) { - reject(socket[kError]); - } else { - callback = resolve14; - } - }); - socket.on("close", onDrain).on("drain", onDrain); - const writer = new AsyncWriter({ abort, socket, request: request3, contentLength, client, expectsPayload, header }); - try { - for await (const chunk of body) { - if (socket[kError]) { - throw socket[kError]; - } - if (!writer.write(chunk)) { - await waitForDrain(); - } - } - writer.end(); - } catch (err) { - writer.destroy(err); - } finally { - socket.off("close", onDrain).off("drain", onDrain); - } - } - var AsyncWriter = class { - constructor({ abort, socket, request: request3, contentLength, client, expectsPayload, header }) { - this.socket = socket; - this.request = request3; - this.contentLength = contentLength; - this.client = client; - this.bytesWritten = 0; - this.expectsPayload = expectsPayload; - this.header = header; - this.abort = abort; - socket[kWriting] = true; - } - write(chunk) { - const { socket, request: request3, contentLength, client, bytesWritten, expectsPayload, header } = this; - if (socket[kError]) { - throw socket[kError]; - } - if (socket.destroyed) { - return false; - } - const len = Buffer.byteLength(chunk); - if (!len) { - return true; - } - if (contentLength !== null && bytesWritten + len > contentLength) { - if (client[kStrictContentLength]) { - throw new RequestContentLengthMismatchError(); - } - process.emitWarning(new RequestContentLengthMismatchError()); - } - socket.cork(); - if (bytesWritten === 0) { - if (!expectsPayload && request3.reset !== false) { - socket[kReset] = true; - } - if (contentLength === null) { - socket.write(`${header}transfer-encoding: chunked\r -`, "latin1"); - } else { - socket.write(`${header}content-length: ${contentLength}\r -\r -`, "latin1"); - } - } - if (contentLength === null) { - socket.write(`\r -${len.toString(16)}\r -`, "latin1"); - } - this.bytesWritten += len; - const ret = socket.write(chunk); - socket.uncork(); - request3.onBodySent(chunk); - if (!ret) { - if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { - if (socket[kParser].timeout.refresh) { - socket[kParser].timeout.refresh(); - } - } - } - return ret; - } - end() { - const { socket, contentLength, client, bytesWritten, expectsPayload, header, request: request3 } = this; - request3.onRequestSent(); - socket[kWriting] = false; - if (socket[kError]) { - throw socket[kError]; - } - if (socket.destroyed) { - return; - } - if (bytesWritten === 0) { - if (expectsPayload) { - socket.write(`${header}content-length: 0\r -\r -`, "latin1"); - } else { - socket.write(`${header}\r -`, "latin1"); - } - } else if (contentLength === null) { - socket.write("\r\n0\r\n\r\n", "latin1"); - } - if (contentLength !== null && bytesWritten !== contentLength) { - if (client[kStrictContentLength]) { - throw new RequestContentLengthMismatchError(); - } else { - process.emitWarning(new RequestContentLengthMismatchError()); - } - } - if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { - if (socket[kParser].timeout.refresh) { - socket[kParser].timeout.refresh(); - } - } - client[kResume](); - } - destroy(err) { - const { socket, client, abort } = this; - socket[kWriting] = false; - if (err) { - assert(client[kRunning] <= 1, "pipeline should only contain this request"); - abort(err); - } - } - }; - module2.exports = connectH1; - } -}); - -// node_modules/undici/lib/dispatcher/client-h2.js -var require_client_h2 = __commonJS({ - "node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var { pipeline: pipeline2 } = require("node:stream"); - var util3 = require_util(); - var { - RequestContentLengthMismatchError, - RequestAbortedError, - SocketError, - InformationalError - } = require_errors(); - var { - kUrl, - kReset, - kClient, - kRunning, - kPending, - kQueue, - kPendingIdx, - kRunningIdx, - kError, - kSocket, - kStrictContentLength, - kOnError, - kMaxConcurrentStreams, - kHTTP2Session, - kResume, - kSize, - kHTTPContext - } = require_symbols(); - var kOpenStreams = /* @__PURE__ */ Symbol("open streams"); - var extractBody; - var h2ExperimentalWarned = false; - var http2; - try { - http2 = require("node:http2"); - } catch { - http2 = { constants: {} }; - } - var { - constants: { - HTTP2_HEADER_AUTHORITY, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_PATH, - HTTP2_HEADER_SCHEME, - HTTP2_HEADER_CONTENT_LENGTH, - HTTP2_HEADER_EXPECT, - HTTP2_HEADER_STATUS - } - } = http2; - function parseH2Headers(headers) { - const result = []; - for (const [name, value] of Object.entries(headers)) { - if (Array.isArray(value)) { - for (const subvalue of value) { - result.push(Buffer.from(name), Buffer.from(subvalue)); - } - } else { - result.push(Buffer.from(name), Buffer.from(value)); - } - } - return result; - } - async function connectH2(client, socket) { - client[kSocket] = socket; - if (!h2ExperimentalWarned) { - h2ExperimentalWarned = true; - process.emitWarning("H2 support is experimental, expect them to change at any time.", { - code: "UNDICI-H2" - }); - } - const session = http2.connect(client[kUrl], { - createConnection: () => socket, - peerMaxConcurrentStreams: client[kMaxConcurrentStreams] - }); - session[kOpenStreams] = 0; - session[kClient] = client; - session[kSocket] = socket; - util3.addListener(session, "error", onHttp2SessionError); - util3.addListener(session, "frameError", onHttp2FrameError); - util3.addListener(session, "end", onHttp2SessionEnd); - util3.addListener(session, "goaway", onHTTP2GoAway); - util3.addListener(session, "close", function() { - const { [kClient]: client2 } = this; - const { [kSocket]: socket2 } = client2; - const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util3.getSocketInfo(socket2)); - client2[kHTTP2Session] = null; - if (client2.destroyed) { - assert(client2[kPending] === 0); - const requests = client2[kQueue].splice(client2[kRunningIdx]); - for (let i = 0; i < requests.length; i++) { - const request3 = requests[i]; - util3.errorRequest(client2, request3, err); - } - } - }); - session.unref(); - client[kHTTP2Session] = session; - socket[kHTTP2Session] = session; - util3.addListener(socket, "error", function(err) { - assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - this[kError] = err; - this[kClient][kOnError](err); - }); - util3.addListener(socket, "end", function() { - util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); - }); - util3.addListener(socket, "close", function() { - const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); - client[kSocket] = null; - if (this[kHTTP2Session] != null) { - this[kHTTP2Session].destroy(err); - } - client[kPendingIdx] = client[kRunningIdx]; - assert(client[kRunning] === 0); - client.emit("disconnect", client[kUrl], [client], err); - client[kResume](); - }); - let closed = false; - socket.on("close", () => { - closed = true; - }); - return { - version: "h2", - defaultPipelining: Infinity, - write(...args) { - return writeH2(client, ...args); - }, - resume() { - resumeH2(client); - }, - destroy(err, callback) { - if (closed) { - queueMicrotask(callback); - } else { - socket.destroy(err).on("close", callback); - } - }, - get destroyed() { - return socket.destroyed; - }, - busy() { - return false; - } - }; - } - function resumeH2(client) { - const socket = client[kSocket]; - if (socket?.destroyed === false) { - if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) { - socket.unref(); - client[kHTTP2Session].unref(); - } else { - socket.ref(); - client[kHTTP2Session].ref(); - } - } - } - function onHttp2SessionError(err) { - assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - this[kSocket][kError] = err; - this[kClient][kOnError](err); - } - function onHttp2FrameError(type, code, id) { - if (id === 0) { - const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`); - this[kSocket][kError] = err; - this[kClient][kOnError](err); - } - } - function onHttp2SessionEnd() { - const err = new SocketError("other side closed", util3.getSocketInfo(this[kSocket])); - this.destroy(err); - util3.destroy(this[kSocket], err); - } - function onHTTP2GoAway(code) { - const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util3.getSocketInfo(this)); - const client = this[kClient]; - client[kSocket] = null; - client[kHTTPContext] = null; - if (this[kHTTP2Session] != null) { - this[kHTTP2Session].destroy(err); - this[kHTTP2Session] = null; - } - util3.destroy(this[kSocket], err); - if (client[kRunningIdx] < client[kQueue].length) { - const request3 = client[kQueue][client[kRunningIdx]]; - client[kQueue][client[kRunningIdx]++] = null; - util3.errorRequest(client, request3, err); - client[kPendingIdx] = client[kRunningIdx]; - } - assert(client[kRunning] === 0); - client.emit("disconnect", client[kUrl], [client], err); - client[kResume](); - } - function shouldSendContentLength(method) { - return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; - } - function writeH2(client, request3) { - const session = client[kHTTP2Session]; - const { method, path: path30, host, upgrade, expectContinue, signal, headers: reqHeaders } = request3; - let { body } = request3; - if (upgrade) { - util3.errorRequest(client, request3, new Error("Upgrade not supported for H2")); - return false; - } - const headers = {}; - for (let n = 0; n < reqHeaders.length; n += 2) { - const key = reqHeaders[n + 0]; - const val = reqHeaders[n + 1]; - if (Array.isArray(val)) { - for (let i = 0; i < val.length; i++) { - if (headers[key]) { - headers[key] += `,${val[i]}`; - } else { - headers[key] = val[i]; - } - } - } else { - headers[key] = val; - } - } - let stream2; - const { hostname, port } = client[kUrl]; - headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; - headers[HTTP2_HEADER_METHOD] = method; - const abort = (err) => { - if (request3.aborted || request3.completed) { - return; - } - err = err || new RequestAbortedError(); - util3.errorRequest(client, request3, err); - if (stream2 != null) { - util3.destroy(stream2, err); - } - util3.destroy(body, err); - client[kQueue][client[kRunningIdx]++] = null; - client[kResume](); - }; - try { - request3.onConnect(abort); - } catch (err) { - util3.errorRequest(client, request3, err); - } - if (request3.aborted) { - return false; - } - if (method === "CONNECT") { - session.ref(); - stream2 = session.request(headers, { endStream: false, signal }); - if (stream2.id && !stream2.pending) { - request3.onUpgrade(null, null, stream2); - ++session[kOpenStreams]; - client[kQueue][client[kRunningIdx]++] = null; - } else { - stream2.once("ready", () => { - request3.onUpgrade(null, null, stream2); - ++session[kOpenStreams]; - client[kQueue][client[kRunningIdx]++] = null; - }); - } - stream2.once("close", () => { - session[kOpenStreams] -= 1; - if (session[kOpenStreams] === 0) session.unref(); - }); - return true; - } - headers[HTTP2_HEADER_PATH] = path30; - headers[HTTP2_HEADER_SCHEME] = "https"; - const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; - if (body && typeof body.read === "function") { - body.read(0); - } - let contentLength = util3.bodyLength(body); - if (util3.isFormDataLike(body)) { - extractBody ??= require_body().extractBody; - const [bodyStream, contentType] = extractBody(body); - headers["content-type"] = contentType; - body = bodyStream.stream; - contentLength = bodyStream.length; - } - if (contentLength == null) { - contentLength = request3.contentLength; - } - if (contentLength === 0 || !expectsPayload) { - contentLength = null; - } - if (shouldSendContentLength(method) && contentLength > 0 && request3.contentLength != null && request3.contentLength !== contentLength) { - if (client[kStrictContentLength]) { - util3.errorRequest(client, request3, new RequestContentLengthMismatchError()); - return false; - } - process.emitWarning(new RequestContentLengthMismatchError()); - } - if (contentLength != null) { - assert(body, "no body must not have content length"); - headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; - } - session.ref(); - const shouldEndStream = method === "GET" || method === "HEAD" || body === null; - if (expectContinue) { - headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream2 = session.request(headers, { endStream: shouldEndStream, signal }); - stream2.once("continue", writeBodyH2); - } else { - stream2 = session.request(headers, { - endStream: shouldEndStream, - signal - }); - writeBodyH2(); - } - ++session[kOpenStreams]; - stream2.once("response", (headers2) => { - const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; - request3.onResponseStarted(); - if (request3.aborted) { - const err = new RequestAbortedError(); - util3.errorRequest(client, request3, err); - util3.destroy(stream2, err); - return; - } - if (request3.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream2.resume.bind(stream2), "") === false) { - stream2.pause(); - } - stream2.on("data", (chunk) => { - if (request3.onData(chunk) === false) { - stream2.pause(); - } - }); - }); - stream2.once("end", () => { - if (stream2.state?.state == null || stream2.state.state < 6) { - request3.onComplete([]); - } - if (session[kOpenStreams] === 0) { - session.unref(); - } - abort(new InformationalError("HTTP/2: stream half-closed (remote)")); - client[kQueue][client[kRunningIdx]++] = null; - client[kPendingIdx] = client[kRunningIdx]; - client[kResume](); - }); - stream2.once("close", () => { - session[kOpenStreams] -= 1; - if (session[kOpenStreams] === 0) { - session.unref(); - } - }); - stream2.once("error", function(err) { - abort(err); - }); - stream2.once("frameError", (type, code) => { - abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)); - }); - return true; - function writeBodyH2() { - if (!body || contentLength === 0) { - writeBuffer( - abort, - stream2, - null, - client, - request3, - client[kSocket], - contentLength, - expectsPayload - ); - } else if (util3.isBuffer(body)) { - writeBuffer( - abort, - stream2, - body, - client, - request3, - client[kSocket], - contentLength, - expectsPayload - ); - } else if (util3.isBlobLike(body)) { - if (typeof body.stream === "function") { - writeIterable( - abort, - stream2, - body.stream(), - client, - request3, - client[kSocket], - contentLength, - expectsPayload - ); - } else { - writeBlob( - abort, - stream2, - body, - client, - request3, - client[kSocket], - contentLength, - expectsPayload - ); - } - } else if (util3.isStream(body)) { - writeStream( - abort, - client[kSocket], - expectsPayload, - stream2, - body, - client, - request3, - contentLength - ); - } else if (util3.isIterable(body)) { - writeIterable( - abort, - stream2, - body, - client, - request3, - client[kSocket], - contentLength, - expectsPayload - ); - } else { - assert(false); - } - } - } - function writeBuffer(abort, h2stream, body, client, request3, socket, contentLength, expectsPayload) { - try { - if (body != null && util3.isBuffer(body)) { - assert(contentLength === body.byteLength, "buffer body must have content length"); - h2stream.cork(); - h2stream.write(body); - h2stream.uncork(); - h2stream.end(); - request3.onBodySent(body); - } - if (!expectsPayload) { - socket[kReset] = true; - } - request3.onRequestSent(); - client[kResume](); - } catch (error3) { - abort(error3); - } - } - function writeStream(abort, socket, expectsPayload, h2stream, body, client, request3, contentLength) { - assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); - const pipe = pipeline2( - body, - h2stream, - (err) => { - if (err) { - util3.destroy(pipe, err); - abort(err); - } else { - util3.removeAllListeners(pipe); - request3.onRequestSent(); - if (!expectsPayload) { - socket[kReset] = true; - } - client[kResume](); - } - } - ); - util3.addListener(pipe, "data", onPipeData); - function onPipeData(chunk) { - request3.onBodySent(chunk); - } - } - async function writeBlob(abort, h2stream, body, client, request3, socket, contentLength, expectsPayload) { - assert(contentLength === body.size, "blob body must have content length"); - try { - if (contentLength != null && contentLength !== body.size) { - throw new RequestContentLengthMismatchError(); - } - const buffer = Buffer.from(await body.arrayBuffer()); - h2stream.cork(); - h2stream.write(buffer); - h2stream.uncork(); - h2stream.end(); - request3.onBodySent(buffer); - request3.onRequestSent(); - if (!expectsPayload) { - socket[kReset] = true; - } - client[kResume](); - } catch (err) { - abort(err); - } - } - async function writeIterable(abort, h2stream, body, client, request3, socket, contentLength, expectsPayload) { - assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); - let callback = null; - function onDrain() { - if (callback) { - const cb = callback; - callback = null; - cb(); - } - } - const waitForDrain = () => new Promise((resolve14, reject) => { - assert(callback === null); - if (socket[kError]) { - reject(socket[kError]); - } else { - callback = resolve14; - } - }); - h2stream.on("close", onDrain).on("drain", onDrain); - try { - for await (const chunk of body) { - if (socket[kError]) { - throw socket[kError]; - } - const res = h2stream.write(chunk); - request3.onBodySent(chunk); - if (!res) { - await waitForDrain(); - } - } - h2stream.end(); - request3.onRequestSent(); - if (!expectsPayload) { - socket[kReset] = true; - } - client[kResume](); - } catch (err) { - abort(err); - } finally { - h2stream.off("close", onDrain).off("drain", onDrain); - } - } - module2.exports = connectH2; - } -}); - -// node_modules/undici/lib/handler/redirect-handler.js -var require_redirect_handler = __commonJS({ - "node_modules/undici/lib/handler/redirect-handler.js"(exports2, module2) { - "use strict"; - var util3 = require_util(); - var { kBodyUsed } = require_symbols(); - var assert = require("node:assert"); - var { InvalidArgumentError } = require_errors(); - var EE = require("node:events"); - var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = /* @__PURE__ */ Symbol("body"); - var BodyAsyncIterable = class { - constructor(body) { - this[kBody] = body; - this[kBodyUsed] = false; - } - async *[Symbol.asyncIterator]() { - assert(!this[kBodyUsed], "disturbed"); - this[kBodyUsed] = true; - yield* this[kBody]; - } - }; - var RedirectHandler = class { - constructor(dispatch, maxRedirections, opts, handler2) { - if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { - throw new InvalidArgumentError("maxRedirections must be a positive number"); - } - util3.validateHandler(handler2, opts.method, opts.upgrade); - this.dispatch = dispatch; - this.location = null; - this.abort = null; - this.opts = { ...opts, maxRedirections: 0 }; - this.maxRedirections = maxRedirections; - this.handler = handler2; - this.history = []; - this.redirectionLimitReached = false; - if (util3.isStream(this.opts.body)) { - if (util3.bodyLength(this.opts.body) === 0) { - this.opts.body.on("data", function() { - assert(false); - }); - } - if (typeof this.opts.body.readableDidRead !== "boolean") { - this.opts.body[kBodyUsed] = false; - EE.prototype.on.call(this.opts.body, "data", function() { - this[kBodyUsed] = true; - }); - } - } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { - this.opts.body = new BodyAsyncIterable(this.opts.body); - } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util3.isIterable(this.opts.body)) { - this.opts.body = new BodyAsyncIterable(this.opts.body); - } - } - onConnect(abort) { - this.abort = abort; - this.handler.onConnect(abort, { history: this.history }); - } - onUpgrade(statusCode, headers, socket) { - this.handler.onUpgrade(statusCode, headers, socket); - } - onError(error3) { - this.handler.onError(error3); - } - onHeaders(statusCode, headers, resume, statusText) { - this.location = this.history.length >= this.maxRedirections || util3.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); - if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { - if (this.request) { - this.request.abort(new Error("max redirects")); - } - this.redirectionLimitReached = true; - this.abort(new Error("max redirects")); - return; - } - if (this.opts.origin) { - this.history.push(new URL(this.opts.path, this.opts.origin)); - } - if (!this.location) { - return this.handler.onHeaders(statusCode, headers, resume, statusText); - } - const { origin, pathname, search } = util3.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path30 = search ? `${pathname}${search}` : pathname; - this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path30; - this.opts.origin = origin; - this.opts.maxRedirections = 0; - this.opts.query = null; - if (statusCode === 303 && this.opts.method !== "HEAD") { - this.opts.method = "GET"; - this.opts.body = null; - } - } - onData(chunk) { - if (this.location) { - } else { - return this.handler.onData(chunk); - } - } - onComplete(trailers) { - if (this.location) { - this.location = null; - this.abort = null; - this.dispatch(this.opts, this); - } else { - this.handler.onComplete(trailers); - } - } - onBodySent(chunk) { - if (this.handler.onBodySent) { - this.handler.onBodySent(chunk); - } - } - }; - function parseLocation(statusCode, headers) { - if (redirectableStatusCodes.indexOf(statusCode) === -1) { - return null; - } - for (let i = 0; i < headers.length; i += 2) { - if (headers[i].length === 8 && util3.headerNameToString(headers[i]) === "location") { - return headers[i + 1]; - } - } - } - function shouldRemoveHeader(header, removeContent, unknownOrigin) { - if (header.length === 4) { - return util3.headerNameToString(header) === "host"; - } - if (removeContent && util3.headerNameToString(header).startsWith("content-")) { - return true; - } - if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { - const name = util3.headerNameToString(header); - return name === "authorization" || name === "cookie" || name === "proxy-authorization"; - } - return false; - } - function cleanRequestHeaders(headers, removeContent, unknownOrigin) { - const ret = []; - if (Array.isArray(headers)) { - for (let i = 0; i < headers.length; i += 2) { - if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { - ret.push(headers[i], headers[i + 1]); - } - } - } else if (headers && typeof headers === "object") { - for (const key of Object.keys(headers)) { - if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { - ret.push(key, headers[key]); - } - } - } else { - assert(headers == null, "headers must be an object or an array"); - } - return ret; - } - module2.exports = RedirectHandler; - } -}); - -// node_modules/undici/lib/interceptor/redirect-interceptor.js -var require_redirect_interceptor = __commonJS({ - "node_modules/undici/lib/interceptor/redirect-interceptor.js"(exports2, module2) { - "use strict"; - var RedirectHandler = require_redirect_handler(); - function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) { - return (dispatch) => { - return function Intercept(opts, handler2) { - const { maxRedirections = defaultMaxRedirections } = opts; - if (!maxRedirections) { - return dispatch(opts, handler2); - } - const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler2); - opts = { ...opts, maxRedirections: 0 }; - return dispatch(opts, redirectHandler); - }; - }; - } - module2.exports = createRedirectInterceptor; - } -}); - -// node_modules/undici/lib/dispatcher/client.js -var require_client = __commonJS({ - "node_modules/undici/lib/dispatcher/client.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var net = require("node:net"); - var http = require("node:http"); - var util3 = require_util(); - var { channels } = require_diagnostics(); - var Request = require_request(); - var DispatcherBase = require_dispatcher_base(); - var { - InvalidArgumentError, - InformationalError, - ClientDestroyedError - } = require_errors(); - var buildConnector = require_connect(); - var { - kUrl, - kServerName, - kClient, - kBusy, - kConnect, - kResuming, - kRunning, - kPending, - kSize, - kQueue, - kConnected, - kConnecting, - kNeedDrain, - kKeepAliveDefaultTimeout, - kHostHeader, - kPendingIdx, - kRunningIdx, - kError, - kPipelining, - kKeepAliveTimeoutValue, - kMaxHeadersSize, - kKeepAliveMaxTimeout, - kKeepAliveTimeoutThreshold, - kHeadersTimeout, - kBodyTimeout, - kStrictContentLength, - kConnector, - kMaxRedirections, - kMaxRequests, - kCounter, - kClose, - kDestroy, - kDispatch, - kInterceptors, - kLocalAddress, - kMaxResponseSize, - kOnError, - kHTTPContext, - kMaxConcurrentStreams, - kResume - } = require_symbols(); - var connectH1 = require_client_h1(); - var connectH2 = require_client_h2(); - var deprecatedInterceptorWarned = false; - var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); - var noop3 = () => { - }; - function getPipelining(client) { - return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1; - } - var Client = class extends DispatcherBase { - /** - * - * @param {string|URL} url - * @param {import('../../types/client.js').Client.Options} options - */ - constructor(url2, { - interceptors, - maxHeaderSize, - headersTimeout, - socketTimeout, - requestTimeout, - connectTimeout, - bodyTimeout, - idleTimeout, - keepAlive, - keepAliveTimeout, - maxKeepAliveTimeout, - keepAliveMaxTimeout, - keepAliveTimeoutThreshold, - socketPath, - pipelining, - tls, - strictContentLength, - maxCachedSessions, - maxRedirections, - connect: connect2, - maxRequestsPerClient, - localAddress, - maxResponseSize, - autoSelectFamily, - autoSelectFamilyAttemptTimeout, - // h2 - maxConcurrentStreams, - allowH2, - webSocket - } = {}) { - super({ webSocket }); - if (keepAlive !== void 0) { - throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); - } - if (socketTimeout !== void 0) { - throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead"); - } - if (requestTimeout !== void 0) { - throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead"); - } - if (idleTimeout !== void 0) { - throw new InvalidArgumentError("unsupported idleTimeout, use keepAliveTimeout instead"); - } - if (maxKeepAliveTimeout !== void 0) { - throw new InvalidArgumentError("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead"); - } - if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { - throw new InvalidArgumentError("invalid maxHeaderSize"); - } - if (socketPath != null && typeof socketPath !== "string") { - throw new InvalidArgumentError("invalid socketPath"); - } - if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { - throw new InvalidArgumentError("invalid connectTimeout"); - } - if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { - throw new InvalidArgumentError("invalid keepAliveTimeout"); - } - if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { - throw new InvalidArgumentError("invalid keepAliveMaxTimeout"); - } - if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { - throw new InvalidArgumentError("invalid keepAliveTimeoutThreshold"); - } - if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { - throw new InvalidArgumentError("headersTimeout must be a positive integer or zero"); - } - if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { - throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero"); - } - if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { - throw new InvalidArgumentError("connect must be a function or an object"); - } - if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { - throw new InvalidArgumentError("maxRedirections must be a positive number"); - } - if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { - throw new InvalidArgumentError("maxRequestsPerClient must be a positive number"); - } - if (localAddress != null && (typeof localAddress !== "string" || net.isIP(localAddress) === 0)) { - throw new InvalidArgumentError("localAddress must be valid string IP address"); - } - if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { - throw new InvalidArgumentError("maxResponseSize must be a positive number"); - } - if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) { - throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number"); - } - if (allowH2 != null && typeof allowH2 !== "boolean") { - throw new InvalidArgumentError("allowH2 must be a valid boolean value"); - } - if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) { - throw new InvalidArgumentError("maxConcurrentStreams must be a positive integer, greater than 0"); - } - if (typeof connect2 !== "function") { - connect2 = buildConnector({ - ...tls, - maxCachedSessions, - allowH2, - socketPath, - timeout: connectTimeout, - ...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, - ...connect2 - }); - } - if (interceptors?.Client && Array.isArray(interceptors.Client)) { - this[kInterceptors] = interceptors.Client; - if (!deprecatedInterceptorWarned) { - deprecatedInterceptorWarned = true; - process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.", { - code: "UNDICI-CLIENT-INTERCEPTOR-DEPRECATED" - }); - } - } else { - this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]; - } - this[kUrl] = util3.parseOrigin(url2); - this[kConnector] = connect2; - this[kPipelining] = pipelining != null ? pipelining : 1; - this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize; - this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; - this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; - this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold; - this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]; - this[kServerName] = null; - this[kLocalAddress] = localAddress != null ? localAddress : null; - this[kResuming] = 0; - this[kNeedDrain] = 0; - this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r -`; - this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5; - this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5; - this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength; - this[kMaxRedirections] = maxRedirections; - this[kMaxRequests] = maxRequestsPerClient; - this[kClosedResolve] = null; - this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1; - this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100; - this[kHTTPContext] = null; - this[kQueue] = []; - this[kRunningIdx] = 0; - this[kPendingIdx] = 0; - this[kResume] = (sync) => resume(this, sync); - this[kOnError] = (err) => onError(this, err); - } - get pipelining() { - return this[kPipelining]; - } - set pipelining(value) { - this[kPipelining] = value; - this[kResume](true); - } - get [kPending]() { - return this[kQueue].length - this[kPendingIdx]; - } - get [kRunning]() { - return this[kPendingIdx] - this[kRunningIdx]; - } - get [kSize]() { - return this[kQueue].length - this[kRunningIdx]; - } - get [kConnected]() { - return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed; - } - get [kBusy]() { - return Boolean( - this[kHTTPContext]?.busy(null) || this[kSize] >= (getPipelining(this) || 1) || this[kPending] > 0 - ); - } - /* istanbul ignore: only used for test */ - [kConnect](cb) { - connect(this); - this.once("connect", cb); - } - [kDispatch](opts, handler2) { - const origin = opts.origin || this[kUrl].origin; - const request3 = new Request(origin, opts, handler2); - this[kQueue].push(request3); - if (this[kResuming]) { - } else if (util3.bodyLength(request3.body) == null && util3.isIterable(request3.body)) { - this[kResuming] = 1; - queueMicrotask(() => resume(this)); - } else { - this[kResume](true); - } - if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { - this[kNeedDrain] = 2; - } - return this[kNeedDrain] < 2; - } - async [kClose]() { - return new Promise((resolve14) => { - if (this[kSize]) { - this[kClosedResolve] = resolve14; - } else { - resolve14(null); - } - }); - } - async [kDestroy](err) { - return new Promise((resolve14) => { - const requests = this[kQueue].splice(this[kPendingIdx]); - for (let i = 0; i < requests.length; i++) { - const request3 = requests[i]; - util3.errorRequest(this, request3, err); - } - const callback = () => { - if (this[kClosedResolve]) { - this[kClosedResolve](); - this[kClosedResolve] = null; - } - resolve14(null); - }; - if (this[kHTTPContext]) { - this[kHTTPContext].destroy(err, callback); - this[kHTTPContext] = null; - } else { - queueMicrotask(callback); - } - this[kResume](); - }); - } - }; - var createRedirectInterceptor = require_redirect_interceptor(); - function onError(client, err) { - if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { - assert(client[kPendingIdx] === client[kRunningIdx]); - const requests = client[kQueue].splice(client[kRunningIdx]); - for (let i = 0; i < requests.length; i++) { - const request3 = requests[i]; - util3.errorRequest(client, request3, err); - } - assert(client[kSize] === 0); - } - } - async function connect(client) { - assert(!client[kConnecting]); - assert(!client[kHTTPContext]); - let { host, hostname, protocol, port } = client[kUrl]; - if (hostname[0] === "[") { - const idx = hostname.indexOf("]"); - assert(idx !== -1); - const ip = hostname.substring(1, idx); - assert(net.isIP(ip)); - hostname = ip; - } - client[kConnecting] = true; - if (channels.beforeConnect.hasSubscribers) { - channels.beforeConnect.publish({ - connectParams: { - host, - hostname, - protocol, - port, - version: client[kHTTPContext]?.version, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector] - }); - } - try { - const socket = await new Promise((resolve14, reject) => { - client[kConnector]({ - host, - hostname, - protocol, - port, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, (err, socket2) => { - if (err) { - reject(err); - } else { - resolve14(socket2); - } - }); - }); - if (client.destroyed) { - util3.destroy(socket.on("error", noop3), new ClientDestroyedError()); - return; - } - assert(socket); - try { - client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket); - } catch (err) { - socket.destroy().on("error", noop3); - throw err; - } - client[kConnecting] = false; - socket[kCounter] = 0; - socket[kMaxRequests] = client[kMaxRequests]; - socket[kClient] = client; - socket[kError] = null; - if (channels.connected.hasSubscribers) { - channels.connected.publish({ - connectParams: { - host, - hostname, - protocol, - port, - version: client[kHTTPContext]?.version, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector], - socket - }); - } - client.emit("connect", client[kUrl], [client]); - } catch (err) { - if (client.destroyed) { - return; - } - client[kConnecting] = false; - if (channels.connectError.hasSubscribers) { - channels.connectError.publish({ - connectParams: { - host, - hostname, - protocol, - port, - version: client[kHTTPContext]?.version, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector], - error: err - }); - } - if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - assert(client[kRunning] === 0); - while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { - const request3 = client[kQueue][client[kPendingIdx]++]; - util3.errorRequest(client, request3, err); - } - } else { - onError(client, err); - } - client.emit("connectionError", client[kUrl], [client], err); - } - client[kResume](); - } - function emitDrain(client) { - client[kNeedDrain] = 0; - client.emit("drain", client[kUrl], [client]); - } - function resume(client, sync) { - if (client[kResuming] === 2) { - return; - } - client[kResuming] = 2; - _resume(client, sync); - client[kResuming] = 0; - if (client[kRunningIdx] > 256) { - client[kQueue].splice(0, client[kRunningIdx]); - client[kPendingIdx] -= client[kRunningIdx]; - client[kRunningIdx] = 0; - } - } - function _resume(client, sync) { - while (true) { - if (client.destroyed) { - assert(client[kPending] === 0); - return; - } - if (client[kClosedResolve] && !client[kSize]) { - client[kClosedResolve](); - client[kClosedResolve] = null; - return; - } - if (client[kHTTPContext]) { - client[kHTTPContext].resume(); - } - if (client[kBusy]) { - client[kNeedDrain] = 2; - } else if (client[kNeedDrain] === 2) { - if (sync) { - client[kNeedDrain] = 1; - queueMicrotask(() => emitDrain(client)); - } else { - emitDrain(client); - } - continue; - } - if (client[kPending] === 0) { - return; - } - if (client[kRunning] >= (getPipelining(client) || 1)) { - return; - } - const request3 = client[kQueue][client[kPendingIdx]]; - if (client[kUrl].protocol === "https:" && client[kServerName] !== request3.servername) { - if (client[kRunning] > 0) { - return; - } - client[kServerName] = request3.servername; - client[kHTTPContext]?.destroy(new InformationalError("servername changed"), () => { - client[kHTTPContext] = null; - resume(client); - }); - } - if (client[kConnecting]) { - return; - } - if (!client[kHTTPContext]) { - connect(client); - return; - } - if (client[kHTTPContext].destroyed) { - return; - } - if (client[kHTTPContext].busy(request3)) { - return; - } - if (!request3.aborted && client[kHTTPContext].write(request3)) { - client[kPendingIdx]++; - } else { - client[kQueue].splice(client[kPendingIdx], 1); - } - } - } - module2.exports = Client; - } -}); - -// node_modules/undici/lib/dispatcher/fixed-queue.js -var require_fixed_queue = __commonJS({ - "node_modules/undici/lib/dispatcher/fixed-queue.js"(exports2, module2) { - "use strict"; - var kSize = 2048; - var kMask = kSize - 1; - var FixedCircularBuffer = class { - constructor() { - this.bottom = 0; - this.top = 0; - this.list = new Array(kSize); - this.next = null; - } - isEmpty() { - return this.top === this.bottom; - } - isFull() { - return (this.top + 1 & kMask) === this.bottom; - } - push(data) { - this.list[this.top] = data; - this.top = this.top + 1 & kMask; - } - shift() { - const nextItem = this.list[this.bottom]; - if (nextItem === void 0) - return null; - this.list[this.bottom] = void 0; - this.bottom = this.bottom + 1 & kMask; - return nextItem; - } - }; - module2.exports = class FixedQueue { - constructor() { - this.head = this.tail = new FixedCircularBuffer(); - } - isEmpty() { - return this.head.isEmpty(); - } - push(data) { - if (this.head.isFull()) { - this.head = this.head.next = new FixedCircularBuffer(); - } - this.head.push(data); - } - shift() { - const tail = this.tail; - const next = tail.shift(); - if (tail.isEmpty() && tail.next !== null) { - this.tail = tail.next; - } - return next; - } - }; - } -}); - -// node_modules/undici/lib/dispatcher/pool-stats.js -var require_pool_stats = __commonJS({ - "node_modules/undici/lib/dispatcher/pool-stats.js"(exports2, module2) { - var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = /* @__PURE__ */ Symbol("pool"); - var PoolStats = class { - constructor(pool) { - this[kPool] = pool; - } - get connected() { - return this[kPool][kConnected]; - } - get free() { - return this[kPool][kFree]; - } - get pending() { - return this[kPool][kPending]; - } - get queued() { - return this[kPool][kQueued]; - } - get running() { - return this[kPool][kRunning]; - } - get size() { - return this[kPool][kSize]; - } - }; - module2.exports = PoolStats; - } -}); - -// node_modules/undici/lib/dispatcher/pool-base.js -var require_pool_base = __commonJS({ - "node_modules/undici/lib/dispatcher/pool-base.js"(exports2, module2) { - "use strict"; - var DispatcherBase = require_dispatcher_base(); - var FixedQueue = require_fixed_queue(); - var { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols(); - var PoolStats = require_pool_stats(); - var kClients = /* @__PURE__ */ Symbol("clients"); - var kNeedDrain = /* @__PURE__ */ Symbol("needDrain"); - var kQueue = /* @__PURE__ */ Symbol("queue"); - var kClosedResolve = /* @__PURE__ */ Symbol("closed resolve"); - var kOnDrain = /* @__PURE__ */ Symbol("onDrain"); - var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); - var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); - var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); - var kGetDispatcher = /* @__PURE__ */ Symbol("get dispatcher"); - var kAddClient = /* @__PURE__ */ Symbol("add client"); - var kRemoveClient = /* @__PURE__ */ Symbol("remove client"); - var kStats = /* @__PURE__ */ Symbol("stats"); - var PoolBase = class extends DispatcherBase { - constructor(opts) { - super(opts); - this[kQueue] = new FixedQueue(); - this[kClients] = []; - this[kQueued] = 0; - const pool = this; - this[kOnDrain] = function onDrain(origin, targets) { - const queue2 = pool[kQueue]; - let needDrain = false; - while (!needDrain) { - const item = queue2.shift(); - if (!item) { - break; - } - pool[kQueued]--; - needDrain = !this.dispatch(item.opts, item.handler); - } - this[kNeedDrain] = needDrain; - if (!this[kNeedDrain] && pool[kNeedDrain]) { - pool[kNeedDrain] = false; - pool.emit("drain", origin, [pool, ...targets]); - } - if (pool[kClosedResolve] && queue2.isEmpty()) { - Promise.all(pool[kClients].map((c) => c.close())).then(pool[kClosedResolve]); - } - }; - this[kOnConnect] = (origin, targets) => { - pool.emit("connect", origin, [pool, ...targets]); - }; - this[kOnDisconnect] = (origin, targets, err) => { - pool.emit("disconnect", origin, [pool, ...targets], err); - }; - this[kOnConnectionError] = (origin, targets, err) => { - pool.emit("connectionError", origin, [pool, ...targets], err); - }; - this[kStats] = new PoolStats(this); - } - get [kBusy]() { - return this[kNeedDrain]; - } - get [kConnected]() { - return this[kClients].filter((client) => client[kConnected]).length; - } - get [kFree]() { - return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length; - } - get [kPending]() { - let ret = this[kQueued]; - for (const { [kPending]: pending } of this[kClients]) { - ret += pending; - } - return ret; - } - get [kRunning]() { - let ret = 0; - for (const { [kRunning]: running } of this[kClients]) { - ret += running; - } - return ret; - } - get [kSize]() { - let ret = this[kQueued]; - for (const { [kSize]: size } of this[kClients]) { - ret += size; - } - return ret; - } - get stats() { - return this[kStats]; - } - async [kClose]() { - if (this[kQueue].isEmpty()) { - await Promise.all(this[kClients].map((c) => c.close())); - } else { - await new Promise((resolve14) => { - this[kClosedResolve] = resolve14; - }); - } - } - async [kDestroy](err) { - while (true) { - const item = this[kQueue].shift(); - if (!item) { - break; - } - item.handler.onError(err); - } - await Promise.all(this[kClients].map((c) => c.destroy(err))); - } - [kDispatch](opts, handler2) { - const dispatcher = this[kGetDispatcher](); - if (!dispatcher) { - this[kNeedDrain] = true; - this[kQueue].push({ opts, handler: handler2 }); - this[kQueued]++; - } else if (!dispatcher.dispatch(opts, handler2)) { - dispatcher[kNeedDrain] = true; - this[kNeedDrain] = !this[kGetDispatcher](); - } - return !this[kNeedDrain]; - } - [kAddClient](client) { - client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); - this[kClients].push(client); - if (this[kNeedDrain]) { - queueMicrotask(() => { - if (this[kNeedDrain]) { - this[kOnDrain](client[kUrl], [this, client]); - } - }); - } - return this; - } - [kRemoveClient](client) { - client.close(() => { - const idx = this[kClients].indexOf(client); - if (idx !== -1) { - this[kClients].splice(idx, 1); - } - }); - this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); - } - }; - module2.exports = { - PoolBase, - kClients, - kNeedDrain, - kAddClient, - kRemoveClient, - kGetDispatcher - }; - } -}); - -// node_modules/undici/lib/dispatcher/pool.js -var require_pool = __commonJS({ - "node_modules/undici/lib/dispatcher/pool.js"(exports2, module2) { - "use strict"; - var { - PoolBase, - kClients, - kNeedDrain, - kAddClient, - kGetDispatcher - } = require_pool_base(); - var Client = require_client(); - var { - InvalidArgumentError - } = require_errors(); - var util3 = require_util(); - var { kUrl, kInterceptors } = require_symbols(); - var buildConnector = require_connect(); - var kOptions = /* @__PURE__ */ Symbol("options"); - var kConnections = /* @__PURE__ */ Symbol("connections"); - var kFactory = /* @__PURE__ */ Symbol("factory"); - function defaultFactory(origin, opts) { - return new Client(origin, opts); - } - var Pool = class extends PoolBase { - constructor(origin, { - connections, - factory = defaultFactory, - connect, - connectTimeout, - tls, - maxCachedSessions, - socketPath, - autoSelectFamily, - autoSelectFamilyAttemptTimeout, - allowH2, - ...options - } = {}) { - if (connections != null && (!Number.isFinite(connections) || connections < 0)) { - throw new InvalidArgumentError("invalid connections"); - } - if (typeof factory !== "function") { - throw new InvalidArgumentError("factory must be a function."); - } - if (connect != null && typeof connect !== "function" && typeof connect !== "object") { - throw new InvalidArgumentError("connect must be a function or an object"); - } - if (typeof connect !== "function") { - connect = buildConnector({ - ...tls, - maxCachedSessions, - allowH2, - socketPath, - timeout: connectTimeout, - ...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, - ...connect - }); - } - super(options); - this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; - this[kConnections] = connections || null; - this[kUrl] = util3.parseOrigin(origin); - this[kOptions] = { ...util3.deepClone(options), connect, allowH2 }; - this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; - this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error3) => { - for (const target of targets) { - const idx = this[kClients].indexOf(target); - if (idx !== -1) { - this[kClients].splice(idx, 1); - } - } - }); - } - [kGetDispatcher]() { - for (const client of this[kClients]) { - if (!client[kNeedDrain]) { - return client; - } - } - if (!this[kConnections] || this[kClients].length < this[kConnections]) { - const dispatcher = this[kFactory](this[kUrl], this[kOptions]); - this[kAddClient](dispatcher); - return dispatcher; - } - } - }; - module2.exports = Pool; - } -}); - -// node_modules/undici/lib/dispatcher/balanced-pool.js -var require_balanced_pool = __commonJS({ - "node_modules/undici/lib/dispatcher/balanced-pool.js"(exports2, module2) { - "use strict"; - var { - BalancedPoolMissingUpstreamError, - InvalidArgumentError - } = require_errors(); - var { - PoolBase, - kClients, - kNeedDrain, - kAddClient, - kRemoveClient, - kGetDispatcher - } = require_pool_base(); - var Pool = require_pool(); - var { kUrl, kInterceptors } = require_symbols(); - var { parseOrigin } = require_util(); - var kFactory = /* @__PURE__ */ Symbol("factory"); - var kOptions = /* @__PURE__ */ Symbol("options"); - var kGreatestCommonDivisor = /* @__PURE__ */ Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = /* @__PURE__ */ Symbol("kCurrentWeight"); - var kIndex = /* @__PURE__ */ Symbol("kIndex"); - var kWeight = /* @__PURE__ */ Symbol("kWeight"); - var kMaxWeightPerServer = /* @__PURE__ */ Symbol("kMaxWeightPerServer"); - var kErrorPenalty = /* @__PURE__ */ Symbol("kErrorPenalty"); - function getGreatestCommonDivisor(a, b) { - if (a === 0) return b; - while (b !== 0) { - const t = b; - b = a % b; - a = t; - } - return a; - } - function defaultFactory(origin, opts) { - return new Pool(origin, opts); - } - var BalancedPool = class extends PoolBase { - constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) { - super(); - this[kOptions] = opts; - this[kIndex] = -1; - this[kCurrentWeight] = 0; - this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100; - this[kErrorPenalty] = this[kOptions].errorPenalty || 15; - if (!Array.isArray(upstreams)) { - upstreams = [upstreams]; - } - if (typeof factory !== "function") { - throw new InvalidArgumentError("factory must be a function."); - } - this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) ? opts.interceptors.BalancedPool : []; - this[kFactory] = factory; - for (const upstream of upstreams) { - this.addUpstream(upstream); - } - this._updateBalancedPoolStats(); - } - addUpstream(upstream) { - const upstreamOrigin = parseOrigin(upstream).origin; - if (this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true)) { - return this; - } - const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])); - this[kAddClient](pool); - pool.on("connect", () => { - pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]); - }); - pool.on("connectionError", () => { - pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); - this._updateBalancedPoolStats(); - }); - pool.on("disconnect", (...args) => { - const err = args[2]; - if (err && err.code === "UND_ERR_SOCKET") { - pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); - this._updateBalancedPoolStats(); - } - }); - for (const client of this[kClients]) { - client[kWeight] = this[kMaxWeightPerServer]; - } - this._updateBalancedPoolStats(); - return this; - } - _updateBalancedPoolStats() { - let result = 0; - for (let i = 0; i < this[kClients].length; i++) { - result = getGreatestCommonDivisor(this[kClients][i][kWeight], result); - } - this[kGreatestCommonDivisor] = result; - } - removeUpstream(upstream) { - const upstreamOrigin = parseOrigin(upstream).origin; - const pool = this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true); - if (pool) { - this[kRemoveClient](pool); - } - return this; - } - get upstreams() { - return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p) => p[kUrl].origin); - } - [kGetDispatcher]() { - if (this[kClients].length === 0) { - throw new BalancedPoolMissingUpstreamError(); - } - const dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain] && dispatcher2.closed !== true && dispatcher2.destroyed !== true); - if (!dispatcher) { - return; - } - const allClientsBusy = this[kClients].map((pool) => pool[kNeedDrain]).reduce((a, b) => a && b, true); - if (allClientsBusy) { - return; - } - let counter = 0; - let maxWeightIndex = this[kClients].findIndex((pool) => !pool[kNeedDrain]); - while (counter++ < this[kClients].length) { - this[kIndex] = (this[kIndex] + 1) % this[kClients].length; - const pool = this[kClients][this[kIndex]]; - if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { - maxWeightIndex = this[kIndex]; - } - if (this[kIndex] === 0) { - this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]; - if (this[kCurrentWeight] <= 0) { - this[kCurrentWeight] = this[kMaxWeightPerServer]; - } - } - if (pool[kWeight] >= this[kCurrentWeight] && !pool[kNeedDrain]) { - return pool; - } - } - this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]; - this[kIndex] = maxWeightIndex; - return this[kClients][maxWeightIndex]; - } - }; - module2.exports = BalancedPool; - } -}); - -// node_modules/undici/lib/dispatcher/agent.js -var require_agent = __commonJS({ - "node_modules/undici/lib/dispatcher/agent.js"(exports2, module2) { - "use strict"; - var { InvalidArgumentError } = require_errors(); - var { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); - var DispatcherBase = require_dispatcher_base(); - var Pool = require_pool(); - var Client = require_client(); - var util3 = require_util(); - var createRedirectInterceptor = require_redirect_interceptor(); - var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); - var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); - var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); - var kMaxRedirections = /* @__PURE__ */ Symbol("maxRedirections"); - var kOnDrain = /* @__PURE__ */ Symbol("onDrain"); - var kFactory = /* @__PURE__ */ Symbol("factory"); - var kOptions = /* @__PURE__ */ Symbol("options"); - function defaultFactory(origin, opts) { - return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); - } - var Agent = class extends DispatcherBase { - constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - if (typeof factory !== "function") { - throw new InvalidArgumentError("factory must be a function."); - } - if (connect != null && typeof connect !== "function" && typeof connect !== "object") { - throw new InvalidArgumentError("connect must be a function or an object"); - } - if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { - throw new InvalidArgumentError("maxRedirections must be a positive number"); - } - super(options); - if (connect && typeof connect !== "function") { - connect = { ...connect }; - } - this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; - this[kOptions] = { ...util3.deepClone(options), connect }; - this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; - this[kMaxRedirections] = maxRedirections; - this[kFactory] = factory; - this[kClients] = /* @__PURE__ */ new Map(); - this[kOnDrain] = (origin, targets) => { - this.emit("drain", origin, [this, ...targets]); - }; - this[kOnConnect] = (origin, targets) => { - this.emit("connect", origin, [this, ...targets]); - }; - this[kOnDisconnect] = (origin, targets, err) => { - this.emit("disconnect", origin, [this, ...targets], err); - }; - this[kOnConnectionError] = (origin, targets, err) => { - this.emit("connectionError", origin, [this, ...targets], err); - }; - } - get [kRunning]() { - let ret = 0; - for (const client of this[kClients].values()) { - ret += client[kRunning]; - } - return ret; - } - [kDispatch](opts, handler2) { - let key; - if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) { - key = String(opts.origin); - } else { - throw new InvalidArgumentError("opts.origin must be a non-empty string or URL."); - } - let dispatcher = this[kClients].get(key); - if (!dispatcher) { - dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); - this[kClients].set(key, dispatcher); - } - return dispatcher.dispatch(opts, handler2); - } - async [kClose]() { - const closePromises = []; - for (const client of this[kClients].values()) { - closePromises.push(client.close()); - } - this[kClients].clear(); - await Promise.all(closePromises); - } - async [kDestroy](err) { - const destroyPromises = []; - for (const client of this[kClients].values()) { - destroyPromises.push(client.destroy(err)); - } - this[kClients].clear(); - await Promise.all(destroyPromises); - } - }; - module2.exports = Agent; - } -}); - -// node_modules/undici/lib/dispatcher/proxy-agent.js -var require_proxy_agent = __commonJS({ - "node_modules/undici/lib/dispatcher/proxy-agent.js"(exports2, module2) { - "use strict"; - var { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); - var { URL: URL2 } = require("node:url"); - var Agent = require_agent(); - var Pool = require_pool(); - var DispatcherBase = require_dispatcher_base(); - var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors(); - var buildConnector = require_connect(); - var Client = require_client(); - var kAgent = /* @__PURE__ */ Symbol("proxy agent"); - var kClient = /* @__PURE__ */ Symbol("proxy client"); - var kProxyHeaders = /* @__PURE__ */ Symbol("proxy headers"); - var kRequestTls = /* @__PURE__ */ Symbol("request tls settings"); - var kProxyTls = /* @__PURE__ */ Symbol("proxy tls settings"); - var kConnectEndpoint = /* @__PURE__ */ Symbol("connect endpoint function"); - var kTunnelProxy = /* @__PURE__ */ Symbol("tunnel proxy"); - function defaultProtocolPort(protocol) { - return protocol === "https:" ? 443 : 80; - } - function defaultFactory(origin, opts) { - return new Pool(origin, opts); - } - var noop3 = () => { - }; - function defaultAgentFactory(origin, opts) { - if (opts.connections === 1) { - return new Client(origin, opts); - } - return new Pool(origin, opts); - } - var Http1ProxyWrapper = class extends DispatcherBase { - #client; - constructor(proxyUrl, { headers = {}, connect, factory }) { - super(); - if (!proxyUrl) { - throw new InvalidArgumentError("Proxy URL is mandatory"); - } - this[kProxyHeaders] = headers; - if (factory) { - this.#client = factory(proxyUrl, { connect }); - } else { - this.#client = new Client(proxyUrl, { connect }); - } - } - [kDispatch](opts, handler2) { - const onHeaders = handler2.onHeaders; - handler2.onHeaders = function(statusCode, data, resume) { - if (statusCode === 407) { - if (typeof handler2.onError === "function") { - handler2.onError(new InvalidArgumentError("Proxy Authentication Required (407)")); - } - return; - } - if (onHeaders) onHeaders.call(this, statusCode, data, resume); - }; - const { - origin, - path: path30 = "/", - headers = {} - } = opts; - opts.path = origin + path30; - if (!("host" in headers) && !("Host" in headers)) { - const { host } = new URL2(origin); - headers.host = host; - } - opts.headers = { ...this[kProxyHeaders], ...headers }; - return this.#client[kDispatch](opts, handler2); - } - async [kClose]() { - return this.#client.close(); - } - async [kDestroy](err) { - return this.#client.destroy(err); - } - }; - var ProxyAgent2 = class extends DispatcherBase { - constructor(opts) { - super(); - if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) { - throw new InvalidArgumentError("Proxy uri is mandatory"); - } - const { clientFactory = defaultFactory } = opts; - if (typeof clientFactory !== "function") { - throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); - } - const { proxyTunnel = true } = opts; - const url2 = this.#getUrl(opts); - const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url2; - this[kProxy] = { uri: href, protocol }; - this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : []; - this[kRequestTls] = opts.requestTls; - this[kProxyTls] = opts.proxyTls; - this[kProxyHeaders] = opts.headers || {}; - this[kTunnelProxy] = proxyTunnel; - if (opts.auth && opts.token) { - throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token"); - } else if (opts.auth) { - this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`; - } else if (opts.token) { - this[kProxyHeaders]["proxy-authorization"] = opts.token; - } else if (username && password) { - this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString("base64")}`; - } - const connect = buildConnector({ ...opts.proxyTls }); - this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }); - const agentFactory = opts.factory || defaultAgentFactory; - const factory = (origin2, options) => { - const { protocol: protocol2 } = new URL2(origin2); - if (!this[kTunnelProxy] && protocol2 === "http:" && this[kProxy].protocol === "http:") { - return new Http1ProxyWrapper(this[kProxy].uri, { - headers: this[kProxyHeaders], - connect, - factory: agentFactory - }); - } - return agentFactory(origin2, options); - }; - this[kClient] = clientFactory(url2, { connect }); - this[kAgent] = new Agent({ - ...opts, - factory, - connect: async (opts2, callback) => { - let requestedPath = opts2.host; - if (!opts2.port) { - requestedPath += `:${defaultProtocolPort(opts2.protocol)}`; - } - try { - const { socket, statusCode } = await this[kClient].connect({ - origin, - port, - path: requestedPath, - signal: opts2.signal, - headers: { - ...this[kProxyHeaders], - host: opts2.host - }, - servername: this[kProxyTls]?.servername || proxyHostname - }); - if (statusCode !== 200) { - socket.on("error", noop3).destroy(); - callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)); - } - if (opts2.protocol !== "https:") { - callback(null, socket); - return; - } - let servername; - if (this[kRequestTls]) { - servername = this[kRequestTls].servername; - } else { - servername = opts2.servername; - } - this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); - } catch (err) { - if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - callback(new SecureProxyConnectionError(err)); - } else { - callback(err); - } - } - } - }); - } - dispatch(opts, handler2) { - const headers = buildHeaders(opts.headers); - throwIfProxyAuthIsSent(headers); - if (headers && !("host" in headers) && !("Host" in headers)) { - const { host } = new URL2(opts.origin); - headers.host = host; - } - return this[kAgent].dispatch( - { - ...opts, - headers - }, - handler2 - ); - } - /** - * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts - * @returns {URL} - */ - #getUrl(opts) { - if (typeof opts === "string") { - return new URL2(opts); - } else if (opts instanceof URL2) { - return opts; - } else { - return new URL2(opts.uri); - } - } - async [kClose]() { - await this[kAgent].close(); - await this[kClient].close(); - } - async [kDestroy]() { - await this[kAgent].destroy(); - await this[kClient].destroy(); - } - }; - function buildHeaders(headers) { - if (Array.isArray(headers)) { - const headersPair = {}; - for (let i = 0; i < headers.length; i += 2) { - headersPair[headers[i]] = headers[i + 1]; - } - return headersPair; - } - return headers; - } - function throwIfProxyAuthIsSent(headers) { - const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization"); - if (existProxyAuth) { - throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); - } - } - module2.exports = ProxyAgent2; - } -}); - -// node_modules/undici/lib/dispatcher/env-http-proxy-agent.js -var require_env_http_proxy_agent = __commonJS({ - "node_modules/undici/lib/dispatcher/env-http-proxy-agent.js"(exports2, module2) { - "use strict"; - var DispatcherBase = require_dispatcher_base(); - var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols(); - var ProxyAgent2 = require_proxy_agent(); - var Agent = require_agent(); - var DEFAULT_PORTS = { - "http:": 80, - "https:": 443 - }; - var experimentalWarned = false; - var EnvHttpProxyAgent = class extends DispatcherBase { - #noProxyValue = null; - #noProxyEntries = null; - #opts = null; - constructor(opts = {}) { - super(); - this.#opts = opts; - if (!experimentalWarned) { - experimentalWarned = true; - process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.", { - code: "UNDICI-EHPA" - }); - } - const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts; - this[kNoProxyAgent] = new Agent(agentOpts); - const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; - if (HTTP_PROXY) { - this[kHttpProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTP_PROXY }); - } else { - this[kHttpProxyAgent] = this[kNoProxyAgent]; - } - const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; - if (HTTPS_PROXY) { - this[kHttpsProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTPS_PROXY }); - } else { - this[kHttpsProxyAgent] = this[kHttpProxyAgent]; - } - this.#parseNoProxy(); - } - [kDispatch](opts, handler2) { - const url2 = new URL(opts.origin); - const agent = this.#getProxyAgentForUrl(url2); - return agent.dispatch(opts, handler2); - } - async [kClose]() { - await this[kNoProxyAgent].close(); - if (!this[kHttpProxyAgent][kClosed]) { - await this[kHttpProxyAgent].close(); - } - if (!this[kHttpsProxyAgent][kClosed]) { - await this[kHttpsProxyAgent].close(); - } - } - async [kDestroy](err) { - await this[kNoProxyAgent].destroy(err); - if (!this[kHttpProxyAgent][kDestroyed]) { - await this[kHttpProxyAgent].destroy(err); - } - if (!this[kHttpsProxyAgent][kDestroyed]) { - await this[kHttpsProxyAgent].destroy(err); - } - } - #getProxyAgentForUrl(url2) { - let { protocol, host: hostname, port } = url2; - hostname = hostname.replace(/:\d*$/, "").toLowerCase(); - port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0; - if (!this.#shouldProxy(hostname, port)) { - return this[kNoProxyAgent]; - } - if (protocol === "https:") { - return this[kHttpsProxyAgent]; - } - return this[kHttpProxyAgent]; - } - #shouldProxy(hostname, port) { - if (this.#noProxyChanged) { - this.#parseNoProxy(); - } - if (this.#noProxyEntries.length === 0) { - return true; - } - if (this.#noProxyValue === "*") { - return false; - } - for (let i = 0; i < this.#noProxyEntries.length; i++) { - const entry = this.#noProxyEntries[i]; - if (entry.port && entry.port !== port) { - continue; - } - if (!/^[.*]/.test(entry.hostname)) { - if (hostname === entry.hostname) { - return false; - } - } else { - if (hostname.endsWith(entry.hostname.replace(/^\*/, ""))) { - return false; - } - } - } - return true; - } - #parseNoProxy() { - const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv; - const noProxySplit = noProxyValue.split(/[,\s]/); - const noProxyEntries = []; - for (let i = 0; i < noProxySplit.length; i++) { - const entry = noProxySplit[i]; - if (!entry) { - continue; - } - const parsed = entry.match(/^(.+):(\d+)$/); - noProxyEntries.push({ - hostname: (parsed ? parsed[1] : entry).toLowerCase(), - port: parsed ? Number.parseInt(parsed[2], 10) : 0 - }); - } - this.#noProxyValue = noProxyValue; - this.#noProxyEntries = noProxyEntries; - } - get #noProxyChanged() { - if (this.#opts.noProxy !== void 0) { - return false; - } - return this.#noProxyValue !== this.#noProxyEnv; - } - get #noProxyEnv() { - return process.env.no_proxy ?? process.env.NO_PROXY ?? ""; - } - }; - module2.exports = EnvHttpProxyAgent; - } -}); - -// node_modules/undici/lib/handler/retry-handler.js -var require_retry_handler = __commonJS({ - "node_modules/undici/lib/handler/retry-handler.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var { kRetryHandlerDefaultRetry } = require_symbols(); - var { RequestRetryError } = require_errors(); - var { - isDisturbed, - parseHeaders, - parseRangeHeader, - wrapRequestBody - } = require_util(); - function calculateRetryAfterHeader(retryAfter) { - const current = Date.now(); - return new Date(retryAfter).getTime() - current; - } - function validatePartialResponseContentLength(headers, range2, statusCode, retryCount) { - const contentLength = headers["content-length"]; - if (contentLength == null) { - return null; - } - if (!Number.isFinite(range2.start) || !Number.isFinite(range2.end)) { - return null; - } - const length = Number(contentLength); - const expectedLength = range2.end - range2.start + 1; - if (!Number.isFinite(length) || length !== expectedLength) { - return new RequestRetryError("Content-Length mismatch", statusCode, { - headers, - data: { count: retryCount } - }); - } - return null; - } - var RetryHandler = class _RetryHandler { - constructor(opts, handlers) { - const { retryOptions, ...dispatchOpts } = opts; - const { - // Retry scoped - retry: retryFn, - maxRetries, - maxTimeout, - minTimeout, - timeoutFactor, - // Response scoped - methods, - errorCodes, - retryAfter, - statusCodes - } = retryOptions ?? {}; - this.dispatch = handlers.dispatch; - this.handler = handlers.handler; - this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }; - this.abort = null; - this.aborted = false; - this.retryOpts = { - retry: retryFn ?? _RetryHandler[kRetryHandlerDefaultRetry], - retryAfter: retryAfter ?? true, - maxTimeout: maxTimeout ?? 30 * 1e3, - // 30s, - minTimeout: minTimeout ?? 500, - // .5s - timeoutFactor: timeoutFactor ?? 2, - maxRetries: maxRetries ?? 5, - // What errors we should retry - methods: methods ?? ["GET", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"], - // Indicates which errors to retry - statusCodes: statusCodes ?? [500, 502, 503, 504, 429], - // List of errors to retry - errorCodes: errorCodes ?? [ - "ECONNRESET", - "ECONNREFUSED", - "ENOTFOUND", - "ENETDOWN", - "ENETUNREACH", - "EHOSTDOWN", - "EHOSTUNREACH", - "EPIPE", - "UND_ERR_SOCKET" - ] - }; - this.retryCount = 0; - this.retryCountCheckpoint = 0; - this.start = 0; - this.end = null; - this.etag = null; - this.resume = null; - this.handler.onConnect((reason) => { - this.aborted = true; - if (this.abort) { - this.abort(reason); - } else { - this.reason = reason; - } - }); - } - onRequestSent() { - if (this.handler.onRequestSent) { - this.handler.onRequestSent(); - } - } - onUpgrade(statusCode, headers, socket) { - if (this.handler.onUpgrade) { - this.handler.onUpgrade(statusCode, headers, socket); - } - } - onConnect(abort) { - if (this.aborted) { - abort(this.reason); - } else { - this.abort = abort; - } - } - onBodySent(chunk) { - if (this.handler.onBodySent) return this.handler.onBodySent(chunk); - } - static [kRetryHandlerDefaultRetry](err, { state, opts }, cb) { - const { statusCode, code, headers } = err; - const { method, retryOptions } = opts; - const { - maxRetries, - minTimeout, - maxTimeout, - timeoutFactor, - statusCodes, - errorCodes, - methods - } = retryOptions; - const { counter } = state; - if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code)) { - cb(err); - return; - } - if (Array.isArray(methods) && !methods.includes(method)) { - cb(err); - return; - } - if (statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode)) { - cb(err); - return; - } - if (counter > maxRetries) { - cb(err); - return; - } - let retryAfterHeader = headers?.["retry-after"]; - if (retryAfterHeader) { - retryAfterHeader = Number(retryAfterHeader); - retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3; - } - const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout); - setTimeout(() => cb(null), retryTimeout); - } - onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const headers = parseHeaders(rawHeaders); - this.retryCount += 1; - if (statusCode >= 300) { - if (this.retryOpts.statusCodes.includes(statusCode) === false) { - return this.handler.onHeaders( - statusCode, - rawHeaders, - resume, - statusMessage - ); - } else { - this.abort( - new RequestRetryError("Request failed", statusCode, { - headers, - data: { - count: this.retryCount - } - }) - ); - return false; - } - } - if (this.resume != null) { - this.resume = null; - if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) { - this.abort( - new RequestRetryError("server does not support the range header and the payload was partially consumed", statusCode, { - headers, - data: { count: this.retryCount } - }) - ); - return false; - } - const contentRange = parseRangeHeader(headers["content-range"]); - if (!contentRange) { - this.abort( - new RequestRetryError("Content-Range mismatch", statusCode, { - headers, - data: { count: this.retryCount } - }) - ); - return false; - } - if (this.etag != null && this.etag !== headers.etag) { - this.abort( - new RequestRetryError("ETag mismatch", statusCode, { - headers, - data: { count: this.retryCount } - }) - ); - return false; - } - const contentLengthError = validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount); - if (contentLengthError != null) { - this.abort(contentLengthError); - return false; - } - const { start, size, end = size - 1 } = contentRange; - assert(this.start === start, "content-range mismatch"); - assert(this.end == null || this.end === end, "content-range mismatch"); - this.resume = resume; - return true; - } - if (this.end == null) { - if (statusCode === 206) { - const range2 = parseRangeHeader(headers["content-range"]); - if (range2 == null) { - return this.handler.onHeaders( - statusCode, - rawHeaders, - resume, - statusMessage - ); - } - const contentLengthError = validatePartialResponseContentLength(headers, range2, statusCode, this.retryCount); - if (contentLengthError != null) { - this.abort(contentLengthError); - return false; - } - const { start, size, end = size - 1 } = range2; - assert( - start != null && Number.isFinite(start), - "content-range mismatch" - ); - assert(end != null && Number.isFinite(end), "invalid content-length"); - this.start = start; - this.end = end; - } - if (this.end == null) { - const contentLength = headers["content-length"]; - this.end = contentLength != null ? Number(contentLength) - 1 : null; - } - assert(Number.isFinite(this.start)); - assert( - this.end == null || Number.isFinite(this.end), - "invalid content-length" - ); - this.resume = resume; - this.etag = headers.etag != null ? headers.etag : null; - if (this.etag != null && this.etag.startsWith("W/")) { - this.etag = null; - } - return this.handler.onHeaders( - statusCode, - rawHeaders, - resume, - statusMessage - ); - } - const err = new RequestRetryError("Request failed", statusCode, { - headers, - data: { count: this.retryCount } - }); - this.abort(err); - return false; - } - onData(chunk) { - this.start += chunk.length; - return this.handler.onData(chunk); - } - onComplete(rawTrailers) { - this.retryCount = 0; - return this.handler.onComplete(rawTrailers); - } - onError(err) { - if (this.aborted || isDisturbed(this.opts.body)) { - return this.handler.onError(err); - } - if (this.retryCount - this.retryCountCheckpoint > 0) { - this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint); - } else { - this.retryCount += 1; - } - this.retryOpts.retry( - err, - { - state: { counter: this.retryCount }, - opts: { retryOptions: this.retryOpts, ...this.opts } - }, - onRetry.bind(this) - ); - function onRetry(err2) { - if (err2 != null || this.aborted || isDisturbed(this.opts.body)) { - return this.handler.onError(err2); - } - if (this.start !== 0) { - const headers = { range: `bytes=${this.start}-${this.end ?? ""}` }; - if (this.etag != null) { - headers["if-match"] = this.etag; - } - this.opts = { - ...this.opts, - headers: { - ...this.opts.headers, - ...headers - } - }; - } - try { - this.retryCountCheckpoint = this.retryCount; - this.dispatch(this.opts, this); - } catch (err3) { - this.handler.onError(err3); - } - } - } - }; - module2.exports = RetryHandler; - } -}); - -// node_modules/undici/lib/dispatcher/retry-agent.js -var require_retry_agent = __commonJS({ - "node_modules/undici/lib/dispatcher/retry-agent.js"(exports2, module2) { - "use strict"; - var Dispatcher = require_dispatcher(); - var RetryHandler = require_retry_handler(); - var RetryAgent = class extends Dispatcher { - #agent = null; - #options = null; - constructor(agent, options = {}) { - super(options); - this.#agent = agent; - this.#options = options; - } - dispatch(opts, handler2) { - const retry2 = new RetryHandler({ - ...opts, - retryOptions: this.#options - }, { - dispatch: this.#agent.dispatch.bind(this.#agent), - handler: handler2 - }); - return this.#agent.dispatch(opts, retry2); - } - close() { - return this.#agent.close(); - } - destroy() { - return this.#agent.destroy(); - } - }; - module2.exports = RetryAgent; - } -}); - -// node_modules/undici/lib/api/readable.js -var require_readable = __commonJS({ - "node_modules/undici/lib/api/readable.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var { Readable: Readable3 } = require("node:stream"); - var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors(); - var util3 = require_util(); - var { ReadableStreamFrom } = require_util(); - var kConsume = /* @__PURE__ */ Symbol("kConsume"); - var kReading = /* @__PURE__ */ Symbol("kReading"); - var kBody = /* @__PURE__ */ Symbol("kBody"); - var kAbort = /* @__PURE__ */ Symbol("kAbort"); - var kContentType = /* @__PURE__ */ Symbol("kContentType"); - var kContentLength = /* @__PURE__ */ Symbol("kContentLength"); - var noop3 = () => { - }; - var BodyReadable = class extends Readable3 { - constructor({ - resume, - abort, - contentType = "", - contentLength, - highWaterMark = 64 * 1024 - // Same as nodejs fs streams. - }) { - super({ - autoDestroy: true, - read: resume, - highWaterMark - }); - this._readableState.dataEmitted = false; - this[kAbort] = abort; - this[kConsume] = null; - this[kBody] = null; - this[kContentType] = contentType; - this[kContentLength] = contentLength; - this[kReading] = false; - } - destroy(err) { - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError(); - } - if (err) { - this[kAbort](); - } - return super.destroy(err); - } - _destroy(err, callback) { - if (!this[kReading]) { - setImmediate(() => { - callback(err); - }); - } else { - callback(err); - } - } - on(ev, ...args) { - if (ev === "data" || ev === "readable") { - this[kReading] = true; - } - return super.on(ev, ...args); - } - addListener(ev, ...args) { - return this.on(ev, ...args); - } - off(ev, ...args) { - const ret = super.off(ev, ...args); - if (ev === "data" || ev === "readable") { - this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0; - } - return ret; - } - removeListener(ev, ...args) { - return this.off(ev, ...args); - } - push(chunk) { - if (this[kConsume] && chunk !== null) { - consumePush(this[kConsume], chunk); - return this[kReading] ? super.push(chunk) : true; - } - return super.push(chunk); - } - // https://fetch.spec.whatwg.org/#dom-body-text - async text() { - return consume(this, "text"); - } - // https://fetch.spec.whatwg.org/#dom-body-json - async json() { - return consume(this, "json"); - } - // https://fetch.spec.whatwg.org/#dom-body-blob - async blob() { - return consume(this, "blob"); - } - // https://fetch.spec.whatwg.org/#dom-body-bytes - async bytes() { - return consume(this, "bytes"); - } - // https://fetch.spec.whatwg.org/#dom-body-arraybuffer - async arrayBuffer() { - return consume(this, "arrayBuffer"); - } - // https://fetch.spec.whatwg.org/#dom-body-formdata - async formData() { - throw new NotSupportedError(); - } - // https://fetch.spec.whatwg.org/#dom-body-bodyused - get bodyUsed() { - return util3.isDisturbed(this); - } - // https://fetch.spec.whatwg.org/#dom-body-body - get body() { - if (!this[kBody]) { - this[kBody] = ReadableStreamFrom(this); - if (this[kConsume]) { - this[kBody].getReader(); - assert(this[kBody].locked); - } - } - return this[kBody]; - } - async dump(opts) { - let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024; - const signal = opts?.signal; - if (signal != null && (typeof signal !== "object" || !("aborted" in signal))) { - throw new InvalidArgumentError("signal must be an AbortSignal"); - } - signal?.throwIfAborted(); - if (this._readableState.closeEmitted) { - return null; - } - return await new Promise((resolve14, reject) => { - if (this[kContentLength] > limit) { - this.destroy(new AbortError()); - } - const onAbort = () => { - this.destroy(signal.reason ?? new AbortError()); - }; - signal?.addEventListener("abort", onAbort); - this.on("close", function() { - signal?.removeEventListener("abort", onAbort); - if (signal?.aborted) { - reject(signal.reason ?? new AbortError()); - } else { - resolve14(null); - } - }).on("error", noop3).on("data", function(chunk) { - limit -= chunk.length; - if (limit <= 0) { - this.destroy(); - } - }).resume(); - }); - } - }; - function isLocked(self2) { - return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; - } - function isUnusable(self2) { - return util3.isDisturbed(self2) || isLocked(self2); - } - async function consume(stream2, type) { - assert(!stream2[kConsume]); - return new Promise((resolve14, reject) => { - if (isUnusable(stream2)) { - const rState = stream2._readableState; - if (rState.destroyed && rState.closeEmitted === false) { - stream2.on("error", (err) => { - reject(err); - }).on("close", () => { - reject(new TypeError("unusable")); - }); - } else { - reject(rState.errored ?? new TypeError("unusable")); - } - } else { - queueMicrotask(() => { - stream2[kConsume] = { - type, - stream: stream2, - resolve: resolve14, - reject, - length: 0, - body: [] - }; - stream2.on("error", function(err) { - consumeFinish(this[kConsume], err); - }).on("close", function() { - if (this[kConsume].body !== null) { - consumeFinish(this[kConsume], new RequestAbortedError()); - } - }); - consumeStart(stream2[kConsume]); - }); - } - }); - } - function consumeStart(consume2) { - if (consume2.body === null) { - return; - } - const { _readableState: state } = consume2.stream; - if (state.bufferIndex) { - const start = state.bufferIndex; - const end = state.buffer.length; - for (let n = start; n < end; n++) { - consumePush(consume2, state.buffer[n]); - } - } else { - for (const chunk of state.buffer) { - consumePush(consume2, chunk); - } - } - if (state.endEmitted) { - consumeEnd(this[kConsume]); - } else { - consume2.stream.on("end", function() { - consumeEnd(this[kConsume]); - }); - } - consume2.stream.resume(); - while (consume2.stream.read() != null) { - } - } - function chunksDecode(chunks, length) { - if (chunks.length === 0 || length === 0) { - return ""; - } - const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length); - const bufferLength = buffer.length; - const start = bufferLength > 2 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191 ? 3 : 0; - return buffer.utf8Slice(start, bufferLength); - } - function chunksConcat(chunks, length) { - if (chunks.length === 0 || length === 0) { - return new Uint8Array(0); - } - if (chunks.length === 1) { - return new Uint8Array(chunks[0]); - } - const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer); - let offset = 0; - for (let i = 0; i < chunks.length; ++i) { - const chunk = chunks[i]; - buffer.set(chunk, offset); - offset += chunk.length; - } - return buffer; - } - function consumeEnd(consume2) { - const { type, body, resolve: resolve14, stream: stream2, length } = consume2; - try { - if (type === "text") { - resolve14(chunksDecode(body, length)); - } else if (type === "json") { - resolve14(JSON.parse(chunksDecode(body, length))); - } else if (type === "arrayBuffer") { - resolve14(chunksConcat(body, length).buffer); - } else if (type === "blob") { - resolve14(new Blob(body, { type: stream2[kContentType] })); - } else if (type === "bytes") { - resolve14(chunksConcat(body, length)); - } - consumeFinish(consume2); - } catch (err) { - stream2.destroy(err); - } - } - function consumePush(consume2, chunk) { - consume2.length += chunk.length; - consume2.body.push(chunk); - } - function consumeFinish(consume2, err) { - if (consume2.body === null) { - return; - } - if (err) { - consume2.reject(err); - } else { - consume2.resolve(); - } - consume2.type = null; - consume2.stream = null; - consume2.resolve = null; - consume2.reject = null; - consume2.length = 0; - consume2.body = null; - } - module2.exports = { Readable: BodyReadable, chunksDecode }; - } -}); - -// node_modules/undici/lib/api/util.js -var require_util3 = __commonJS({ - "node_modules/undici/lib/api/util.js"(exports2, module2) { - var assert = require("node:assert"); - var { - ResponseStatusCodeError - } = require_errors(); - var { chunksDecode } = require_readable(); - var CHUNK_LIMIT = 128 * 1024; - async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { - assert(body); - let chunks = []; - let length = 0; - try { - for await (const chunk of body) { - chunks.push(chunk); - length += chunk.length; - if (length > CHUNK_LIMIT) { - chunks = []; - length = 0; - break; - } - } - } catch { - chunks = []; - length = 0; - } - const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`; - if (statusCode === 204 || !contentType || !length) { - queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))); - return; - } - const stackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - let payload; - try { - if (isContentTypeApplicationJson(contentType)) { - payload = JSON.parse(chunksDecode(chunks, length)); - } else if (isContentTypeText(contentType)) { - payload = chunksDecode(chunks, length); - } - } catch { - } finally { - Error.stackTraceLimit = stackTraceLimit; - } - queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload))); - } - var isContentTypeApplicationJson = (contentType) => { - return contentType.length > 15 && contentType[11] === "/" && contentType[0] === "a" && contentType[1] === "p" && contentType[2] === "p" && contentType[3] === "l" && contentType[4] === "i" && contentType[5] === "c" && contentType[6] === "a" && contentType[7] === "t" && contentType[8] === "i" && contentType[9] === "o" && contentType[10] === "n" && contentType[12] === "j" && contentType[13] === "s" && contentType[14] === "o" && contentType[15] === "n"; - }; - var isContentTypeText = (contentType) => { - return contentType.length > 4 && contentType[4] === "/" && contentType[0] === "t" && contentType[1] === "e" && contentType[2] === "x" && contentType[3] === "t"; - }; - module2.exports = { - getResolveErrorBodyCallback, - isContentTypeApplicationJson, - isContentTypeText - }; - } -}); - -// node_modules/undici/lib/api/api-request.js -var require_api_request = __commonJS({ - "node_modules/undici/lib/api/api-request.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var { Readable: Readable3 } = require_readable(); - var { InvalidArgumentError, RequestAbortedError } = require_errors(); - var util3 = require_util(); - var { getResolveErrorBodyCallback } = require_util3(); - var { AsyncResource } = require("node:async_hooks"); - var RequestHandler = class extends AsyncResource { - constructor(opts, callback) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts; - try { - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) { - throw new InvalidArgumentError("invalid highWaterMark"); - } - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - if (method === "CONNECT") { - throw new InvalidArgumentError("invalid method"); - } - if (onInfo && typeof onInfo !== "function") { - throw new InvalidArgumentError("invalid onInfo callback"); - } - super("UNDICI_REQUEST"); - } catch (err) { - if (util3.isStream(body)) { - util3.destroy(body.on("error", util3.nop), err); - } - throw err; - } - this.method = method; - this.responseHeaders = responseHeaders || null; - this.opaque = opaque || null; - this.callback = callback; - this.res = null; - this.abort = null; - this.body = body; - this.trailers = {}; - this.context = null; - this.onInfo = onInfo || null; - this.throwOnError = throwOnError; - this.highWaterMark = highWaterMark; - this.signal = signal; - this.reason = null; - this.removeAbortListener = null; - if (util3.isStream(body)) { - body.on("error", (err) => { - this.onError(err); - }); - } - if (this.signal) { - if (this.signal.aborted) { - this.reason = this.signal.reason ?? new RequestAbortedError(); - } else { - this.removeAbortListener = util3.addAbortListener(this.signal, () => { - this.reason = this.signal.reason ?? new RequestAbortedError(); - if (this.res) { - util3.destroy(this.res.on("error", util3.nop), this.reason); - } else if (this.abort) { - this.abort(this.reason); - } - if (this.removeAbortListener) { - this.res?.off("close", this.removeAbortListener); - this.removeAbortListener(); - this.removeAbortListener = null; - } - }); - } - } - } - onConnect(abort, context5) { - if (this.reason) { - abort(this.reason); - return; - } - assert(this.callback); - this.abort = abort; - this.context = context5; - } - onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context5, responseHeaders, highWaterMark } = this; - const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); - if (statusCode < 200) { - if (this.onInfo) { - this.onInfo({ statusCode, headers }); - } - return; - } - const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; - const contentType = parsedHeaders["content-type"]; - const contentLength = parsedHeaders["content-length"]; - const res = new Readable3({ - resume, - abort, - contentType, - contentLength: this.method !== "HEAD" && contentLength ? Number(contentLength) : null, - highWaterMark - }); - if (this.removeAbortListener) { - res.on("close", this.removeAbortListener); - } - this.callback = null; - this.res = res; - if (callback !== null) { - if (this.throwOnError && statusCode >= 400) { - this.runInAsyncScope( - getResolveErrorBodyCallback, - null, - { callback, body: res, contentType, statusCode, statusMessage, headers } - ); - } else { - this.runInAsyncScope(callback, null, null, { - statusCode, - headers, - trailers: this.trailers, - opaque, - body: res, - context: context5 - }); - } - } - } - onData(chunk) { - return this.res.push(chunk); - } - onComplete(trailers) { - util3.parseHeaders(trailers, this.trailers); - this.res.push(null); - } - onError(err) { - const { res, callback, body, opaque } = this; - if (callback) { - this.callback = null; - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); - }); - } - if (res) { - this.res = null; - queueMicrotask(() => { - util3.destroy(res, err); - }); - } - if (body) { - this.body = null; - util3.destroy(body, err); - } - if (this.removeAbortListener) { - res?.off("close", this.removeAbortListener); - this.removeAbortListener(); - this.removeAbortListener = null; - } - } - }; - function request3(opts, callback) { - if (callback === void 0) { - return new Promise((resolve14, reject) => { - request3.call(this, opts, (err, data) => { - return err ? reject(err) : resolve14(data); - }); - }); - } - try { - this.dispatch(opts, new RequestHandler(opts, callback)); - } catch (err) { - if (typeof callback !== "function") { - throw err; - } - const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); - } - } - module2.exports = request3; - module2.exports.RequestHandler = RequestHandler; - } -}); - -// node_modules/undici/lib/api/abort-signal.js -var require_abort_signal = __commonJS({ - "node_modules/undici/lib/api/abort-signal.js"(exports2, module2) { - var { addAbortListener } = require_util(); - var { RequestAbortedError } = require_errors(); - var kListener = /* @__PURE__ */ Symbol("kListener"); - var kSignal = /* @__PURE__ */ Symbol("kSignal"); - function abort(self2) { - if (self2.abort) { - self2.abort(self2[kSignal]?.reason); - } else { - self2.reason = self2[kSignal]?.reason ?? new RequestAbortedError(); - } - removeSignal(self2); - } - function addSignal(self2, signal) { - self2.reason = null; - self2[kSignal] = null; - self2[kListener] = null; - if (!signal) { - return; - } - if (signal.aborted) { - abort(self2); - return; - } - self2[kSignal] = signal; - self2[kListener] = () => { - abort(self2); - }; - addAbortListener(self2[kSignal], self2[kListener]); - } - function removeSignal(self2) { - if (!self2[kSignal]) { - return; - } - if ("removeEventListener" in self2[kSignal]) { - self2[kSignal].removeEventListener("abort", self2[kListener]); - } else { - self2[kSignal].removeListener("abort", self2[kListener]); - } - self2[kSignal] = null; - self2[kListener] = null; - } - module2.exports = { - addSignal, - removeSignal - }; - } -}); - -// node_modules/undici/lib/api/api-stream.js -var require_api_stream = __commonJS({ - "node_modules/undici/lib/api/api-stream.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var { finished, PassThrough: PassThrough3 } = require("node:stream"); - var { InvalidArgumentError, InvalidReturnValueError } = require_errors(); - var util3 = require_util(); - var { getResolveErrorBodyCallback } = require_util3(); - var { AsyncResource } = require("node:async_hooks"); - var { addSignal, removeSignal } = require_abort_signal(); - var StreamHandler = class extends AsyncResource { - constructor(opts, factory, callback) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts; - try { - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - if (typeof factory !== "function") { - throw new InvalidArgumentError("invalid factory"); - } - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - if (method === "CONNECT") { - throw new InvalidArgumentError("invalid method"); - } - if (onInfo && typeof onInfo !== "function") { - throw new InvalidArgumentError("invalid onInfo callback"); - } - super("UNDICI_STREAM"); - } catch (err) { - if (util3.isStream(body)) { - util3.destroy(body.on("error", util3.nop), err); - } - throw err; - } - this.responseHeaders = responseHeaders || null; - this.opaque = opaque || null; - this.factory = factory; - this.callback = callback; - this.res = null; - this.abort = null; - this.context = null; - this.trailers = null; - this.body = body; - this.onInfo = onInfo || null; - this.throwOnError = throwOnError || false; - if (util3.isStream(body)) { - body.on("error", (err) => { - this.onError(err); - }); - } - addSignal(this, signal); - } - onConnect(abort, context5) { - if (this.reason) { - abort(this.reason); - return; - } - assert(this.callback); - this.abort = abort; - this.context = context5; - } - onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context5, callback, responseHeaders } = this; - const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); - if (statusCode < 200) { - if (this.onInfo) { - this.onInfo({ statusCode, headers }); - } - return; - } - this.factory = null; - let res; - if (this.throwOnError && statusCode >= 400) { - const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; - const contentType = parsedHeaders["content-type"]; - res = new PassThrough3(); - this.callback = null; - this.runInAsyncScope( - getResolveErrorBodyCallback, - null, - { callback, body: res, contentType, statusCode, statusMessage, headers } - ); - } else { - if (factory === null) { - return; - } - res = this.runInAsyncScope(factory, null, { - statusCode, - headers, - opaque, - context: context5 - }); - if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { - throw new InvalidReturnValueError("expected Writable"); - } - finished(res, { readable: false }, (err) => { - const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; - this.res = null; - if (err || !res2.readable) { - util3.destroy(res2, err); - } - this.callback = null; - this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); - if (err) { - abort(); - } - }); - } - res.on("drain", resume); - this.res = res; - const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState?.needDrain; - return needDrain !== true; - } - onData(chunk) { - const { res } = this; - return res ? res.write(chunk) : true; - } - onComplete(trailers) { - const { res } = this; - removeSignal(this); - if (!res) { - return; - } - this.trailers = util3.parseHeaders(trailers); - res.end(); - } - onError(err) { - const { res, callback, opaque, body } = this; - removeSignal(this); - this.factory = null; - if (res) { - this.res = null; - util3.destroy(res, err); - } else if (callback) { - this.callback = null; - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); - }); - } - if (body) { - this.body = null; - util3.destroy(body, err); - } - } - }; - function stream2(opts, factory, callback) { - if (callback === void 0) { - return new Promise((resolve14, reject) => { - stream2.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve14(data); - }); - }); - } - try { - this.dispatch(opts, new StreamHandler(opts, factory, callback)); - } catch (err) { - if (typeof callback !== "function") { - throw err; - } - const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); - } - } - module2.exports = stream2; - } -}); - -// node_modules/undici/lib/api/api-pipeline.js -var require_api_pipeline = __commonJS({ - "node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { - "use strict"; - var { - Readable: Readable3, - Duplex, - PassThrough: PassThrough3 - } = require("node:stream"); - var { - InvalidArgumentError, - InvalidReturnValueError, - RequestAbortedError - } = require_errors(); - var util3 = require_util(); - var { AsyncResource } = require("node:async_hooks"); - var { addSignal, removeSignal } = require_abort_signal(); - var assert = require("node:assert"); - var kResume = /* @__PURE__ */ Symbol("resume"); - var PipelineRequest = class extends Readable3 { - constructor() { - super({ autoDestroy: true }); - this[kResume] = null; - } - _read() { - const { [kResume]: resume } = this; - if (resume) { - this[kResume] = null; - resume(); - } - } - _destroy(err, callback) { - this._read(); - callback(err); - } - }; - var PipelineResponse = class extends Readable3 { - constructor(resume) { - super({ autoDestroy: true }); - this[kResume] = resume; - } - _read() { - this[kResume](); - } - _destroy(err, callback) { - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError(); - } - callback(err); - } - }; - var PipelineHandler = class extends AsyncResource { - constructor(opts, handler2) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - if (typeof handler2 !== "function") { - throw new InvalidArgumentError("invalid handler"); - } - const { signal, method, opaque, onInfo, responseHeaders } = opts; - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - if (method === "CONNECT") { - throw new InvalidArgumentError("invalid method"); - } - if (onInfo && typeof onInfo !== "function") { - throw new InvalidArgumentError("invalid onInfo callback"); - } - super("UNDICI_PIPELINE"); - this.opaque = opaque || null; - this.responseHeaders = responseHeaders || null; - this.handler = handler2; - this.abort = null; - this.context = null; - this.onInfo = onInfo || null; - this.req = new PipelineRequest().on("error", util3.nop); - this.ret = new Duplex({ - readableObjectMode: opts.objectMode, - autoDestroy: true, - read: () => { - const { body } = this; - if (body?.resume) { - body.resume(); - } - }, - write: (chunk, encoding, callback) => { - const { req } = this; - if (req.push(chunk, encoding) || req._readableState.destroyed) { - callback(); - } else { - req[kResume] = callback; - } - }, - destroy: (err, callback) => { - const { body, req, res, ret, abort } = this; - if (!err && !ret._readableState.endEmitted) { - err = new RequestAbortedError(); - } - if (abort && err) { - abort(); - } - util3.destroy(body, err); - util3.destroy(req, err); - util3.destroy(res, err); - removeSignal(this); - callback(err); - } - }).on("prefinish", () => { - const { req } = this; - req.push(null); - }); - this.res = null; - addSignal(this, signal); - } - onConnect(abort, context5) { - const { ret, res } = this; - if (this.reason) { - abort(this.reason); - return; - } - assert(!res, "pipeline cannot be retried"); - assert(!ret.destroyed); - this.abort = abort; - this.context = context5; - } - onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context5 } = this; - if (statusCode < 200) { - if (this.onInfo) { - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); - this.onInfo({ statusCode, headers }); - } - return; - } - this.res = new PipelineResponse(resume); - let body; - try { - this.handler = null; - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); - body = this.runInAsyncScope(handler2, null, { - statusCode, - headers, - opaque, - body: this.res, - context: context5 - }); - } catch (err) { - this.res.on("error", util3.nop); - throw err; - } - if (!body || typeof body.on !== "function") { - throw new InvalidReturnValueError("expected Readable"); - } - body.on("data", (chunk) => { - const { ret, body: body2 } = this; - if (!ret.push(chunk) && body2.pause) { - body2.pause(); - } - }).on("error", (err) => { - const { ret } = this; - util3.destroy(ret, err); - }).on("end", () => { - const { ret } = this; - ret.push(null); - }).on("close", () => { - const { ret } = this; - if (!ret._readableState.ended) { - util3.destroy(ret, new RequestAbortedError()); - } - }); - this.body = body; - } - onData(chunk) { - const { res } = this; - return res.push(chunk); - } - onComplete(trailers) { - const { res } = this; - res.push(null); - } - onError(err) { - const { ret } = this; - this.handler = null; - util3.destroy(ret, err); - } - }; - function pipeline2(opts, handler2) { - try { - const pipelineHandler = new PipelineHandler(opts, handler2); - this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); - return pipelineHandler.ret; - } catch (err) { - return new PassThrough3().destroy(err); - } - } - module2.exports = pipeline2; - } -}); - -// node_modules/undici/lib/api/api-upgrade.js -var require_api_upgrade = __commonJS({ - "node_modules/undici/lib/api/api-upgrade.js"(exports2, module2) { - "use strict"; - var { InvalidArgumentError, SocketError } = require_errors(); - var { AsyncResource } = require("node:async_hooks"); - var util3 = require_util(); - var { addSignal, removeSignal } = require_abort_signal(); - var assert = require("node:assert"); - var UpgradeHandler = class extends AsyncResource { - constructor(opts, callback) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - const { signal, opaque, responseHeaders } = opts; - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - super("UNDICI_UPGRADE"); - this.responseHeaders = responseHeaders || null; - this.opaque = opaque || null; - this.callback = callback; - this.abort = null; - this.context = null; - addSignal(this, signal); - } - onConnect(abort, context5) { - if (this.reason) { - abort(this.reason); - return; - } - assert(this.callback); - this.abort = abort; - this.context = null; - } - onHeaders() { - throw new SocketError("bad upgrade", null); - } - onUpgrade(statusCode, rawHeaders, socket) { - assert(statusCode === 101); - const { callback, opaque, context: context5 } = this; - removeSignal(this); - this.callback = null; - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); - this.runInAsyncScope(callback, null, null, { - headers, - socket, - opaque, - context: context5 - }); - } - onError(err) { - const { callback, opaque } = this; - removeSignal(this); - if (callback) { - this.callback = null; - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); - }); - } - } - }; - function upgrade(opts, callback) { - if (callback === void 0) { - return new Promise((resolve14, reject) => { - upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve14(data); - }); - }); - } - try { - const upgradeHandler = new UpgradeHandler(opts, callback); - this.dispatch({ - ...opts, - method: opts.method || "GET", - upgrade: opts.protocol || "Websocket" - }, upgradeHandler); - } catch (err) { - if (typeof callback !== "function") { - throw err; - } - const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); - } - } - module2.exports = upgrade; - } -}); - -// node_modules/undici/lib/api/api-connect.js -var require_api_connect = __commonJS({ - "node_modules/undici/lib/api/api-connect.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var { AsyncResource } = require("node:async_hooks"); - var { InvalidArgumentError, SocketError } = require_errors(); - var util3 = require_util(); - var { addSignal, removeSignal } = require_abort_signal(); - var ConnectHandler = class extends AsyncResource { - constructor(opts, callback) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - const { signal, opaque, responseHeaders } = opts; - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - super("UNDICI_CONNECT"); - this.opaque = opaque || null; - this.responseHeaders = responseHeaders || null; - this.callback = callback; - this.abort = null; - addSignal(this, signal); - } - onConnect(abort, context5) { - if (this.reason) { - abort(this.reason); - return; - } - assert(this.callback); - this.abort = abort; - this.context = context5; - } - onHeaders() { - throw new SocketError("bad connect", null); - } - onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context5 } = this; - removeSignal(this); - this.callback = null; - let headers = rawHeaders; - if (headers != null) { - headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); - } - this.runInAsyncScope(callback, null, null, { - statusCode, - headers, - socket, - opaque, - context: context5 - }); - } - onError(err) { - const { callback, opaque } = this; - removeSignal(this); - if (callback) { - this.callback = null; - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); - }); - } - } - }; - function connect(opts, callback) { - if (callback === void 0) { - return new Promise((resolve14, reject) => { - connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve14(data); - }); - }); - } - try { - const connectHandler = new ConnectHandler(opts, callback); - this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); - } catch (err) { - if (typeof callback !== "function") { - throw err; - } - const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); - } - } - module2.exports = connect; - } -}); - -// node_modules/undici/lib/api/index.js -var require_api = __commonJS({ - "node_modules/undici/lib/api/index.js"(exports2, module2) { - "use strict"; - module2.exports.request = require_api_request(); - module2.exports.stream = require_api_stream(); - module2.exports.pipeline = require_api_pipeline(); - module2.exports.upgrade = require_api_upgrade(); - module2.exports.connect = require_api_connect(); - } -}); - -// node_modules/undici/lib/mock/mock-errors.js -var require_mock_errors = __commonJS({ - "node_modules/undici/lib/mock/mock-errors.js"(exports2, module2) { - "use strict"; - var { UndiciError } = require_errors(); - var kMockNotMatchedError = /* @__PURE__ */ Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"); - var MockNotMatchedError = class _MockNotMatchedError extends UndiciError { - constructor(message) { - super(message); - Error.captureStackTrace(this, _MockNotMatchedError); - this.name = "MockNotMatchedError"; - this.message = message || "The request does not match any registered mock dispatches"; - this.code = "UND_MOCK_ERR_MOCK_NOT_MATCHED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kMockNotMatchedError] === true; - } - [kMockNotMatchedError] = true; - }; - module2.exports = { - MockNotMatchedError - }; - } -}); - -// node_modules/undici/lib/mock/mock-symbols.js -var require_mock_symbols = __commonJS({ - "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { - "use strict"; - module2.exports = { - kAgent: /* @__PURE__ */ Symbol("agent"), - kOptions: /* @__PURE__ */ Symbol("options"), - kFactory: /* @__PURE__ */ Symbol("factory"), - kDispatches: /* @__PURE__ */ Symbol("dispatches"), - kDispatchKey: /* @__PURE__ */ Symbol("dispatch key"), - kDefaultHeaders: /* @__PURE__ */ Symbol("default headers"), - kDefaultTrailers: /* @__PURE__ */ Symbol("default trailers"), - kContentLength: /* @__PURE__ */ Symbol("content length"), - kMockAgent: /* @__PURE__ */ Symbol("mock agent"), - kMockAgentSet: /* @__PURE__ */ Symbol("mock agent set"), - kMockAgentGet: /* @__PURE__ */ Symbol("mock agent get"), - kMockDispatch: /* @__PURE__ */ Symbol("mock dispatch"), - kClose: /* @__PURE__ */ Symbol("close"), - kOriginalClose: /* @__PURE__ */ Symbol("original agent close"), - kOrigin: /* @__PURE__ */ Symbol("origin"), - kIsMockActive: /* @__PURE__ */ Symbol("is mock active"), - kNetConnect: /* @__PURE__ */ Symbol("net connect"), - kGetNetConnect: /* @__PURE__ */ Symbol("get net connect"), - kConnected: /* @__PURE__ */ Symbol("connected") - }; - } -}); - -// node_modules/undici/lib/mock/mock-utils.js -var require_mock_utils = __commonJS({ - "node_modules/undici/lib/mock/mock-utils.js"(exports2, module2) { - "use strict"; - var { MockNotMatchedError } = require_mock_errors(); - var { - kDispatches, - kMockAgent, - kOriginalDispatch, - kOrigin, - kGetNetConnect - } = require_mock_symbols(); - var { buildURL } = require_util(); - var { STATUS_CODES } = require("node:http"); - var { - types: { - isPromise - } - } = require("node:util"); - function matchValue(match2, value) { - if (typeof match2 === "string") { - return match2 === value; - } - if (match2 instanceof RegExp) { - return match2.test(value); - } - if (typeof match2 === "function") { - return match2(value) === true; - } - return false; - } - function lowerCaseEntries(headers) { - return Object.fromEntries( - Object.entries(headers).map(([headerName, headerValue]) => { - return [headerName.toLocaleLowerCase(), headerValue]; - }) - ); - } - function getHeaderByName(headers, key) { - if (Array.isArray(headers)) { - for (let i = 0; i < headers.length; i += 2) { - if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { - return headers[i + 1]; - } - } - return void 0; - } else if (typeof headers.get === "function") { - return headers.get(key); - } else { - return lowerCaseEntries(headers)[key.toLocaleLowerCase()]; - } - } - function buildHeadersFromArray(headers) { - const clone = headers.slice(); - const entries = []; - for (let index2 = 0; index2 < clone.length; index2 += 2) { - entries.push([clone[index2], clone[index2 + 1]]); - } - return Object.fromEntries(entries); - } - function matchHeaders(mockDispatch2, headers) { - if (typeof mockDispatch2.headers === "function") { - if (Array.isArray(headers)) { - headers = buildHeadersFromArray(headers); - } - return mockDispatch2.headers(headers ? lowerCaseEntries(headers) : {}); - } - if (typeof mockDispatch2.headers === "undefined") { - return true; - } - if (typeof headers !== "object" || typeof mockDispatch2.headers !== "object") { - return false; - } - for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch2.headers)) { - const headerValue = getHeaderByName(headers, matchHeaderName); - if (!matchValue(matchHeaderValue, headerValue)) { - return false; - } - } - return true; - } - function safeUrl(path30) { - if (typeof path30 !== "string") { - return path30; - } - const pathSegments = path30.split("?"); - if (pathSegments.length !== 2) { - return path30; - } - const qp = new URLSearchParams(pathSegments.pop()); - qp.sort(); - return [...pathSegments, qp.toString()].join("?"); - } - function matchKey(mockDispatch2, { path: path30, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path30); - const methodMatch = matchValue(mockDispatch2.method, method); - const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; - const headersMatch = matchHeaders(mockDispatch2, headers); - return pathMatch && methodMatch && bodyMatch && headersMatch; - } - function getResponseData2(data) { - if (Buffer.isBuffer(data)) { - return data; - } else if (data instanceof Uint8Array) { - return data; - } else if (data instanceof ArrayBuffer) { - return data; - } else if (typeof data === "object") { - return JSON.stringify(data); - } else { - return data.toString(); - } - } - function getMockDispatch(mockDispatches, key) { - const basePath = key.query ? buildURL(key.path, key.query) : key.path; - const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path30 }) => matchValue(safeUrl(path30), resolvedPath)); - if (matchedMockDispatches.length === 0) { - throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); - } - matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)); - if (matchedMockDispatches.length === 0) { - throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`); - } - matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== "undefined" ? matchValue(body, key.body) : true); - if (matchedMockDispatches.length === 0) { - throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`); - } - matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2, key.headers)); - if (matchedMockDispatches.length === 0) { - const headers = typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers; - throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`); - } - return matchedMockDispatches[0]; - } - function addMockDispatch(mockDispatches, key, data) { - const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }; - const replyData = typeof data === "function" ? { callback: data } : { ...data }; - const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }; - mockDispatches.push(newMockDispatch); - return newMockDispatch; - } - function deleteMockDispatch(mockDispatches, key) { - const index2 = mockDispatches.findIndex((dispatch) => { - if (!dispatch.consumed) { - return false; - } - return matchKey(dispatch, key); - }); - if (index2 !== -1) { - mockDispatches.splice(index2, 1); - } - } - function buildKey(opts) { - const { path: path30, method, body, headers, query } = opts; - return { - path: path30, - method, - body, - headers, - query - }; - } - function generateKeyValues(data) { - const keys = Object.keys(data); - const result = []; - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - const value = data[key]; - const name = Buffer.from(`${key}`); - if (Array.isArray(value)) { - for (let j = 0; j < value.length; ++j) { - result.push(name, Buffer.from(`${value[j]}`)); - } - } else { - result.push(name, Buffer.from(`${value}`)); - } - } - return result; - } - function getStatusText(statusCode) { - return STATUS_CODES[statusCode] || "unknown"; - } - async function getResponse(body) { - const buffers = []; - for await (const data of body) { - buffers.push(data); - } - return Buffer.concat(buffers).toString("utf8"); - } - function mockDispatch(opts, handler2) { - const key = buildKey(opts); - const mockDispatch2 = getMockDispatch(this[kDispatches], key); - mockDispatch2.timesInvoked++; - if (mockDispatch2.data.callback) { - mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; - } - const { data: { statusCode, data, headers, trailers, error: error3 }, delay: delay2, persist } = mockDispatch2; - const { timesInvoked, times } = mockDispatch2; - mockDispatch2.consumed = !persist && timesInvoked >= times; - mockDispatch2.pending = timesInvoked < times; - if (error3 !== null) { - deleteMockDispatch(this[kDispatches], key); - handler2.onError(error3); - return true; - } - if (typeof delay2 === "number" && delay2 > 0) { - setTimeout(() => { - handleReply(this[kDispatches]); - }, delay2); - } else { - handleReply(this[kDispatches]); - } - function handleReply(mockDispatches, _data = data) { - const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers; - const body = typeof _data === "function" ? _data({ ...opts, headers: optsHeaders }) : _data; - if (isPromise(body)) { - body.then((newData) => handleReply(mockDispatches, newData)); - return; - } - const responseData = getResponseData2(body); - const responseHeaders = generateKeyValues(headers); - const responseTrailers = generateKeyValues(trailers); - handler2.onConnect?.((err) => handler2.onError(err), null); - handler2.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode)); - handler2.onData?.(Buffer.from(responseData)); - handler2.onComplete?.(responseTrailers); - deleteMockDispatch(mockDispatches, key); - } - function resume() { - } - return true; - } - function buildMockDispatch() { - const agent = this[kMockAgent]; - const origin = this[kOrigin]; - const originalDispatch = this[kOriginalDispatch]; - return function dispatch(opts, handler2) { - if (agent.isMockActive) { - try { - mockDispatch.call(this, opts, handler2); - } catch (error3) { - if (error3 instanceof MockNotMatchedError) { - const netConnect = agent[kGetNetConnect](); - if (netConnect === false) { - throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); - } - if (checkNetConnect(netConnect, origin)) { - originalDispatch.call(this, opts, handler2); - } else { - throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); - } - } else { - throw error3; - } - } - } else { - originalDispatch.call(this, opts, handler2); - } - }; - } - function checkNetConnect(netConnect, origin) { - const url2 = new URL(origin); - if (netConnect === true) { - return true; - } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url2.host))) { - return true; - } - return false; - } - function buildMockOptions(opts) { - if (opts) { - const { agent, ...mockOptions } = opts; - return mockOptions; - } - } - module2.exports = { - getResponseData: getResponseData2, - getMockDispatch, - addMockDispatch, - deleteMockDispatch, - buildKey, - generateKeyValues, - matchValue, - getResponse, - getStatusText, - mockDispatch, - buildMockDispatch, - checkNetConnect, - buildMockOptions, - getHeaderByName, - buildHeadersFromArray - }; - } -}); - -// node_modules/undici/lib/mock/mock-interceptor.js -var require_mock_interceptor = __commonJS({ - "node_modules/undici/lib/mock/mock-interceptor.js"(exports2, module2) { - "use strict"; - var { getResponseData: getResponseData2, buildKey, addMockDispatch } = require_mock_utils(); - var { - kDispatches, - kDispatchKey, - kDefaultHeaders, - kDefaultTrailers, - kContentLength, - kMockDispatch - } = require_mock_symbols(); - var { InvalidArgumentError } = require_errors(); - var { buildURL } = require_util(); - var MockScope = class { - constructor(mockDispatch) { - this[kMockDispatch] = mockDispatch; - } - /** - * Delay a reply by a set amount in ms. - */ - delay(waitInMs) { - if (typeof waitInMs !== "number" || !Number.isInteger(waitInMs) || waitInMs <= 0) { - throw new InvalidArgumentError("waitInMs must be a valid integer > 0"); - } - this[kMockDispatch].delay = waitInMs; - return this; - } - /** - * For a defined reply, never mark as consumed. - */ - persist() { - this[kMockDispatch].persist = true; - return this; - } - /** - * Allow one to define a reply for a set amount of matching requests. - */ - times(repeatTimes) { - if (typeof repeatTimes !== "number" || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { - throw new InvalidArgumentError("repeatTimes must be a valid integer > 0"); - } - this[kMockDispatch].times = repeatTimes; - return this; - } - }; - var MockInterceptor = class { - constructor(opts, mockDispatches) { - if (typeof opts !== "object") { - throw new InvalidArgumentError("opts must be an object"); - } - if (typeof opts.path === "undefined") { - throw new InvalidArgumentError("opts.path must be defined"); - } - if (typeof opts.method === "undefined") { - opts.method = "GET"; - } - if (typeof opts.path === "string") { - if (opts.query) { - opts.path = buildURL(opts.path, opts.query); - } else { - const parsedURL = new URL(opts.path, "data://"); - opts.path = parsedURL.pathname + parsedURL.search; - } - } - if (typeof opts.method === "string") { - opts.method = opts.method.toUpperCase(); - } - this[kDispatchKey] = buildKey(opts); - this[kDispatches] = mockDispatches; - this[kDefaultHeaders] = {}; - this[kDefaultTrailers] = {}; - this[kContentLength] = false; - } - createMockScopeDispatchData({ statusCode, data, responseOptions }) { - const responseData = getResponseData2(data); - const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {}; - const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }; - const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }; - return { statusCode, data, headers, trailers }; - } - validateReplyParameters(replyParameters) { - if (typeof replyParameters.statusCode === "undefined") { - throw new InvalidArgumentError("statusCode must be defined"); - } - if (typeof replyParameters.responseOptions !== "object" || replyParameters.responseOptions === null) { - throw new InvalidArgumentError("responseOptions must be an object"); - } - } - /** - * Mock an undici request with a defined reply. - */ - reply(replyOptionsCallbackOrStatusCode) { - if (typeof replyOptionsCallbackOrStatusCode === "function") { - const wrappedDefaultsCallback = (opts) => { - const resolvedData = replyOptionsCallbackOrStatusCode(opts); - if (typeof resolvedData !== "object" || resolvedData === null) { - throw new InvalidArgumentError("reply options callback must return an object"); - } - const replyParameters2 = { data: "", responseOptions: {}, ...resolvedData }; - this.validateReplyParameters(replyParameters2); - return { - ...this.createMockScopeDispatchData(replyParameters2) - }; - }; - const newMockDispatch2 = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback); - return new MockScope(newMockDispatch2); - } - const replyParameters = { - statusCode: replyOptionsCallbackOrStatusCode, - data: arguments[1] === void 0 ? "" : arguments[1], - responseOptions: arguments[2] === void 0 ? {} : arguments[2] - }; - this.validateReplyParameters(replyParameters); - const dispatchData = this.createMockScopeDispatchData(replyParameters); - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData); - return new MockScope(newMockDispatch); - } - /** - * Mock an undici request with a defined error. - */ - replyWithError(error3) { - if (typeof error3 === "undefined") { - throw new InvalidArgumentError("error must be defined"); - } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); - return new MockScope(newMockDispatch); - } - /** - * Set default reply headers on the interceptor for subsequent replies - */ - defaultReplyHeaders(headers) { - if (typeof headers === "undefined") { - throw new InvalidArgumentError("headers must be defined"); - } - this[kDefaultHeaders] = headers; - return this; - } - /** - * Set default reply trailers on the interceptor for subsequent replies - */ - defaultReplyTrailers(trailers) { - if (typeof trailers === "undefined") { - throw new InvalidArgumentError("trailers must be defined"); - } - this[kDefaultTrailers] = trailers; - return this; - } - /** - * Set reply content length header for replies on the interceptor - */ - replyContentLength() { - this[kContentLength] = true; - return this; - } - }; - module2.exports.MockInterceptor = MockInterceptor; - module2.exports.MockScope = MockScope; - } -}); - -// node_modules/undici/lib/mock/mock-client.js -var require_mock_client = __commonJS({ - "node_modules/undici/lib/mock/mock-client.js"(exports2, module2) { - "use strict"; - var { promisify } = require("node:util"); - var Client = require_client(); - var { buildMockDispatch } = require_mock_utils(); - var { - kDispatches, - kMockAgent, - kClose, - kOriginalClose, - kOrigin, - kOriginalDispatch, - kConnected - } = require_mock_symbols(); - var { MockInterceptor } = require_mock_interceptor(); - var Symbols = require_symbols(); - var { InvalidArgumentError } = require_errors(); - var MockClient = class extends Client { - constructor(origin, opts) { - super(origin, opts); - if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { - throw new InvalidArgumentError("Argument opts.agent must implement Agent"); - } - this[kMockAgent] = opts.agent; - this[kOrigin] = origin; - this[kDispatches] = []; - this[kConnected] = 1; - this[kOriginalDispatch] = this.dispatch; - this[kOriginalClose] = this.close.bind(this); - this.dispatch = buildMockDispatch.call(this); - this.close = this[kClose]; - } - get [Symbols.kConnected]() { - return this[kConnected]; - } - /** - * Sets up the base interceptor for mocking replies from undici. - */ - intercept(opts) { - return new MockInterceptor(opts, this[kDispatches]); - } - async [kClose]() { - await promisify(this[kOriginalClose])(); - this[kConnected] = 0; - this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); - } - }; - module2.exports = MockClient; - } -}); - -// node_modules/undici/lib/mock/mock-pool.js -var require_mock_pool = __commonJS({ - "node_modules/undici/lib/mock/mock-pool.js"(exports2, module2) { - "use strict"; - var { promisify } = require("node:util"); - var Pool = require_pool(); - var { buildMockDispatch } = require_mock_utils(); - var { - kDispatches, - kMockAgent, - kClose, - kOriginalClose, - kOrigin, - kOriginalDispatch, - kConnected - } = require_mock_symbols(); - var { MockInterceptor } = require_mock_interceptor(); - var Symbols = require_symbols(); - var { InvalidArgumentError } = require_errors(); - var MockPool = class extends Pool { - constructor(origin, opts) { - super(origin, opts); - if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { - throw new InvalidArgumentError("Argument opts.agent must implement Agent"); - } - this[kMockAgent] = opts.agent; - this[kOrigin] = origin; - this[kDispatches] = []; - this[kConnected] = 1; - this[kOriginalDispatch] = this.dispatch; - this[kOriginalClose] = this.close.bind(this); - this.dispatch = buildMockDispatch.call(this); - this.close = this[kClose]; - } - get [Symbols.kConnected]() { - return this[kConnected]; - } - /** - * Sets up the base interceptor for mocking replies from undici. - */ - intercept(opts) { - return new MockInterceptor(opts, this[kDispatches]); - } - async [kClose]() { - await promisify(this[kOriginalClose])(); - this[kConnected] = 0; - this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); - } - }; - module2.exports = MockPool; - } -}); - -// node_modules/undici/lib/mock/pluralizer.js -var require_pluralizer = __commonJS({ - "node_modules/undici/lib/mock/pluralizer.js"(exports2, module2) { - "use strict"; - var singulars = { - pronoun: "it", - is: "is", - was: "was", - this: "this" - }; - var plurals = { - pronoun: "they", - is: "are", - was: "were", - this: "these" - }; - module2.exports = class Pluralizer { - constructor(singular, plural) { - this.singular = singular; - this.plural = plural; - } - pluralize(count) { - const one = count === 1; - const keys = one ? singulars : plurals; - const noun = one ? this.singular : this.plural; - return { ...keys, count, noun }; - } - }; - } -}); - -// node_modules/undici/lib/mock/pending-interceptors-formatter.js -var require_pending_interceptors_formatter = __commonJS({ - "node_modules/undici/lib/mock/pending-interceptors-formatter.js"(exports2, module2) { - "use strict"; - var { Transform: Transform5 } = require("node:stream"); - var { Console } = require("node:console"); - var PERSISTENT = process.versions.icu ? "\u2705" : "Y "; - var NOT_PERSISTENT = process.versions.icu ? "\u274C" : "N "; - module2.exports = class PendingInterceptorsFormatter { - constructor({ disableColors } = {}) { - this.transform = new Transform5({ - transform(chunk, _enc, cb) { - cb(null, chunk); - } - }); - this.logger = new Console({ - stdout: this.transform, - inspectOptions: { - colors: !disableColors && !process.env.CI - } - }); - } - format(pendingInterceptors) { - const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path30, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ - Method: method, - Origin: origin, - Path: path30, - "Status code": statusCode, - Persistent: persist ? PERSISTENT : NOT_PERSISTENT, - Invocations: timesInvoked, - Remaining: persist ? Infinity : times - timesInvoked - }) - ); - this.logger.table(withPrettyHeaders); - return this.transform.read().toString(); - } - }; - } -}); - -// node_modules/undici/lib/mock/mock-agent.js -var require_mock_agent = __commonJS({ - "node_modules/undici/lib/mock/mock-agent.js"(exports2, module2) { - "use strict"; - var { kClients } = require_symbols(); - var Agent = require_agent(); - var { - kAgent, - kMockAgentSet, - kMockAgentGet, - kDispatches, - kIsMockActive, - kNetConnect, - kGetNetConnect, - kOptions, - kFactory - } = require_mock_symbols(); - var MockClient = require_mock_client(); - var MockPool = require_mock_pool(); - var { matchValue, buildMockOptions } = require_mock_utils(); - var { InvalidArgumentError, UndiciError } = require_errors(); - var Dispatcher = require_dispatcher(); - var Pluralizer = require_pluralizer(); - var PendingInterceptorsFormatter = require_pending_interceptors_formatter(); - var MockAgent = class extends Dispatcher { - constructor(opts) { - super(opts); - this[kNetConnect] = true; - this[kIsMockActive] = true; - if (opts?.agent && typeof opts.agent.dispatch !== "function") { - throw new InvalidArgumentError("Argument opts.agent must implement Agent"); - } - const agent = opts?.agent ? opts.agent : new Agent(opts); - this[kAgent] = agent; - this[kClients] = agent[kClients]; - this[kOptions] = buildMockOptions(opts); - } - get(origin) { - let dispatcher = this[kMockAgentGet](origin); - if (!dispatcher) { - dispatcher = this[kFactory](origin); - this[kMockAgentSet](origin, dispatcher); - } - return dispatcher; - } - dispatch(opts, handler2) { - this.get(opts.origin); - return this[kAgent].dispatch(opts, handler2); - } - async close() { - await this[kAgent].close(); - this[kClients].clear(); - } - deactivate() { - this[kIsMockActive] = false; - } - activate() { - this[kIsMockActive] = true; - } - enableNetConnect(matcher) { - if (typeof matcher === "string" || typeof matcher === "function" || matcher instanceof RegExp) { - if (Array.isArray(this[kNetConnect])) { - this[kNetConnect].push(matcher); - } else { - this[kNetConnect] = [matcher]; - } - } else if (typeof matcher === "undefined") { - this[kNetConnect] = true; - } else { - throw new InvalidArgumentError("Unsupported matcher. Must be one of String|Function|RegExp."); - } - } - disableNetConnect() { - this[kNetConnect] = false; - } - // This is required to bypass issues caused by using global symbols - see: - // https://github.com/nodejs/undici/issues/1447 - get isMockActive() { - return this[kIsMockActive]; - } - [kMockAgentSet](origin, dispatcher) { - this[kClients].set(origin, dispatcher); - } - [kFactory](origin) { - const mockOptions = Object.assign({ agent: this }, this[kOptions]); - return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions); - } - [kMockAgentGet](origin) { - const client = this[kClients].get(origin); - if (client) { - return client; - } - if (typeof origin !== "string") { - const dispatcher = this[kFactory]("http://localhost:9999"); - this[kMockAgentSet](origin, dispatcher); - return dispatcher; - } - for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) { - if (nonExplicitDispatcher && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) { - const dispatcher = this[kFactory](origin); - this[kMockAgentSet](origin, dispatcher); - dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]; - return dispatcher; - } - } - } - [kGetNetConnect]() { - return this[kNetConnect]; - } - pendingInterceptors() { - const mockAgentClients = this[kClients]; - return Array.from(mockAgentClients.entries()).flatMap(([origin, scope]) => scope[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending }) => pending); - } - assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { - const pending = this.pendingInterceptors(); - if (pending.length === 0) { - return; - } - const pluralizer = new Pluralizer("interceptor", "interceptors").pluralize(pending.length); - throw new UndiciError(` -${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: - -${pendingInterceptorsFormatter.format(pending)} -`.trim()); - } - }; - module2.exports = MockAgent; - } -}); - -// node_modules/undici/lib/global.js -var require_global2 = __commonJS({ - "node_modules/undici/lib/global.js"(exports2, module2) { - "use strict"; - var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); - var { InvalidArgumentError } = require_errors(); - var Agent = require_agent(); - if (getGlobalDispatcher() === void 0) { - setGlobalDispatcher(new Agent()); - } - function setGlobalDispatcher(agent) { - if (!agent || typeof agent.dispatch !== "function") { - throw new InvalidArgumentError("Argument agent must implement Agent"); - } - Object.defineProperty(globalThis, globalDispatcher, { - value: agent, - writable: true, - enumerable: false, - configurable: false - }); - } - function getGlobalDispatcher() { - return globalThis[globalDispatcher]; - } - module2.exports = { - setGlobalDispatcher, - getGlobalDispatcher - }; - } -}); - -// node_modules/undici/lib/handler/decorator-handler.js -var require_decorator_handler = __commonJS({ - "node_modules/undici/lib/handler/decorator-handler.js"(exports2, module2) { - "use strict"; - module2.exports = class DecoratorHandler { - #handler; - constructor(handler2) { - if (typeof handler2 !== "object" || handler2 === null) { - throw new TypeError("handler must be an object"); - } - this.#handler = handler2; - } - onConnect(...args) { - return this.#handler.onConnect?.(...args); - } - onError(...args) { - return this.#handler.onError?.(...args); - } - onUpgrade(...args) { - return this.#handler.onUpgrade?.(...args); - } - onResponseStarted(...args) { - return this.#handler.onResponseStarted?.(...args); - } - onHeaders(...args) { - return this.#handler.onHeaders?.(...args); - } - onData(...args) { - return this.#handler.onData?.(...args); - } - onComplete(...args) { - return this.#handler.onComplete?.(...args); - } - onBodySent(...args) { - return this.#handler.onBodySent?.(...args); - } - }; - } -}); - -// node_modules/undici/lib/interceptor/redirect.js -var require_redirect = __commonJS({ - "node_modules/undici/lib/interceptor/redirect.js"(exports2, module2) { - "use strict"; - var RedirectHandler = require_redirect_handler(); - module2.exports = (opts) => { - const globalMaxRedirections = opts?.maxRedirections; - return (dispatch) => { - return function redirectInterceptor(opts2, handler2) { - const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts2; - if (!maxRedirections) { - return dispatch(opts2, handler2); - } - const redirectHandler = new RedirectHandler( - dispatch, - maxRedirections, - opts2, - handler2 - ); - return dispatch(baseOpts, redirectHandler); - }; - }; - }; - } -}); - -// node_modules/undici/lib/interceptor/retry.js -var require_retry = __commonJS({ - "node_modules/undici/lib/interceptor/retry.js"(exports2, module2) { - "use strict"; - var RetryHandler = require_retry_handler(); - module2.exports = (globalOpts) => { - return (dispatch) => { - return function retryInterceptor(opts, handler2) { - return dispatch( - opts, - new RetryHandler( - { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } }, - { - handler: handler2, - dispatch - } - ) - ); - }; - }; - }; - } -}); - -// node_modules/undici/lib/interceptor/dump.js -var require_dump = __commonJS({ - "node_modules/undici/lib/interceptor/dump.js"(exports2, module2) { - "use strict"; - var util3 = require_util(); - var { InvalidArgumentError, RequestAbortedError } = require_errors(); - var DecoratorHandler = require_decorator_handler(); - var DumpHandler = class extends DecoratorHandler { - #maxSize = 1024 * 1024; - #abort = null; - #dumped = false; - #aborted = false; - #size = 0; - #reason = null; - #handler = null; - constructor({ maxSize }, handler2) { - super(handler2); - if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) { - throw new InvalidArgumentError("maxSize must be a number greater than 0"); - } - this.#maxSize = maxSize ?? this.#maxSize; - this.#handler = handler2; - } - onConnect(abort) { - this.#abort = abort; - this.#handler.onConnect(this.#customAbort.bind(this)); - } - #customAbort(reason) { - this.#aborted = true; - this.#reason = reason; - } - // TODO: will require adjustment after new hooks are out - onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const headers = util3.parseHeaders(rawHeaders); - const contentLength = headers["content-length"]; - if (contentLength != null && contentLength > this.#maxSize) { - throw new RequestAbortedError( - `Response size (${contentLength}) larger than maxSize (${this.#maxSize})` - ); - } - if (this.#aborted) { - return true; - } - return this.#handler.onHeaders( - statusCode, - rawHeaders, - resume, - statusMessage - ); - } - onError(err) { - if (this.#dumped) { - return; - } - err = this.#reason ?? err; - this.#handler.onError(err); - } - onData(chunk) { - this.#size = this.#size + chunk.length; - if (this.#size >= this.#maxSize) { - this.#dumped = true; - if (this.#aborted) { - this.#handler.onError(this.#reason); - } else { - this.#handler.onComplete([]); - } - } - return true; - } - onComplete(trailers) { - if (this.#dumped) { - return; - } - if (this.#aborted) { - this.#handler.onError(this.reason); - return; - } - this.#handler.onComplete(trailers); - } - }; - function createDumpInterceptor({ maxSize: defaultMaxSize } = { - maxSize: 1024 * 1024 - }) { - return (dispatch) => { - return function Intercept(opts, handler2) { - const { dumpMaxSize = defaultMaxSize } = opts; - const dumpHandler = new DumpHandler( - { maxSize: dumpMaxSize }, - handler2 - ); - return dispatch(opts, dumpHandler); - }; - }; - } - module2.exports = createDumpInterceptor; - } -}); - -// node_modules/undici/lib/interceptor/dns.js -var require_dns = __commonJS({ - "node_modules/undici/lib/interceptor/dns.js"(exports2, module2) { - "use strict"; - var { isIP } = require("node:net"); - var { lookup } = require("node:dns"); - var DecoratorHandler = require_decorator_handler(); - var { InvalidArgumentError, InformationalError } = require_errors(); - var maxInt = Math.pow(2, 31) - 1; - var DNSInstance = class { - #maxTTL = 0; - #maxItems = 0; - #records = /* @__PURE__ */ new Map(); - dualStack = true; - affinity = null; - lookup = null; - pick = null; - constructor(opts) { - this.#maxTTL = opts.maxTTL; - this.#maxItems = opts.maxItems; - this.dualStack = opts.dualStack; - this.affinity = opts.affinity; - this.lookup = opts.lookup ?? this.#defaultLookup; - this.pick = opts.pick ?? this.#defaultPick; - } - get full() { - return this.#records.size === this.#maxItems; - } - runLookup(origin, opts, cb) { - const ips = this.#records.get(origin.hostname); - if (ips == null && this.full) { - cb(null, origin.origin); - return; - } - const newOpts = { - affinity: this.affinity, - dualStack: this.dualStack, - lookup: this.lookup, - pick: this.pick, - ...opts.dns, - maxTTL: this.#maxTTL, - maxItems: this.#maxItems - }; - if (ips == null) { - this.lookup(origin, newOpts, (err, addresses) => { - if (err || addresses == null || addresses.length === 0) { - cb(err ?? new InformationalError("No DNS entries found")); - return; - } - this.setRecords(origin, addresses); - const records = this.#records.get(origin.hostname); - const ip = this.pick( - origin, - records, - newOpts.affinity - ); - let port; - if (typeof ip.port === "number") { - port = `:${ip.port}`; - } else if (origin.port !== "") { - port = `:${origin.port}`; - } else { - port = ""; - } - cb( - null, - `${origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}` - ); - }); - } else { - const ip = this.pick( - origin, - ips, - newOpts.affinity - ); - if (ip == null) { - this.#records.delete(origin.hostname); - this.runLookup(origin, opts, cb); - return; - } - let port; - if (typeof ip.port === "number") { - port = `:${ip.port}`; - } else if (origin.port !== "") { - port = `:${origin.port}`; - } else { - port = ""; - } - cb( - null, - `${origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}` - ); - } - } - #defaultLookup(origin, opts, cb) { - lookup( - origin.hostname, - { - all: true, - family: this.dualStack === false ? this.affinity : 0, - order: "ipv4first" - }, - (err, addresses) => { - if (err) { - return cb(err); - } - const results = /* @__PURE__ */ new Map(); - for (const addr of addresses) { - results.set(`${addr.address}:${addr.family}`, addr); - } - cb(null, results.values()); - } - ); - } - #defaultPick(origin, hostnameRecords, affinity) { - let ip = null; - const { records, offset } = hostnameRecords; - let family; - if (this.dualStack) { - if (affinity == null) { - if (offset == null || offset === maxInt) { - hostnameRecords.offset = 0; - affinity = 4; - } else { - hostnameRecords.offset++; - affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4; - } - } - if (records[affinity] != null && records[affinity].ips.length > 0) { - family = records[affinity]; - } else { - family = records[affinity === 4 ? 6 : 4]; - } - } else { - family = records[affinity]; - } - if (family == null || family.ips.length === 0) { - return ip; - } - if (family.offset == null || family.offset === maxInt) { - family.offset = 0; - } else { - family.offset++; - } - const position = family.offset % family.ips.length; - ip = family.ips[position] ?? null; - if (ip == null) { - return ip; - } - if (Date.now() - ip.timestamp > ip.ttl) { - family.ips.splice(position, 1); - return this.pick(origin, hostnameRecords, affinity); - } - return ip; - } - setRecords(origin, addresses) { - const timestamp = Date.now(); - const records = { records: { 4: null, 6: null } }; - for (const record of addresses) { - record.timestamp = timestamp; - if (typeof record.ttl === "number") { - record.ttl = Math.min(record.ttl, this.#maxTTL); - } else { - record.ttl = this.#maxTTL; - } - const familyRecords = records.records[record.family] ?? { ips: [] }; - familyRecords.ips.push(record); - records.records[record.family] = familyRecords; - } - this.#records.set(origin.hostname, records); - } - getHandler(meta, opts) { - return new DNSDispatchHandler(this, meta, opts); - } - }; - var DNSDispatchHandler = class extends DecoratorHandler { - #state = null; - #opts = null; - #dispatch = null; - #handler = null; - #origin = null; - constructor(state, { origin, handler: handler2, dispatch }, opts) { - super(handler2); - this.#origin = origin; - this.#handler = handler2; - this.#opts = { ...opts }; - this.#state = state; - this.#dispatch = dispatch; - } - onError(err) { - switch (err.code) { - case "ETIMEDOUT": - case "ECONNREFUSED": { - if (this.#state.dualStack) { - this.#state.runLookup(this.#origin, this.#opts, (err2, newOrigin) => { - if (err2) { - return this.#handler.onError(err2); - } - const dispatchOpts = { - ...this.#opts, - origin: newOrigin - }; - this.#dispatch(dispatchOpts, this); - }); - return; - } - this.#handler.onError(err); - return; - } - case "ENOTFOUND": - this.#state.deleteRecord(this.#origin); - // eslint-disable-next-line no-fallthrough - default: - this.#handler.onError(err); - break; - } - } - }; - module2.exports = (interceptorOpts) => { - if (interceptorOpts?.maxTTL != null && (typeof interceptorOpts?.maxTTL !== "number" || interceptorOpts?.maxTTL < 0)) { - throw new InvalidArgumentError("Invalid maxTTL. Must be a positive number"); - } - if (interceptorOpts?.maxItems != null && (typeof interceptorOpts?.maxItems !== "number" || interceptorOpts?.maxItems < 1)) { - throw new InvalidArgumentError( - "Invalid maxItems. Must be a positive number and greater than zero" - ); - } - if (interceptorOpts?.affinity != null && interceptorOpts?.affinity !== 4 && interceptorOpts?.affinity !== 6) { - throw new InvalidArgumentError("Invalid affinity. Must be either 4 or 6"); - } - if (interceptorOpts?.dualStack != null && typeof interceptorOpts?.dualStack !== "boolean") { - throw new InvalidArgumentError("Invalid dualStack. Must be a boolean"); - } - if (interceptorOpts?.lookup != null && typeof interceptorOpts?.lookup !== "function") { - throw new InvalidArgumentError("Invalid lookup. Must be a function"); - } - if (interceptorOpts?.pick != null && typeof interceptorOpts?.pick !== "function") { - throw new InvalidArgumentError("Invalid pick. Must be a function"); - } - const dualStack = interceptorOpts?.dualStack ?? true; - let affinity; - if (dualStack) { - affinity = interceptorOpts?.affinity ?? null; - } else { - affinity = interceptorOpts?.affinity ?? 4; - } - const opts = { - maxTTL: interceptorOpts?.maxTTL ?? 1e4, - // Expressed in ms - lookup: interceptorOpts?.lookup ?? null, - pick: interceptorOpts?.pick ?? null, - dualStack, - affinity, - maxItems: interceptorOpts?.maxItems ?? Infinity - }; - const instance = new DNSInstance(opts); - return (dispatch) => { - return function dnsInterceptor(origDispatchOpts, handler2) { - const origin = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin); - if (isIP(origin.hostname) !== 0) { - return dispatch(origDispatchOpts, handler2); - } - instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => { - if (err) { - return handler2.onError(err); - } - let dispatchOpts = null; - dispatchOpts = { - ...origDispatchOpts, - servername: origin.hostname, - // For SNI on TLS - origin: newOrigin, - headers: { - host: origin.hostname, - ...origDispatchOpts.headers - } - }; - dispatch( - dispatchOpts, - instance.getHandler({ origin, dispatch, handler: handler2 }, origDispatchOpts) - ); - }); - return true; - }; - }; - }; - } -}); - -// node_modules/undici/lib/web/fetch/headers.js -var require_headers = __commonJS({ - "node_modules/undici/lib/web/fetch/headers.js"(exports2, module2) { - "use strict"; - var { kConstruct } = require_symbols(); - var { kEnumerableProperty } = require_util(); - var { - iteratorMixin, - isValidHeaderName, - isValidHeaderValue - } = require_util2(); - var { webidl } = require_webidl(); - var assert = require("node:assert"); - var util3 = require("node:util"); - var kHeadersMap = /* @__PURE__ */ Symbol("headers map"); - var kHeadersSortedMap = /* @__PURE__ */ Symbol("headers map sorted"); - function isHTTPWhiteSpaceCharCode(code) { - return code === 10 || code === 13 || code === 9 || code === 32; - } - function headerValueNormalize(potentialValue) { - let i = 0; - let j = potentialValue.length; - while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j; - while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i; - return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j); - } - function fill(headers, object2) { - if (Array.isArray(object2)) { - for (let i = 0; i < object2.length; ++i) { - const header = object2[i]; - if (header.length !== 2) { - throw webidl.errors.exception({ - header: "Headers constructor", - message: `expected name/value pair to be length 2, found ${header.length}.` - }); - } - appendHeader(headers, header[0], header[1]); - } - } else if (typeof object2 === "object" && object2 !== null) { - const keys = Object.keys(object2); - for (let i = 0; i < keys.length; ++i) { - appendHeader(headers, keys[i], object2[keys[i]]); - } - } else { - throw webidl.errors.conversionFailed({ - prefix: "Headers constructor", - argument: "Argument 1", - types: ["sequence>", "record"] - }); - } - } - function appendHeader(headers, name, value) { - value = headerValueNormalize(value); - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix: "Headers.append", - value: name, - type: "header name" - }); - } else if (!isValidHeaderValue(value)) { - throw webidl.errors.invalidArgument({ - prefix: "Headers.append", - value, - type: "header value" - }); - } - if (getHeadersGuard(headers) === "immutable") { - throw new TypeError("immutable"); - } - return getHeadersList(headers).append(name, value, false); - } - function compareHeaderName(a, b) { - return a[0] < b[0] ? -1 : 1; - } - var HeadersList = class _HeadersList { - /** @type {[string, string][]|null} */ - cookies = null; - constructor(init2) { - if (init2 instanceof _HeadersList) { - this[kHeadersMap] = new Map(init2[kHeadersMap]); - this[kHeadersSortedMap] = init2[kHeadersSortedMap]; - this.cookies = init2.cookies === null ? null : [...init2.cookies]; - } else { - this[kHeadersMap] = new Map(init2); - this[kHeadersSortedMap] = null; - } - } - /** - * @see https://fetch.spec.whatwg.org/#header-list-contains - * @param {string} name - * @param {boolean} isLowerCase - */ - contains(name, isLowerCase) { - return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase()); - } - clear() { - this[kHeadersMap].clear(); - this[kHeadersSortedMap] = null; - this.cookies = null; - } - /** - * @see https://fetch.spec.whatwg.org/#concept-header-list-append - * @param {string} name - * @param {string} value - * @param {boolean} isLowerCase - */ - append(name, value, isLowerCase) { - this[kHeadersSortedMap] = null; - const lowercaseName = isLowerCase ? name : name.toLowerCase(); - const exists = this[kHeadersMap].get(lowercaseName); - if (exists) { - const delimiter = lowercaseName === "cookie" ? "; " : ", "; - this[kHeadersMap].set(lowercaseName, { - name: exists.name, - value: `${exists.value}${delimiter}${value}` - }); - } else { - this[kHeadersMap].set(lowercaseName, { name, value }); - } - if (lowercaseName === "set-cookie") { - (this.cookies ??= []).push(value); - } - } - /** - * @see https://fetch.spec.whatwg.org/#concept-header-list-set - * @param {string} name - * @param {string} value - * @param {boolean} isLowerCase - */ - set(name, value, isLowerCase) { - this[kHeadersSortedMap] = null; - const lowercaseName = isLowerCase ? name : name.toLowerCase(); - if (lowercaseName === "set-cookie") { - this.cookies = [value]; - } - this[kHeadersMap].set(lowercaseName, { name, value }); - } - /** - * @see https://fetch.spec.whatwg.org/#concept-header-list-delete - * @param {string} name - * @param {boolean} isLowerCase - */ - delete(name, isLowerCase) { - this[kHeadersSortedMap] = null; - if (!isLowerCase) name = name.toLowerCase(); - if (name === "set-cookie") { - this.cookies = null; - } - this[kHeadersMap].delete(name); - } - /** - * @see https://fetch.spec.whatwg.org/#concept-header-list-get - * @param {string} name - * @param {boolean} isLowerCase - * @returns {string | null} - */ - get(name, isLowerCase) { - return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null; - } - *[Symbol.iterator]() { - for (const { 0: name, 1: { value } } of this[kHeadersMap]) { - yield [name, value]; - } - } - get entries() { - const headers = {}; - if (this[kHeadersMap].size !== 0) { - for (const { name, value } of this[kHeadersMap].values()) { - headers[name] = value; - } - } - return headers; - } - rawValues() { - return this[kHeadersMap].values(); - } - get entriesList() { - const headers = []; - if (this[kHeadersMap].size !== 0) { - for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) { - if (lowerName === "set-cookie") { - for (const cookie of this.cookies) { - headers.push([name, cookie]); - } - } else { - headers.push([name, value]); - } - } - } - return headers; - } - // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set - toSortedArray() { - const size = this[kHeadersMap].size; - const array2 = new Array(size); - if (size <= 32) { - if (size === 0) { - return array2; - } - const iterator2 = this[kHeadersMap][Symbol.iterator](); - const firstValue = iterator2.next().value; - array2[0] = [firstValue[0], firstValue[1].value]; - assert(firstValue[1].value !== null); - for (let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value; i < size; ++i) { - value = iterator2.next().value; - x = array2[i] = [value[0], value[1].value]; - assert(x[1] !== null); - left = 0; - right = i; - while (left < right) { - pivot = left + (right - left >> 1); - if (array2[pivot][0] <= x[0]) { - left = pivot + 1; - } else { - right = pivot; - } - } - if (i !== pivot) { - j = i; - while (j > left) { - array2[j] = array2[--j]; - } - array2[left] = x; - } - } - if (!iterator2.next().done) { - throw new TypeError("Unreachable"); - } - return array2; - } else { - let i = 0; - for (const { 0: name, 1: { value } } of this[kHeadersMap]) { - array2[i++] = [name, value]; - assert(value !== null); - } - return array2.sort(compareHeaderName); - } - } - }; - var Headers = class _Headers { - #guard; - #headersList; - constructor(init2 = void 0) { - webidl.util.markAsUncloneable(this); - if (init2 === kConstruct) { - return; - } - this.#headersList = new HeadersList(); - this.#guard = "none"; - if (init2 !== void 0) { - init2 = webidl.converters.HeadersInit(init2, "Headers contructor", "init"); - fill(this, init2); - } - } - // https://fetch.spec.whatwg.org/#dom-headers-append - append(name, value) { - webidl.brandCheck(this, _Headers); - webidl.argumentLengthCheck(arguments, 2, "Headers.append"); - const prefix = "Headers.append"; - name = webidl.converters.ByteString(name, prefix, "name"); - value = webidl.converters.ByteString(value, prefix, "value"); - return appendHeader(this, name, value); - } - // https://fetch.spec.whatwg.org/#dom-headers-delete - delete(name) { - webidl.brandCheck(this, _Headers); - webidl.argumentLengthCheck(arguments, 1, "Headers.delete"); - const prefix = "Headers.delete"; - name = webidl.converters.ByteString(name, prefix, "name"); - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix: "Headers.delete", - value: name, - type: "header name" - }); - } - if (this.#guard === "immutable") { - throw new TypeError("immutable"); - } - if (!this.#headersList.contains(name, false)) { - return; - } - this.#headersList.delete(name, false); - } - // https://fetch.spec.whatwg.org/#dom-headers-get - get(name) { - webidl.brandCheck(this, _Headers); - webidl.argumentLengthCheck(arguments, 1, "Headers.get"); - const prefix = "Headers.get"; - name = webidl.converters.ByteString(name, prefix, "name"); - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix, - value: name, - type: "header name" - }); - } - return this.#headersList.get(name, false); - } - // https://fetch.spec.whatwg.org/#dom-headers-has - has(name) { - webidl.brandCheck(this, _Headers); - webidl.argumentLengthCheck(arguments, 1, "Headers.has"); - const prefix = "Headers.has"; - name = webidl.converters.ByteString(name, prefix, "name"); - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix, - value: name, - type: "header name" - }); - } - return this.#headersList.contains(name, false); - } - // https://fetch.spec.whatwg.org/#dom-headers-set - set(name, value) { - webidl.brandCheck(this, _Headers); - webidl.argumentLengthCheck(arguments, 2, "Headers.set"); - const prefix = "Headers.set"; - name = webidl.converters.ByteString(name, prefix, "name"); - value = webidl.converters.ByteString(value, prefix, "value"); - value = headerValueNormalize(value); - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix, - value: name, - type: "header name" - }); - } else if (!isValidHeaderValue(value)) { - throw webidl.errors.invalidArgument({ - prefix, - value, - type: "header value" - }); - } - if (this.#guard === "immutable") { - throw new TypeError("immutable"); - } - this.#headersList.set(name, value, false); - } - // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie - getSetCookie() { - webidl.brandCheck(this, _Headers); - const list = this.#headersList.cookies; - if (list) { - return [...list]; - } - return []; - } - // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine - get [kHeadersSortedMap]() { - if (this.#headersList[kHeadersSortedMap]) { - return this.#headersList[kHeadersSortedMap]; - } - const headers = []; - const names = this.#headersList.toSortedArray(); - const cookies = this.#headersList.cookies; - if (cookies === null || cookies.length === 1) { - return this.#headersList[kHeadersSortedMap] = names; - } - for (let i = 0; i < names.length; ++i) { - const { 0: name, 1: value } = names[i]; - if (name === "set-cookie") { - for (let j = 0; j < cookies.length; ++j) { - headers.push([name, cookies[j]]); - } - } else { - headers.push([name, value]); - } - } - return this.#headersList[kHeadersSortedMap] = headers; - } - [util3.inspect.custom](depth, options) { - options.depth ??= depth; - return `Headers ${util3.formatWithOptions(options, this.#headersList.entries)}`; - } - static getHeadersGuard(o) { - return o.#guard; - } - static setHeadersGuard(o, guard) { - o.#guard = guard; - } - static getHeadersList(o) { - return o.#headersList; - } - static setHeadersList(o, list) { - o.#headersList = list; - } - }; - var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers; - Reflect.deleteProperty(Headers, "getHeadersGuard"); - Reflect.deleteProperty(Headers, "setHeadersGuard"); - Reflect.deleteProperty(Headers, "getHeadersList"); - Reflect.deleteProperty(Headers, "setHeadersList"); - iteratorMixin("Headers", Headers, kHeadersSortedMap, 0, 1); - Object.defineProperties(Headers.prototype, { - append: kEnumerableProperty, - delete: kEnumerableProperty, - get: kEnumerableProperty, - has: kEnumerableProperty, - set: kEnumerableProperty, - getSetCookie: kEnumerableProperty, - [Symbol.toStringTag]: { - value: "Headers", - configurable: true - }, - [util3.inspect.custom]: { - enumerable: false - } - }); - webidl.converters.HeadersInit = function(V, prefix, argument) { - if (webidl.util.Type(V) === "Object") { - const iterator2 = Reflect.get(V, Symbol.iterator); - if (!util3.types.isProxy(V) && iterator2 === Headers.prototype.entries) { - try { - return getHeadersList(V).entriesList; - } catch { - } - } - if (typeof iterator2 === "function") { - return webidl.converters["sequence>"](V, prefix, argument, iterator2.bind(V)); - } - return webidl.converters["record"](V, prefix, argument); - } - throw webidl.errors.conversionFailed({ - prefix: "Headers constructor", - argument: "Argument 1", - types: ["sequence>", "record"] - }); - }; - module2.exports = { - fill, - // for test. - compareHeaderName, - Headers, - HeadersList, - getHeadersGuard, - setHeadersGuard, - setHeadersList, - getHeadersList - }; - } -}); - -// node_modules/undici/lib/web/fetch/response.js -var require_response = __commonJS({ - "node_modules/undici/lib/web/fetch/response.js"(exports2, module2) { - "use strict"; - var { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); - var { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require_body(); - var util3 = require_util(); - var nodeUtil = require("node:util"); - var { kEnumerableProperty } = util3; - var { - isValidReasonPhrase, - isCancelled, - isAborted, - isBlobLike, - serializeJavascriptValueToJSONString, - isErrorLike, - isomorphicEncode, - environmentSettingsObject: relevantRealm - } = require_util2(); - var { - redirectStatusSet, - nullBodyStatus - } = require_constants3(); - var { kState, kHeaders } = require_symbols2(); - var { webidl } = require_webidl(); - var { FormData: FormData2 } = require_formdata(); - var { URLSerializer } = require_data_url(); - var { kConstruct } = require_symbols(); - var assert = require("node:assert"); - var { types: types2 } = require("node:util"); - var textEncoder = new TextEncoder("utf-8"); - var Response = class _Response { - // Creates network error Response. - static error() { - const responseObject = fromInnerResponse(makeNetworkError(), "immutable"); - return responseObject; - } - // https://fetch.spec.whatwg.org/#dom-response-json - static json(data, init2 = {}) { - webidl.argumentLengthCheck(arguments, 1, "Response.json"); - if (init2 !== null) { - init2 = webidl.converters.ResponseInit(init2); - } - const bytes = textEncoder.encode( - serializeJavascriptValueToJSONString(data) - ); - const body = extractBody(bytes); - const responseObject = fromInnerResponse(makeResponse({}), "response"); - initializeResponse(responseObject, init2, { body: body[0], type: "application/json" }); - return responseObject; - } - // Creates a redirect Response that redirects to url with status status. - static redirect(url2, status = 302) { - webidl.argumentLengthCheck(arguments, 1, "Response.redirect"); - url2 = webidl.converters.USVString(url2); - status = webidl.converters["unsigned short"](status); - let parsedURL; - try { - parsedURL = new URL(url2, relevantRealm.settingsObject.baseUrl); - } catch (err) { - throw new TypeError(`Failed to parse URL from ${url2}`, { cause: err }); - } - if (!redirectStatusSet.has(status)) { - throw new RangeError(`Invalid status code ${status}`); - } - const responseObject = fromInnerResponse(makeResponse({}), "immutable"); - responseObject[kState].status = status; - const value = isomorphicEncode(URLSerializer(parsedURL)); - responseObject[kState].headersList.append("location", value, true); - return responseObject; - } - // https://fetch.spec.whatwg.org/#dom-response - constructor(body = null, init2 = {}) { - webidl.util.markAsUncloneable(this); - if (body === kConstruct) { - return; - } - if (body !== null) { - body = webidl.converters.BodyInit(body); - } - init2 = webidl.converters.ResponseInit(init2); - this[kState] = makeResponse({}); - this[kHeaders] = new Headers(kConstruct); - setHeadersGuard(this[kHeaders], "response"); - setHeadersList(this[kHeaders], this[kState].headersList); - let bodyWithType = null; - if (body != null) { - const [extractedBody, type] = extractBody(body); - bodyWithType = { body: extractedBody, type }; - } - initializeResponse(this, init2, bodyWithType); - } - // Returns response’s type, e.g., "cors". - get type() { - webidl.brandCheck(this, _Response); - return this[kState].type; - } - // Returns response’s URL, if it has one; otherwise the empty string. - get url() { - webidl.brandCheck(this, _Response); - const urlList = this[kState].urlList; - const url2 = urlList[urlList.length - 1] ?? null; - if (url2 === null) { - return ""; - } - return URLSerializer(url2, true); - } - // Returns whether response was obtained through a redirect. - get redirected() { - webidl.brandCheck(this, _Response); - return this[kState].urlList.length > 1; - } - // Returns response’s status. - get status() { - webidl.brandCheck(this, _Response); - return this[kState].status; - } - // Returns whether response’s status is an ok status. - get ok() { - webidl.brandCheck(this, _Response); - return this[kState].status >= 200 && this[kState].status <= 299; - } - // Returns response’s status message. - get statusText() { - webidl.brandCheck(this, _Response); - return this[kState].statusText; - } - // Returns response’s headers as Headers. - get headers() { - webidl.brandCheck(this, _Response); - return this[kHeaders]; - } - get body() { - webidl.brandCheck(this, _Response); - return this[kState].body ? this[kState].body.stream : null; - } - get bodyUsed() { - webidl.brandCheck(this, _Response); - return !!this[kState].body && util3.isDisturbed(this[kState].body.stream); - } - // Returns a clone of response. - clone() { - webidl.brandCheck(this, _Response); - if (bodyUnusable(this)) { - throw webidl.errors.exception({ - header: "Response.clone", - message: "Body has already been consumed." - }); - } - const clonedResponse = cloneResponse(this[kState]); - if (hasFinalizationRegistry && this[kState].body?.stream) { - streamRegistry.register(this, new WeakRef(this[kState].body.stream)); - } - return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders])); - } - [nodeUtil.inspect.custom](depth, options) { - if (options.depth === null) { - options.depth = 2; - } - options.colors ??= true; - const properties = { - status: this.status, - statusText: this.statusText, - headers: this.headers, - body: this.body, - bodyUsed: this.bodyUsed, - ok: this.ok, - redirected: this.redirected, - type: this.type, - url: this.url - }; - return `Response ${nodeUtil.formatWithOptions(options, properties)}`; - } - }; - mixinBody(Response); - Object.defineProperties(Response.prototype, { - type: kEnumerableProperty, - url: kEnumerableProperty, - status: kEnumerableProperty, - ok: kEnumerableProperty, - redirected: kEnumerableProperty, - statusText: kEnumerableProperty, - headers: kEnumerableProperty, - clone: kEnumerableProperty, - body: kEnumerableProperty, - bodyUsed: kEnumerableProperty, - [Symbol.toStringTag]: { - value: "Response", - configurable: true - } - }); - Object.defineProperties(Response, { - json: kEnumerableProperty, - redirect: kEnumerableProperty, - error: kEnumerableProperty - }); - function cloneResponse(response) { - if (response.internalResponse) { - return filterResponse( - cloneResponse(response.internalResponse), - response.type - ); - } - const newResponse = makeResponse({ ...response, body: null }); - if (response.body != null) { - newResponse.body = cloneBody(newResponse, response.body); - } - return newResponse; - } - function makeResponse(init2) { - return { - aborted: false, - rangeRequested: false, - timingAllowPassed: false, - requestIncludesCredentials: false, - type: "default", - status: 200, - timingInfo: null, - cacheState: "", - statusText: "", - ...init2, - headersList: init2?.headersList ? new HeadersList(init2?.headersList) : new HeadersList(), - urlList: init2?.urlList ? [...init2.urlList] : [] - }; - } - function makeNetworkError(reason) { - const isError = isErrorLike(reason); - return makeResponse({ - type: "error", - status: 0, - error: isError ? reason : new Error(reason ? String(reason) : reason), - aborted: reason && reason.name === "AbortError" - }); - } - function isNetworkError(response) { - return ( - // A network error is a response whose type is "error", - response.type === "error" && // status is 0 - response.status === 0 - ); - } - function makeFilteredResponse(response, state) { - state = { - internalResponse: response, - ...state - }; - return new Proxy(response, { - get(target, p) { - return p in state ? state[p] : target[p]; - }, - set(target, p, value) { - assert(!(p in state)); - target[p] = value; - return true; - } - }); - } - function filterResponse(response, type) { - if (type === "basic") { - return makeFilteredResponse(response, { - type: "basic", - headersList: response.headersList - }); - } else if (type === "cors") { - return makeFilteredResponse(response, { - type: "cors", - headersList: response.headersList - }); - } else if (type === "opaque") { - return makeFilteredResponse(response, { - type: "opaque", - urlList: Object.freeze([]), - status: 0, - statusText: "", - body: null - }); - } else if (type === "opaqueredirect") { - return makeFilteredResponse(response, { - type: "opaqueredirect", - status: 0, - statusText: "", - headersList: [], - body: null - }); - } else { - assert(false); - } - } - function makeAppropriateNetworkError(fetchParams, err = null) { - assert(isCancelled(fetchParams)); - return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err })); - } - function initializeResponse(response, init2, body) { - if (init2.status !== null && (init2.status < 200 || init2.status > 599)) { - throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.'); - } - if ("statusText" in init2 && init2.statusText != null) { - if (!isValidReasonPhrase(String(init2.statusText))) { - throw new TypeError("Invalid statusText"); - } - } - if ("status" in init2 && init2.status != null) { - response[kState].status = init2.status; - } - if ("statusText" in init2 && init2.statusText != null) { - response[kState].statusText = init2.statusText; - } - if ("headers" in init2 && init2.headers != null) { - fill(response[kHeaders], init2.headers); - } - if (body) { - if (nullBodyStatus.includes(response.status)) { - throw webidl.errors.exception({ - header: "Response constructor", - message: `Invalid response status code ${response.status}` - }); - } - response[kState].body = body.body; - if (body.type != null && !response[kState].headersList.contains("content-type", true)) { - response[kState].headersList.append("content-type", body.type, true); - } - } - } - function fromInnerResponse(innerResponse, guard) { - const response = new Response(kConstruct); - response[kState] = innerResponse; - response[kHeaders] = new Headers(kConstruct); - setHeadersList(response[kHeaders], innerResponse.headersList); - setHeadersGuard(response[kHeaders], guard); - if (hasFinalizationRegistry && innerResponse.body?.stream) { - streamRegistry.register(response, new WeakRef(innerResponse.body.stream)); - } - return response; - } - webidl.converters.ReadableStream = webidl.interfaceConverter( - ReadableStream - ); - webidl.converters.FormData = webidl.interfaceConverter( - FormData2 - ); - webidl.converters.URLSearchParams = webidl.interfaceConverter( - URLSearchParams - ); - webidl.converters.XMLHttpRequestBodyInit = function(V, prefix, name) { - if (typeof V === "string") { - return webidl.converters.USVString(V, prefix, name); - } - if (isBlobLike(V)) { - return webidl.converters.Blob(V, prefix, name, { strict: false }); - } - if (ArrayBuffer.isView(V) || types2.isArrayBuffer(V)) { - return webidl.converters.BufferSource(V, prefix, name); - } - if (util3.isFormDataLike(V)) { - return webidl.converters.FormData(V, prefix, name, { strict: false }); - } - if (V instanceof URLSearchParams) { - return webidl.converters.URLSearchParams(V, prefix, name); - } - return webidl.converters.DOMString(V, prefix, name); - }; - webidl.converters.BodyInit = function(V, prefix, argument) { - if (V instanceof ReadableStream) { - return webidl.converters.ReadableStream(V, prefix, argument); - } - if (V?.[Symbol.asyncIterator]) { - return V; - } - return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument); - }; - webidl.converters.ResponseInit = webidl.dictionaryConverter([ - { - key: "status", - converter: webidl.converters["unsigned short"], - defaultValue: () => 200 - }, - { - key: "statusText", - converter: webidl.converters.ByteString, - defaultValue: () => "" - }, - { - key: "headers", - converter: webidl.converters.HeadersInit - } - ]); - module2.exports = { - isNetworkError, - makeNetworkError, - makeResponse, - makeAppropriateNetworkError, - filterResponse, - Response, - cloneResponse, - fromInnerResponse - }; - } -}); - -// node_modules/undici/lib/web/fetch/dispatcher-weakref.js -var require_dispatcher_weakref = __commonJS({ - "node_modules/undici/lib/web/fetch/dispatcher-weakref.js"(exports2, module2) { - "use strict"; - var { kConnected, kSize } = require_symbols(); - var CompatWeakRef = class { - constructor(value) { - this.value = value; - } - deref() { - return this.value[kConnected] === 0 && this.value[kSize] === 0 ? void 0 : this.value; - } - }; - var CompatFinalizer = class { - constructor(finalizer) { - this.finalizer = finalizer; - } - register(dispatcher, key) { - if (dispatcher.on) { - dispatcher.on("disconnect", () => { - if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { - this.finalizer(key); - } - }); - } - } - unregister(key) { - } - }; - module2.exports = function() { - if (process.env.NODE_V8_COVERAGE && process.version.startsWith("v18")) { - process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"); - return { - WeakRef: CompatWeakRef, - FinalizationRegistry: CompatFinalizer - }; - } - return { WeakRef, FinalizationRegistry }; - }; - } -}); - -// node_modules/undici/lib/web/fetch/request.js -var require_request2 = __commonJS({ - "node_modules/undici/lib/web/fetch/request.js"(exports2, module2) { - "use strict"; - var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body(); - var { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); - var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()(); - var util3 = require_util(); - var nodeUtil = require("node:util"); - var { - isValidHTTPToken, - sameOrigin, - environmentSettingsObject - } = require_util2(); - var { - forbiddenMethodsSet, - corsSafeListedMethodsSet, - referrerPolicy, - requestRedirect, - requestMode, - requestCredentials, - requestCache, - requestDuplex - } = require_constants3(); - var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util3; - var { kHeaders, kSignal, kState, kDispatcher } = require_symbols2(); - var { webidl } = require_webidl(); - var { URLSerializer } = require_data_url(); - var { kConstruct } = require_symbols(); - var assert = require("node:assert"); - var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("node:events"); - var kAbortController = /* @__PURE__ */ Symbol("abortController"); - var requestFinalizer = new FinalizationRegistry2(({ signal, abort }) => { - signal.removeEventListener("abort", abort); - }); - var dependentControllerMap = /* @__PURE__ */ new WeakMap(); - function buildAbort(acRef) { - return abort; - function abort() { - const ac = acRef.deref(); - if (ac !== void 0) { - requestFinalizer.unregister(abort); - this.removeEventListener("abort", abort); - ac.abort(this.reason); - const controllerList = dependentControllerMap.get(ac.signal); - if (controllerList !== void 0) { - if (controllerList.size !== 0) { - for (const ref of controllerList) { - const ctrl = ref.deref(); - if (ctrl !== void 0) { - ctrl.abort(this.reason); - } - } - controllerList.clear(); - } - dependentControllerMap.delete(ac.signal); - } - } - } - } - var patchMethodWarning = false; - var Request = class _Request { - // https://fetch.spec.whatwg.org/#dom-request - constructor(input, init2 = {}) { - webidl.util.markAsUncloneable(this); - if (input === kConstruct) { - return; - } - const prefix = "Request constructor"; - webidl.argumentLengthCheck(arguments, 1, prefix); - input = webidl.converters.RequestInfo(input, prefix, "input"); - init2 = webidl.converters.RequestInit(init2, prefix, "init"); - let request3 = null; - let fallbackMode = null; - const baseUrl = environmentSettingsObject.settingsObject.baseUrl; - let signal = null; - if (typeof input === "string") { - this[kDispatcher] = init2.dispatcher; - let parsedURL; - try { - parsedURL = new URL(input, baseUrl); - } catch (err) { - throw new TypeError("Failed to parse URL from " + input, { cause: err }); - } - if (parsedURL.username || parsedURL.password) { - throw new TypeError( - "Request cannot be constructed from a URL that includes credentials: " + input - ); - } - request3 = makeRequest({ urlList: [parsedURL] }); - fallbackMode = "cors"; - } else { - this[kDispatcher] = init2.dispatcher || input[kDispatcher]; - assert(input instanceof _Request); - request3 = input[kState]; - signal = input[kSignal]; - } - const origin = environmentSettingsObject.settingsObject.origin; - let window2 = "client"; - if (request3.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request3.window, origin)) { - window2 = request3.window; - } - if (init2.window != null) { - throw new TypeError(`'window' option '${window2}' must be null`); - } - if ("window" in init2) { - window2 = "no-window"; - } - request3 = makeRequest({ - // URL request’s URL. - // undici implementation note: this is set as the first item in request's urlList in makeRequest - // method request’s method. - method: request3.method, - // header list A copy of request’s header list. - // undici implementation note: headersList is cloned in makeRequest - headersList: request3.headersList, - // unsafe-request flag Set. - unsafeRequest: request3.unsafeRequest, - // client This’s relevant settings object. - client: environmentSettingsObject.settingsObject, - // window window. - window: window2, - // priority request’s priority. - priority: request3.priority, - // origin request’s origin. The propagation of the origin is only significant for navigation requests - // being handled by a service worker. In this scenario a request can have an origin that is different - // from the current client. - origin: request3.origin, - // referrer request’s referrer. - referrer: request3.referrer, - // referrer policy request’s referrer policy. - referrerPolicy: request3.referrerPolicy, - // mode request’s mode. - mode: request3.mode, - // credentials mode request’s credentials mode. - credentials: request3.credentials, - // cache mode request’s cache mode. - cache: request3.cache, - // redirect mode request’s redirect mode. - redirect: request3.redirect, - // integrity metadata request’s integrity metadata. - integrity: request3.integrity, - // keepalive request’s keepalive. - keepalive: request3.keepalive, - // reload-navigation flag request’s reload-navigation flag. - reloadNavigation: request3.reloadNavigation, - // history-navigation flag request’s history-navigation flag. - historyNavigation: request3.historyNavigation, - // URL list A clone of request’s URL list. - urlList: [...request3.urlList] - }); - const initHasKey = Object.keys(init2).length !== 0; - if (initHasKey) { - if (request3.mode === "navigate") { - request3.mode = "same-origin"; - } - request3.reloadNavigation = false; - request3.historyNavigation = false; - request3.origin = "client"; - request3.referrer = "client"; - request3.referrerPolicy = ""; - request3.url = request3.urlList[request3.urlList.length - 1]; - request3.urlList = [request3.url]; - } - if (init2.referrer !== void 0) { - const referrer = init2.referrer; - if (referrer === "") { - request3.referrer = "no-referrer"; - } else { - let parsedReferrer; - try { - parsedReferrer = new URL(referrer, baseUrl); - } catch (err) { - throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }); - } - if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl)) { - request3.referrer = "client"; - } else { - request3.referrer = parsedReferrer; - } - } - } - if (init2.referrerPolicy !== void 0) { - request3.referrerPolicy = init2.referrerPolicy; - } - let mode; - if (init2.mode !== void 0) { - mode = init2.mode; - } else { - mode = fallbackMode; - } - if (mode === "navigate") { - throw webidl.errors.exception({ - header: "Request constructor", - message: "invalid request mode navigate." - }); - } - if (mode != null) { - request3.mode = mode; - } - if (init2.credentials !== void 0) { - request3.credentials = init2.credentials; - } - if (init2.cache !== void 0) { - request3.cache = init2.cache; - } - if (request3.cache === "only-if-cached" && request3.mode !== "same-origin") { - throw new TypeError( - "'only-if-cached' can be set only with 'same-origin' mode" - ); - } - if (init2.redirect !== void 0) { - request3.redirect = init2.redirect; - } - if (init2.integrity != null) { - request3.integrity = String(init2.integrity); - } - if (init2.keepalive !== void 0) { - request3.keepalive = Boolean(init2.keepalive); - } - if (init2.method !== void 0) { - let method = init2.method; - const mayBeNormalized = normalizedMethodRecords[method]; - if (mayBeNormalized !== void 0) { - request3.method = mayBeNormalized; - } else { - if (!isValidHTTPToken(method)) { - throw new TypeError(`'${method}' is not a valid HTTP method.`); - } - const upperCase = method.toUpperCase(); - if (forbiddenMethodsSet.has(upperCase)) { - throw new TypeError(`'${method}' HTTP method is unsupported.`); - } - method = normalizedMethodRecordsBase[upperCase] ?? method; - request3.method = method; - } - if (!patchMethodWarning && request3.method === "patch") { - process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.", { - code: "UNDICI-FETCH-patch" - }); - patchMethodWarning = true; - } - } - if (init2.signal !== void 0) { - signal = init2.signal; - } - this[kState] = request3; - const ac = new AbortController(); - this[kSignal] = ac.signal; - if (signal != null) { - if (!signal || typeof signal.aborted !== "boolean" || typeof signal.addEventListener !== "function") { - throw new TypeError( - "Failed to construct 'Request': member signal is not of type AbortSignal." - ); - } - if (signal.aborted) { - ac.abort(signal.reason); - } else { - this[kAbortController] = ac; - const acRef = new WeakRef(ac); - const abort = buildAbort(acRef); - try { - if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) { - setMaxListeners(1500, signal); - } else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) { - setMaxListeners(1500, signal); - } - } catch { - } - util3.addAbortListener(signal, abort); - requestFinalizer.register(ac, { signal, abort }, abort); - } - } - this[kHeaders] = new Headers(kConstruct); - setHeadersList(this[kHeaders], request3.headersList); - setHeadersGuard(this[kHeaders], "request"); - if (mode === "no-cors") { - if (!corsSafeListedMethodsSet.has(request3.method)) { - throw new TypeError( - `'${request3.method} is unsupported in no-cors mode.` - ); - } - setHeadersGuard(this[kHeaders], "request-no-cors"); - } - if (initHasKey) { - const headersList = getHeadersList(this[kHeaders]); - const headers = init2.headers !== void 0 ? init2.headers : new HeadersList(headersList); - headersList.clear(); - if (headers instanceof HeadersList) { - for (const { name, value } of headers.rawValues()) { - headersList.append(name, value, false); - } - headersList.cookies = headers.cookies; - } else { - fillHeaders(this[kHeaders], headers); - } - } - const inputBody = input instanceof _Request ? input[kState].body : null; - if ((init2.body != null || inputBody != null) && (request3.method === "GET" || request3.method === "HEAD")) { - throw new TypeError("Request with GET/HEAD method cannot have body."); - } - let initBody = null; - if (init2.body != null) { - const [extractedBody, contentType] = extractBody( - init2.body, - request3.keepalive - ); - initBody = extractedBody; - if (contentType && !getHeadersList(this[kHeaders]).contains("content-type", true)) { - this[kHeaders].append("content-type", contentType); - } - } - const inputOrInitBody = initBody ?? inputBody; - if (inputOrInitBody != null && inputOrInitBody.source == null) { - if (initBody != null && init2.duplex == null) { - throw new TypeError("RequestInit: duplex option is required when sending a body."); - } - if (request3.mode !== "same-origin" && request3.mode !== "cors") { - throw new TypeError( - 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' - ); - } - request3.useCORSPreflightFlag = true; - } - let finalBody = inputOrInitBody; - if (initBody == null && inputBody != null) { - if (bodyUnusable(input)) { - throw new TypeError( - "Cannot construct a Request with a Request object that has already been used." - ); - } - const identityTransform = new TransformStream(); - inputBody.stream.pipeThrough(identityTransform); - finalBody = { - source: inputBody.source, - length: inputBody.length, - stream: identityTransform.readable - }; - } - this[kState].body = finalBody; - } - // Returns request’s HTTP method, which is "GET" by default. - get method() { - webidl.brandCheck(this, _Request); - return this[kState].method; - } - // Returns the URL of request as a string. - get url() { - webidl.brandCheck(this, _Request); - return URLSerializer(this[kState].url); - } - // Returns a Headers object consisting of the headers associated with request. - // Note that headers added in the network layer by the user agent will not - // be accounted for in this object, e.g., the "Host" header. - get headers() { - webidl.brandCheck(this, _Request); - return this[kHeaders]; - } - // Returns the kind of resource requested by request, e.g., "document" - // or "script". - get destination() { - webidl.brandCheck(this, _Request); - return this[kState].destination; - } - // Returns the referrer of request. Its value can be a same-origin URL if - // explicitly set in init, the empty string to indicate no referrer, and - // "about:client" when defaulting to the global’s default. This is used - // during fetching to determine the value of the `Referer` header of the - // request being made. - get referrer() { - webidl.brandCheck(this, _Request); - if (this[kState].referrer === "no-referrer") { - return ""; - } - if (this[kState].referrer === "client") { - return "about:client"; - } - return this[kState].referrer.toString(); - } - // Returns the referrer policy associated with request. - // This is used during fetching to compute the value of the request’s - // referrer. - get referrerPolicy() { - webidl.brandCheck(this, _Request); - return this[kState].referrerPolicy; - } - // Returns the mode associated with request, which is a string indicating - // whether the request will use CORS, or will be restricted to same-origin - // URLs. - get mode() { - webidl.brandCheck(this, _Request); - return this[kState].mode; - } - // Returns the credentials mode associated with request, - // which is a string indicating whether credentials will be sent with the - // request always, never, or only when sent to a same-origin URL. - get credentials() { - return this[kState].credentials; - } - // Returns the cache mode associated with request, - // which is a string indicating how the request will - // interact with the browser’s cache when fetching. - get cache() { - webidl.brandCheck(this, _Request); - return this[kState].cache; - } - // Returns the redirect mode associated with request, - // which is a string indicating how redirects for the - // request will be handled during fetching. A request - // will follow redirects by default. - get redirect() { - webidl.brandCheck(this, _Request); - return this[kState].redirect; - } - // Returns request’s subresource integrity metadata, which is a - // cryptographic hash of the resource being fetched. Its value - // consists of multiple hashes separated by whitespace. [SRI] - get integrity() { - webidl.brandCheck(this, _Request); - return this[kState].integrity; - } - // Returns a boolean indicating whether or not request can outlive the - // global in which it was created. - get keepalive() { - webidl.brandCheck(this, _Request); - return this[kState].keepalive; - } - // Returns a boolean indicating whether or not request is for a reload - // navigation. - get isReloadNavigation() { - webidl.brandCheck(this, _Request); - return this[kState].reloadNavigation; - } - // Returns a boolean indicating whether or not request is for a history - // navigation (a.k.a. back-forward navigation). - get isHistoryNavigation() { - webidl.brandCheck(this, _Request); - return this[kState].historyNavigation; - } - // Returns the signal associated with request, which is an AbortSignal - // object indicating whether or not request has been aborted, and its - // abort event handler. - get signal() { - webidl.brandCheck(this, _Request); - return this[kSignal]; - } - get body() { - webidl.brandCheck(this, _Request); - return this[kState].body ? this[kState].body.stream : null; - } - get bodyUsed() { - webidl.brandCheck(this, _Request); - return !!this[kState].body && util3.isDisturbed(this[kState].body.stream); - } - get duplex() { - webidl.brandCheck(this, _Request); - return "half"; - } - // Returns a clone of request. - clone() { - webidl.brandCheck(this, _Request); - if (bodyUnusable(this)) { - throw new TypeError("unusable"); - } - const clonedRequest = cloneRequest(this[kState]); - const ac = new AbortController(); - if (this.signal.aborted) { - ac.abort(this.signal.reason); - } else { - let list = dependentControllerMap.get(this.signal); - if (list === void 0) { - list = /* @__PURE__ */ new Set(); - dependentControllerMap.set(this.signal, list); - } - const acRef = new WeakRef(ac); - list.add(acRef); - util3.addAbortListener( - ac.signal, - buildAbort(acRef) - ); - } - return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders])); - } - [nodeUtil.inspect.custom](depth, options) { - if (options.depth === null) { - options.depth = 2; - } - options.colors ??= true; - const properties = { - method: this.method, - url: this.url, - headers: this.headers, - destination: this.destination, - referrer: this.referrer, - referrerPolicy: this.referrerPolicy, - mode: this.mode, - credentials: this.credentials, - cache: this.cache, - redirect: this.redirect, - integrity: this.integrity, - keepalive: this.keepalive, - isReloadNavigation: this.isReloadNavigation, - isHistoryNavigation: this.isHistoryNavigation, - signal: this.signal - }; - return `Request ${nodeUtil.formatWithOptions(options, properties)}`; - } - }; - mixinBody(Request); - function makeRequest(init2) { - return { - method: init2.method ?? "GET", - localURLsOnly: init2.localURLsOnly ?? false, - unsafeRequest: init2.unsafeRequest ?? false, - body: init2.body ?? null, - client: init2.client ?? null, - reservedClient: init2.reservedClient ?? null, - replacesClientId: init2.replacesClientId ?? "", - window: init2.window ?? "client", - keepalive: init2.keepalive ?? false, - serviceWorkers: init2.serviceWorkers ?? "all", - initiator: init2.initiator ?? "", - destination: init2.destination ?? "", - priority: init2.priority ?? null, - origin: init2.origin ?? "client", - policyContainer: init2.policyContainer ?? "client", - referrer: init2.referrer ?? "client", - referrerPolicy: init2.referrerPolicy ?? "", - mode: init2.mode ?? "no-cors", - useCORSPreflightFlag: init2.useCORSPreflightFlag ?? false, - credentials: init2.credentials ?? "same-origin", - useCredentials: init2.useCredentials ?? false, - cache: init2.cache ?? "default", - redirect: init2.redirect ?? "follow", - integrity: init2.integrity ?? "", - cryptoGraphicsNonceMetadata: init2.cryptoGraphicsNonceMetadata ?? "", - parserMetadata: init2.parserMetadata ?? "", - reloadNavigation: init2.reloadNavigation ?? false, - historyNavigation: init2.historyNavigation ?? false, - userActivation: init2.userActivation ?? false, - taintedOrigin: init2.taintedOrigin ?? false, - redirectCount: init2.redirectCount ?? 0, - responseTainting: init2.responseTainting ?? "basic", - preventNoCacheCacheControlHeaderModification: init2.preventNoCacheCacheControlHeaderModification ?? false, - done: init2.done ?? false, - timingAllowFailed: init2.timingAllowFailed ?? false, - urlList: init2.urlList, - url: init2.urlList[0], - headersList: init2.headersList ? new HeadersList(init2.headersList) : new HeadersList() - }; - } - function cloneRequest(request3) { - const newRequest = makeRequest({ ...request3, body: null }); - if (request3.body != null) { - newRequest.body = cloneBody(newRequest, request3.body); - } - return newRequest; - } - function fromInnerRequest(innerRequest, signal, guard) { - const request3 = new Request(kConstruct); - request3[kState] = innerRequest; - request3[kSignal] = signal; - request3[kHeaders] = new Headers(kConstruct); - setHeadersList(request3[kHeaders], innerRequest.headersList); - setHeadersGuard(request3[kHeaders], guard); - return request3; - } - Object.defineProperties(Request.prototype, { - method: kEnumerableProperty, - url: kEnumerableProperty, - headers: kEnumerableProperty, - redirect: kEnumerableProperty, - clone: kEnumerableProperty, - signal: kEnumerableProperty, - duplex: kEnumerableProperty, - destination: kEnumerableProperty, - body: kEnumerableProperty, - bodyUsed: kEnumerableProperty, - isHistoryNavigation: kEnumerableProperty, - isReloadNavigation: kEnumerableProperty, - keepalive: kEnumerableProperty, - integrity: kEnumerableProperty, - cache: kEnumerableProperty, - credentials: kEnumerableProperty, - attribute: kEnumerableProperty, - referrerPolicy: kEnumerableProperty, - referrer: kEnumerableProperty, - mode: kEnumerableProperty, - [Symbol.toStringTag]: { - value: "Request", - configurable: true - } - }); - webidl.converters.Request = webidl.interfaceConverter( - Request - ); - webidl.converters.RequestInfo = function(V, prefix, argument) { - if (typeof V === "string") { - return webidl.converters.USVString(V, prefix, argument); - } - if (V instanceof Request) { - return webidl.converters.Request(V, prefix, argument); - } - return webidl.converters.USVString(V, prefix, argument); - }; - webidl.converters.AbortSignal = webidl.interfaceConverter( - AbortSignal - ); - webidl.converters.RequestInit = webidl.dictionaryConverter([ - { - key: "method", - converter: webidl.converters.ByteString - }, - { - key: "headers", - converter: webidl.converters.HeadersInit - }, - { - key: "body", - converter: webidl.nullableConverter( - webidl.converters.BodyInit - ) - }, - { - key: "referrer", - converter: webidl.converters.USVString - }, - { - key: "referrerPolicy", - converter: webidl.converters.DOMString, - // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy - allowedValues: referrerPolicy - }, - { - key: "mode", - converter: webidl.converters.DOMString, - // https://fetch.spec.whatwg.org/#concept-request-mode - allowedValues: requestMode - }, - { - key: "credentials", - converter: webidl.converters.DOMString, - // https://fetch.spec.whatwg.org/#requestcredentials - allowedValues: requestCredentials - }, - { - key: "cache", - converter: webidl.converters.DOMString, - // https://fetch.spec.whatwg.org/#requestcache - allowedValues: requestCache - }, - { - key: "redirect", - converter: webidl.converters.DOMString, - // https://fetch.spec.whatwg.org/#requestredirect - allowedValues: requestRedirect - }, - { - key: "integrity", - converter: webidl.converters.DOMString - }, - { - key: "keepalive", - converter: webidl.converters.boolean - }, - { - key: "signal", - converter: webidl.nullableConverter( - (signal) => webidl.converters.AbortSignal( - signal, - "RequestInit", - "signal", - { strict: false } - ) - ) - }, - { - key: "window", - converter: webidl.converters.any - }, - { - key: "duplex", - converter: webidl.converters.DOMString, - allowedValues: requestDuplex - }, - { - key: "dispatcher", - // undici specific option - converter: webidl.converters.any - } - ]); - module2.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }; - } -}); - -// node_modules/undici/lib/web/fetch/index.js -var require_fetch = __commonJS({ - "node_modules/undici/lib/web/fetch/index.js"(exports2, module2) { - "use strict"; - var { - makeNetworkError, - makeAppropriateNetworkError, - filterResponse, - makeResponse, - fromInnerResponse - } = require_response(); - var { HeadersList } = require_headers(); - var { Request, cloneRequest } = require_request2(); - var zlib3 = require("node:zlib"); - var { - bytesMatch, - makePolicyContainer, - clonePolicyContainer, - requestBadPort, - TAOCheck, - appendRequestOriginHeader, - responseLocationURL, - requestCurrentURL, - setRequestReferrerPolicyOnRedirect, - tryUpgradeRequestToAPotentiallyTrustworthyURL, - createOpaqueTimingInfo, - appendFetchMetadata, - corsCheck, - crossOriginResourcePolicyCheck, - determineRequestsReferrer, - coarsenedSharedCurrentTime, - createDeferredPromise, - isBlobLike, - sameOrigin, - isCancelled, - isAborted, - isErrorLike, - fullyReadBody, - readableStreamClose, - isomorphicEncode, - urlIsLocal, - urlIsHttpHttpsScheme, - urlHasHttpsScheme, - clampAndCoarsenConnectionTimingInfo, - simpleRangeHeaderValue, - buildContentRange, - createInflate, - extractMimeType - } = require_util2(); - var { kState, kDispatcher } = require_symbols2(); - var assert = require("node:assert"); - var { safelyExtractBody, extractBody } = require_body(); - var { - redirectStatusSet, - nullBodyStatus, - safeMethodsSet, - requestBodyHeader, - subresourceSet - } = require_constants3(); - var EE = require("node:events"); - var { Readable: Readable3, pipeline: pipeline2, finished } = require("node:stream"); - var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util(); - var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url(); - var { getGlobalDispatcher } = require_global2(); - var { webidl } = require_webidl(); - var { STATUS_CODES } = require("node:http"); - var GET_OR_HEAD = ["GET", "HEAD"]; - var defaultUserAgent = typeof __UNDICI_IS_NODE__ !== "undefined" || typeof esbuildDetection !== "undefined" ? "node" : "undici"; - var resolveObjectURL; - var Fetch = class extends EE { - constructor(dispatcher) { - super(); - this.dispatcher = dispatcher; - this.connection = null; - this.dump = false; - this.state = "ongoing"; - } - terminate(reason) { - if (this.state !== "ongoing") { - return; - } - this.state = "terminated"; - this.connection?.destroy(reason); - this.emit("terminated", reason); - } - // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error3) { - if (this.state !== "ongoing") { - return; - } - this.state = "aborted"; - if (!error3) { - error3 = new DOMException("The operation was aborted.", "AbortError"); - } - this.serializedAbortReason = error3; - this.connection?.destroy(error3); - this.emit("terminated", error3); - } - }; - function handleFetchDone(response) { - finalizeAndReportTiming(response, "fetch"); - } - function fetch(input, init2 = void 0) { - webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch"); - let p = createDeferredPromise(); - let requestObject; - try { - requestObject = new Request(input, init2); - } catch (e) { - p.reject(e); - return p.promise; - } - const request3 = requestObject[kState]; - if (requestObject.signal.aborted) { - abortFetch(p, request3, null, requestObject.signal.reason); - return p.promise; - } - const globalObject = request3.client.globalObject; - if (globalObject?.constructor?.name === "ServiceWorkerGlobalScope") { - request3.serviceWorkers = "none"; - } - let responseObject = null; - let locallyAborted = false; - let controller = null; - addAbortListener( - requestObject.signal, - () => { - locallyAborted = true; - assert(controller != null); - controller.abort(requestObject.signal.reason); - const realResponse = responseObject?.deref(); - abortFetch(p, request3, realResponse, requestObject.signal.reason); - } - ); - const processResponse = (response) => { - if (locallyAborted) { - return; - } - if (response.aborted) { - abortFetch(p, request3, responseObject, controller.serializedAbortReason); - return; - } - if (response.type === "error") { - p.reject(new TypeError("fetch failed", { cause: response.error })); - return; - } - responseObject = new WeakRef(fromInnerResponse(response, "immutable")); - p.resolve(responseObject.deref()); - p = null; - }; - controller = fetching({ - request: request3, - processResponseEndOfBody: handleFetchDone, - processResponse, - dispatcher: requestObject[kDispatcher] - // undici - }); - return p.promise; - } - function finalizeAndReportTiming(response, initiatorType = "other") { - if (response.type === "error" && response.aborted) { - return; - } - if (!response.urlList?.length) { - return; - } - const originalURL = response.urlList[0]; - let timingInfo = response.timingInfo; - let cacheState = response.cacheState; - if (!urlIsHttpHttpsScheme(originalURL)) { - return; - } - if (timingInfo === null) { - return; - } - if (!response.timingAllowPassed) { - timingInfo = createOpaqueTimingInfo({ - startTime: timingInfo.startTime - }); - cacheState = ""; - } - timingInfo.endTime = coarsenedSharedCurrentTime(); - response.timingInfo = timingInfo; - markResourceTiming( - timingInfo, - originalURL.href, - initiatorType, - globalThis, - cacheState - ); - } - var markResourceTiming = performance.markResourceTiming; - function abortFetch(p, request3, responseObject, error3) { - if (p) { - p.reject(error3); - } - if (request3.body != null && isReadable(request3.body?.stream)) { - request3.body.stream.cancel(error3).catch((err) => { - if (err.code === "ERR_INVALID_STATE") { - return; - } - throw err; - }); - } - if (responseObject == null) { - return; - } - const response = responseObject[kState]; - if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error3).catch((err) => { - if (err.code === "ERR_INVALID_STATE") { - return; - } - throw err; - }); - } - } - function fetching({ - request: request3, - processRequestBodyChunkLength, - processRequestEndOfBody, - processResponse, - processResponseEndOfBody, - processResponseConsumeBody, - useParallelQueue = false, - dispatcher = getGlobalDispatcher() - // undici - }) { - assert(dispatcher); - let taskDestination = null; - let crossOriginIsolatedCapability = false; - if (request3.client != null) { - taskDestination = request3.client.globalObject; - crossOriginIsolatedCapability = request3.client.crossOriginIsolatedCapability; - } - const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability); - const timingInfo = createOpaqueTimingInfo({ - startTime: currentTime - }); - const fetchParams = { - controller: new Fetch(dispatcher), - request: request3, - timingInfo, - processRequestBodyChunkLength, - processRequestEndOfBody, - processResponse, - processResponseConsumeBody, - processResponseEndOfBody, - taskDestination, - crossOriginIsolatedCapability - }; - assert(!request3.body || request3.body.stream); - if (request3.window === "client") { - request3.window = request3.client?.globalObject?.constructor?.name === "Window" ? request3.client : "no-window"; - } - if (request3.origin === "client") { - request3.origin = request3.client.origin; - } - if (request3.policyContainer === "client") { - if (request3.client != null) { - request3.policyContainer = clonePolicyContainer( - request3.client.policyContainer - ); - } else { - request3.policyContainer = makePolicyContainer(); - } - } - if (!request3.headersList.contains("accept", true)) { - const value = "*/*"; - request3.headersList.append("accept", value, true); - } - if (!request3.headersList.contains("accept-language", true)) { - request3.headersList.append("accept-language", "*", true); - } - if (request3.priority === null) { - } - if (subresourceSet.has(request3.destination)) { - } - mainFetch(fetchParams).catch((err) => { - fetchParams.controller.terminate(err); - }); - return fetchParams.controller; - } - async function mainFetch(fetchParams, recursive = false) { - const request3 = fetchParams.request; - let response = null; - if (request3.localURLsOnly && !urlIsLocal(requestCurrentURL(request3))) { - response = makeNetworkError("local URLs only"); - } - tryUpgradeRequestToAPotentiallyTrustworthyURL(request3); - if (requestBadPort(request3) === "blocked") { - response = makeNetworkError("bad port"); - } - if (request3.referrerPolicy === "") { - request3.referrerPolicy = request3.policyContainer.referrerPolicy; - } - if (request3.referrer !== "no-referrer") { - request3.referrer = determineRequestsReferrer(request3); - } - if (response === null) { - response = await (async () => { - const currentURL = requestCurrentURL(request3); - if ( - // - request’s current URL’s origin is same origin with request’s origin, - // and request’s response tainting is "basic" - sameOrigin(currentURL, request3.url) && request3.responseTainting === "basic" || // request’s current URL’s scheme is "data" - currentURL.protocol === "data:" || // - request’s mode is "navigate" or "websocket" - (request3.mode === "navigate" || request3.mode === "websocket") - ) { - request3.responseTainting = "basic"; - return await schemeFetch(fetchParams); - } - if (request3.mode === "same-origin") { - return makeNetworkError('request mode cannot be "same-origin"'); - } - if (request3.mode === "no-cors") { - if (request3.redirect !== "follow") { - return makeNetworkError( - 'redirect mode cannot be "follow" for "no-cors" request' - ); - } - request3.responseTainting = "opaque"; - return await schemeFetch(fetchParams); - } - if (!urlIsHttpHttpsScheme(requestCurrentURL(request3))) { - return makeNetworkError("URL scheme must be a HTTP(S) scheme"); - } - request3.responseTainting = "cors"; - return await httpFetch(fetchParams); - })(); - } - if (recursive) { - return response; - } - if (response.status !== 0 && !response.internalResponse) { - if (request3.responseTainting === "cors") { - } - if (request3.responseTainting === "basic") { - response = filterResponse(response, "basic"); - } else if (request3.responseTainting === "cors") { - response = filterResponse(response, "cors"); - } else if (request3.responseTainting === "opaque") { - response = filterResponse(response, "opaque"); - } else { - assert(false); - } - } - let internalResponse = response.status === 0 ? response : response.internalResponse; - if (internalResponse.urlList.length === 0) { - internalResponse.urlList.push(...request3.urlList); - } - if (!request3.timingAllowFailed) { - response.timingAllowPassed = true; - } - if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request3.headers.contains("range", true)) { - response = internalResponse = makeNetworkError(); - } - if (response.status !== 0 && (request3.method === "HEAD" || request3.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { - internalResponse.body = null; - fetchParams.controller.dump = true; - } - if (request3.integrity) { - const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason)); - if (request3.responseTainting === "opaque" || response.body == null) { - processBodyError(response.error); - return; - } - const processBody = (bytes) => { - if (!bytesMatch(bytes, request3.integrity)) { - processBodyError("integrity mismatch"); - return; - } - response.body = safelyExtractBody(bytes)[0]; - fetchFinale(fetchParams, response); - }; - await fullyReadBody(response.body, processBody, processBodyError); - } else { - fetchFinale(fetchParams, response); - } - } - function schemeFetch(fetchParams) { - if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { - return Promise.resolve(makeAppropriateNetworkError(fetchParams)); - } - const { request: request3 } = fetchParams; - const { protocol: scheme } = requestCurrentURL(request3); - switch (scheme) { - case "about:": { - return Promise.resolve(makeNetworkError("about scheme is not supported")); - } - case "blob:": { - if (!resolveObjectURL) { - resolveObjectURL = require("node:buffer").resolveObjectURL; - } - const blobURLEntry = requestCurrentURL(request3); - if (blobURLEntry.search.length !== 0) { - return Promise.resolve(makeNetworkError("NetworkError when attempting to fetch resource.")); - } - const blob = resolveObjectURL(blobURLEntry.toString()); - if (request3.method !== "GET" || !isBlobLike(blob)) { - return Promise.resolve(makeNetworkError("invalid method")); - } - const response = makeResponse(); - const fullLength = blob.size; - const serializedFullLength = isomorphicEncode(`${fullLength}`); - const type = blob.type; - if (!request3.headersList.contains("range", true)) { - const bodyWithType = extractBody(blob); - response.statusText = "OK"; - response.body = bodyWithType[0]; - response.headersList.set("content-length", serializedFullLength, true); - response.headersList.set("content-type", type, true); - } else { - response.rangeRequested = true; - const rangeHeader = request3.headersList.get("range", true); - const rangeValue = simpleRangeHeaderValue(rangeHeader, true); - if (rangeValue === "failure") { - return Promise.resolve(makeNetworkError("failed to fetch the data URL")); - } - let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue; - if (rangeStart === null) { - rangeStart = fullLength - rangeEnd; - rangeEnd = rangeStart + rangeEnd - 1; - } else { - if (rangeStart >= fullLength) { - return Promise.resolve(makeNetworkError("Range start is greater than the blob's size.")); - } - if (rangeEnd === null || rangeEnd >= fullLength) { - rangeEnd = fullLength - 1; - } - } - const slicedBlob = blob.slice(rangeStart, rangeEnd, type); - const slicedBodyWithType = extractBody(slicedBlob); - response.body = slicedBodyWithType[0]; - const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`); - const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength); - response.status = 206; - response.statusText = "Partial Content"; - response.headersList.set("content-length", serializedSlicedLength, true); - response.headersList.set("content-type", type, true); - response.headersList.set("content-range", contentRange, true); - } - return Promise.resolve(response); - } - case "data:": { - const currentURL = requestCurrentURL(request3); - const dataURLStruct = dataURLProcessor(currentURL); - if (dataURLStruct === "failure") { - return Promise.resolve(makeNetworkError("failed to fetch the data URL")); - } - const mimeType = serializeAMimeType(dataURLStruct.mimeType); - return Promise.resolve(makeResponse({ - statusText: "OK", - headersList: [ - ["content-type", { name: "Content-Type", value: mimeType }] - ], - body: safelyExtractBody(dataURLStruct.body)[0] - })); - } - case "file:": { - return Promise.resolve(makeNetworkError("not implemented... yet...")); - } - case "http:": - case "https:": { - return httpFetch(fetchParams).catch((err) => makeNetworkError(err)); - } - default: { - return Promise.resolve(makeNetworkError("unknown scheme")); - } - } - } - function finalizeResponse(fetchParams, response) { - fetchParams.request.done = true; - if (fetchParams.processResponseDone != null) { - queueMicrotask(() => fetchParams.processResponseDone(response)); - } - } - function fetchFinale(fetchParams, response) { - let timingInfo = fetchParams.timingInfo; - const processResponseEndOfBody = () => { - const unsafeEndTime = Date.now(); - if (fetchParams.request.destination === "document") { - fetchParams.controller.fullTimingInfo = timingInfo; - } - fetchParams.controller.reportTimingSteps = () => { - if (fetchParams.request.url.protocol !== "https:") { - return; - } - timingInfo.endTime = unsafeEndTime; - let cacheState = response.cacheState; - const bodyInfo = response.bodyInfo; - if (!response.timingAllowPassed) { - timingInfo = createOpaqueTimingInfo(timingInfo); - cacheState = ""; - } - let responseStatus = 0; - if (fetchParams.request.mode !== "navigator" || !response.hasCrossOriginRedirects) { - responseStatus = response.status; - const mimeType = extractMimeType(response.headersList); - if (mimeType !== "failure") { - bodyInfo.contentType = minimizeSupportedMimeType(mimeType); - } - } - if (fetchParams.request.initiatorType != null) { - markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus); - } - }; - const processResponseEndOfBodyTask = () => { - fetchParams.request.done = true; - if (fetchParams.processResponseEndOfBody != null) { - queueMicrotask(() => fetchParams.processResponseEndOfBody(response)); - } - if (fetchParams.request.initiatorType != null) { - fetchParams.controller.reportTimingSteps(); - } - }; - queueMicrotask(() => processResponseEndOfBodyTask()); - }; - if (fetchParams.processResponse != null) { - queueMicrotask(() => { - fetchParams.processResponse(response); - fetchParams.processResponse = null; - }); - } - const internalResponse = response.type === "error" ? response : response.internalResponse ?? response; - if (internalResponse.body == null) { - processResponseEndOfBody(); - } else { - finished(internalResponse.body.stream, () => { - processResponseEndOfBody(); - }); - } - } - async function httpFetch(fetchParams) { - const request3 = fetchParams.request; - let response = null; - let actualResponse = null; - const timingInfo = fetchParams.timingInfo; - if (request3.serviceWorkers === "all") { - } - if (response === null) { - if (request3.redirect === "follow") { - request3.serviceWorkers = "none"; - } - actualResponse = response = await httpNetworkOrCacheFetch(fetchParams); - if (request3.responseTainting === "cors" && corsCheck(request3, response) === "failure") { - return makeNetworkError("cors failure"); - } - if (TAOCheck(request3, response) === "failure") { - request3.timingAllowFailed = true; - } - } - if ((request3.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck( - request3.origin, - request3.client, - request3.destination, - actualResponse - ) === "blocked") { - return makeNetworkError("blocked"); - } - if (redirectStatusSet.has(actualResponse.status)) { - if (request3.redirect !== "manual") { - fetchParams.controller.connection.destroy(void 0, false); - } - if (request3.redirect === "error") { - response = makeNetworkError("unexpected redirect"); - } else if (request3.redirect === "manual") { - response = actualResponse; - } else if (request3.redirect === "follow") { - response = await httpRedirectFetch(fetchParams, response); - } else { - assert(false); - } - } - response.timingInfo = timingInfo; - return response; - } - function httpRedirectFetch(fetchParams, response) { - const request3 = fetchParams.request; - const actualResponse = response.internalResponse ? response.internalResponse : response; - let locationURL; - try { - locationURL = responseLocationURL( - actualResponse, - requestCurrentURL(request3).hash - ); - if (locationURL == null) { - return response; - } - } catch (err) { - return Promise.resolve(makeNetworkError(err)); - } - if (!urlIsHttpHttpsScheme(locationURL)) { - return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme")); - } - if (request3.redirectCount === 20) { - return Promise.resolve(makeNetworkError("redirect count exceeded")); - } - request3.redirectCount += 1; - if (request3.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request3, locationURL)) { - return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')); - } - if (request3.responseTainting === "cors" && (locationURL.username || locationURL.password)) { - return Promise.resolve(makeNetworkError( - 'URL cannot contain credentials for request mode "cors"' - )); - } - if (actualResponse.status !== 303 && request3.body != null && request3.body.source == null) { - return Promise.resolve(makeNetworkError()); - } - if ([301, 302].includes(actualResponse.status) && request3.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request3.method)) { - request3.method = "GET"; - request3.body = null; - for (const headerName of requestBodyHeader) { - request3.headersList.delete(headerName); - } - } - if (!sameOrigin(requestCurrentURL(request3), locationURL)) { - request3.headersList.delete("authorization", true); - request3.headersList.delete("proxy-authorization", true); - request3.headersList.delete("cookie", true); - request3.headersList.delete("host", true); - } - if (request3.body != null) { - assert(request3.body.source != null); - request3.body = safelyExtractBody(request3.body.source)[0]; - } - const timingInfo = fetchParams.timingInfo; - timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); - if (timingInfo.redirectStartTime === 0) { - timingInfo.redirectStartTime = timingInfo.startTime; - } - request3.urlList.push(locationURL); - setRequestReferrerPolicyOnRedirect(request3, actualResponse); - return mainFetch(fetchParams, true); - } - async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) { - const request3 = fetchParams.request; - let httpFetchParams = null; - let httpRequest = null; - let response = null; - const httpCache = null; - const revalidatingFlag = false; - if (request3.window === "no-window" && request3.redirect === "error") { - httpFetchParams = fetchParams; - httpRequest = request3; - } else { - httpRequest = cloneRequest(request3); - httpFetchParams = { ...fetchParams }; - httpFetchParams.request = httpRequest; - } - const includeCredentials = request3.credentials === "include" || request3.credentials === "same-origin" && request3.responseTainting === "basic"; - const contentLength = httpRequest.body ? httpRequest.body.length : null; - let contentLengthHeaderValue = null; - if (httpRequest.body == null && ["POST", "PUT"].includes(httpRequest.method)) { - contentLengthHeaderValue = "0"; - } - if (contentLength != null) { - contentLengthHeaderValue = isomorphicEncode(`${contentLength}`); - } - if (contentLengthHeaderValue != null) { - httpRequest.headersList.append("content-length", contentLengthHeaderValue, true); - } - if (contentLength != null && httpRequest.keepalive) { - } - if (httpRequest.referrer instanceof URL) { - httpRequest.headersList.append("referer", isomorphicEncode(httpRequest.referrer.href), true); - } - appendRequestOriginHeader(httpRequest); - appendFetchMetadata(httpRequest); - if (!httpRequest.headersList.contains("user-agent", true)) { - httpRequest.headersList.append("user-agent", defaultUserAgent); - } - if (httpRequest.cache === "default" && (httpRequest.headersList.contains("if-modified-since", true) || httpRequest.headersList.contains("if-none-match", true) || httpRequest.headersList.contains("if-unmodified-since", true) || httpRequest.headersList.contains("if-match", true) || httpRequest.headersList.contains("if-range", true))) { - httpRequest.cache = "no-store"; - } - if (httpRequest.cache === "no-cache" && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.contains("cache-control", true)) { - httpRequest.headersList.append("cache-control", "max-age=0", true); - } - if (httpRequest.cache === "no-store" || httpRequest.cache === "reload") { - if (!httpRequest.headersList.contains("pragma", true)) { - httpRequest.headersList.append("pragma", "no-cache", true); - } - if (!httpRequest.headersList.contains("cache-control", true)) { - httpRequest.headersList.append("cache-control", "no-cache", true); - } - } - if (httpRequest.headersList.contains("range", true)) { - httpRequest.headersList.append("accept-encoding", "identity", true); - } - if (!httpRequest.headersList.contains("accept-encoding", true)) { - if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { - httpRequest.headersList.append("accept-encoding", "br, gzip, deflate", true); - } else { - httpRequest.headersList.append("accept-encoding", "gzip, deflate", true); - } - } - httpRequest.headersList.delete("host", true); - if (includeCredentials) { - } - if (httpCache == null) { - httpRequest.cache = "no-store"; - } - if (httpRequest.cache !== "no-store" && httpRequest.cache !== "reload") { - } - if (response == null) { - if (httpRequest.cache === "only-if-cached") { - return makeNetworkError("only if cached"); - } - const forwardResponse = await httpNetworkFetch( - httpFetchParams, - includeCredentials, - isNewConnectionFetch - ); - if (!safeMethodsSet.has(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) { - } - if (revalidatingFlag && forwardResponse.status === 304) { - } - if (response == null) { - response = forwardResponse; - } - } - response.urlList = [...httpRequest.urlList]; - if (httpRequest.headersList.contains("range", true)) { - response.rangeRequested = true; - } - response.requestIncludesCredentials = includeCredentials; - if (response.status === 407) { - if (request3.window === "no-window") { - return makeNetworkError(); - } - if (isCancelled(fetchParams)) { - return makeAppropriateNetworkError(fetchParams); - } - return makeNetworkError("proxy authentication required"); - } - if ( - // response’s status is 421 - response.status === 421 && // isNewConnectionFetch is false - !isNewConnectionFetch && // request’s body is null, or request’s body is non-null and request’s body’s source is non-null - (request3.body == null || request3.body.source != null) - ) { - if (isCancelled(fetchParams)) { - return makeAppropriateNetworkError(fetchParams); - } - fetchParams.controller.connection.destroy(); - response = await httpNetworkOrCacheFetch( - fetchParams, - isAuthenticationFetch, - true - ); - } - if (isAuthenticationFetch) { - } - return response; - } - async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { - assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); - fetchParams.controller.connection = { - abort: null, - destroyed: false, - destroy(err, abort = true) { - if (!this.destroyed) { - this.destroyed = true; - if (abort) { - this.abort?.(err ?? new DOMException("The operation was aborted.", "AbortError")); - } - } - } - }; - const request3 = fetchParams.request; - let response = null; - const timingInfo = fetchParams.timingInfo; - const httpCache = null; - if (httpCache == null) { - request3.cache = "no-store"; - } - const newConnection = forceNewConnection ? "yes" : "no"; - if (request3.mode === "websocket") { - } else { - } - let requestBody = null; - if (request3.body == null && fetchParams.processRequestEndOfBody) { - queueMicrotask(() => fetchParams.processRequestEndOfBody()); - } else if (request3.body != null) { - const processBodyChunk = async function* (bytes) { - if (isCancelled(fetchParams)) { - return; - } - yield bytes; - fetchParams.processRequestBodyChunkLength?.(bytes.byteLength); - }; - const processEndOfBody = () => { - if (isCancelled(fetchParams)) { - return; - } - if (fetchParams.processRequestEndOfBody) { - fetchParams.processRequestEndOfBody(); - } - }; - const processBodyError = (e) => { - if (isCancelled(fetchParams)) { - return; - } - if (e.name === "AbortError") { - fetchParams.controller.abort(); - } else { - fetchParams.controller.terminate(e); - } - }; - requestBody = (async function* () { - try { - for await (const bytes of request3.body.stream) { - yield* processBodyChunk(bytes); - } - processEndOfBody(); - } catch (err) { - processBodyError(err); - } - })(); - } - try { - const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }); - if (socket) { - response = makeResponse({ status, statusText, headersList, socket }); - } else { - const iterator2 = body[Symbol.asyncIterator](); - fetchParams.controller.next = () => iterator2.next(); - response = makeResponse({ status, statusText, headersList }); - } - } catch (err) { - if (err.name === "AbortError") { - fetchParams.controller.connection.destroy(); - return makeAppropriateNetworkError(fetchParams, err); - } - return makeNetworkError(err); - } - const pullAlgorithm = async () => { - await fetchParams.controller.resume(); - }; - const cancelAlgorithm = (reason) => { - if (!isCancelled(fetchParams)) { - fetchParams.controller.abort(reason); - } - }; - const stream2 = new ReadableStream( - { - async start(controller) { - fetchParams.controller.controller = controller; - }, - async pull(controller) { - await pullAlgorithm(controller); - }, - async cancel(reason) { - await cancelAlgorithm(reason); - }, - type: "bytes" - } - ); - response.body = { stream: stream2, source: null, length: null }; - fetchParams.controller.onAborted = onAborted; - fetchParams.controller.on("terminated", onAborted); - fetchParams.controller.resume = async () => { - while (true) { - let bytes; - let isFailure; - try { - const { done, value } = await fetchParams.controller.next(); - if (isAborted(fetchParams)) { - break; - } - bytes = done ? void 0 : value; - } catch (err) { - if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { - bytes = void 0; - } else { - bytes = err; - isFailure = true; - } - } - if (bytes === void 0) { - readableStreamClose(fetchParams.controller.controller); - finalizeResponse(fetchParams, response); - return; - } - timingInfo.decodedBodySize += bytes?.byteLength ?? 0; - if (isFailure) { - fetchParams.controller.terminate(bytes); - return; - } - const buffer = new Uint8Array(bytes); - if (buffer.byteLength) { - fetchParams.controller.controller.enqueue(buffer); - } - if (isErrored(stream2)) { - fetchParams.controller.terminate(); - return; - } - if (fetchParams.controller.controller.desiredSize <= 0) { - return; - } - } - }; - function onAborted(reason) { - if (isAborted(fetchParams)) { - response.aborted = true; - if (isReadable(stream2)) { - fetchParams.controller.controller.error( - fetchParams.controller.serializedAbortReason - ); - } - } else { - if (isReadable(stream2)) { - fetchParams.controller.controller.error(new TypeError("terminated", { - cause: isErrorLike(reason) ? reason : void 0 - })); - } - } - fetchParams.controller.connection.destroy(); - } - return response; - function dispatch({ body }) { - const url2 = requestCurrentURL(request3); - const agent = fetchParams.controller.dispatcher; - return new Promise((resolve14, reject) => agent.dispatch( - { - path: url2.pathname + url2.search, - origin: url2.origin, - method: request3.method, - body: agent.isMockActive ? request3.body && (request3.body.source || request3.body.stream) : body, - headers: request3.headersList.entries, - maxRedirections: 0, - upgrade: request3.mode === "websocket" ? "websocket" : void 0 - }, - { - body: null, - abort: null, - onConnect(abort) { - const { connection } = fetchParams.controller; - timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(void 0, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability); - if (connection.destroyed) { - abort(new DOMException("The operation was aborted.", "AbortError")); - } else { - fetchParams.controller.on("terminated", abort); - this.abort = connection.abort = abort; - } - timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); - }, - onResponseStarted() { - timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); - }, - onHeaders(status, rawHeaders, resume, statusText) { - if (status < 200) { - return; - } - let location = ""; - const headersList = new HeadersList(); - for (let i = 0; i < rawHeaders.length; i += 2) { - headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); - } - location = headersList.get("location", true); - this.body = new Readable3({ read: resume }); - const decoders = []; - const willFollow = location && request3.redirect === "follow" && redirectStatusSet.has(status); - if (request3.method !== "HEAD" && request3.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { - const contentEncoding = headersList.get("content-encoding", true); - const codings = contentEncoding ? contentEncoding.toLowerCase().split(",") : []; - const maxContentEncodings = 5; - if (codings.length > maxContentEncodings) { - reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`)); - return true; - } - for (let i = codings.length - 1; i >= 0; --i) { - const coding = codings[i].trim(); - if (coding === "x-gzip" || coding === "gzip") { - decoders.push(zlib3.createGunzip({ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - flush: zlib3.constants.Z_SYNC_FLUSH, - finishFlush: zlib3.constants.Z_SYNC_FLUSH - })); - } else if (coding === "deflate") { - decoders.push(createInflate({ - flush: zlib3.constants.Z_SYNC_FLUSH, - finishFlush: zlib3.constants.Z_SYNC_FLUSH - })); - } else if (coding === "br") { - decoders.push(zlib3.createBrotliDecompress({ - flush: zlib3.constants.BROTLI_OPERATION_FLUSH, - finishFlush: zlib3.constants.BROTLI_OPERATION_FLUSH - })); - } else { - decoders.length = 0; - break; - } - } - } - const onError = this.onError.bind(this); - resolve14({ - status, - statusText, - headersList, - body: decoders.length ? pipeline2(this.body, ...decoders, (err) => { - if (err) { - this.onError(err); - } - }).on("error", onError) : this.body.on("error", onError) - }); - return true; - }, - onData(chunk) { - if (fetchParams.controller.dump) { - return; - } - const bytes = chunk; - timingInfo.encodedBodySize += bytes.byteLength; - return this.body.push(bytes); - }, - onComplete() { - if (this.abort) { - fetchParams.controller.off("terminated", this.abort); - } - if (fetchParams.controller.onAborted) { - fetchParams.controller.off("terminated", fetchParams.controller.onAborted); - } - fetchParams.controller.ended = true; - this.body.push(null); - }, - onError(error3) { - if (this.abort) { - fetchParams.controller.off("terminated", this.abort); - } - this.body?.destroy(error3); - fetchParams.controller.terminate(error3); - reject(error3); - }, - onUpgrade(status, rawHeaders, socket) { - if (status !== 101) { - return; - } - const headersList = new HeadersList(); - for (let i = 0; i < rawHeaders.length; i += 2) { - headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); - } - resolve14({ - status, - statusText: STATUS_CODES[status], - headersList, - socket - }); - return true; - } - } - )); - } - } - module2.exports = { - fetch, - Fetch, - fetching, - finalizeAndReportTiming - }; - } -}); - -// node_modules/undici/lib/web/fileapi/symbols.js -var require_symbols3 = __commonJS({ - "node_modules/undici/lib/web/fileapi/symbols.js"(exports2, module2) { - "use strict"; - module2.exports = { - kState: /* @__PURE__ */ Symbol("FileReader state"), - kResult: /* @__PURE__ */ Symbol("FileReader result"), - kError: /* @__PURE__ */ Symbol("FileReader error"), - kLastProgressEventFired: /* @__PURE__ */ Symbol("FileReader last progress event fired timestamp"), - kEvents: /* @__PURE__ */ Symbol("FileReader events"), - kAborted: /* @__PURE__ */ Symbol("FileReader aborted") - }; - } -}); - -// node_modules/undici/lib/web/fileapi/progressevent.js -var require_progressevent = __commonJS({ - "node_modules/undici/lib/web/fileapi/progressevent.js"(exports2, module2) { - "use strict"; - var { webidl } = require_webidl(); - var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); - var ProgressEvent = class _ProgressEvent extends Event { - constructor(type, eventInitDict = {}) { - type = webidl.converters.DOMString(type, "ProgressEvent constructor", "type"); - eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}); - super(type, eventInitDict); - this[kState] = { - lengthComputable: eventInitDict.lengthComputable, - loaded: eventInitDict.loaded, - total: eventInitDict.total - }; - } - get lengthComputable() { - webidl.brandCheck(this, _ProgressEvent); - return this[kState].lengthComputable; - } - get loaded() { - webidl.brandCheck(this, _ProgressEvent); - return this[kState].loaded; - } - get total() { - webidl.brandCheck(this, _ProgressEvent); - return this[kState].total; - } - }; - webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ - { - key: "lengthComputable", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "loaded", - converter: webidl.converters["unsigned long long"], - defaultValue: () => 0 - }, - { - key: "total", - converter: webidl.converters["unsigned long long"], - defaultValue: () => 0 - }, - { - key: "bubbles", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "cancelable", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "composed", - converter: webidl.converters.boolean, - defaultValue: () => false - } - ]); - module2.exports = { - ProgressEvent - }; - } -}); - -// node_modules/undici/lib/web/fileapi/encoding.js -var require_encoding = __commonJS({ - "node_modules/undici/lib/web/fileapi/encoding.js"(exports2, module2) { - "use strict"; - function getEncoding(label) { - if (!label) { - return "failure"; - } - switch (label.trim().toLowerCase()) { - case "unicode-1-1-utf-8": - case "unicode11utf8": - case "unicode20utf8": - case "utf-8": - case "utf8": - case "x-unicode20utf8": - return "UTF-8"; - case "866": - case "cp866": - case "csibm866": - case "ibm866": - return "IBM866"; - case "csisolatin2": - case "iso-8859-2": - case "iso-ir-101": - case "iso8859-2": - case "iso88592": - case "iso_8859-2": - case "iso_8859-2:1987": - case "l2": - case "latin2": - return "ISO-8859-2"; - case "csisolatin3": - case "iso-8859-3": - case "iso-ir-109": - case "iso8859-3": - case "iso88593": - case "iso_8859-3": - case "iso_8859-3:1988": - case "l3": - case "latin3": - return "ISO-8859-3"; - case "csisolatin4": - case "iso-8859-4": - case "iso-ir-110": - case "iso8859-4": - case "iso88594": - case "iso_8859-4": - case "iso_8859-4:1988": - case "l4": - case "latin4": - return "ISO-8859-4"; - case "csisolatincyrillic": - case "cyrillic": - case "iso-8859-5": - case "iso-ir-144": - case "iso8859-5": - case "iso88595": - case "iso_8859-5": - case "iso_8859-5:1988": - return "ISO-8859-5"; - case "arabic": - case "asmo-708": - case "csiso88596e": - case "csiso88596i": - case "csisolatinarabic": - case "ecma-114": - case "iso-8859-6": - case "iso-8859-6-e": - case "iso-8859-6-i": - case "iso-ir-127": - case "iso8859-6": - case "iso88596": - case "iso_8859-6": - case "iso_8859-6:1987": - return "ISO-8859-6"; - case "csisolatingreek": - case "ecma-118": - case "elot_928": - case "greek": - case "greek8": - case "iso-8859-7": - case "iso-ir-126": - case "iso8859-7": - case "iso88597": - case "iso_8859-7": - case "iso_8859-7:1987": - case "sun_eu_greek": - return "ISO-8859-7"; - case "csiso88598e": - case "csisolatinhebrew": - case "hebrew": - case "iso-8859-8": - case "iso-8859-8-e": - case "iso-ir-138": - case "iso8859-8": - case "iso88598": - case "iso_8859-8": - case "iso_8859-8:1988": - case "visual": - return "ISO-8859-8"; - case "csiso88598i": - case "iso-8859-8-i": - case "logical": - return "ISO-8859-8-I"; - case "csisolatin6": - case "iso-8859-10": - case "iso-ir-157": - case "iso8859-10": - case "iso885910": - case "l6": - case "latin6": - return "ISO-8859-10"; - case "iso-8859-13": - case "iso8859-13": - case "iso885913": - return "ISO-8859-13"; - case "iso-8859-14": - case "iso8859-14": - case "iso885914": - return "ISO-8859-14"; - case "csisolatin9": - case "iso-8859-15": - case "iso8859-15": - case "iso885915": - case "iso_8859-15": - case "l9": - return "ISO-8859-15"; - case "iso-8859-16": - return "ISO-8859-16"; - case "cskoi8r": - case "koi": - case "koi8": - case "koi8-r": - case "koi8_r": - return "KOI8-R"; - case "koi8-ru": - case "koi8-u": - return "KOI8-U"; - case "csmacintosh": - case "mac": - case "macintosh": - case "x-mac-roman": - return "macintosh"; - case "iso-8859-11": - case "iso8859-11": - case "iso885911": - case "tis-620": - case "windows-874": - return "windows-874"; - case "cp1250": - case "windows-1250": - case "x-cp1250": - return "windows-1250"; - case "cp1251": - case "windows-1251": - case "x-cp1251": - return "windows-1251"; - case "ansi_x3.4-1968": - case "ascii": - case "cp1252": - case "cp819": - case "csisolatin1": - case "ibm819": - case "iso-8859-1": - case "iso-ir-100": - case "iso8859-1": - case "iso88591": - case "iso_8859-1": - case "iso_8859-1:1987": - case "l1": - case "latin1": - case "us-ascii": - case "windows-1252": - case "x-cp1252": - return "windows-1252"; - case "cp1253": - case "windows-1253": - case "x-cp1253": - return "windows-1253"; - case "cp1254": - case "csisolatin5": - case "iso-8859-9": - case "iso-ir-148": - case "iso8859-9": - case "iso88599": - case "iso_8859-9": - case "iso_8859-9:1989": - case "l5": - case "latin5": - case "windows-1254": - case "x-cp1254": - return "windows-1254"; - case "cp1255": - case "windows-1255": - case "x-cp1255": - return "windows-1255"; - case "cp1256": - case "windows-1256": - case "x-cp1256": - return "windows-1256"; - case "cp1257": - case "windows-1257": - case "x-cp1257": - return "windows-1257"; - case "cp1258": - case "windows-1258": - case "x-cp1258": - return "windows-1258"; - case "x-mac-cyrillic": - case "x-mac-ukrainian": - return "x-mac-cyrillic"; - case "chinese": - case "csgb2312": - case "csiso58gb231280": - case "gb2312": - case "gb_2312": - case "gb_2312-80": - case "gbk": - case "iso-ir-58": - case "x-gbk": - return "GBK"; - case "gb18030": - return "gb18030"; - case "big5": - case "big5-hkscs": - case "cn-big5": - case "csbig5": - case "x-x-big5": - return "Big5"; - case "cseucpkdfmtjapanese": - case "euc-jp": - case "x-euc-jp": - return "EUC-JP"; - case "csiso2022jp": - case "iso-2022-jp": - return "ISO-2022-JP"; - case "csshiftjis": - case "ms932": - case "ms_kanji": - case "shift-jis": - case "shift_jis": - case "sjis": - case "windows-31j": - case "x-sjis": - return "Shift_JIS"; - case "cseuckr": - case "csksc56011987": - case "euc-kr": - case "iso-ir-149": - case "korean": - case "ks_c_5601-1987": - case "ks_c_5601-1989": - case "ksc5601": - case "ksc_5601": - case "windows-949": - return "EUC-KR"; - case "csiso2022kr": - case "hz-gb-2312": - case "iso-2022-cn": - case "iso-2022-cn-ext": - case "iso-2022-kr": - case "replacement": - return "replacement"; - case "unicodefffe": - case "utf-16be": - return "UTF-16BE"; - case "csunicode": - case "iso-10646-ucs-2": - case "ucs-2": - case "unicode": - case "unicodefeff": - case "utf-16": - case "utf-16le": - return "UTF-16LE"; - case "x-user-defined": - return "x-user-defined"; - default: - return "failure"; - } - } - module2.exports = { - getEncoding - }; - } -}); - -// node_modules/undici/lib/web/fileapi/util.js -var require_util4 = __commonJS({ - "node_modules/undici/lib/web/fileapi/util.js"(exports2, module2) { - "use strict"; - var { - kState, - kError, - kResult, - kAborted, - kLastProgressEventFired - } = require_symbols3(); - var { ProgressEvent } = require_progressevent(); - var { getEncoding } = require_encoding(); - var { serializeAMimeType, parseMIMEType } = require_data_url(); - var { types: types2 } = require("node:util"); - var { StringDecoder } = require("string_decoder"); - var { btoa: btoa2 } = require("node:buffer"); - var staticPropertyDescriptors = { - enumerable: true, - writable: false, - configurable: false - }; - function readOperation(fr, blob, type, encodingName) { - if (fr[kState] === "loading") { - throw new DOMException("Invalid state", "InvalidStateError"); - } - fr[kState] = "loading"; - fr[kResult] = null; - fr[kError] = null; - const stream2 = blob.stream(); - const reader = stream2.getReader(); - const bytes = []; - let chunkPromise = reader.read(); - let isFirstChunk = true; - (async () => { - while (!fr[kAborted]) { - try { - const { done, value } = await chunkPromise; - if (isFirstChunk && !fr[kAborted]) { - queueMicrotask(() => { - fireAProgressEvent("loadstart", fr); - }); - } - isFirstChunk = false; - if (!done && types2.isUint8Array(value)) { - bytes.push(value); - if ((fr[kLastProgressEventFired] === void 0 || Date.now() - fr[kLastProgressEventFired] >= 50) && !fr[kAborted]) { - fr[kLastProgressEventFired] = Date.now(); - queueMicrotask(() => { - fireAProgressEvent("progress", fr); - }); - } - chunkPromise = reader.read(); - } else if (done) { - queueMicrotask(() => { - fr[kState] = "done"; - try { - const result = packageData(bytes, type, blob.type, encodingName); - if (fr[kAborted]) { - return; - } - fr[kResult] = result; - fireAProgressEvent("load", fr); - } catch (error3) { - fr[kError] = error3; - fireAProgressEvent("error", fr); - } - if (fr[kState] !== "loading") { - fireAProgressEvent("loadend", fr); - } - }); - break; - } - } catch (error3) { - if (fr[kAborted]) { - return; - } - queueMicrotask(() => { - fr[kState] = "done"; - fr[kError] = error3; - fireAProgressEvent("error", fr); - if (fr[kState] !== "loading") { - fireAProgressEvent("loadend", fr); - } - }); - break; - } - } - })(); - } - function fireAProgressEvent(e, reader) { - const event = new ProgressEvent(e, { - bubbles: false, - cancelable: false - }); - reader.dispatchEvent(event); - } - function packageData(bytes, type, mimeType, encodingName) { - switch (type) { - case "DataURL": { - let dataURL = "data:"; - const parsed = parseMIMEType(mimeType || "application/octet-stream"); - if (parsed !== "failure") { - dataURL += serializeAMimeType(parsed); - } - dataURL += ";base64,"; - const decoder = new StringDecoder("latin1"); - for (const chunk of bytes) { - dataURL += btoa2(decoder.write(chunk)); - } - dataURL += btoa2(decoder.end()); - return dataURL; - } - case "Text": { - let encoding = "failure"; - if (encodingName) { - encoding = getEncoding(encodingName); - } - if (encoding === "failure" && mimeType) { - const type2 = parseMIMEType(mimeType); - if (type2 !== "failure") { - encoding = getEncoding(type2.parameters.get("charset")); - } - } - if (encoding === "failure") { - encoding = "UTF-8"; - } - return decode(bytes, encoding); - } - case "ArrayBuffer": { - const sequence = combineByteSequences(bytes); - return sequence.buffer; - } - case "BinaryString": { - let binaryString = ""; - const decoder = new StringDecoder("latin1"); - for (const chunk of bytes) { - binaryString += decoder.write(chunk); - } - binaryString += decoder.end(); - return binaryString; - } - } - } - function decode(ioQueue, encoding) { - const bytes = combineByteSequences(ioQueue); - const BOMEncoding = BOMSniffing(bytes); - let slice = 0; - if (BOMEncoding !== null) { - encoding = BOMEncoding; - slice = BOMEncoding === "UTF-8" ? 3 : 2; - } - const sliced = bytes.slice(slice); - return new TextDecoder(encoding).decode(sliced); - } - function BOMSniffing(ioQueue) { - const [a, b, c] = ioQueue; - if (a === 239 && b === 187 && c === 191) { - return "UTF-8"; - } else if (a === 254 && b === 255) { - return "UTF-16BE"; - } else if (a === 255 && b === 254) { - return "UTF-16LE"; - } - return null; - } - function combineByteSequences(sequences) { - const size = sequences.reduce((a, b) => { - return a + b.byteLength; - }, 0); - let offset = 0; - return sequences.reduce((a, b) => { - a.set(b, offset); - offset += b.byteLength; - return a; - }, new Uint8Array(size)); - } - module2.exports = { - staticPropertyDescriptors, - readOperation, - fireAProgressEvent - }; - } -}); - -// node_modules/undici/lib/web/fileapi/filereader.js -var require_filereader = __commonJS({ - "node_modules/undici/lib/web/fileapi/filereader.js"(exports2, module2) { - "use strict"; - var { - staticPropertyDescriptors, - readOperation, - fireAProgressEvent - } = require_util4(); - var { - kState, - kError, - kResult, - kEvents, - kAborted - } = require_symbols3(); - var { webidl } = require_webidl(); - var { kEnumerableProperty } = require_util(); - var FileReader = class _FileReader extends EventTarget { - constructor() { - super(); - this[kState] = "empty"; - this[kResult] = null; - this[kError] = null; - this[kEvents] = { - loadend: null, - error: null, - abort: null, - load: null, - progress: null, - loadstart: null - }; - } - /** - * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer - * @param {import('buffer').Blob} blob - */ - readAsArrayBuffer(blob) { - webidl.brandCheck(this, _FileReader); - webidl.argumentLengthCheck(arguments, 1, "FileReader.readAsArrayBuffer"); - blob = webidl.converters.Blob(blob, { strict: false }); - readOperation(this, blob, "ArrayBuffer"); - } - /** - * @see https://w3c.github.io/FileAPI/#readAsBinaryString - * @param {import('buffer').Blob} blob - */ - readAsBinaryString(blob) { - webidl.brandCheck(this, _FileReader); - webidl.argumentLengthCheck(arguments, 1, "FileReader.readAsBinaryString"); - blob = webidl.converters.Blob(blob, { strict: false }); - readOperation(this, blob, "BinaryString"); - } - /** - * @see https://w3c.github.io/FileAPI/#readAsDataText - * @param {import('buffer').Blob} blob - * @param {string?} encoding - */ - readAsText(blob, encoding = void 0) { - webidl.brandCheck(this, _FileReader); - webidl.argumentLengthCheck(arguments, 1, "FileReader.readAsText"); - blob = webidl.converters.Blob(blob, { strict: false }); - if (encoding !== void 0) { - encoding = webidl.converters.DOMString(encoding, "FileReader.readAsText", "encoding"); - } - readOperation(this, blob, "Text", encoding); - } - /** - * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL - * @param {import('buffer').Blob} blob - */ - readAsDataURL(blob) { - webidl.brandCheck(this, _FileReader); - webidl.argumentLengthCheck(arguments, 1, "FileReader.readAsDataURL"); - blob = webidl.converters.Blob(blob, { strict: false }); - readOperation(this, blob, "DataURL"); - } - /** - * @see https://w3c.github.io/FileAPI/#dfn-abort - */ - abort() { - if (this[kState] === "empty" || this[kState] === "done") { - this[kResult] = null; - return; - } - if (this[kState] === "loading") { - this[kState] = "done"; - this[kResult] = null; - } - this[kAborted] = true; - fireAProgressEvent("abort", this); - if (this[kState] !== "loading") { - fireAProgressEvent("loadend", this); - } - } - /** - * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate - */ - get readyState() { - webidl.brandCheck(this, _FileReader); - switch (this[kState]) { - case "empty": - return this.EMPTY; - case "loading": - return this.LOADING; - case "done": - return this.DONE; - } - } - /** - * @see https://w3c.github.io/FileAPI/#dom-filereader-result - */ - get result() { - webidl.brandCheck(this, _FileReader); - return this[kResult]; - } - /** - * @see https://w3c.github.io/FileAPI/#dom-filereader-error - */ - get error() { - webidl.brandCheck(this, _FileReader); - return this[kError]; - } - get onloadend() { - webidl.brandCheck(this, _FileReader); - return this[kEvents].loadend; - } - set onloadend(fn) { - webidl.brandCheck(this, _FileReader); - if (this[kEvents].loadend) { - this.removeEventListener("loadend", this[kEvents].loadend); - } - if (typeof fn === "function") { - this[kEvents].loadend = fn; - this.addEventListener("loadend", fn); - } else { - this[kEvents].loadend = null; - } - } - get onerror() { - webidl.brandCheck(this, _FileReader); - return this[kEvents].error; - } - set onerror(fn) { - webidl.brandCheck(this, _FileReader); - if (this[kEvents].error) { - this.removeEventListener("error", this[kEvents].error); - } - if (typeof fn === "function") { - this[kEvents].error = fn; - this.addEventListener("error", fn); - } else { - this[kEvents].error = null; - } - } - get onloadstart() { - webidl.brandCheck(this, _FileReader); - return this[kEvents].loadstart; - } - set onloadstart(fn) { - webidl.brandCheck(this, _FileReader); - if (this[kEvents].loadstart) { - this.removeEventListener("loadstart", this[kEvents].loadstart); - } - if (typeof fn === "function") { - this[kEvents].loadstart = fn; - this.addEventListener("loadstart", fn); - } else { - this[kEvents].loadstart = null; - } - } - get onprogress() { - webidl.brandCheck(this, _FileReader); - return this[kEvents].progress; - } - set onprogress(fn) { - webidl.brandCheck(this, _FileReader); - if (this[kEvents].progress) { - this.removeEventListener("progress", this[kEvents].progress); - } - if (typeof fn === "function") { - this[kEvents].progress = fn; - this.addEventListener("progress", fn); - } else { - this[kEvents].progress = null; - } - } - get onload() { - webidl.brandCheck(this, _FileReader); - return this[kEvents].load; - } - set onload(fn) { - webidl.brandCheck(this, _FileReader); - if (this[kEvents].load) { - this.removeEventListener("load", this[kEvents].load); - } - if (typeof fn === "function") { - this[kEvents].load = fn; - this.addEventListener("load", fn); - } else { - this[kEvents].load = null; - } - } - get onabort() { - webidl.brandCheck(this, _FileReader); - return this[kEvents].abort; - } - set onabort(fn) { - webidl.brandCheck(this, _FileReader); - if (this[kEvents].abort) { - this.removeEventListener("abort", this[kEvents].abort); - } - if (typeof fn === "function") { - this[kEvents].abort = fn; - this.addEventListener("abort", fn); - } else { - this[kEvents].abort = null; - } - } - }; - FileReader.EMPTY = FileReader.prototype.EMPTY = 0; - FileReader.LOADING = FileReader.prototype.LOADING = 1; - FileReader.DONE = FileReader.prototype.DONE = 2; - Object.defineProperties(FileReader.prototype, { - EMPTY: staticPropertyDescriptors, - LOADING: staticPropertyDescriptors, - DONE: staticPropertyDescriptors, - readAsArrayBuffer: kEnumerableProperty, - readAsBinaryString: kEnumerableProperty, - readAsText: kEnumerableProperty, - readAsDataURL: kEnumerableProperty, - abort: kEnumerableProperty, - readyState: kEnumerableProperty, - result: kEnumerableProperty, - error: kEnumerableProperty, - onloadstart: kEnumerableProperty, - onprogress: kEnumerableProperty, - onload: kEnumerableProperty, - onabort: kEnumerableProperty, - onerror: kEnumerableProperty, - onloadend: kEnumerableProperty, - [Symbol.toStringTag]: { - value: "FileReader", - writable: false, - enumerable: false, - configurable: true - } - }); - Object.defineProperties(FileReader, { - EMPTY: staticPropertyDescriptors, - LOADING: staticPropertyDescriptors, - DONE: staticPropertyDescriptors - }); - module2.exports = { - FileReader - }; - } -}); - -// node_modules/undici/lib/web/cache/symbols.js -var require_symbols4 = __commonJS({ - "node_modules/undici/lib/web/cache/symbols.js"(exports2, module2) { - "use strict"; - module2.exports = { - kConstruct: require_symbols().kConstruct - }; - } -}); - -// node_modules/undici/lib/web/cache/util.js -var require_util5 = __commonJS({ - "node_modules/undici/lib/web/cache/util.js"(exports2, module2) { - "use strict"; - var assert = require("node:assert"); - var { URLSerializer } = require_data_url(); - var { isValidHeaderName } = require_util2(); - function urlEquals(A, B, excludeFragment = false) { - const serializedA = URLSerializer(A, excludeFragment); - const serializedB = URLSerializer(B, excludeFragment); - return serializedA === serializedB; - } - function getFieldValues(header) { - assert(header !== null); - const values = []; - for (let value of header.split(",")) { - value = value.trim(); - if (isValidHeaderName(value)) { - values.push(value); - } - } - return values; - } - module2.exports = { - urlEquals, - getFieldValues - }; - } -}); - -// node_modules/undici/lib/web/cache/cache.js -var require_cache = __commonJS({ - "node_modules/undici/lib/web/cache/cache.js"(exports2, module2) { - "use strict"; - var { kConstruct } = require_symbols4(); - var { urlEquals, getFieldValues } = require_util5(); - var { kEnumerableProperty, isDisturbed } = require_util(); - var { webidl } = require_webidl(); - var { Response, cloneResponse, fromInnerResponse } = require_response(); - var { Request, fromInnerRequest } = require_request2(); - var { kState } = require_symbols2(); - var { fetching } = require_fetch(); - var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2(); - var assert = require("node:assert"); - var Cache = class _Cache { - /** - * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list - * @type {requestResponseList} - */ - #relevantRequestResponseList; - constructor() { - if (arguments[0] !== kConstruct) { - webidl.illegalConstructor(); - } - webidl.util.markAsUncloneable(this); - this.#relevantRequestResponseList = arguments[1]; - } - async match(request3, options = {}) { - webidl.brandCheck(this, _Cache); - const prefix = "Cache.match"; - webidl.argumentLengthCheck(arguments, 1, prefix); - request3 = webidl.converters.RequestInfo(request3, prefix, "request"); - options = webidl.converters.CacheQueryOptions(options, prefix, "options"); - const p = this.#internalMatchAll(request3, options, 1); - if (p.length === 0) { - return; - } - return p[0]; - } - async matchAll(request3 = void 0, options = {}) { - webidl.brandCheck(this, _Cache); - const prefix = "Cache.matchAll"; - if (request3 !== void 0) request3 = webidl.converters.RequestInfo(request3, prefix, "request"); - options = webidl.converters.CacheQueryOptions(options, prefix, "options"); - return this.#internalMatchAll(request3, options); - } - async add(request3) { - webidl.brandCheck(this, _Cache); - const prefix = "Cache.add"; - webidl.argumentLengthCheck(arguments, 1, prefix); - request3 = webidl.converters.RequestInfo(request3, prefix, "request"); - const requests = [request3]; - const responseArrayPromise = this.addAll(requests); - return await responseArrayPromise; - } - async addAll(requests) { - webidl.brandCheck(this, _Cache); - const prefix = "Cache.addAll"; - webidl.argumentLengthCheck(arguments, 1, prefix); - const responsePromises = []; - const requestList = []; - for (let request3 of requests) { - if (request3 === void 0) { - throw webidl.errors.conversionFailed({ - prefix, - argument: "Argument 1", - types: ["undefined is not allowed"] - }); - } - request3 = webidl.converters.RequestInfo(request3); - if (typeof request3 === "string") { - continue; - } - const r = request3[kState]; - if (!urlIsHttpHttpsScheme(r.url) || r.method !== "GET") { - throw webidl.errors.exception({ - header: prefix, - message: "Expected http/s scheme when method is not GET." - }); - } - } - const fetchControllers = []; - for (const request3 of requests) { - const r = new Request(request3)[kState]; - if (!urlIsHttpHttpsScheme(r.url)) { - throw webidl.errors.exception({ - header: prefix, - message: "Expected http/s scheme." - }); - } - r.initiator = "fetch"; - r.destination = "subresource"; - requestList.push(r); - const responsePromise = createDeferredPromise(); - fetchControllers.push(fetching({ - request: r, - processResponse(response) { - if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) { - responsePromise.reject(webidl.errors.exception({ - header: "Cache.addAll", - message: "Received an invalid status code or the request failed." - })); - } else if (response.headersList.contains("vary")) { - const fieldValues = getFieldValues(response.headersList.get("vary")); - for (const fieldValue of fieldValues) { - if (fieldValue === "*") { - responsePromise.reject(webidl.errors.exception({ - header: "Cache.addAll", - message: "invalid vary field value" - })); - for (const controller of fetchControllers) { - controller.abort(); - } - return; - } - } - } - }, - processResponseEndOfBody(response) { - if (response.aborted) { - responsePromise.reject(new DOMException("aborted", "AbortError")); - return; - } - responsePromise.resolve(response); - } - })); - responsePromises.push(responsePromise.promise); - } - const p = Promise.all(responsePromises); - const responses = await p; - const operations = []; - let index2 = 0; - for (const response of responses) { - const operation = { - type: "put", - // 7.3.2 - request: requestList[index2], - // 7.3.3 - response - // 7.3.4 - }; - operations.push(operation); - index2++; - } - const cacheJobPromise = createDeferredPromise(); - let errorData = null; - try { - this.#batchCacheOperations(operations); - } catch (e) { - errorData = e; - } - queueMicrotask(() => { - if (errorData === null) { - cacheJobPromise.resolve(void 0); - } else { - cacheJobPromise.reject(errorData); - } - }); - return cacheJobPromise.promise; - } - async put(request3, response) { - webidl.brandCheck(this, _Cache); - const prefix = "Cache.put"; - webidl.argumentLengthCheck(arguments, 2, prefix); - request3 = webidl.converters.RequestInfo(request3, prefix, "request"); - response = webidl.converters.Response(response, prefix, "response"); - let innerRequest = null; - if (request3 instanceof Request) { - innerRequest = request3[kState]; - } else { - innerRequest = new Request(request3)[kState]; - } - if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") { - throw webidl.errors.exception({ - header: prefix, - message: "Expected an http/s scheme when method is not GET" - }); - } - const innerResponse = response[kState]; - if (innerResponse.status === 206) { - throw webidl.errors.exception({ - header: prefix, - message: "Got 206 status" - }); - } - if (innerResponse.headersList.contains("vary")) { - const fieldValues = getFieldValues(innerResponse.headersList.get("vary")); - for (const fieldValue of fieldValues) { - if (fieldValue === "*") { - throw webidl.errors.exception({ - header: prefix, - message: "Got * vary field value" - }); - } - } - } - if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { - throw webidl.errors.exception({ - header: prefix, - message: "Response body is locked or disturbed" - }); - } - const clonedResponse = cloneResponse(innerResponse); - const bodyReadPromise = createDeferredPromise(); - if (innerResponse.body != null) { - const stream2 = innerResponse.body.stream; - const reader = stream2.getReader(); - readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); - } else { - bodyReadPromise.resolve(void 0); - } - const operations = []; - const operation = { - type: "put", - // 14. - request: innerRequest, - // 15. - response: clonedResponse - // 16. - }; - operations.push(operation); - const bytes = await bodyReadPromise.promise; - if (clonedResponse.body != null) { - clonedResponse.body.source = bytes; - } - const cacheJobPromise = createDeferredPromise(); - let errorData = null; - try { - this.#batchCacheOperations(operations); - } catch (e) { - errorData = e; - } - queueMicrotask(() => { - if (errorData === null) { - cacheJobPromise.resolve(); - } else { - cacheJobPromise.reject(errorData); - } - }); - return cacheJobPromise.promise; - } - async delete(request3, options = {}) { - webidl.brandCheck(this, _Cache); - const prefix = "Cache.delete"; - webidl.argumentLengthCheck(arguments, 1, prefix); - request3 = webidl.converters.RequestInfo(request3, prefix, "request"); - options = webidl.converters.CacheQueryOptions(options, prefix, "options"); - let r = null; - if (request3 instanceof Request) { - r = request3[kState]; - if (r.method !== "GET" && !options.ignoreMethod) { - return false; - } - } else { - assert(typeof request3 === "string"); - r = new Request(request3)[kState]; - } - const operations = []; - const operation = { - type: "delete", - request: r, - options - }; - operations.push(operation); - const cacheJobPromise = createDeferredPromise(); - let errorData = null; - let requestResponses; - try { - requestResponses = this.#batchCacheOperations(operations); - } catch (e) { - errorData = e; - } - queueMicrotask(() => { - if (errorData === null) { - cacheJobPromise.resolve(!!requestResponses?.length); - } else { - cacheJobPromise.reject(errorData); - } - }); - return cacheJobPromise.promise; - } - /** - * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys - * @param {any} request - * @param {import('../../types/cache').CacheQueryOptions} options - * @returns {Promise} - */ - async keys(request3 = void 0, options = {}) { - webidl.brandCheck(this, _Cache); - const prefix = "Cache.keys"; - if (request3 !== void 0) request3 = webidl.converters.RequestInfo(request3, prefix, "request"); - options = webidl.converters.CacheQueryOptions(options, prefix, "options"); - let r = null; - if (request3 !== void 0) { - if (request3 instanceof Request) { - r = request3[kState]; - if (r.method !== "GET" && !options.ignoreMethod) { - return []; - } - } else if (typeof request3 === "string") { - r = new Request(request3)[kState]; - } - } - const promise = createDeferredPromise(); - const requests = []; - if (request3 === void 0) { - for (const requestResponse of this.#relevantRequestResponseList) { - requests.push(requestResponse[0]); - } - } else { - const requestResponses = this.#queryCache(r, options); - for (const requestResponse of requestResponses) { - requests.push(requestResponse[0]); - } - } - queueMicrotask(() => { - const requestList = []; - for (const request4 of requests) { - const requestObject = fromInnerRequest( - request4, - new AbortController().signal, - "immutable" - ); - requestList.push(requestObject); - } - promise.resolve(Object.freeze(requestList)); - }); - return promise.promise; - } - /** - * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm - * @param {CacheBatchOperation[]} operations - * @returns {requestResponseList} - */ - #batchCacheOperations(operations) { - const cache = this.#relevantRequestResponseList; - const backupCache = [...cache]; - const addedItems = []; - const resultList = []; - try { - for (const operation of operations) { - if (operation.type !== "delete" && operation.type !== "put") { - throw webidl.errors.exception({ - header: "Cache.#batchCacheOperations", - message: 'operation type does not match "delete" or "put"' - }); - } - if (operation.type === "delete" && operation.response != null) { - throw webidl.errors.exception({ - header: "Cache.#batchCacheOperations", - message: "delete operation should not have an associated response" - }); - } - if (this.#queryCache(operation.request, operation.options, addedItems).length) { - throw new DOMException("???", "InvalidStateError"); - } - let requestResponses; - if (operation.type === "delete") { - requestResponses = this.#queryCache(operation.request, operation.options); - if (requestResponses.length === 0) { - return []; - } - for (const requestResponse of requestResponses) { - const idx = cache.indexOf(requestResponse); - assert(idx !== -1); - cache.splice(idx, 1); - } - } else if (operation.type === "put") { - if (operation.response == null) { - throw webidl.errors.exception({ - header: "Cache.#batchCacheOperations", - message: "put operation should have an associated response" - }); - } - const r = operation.request; - if (!urlIsHttpHttpsScheme(r.url)) { - throw webidl.errors.exception({ - header: "Cache.#batchCacheOperations", - message: "expected http or https scheme" - }); - } - if (r.method !== "GET") { - throw webidl.errors.exception({ - header: "Cache.#batchCacheOperations", - message: "not get method" - }); - } - if (operation.options != null) { - throw webidl.errors.exception({ - header: "Cache.#batchCacheOperations", - message: "options must not be defined" - }); - } - requestResponses = this.#queryCache(operation.request); - for (const requestResponse of requestResponses) { - const idx = cache.indexOf(requestResponse); - assert(idx !== -1); - cache.splice(idx, 1); - } - cache.push([operation.request, operation.response]); - addedItems.push([operation.request, operation.response]); - } - resultList.push([operation.request, operation.response]); - } - return resultList; - } catch (e) { - this.#relevantRequestResponseList.length = 0; - this.#relevantRequestResponseList = backupCache; - throw e; - } - } - /** - * @see https://w3c.github.io/ServiceWorker/#query-cache - * @param {any} requestQuery - * @param {import('../../types/cache').CacheQueryOptions} options - * @param {requestResponseList} targetStorage - * @returns {requestResponseList} - */ - #queryCache(requestQuery, options, targetStorage) { - const resultList = []; - const storage = targetStorage ?? this.#relevantRequestResponseList; - for (const requestResponse of storage) { - const [cachedRequest, cachedResponse] = requestResponse; - if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { - resultList.push(requestResponse); - } - } - return resultList; - } - /** - * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm - * @param {any} requestQuery - * @param {any} request - * @param {any | null} response - * @param {import('../../types/cache').CacheQueryOptions | undefined} options - * @returns {boolean} - */ - #requestMatchesCachedItem(requestQuery, request3, response = null, options) { - const queryURL = new URL(requestQuery.url); - const cachedURL = new URL(request3.url); - if (options?.ignoreSearch) { - cachedURL.search = ""; - queryURL.search = ""; - } - if (!urlEquals(queryURL, cachedURL, true)) { - return false; - } - if (response == null || options?.ignoreVary || !response.headersList.contains("vary")) { - return true; - } - const fieldValues = getFieldValues(response.headersList.get("vary")); - for (const fieldValue of fieldValues) { - if (fieldValue === "*") { - return false; - } - const requestValue = request3.headersList.get(fieldValue); - const queryValue = requestQuery.headersList.get(fieldValue); - if (requestValue !== queryValue) { - return false; - } - } - return true; - } - #internalMatchAll(request3, options, maxResponses = Infinity) { - let r = null; - if (request3 !== void 0) { - if (request3 instanceof Request) { - r = request3[kState]; - if (r.method !== "GET" && !options.ignoreMethod) { - return []; - } - } else if (typeof request3 === "string") { - r = new Request(request3)[kState]; - } - } - const responses = []; - if (request3 === void 0) { - for (const requestResponse of this.#relevantRequestResponseList) { - responses.push(requestResponse[1]); - } - } else { - const requestResponses = this.#queryCache(r, options); - for (const requestResponse of requestResponses) { - responses.push(requestResponse[1]); - } - } - const responseList = []; - for (const response of responses) { - const responseObject = fromInnerResponse(response, "immutable"); - responseList.push(responseObject.clone()); - if (responseList.length >= maxResponses) { - break; - } - } - return Object.freeze(responseList); - } - }; - Object.defineProperties(Cache.prototype, { - [Symbol.toStringTag]: { - value: "Cache", - configurable: true - }, - match: kEnumerableProperty, - matchAll: kEnumerableProperty, - add: kEnumerableProperty, - addAll: kEnumerableProperty, - put: kEnumerableProperty, - delete: kEnumerableProperty, - keys: kEnumerableProperty - }); - var cacheQueryOptionConverters = [ - { - key: "ignoreSearch", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "ignoreMethod", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "ignoreVary", - converter: webidl.converters.boolean, - defaultValue: () => false - } - ]; - webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters); - webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ - ...cacheQueryOptionConverters, - { - key: "cacheName", - converter: webidl.converters.DOMString - } - ]); - webidl.converters.Response = webidl.interfaceConverter(Response); - webidl.converters["sequence"] = webidl.sequenceConverter( - webidl.converters.RequestInfo - ); - module2.exports = { - Cache - }; - } -}); - -// node_modules/undici/lib/web/cache/cachestorage.js -var require_cachestorage = __commonJS({ - "node_modules/undici/lib/web/cache/cachestorage.js"(exports2, module2) { - "use strict"; - var { kConstruct } = require_symbols4(); - var { Cache } = require_cache(); - var { webidl } = require_webidl(); - var { kEnumerableProperty } = require_util(); - var CacheStorage = class _CacheStorage { - /** - * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map - * @type {Map} - */ - async has(cacheName) { - webidl.brandCheck(this, _CacheStorage); - const prefix = "CacheStorage.has"; - webidl.argumentLengthCheck(arguments, 1, prefix); - cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); - return this.#caches.has(cacheName); - } - /** - * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open - * @param {string} cacheName - * @returns {Promise} - */ - async open(cacheName) { - webidl.brandCheck(this, _CacheStorage); - const prefix = "CacheStorage.open"; - webidl.argumentLengthCheck(arguments, 1, prefix); - cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); - if (this.#caches.has(cacheName)) { - const cache2 = this.#caches.get(cacheName); - return new Cache(kConstruct, cache2); - } - const cache = []; - this.#caches.set(cacheName, cache); - return new Cache(kConstruct, cache); - } - /** - * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete - * @param {string} cacheName - * @returns {Promise} - */ - async delete(cacheName) { - webidl.brandCheck(this, _CacheStorage); - const prefix = "CacheStorage.delete"; - webidl.argumentLengthCheck(arguments, 1, prefix); - cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); - return this.#caches.delete(cacheName); - } - /** - * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys - * @returns {Promise} - */ - async keys() { - webidl.brandCheck(this, _CacheStorage); - const keys = this.#caches.keys(); - return [...keys]; - } - }; - Object.defineProperties(CacheStorage.prototype, { - [Symbol.toStringTag]: { - value: "CacheStorage", - configurable: true - }, - match: kEnumerableProperty, - has: kEnumerableProperty, - open: kEnumerableProperty, - delete: kEnumerableProperty, - keys: kEnumerableProperty - }); - module2.exports = { - CacheStorage - }; - } -}); - -// node_modules/undici/lib/web/cookies/constants.js -var require_constants4 = __commonJS({ - "node_modules/undici/lib/web/cookies/constants.js"(exports2, module2) { - "use strict"; - var maxAttributeValueSize = 1024; - var maxNameValuePairSize = 4096; - module2.exports = { - maxAttributeValueSize, - maxNameValuePairSize - }; - } -}); - -// node_modules/undici/lib/web/cookies/util.js -var require_util6 = __commonJS({ - "node_modules/undici/lib/web/cookies/util.js"(exports2, module2) { - "use strict"; - function isCTLExcludingHtab(value) { - for (let i = 0; i < value.length; ++i) { - const code = value.charCodeAt(i); - if (code >= 0 && code <= 8 || code >= 10 && code <= 31 || code === 127) { - return true; - } - } - return false; - } - function validateCookieName(name) { - for (let i = 0; i < name.length; ++i) { - const code = name.charCodeAt(i); - if (code < 33 || // exclude CTLs (0-31), SP and HT - code > 126 || // exclude non-ascii and DEL - code === 34 || // " - code === 40 || // ( - code === 41 || // ) - code === 60 || // < - code === 62 || // > - code === 64 || // @ - code === 44 || // , - code === 59 || // ; - code === 58 || // : - code === 92 || // \ - code === 47 || // / - code === 91 || // [ - code === 93 || // ] - code === 63 || // ? - code === 61 || // = - code === 123 || // { - code === 125) { - throw new Error("Invalid cookie name"); - } - } - } - function validateCookieValue(value) { - let len = value.length; - let i = 0; - if (value[0] === '"') { - if (len === 1 || value[len - 1] !== '"') { - throw new Error("Invalid cookie value"); - } - --len; - ++i; - } - while (i < len) { - const code = value.charCodeAt(i++); - if (code < 33 || // exclude CTLs (0-31) - code > 126 || // non-ascii and DEL (127) - code === 34 || // " - code === 44 || // , - code === 59 || // ; - code === 92) { - throw new Error("Invalid cookie value"); - } - } - } - function validateCookiePath(path30) { - for (let i = 0; i < path30.length; ++i) { - const code = path30.charCodeAt(i); - if (code < 32 || // exclude CTLs (0-31) - code > 126 || // exclude DEL and non-ascii - code === 59) { - throw new Error("Invalid cookie path"); - } - } - } - function isLetterOrDigit(code) { - return code >= 48 && code <= 57 || // 0-9 - code >= 65 && code <= 90 || // A-Z - code >= 97 && code <= 122; - } - function validateCookieDomain(domain) { - if (domain === " ") { - return; - } - if (domain.length > 255) { - throw new Error("Invalid cookie domain"); - } - let labelLength = 0; - for (let i = 0; i < domain.length; ++i) { - const code = domain.charCodeAt(i); - if (code === 46) { - if (labelLength === 0) { - throw new Error("Invalid cookie domain"); - } - if (domain.charCodeAt(i - 1) === 45) { - throw new Error("Invalid cookie domain"); - } - labelLength = 0; - continue; - } - if (labelLength === 0 && !isLetterOrDigit(code)) { - throw new Error("Invalid cookie domain"); - } - if (!isLetterOrDigit(code) && code !== 45) { - throw new Error("Invalid cookie domain"); - } - if (++labelLength > 63) { - throw new Error("Invalid cookie domain"); - } - } - if (labelLength === 0 || domain.charCodeAt(domain.length - 1) === 45) { - throw new Error("Invalid cookie domain"); - } - } - var IMFDays = [ - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat" - ]; - var IMFMonths = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" - ]; - var IMFPaddedNumbers = Array(61).fill(0).map((_2, i) => i.toString().padStart(2, "0")); - function toIMFDate(date) { - if (typeof date === "number") { - date = new Date(date); - } - return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`; - } - function validateCookieMaxAge(maxAge) { - if (maxAge < 0) { - throw new Error("Invalid cookie max-age"); - } - } - function stringify(cookie) { - if (cookie.name.length === 0) { - return null; - } - validateCookieName(cookie.name); - validateCookieValue(cookie.value); - const out = [`${cookie.name}=${cookie.value}`]; - if (cookie.name.startsWith("__Secure-")) { - cookie.secure = true; - } - if (cookie.name.startsWith("__Host-")) { - cookie.secure = true; - cookie.domain = null; - cookie.path = "/"; - } - if (cookie.secure) { - out.push("Secure"); - } - if (cookie.httpOnly) { - out.push("HttpOnly"); - } - if (typeof cookie.maxAge === "number") { - validateCookieMaxAge(cookie.maxAge); - out.push(`Max-Age=${cookie.maxAge}`); - } - if (cookie.domain) { - validateCookieDomain(cookie.domain); - out.push(`Domain=${cookie.domain}`); - } - if (cookie.path) { - validateCookiePath(cookie.path); - out.push(`Path=${cookie.path}`); - } - if (cookie.expires && cookie.expires.toString() !== "Invalid Date") { - out.push(`Expires=${toIMFDate(cookie.expires)}`); - } - if (cookie.sameSite) { - out.push(`SameSite=${cookie.sameSite}`); - } - for (const part of cookie.unparsed) { - if (!part.includes("=")) { - throw new Error("Invalid unparsed"); - } - const [key, ...value] = part.split("="); - const trimmedKey = key.trim(); - const joinedValue = value.join("="); - validateCookieName(trimmedKey); - validateCookieValue(joinedValue); - out.push(`${trimmedKey}=${joinedValue}`); - } - return out.join("; "); - } - module2.exports = { - isCTLExcludingHtab, - validateCookieName, - validateCookiePath, - validateCookieValue, - toIMFDate, - stringify - }; - } -}); - -// node_modules/undici/lib/web/cookies/parse.js -var require_parse = __commonJS({ - "node_modules/undici/lib/web/cookies/parse.js"(exports2, module2) { - "use strict"; - var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4(); - var { isCTLExcludingHtab } = require_util6(); - var { collectASequenceOfCodePointsFast } = require_data_url(); - var assert = require("node:assert"); - function parseSetCookie(header) { - if (isCTLExcludingHtab(header)) { - return null; - } - let nameValuePair = ""; - let unparsedAttributes = ""; - let name = ""; - let value = ""; - if (header.includes(";")) { - const position = { position: 0 }; - nameValuePair = collectASequenceOfCodePointsFast(";", header, position); - unparsedAttributes = header.slice(position.position); - } else { - nameValuePair = header; - } - if (!nameValuePair.includes("=")) { - value = nameValuePair; - } else { - const position = { position: 0 }; - name = collectASequenceOfCodePointsFast( - "=", - nameValuePair, - position - ); - value = nameValuePair.slice(position.position + 1); - } - name = name.trim(); - value = value.trim(); - if (name.length + value.length > maxNameValuePairSize) { - return null; - } - return { - name, - value, - ...parseUnparsedAttributes(unparsedAttributes) - }; - } - function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) { - if (unparsedAttributes.length === 0) { - return cookieAttributeList; - } - assert(unparsedAttributes[0] === ";"); - unparsedAttributes = unparsedAttributes.slice(1); - let cookieAv = ""; - if (unparsedAttributes.includes(";")) { - cookieAv = collectASequenceOfCodePointsFast( - ";", - unparsedAttributes, - { position: 0 } - ); - unparsedAttributes = unparsedAttributes.slice(cookieAv.length); - } else { - cookieAv = unparsedAttributes; - unparsedAttributes = ""; - } - let attributeName = ""; - let attributeValue = ""; - if (cookieAv.includes("=")) { - const position = { position: 0 }; - attributeName = collectASequenceOfCodePointsFast( - "=", - cookieAv, - position - ); - attributeValue = cookieAv.slice(position.position + 1); - } else { - attributeName = cookieAv; - } - attributeName = attributeName.trim(); - attributeValue = attributeValue.trim(); - if (attributeValue.length > maxAttributeValueSize) { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - const attributeNameLowercase = attributeName.toLowerCase(); - if (attributeNameLowercase === "expires") { - const expiryTime = new Date(attributeValue); - cookieAttributeList.expires = expiryTime; - } else if (attributeNameLowercase === "max-age") { - const charCode = attributeValue.charCodeAt(0); - if ((charCode < 48 || charCode > 57) && attributeValue[0] !== "-") { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - if (!/^\d+$/.test(attributeValue)) { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - const deltaSeconds = Number(attributeValue); - cookieAttributeList.maxAge = deltaSeconds; - } else if (attributeNameLowercase === "domain") { - let cookieDomain = attributeValue; - if (cookieDomain[0] === ".") { - cookieDomain = cookieDomain.slice(1); - } - cookieDomain = cookieDomain.toLowerCase(); - cookieAttributeList.domain = cookieDomain; - } else if (attributeNameLowercase === "path") { - let cookiePath = ""; - if (attributeValue.length === 0 || attributeValue[0] !== "/") { - cookiePath = "/"; - } else { - cookiePath = attributeValue; - } - cookieAttributeList.path = cookiePath; - } else if (attributeNameLowercase === "secure") { - cookieAttributeList.secure = true; - } else if (attributeNameLowercase === "httponly") { - cookieAttributeList.httpOnly = true; - } else if (attributeNameLowercase === "samesite") { - const attributeValueLowercase = attributeValue.toLowerCase(); - if (attributeValueLowercase === "none") { - cookieAttributeList.sameSite = "None"; - } else if (attributeValueLowercase === "strict") { - cookieAttributeList.sameSite = "Strict"; - } else if (attributeValueLowercase === "lax") { - cookieAttributeList.sameSite = "Lax"; - } - } else { - cookieAttributeList.unparsed ??= []; - cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); - } - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - module2.exports = { - parseSetCookie, - parseUnparsedAttributes - }; - } -}); - -// node_modules/undici/lib/web/cookies/index.js -var require_cookies = __commonJS({ - "node_modules/undici/lib/web/cookies/index.js"(exports2, module2) { - "use strict"; - var { parseSetCookie } = require_parse(); - var { stringify } = require_util6(); - var { webidl } = require_webidl(); - var { Headers } = require_headers(); - function getCookies(headers) { - webidl.argumentLengthCheck(arguments, 1, "getCookies"); - webidl.brandCheck(headers, Headers, { strict: false }); - const cookie = headers.get("cookie"); - const out = {}; - if (!cookie) { - return out; - } - for (const piece of cookie.split(";")) { - const [name, ...value] = piece.split("="); - out[name.trim()] = value.join("="); - } - return out; - } - function deleteCookie(headers, name, attributes) { - webidl.brandCheck(headers, Headers, { strict: false }); - const prefix = "deleteCookie"; - webidl.argumentLengthCheck(arguments, 2, prefix); - name = webidl.converters.DOMString(name, prefix, "name"); - attributes = webidl.converters.DeleteCookieAttributes(attributes); - setCookie(headers, { - name, - value: "", - expires: /* @__PURE__ */ new Date(0), - ...attributes - }); - } - function getSetCookies(headers) { - webidl.argumentLengthCheck(arguments, 1, "getSetCookies"); - webidl.brandCheck(headers, Headers, { strict: false }); - const cookies = headers.getSetCookie(); - if (!cookies) { - return []; - } - return cookies.map((pair) => parseSetCookie(pair)); - } - function setCookie(headers, cookie) { - webidl.argumentLengthCheck(arguments, 2, "setCookie"); - webidl.brandCheck(headers, Headers, { strict: false }); - cookie = webidl.converters.Cookie(cookie); - const str = stringify(cookie); - if (str) { - headers.append("Set-Cookie", str); - } - } - webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ - { - converter: webidl.nullableConverter(webidl.converters.DOMString), - key: "path", - defaultValue: () => null - }, - { - converter: webidl.nullableConverter(webidl.converters.DOMString), - key: "domain", - defaultValue: () => null - } - ]); - webidl.converters.Cookie = webidl.dictionaryConverter([ - { - converter: webidl.converters.DOMString, - key: "name" - }, - { - converter: webidl.converters.DOMString, - key: "value" - }, - { - converter: webidl.nullableConverter((value) => { - if (typeof value === "number") { - return webidl.converters["unsigned long long"](value); - } - return new Date(value); - }), - key: "expires", - defaultValue: () => null - }, - { - converter: webidl.nullableConverter(webidl.converters["long long"]), - key: "maxAge", - defaultValue: () => null - }, - { - converter: webidl.nullableConverter(webidl.converters.DOMString), - key: "domain", - defaultValue: () => null - }, - { - converter: webidl.nullableConverter(webidl.converters.DOMString), - key: "path", - defaultValue: () => null - }, - { - converter: webidl.nullableConverter(webidl.converters.boolean), - key: "secure", - defaultValue: () => null - }, - { - converter: webidl.nullableConverter(webidl.converters.boolean), - key: "httpOnly", - defaultValue: () => null - }, - { - converter: webidl.converters.USVString, - key: "sameSite", - allowedValues: ["Strict", "Lax", "None"] - }, - { - converter: webidl.sequenceConverter(webidl.converters.DOMString), - key: "unparsed", - defaultValue: () => new Array(0) - } - ]); - module2.exports = { - getCookies, - deleteCookie, - getSetCookies, - setCookie - }; - } -}); - -// node_modules/undici/lib/web/websocket/events.js -var require_events = __commonJS({ - "node_modules/undici/lib/web/websocket/events.js"(exports2, module2) { - "use strict"; - var { webidl } = require_webidl(); - var { kEnumerableProperty } = require_util(); - var { kConstruct } = require_symbols(); - var { MessagePort } = require("node:worker_threads"); - var MessageEvent = class _MessageEvent extends Event { - #eventInit; - constructor(type, eventInitDict = {}) { - if (type === kConstruct) { - super(arguments[1], arguments[2]); - webidl.util.markAsUncloneable(this); - return; - } - const prefix = "MessageEvent constructor"; - webidl.argumentLengthCheck(arguments, 1, prefix); - type = webidl.converters.DOMString(type, prefix, "type"); - eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, "eventInitDict"); - super(type, eventInitDict); - this.#eventInit = eventInitDict; - webidl.util.markAsUncloneable(this); - } - get data() { - webidl.brandCheck(this, _MessageEvent); - return this.#eventInit.data; - } - get origin() { - webidl.brandCheck(this, _MessageEvent); - return this.#eventInit.origin; - } - get lastEventId() { - webidl.brandCheck(this, _MessageEvent); - return this.#eventInit.lastEventId; - } - get source() { - webidl.brandCheck(this, _MessageEvent); - return this.#eventInit.source; - } - get ports() { - webidl.brandCheck(this, _MessageEvent); - if (!Object.isFrozen(this.#eventInit.ports)) { - Object.freeze(this.#eventInit.ports); - } - return this.#eventInit.ports; - } - initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId = "", source = null, ports = []) { - webidl.brandCheck(this, _MessageEvent); - webidl.argumentLengthCheck(arguments, 1, "MessageEvent.initMessageEvent"); - return new _MessageEvent(type, { - bubbles, - cancelable, - data, - origin, - lastEventId, - source, - ports - }); - } - static createFastMessageEvent(type, init2) { - const messageEvent = new _MessageEvent(kConstruct, type, init2); - messageEvent.#eventInit = init2; - messageEvent.#eventInit.data ??= null; - messageEvent.#eventInit.origin ??= ""; - messageEvent.#eventInit.lastEventId ??= ""; - messageEvent.#eventInit.source ??= null; - messageEvent.#eventInit.ports ??= []; - return messageEvent; - } - }; - var { createFastMessageEvent } = MessageEvent; - delete MessageEvent.createFastMessageEvent; - var CloseEvent = class _CloseEvent extends Event { - #eventInit; - constructor(type, eventInitDict = {}) { - const prefix = "CloseEvent constructor"; - webidl.argumentLengthCheck(arguments, 1, prefix); - type = webidl.converters.DOMString(type, prefix, "type"); - eventInitDict = webidl.converters.CloseEventInit(eventInitDict); - super(type, eventInitDict); - this.#eventInit = eventInitDict; - webidl.util.markAsUncloneable(this); - } - get wasClean() { - webidl.brandCheck(this, _CloseEvent); - return this.#eventInit.wasClean; - } - get code() { - webidl.brandCheck(this, _CloseEvent); - return this.#eventInit.code; - } - get reason() { - webidl.brandCheck(this, _CloseEvent); - return this.#eventInit.reason; - } - }; - var ErrorEvent = class _ErrorEvent extends Event { - #eventInit; - constructor(type, eventInitDict) { - const prefix = "ErrorEvent constructor"; - webidl.argumentLengthCheck(arguments, 1, prefix); - super(type, eventInitDict); - webidl.util.markAsUncloneable(this); - type = webidl.converters.DOMString(type, prefix, "type"); - eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}); - this.#eventInit = eventInitDict; - } - get message() { - webidl.brandCheck(this, _ErrorEvent); - return this.#eventInit.message; - } - get filename() { - webidl.brandCheck(this, _ErrorEvent); - return this.#eventInit.filename; - } - get lineno() { - webidl.brandCheck(this, _ErrorEvent); - return this.#eventInit.lineno; - } - get colno() { - webidl.brandCheck(this, _ErrorEvent); - return this.#eventInit.colno; - } - get error() { - webidl.brandCheck(this, _ErrorEvent); - return this.#eventInit.error; - } - }; - Object.defineProperties(MessageEvent.prototype, { - [Symbol.toStringTag]: { - value: "MessageEvent", - configurable: true - }, - data: kEnumerableProperty, - origin: kEnumerableProperty, - lastEventId: kEnumerableProperty, - source: kEnumerableProperty, - ports: kEnumerableProperty, - initMessageEvent: kEnumerableProperty - }); - Object.defineProperties(CloseEvent.prototype, { - [Symbol.toStringTag]: { - value: "CloseEvent", - configurable: true - }, - reason: kEnumerableProperty, - code: kEnumerableProperty, - wasClean: kEnumerableProperty - }); - Object.defineProperties(ErrorEvent.prototype, { - [Symbol.toStringTag]: { - value: "ErrorEvent", - configurable: true - }, - message: kEnumerableProperty, - filename: kEnumerableProperty, - lineno: kEnumerableProperty, - colno: kEnumerableProperty, - error: kEnumerableProperty - }); - webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort); - webidl.converters["sequence"] = webidl.sequenceConverter( - webidl.converters.MessagePort - ); - var eventInit = [ - { - key: "bubbles", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "cancelable", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "composed", - converter: webidl.converters.boolean, - defaultValue: () => false - } - ]; - webidl.converters.MessageEventInit = webidl.dictionaryConverter([ - ...eventInit, - { - key: "data", - converter: webidl.converters.any, - defaultValue: () => null - }, - { - key: "origin", - converter: webidl.converters.USVString, - defaultValue: () => "" - }, - { - key: "lastEventId", - converter: webidl.converters.DOMString, - defaultValue: () => "" - }, - { - key: "source", - // Node doesn't implement WindowProxy or ServiceWorker, so the only - // valid value for source is a MessagePort. - converter: webidl.nullableConverter(webidl.converters.MessagePort), - defaultValue: () => null - }, - { - key: "ports", - converter: webidl.converters["sequence"], - defaultValue: () => new Array(0) - } - ]); - webidl.converters.CloseEventInit = webidl.dictionaryConverter([ - ...eventInit, - { - key: "wasClean", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "code", - converter: webidl.converters["unsigned short"], - defaultValue: () => 0 - }, - { - key: "reason", - converter: webidl.converters.USVString, - defaultValue: () => "" - } - ]); - webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ - ...eventInit, - { - key: "message", - converter: webidl.converters.DOMString, - defaultValue: () => "" - }, - { - key: "filename", - converter: webidl.converters.USVString, - defaultValue: () => "" - }, - { - key: "lineno", - converter: webidl.converters["unsigned long"], - defaultValue: () => 0 - }, - { - key: "colno", - converter: webidl.converters["unsigned long"], - defaultValue: () => 0 - }, - { - key: "error", - converter: webidl.converters.any - } - ]); - module2.exports = { - MessageEvent, - CloseEvent, - ErrorEvent, - createFastMessageEvent - }; - } -}); - -// node_modules/undici/lib/web/websocket/constants.js -var require_constants5 = __commonJS({ - "node_modules/undici/lib/web/websocket/constants.js"(exports2, module2) { - "use strict"; - var uid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; - var staticPropertyDescriptors = { - enumerable: true, - writable: false, - configurable: false - }; - var states = { - CONNECTING: 0, - OPEN: 1, - CLOSING: 2, - CLOSED: 3 - }; - var sentCloseFrameState = { - NOT_SENT: 0, - PROCESSING: 1, - SENT: 2 - }; - var opcodes = { - CONTINUATION: 0, - TEXT: 1, - BINARY: 2, - CLOSE: 8, - PING: 9, - PONG: 10 - }; - var maxUnsigned16Bit = 2 ** 16 - 1; - var parserStates = { - INFO: 0, - PAYLOADLENGTH_16: 2, - PAYLOADLENGTH_64: 3, - READ_DATA: 4 - }; - var emptyBuffer = Buffer.allocUnsafe(0); - var sendHints = { - string: 1, - typedArray: 2, - arrayBuffer: 3, - blob: 4 - }; - module2.exports = { - uid, - sentCloseFrameState, - staticPropertyDescriptors, - states, - opcodes, - maxUnsigned16Bit, - parserStates, - emptyBuffer, - sendHints - }; - } -}); - -// node_modules/undici/lib/web/websocket/symbols.js -var require_symbols5 = __commonJS({ - "node_modules/undici/lib/web/websocket/symbols.js"(exports2, module2) { - "use strict"; - module2.exports = { - kWebSocketURL: /* @__PURE__ */ Symbol("url"), - kReadyState: /* @__PURE__ */ Symbol("ready state"), - kController: /* @__PURE__ */ Symbol("controller"), - kResponse: /* @__PURE__ */ Symbol("response"), - kBinaryType: /* @__PURE__ */ Symbol("binary type"), - kSentClose: /* @__PURE__ */ Symbol("sent close"), - kReceivedClose: /* @__PURE__ */ Symbol("received close"), - kByteParser: /* @__PURE__ */ Symbol("byte parser") - }; - } -}); - -// node_modules/undici/lib/web/websocket/util.js -var require_util7 = __commonJS({ - "node_modules/undici/lib/web/websocket/util.js"(exports2, module2) { - "use strict"; - var { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols5(); - var { states, opcodes } = require_constants5(); - var { ErrorEvent, createFastMessageEvent } = require_events(); - var { isUtf8 } = require("node:buffer"); - var { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require_data_url(); - function isConnecting(ws) { - return ws[kReadyState] === states.CONNECTING; - } - function isEstablished(ws) { - return ws[kReadyState] === states.OPEN; - } - function isClosing(ws) { - return ws[kReadyState] === states.CLOSING; - } - function isClosed(ws) { - return ws[kReadyState] === states.CLOSED; - } - function fireEvent(e, target, eventFactory = (type, init2) => new Event(type, init2), eventInitDict = {}) { - const event = eventFactory(e, eventInitDict); - target.dispatchEvent(event); - } - function websocketMessageReceived(ws, type, data) { - if (ws[kReadyState] !== states.OPEN) { - return; - } - let dataForEvent; - if (type === opcodes.TEXT) { - try { - dataForEvent = utf8Decode(data); - } catch { - failWebsocketConnection(ws, "Received invalid UTF-8 in text frame."); - return; - } - } else if (type === opcodes.BINARY) { - if (ws[kBinaryType] === "blob") { - dataForEvent = new Blob([data]); - } else { - dataForEvent = toArrayBuffer(data); - } - } - fireEvent("message", ws, createFastMessageEvent, { - origin: ws[kWebSocketURL].origin, - data: dataForEvent - }); - } - function toArrayBuffer(buffer) { - if (buffer.byteLength === buffer.buffer.byteLength) { - return buffer.buffer; - } - return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength); - } - function isValidSubprotocol(protocol) { - if (protocol.length === 0) { - return false; - } - for (let i = 0; i < protocol.length; ++i) { - const code = protocol.charCodeAt(i); - if (code < 33 || // CTL, contains SP (0x20) and HT (0x09) - code > 126 || code === 34 || // " - code === 40 || // ( - code === 41 || // ) - code === 44 || // , - code === 47 || // / - code === 58 || // : - code === 59 || // ; - code === 60 || // < - code === 61 || // = - code === 62 || // > - code === 63 || // ? - code === 64 || // @ - code === 91 || // [ - code === 92 || // \ - code === 93 || // ] - code === 123 || // { - code === 125) { - return false; - } - } - return true; - } - function isValidStatusCode(code) { - if (code >= 1e3 && code < 1015) { - return code !== 1004 && // reserved - code !== 1005 && // "MUST NOT be set as a status code" - code !== 1006; - } - return code >= 3e3 && code <= 4999; - } - function failWebsocketConnection(ws, reason) { - const { [kController]: controller, [kResponse]: response } = ws; - controller.abort(); - if (response?.socket && !response.socket.destroyed) { - response.socket.destroy(); - } - if (reason) { - fireEvent("error", ws, (type, init2) => new ErrorEvent(type, init2), { - error: new Error(reason), - message: reason - }); - } - } - function isControlFrame(opcode) { - return opcode === opcodes.CLOSE || opcode === opcodes.PING || opcode === opcodes.PONG; - } - function isContinuationFrame(opcode) { - return opcode === opcodes.CONTINUATION; - } - function isTextBinaryFrame(opcode) { - return opcode === opcodes.TEXT || opcode === opcodes.BINARY; - } - function isValidOpcode(opcode) { - return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode); - } - function parseExtensions(extensions) { - const position = { position: 0 }; - const extensionList = /* @__PURE__ */ new Map(); - while (position.position < extensions.length) { - const pair = collectASequenceOfCodePointsFast(";", extensions, position); - const [name, value = ""] = pair.split("="); - extensionList.set( - removeHTTPWhitespace(name, true, false), - removeHTTPWhitespace(value, false, true) - ); - position.position++; - } - return extensionList; - } - function isValidClientWindowBits(value) { - if (value.length === 0) { - return false; - } - for (let i = 0; i < value.length; i++) { - const byte = value.charCodeAt(i); - if (byte < 48 || byte > 57) { - return false; - } - } - const num = Number.parseInt(value, 10); - return num >= 8 && num <= 15; - } - var hasIntl = typeof process.versions.icu === "string"; - var fatalDecoder = hasIntl ? new TextDecoder("utf-8", { fatal: true }) : void 0; - var utf8Decode = hasIntl ? fatalDecoder.decode.bind(fatalDecoder) : function(buffer) { - if (isUtf8(buffer)) { - return buffer.toString("utf-8"); - } - throw new TypeError("Invalid utf-8 received."); - }; - module2.exports = { - isConnecting, - isEstablished, - isClosing, - isClosed, - fireEvent, - isValidSubprotocol, - isValidStatusCode, - failWebsocketConnection, - websocketMessageReceived, - utf8Decode, - isControlFrame, - isContinuationFrame, - isTextBinaryFrame, - isValidOpcode, - parseExtensions, - isValidClientWindowBits - }; - } -}); - -// node_modules/undici/lib/web/websocket/frame.js -var require_frame = __commonJS({ - "node_modules/undici/lib/web/websocket/frame.js"(exports2, module2) { - "use strict"; - var { maxUnsigned16Bit } = require_constants5(); - var BUFFER_SIZE = 16386; - var crypto3; - var buffer = null; - var bufIdx = BUFFER_SIZE; - try { - crypto3 = require("node:crypto"); - } catch { - crypto3 = { - // not full compatibility, but minimum. - randomFillSync: function randomFillSync(buffer2, _offset, _size) { - for (let i = 0; i < buffer2.length; ++i) { - buffer2[i] = Math.random() * 255 | 0; - } - return buffer2; - } - }; - } - function generateMask() { - if (bufIdx === BUFFER_SIZE) { - bufIdx = 0; - crypto3.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); - } - return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]; - } - var WebsocketFrameSend = class { - /** - * @param {Buffer|undefined} data - */ - constructor(data) { - this.frameData = data; - } - createFrame(opcode) { - const frameData = this.frameData; - const maskKey = generateMask(); - const bodyLength = frameData?.byteLength ?? 0; - let payloadLength = bodyLength; - let offset = 6; - if (bodyLength > maxUnsigned16Bit) { - offset += 8; - payloadLength = 127; - } else if (bodyLength > 125) { - offset += 2; - payloadLength = 126; - } - const buffer2 = Buffer.allocUnsafe(bodyLength + offset); - buffer2[0] = buffer2[1] = 0; - buffer2[0] |= 128; - buffer2[0] = (buffer2[0] & 240) + opcode; - buffer2[offset - 4] = maskKey[0]; - buffer2[offset - 3] = maskKey[1]; - buffer2[offset - 2] = maskKey[2]; - buffer2[offset - 1] = maskKey[3]; - buffer2[1] = payloadLength; - if (payloadLength === 126) { - buffer2.writeUInt16BE(bodyLength, 2); - } else if (payloadLength === 127) { - buffer2[2] = buffer2[3] = 0; - buffer2.writeUIntBE(bodyLength, 4, 6); - } - buffer2[1] |= 128; - for (let i = 0; i < bodyLength; ++i) { - buffer2[offset + i] = frameData[i] ^ maskKey[i & 3]; - } - return buffer2; - } - }; - module2.exports = { - WebsocketFrameSend - }; - } -}); - -// node_modules/undici/lib/web/websocket/connection.js -var require_connection = __commonJS({ - "node_modules/undici/lib/web/websocket/connection.js"(exports2, module2) { - "use strict"; - var { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require_constants5(); - var { - kReadyState, - kSentClose, - kByteParser, - kReceivedClose, - kResponse - } = require_symbols5(); - var { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require_util7(); - var { channels } = require_diagnostics(); - var { CloseEvent } = require_events(); - var { makeRequest } = require_request2(); - var { fetching } = require_fetch(); - var { Headers, getHeadersList } = require_headers(); - var { getDecodeSplit } = require_util2(); - var { WebsocketFrameSend } = require_frame(); - var crypto3; - try { - crypto3 = require("node:crypto"); - } catch { - } - function establishWebSocketConnection(url2, protocols, client, ws, onEstablish, options) { - const requestURL = url2; - requestURL.protocol = url2.protocol === "ws:" ? "http:" : "https:"; - const request3 = makeRequest({ - urlList: [requestURL], - client, - serviceWorkers: "none", - referrer: "no-referrer", - mode: "websocket", - credentials: "include", - cache: "no-store", - redirect: "error" - }); - if (options.headers) { - const headersList = getHeadersList(new Headers(options.headers)); - request3.headersList = headersList; - } - const keyValue = crypto3.randomBytes(16).toString("base64"); - request3.headersList.append("sec-websocket-key", keyValue); - request3.headersList.append("sec-websocket-version", "13"); - for (const protocol of protocols) { - request3.headersList.append("sec-websocket-protocol", protocol); - } - const permessageDeflate = "permessage-deflate; client_max_window_bits"; - request3.headersList.append("sec-websocket-extensions", permessageDeflate); - const controller = fetching({ - request: request3, - useParallelQueue: true, - dispatcher: options.dispatcher, - processResponse(response) { - if (response.type === "error" || response.status !== 101) { - failWebsocketConnection(ws, "Received network error or non-101 status code."); - return; - } - if (protocols.length !== 0 && !response.headersList.get("Sec-WebSocket-Protocol")) { - failWebsocketConnection(ws, "Server did not respond with sent protocols."); - return; - } - if (response.headersList.get("Upgrade")?.toLowerCase() !== "websocket") { - failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".'); - return; - } - if (response.headersList.get("Connection")?.toLowerCase() !== "upgrade") { - failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".'); - return; - } - const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64"); - if (secWSAccept !== digest) { - failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); - return; - } - const secExtension = response.headersList.get("Sec-WebSocket-Extensions"); - let extensions; - if (secExtension !== null) { - extensions = parseExtensions(secExtension); - if (!extensions.has("permessage-deflate")) { - failWebsocketConnection(ws, "Sec-WebSocket-Extensions header does not match."); - return; - } - } - const secProtocol = response.headersList.get("Sec-WebSocket-Protocol"); - if (secProtocol !== null) { - const requestProtocols = getDecodeSplit("sec-websocket-protocol", request3.headersList); - if (!requestProtocols.includes(secProtocol)) { - failWebsocketConnection(ws, "Protocol was not set in the opening handshake."); - return; - } - } - response.socket.on("data", onSocketData); - response.socket.on("close", onSocketClose); - response.socket.on("error", onSocketError); - if (channels.open.hasSubscribers) { - channels.open.publish({ - address: response.socket.address(), - protocol: secProtocol, - extensions: secExtension - }); - } - onEstablish(response, extensions); - } - }); - return controller; - } - function closeWebSocketConnection(ws, code, reason, reasonByteLength) { - if (isClosing(ws) || isClosed(ws)) { - } else if (!isEstablished(ws)) { - failWebsocketConnection(ws, "Connection was closed before it was established."); - ws[kReadyState] = states.CLOSING; - } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) { - ws[kSentClose] = sentCloseFrameState.PROCESSING; - const frame = new WebsocketFrameSend(); - if (code !== void 0 && reason === void 0) { - frame.frameData = Buffer.allocUnsafe(2); - frame.frameData.writeUInt16BE(code, 0); - } else if (code !== void 0 && reason !== void 0) { - frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength); - frame.frameData.writeUInt16BE(code, 0); - frame.frameData.write(reason, 2, "utf-8"); - } else { - frame.frameData = emptyBuffer; - } - const socket = ws[kResponse].socket; - socket.write(frame.createFrame(opcodes.CLOSE)); - ws[kSentClose] = sentCloseFrameState.SENT; - ws[kReadyState] = states.CLOSING; - } else { - ws[kReadyState] = states.CLOSING; - } - } - function onSocketData(chunk) { - if (!this.ws[kByteParser].write(chunk)) { - this.pause(); - } - } - function onSocketClose() { - const { ws } = this; - const { [kResponse]: response } = ws; - response.socket.off("data", onSocketData); - response.socket.off("close", onSocketClose); - response.socket.off("error", onSocketError); - const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]; - let code = 1005; - let reason = ""; - const result = ws[kByteParser].closingInfo; - if (result && !result.error) { - code = result.code ?? 1005; - reason = result.reason; - } else if (!ws[kReceivedClose]) { - code = 1006; - } - ws[kReadyState] = states.CLOSED; - fireEvent("close", ws, (type, init2) => new CloseEvent(type, init2), { - wasClean, - code, - reason - }); - if (channels.close.hasSubscribers) { - channels.close.publish({ - websocket: ws, - code, - reason - }); - } - } - function onSocketError(error3) { - const { ws } = this; - ws[kReadyState] = states.CLOSING; - if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error3); - } - this.destroy(); - } - module2.exports = { - establishWebSocketConnection, - closeWebSocketConnection - }; - } -}); - -// node_modules/undici/lib/web/websocket/permessage-deflate.js -var require_permessage_deflate = __commonJS({ - "node_modules/undici/lib/web/websocket/permessage-deflate.js"(exports2, module2) { - "use strict"; - var { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require("node:zlib"); - var { isValidClientWindowBits } = require_util7(); - var { MessageSizeExceededError } = require_errors(); - var tail = Buffer.from([0, 0, 255, 255]); - var kBuffer = /* @__PURE__ */ Symbol("kBuffer"); - var kLength = /* @__PURE__ */ Symbol("kLength"); - var PerMessageDeflate = class { - /** @type {import('node:zlib').InflateRaw} */ - #inflate; - #options = {}; - #maxPayloadSize = 0; - /** - * @param {Map} extensions - */ - constructor(extensions, options) { - this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover"); - this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits"); - this.#maxPayloadSize = options.maxPayloadSize; - } - /** - * Decompress a compressed payload. - * @param {Buffer} chunk Compressed data - * @param {boolean} fin Final fragment flag - * @param {Function} callback Callback function - */ - decompress(chunk, fin, callback) { - if (!this.#inflate) { - let windowBits = Z_DEFAULT_WINDOWBITS; - if (this.#options.serverMaxWindowBits) { - if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) { - callback(new Error("Invalid server_max_window_bits")); - return; - } - windowBits = Number.parseInt(this.#options.serverMaxWindowBits); - } - try { - this.#inflate = createInflateRaw({ windowBits }); - } catch (err) { - callback(err); - return; - } - this.#inflate[kBuffer] = []; - this.#inflate[kLength] = 0; - this.#inflate.on("data", (data) => { - this.#inflate[kLength] += data.length; - if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) { - callback(new MessageSizeExceededError()); - this.#inflate.removeAllListeners(); - this.#inflate = null; - return; - } - this.#inflate[kBuffer].push(data); - }); - this.#inflate.on("error", (err) => { - this.#inflate = null; - callback(err); - }); - } - this.#inflate.write(chunk); - if (fin) { - this.#inflate.write(tail); - } - this.#inflate.flush(() => { - if (!this.#inflate) { - return; - } - const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]); - this.#inflate[kBuffer].length = 0; - this.#inflate[kLength] = 0; - callback(null, full); - }); - } - }; - module2.exports = { PerMessageDeflate }; - } -}); - -// node_modules/undici/lib/web/websocket/receiver.js -var require_receiver = __commonJS({ - "node_modules/undici/lib/web/websocket/receiver.js"(exports2, module2) { - "use strict"; - var { Writable } = require("node:stream"); - var assert = require("node:assert"); - var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5(); - var { kReadyState, kSentClose, kResponse, kReceivedClose } = require_symbols5(); - var { channels } = require_diagnostics(); - var { - isValidStatusCode, - isValidOpcode, - failWebsocketConnection, - websocketMessageReceived, - utf8Decode, - isControlFrame, - isTextBinaryFrame, - isContinuationFrame - } = require_util7(); - var { WebsocketFrameSend } = require_frame(); - var { closeWebSocketConnection } = require_connection(); - var { PerMessageDeflate } = require_permessage_deflate(); - var { MessageSizeExceededError } = require_errors(); - function failWebsocketConnectionWithCode(ws, code, reason) { - closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason)); - failWebsocketConnection(ws, reason); - } - var ByteParser = class extends Writable { - #buffers = []; - #fragmentsBytes = 0; - #byteOffset = 0; - #loop = false; - #state = parserStates.INFO; - #info = {}; - #fragments = []; - /** @type {Map} */ - #extensions; - /** @type {number} */ - #maxFragments; - /** @type {number} */ - #maxPayloadSize; - /** - * @param {import('./websocket').WebSocket} ws - * @param {Map|null} extensions - * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options] - */ - constructor(ws, extensions, options = {}) { - super(); - this.ws = ws; - this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions; - this.#maxFragments = options.maxFragments ?? 0; - this.#maxPayloadSize = options.maxPayloadSize ?? 0; - if (this.#extensions.has("permessage-deflate")) { - this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions, options)); - } - } - /** - * @param {Buffer} chunk - * @param {() => void} callback - */ - _write(chunk, _2, callback) { - this.#buffers.push(chunk); - this.#byteOffset += chunk.length; - this.#loop = true; - this.run(callback); - } - #validatePayloadLength() { - if (this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnectionWithCode(this.ws, 1009, "Payload size exceeds maximum allowed size"); - return false; - } - return true; - } - /** - * Runs whenever a new chunk is received. - * Callback is called whenever there are no more chunks buffering, - * or not enough bytes are buffered to parse. - */ - run(callback) { - while (this.#loop) { - if (this.#state === parserStates.INFO) { - if (this.#byteOffset < 2) { - return callback(); - } - const buffer = this.consume(2); - const fin = (buffer[0] & 128) !== 0; - const opcode = buffer[0] & 15; - const masked = (buffer[1] & 128) === 128; - const fragmented = !fin && opcode !== opcodes.CONTINUATION; - const payloadLength = buffer[1] & 127; - const rsv1 = buffer[0] & 64; - const rsv2 = buffer[0] & 32; - const rsv3 = buffer[0] & 16; - if (!isValidOpcode(opcode)) { - failWebsocketConnection(this.ws, "Invalid opcode received"); - return callback(); - } - if (masked) { - failWebsocketConnection(this.ws, "Frame cannot be masked"); - return callback(); - } - if (rsv1 !== 0 && !this.#extensions.has("permessage-deflate")) { - failWebsocketConnection(this.ws, "Expected RSV1 to be clear."); - return; - } - if (rsv2 !== 0 || rsv3 !== 0) { - failWebsocketConnection(this.ws, "RSV1, RSV2, RSV3 must be clear"); - return; - } - if (fragmented && !isTextBinaryFrame(opcode)) { - failWebsocketConnection(this.ws, "Invalid frame type was fragmented."); - return; - } - if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) { - failWebsocketConnection(this.ws, "Expected continuation frame"); - return; - } - if (this.#info.fragmented && fragmented) { - failWebsocketConnection(this.ws, "Fragmented frame exceeded 125 bytes."); - return; - } - if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) { - failWebsocketConnection(this.ws, "Control frame either too large or fragmented"); - return; - } - if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) { - failWebsocketConnection(this.ws, "Unexpected continuation frame"); - return; - } - if (payloadLength <= 125) { - this.#info.payloadLength = payloadLength; - this.#state = parserStates.READ_DATA; - if (!this.#validatePayloadLength()) { - return; - } - } else if (payloadLength === 126) { - this.#state = parserStates.PAYLOADLENGTH_16; - } else if (payloadLength === 127) { - this.#state = parserStates.PAYLOADLENGTH_64; - } - if (isTextBinaryFrame(opcode)) { - this.#info.binaryType = opcode; - this.#info.compressed = rsv1 !== 0; - } - this.#info.opcode = opcode; - this.#info.masked = masked; - this.#info.fin = fin; - this.#info.fragmented = fragmented; - } else if (this.#state === parserStates.PAYLOADLENGTH_16) { - if (this.#byteOffset < 2) { - return callback(); - } - const buffer = this.consume(2); - this.#info.payloadLength = buffer.readUInt16BE(0); - this.#state = parserStates.READ_DATA; - if (!this.#validatePayloadLength()) { - return; - } - } else if (this.#state === parserStates.PAYLOADLENGTH_64) { - if (this.#byteOffset < 8) { - return callback(); - } - const buffer = this.consume(8); - const upper = buffer.readUInt32BE(0); - const lower = buffer.readUInt32BE(4); - if (upper !== 0 || lower > 2 ** 31 - 1) { - failWebsocketConnection(this.ws, "Received payload length > 2^31 bytes."); - return; - } - this.#info.payloadLength = lower; - this.#state = parserStates.READ_DATA; - if (!this.#validatePayloadLength()) { - return; - } - } else if (this.#state === parserStates.READ_DATA) { - if (this.#byteOffset < this.#info.payloadLength) { - return callback(); - } - const body = this.consume(this.#info.payloadLength); - if (isControlFrame(this.#info.opcode)) { - this.#loop = this.parseControlFrame(body); - this.#state = parserStates.INFO; - } else { - if (!this.#info.compressed) { - if (!this.writeFragments(body)) { - return; - } - if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message); - return; - } - if (!this.#info.fragmented && this.#info.fin) { - websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); - } - this.#state = parserStates.INFO; - } else { - this.#extensions.get("permessage-deflate").decompress( - body, - this.#info.fin, - (error3, data) => { - if (error3) { - const code = error3 instanceof MessageSizeExceededError ? 1009 : 1007; - failWebsocketConnectionWithCode(this.ws, code, error3.message); - return; - } - if (!this.writeFragments(data)) { - return; - } - if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message); - return; - } - if (!this.#info.fin) { - this.#state = parserStates.INFO; - this.#loop = true; - this.run(callback); - return; - } - websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); - this.#loop = true; - this.#state = parserStates.INFO; - this.run(callback); - } - ); - this.#loop = false; - break; - } - } - } - } - } - /** - * Take n bytes from the buffered Buffers - * @param {number} n - * @returns {Buffer} - */ - consume(n) { - if (n > this.#byteOffset) { - throw new Error("Called consume() before buffers satiated."); - } else if (n === 0) { - return emptyBuffer; - } - if (this.#buffers[0].length === n) { - this.#byteOffset -= this.#buffers[0].length; - return this.#buffers.shift(); - } - const buffer = Buffer.allocUnsafe(n); - let offset = 0; - while (offset !== n) { - const next = this.#buffers[0]; - const { length } = next; - if (length + offset === n) { - buffer.set(this.#buffers.shift(), offset); - break; - } else if (length + offset > n) { - buffer.set(next.subarray(0, n - offset), offset); - this.#buffers[0] = next.subarray(n - offset); - break; - } else { - buffer.set(this.#buffers.shift(), offset); - offset += next.length; - } - } - this.#byteOffset -= n; - return buffer; - } - writeFragments(fragment) { - if (this.#maxFragments > 0 && this.#fragments.length === this.#maxFragments) { - failWebsocketConnectionWithCode(this.ws, 1008, "Too many message fragments"); - return false; - } - this.#fragmentsBytes += fragment.length; - this.#fragments.push(fragment); - return true; - } - consumeFragments() { - const fragments = this.#fragments; - if (fragments.length === 1) { - this.#fragmentsBytes = 0; - return fragments.shift(); - } - const output = Buffer.concat(fragments, this.#fragmentsBytes); - this.#fragments = []; - this.#fragmentsBytes = 0; - return output; - } - parseCloseBody(data) { - assert(data.length !== 1); - let code; - if (data.length >= 2) { - code = data.readUInt16BE(0); - } - if (code !== void 0 && !isValidStatusCode(code)) { - return { code: 1002, reason: "Invalid status code", error: true }; - } - let reason = data.subarray(2); - if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) { - reason = reason.subarray(3); - } - try { - reason = utf8Decode(reason); - } catch { - return { code: 1007, reason: "Invalid UTF-8", error: true }; - } - return { code, reason, error: false }; - } - /** - * Parses control frames. - * @param {Buffer} body - */ - parseControlFrame(body) { - const { opcode, payloadLength } = this.#info; - if (opcode === opcodes.CLOSE) { - if (payloadLength === 1) { - failWebsocketConnection(this.ws, "Received close frame with a 1-byte body."); - return false; - } - this.#info.closeInfo = this.parseCloseBody(body); - if (this.#info.closeInfo.error) { - const { code, reason } = this.#info.closeInfo; - closeWebSocketConnection(this.ws, code, reason, reason.length); - failWebsocketConnection(this.ws, reason); - return false; - } - if (this.ws[kSentClose] !== sentCloseFrameState.SENT) { - let body2 = emptyBuffer; - if (this.#info.closeInfo.code) { - body2 = Buffer.allocUnsafe(2); - body2.writeUInt16BE(this.#info.closeInfo.code, 0); - } - const closeFrame = new WebsocketFrameSend(body2); - this.ws[kResponse].socket.write( - closeFrame.createFrame(opcodes.CLOSE), - (err) => { - if (!err) { - this.ws[kSentClose] = sentCloseFrameState.SENT; - } - } - ); - } - this.ws[kReadyState] = states.CLOSING; - this.ws[kReceivedClose] = true; - return false; - } else if (opcode === opcodes.PING) { - if (!this.ws[kReceivedClose]) { - const frame = new WebsocketFrameSend(body); - this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)); - if (channels.ping.hasSubscribers) { - channels.ping.publish({ - payload: body - }); - } - } - } else if (opcode === opcodes.PONG) { - if (channels.pong.hasSubscribers) { - channels.pong.publish({ - payload: body - }); - } - } - return true; - } - get closingInfo() { - return this.#info.closeInfo; - } - }; - module2.exports = { - ByteParser - }; - } -}); - -// node_modules/undici/lib/web/websocket/sender.js -var require_sender = __commonJS({ - "node_modules/undici/lib/web/websocket/sender.js"(exports2, module2) { - "use strict"; - var { WebsocketFrameSend } = require_frame(); - var { opcodes, sendHints } = require_constants5(); - var FixedQueue = require_fixed_queue(); - var FastBuffer = Buffer[Symbol.species]; - var SendQueue = class { - /** - * @type {FixedQueue} - */ - #queue = new FixedQueue(); - /** - * @type {boolean} - */ - #running = false; - /** @type {import('node:net').Socket} */ - #socket; - constructor(socket) { - this.#socket = socket; - } - add(item, cb, hint) { - if (hint !== sendHints.blob) { - const frame = createFrame(item, hint); - if (!this.#running) { - this.#socket.write(frame, cb); - } else { - const node2 = { - promise: null, - callback: cb, - frame - }; - this.#queue.push(node2); - } - return; - } - const node = { - promise: item.arrayBuffer().then((ab) => { - node.promise = null; - node.frame = createFrame(ab, hint); - }), - callback: cb, - frame: null - }; - this.#queue.push(node); - if (!this.#running) { - this.#run(); - } - } - async #run() { - this.#running = true; - const queue2 = this.#queue; - while (!queue2.isEmpty()) { - const node = queue2.shift(); - if (node.promise !== null) { - await node.promise; - } - this.#socket.write(node.frame, node.callback); - node.callback = node.frame = null; - } - this.#running = false; - } - }; - function createFrame(data, hint) { - return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY); - } - function toBuffer(data, hint) { - switch (hint) { - case sendHints.string: - return Buffer.from(data); - case sendHints.arrayBuffer: - case sendHints.blob: - return new FastBuffer(data); - case sendHints.typedArray: - return new FastBuffer(data.buffer, data.byteOffset, data.byteLength); - } - } - module2.exports = { SendQueue }; - } -}); - -// node_modules/undici/lib/web/websocket/websocket.js -var require_websocket = __commonJS({ - "node_modules/undici/lib/web/websocket/websocket.js"(exports2, module2) { - "use strict"; - var { webidl } = require_webidl(); - var { URLSerializer } = require_data_url(); - var { environmentSettingsObject } = require_util2(); - var { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require_constants5(); - var { - kWebSocketURL, - kReadyState, - kController, - kBinaryType, - kResponse, - kSentClose, - kByteParser - } = require_symbols5(); - var { - isConnecting, - isEstablished, - isClosing, - isValidSubprotocol, - fireEvent - } = require_util7(); - var { establishWebSocketConnection, closeWebSocketConnection } = require_connection(); - var { ByteParser } = require_receiver(); - var { kEnumerableProperty, isBlobLike } = require_util(); - var { getGlobalDispatcher } = require_global2(); - var { types: types2 } = require("node:util"); - var { ErrorEvent, CloseEvent } = require_events(); - var { SendQueue } = require_sender(); - var WebSocket = class _WebSocket extends EventTarget { - #events = { - open: null, - error: null, - close: null, - message: null - }; - #bufferedAmount = 0; - #protocol = ""; - #extensions = ""; - /** @type {SendQueue} */ - #sendQueue; - /** - * @param {string} url - * @param {string|string[]} protocols - */ - constructor(url2, protocols = []) { - super(); - webidl.util.markAsUncloneable(this); - const prefix = "WebSocket constructor"; - webidl.argumentLengthCheck(arguments, 1, prefix); - const options = webidl.converters["DOMString or sequence or WebSocketInit"](protocols, prefix, "options"); - url2 = webidl.converters.USVString(url2, prefix, "url"); - protocols = options.protocols; - const baseURL = environmentSettingsObject.settingsObject.baseUrl; - let urlRecord; - try { - urlRecord = new URL(url2, baseURL); - } catch (e) { - throw new DOMException(e, "SyntaxError"); - } - if (urlRecord.protocol === "http:") { - urlRecord.protocol = "ws:"; - } else if (urlRecord.protocol === "https:") { - urlRecord.protocol = "wss:"; - } - if (urlRecord.protocol !== "ws:" && urlRecord.protocol !== "wss:") { - throw new DOMException( - `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, - "SyntaxError" - ); - } - if (urlRecord.hash || urlRecord.href.endsWith("#")) { - throw new DOMException("Got fragment", "SyntaxError"); - } - if (typeof protocols === "string") { - protocols = [protocols]; - } - if (protocols.length !== new Set(protocols.map((p) => p.toLowerCase())).size) { - throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); - } - if (protocols.length > 0 && !protocols.every((p) => isValidSubprotocol(p))) { - throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); - } - this[kWebSocketURL] = new URL(urlRecord.href); - const client = environmentSettingsObject.settingsObject; - this[kController] = establishWebSocketConnection( - urlRecord, - protocols, - client, - this, - (response, extensions) => this.#onConnectionEstablished(response, extensions), - options - ); - this[kReadyState] = _WebSocket.CONNECTING; - this[kSentClose] = sentCloseFrameState.NOT_SENT; - this[kBinaryType] = "blob"; - } - /** - * @see https://websockets.spec.whatwg.org/#dom-websocket-close - * @param {number|undefined} code - * @param {string|undefined} reason - */ - close(code = void 0, reason = void 0) { - webidl.brandCheck(this, _WebSocket); - const prefix = "WebSocket.close"; - if (code !== void 0) { - code = webidl.converters["unsigned short"](code, prefix, "code", { clamp: true }); - } - if (reason !== void 0) { - reason = webidl.converters.USVString(reason, prefix, "reason"); - } - if (code !== void 0) { - if (code !== 1e3 && (code < 3e3 || code > 4999)) { - throw new DOMException("invalid code", "InvalidAccessError"); - } - } - let reasonByteLength = 0; - if (reason !== void 0) { - reasonByteLength = Buffer.byteLength(reason); - if (reasonByteLength > 123) { - throw new DOMException( - `Reason must be less than 123 bytes; received ${reasonByteLength}`, - "SyntaxError" - ); - } - } - closeWebSocketConnection(this, code, reason, reasonByteLength); - } - /** - * @see https://websockets.spec.whatwg.org/#dom-websocket-send - * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data - */ - send(data) { - webidl.brandCheck(this, _WebSocket); - const prefix = "WebSocket.send"; - webidl.argumentLengthCheck(arguments, 1, prefix); - data = webidl.converters.WebSocketSendData(data, prefix, "data"); - if (isConnecting(this)) { - throw new DOMException("Sent before connected.", "InvalidStateError"); - } - if (!isEstablished(this) || isClosing(this)) { - return; - } - if (typeof data === "string") { - const length = Buffer.byteLength(data); - this.#bufferedAmount += length; - this.#sendQueue.add(data, () => { - this.#bufferedAmount -= length; - }, sendHints.string); - } else if (types2.isArrayBuffer(data)) { - this.#bufferedAmount += data.byteLength; - this.#sendQueue.add(data, () => { - this.#bufferedAmount -= data.byteLength; - }, sendHints.arrayBuffer); - } else if (ArrayBuffer.isView(data)) { - this.#bufferedAmount += data.byteLength; - this.#sendQueue.add(data, () => { - this.#bufferedAmount -= data.byteLength; - }, sendHints.typedArray); - } else if (isBlobLike(data)) { - this.#bufferedAmount += data.size; - this.#sendQueue.add(data, () => { - this.#bufferedAmount -= data.size; - }, sendHints.blob); - } - } - get readyState() { - webidl.brandCheck(this, _WebSocket); - return this[kReadyState]; - } - get bufferedAmount() { - webidl.brandCheck(this, _WebSocket); - return this.#bufferedAmount; - } - get url() { - webidl.brandCheck(this, _WebSocket); - return URLSerializer(this[kWebSocketURL]); - } - get extensions() { - webidl.brandCheck(this, _WebSocket); - return this.#extensions; - } - get protocol() { - webidl.brandCheck(this, _WebSocket); - return this.#protocol; - } - get onopen() { - webidl.brandCheck(this, _WebSocket); - return this.#events.open; - } - set onopen(fn) { - webidl.brandCheck(this, _WebSocket); - if (this.#events.open) { - this.removeEventListener("open", this.#events.open); - } - if (typeof fn === "function") { - this.#events.open = fn; - this.addEventListener("open", fn); - } else { - this.#events.open = null; - } - } - get onerror() { - webidl.brandCheck(this, _WebSocket); - return this.#events.error; - } - set onerror(fn) { - webidl.brandCheck(this, _WebSocket); - if (this.#events.error) { - this.removeEventListener("error", this.#events.error); - } - if (typeof fn === "function") { - this.#events.error = fn; - this.addEventListener("error", fn); - } else { - this.#events.error = null; - } - } - get onclose() { - webidl.brandCheck(this, _WebSocket); - return this.#events.close; - } - set onclose(fn) { - webidl.brandCheck(this, _WebSocket); - if (this.#events.close) { - this.removeEventListener("close", this.#events.close); - } - if (typeof fn === "function") { - this.#events.close = fn; - this.addEventListener("close", fn); - } else { - this.#events.close = null; - } - } - get onmessage() { - webidl.brandCheck(this, _WebSocket); - return this.#events.message; - } - set onmessage(fn) { - webidl.brandCheck(this, _WebSocket); - if (this.#events.message) { - this.removeEventListener("message", this.#events.message); - } - if (typeof fn === "function") { - this.#events.message = fn; - this.addEventListener("message", fn); - } else { - this.#events.message = null; - } - } - get binaryType() { - webidl.brandCheck(this, _WebSocket); - return this[kBinaryType]; - } - set binaryType(type) { - webidl.brandCheck(this, _WebSocket); - if (type !== "blob" && type !== "arraybuffer") { - this[kBinaryType] = "blob"; - } else { - this[kBinaryType] = type; - } - } - /** - * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol - */ - #onConnectionEstablished(response, parsedExtensions) { - this[kResponse] = response; - const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions; - const maxFragments = webSocketOptions?.maxFragments; - const maxPayloadSize = webSocketOptions?.maxPayloadSize; - const parser = new ByteParser(this, parsedExtensions, { - maxFragments, - maxPayloadSize - }); - parser.on("drain", onParserDrain); - parser.on("error", onParserError.bind(this)); - response.socket.ws = this; - this[kByteParser] = parser; - this.#sendQueue = new SendQueue(response.socket); - this[kReadyState] = states.OPEN; - const extensions = response.headersList.get("sec-websocket-extensions"); - if (extensions !== null) { - this.#extensions = extensions; - } - const protocol = response.headersList.get("sec-websocket-protocol"); - if (protocol !== null) { - this.#protocol = protocol; - } - fireEvent("open", this); - } - }; - WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING; - WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN; - WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING; - WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED; - Object.defineProperties(WebSocket.prototype, { - CONNECTING: staticPropertyDescriptors, - OPEN: staticPropertyDescriptors, - CLOSING: staticPropertyDescriptors, - CLOSED: staticPropertyDescriptors, - url: kEnumerableProperty, - readyState: kEnumerableProperty, - bufferedAmount: kEnumerableProperty, - onopen: kEnumerableProperty, - onerror: kEnumerableProperty, - onclose: kEnumerableProperty, - close: kEnumerableProperty, - onmessage: kEnumerableProperty, - binaryType: kEnumerableProperty, - send: kEnumerableProperty, - extensions: kEnumerableProperty, - protocol: kEnumerableProperty, - [Symbol.toStringTag]: { - value: "WebSocket", - writable: false, - enumerable: false, - configurable: true - } - }); - Object.defineProperties(WebSocket, { - CONNECTING: staticPropertyDescriptors, - OPEN: staticPropertyDescriptors, - CLOSING: staticPropertyDescriptors, - CLOSED: staticPropertyDescriptors - }); - webidl.converters["sequence"] = webidl.sequenceConverter( - webidl.converters.DOMString - ); - webidl.converters["DOMString or sequence"] = function(V, prefix, argument) { - if (webidl.util.Type(V) === "Object" && Symbol.iterator in V) { - return webidl.converters["sequence"](V); - } - return webidl.converters.DOMString(V, prefix, argument); - }; - webidl.converters.WebSocketInit = webidl.dictionaryConverter([ - { - key: "protocols", - converter: webidl.converters["DOMString or sequence"], - defaultValue: () => new Array(0) - }, - { - key: "dispatcher", - converter: webidl.converters.any, - defaultValue: () => getGlobalDispatcher() - }, - { - key: "headers", - converter: webidl.nullableConverter(webidl.converters.HeadersInit) - } - ]); - webidl.converters["DOMString or sequence or WebSocketInit"] = function(V) { - if (webidl.util.Type(V) === "Object" && !(Symbol.iterator in V)) { - return webidl.converters.WebSocketInit(V); - } - return { protocols: webidl.converters["DOMString or sequence"](V) }; - }; - webidl.converters.WebSocketSendData = function(V) { - if (webidl.util.Type(V) === "Object") { - if (isBlobLike(V)) { - return webidl.converters.Blob(V, { strict: false }); - } - if (ArrayBuffer.isView(V) || types2.isArrayBuffer(V)) { - return webidl.converters.BufferSource(V); - } - } - return webidl.converters.USVString(V); - }; - function onParserDrain() { - this.ws[kResponse].socket.resume(); - } - function onParserError(err) { - let message; - let code; - if (err instanceof CloseEvent) { - message = err.reason; - code = err.code; - } else { - message = err.message; - } - fireEvent("error", this, () => new ErrorEvent("error", { error: err, message })); - closeWebSocketConnection(this, code); - } - module2.exports = { - WebSocket - }; - } -}); - -// node_modules/undici/lib/web/eventsource/util.js -var require_util8 = __commonJS({ - "node_modules/undici/lib/web/eventsource/util.js"(exports2, module2) { - "use strict"; - function isValidLastEventId(value) { - return value.indexOf("\0") === -1; - } - function isASCIINumber(value) { - if (value.length === 0) return false; - for (let i = 0; i < value.length; i++) { - if (value.charCodeAt(i) < 48 || value.charCodeAt(i) > 57) return false; - } - return true; - } - function delay2(ms) { - return new Promise((resolve14) => { - setTimeout(resolve14, ms).unref(); - }); - } - module2.exports = { - isValidLastEventId, - isASCIINumber, - delay: delay2 - }; - } -}); - -// node_modules/undici/lib/web/eventsource/eventsource-stream.js -var require_eventsource_stream = __commonJS({ - "node_modules/undici/lib/web/eventsource/eventsource-stream.js"(exports2, module2) { - "use strict"; - var { Transform: Transform5 } = require("node:stream"); - var { isASCIINumber, isValidLastEventId } = require_util8(); - var BOM = [239, 187, 191]; - var LF = 10; - var CR = 13; - var COLON = 58; - var SPACE = 32; - var EventSourceStream = class extends Transform5 { - /** - * @type {eventSourceSettings} - */ - state = null; - /** - * Leading byte-order-mark check. - * @type {boolean} - */ - checkBOM = true; - /** - * @type {boolean} - */ - crlfCheck = false; - /** - * @type {boolean} - */ - eventEndCheck = false; - /** - * @type {Buffer} - */ - buffer = null; - pos = 0; - event = { - data: void 0, - event: void 0, - id: void 0, - retry: void 0 - }; - /** - * @param {object} options - * @param {eventSourceSettings} options.eventSourceSettings - * @param {Function} [options.push] - */ - constructor(options = {}) { - options.readableObjectMode = true; - super(options); - this.state = options.eventSourceSettings || {}; - if (options.push) { - this.push = options.push; - } - } - /** - * @param {Buffer} chunk - * @param {string} _encoding - * @param {Function} callback - * @returns {void} - */ - _transform(chunk, _encoding, callback) { - if (chunk.length === 0) { - callback(); - return; - } - if (this.buffer) { - this.buffer = Buffer.concat([this.buffer, chunk]); - } else { - this.buffer = chunk; - } - if (this.checkBOM) { - switch (this.buffer.length) { - case 1: - if (this.buffer[0] === BOM[0]) { - callback(); - return; - } - this.checkBOM = false; - callback(); - return; - case 2: - if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1]) { - callback(); - return; - } - this.checkBOM = false; - break; - case 3: - if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) { - this.buffer = Buffer.alloc(0); - this.checkBOM = false; - callback(); - return; - } - this.checkBOM = false; - break; - default: - if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) { - this.buffer = this.buffer.subarray(3); - } - this.checkBOM = false; - break; - } - } - while (this.pos < this.buffer.length) { - if (this.eventEndCheck) { - if (this.crlfCheck) { - if (this.buffer[this.pos] === LF) { - this.buffer = this.buffer.subarray(this.pos + 1); - this.pos = 0; - this.crlfCheck = false; - continue; - } - this.crlfCheck = false; - } - if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) { - if (this.buffer[this.pos] === CR) { - this.crlfCheck = true; - } - this.buffer = this.buffer.subarray(this.pos + 1); - this.pos = 0; - if (this.event.data !== void 0 || this.event.event || this.event.id || this.event.retry) { - this.processEvent(this.event); - } - this.clearEvent(); - continue; - } - this.eventEndCheck = false; - continue; - } - if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) { - if (this.buffer[this.pos] === CR) { - this.crlfCheck = true; - } - this.parseLine(this.buffer.subarray(0, this.pos), this.event); - this.buffer = this.buffer.subarray(this.pos + 1); - this.pos = 0; - this.eventEndCheck = true; - continue; - } - this.pos++; - } - callback(); - } - /** - * @param {Buffer} line - * @param {EventStreamEvent} event - */ - parseLine(line, event) { - if (line.length === 0) { - return; - } - const colonPosition = line.indexOf(COLON); - if (colonPosition === 0) { - return; - } - let field = ""; - let value = ""; - if (colonPosition !== -1) { - field = line.subarray(0, colonPosition).toString("utf8"); - let valueStart = colonPosition + 1; - if (line[valueStart] === SPACE) { - ++valueStart; - } - value = line.subarray(valueStart).toString("utf8"); - } else { - field = line.toString("utf8"); - value = ""; - } - switch (field) { - case "data": - if (event[field] === void 0) { - event[field] = value; - } else { - event[field] += ` -${value}`; - } - break; - case "retry": - if (isASCIINumber(value)) { - event[field] = value; - } - break; - case "id": - if (isValidLastEventId(value)) { - event[field] = value; - } - break; - case "event": - if (value.length > 0) { - event[field] = value; - } - break; - } - } - /** - * @param {EventSourceStreamEvent} event - */ - processEvent(event) { - if (event.retry && isASCIINumber(event.retry)) { - this.state.reconnectionTime = parseInt(event.retry, 10); - } - if (event.id && isValidLastEventId(event.id)) { - this.state.lastEventId = event.id; - } - if (event.data !== void 0) { - this.push({ - type: event.event || "message", - options: { - data: event.data, - lastEventId: this.state.lastEventId, - origin: this.state.origin - } - }); - } - } - clearEvent() { - this.event = { - data: void 0, - event: void 0, - id: void 0, - retry: void 0 - }; - } - }; - module2.exports = { - EventSourceStream - }; - } -}); - -// node_modules/undici/lib/web/eventsource/eventsource.js -var require_eventsource = __commonJS({ - "node_modules/undici/lib/web/eventsource/eventsource.js"(exports2, module2) { - "use strict"; - var { pipeline: pipeline2 } = require("node:stream"); - var { fetching } = require_fetch(); - var { makeRequest } = require_request2(); - var { webidl } = require_webidl(); - var { EventSourceStream } = require_eventsource_stream(); - var { parseMIMEType } = require_data_url(); - var { createFastMessageEvent } = require_events(); - var { isNetworkError } = require_response(); - var { delay: delay2 } = require_util8(); - var { kEnumerableProperty } = require_util(); - var { environmentSettingsObject } = require_util2(); - var experimentalWarned = false; - var defaultReconnectionTime = 3e3; - var CONNECTING = 0; - var OPEN = 1; - var CLOSED = 2; - var ANONYMOUS = "anonymous"; - var USE_CREDENTIALS = "use-credentials"; - var EventSource = class _EventSource extends EventTarget { - #events = { - open: null, - error: null, - message: null - }; - #url = null; - #withCredentials = false; - #readyState = CONNECTING; - #request = null; - #controller = null; - #dispatcher; - /** - * @type {import('./eventsource-stream').eventSourceSettings} - */ - #state; - /** - * Creates a new EventSource object. - * @param {string} url - * @param {EventSourceInit} [eventSourceInitDict] - * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface - */ - constructor(url2, eventSourceInitDict = {}) { - super(); - webidl.util.markAsUncloneable(this); - const prefix = "EventSource constructor"; - webidl.argumentLengthCheck(arguments, 1, prefix); - if (!experimentalWarned) { - experimentalWarned = true; - process.emitWarning("EventSource is experimental, expect them to change at any time.", { - code: "UNDICI-ES" - }); - } - url2 = webidl.converters.USVString(url2, prefix, "url"); - eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, "eventSourceInitDict"); - this.#dispatcher = eventSourceInitDict.dispatcher; - this.#state = { - lastEventId: "", - reconnectionTime: defaultReconnectionTime - }; - const settings = environmentSettingsObject; - let urlRecord; - try { - urlRecord = new URL(url2, settings.settingsObject.baseUrl); - this.#state.origin = urlRecord.origin; - } catch (e) { - throw new DOMException(e, "SyntaxError"); - } - this.#url = urlRecord.href; - let corsAttributeState = ANONYMOUS; - if (eventSourceInitDict.withCredentials) { - corsAttributeState = USE_CREDENTIALS; - this.#withCredentials = true; - } - const initRequest = { - redirect: "follow", - keepalive: true, - // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes - mode: "cors", - credentials: corsAttributeState === "anonymous" ? "same-origin" : "omit", - referrer: "no-referrer" - }; - initRequest.client = environmentSettingsObject.settingsObject; - initRequest.headersList = [["accept", { name: "accept", value: "text/event-stream" }]]; - initRequest.cache = "no-store"; - initRequest.initiator = "other"; - initRequest.urlList = [new URL(this.#url)]; - this.#request = makeRequest(initRequest); - this.#connect(); - } - /** - * Returns the state of this EventSource object's connection. It can have the - * values described below. - * @returns {0|1|2} - * @readonly - */ - get readyState() { - return this.#readyState; - } - /** - * Returns the URL providing the event stream. - * @readonly - * @returns {string} - */ - get url() { - return this.#url; - } - /** - * Returns a boolean indicating whether the EventSource object was - * instantiated with CORS credentials set (true), or not (false, the default). - */ - get withCredentials() { - return this.#withCredentials; - } - #connect() { - if (this.#readyState === CLOSED) return; - this.#readyState = CONNECTING; - const fetchParams = { - request: this.#request, - dispatcher: this.#dispatcher - }; - const processEventSourceEndOfBody = (response) => { - if (isNetworkError(response)) { - this.dispatchEvent(new Event("error")); - this.close(); - } - this.#reconnect(); - }; - fetchParams.processResponseEndOfBody = processEventSourceEndOfBody; - fetchParams.processResponse = (response) => { - if (isNetworkError(response)) { - if (response.aborted) { - this.close(); - this.dispatchEvent(new Event("error")); - return; - } else { - this.#reconnect(); - return; - } - } - const contentType = response.headersList.get("content-type", true); - const mimeType = contentType !== null ? parseMIMEType(contentType) : "failure"; - const contentTypeValid = mimeType !== "failure" && mimeType.essence === "text/event-stream"; - if (response.status !== 200 || contentTypeValid === false) { - this.close(); - this.dispatchEvent(new Event("error")); - return; - } - this.#readyState = OPEN; - this.dispatchEvent(new Event("open")); - this.#state.origin = response.urlList[response.urlList.length - 1].origin; - const eventSourceStream = new EventSourceStream({ - eventSourceSettings: this.#state, - push: (event) => { - this.dispatchEvent(createFastMessageEvent( - event.type, - event.options - )); - } - }); - pipeline2( - response.body.stream, - eventSourceStream, - (error3) => { - if (error3?.aborted === false) { - this.close(); - this.dispatchEvent(new Event("error")); - } - } - ); - }; - this.#controller = fetching(fetchParams); - } - /** - * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model - * @returns {Promise} - */ - async #reconnect() { - if (this.#readyState === CLOSED) return; - this.#readyState = CONNECTING; - this.dispatchEvent(new Event("error")); - await delay2(this.#state.reconnectionTime); - if (this.#readyState !== CONNECTING) return; - if (this.#state.lastEventId.length) { - this.#request.headersList.set("last-event-id", this.#state.lastEventId, true); - } - this.#connect(); - } - /** - * Closes the connection, if any, and sets the readyState attribute to - * CLOSED. - */ - close() { - webidl.brandCheck(this, _EventSource); - if (this.#readyState === CLOSED) return; - this.#readyState = CLOSED; - this.#controller.abort(); - this.#request = null; - } - get onopen() { - return this.#events.open; - } - set onopen(fn) { - if (this.#events.open) { - this.removeEventListener("open", this.#events.open); - } - if (typeof fn === "function") { - this.#events.open = fn; - this.addEventListener("open", fn); - } else { - this.#events.open = null; - } - } - get onmessage() { - return this.#events.message; - } - set onmessage(fn) { - if (this.#events.message) { - this.removeEventListener("message", this.#events.message); - } - if (typeof fn === "function") { - this.#events.message = fn; - this.addEventListener("message", fn); - } else { - this.#events.message = null; - } - } - get onerror() { - return this.#events.error; - } - set onerror(fn) { - if (this.#events.error) { - this.removeEventListener("error", this.#events.error); - } - if (typeof fn === "function") { - this.#events.error = fn; - this.addEventListener("error", fn); - } else { - this.#events.error = null; - } - } - }; - var constantsPropertyDescriptors = { - CONNECTING: { - __proto__: null, - configurable: false, - enumerable: true, - value: CONNECTING, - writable: false - }, - OPEN: { - __proto__: null, - configurable: false, - enumerable: true, - value: OPEN, - writable: false - }, - CLOSED: { - __proto__: null, - configurable: false, - enumerable: true, - value: CLOSED, - writable: false - } - }; - Object.defineProperties(EventSource, constantsPropertyDescriptors); - Object.defineProperties(EventSource.prototype, constantsPropertyDescriptors); - Object.defineProperties(EventSource.prototype, { - close: kEnumerableProperty, - onerror: kEnumerableProperty, - onmessage: kEnumerableProperty, - onopen: kEnumerableProperty, - readyState: kEnumerableProperty, - url: kEnumerableProperty, - withCredentials: kEnumerableProperty - }); - webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([ - { - key: "withCredentials", - converter: webidl.converters.boolean, - defaultValue: () => false - }, - { - key: "dispatcher", - // undici only - converter: webidl.converters.any - } - ]); - module2.exports = { - EventSource, - defaultReconnectionTime - }; - } -}); - -// node_modules/undici/index.js -var require_undici = __commonJS({ - "node_modules/undici/index.js"(exports2, module2) { - "use strict"; - var Client = require_client(); - var Dispatcher = require_dispatcher(); - var Pool = require_pool(); - var BalancedPool = require_balanced_pool(); - var Agent = require_agent(); - var ProxyAgent2 = require_proxy_agent(); - var EnvHttpProxyAgent = require_env_http_proxy_agent(); - var RetryAgent = require_retry_agent(); - var errors = require_errors(); - var util3 = require_util(); - var { InvalidArgumentError } = errors; - var api = require_api(); - var buildConnector = require_connect(); - var MockClient = require_mock_client(); - var MockAgent = require_mock_agent(); - var MockPool = require_mock_pool(); - var mockErrors = require_mock_errors(); - var RetryHandler = require_retry_handler(); - var { getGlobalDispatcher, setGlobalDispatcher } = require_global2(); - var DecoratorHandler = require_decorator_handler(); - var RedirectHandler = require_redirect_handler(); - var createRedirectInterceptor = require_redirect_interceptor(); - Object.assign(Dispatcher.prototype, api); - module2.exports.Dispatcher = Dispatcher; - module2.exports.Client = Client; - module2.exports.Pool = Pool; - module2.exports.BalancedPool = BalancedPool; - module2.exports.Agent = Agent; - module2.exports.ProxyAgent = ProxyAgent2; - module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; - module2.exports.RetryAgent = RetryAgent; - module2.exports.RetryHandler = RetryHandler; - module2.exports.DecoratorHandler = DecoratorHandler; - module2.exports.RedirectHandler = RedirectHandler; - module2.exports.createRedirectInterceptor = createRedirectInterceptor; - module2.exports.interceptors = { - redirect: require_redirect(), - retry: require_retry(), - dump: require_dump(), - dns: require_dns() - }; - module2.exports.buildConnector = buildConnector; - module2.exports.errors = errors; - module2.exports.util = { - parseHeaders: util3.parseHeaders, - headerNameToString: util3.headerNameToString - }; - function makeDispatcher(fn) { - return (url2, opts, handler2) => { - if (typeof opts === "function") { - handler2 = opts; - opts = null; - } - if (!url2 || typeof url2 !== "string" && typeof url2 !== "object" && !(url2 instanceof URL)) { - throw new InvalidArgumentError("invalid url"); - } - if (opts != null && typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - if (opts && opts.path != null) { - if (typeof opts.path !== "string") { - throw new InvalidArgumentError("invalid opts.path"); - } - let path30 = opts.path; - if (!opts.path.startsWith("/")) { - path30 = `/${path30}`; - } - url2 = new URL(util3.parseOrigin(url2).origin + path30); - } else { - if (!opts) { - opts = typeof url2 === "object" ? url2 : {}; - } - url2 = util3.parseURL(url2); - } - const { agent, dispatcher = getGlobalDispatcher() } = opts; - if (agent) { - throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?"); - } - return fn.call(dispatcher, { - ...opts, - origin: url2.origin, - path: url2.search ? `${url2.pathname}${url2.search}` : url2.pathname, - method: opts.method || (opts.body ? "PUT" : "GET") - }, handler2); - }; - } - module2.exports.setGlobalDispatcher = setGlobalDispatcher; - module2.exports.getGlobalDispatcher = getGlobalDispatcher; - var fetchImpl = require_fetch().fetch; - module2.exports.fetch = async function fetch(init2, options = void 0) { - try { - return await fetchImpl(init2, options); - } catch (err) { - if (err && typeof err === "object") { - Error.captureStackTrace(err); - } - throw err; - } - }; - module2.exports.Headers = require_headers().Headers; - module2.exports.Response = require_response().Response; - module2.exports.Request = require_request2().Request; - module2.exports.FormData = require_formdata().FormData; - module2.exports.File = globalThis.File ?? require("node:buffer").File; - module2.exports.FileReader = require_filereader().FileReader; - var { setGlobalOrigin, getGlobalOrigin } = require_global(); - module2.exports.setGlobalOrigin = setGlobalOrigin; - module2.exports.getGlobalOrigin = getGlobalOrigin; - var { CacheStorage } = require_cachestorage(); - var { kConstruct } = require_symbols4(); - module2.exports.caches = new CacheStorage(kConstruct); - var { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies(); - module2.exports.deleteCookie = deleteCookie; - module2.exports.getCookies = getCookies; - module2.exports.getSetCookies = getSetCookies; - module2.exports.setCookie = setCookie; - var { parseMIMEType, serializeAMimeType } = require_data_url(); - module2.exports.parseMIMEType = parseMIMEType; - module2.exports.serializeAMimeType = serializeAMimeType; - var { CloseEvent, ErrorEvent, MessageEvent } = require_events(); - module2.exports.WebSocket = require_websocket().WebSocket; - module2.exports.CloseEvent = CloseEvent; - module2.exports.ErrorEvent = ErrorEvent; - module2.exports.MessageEvent = MessageEvent; - module2.exports.request = makeDispatcher(api.request); - module2.exports.stream = makeDispatcher(api.stream); - module2.exports.pipeline = makeDispatcher(api.pipeline); - module2.exports.connect = makeDispatcher(api.connect); - module2.exports.upgrade = makeDispatcher(api.upgrade); - module2.exports.MockClient = MockClient; - module2.exports.MockPool = MockPool; - module2.exports.MockAgent = MockAgent; - module2.exports.mockErrors = mockErrors; - var { EventSource } = require_eventsource(); - module2.exports.EventSource = EventSource; - } -}); - -// node_modules/@actions/http-client/lib/index.js -var require_lib = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpClient = exports2.HttpClientResponse = exports2.HttpClientError = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - exports2.getProxyUrl = getProxyUrl; - exports2.isHttps = isHttps; - var http = __importStar2(require("http")); - var https3 = __importStar2(require("https")); - var pm = __importStar2(require_proxy()); - var tunnel = __importStar2(require_tunnel2()); - var undici_1 = require_undici(); - var HttpCodes; - (function(HttpCodes2) { - HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; - HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; - HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; - HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; - HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; - HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; - HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; - HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; - HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; - HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; - HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; - })(HttpCodes || (exports2.HttpCodes = HttpCodes = {})); - var Headers; - (function(Headers2) { - Headers2["Accept"] = "accept"; - Headers2["ContentType"] = "content-type"; - })(Headers || (exports2.Headers = Headers = {})); - var MediaTypes; - (function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; - })(MediaTypes || (exports2.MediaTypes = MediaTypes = {})); - function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ""; - } - var HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect - ]; - var HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout - ]; - var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; - var ExponentialBackoffCeiling = 10; - var ExponentialBackoffTimeSlice = 5; - var HttpClientError = class _HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = "HttpClientError"; - this.statusCode = statusCode; - Object.setPrototypeOf(this, _HttpClientError.prototype); - } - }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => __awaiter2(this, void 0, void 0, function* () { - let output = Buffer.alloc(0); - this.message.on("data", (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on("end", () => { - resolve14(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => __awaiter2(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve14(Buffer.concat(chunks)); - }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - var HttpClient2 = class { - constructor(userAgent2, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = this._getUserAgentWithOrchestrationId(userAgent2); - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl_1) { - return __awaiter2(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - postJson(requestUrl_1, obj_1) { - return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl_1, obj_1) { - return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl_1, obj_1) { - return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); - const res = yield this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter2(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info8 = this._prepareRequest(verb, parsedUrl, headers); - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; - let numTries = 0; - let response; - do { - response = yield this.requestRaw(info8, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler2 of this.handlers) { - if (handler2.canHandleAuthentication(response)) { - authenticationHandler = handler2; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info8, data); - } else { - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { - const redirectUrl = response.message.headers["location"]; - if (!redirectUrl) { - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { - throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } - } - info8 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info8, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info8, data) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve14(res); - } - } - this.requestRawWithCallback(info8, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info8, data, onResult) { - if (typeof data === "string") { - if (!info8.options.headers) { - info8.options.headers = {}; - } - info8.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info8.httpModule.request(info8.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(void 0, res); - }); - let socket; - req.on("socket", (sock) => { - socket = sock; - }); - req.setTimeout(this._socketTimeout || 3 * 6e4, () => { - if (socket) { - socket.end(); - } - handleResult(new Error(`Request timeout: ${info8.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); - } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - getAgentDispatcher(serverUrl) { - const parsedUrl = new URL(serverUrl); - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (!useProxy) { - return; - } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info8 = {}; - info8.parsedUrl = requestUrl; - const usingSsl = info8.parsedUrl.protocol === "https:"; - info8.httpModule = usingSsl ? https3 : http; - const defaultPort = usingSsl ? 443 : 80; - info8.options = {}; - info8.options.host = info8.parsedUrl.hostname; - info8.options.port = info8.parsedUrl.port ? parseInt(info8.parsedUrl.port) : defaultPort; - info8.options.path = (info8.parsedUrl.pathname || "") + (info8.parsedUrl.search || ""); - info8.options.method = method; - info8.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info8.options.headers["user-agent"] = this.userAgent; - } - info8.options.agent = this._getAgent(info8.parsedUrl); - if (this.handlers) { - for (const handler2 of this.handlers) { - handler2.prepareRequest(info8.options); - } - } - return info8; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys2(this.requestOptions.headers), lowercaseKeys2(headers || {})); - } - return lowercaseKeys2(headers || {}); - } - /** - * Gets an existing header value or returns a default. - * Handles converting number header values to strings since HTTP headers must be strings. - * Note: This returns string | string[] since some headers can have multiple values. - * For headers that must always be a single string (like Content-Type), use the - * specialized _getExistingOrDefaultContentTypeHeader method instead. - */ - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys2(this.requestOptions.headers)[header]; - if (headerValue) { - clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; - } - } - const additionalValue = additionalHeaders[header]; - if (additionalValue !== void 0) { - return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; - } - if (clientHeader !== void 0) { - return clientHeader; - } - return _default; - } - /** - * Specialized version of _getExistingOrDefaultHeader for Content-Type header. - * Always returns a single string (not an array) since Content-Type should be a single value. - * Converts arrays to comma-separated strings and numbers to strings to ensure type safety. - * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers - * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]). - */ - _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys2(this.requestOptions.headers)[Headers.ContentType]; - if (headerValue) { - if (typeof headerValue === "number") { - clientHeader = String(headerValue); - } else if (Array.isArray(headerValue)) { - clientHeader = headerValue.join(", "); - } else { - clientHeader = headerValue; - } - } - } - const additionalValue = additionalHeaders[Headers.ContentType]; - if (additionalValue !== void 0) { - if (typeof additionalValue === "number") { - return String(additionalValue); - } else if (Array.isArray(additionalValue)) { - return additionalValue.join(", "); - } else { - return additionalValue; - } - } - if (clientHeader !== void 0) { - return clientHeader; - } - return _default; - } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (!useProxy) { - agent = this._agent; - } - if (agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (proxyUrl && proxyUrl.hostname) { - const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), { host: proxyUrl.hostname, port: proxyUrl.port }) - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === "https:"; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https3.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; - } - if (proxyAgent) { - return proxyAgent; - } - const usingSsl = parsedUrl.protocol === "https:"; - proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { - token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString("base64")}` - })); - this._proxyAgentDispatcher = proxyAgent; - if (usingSsl && this._ignoreSslError) { - proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { - rejectUnauthorized: false - }); - } - return proxyAgent; - } - _getUserAgentWithOrchestrationId(userAgent2) { - const baseUserAgent = userAgent2 || "actions/http-client"; - const orchId = process.env["ACTIONS_ORCHESTRATION_ID"]; - if (orchId) { - const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, "_"); - return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`; - } - return baseUserAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter2(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve14) => setTimeout(() => resolve14(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14, reject) => __awaiter2(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve14(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - let obj; - let contents; - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { - } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; - } else { - msg = `Failed request: (${statusCode})`; - } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve14(response); - } - })); - }); - } - }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// node_modules/@actions/http-client/lib/auth.js -var require_auth = __commonJS({ - "node_modules/@actions/http-client/lib/auth.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; - } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@actions/core/lib/oidc-utils.js -var require_oidc_utils = __commonJS({ - "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OidcClient = void 0; - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var core_1 = require_core(); - var OidcClient = class _OidcClient { - static createHttpClient(allowRetry = true, maxRetry = 10) { - const requestOptions = { - allowRetries: allowRetry, - maxRetries: maxRetry - }; - return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); - } - static getRequestToken() { - const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; - if (!token) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); - } - return token; - } - static getIDTokenUrl() { - const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; - if (!runtimeUrl) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); - } - return runtimeUrl; - } - static getCall(id_token_url) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error3) => { - throw new Error(`Failed to get ID Token. - - Error Code : ${error3.statusCode} - - Error Message: ${error3.message}`); - }); - const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; - if (!id_token) { - throw new Error("Response json body do not have ID Token field"); - } - return id_token; - }); - } - static getIDToken(audience) { - return __awaiter2(this, void 0, void 0, function* () { - try { - let id_token_url = _OidcClient.getIDTokenUrl(); - if (audience) { - const encodedAudience = encodeURIComponent(audience); - id_token_url = `${id_token_url}&audience=${encodedAudience}`; - } - (0, core_1.debug)(`ID token url is ${id_token_url}`); - const id_token = yield _OidcClient.getCall(id_token_url); - (0, core_1.setSecret)(id_token); - return id_token; - } catch (error3) { - throw new Error(`Error message: ${error3.message}`); - } - }); - } - }; - exports2.OidcClient = OidcClient; - } -}); - -// node_modules/@actions/core/lib/summary.js -var require_summary = __commonJS({ - "node_modules/@actions/core/lib/summary.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.summary = exports2.markdownSummary = exports2.SUMMARY_DOCS_URL = exports2.SUMMARY_ENV_VAR = void 0; - var os_1 = require("os"); - var fs_1 = require("fs"); - var { access, appendFile, writeFile } = fs_1.promises; - exports2.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; - exports2.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; - var Summary = class { - constructor() { - this._buffer = ""; - } - /** - * Finds the summary file path from the environment, rejects if env var is not found or file does not exist - * Also checks r/w permissions. - * - * @returns step summary file path - */ - filePath() { - return __awaiter2(this, void 0, void 0, function* () { - if (this._filePath) { - return this._filePath; - } - const pathFromEnv = process.env[exports2.SUMMARY_ENV_VAR]; - if (!pathFromEnv) { - throw new Error(`Unable to find environment variable for $${exports2.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); - } - try { - yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } catch (_a2) { - throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); - } - this._filePath = pathFromEnv; - return this._filePath; - }); - } - /** - * Wraps content in an HTML tag, adding any HTML attributes - * - * @param {string} tag HTML tag to wrap - * @param {string | null} content content within the tag - * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add - * - * @returns {string} content wrapped in HTML element - */ - wrap(tag, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); - if (!content) { - return `<${tag}${htmlAttrs}>`; - } - return `<${tag}${htmlAttrs}>${content}`; - } - /** - * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. - * - * @param {SummaryWriteOptions} [options] (optional) options for write operation - * - * @returns {Promise} summary instance - */ - write(options) { - return __awaiter2(this, void 0, void 0, function* () { - const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); - const filePath = yield this.filePath(); - const writeFunc = overwrite ? writeFile : appendFile; - yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); - return this.emptyBuffer(); - }); - } - /** - * Clears the summary buffer and wipes the summary file - * - * @returns {Summary} summary instance - */ - clear() { - return __awaiter2(this, void 0, void 0, function* () { - return this.emptyBuffer().write({ overwrite: true }); - }); - } - /** - * Returns the current summary buffer as a string - * - * @returns {string} string of summary buffer - */ - stringify() { - return this._buffer; - } - /** - * If the summary buffer is empty - * - * @returns {boolen} true if the buffer is empty - */ - isEmptyBuffer() { - return this._buffer.length === 0; - } - /** - * Resets the summary buffer without writing to summary file - * - * @returns {Summary} summary instance - */ - emptyBuffer() { - this._buffer = ""; - return this; - } - /** - * Adds raw text to the summary buffer - * - * @param {string} text content to add - * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) - * - * @returns {Summary} summary instance - */ - addRaw(text, addEOL = false) { - this._buffer += text; - return addEOL ? this.addEOL() : this; - } - /** - * Adds the operating system-specific end-of-line marker to the buffer - * - * @returns {Summary} summary instance - */ - addEOL() { - return this.addRaw(os_1.EOL); - } - /** - * Adds an HTML codeblock to the summary buffer - * - * @param {string} code content to render within fenced code block - * @param {string} lang (optional) language to syntax highlight code - * - * @returns {Summary} summary instance - */ - addCodeBlock(code, lang) { - const attrs = Object.assign({}, lang && { lang }); - const element = this.wrap("pre", this.wrap("code", code), attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML list to the summary buffer - * - * @param {string[]} items list of items to render - * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) - * - * @returns {Summary} summary instance - */ - addList(items, ordered = false) { - const tag = ordered ? "ol" : "ul"; - const listItems = items.map((item) => this.wrap("li", item)).join(""); - const element = this.wrap(tag, listItems); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML table to the summary buffer - * - * @param {SummaryTableCell[]} rows table rows - * - * @returns {Summary} summary instance - */ - addTable(rows) { - const tableBody = rows.map((row) => { - const cells = row.map((cell) => { - if (typeof cell === "string") { - return this.wrap("td", cell); - } - const { header, data, colspan, rowspan } = cell; - const tag = header ? "th" : "td"; - const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); - return this.wrap(tag, data, attrs); - }).join(""); - return this.wrap("tr", cells); - }).join(""); - const element = this.wrap("table", tableBody); - return this.addRaw(element).addEOL(); - } - /** - * Adds a collapsable HTML details element to the summary buffer - * - * @param {string} label text for the closed state - * @param {string} content collapsable content - * - * @returns {Summary} summary instance - */ - addDetails(label, content) { - const element = this.wrap("details", this.wrap("summary", label) + content); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML image tag to the summary buffer - * - * @param {string} src path to the image you to embed - * @param {string} alt text description of the image - * @param {SummaryImageOptions} options (optional) addition image attributes - * - * @returns {Summary} summary instance - */ - addImage(src, alt, options) { - const { width, height } = options || {}; - const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); - const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML section heading element - * - * @param {string} text heading text - * @param {number | string} [level=1] (optional) the heading level, default: 1 - * - * @returns {Summary} summary instance - */ - addHeading(text, level) { - const tag = `h${level}`; - const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; - const element = this.wrap(allowedTag, text); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML thematic break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addSeparator() { - const element = this.wrap("hr", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML line break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addBreak() { - const element = this.wrap("br", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML blockquote to the summary buffer - * - * @param {string} text quote text - * @param {string} cite (optional) citation url - * - * @returns {Summary} summary instance - */ - addQuote(text, cite) { - const attrs = Object.assign({}, cite && { cite }); - const element = this.wrap("blockquote", text, attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML anchor tag to the summary buffer - * - * @param {string} text link text/content - * @param {string} href hyperlink - * - * @returns {Summary} summary instance - */ - addLink(text, href) { - const element = this.wrap("a", text, { href }); - return this.addRaw(element).addEOL(); - } - }; - var _summary = new Summary(); - exports2.markdownSummary = _summary; - exports2.summary = _summary; - } -}); - -// node_modules/@actions/core/lib/path-utils.js -var require_path_utils = __commonJS({ - "node_modules/@actions/core/lib/path-utils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toPosixPath = toPosixPath; - exports2.toWin32Path = toWin32Path; - exports2.toPlatformPath = toPlatformPath; - var path30 = __importStar2(require("path")); - function toPosixPath(pth) { - return pth.replace(/[\\]/g, "/"); - } - function toWin32Path(pth) { - return pth.replace(/[/]/g, "\\"); - } - function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path30.sep); - } - } -}); - -// node_modules/@actions/io/lib/io-util.js -var require_io_util = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a2; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - exports2.readlink = readlink; - exports2.exists = exists; - exports2.isDirectory = isDirectory; - exports2.isRooted = isRooted; - exports2.tryGetExecutablePath = tryGetExecutablePath; - exports2.getCmdPath = getCmdPath; - var fs32 = __importStar2(require("fs")); - var path30 = __importStar2(require("path")); - _a2 = fs32.promises, exports2.chmod = _a2.chmod, exports2.copyFile = _a2.copyFile, exports2.lstat = _a2.lstat, exports2.mkdir = _a2.mkdir, exports2.open = _a2.open, exports2.readdir = _a2.readdir, exports2.rename = _a2.rename, exports2.rm = _a2.rm, exports2.rmdir = _a2.rmdir, exports2.stat = _a2.stat, exports2.symlink = _a2.symlink, exports2.unlink = _a2.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - const result = yield fs32.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs32.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - try { - yield (0, exports2.stat)(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; - } - throw err; - } - return true; - }); - } - function isDirectory(fsPath_1) { - return __awaiter2(this, arguments, void 0, function* (fsPath, useStat = false) { - const stats = useStat ? yield (0, exports2.stat)(fsPath) : yield (0, exports2.lstat)(fsPath); - return stats.isDirectory(); - }); - } - function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); - } - return p.startsWith("/"); - } - function tryGetExecutablePath(filePath, extensions) { - return __awaiter2(this, void 0, void 0, function* () { - let stats = void 0; - try { - stats = yield (0, exports2.stat)(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path30.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = void 0; - try { - stats = yield (0, exports2.stat)(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - try { - const directory = path30.dirname(filePath); - const upperName = path30.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path30.join(directory, actualName); - break; - } - } - } catch (err) { - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - } - return ""; - }); - } - function normalizeSeparators(p) { - p = p || ""; - if (exports2.IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - return p.replace(/\\\\+/g, "\\"); - } - return p.replace(/\/\/+/g, "/"); - } - function isUnixExecutable(stats) { - return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && process.getgid !== void 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && process.getuid !== void 0 && stats.uid === process.getuid(); - } - function getCmdPath() { - var _a3; - return (_a3 = process.env["COMSPEC"]) !== null && _a3 !== void 0 ? _a3 : `cmd.exe`; - } - } -}); - -// node_modules/@actions/io/lib/io.js -var require_io = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.cp = cp; - exports2.mv = mv; - exports2.rmRF = rmRF; - exports2.mkdirP = mkdirP; - exports2.which = which9; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path30 = __importStar2(require("path")); - var ioUtil = __importStar2(require_io_util()); - function cp(source_1, dest_1) { - return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { - const { force, recursive, copySourceDirectory } = readCopyOptions(options); - const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; - if (destStat && destStat.isFile() && !force) { - return; - } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path30.join(dest, path30.basename(source)) : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); - } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); - } else { - yield cpDirRecursive(source, newDest, 0, force); - } - } else { - if (path30.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile2(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path30.join(dest, path30.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } else { - throw new Error("Destination already exists"); - } - } - } - yield mkdirP(path30.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter2(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - if (/[*"<>|]/.test(inputPath)) { - throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); - } - } - try { - yield ioUtil.rm(inputPath, { - force: true, - maxRetries: 3, - recursive: true, - retryDelay: 300 - }); - } catch (err) { - throw new Error(`File was unable to be removed ${err}`); - } - }); - } - function mkdirP(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which9(tool, check) { - return __awaiter2(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which9(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } - } - return result; - } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; - } - return ""; - }); - } - function findInPath(tool) { - return __awaiter2(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path30.delimiter)) { - if (extension) { - extensions.push(extension); - } - } - } - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; - } - return []; - } - if (tool.includes(path30.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path30.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path30.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } - } - return matches; - }); - } - function readCopyOptions(options) { - const force = options.force == null ? true : options.force; - const recursive = Boolean(options.recursive); - const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); - return { force, recursive, copySourceDirectory }; - } - function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter2(this, void 0, void 0, function* () { - if (currentDepth >= 255) - return; - currentDepth++; - yield mkdirP(destDir); - const files = yield ioUtil.readdir(sourceDir); - for (const fileName of files) { - const srcFile = `${sourceDir}/${fileName}`; - const destFile = `${destDir}/${fileName}`; - const srcFileStat = yield ioUtil.lstat(srcFile); - if (srcFileStat.isDirectory()) { - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } else { - yield copyFile2(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile2(srcFile, destFile, force) { - return __awaiter2(this, void 0, void 0, function* () { - if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { - try { - yield ioUtil.lstat(destFile); - yield ioUtil.unlink(destFile); - } catch (e) { - if (e.code === "EPERM") { - yield ioUtil.chmod(destFile, "0666"); - yield ioUtil.unlink(destFile); - } - } - const symlinkFull = yield ioUtil.readlink(srcFile); - yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? "junction" : null); - } else if (!(yield ioUtil.exists(destFile)) || force) { - yield ioUtil.copyFile(srcFile, destFile); - } - }); - } - } -}); - -// node_modules/@actions/exec/lib/toolrunner.js -var require_toolrunner = __commonJS({ - "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ToolRunner = void 0; - exports2.argStringToArray = argStringToArray; - var os7 = __importStar2(require("os")); - var events = __importStar2(require("events")); - var child = __importStar2(require("child_process")); - var path30 = __importStar2(require("path")); - var io9 = __importStar2(require_io()); - var ioUtil = __importStar2(require_io_util()); - var timers_1 = require("timers"); - var IS_WINDOWS = process.platform === "win32"; - var ToolRunner7 = class extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); - } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); - } - } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? "" : "[command]"; - if (IS_WINDOWS) { - if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; - } - } else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } - } - } else { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } - return cmd; - } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os7.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - s = s.substring(n + os7.EOL.length); - n = s.indexOf(os7.EOL); - } - return s; - } catch (err) { - this._debug(`error processing line. Failed with error ${err}`); - return ""; - } - } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env["COMSPEC"] || "cmd.exe"; - } - } - return this.toolPath; - } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += " "; - argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; - } - } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); - } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); - } - _windowsQuoteCmdArg(arg) { - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); - } - if (!arg) { - return '""'; - } - const cmdSpecialChars = [ - " ", - " ", - "&", - "(", - ")", - "[", - "]", - "{", - "}", - "^", - "=", - ";", - "!", - "'", - "+", - ",", - "`", - "~", - "|", - "<", - ">", - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some((x) => x === char)) { - needsQuotes = true; - break; - } - } - if (!needsQuotes) { - return arg; - } - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === "\\") { - reverse += "\\"; - } else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; - } else { - quoteHit = false; - } - } - reverse += '"'; - return reverse.split("").reverse().join(""); - } - _uvQuoteCmdArg(arg) { - if (!arg) { - return '""'; - } - if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { - return arg; - } - if (!arg.includes('"') && !arg.includes("\\")) { - return `"${arg}"`; - } - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === "\\") { - reverse += "\\"; - } else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += "\\"; - } else { - quoteHit = false; - } - } - reverse += '"'; - return reverse.split("").reverse().join(""); - } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 1e4 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; - } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; - } - /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number - */ - exec() { - return __awaiter2(this, void 0, void 0, function* () { - if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path30.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); - } - this.toolPath = yield io9.which(this.toolPath, true); - return new Promise((resolve14, reject) => __awaiter2(this, void 0, void 0, function* () { - this._debug(`exec tool: ${this.toolPath}`); - this._debug("arguments:"); - for (const arg of this.args) { - this._debug(` ${arg}`); - } - const optionsNonNull = this._cloneExecOptions(this.options); - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os7.EOL); - } - const state = new ExecState(optionsNonNull, this.toolPath); - state.on("debug", (message) => { - this._debug(message); - }); - if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { - return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); - } - const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - let stdbuffer = ""; - if (cp.stdout) { - cp.stdout.on("data", (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); - } - stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); - } - let errbuffer = ""; - if (cp.stderr) { - cp.stderr.on("data", (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; - s.write(data); - } - errbuffer = this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); - } - cp.on("error", (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on("exit", (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); - }); - cp.on("close", (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); - }); - state.on("done", (error3, exitCode) => { - if (stdbuffer.length > 0) { - this.emit("stdline", stdbuffer); - } - if (errbuffer.length > 0) { - this.emit("errline", errbuffer); - } - cp.removeAllListeners(); - if (error3) { - reject(error3); - } else { - resolve14(exitCode); - } - }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error("child process missing stdin"); - } - cp.stdin.end(this.options.input); - } - })); - }); - } - }; - exports2.ToolRunner = ToolRunner7; - function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ""; - function append(c) { - if (escaped && c !== '"') { - arg += "\\"; - } - arg += c; - escaped = false; - } - for (let i = 0; i < argString.length; i++) { - const c = argString.charAt(i); - if (c === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } else { - append(c); - } - continue; - } - if (c === "\\" && escaped) { - append(c); - continue; - } - if (c === "\\" && inQuotes) { - escaped = true; - continue; - } - if (c === " " && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ""; - } - continue; - } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; - } - var ExecState = class _ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; - this.processError = ""; - this.processExitCode = 0; - this.processExited = false; - this.processStderr = false; - this.delay = 1e4; - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error("toolPath must not be empty"); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; - } - } - CheckComplete() { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } else if (this.processExited) { - this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); - } - } - _debug(message) { - this.emit("debug", message); - } - _setResult() { - let error3; - if (this.processExited) { - if (this.processError) { - error3 = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } else if (this.processStderr && this.options.failOnStdErr) { - error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit("done", error3, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { - return; - } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state._debug(message); - } - state._setResult(); - } - }; - } -}); - -// node_modules/@actions/exec/lib/exec.js -var require_exec = __commonJS({ - "node_modules/@actions/exec/lib/exec.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exec = exec3; - exports2.getExecOutput = getExecOutput; - var string_decoder_1 = require("string_decoder"); - var tr = __importStar2(require_toolrunner()); - function exec3(commandLine, args, options) { - return __awaiter2(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); - } - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); - } - function getExecOutput(commandLine, args, options) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2, _b; - let stdout = ""; - let stderr = ""; - const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); - const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); - const originalStdoutListener = (_a2 = options === null || options === void 0 ? void 0 : options.listeners) === null || _a2 === void 0 ? void 0 : _a2.stdout; - const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; - const stdErrListener = (data) => { - stderr += stderrDecoder.write(data); - if (originalStdErrListener) { - originalStdErrListener(data); - } - }; - const stdOutListener = (data) => { - stdout += stdoutDecoder.write(data); - if (originalStdoutListener) { - originalStdoutListener(data); - } - }; - const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec3(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; - exports2.getDetails = getDetails; - var os_1 = __importDefault2(require("os")); - var exec3 = __importStar2(require_exec()); - var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec3.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec3.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - var _a2, _b, _c, _d; - const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a2 = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a2 === void 0 ? void 0 : _a2[1]) !== null && _b !== void 0 ? _b : ""; - const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ""; - return { - name, - version - }; - }); - var getLinuxInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - const { stdout } = yield exec3.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version - }; - }); - exports2.platform = os_1.default.platform(); - exports2.arch = os_1.default.arch(); - exports2.isWindows = exports2.platform === "win32"; - exports2.isMacOS = exports2.platform === "darwin"; - exports2.isLinux = exports2.platform === "linux"; - function getDetails() { - return __awaiter2(this, void 0, void 0, function* () { - return Object.assign(Object.assign({}, yield exports2.isWindows ? getWindowsInfo() : exports2.isMacOS ? getMacOsInfo() : getLinuxInfo()), { - platform: exports2.platform, - arch: exports2.arch, - isWindows: exports2.isWindows, - isMacOS: exports2.isMacOS, - isLinux: exports2.isLinux - }); - }); - } - } -}); - -// node_modules/@actions/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable16; - exports2.setSecret = setSecret2; - exports2.addPath = addPath2; - exports2.getInput = getInput2; - exports2.getMultilineInput = getMultilineInput; - exports2.getBooleanInput = getBooleanInput; - exports2.setOutput = setOutput7; - exports2.setCommandEcho = setCommandEcho; - exports2.setFailed = setFailed12; - exports2.isDebug = isDebug5; - exports2.debug = debug6; - exports2.error = error3; - exports2.warning = warning14; - exports2.notice = notice; - exports2.info = info8; - exports2.startGroup = startGroup4; - exports2.endGroup = endGroup4; - exports2.group = group; - exports2.saveState = saveState3; - exports2.getState = getState3; - exports2.getIDToken = getIDToken; - var command_1 = require_command(); - var file_command_1 = require_file_command(); - var utils_1 = require_utils(); - var os7 = __importStar2(require("os")); - var path30 = __importStar2(require("path")); - var oidc_utils_1 = require_oidc_utils(); - var ExitCode; - (function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; - })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable16(name, val) { - const convertedVal = (0, utils_1.toCommandValue)(val); - process.env[name] = convertedVal; - const filePath = process.env["GITHUB_ENV"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); - } - (0, command_1.issueCommand)("set-env", { name }, convertedVal); - } - function setSecret2(secret) { - (0, command_1.issueCommand)("add-mask", {}, secret); - } - function addPath2(inputPath) { - const filePath = process.env["GITHUB_PATH"] || ""; - if (filePath) { - (0, file_command_1.issueFileCommand)("PATH", inputPath); - } else { - (0, command_1.issueCommand)("add-path", {}, inputPath); - } - process.env["PATH"] = `${inputPath}${path30.delimiter}${process.env["PATH"]}`; - } - function getInput2(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); - } - if (options && options.trimWhitespace === false) { - return val; - } - return val.trim(); - } - function getMultilineInput(name, options) { - const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); - if (options && options.trimWhitespace === false) { - return inputs; - } - return inputs.map((input) => input.trim()); - } - function getBooleanInput(name, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val = getInput2(name, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) - return false; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); - } - function setOutput7(name, value) { - const filePath = process.env["GITHUB_OUTPUT"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); - } - process.stdout.write(os7.EOL); - (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); - } - function setCommandEcho(enabled) { - (0, command_1.issue)("echo", enabled ? "on" : "off"); - } - function setFailed12(message) { - process.exitCode = ExitCode.Failure; - error3(message); - } - function isDebug5() { - return process.env["RUNNER_DEBUG"] === "1"; - } - function debug6(message) { - (0, command_1.issueCommand)("debug", {}, message); - } - function error3(message, properties = {}) { - (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function warning14(message, properties = {}) { - (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function notice(message, properties = {}) { - (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function info8(message) { - process.stdout.write(message + os7.EOL); - } - function startGroup4(name) { - (0, command_1.issue)("group", name); - } - function endGroup4() { - (0, command_1.issue)("endgroup"); - } - function group(name, fn) { - return __awaiter2(this, void 0, void 0, function* () { - startGroup4(name); - let result; - try { - result = yield fn(); - } finally { - endGroup4(); - } - return result; - }); - } - function saveState3(name, value) { - const filePath = process.env["GITHUB_STATE"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); - } - (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); - } - function getState3(name) { - return process.env[`STATE_${name}`] || ""; - } - function getIDToken(aud) { - return __awaiter2(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); - } - var summary_1 = require_summary(); - Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { - return summary_1.summary; - } }); - var summary_2 = require_summary(); - Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { - return summary_2.markdownSummary; - } }); - var path_utils_1 = require_path_utils(); - Object.defineProperty(exports2, "toPosixPath", { enumerable: true, get: function() { - return path_utils_1.toPosixPath; - } }); - Object.defineProperty(exports2, "toWin32Path", { enumerable: true, get: function() { - return path_utils_1.toWin32Path; - } }); - Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { - return path_utils_1.toPlatformPath; - } }); - exports2.platform = __importStar2(require_platform()); - } -}); - -// node_modules/@actions/github/lib/context.js -var require_context = __commonJS({ - "node_modules/@actions/github/lib/context.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Context = void 0; - var fs_1 = require("fs"); - var os_1 = require("os"); - var Context = class { - /** - * Hydrate the context from the environment - */ - constructor() { - var _a2, _b, _c; - this.payload = {}; - if (process.env.GITHUB_EVENT_PATH) { - if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { - this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); - } else { - const path30 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path30} does not exist${os_1.EOL}`); - } - } - this.eventName = process.env.GITHUB_EVENT_NAME; - this.sha = process.env.GITHUB_SHA; - this.ref = process.env.GITHUB_REF; - this.workflow = process.env.GITHUB_WORKFLOW; - this.action = process.env.GITHUB_ACTION; - this.actor = process.env.GITHUB_ACTOR; - this.job = process.env.GITHUB_JOB; - this.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10); - this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); - this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); - this.apiUrl = (_a2 = process.env.GITHUB_API_URL) !== null && _a2 !== void 0 ? _a2 : `https://api.github.com`; - this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; - this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; - } - get issue() { - const payload = this.payload; - return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); - } - get repo() { - if (process.env.GITHUB_REPOSITORY) { - const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); - return { owner, repo }; - } - if (this.payload.repository) { - return { - owner: this.payload.repository.owner.login, - repo: this.payload.repository.name - }; - } - throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); - } - }; - exports2.Context = Context; - } -}); - -// node_modules/@actions/github/lib/internal/utils.js -var require_utils3 = __commonJS({ - "node_modules/@actions/github/lib/internal/utils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getAuthString = getAuthString; - exports2.getProxyAgent = getProxyAgent; - exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; - exports2.getProxyFetch = getProxyFetch; - exports2.getApiBaseUrl = getApiBaseUrl; - var httpClient = __importStar2(require_lib()); - var undici_1 = require_undici(); - function getAuthString(token, options) { - if (!token && !options.auth) { - throw new Error("Parameter token or opts.auth is required"); - } else if (token && options.auth) { - throw new Error("Parameters token and opts.auth may not both be specified"); - } - return typeof options.auth === "string" ? options.auth : `token ${token}`; - } - function getProxyAgent(destinationUrl) { - const hc = new httpClient.HttpClient(); - return hc.getAgent(destinationUrl); - } - function getProxyAgentDispatcher(destinationUrl) { - const hc = new httpClient.HttpClient(); - return hc.getAgentDispatcher(destinationUrl); - } - function getProxyFetch(destinationUrl) { - const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url2, opts) => __awaiter2(this, void 0, void 0, function* () { - return (0, undici_1.fetch)(url2, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); - }); - return proxyFetch; - } - function getApiBaseUrl() { - return process.env["GITHUB_API_URL"] || "https://api.github.com"; - } - } -}); - -// node_modules/@octokit/core/node_modules/universal-user-agent/index.js -function getUserAgent() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } - if (typeof process === "object" && process.version !== void 0) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; - } - return ""; -} -var init_universal_user_agent = __esm({ - "node_modules/@octokit/core/node_modules/universal-user-agent/index.js"() { - } -}); - -// node_modules/before-after-hook/lib/register.js -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } - if (!options) { - options = {}; - } - if (Array.isArray(name)) { - return name.reverse().reduce((callback, name2) => { - return register.bind(null, state, name2, callback, options); - }, method)(); - } - return Promise.resolve().then(() => { - if (!state.registry[name]) { - return method(options); - } - return state.registry[name].reduce((method2, registered) => { - return registered.hook.bind(null, method2, options); - }, method)(); - }); -} -var init_register = __esm({ - "node_modules/before-after-hook/lib/register.js"() { - } -}); - -// node_modules/before-after-hook/lib/add.js -function addHook(state, kind, name, hook2) { - const orig = hook2; - if (!state.registry[name]) { - state.registry[name] = []; - } - if (kind === "before") { - hook2 = (method, options) => { - return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options)); - }; - } - if (kind === "after") { - hook2 = (method, options) => { - let result; - return Promise.resolve().then(method.bind(null, options)).then((result_) => { - result = result_; - return orig(result, options); - }).then(() => { - return result; - }); - }; - } - if (kind === "error") { - hook2 = (method, options) => { - return Promise.resolve().then(method.bind(null, options)).catch((error3) => { - return orig(error3, options); - }); - }; - } - state.registry[name].push({ - hook: hook2, - orig - }); -} -var init_add = __esm({ - "node_modules/before-after-hook/lib/add.js"() { - } -}); - -// node_modules/before-after-hook/lib/remove.js -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } - const index2 = state.registry[name].map((registered) => { - return registered.orig; - }).indexOf(method); - if (index2 === -1) { - return; - } - state.registry[name].splice(index2, 1); -} -var init_remove = __esm({ - "node_modules/before-after-hook/lib/remove.js"() { - } -}); - -// node_modules/before-after-hook/index.js -function bindApi(hook2, state, name) { - const removeHookRef = bindable(removeHook, null).apply( - null, - name ? [state, name] : [state] - ); - hook2.api = { remove: removeHookRef }; - hook2.remove = removeHookRef; - ["before", "error", "after", "wrap"].forEach((kind) => { - const args = name ? [state, kind, name] : [state, kind]; - hook2[kind] = hook2.api[kind] = bindable(addHook, null).apply(null, args); - }); -} -function Singular() { - const singularHookName = /* @__PURE__ */ Symbol("Singular"); - const singularHookState = { - registry: {} - }; - const singularHook = register.bind(null, singularHookState, singularHookName); - bindApi(singularHook, singularHookState, singularHookName); - return singularHook; -} -function Collection() { - const state = { - registry: {} - }; - const hook2 = register.bind(null, state); - bindApi(hook2, state); - return hook2; -} -var bind, bindable, before_after_hook_default; -var init_before_after_hook = __esm({ - "node_modules/before-after-hook/index.js"() { - init_register(); - init_add(); - init_remove(); - bind = Function.bind; - bindable = bind.bind(bind); - before_after_hook_default = { Singular, Collection }; - } -}); - -// node_modules/@octokit/endpoint/node_modules/universal-user-agent/index.js -function getUserAgent2() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } - if (typeof process === "object" && process.version !== void 0) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; - } - return ""; -} -var init_universal_user_agent2 = __esm({ - "node_modules/@octokit/endpoint/node_modules/universal-user-agent/index.js"() { - } -}); - -// node_modules/@octokit/endpoint/dist-bundle/index.js -function lowercaseKeys(object2) { - if (!object2) { - return {}; - } - return Object.keys(object2).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object2[key]; - return newObj; - }, {}); -} -function isPlainObject(value) { - if (typeof value !== "object" || value === null) return false; - if (Object.prototype.toString.call(value) !== "[object Object]") return false; - const proto = Object.getPrototypeOf(value); - if (proto === null) return true; - const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); -} -function mergeDeep(defaults3, options) { - const result = Object.assign({}, defaults3); - Object.keys(options).forEach((key) => { - if (isPlainObject(options[key])) { - if (!(key in defaults3)) Object.assign(result, { [key]: options[key] }); - else result[key] = mergeDeep(defaults3[key], options[key]); - } else { - Object.assign(result, { [key]: options[key] }); - } - }); - return result; -} -function removeUndefinedProperties(obj) { - for (const key in obj) { - if (obj[key] === void 0) { - delete obj[key]; - } - } - return obj; -} -function merge(defaults3, route, options) { - if (typeof route === "string") { - let [method, url2] = route.split(" "); - options = Object.assign(url2 ? { method, url: url2 } : { url: method }, options); - } else { - options = Object.assign({}, route); - } - options.headers = lowercaseKeys(options.headers); - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults3 || {}, options); - if (options.url === "/graphql") { - if (defaults3 && defaults3.mediaType.previews?.length) { - mergedOptions.mediaType.previews = defaults3.mediaType.previews.filter( - (preview) => !mergedOptions.mediaType.previews.includes(preview) - ).concat(mergedOptions.mediaType.previews); - } - mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); - } - return mergedOptions; -} -function addQueryParameters(url2, parameters) { - const separator = /\?/.test(url2) ? "&" : "?"; - const names = Object.keys(parameters); - if (names.length === 0) { - return url2; - } - return url2 + separator + names.map((name) => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); - } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); -} -function removeNonChars(variableName) { - return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []); -} -function omit(object2, keysToOmit) { - const result = { __proto__: null }; - for (const key of Object.keys(object2)) { - if (keysToOmit.indexOf(key) === -1) { - result[key] = object2[key]; - } - } - return result; -} -function encodeReserved(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); - } - return part; - }).join(""); -} -function encodeUnreserved(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); -} -function encodeValue(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - if (key) { - return encodeUnreserved(key) + "=" + value; - } else { - return value; - } -} -function isDefined(value) { - return value !== void 0 && value !== null; -} -function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; -} -function getValues(context5, operator, key, modifier) { - var value = context5[key], result = []; - if (isDefined(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") { - value = value.toString(); - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } - result.push( - encodeValue(operator, value, isKeyOperator(operator) ? key : "") - ); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { - result.push( - encodeValue(operator, value2, isKeyOperator(operator) ? key : "") - ); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } - } else { - const tmp = []; - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { - tmp.push(encodeValue(operator, value2)); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { - tmp.push(encodeUnreserved(k)); - tmp.push(encodeValue(operator, value[k].toString())); - } - }); - } - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); - } - } - } - } else { - if (operator === ";") { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); - } - } - return result; -} -function parseUrl(template) { - return { - expand: expand.bind(null, template) - }; -} -function expand(template, context5) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - template = template.replace( - /\{([^\{\}]+)\}|([^\{\}]+)/g, - function(_2, expression, literal) { - if (expression) { - let operator = ""; - const values = []; - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } - expression.split(/,/g).forEach(function(variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context5, operator, tmp[1], tmp[2] || tmp[3])); - }); - if (operator && operator !== "+") { - var separator = ","; - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; - } - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved(literal); - } - } - ); - if (template === "/") { - return template; - } else { - return template.replace(/\/$/, ""); - } -} -function parse(options) { - let method = options.method.toUpperCase(); - let url2 = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({}, options.headers); - let body; - let parameters = omit(options, [ - "method", - "baseUrl", - "url", - "headers", - "request", - "mediaType" - ]); - const urlVariableNames = extractUrlVariableNames(url2); - url2 = parseUrl(url2).expand(parameters); - if (!/^http/.test(url2)) { - url2 = options.baseUrl + url2; - } - const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); - const remainingParameters = omit(parameters, omittedParameters); - const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); - if (!isBinaryRequest) { - if (options.mediaType.format) { - headers.accept = headers.accept.split(/,/).map( - (format) => format.replace( - /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, - `application/vnd$1$2.${options.mediaType.format}` - ) - ).join(","); - } - if (url2.endsWith("/graphql")) { - if (options.mediaType.previews?.length) { - const previewsFromAcceptHeader = headers.accept.match(/(? { - const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format}`; - }).join(","); - } - } - } - if (["GET", "HEAD"].includes(method)) { - url2 = addQueryParameters(url2, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; - } else { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; - } - } - } - if (!headers["content-type"] && typeof body !== "undefined") { - headers["content-type"] = "application/json; charset=utf-8"; - } - if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } - return Object.assign( - { method, url: url2, headers }, - typeof body !== "undefined" ? { body } : null, - options.request ? { request: options.request } : null - ); -} -function endpointWithDefaults(defaults3, route, options) { - return parse(merge(defaults3, route, options)); -} -function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS2 = merge(oldDefaults, newDefaults); - const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); - return Object.assign(endpoint2, { - DEFAULTS: DEFAULTS2, - defaults: withDefaults.bind(null, DEFAULTS2), - merge: merge.bind(null, DEFAULTS2), - parse - }); -} -var VERSION, userAgent, DEFAULTS, urlVariableRegex, endpoint; -var init_dist_bundle = __esm({ - "node_modules/@octokit/endpoint/dist-bundle/index.js"() { - init_universal_user_agent2(); - VERSION = "0.0.0-development"; - userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent2()}`; - DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "" - } - }; - urlVariableRegex = /\{[^{}}]+\}/g; - endpoint = withDefaults(null, DEFAULTS); - } -}); - -// node_modules/@octokit/request/node_modules/universal-user-agent/index.js -function getUserAgent3() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } - if (typeof process === "object" && process.version !== void 0) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; - } - return ""; -} -var init_universal_user_agent3 = __esm({ - "node_modules/@octokit/request/node_modules/universal-user-agent/index.js"() { - } -}); - -// node_modules/content-type/dist/index.js -var require_dist = __commonJS({ - "node_modules/content-type/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.format = format; - exports2.parse = parse3; - var TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/; - var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; - var QUOTE_REGEXP = /[\\"]/g; - var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; - var NullObject = /* @__PURE__ */ (() => { - const C = function() { - }; - C.prototype = /* @__PURE__ */ Object.create(null); - return C; - })(); - function format(obj) { - const { type, parameters } = obj; - if (!type || !TYPE_REGEXP.test(type)) { - throw new TypeError(`Invalid type: ${type}`); - } - let result = type; - if (parameters) { - for (const param of Object.keys(parameters)) { - if (!TOKEN_REGEXP.test(param)) { - throw new TypeError(`Invalid parameter name: ${param}`); - } - result += `; ${param}=${qstring(parameters[param])}`; - } - } - return result; - } - function parse3(header, options) { - const len = header.length; - let index2 = skipOWS(header, 0, len); - const valueStart = index2; - index2 = skipValue(header, index2, len); - const valueEnd = trailingOWS(header, valueStart, index2); - const type = header.slice(valueStart, valueEnd).toLowerCase(); - const parameters = options?.parameters === false ? new NullObject() : parseParameters(header, index2, len); - return { type, parameters }; - } - var SP = 32; - var HTAB = 9; - var SEMI = 59; - var EQ = 61; - var DQUOTE = 34; - var BSLASH = 92; - function parseParameters(header, index2, len) { - const parameters = new NullObject(); - parameter: while (index2 < len) { - index2 = skipOWS(header, index2 + 1, len); - const keyStart = index2; - while (index2 < len) { - const code = header.charCodeAt(index2); - if (code === SEMI) - continue parameter; - if (code === EQ) { - const keyEnd = trailingOWS(header, keyStart, index2); - const key = header.slice(keyStart, keyEnd).toLowerCase(); - index2 = skipOWS(header, index2 + 1, len); - if (index2 < len && header.charCodeAt(index2) === DQUOTE) { - index2++; - let value = ""; - while (index2 < len) { - const code2 = header.charCodeAt(index2++); - if (code2 === DQUOTE) { - index2 = skipValue(header, index2, len); - if (parameters[key] === void 0) - parameters[key] = value; - break; - } - if (code2 === BSLASH && index2 < len) { - value += header[index2++]; - continue; - } - value += String.fromCharCode(code2); - } - continue parameter; - } - const valueStart = index2; - index2 = skipValue(header, index2, len); - if (parameters[key] === void 0) { - const valueEnd = trailingOWS(header, valueStart, index2); - parameters[key] = header.slice(valueStart, valueEnd); - } - continue parameter; - } - index2++; - } - } - return parameters; - } - function skipValue(str, index2, len) { - while (index2 < len) { - const char = str.charCodeAt(index2); - if (char === SEMI) - break; - index2++; - } - return index2; - } - function skipOWS(header, index2, len) { - while (index2 < len) { - const char = header.charCodeAt(index2); - if (char !== SP && char !== HTAB) - break; - index2++; - } - return index2; - } - function trailingOWS(header, start, end) { - while (end > start) { - const char = header.charCodeAt(end - 1); - if (char !== SP && char !== HTAB) - break; - end--; - } - return end; - } - function qstring(str) { - if (TOKEN_REGEXP.test(str)) - return str; - if (TEXT_REGEXP.test(str)) - return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`; - throw new TypeError(`Invalid parameter value: ${str}`); - } - } -}); - -// node_modules/json-with-bigint/json-with-bigint.js -var intRegex, noiseValue, originalStringify, originalParse, customFormat, bigIntsStringify, noiseStringify, isUnstringifiable, isRawJSON, stringifyIteratively, JSONStringify, featureCache, isContextSourceSupported, convertMarkedBigIntsReviver, JSONParseV2, MAX_INT, MAX_DIGITS, stringsOrLargeNumbers, noiseValueWithQuotes, applyReviverIteratively, serializeBigInts, JSONParse; -var init_json_with_bigint = __esm({ - "node_modules/json-with-bigint/json-with-bigint.js"() { - intRegex = /^-?\d+$/; - noiseValue = /^-?\d+n+$/; - originalStringify = JSON.stringify; - originalParse = JSON.parse; - customFormat = /^-?\d+n$/; - bigIntsStringify = /([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g; - noiseStringify = /([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g; - isUnstringifiable = (val) => val === void 0 || typeof val === "function" || typeof val === "symbol"; - isRawJSON = (val) => val !== null && typeof val === "object" && val.constructor && val.constructor.name === "RawJSON"; - stringifyIteratively = (rootValue, replacer, spaceParam) => { - let space2 = ""; - if (typeof spaceParam === "number") { - space2 = " ".repeat(Math.min(10, Math.max(0, Math.floor(spaceParam)))); - } else if (typeof spaceParam === "string") { - space2 = spaceParam.slice(0, 10); - } - const isFunctionReplacer = typeof replacer === "function"; - const propertyList = Array.isArray(replacer) ? new Set(replacer.map(String)) : null; - const prepareVal = (parent, key, val) => { - const isObject2 = val !== null && typeof val === "object"; - const hasToJSON = isObject2 && typeof val.toJSON === "function"; - if (hasToJSON) { - val = val.toJSON(key); - } - const isNoise = typeof val === "string" && noiseValue.test(val); - if (isNoise) return val + "n"; - const isBigInt = typeof val === "bigint"; - if (isBigInt) { - const supportsRawJSON = "rawJSON" in JSON; - if (supportsRawJSON) return JSON.rawJSON(val.toString()); - return val.toString() + "n"; - } - if (isFunctionReplacer) { - val = replacer.call(parent, key, val); - } - const isPostReplacerObject = val !== null && typeof val === "object"; - if (isPostReplacerObject) { - const isPrimitiveWrapper = val instanceof Number || val instanceof String || val instanceof Boolean; - if (isPrimitiveWrapper) { - val = val.valueOf(); - } - } - return val; - }; - const rootProcessed = prepareVal({ "": rootValue }, "", rootValue); - if (isUnstringifiable(rootProcessed)) { - return void 0; - } - const isRootPrimitive = rootProcessed === null || typeof rootProcessed !== "object"; - const isRootNativeRawJSON = isRawJSON(rootProcessed); - if (isRootPrimitive || isRootNativeRawJSON) { - return originalStringify(rootProcessed); - } - const chunks = []; - let level = 0; - const stack = [ - { - parent: { "": rootProcessed }, - key: "", - val: rootProcessed, - isArray: Array.isArray(rootProcessed), - keys: Array.isArray(rootProcessed) ? null : Object.keys(rootProcessed), - index: 0, - first: true - } - ]; - const visited = new WeakSet([rootProcessed]); - while (stack.length > 0) { - const node = stack[stack.length - 1]; - if (node.index === 0) { - chunks.push(node.isArray ? "[" : "{"); - level++; - } - let isDone = false; - if (node.isArray) { - if (node.index < node.val.length) { - if (!node.first) chunks.push(","); - if (space2) chunks.push("\n" + space2.repeat(level)); - const childRaw = node.val[node.index]; - const childVal = prepareVal(node.val, String(node.index), childRaw); - if (isUnstringifiable(childVal)) { - chunks.push("null"); - node.first = false; - node.index++; - } else { - const isComplexObject = childVal !== null && typeof childVal === "object"; - const isNativeRaw = isRawJSON(childVal); - if (isComplexObject && !isNativeRaw) { - if (visited.has(childVal)) { - throw new TypeError("Converting circular structure to JSON"); - } - visited.add(childVal); - stack.push({ - parent: node.val, - key: String(node.index), - val: childVal, - isArray: Array.isArray(childVal), - keys: Array.isArray(childVal) ? null : Object.keys(childVal), - index: 0, - first: true - }); - node.first = false; - node.index++; - } else { - chunks.push(originalStringify(childVal)); - node.first = false; - node.index++; - } - } - } else { - isDone = true; - } - } else { - while (node.index < node.keys.length) { - const k = node.keys[node.index++]; - const isFilteredOutByArray = propertyList && !propertyList.has(k); - if (isFilteredOutByArray) continue; - const childRaw = node.val[k]; - const childVal = prepareVal(node.val, k, childRaw); - if (isUnstringifiable(childVal)) continue; - if (!node.first) chunks.push(","); - if (space2) { - chunks.push("\n" + space2.repeat(level) + originalStringify(k) + ": "); - } else { - chunks.push(originalStringify(k) + ":"); - } - const isComplexObject = childVal !== null && typeof childVal === "object"; - const isNativeRaw = isRawJSON(childVal); - if (isComplexObject && !isNativeRaw) { - if (visited.has(childVal)) { - throw new TypeError("Converting circular structure to JSON"); - } - visited.add(childVal); - stack.push({ - parent: node.val, - key: k, - val: childVal, - isArray: Array.isArray(childVal), - keys: Array.isArray(childVal) ? null : Object.keys(childVal), - index: 0, - first: true - }); - node.first = false; - break; - } else { - chunks.push(originalStringify(childVal)); - node.first = false; - } - } - const isNodeFullyProcessed = node.index >= node.keys.length && stack[stack.length - 1] === node; - if (isNodeFullyProcessed) { - isDone = true; - } - } - if (isDone) { - level--; - if (!node.first && space2) chunks.push("\n" + space2.repeat(level)); - chunks.push(node.isArray ? "]" : "}"); - visited.delete(node.val); - stack.pop(); - } - } - return chunks.join(""); - }; - JSONStringify = (value, replacer, space2) => { - try { - const supportsRawJSON = "rawJSON" in JSON; - if (supportsRawJSON) { - return originalStringify( - value, - (key, val) => { - if (typeof val === "bigint") return JSON.rawJSON(val.toString()); - const hasFunctionReplacer = typeof replacer === "function"; - if (hasFunctionReplacer) return replacer(key, val); - const isKeyInArrayReplacer = Array.isArray(replacer) && replacer.includes(key); - if (isKeyInArrayReplacer) return val; - return val; - }, - space2 - ); - } - if (!value) return originalStringify(value, replacer, space2); - const convertedToCustomJSON = originalStringify( - value, - (key, val) => { - const isNoise = typeof val === "string" && noiseValue.test(val); - if (isNoise) return val.toString() + "n"; - if (typeof val === "bigint") return val.toString() + "n"; - const hasFunctionReplacer = typeof replacer === "function"; - if (hasFunctionReplacer) return replacer(key, val); - const isKeyInArrayReplacer = Array.isArray(replacer) && replacer.includes(key); - if (isKeyInArrayReplacer) return val; - return val; - }, - space2 - ); - const processedJSON = convertedToCustomJSON.replace( - bigIntsStringify, - "$1$2$3" - ); - const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3"); - return denoisedJSON; - } catch (error3) { - if (error3 instanceof RangeError) { - const convertedJSON = stringifyIteratively(value, replacer, space2); - if (convertedJSON === void 0) return void 0; - const supportsRawJSON = "rawJSON" in JSON; - if (supportsRawJSON) return convertedJSON; - const processedJSON = convertedJSON.replace(bigIntsStringify, "$1$2$3"); - return processedJSON.replace(noiseStringify, "$1$2$3"); - } - throw error3; - } - }; - featureCache = /* @__PURE__ */ new Map(); - isContextSourceSupported = () => { - const parseFingerprint = JSON.parse.toString(); - if (featureCache.has(parseFingerprint)) { - return featureCache.get(parseFingerprint); - } - try { - const result = JSON.parse( - "1", - (_2, __, context5) => !!context5?.source && context5.source === "1" - ); - featureCache.set(parseFingerprint, result); - return result; - } catch { - featureCache.set(parseFingerprint, false); - return false; - } - }; - convertMarkedBigIntsReviver = (key, value, context5, userReviver) => { - const isCustomFormatBigInt = typeof value === "string" && customFormat.test(value); - if (isCustomFormatBigInt) return BigInt(value.slice(0, -1)); - const isNoiseValue = typeof value === "string" && noiseValue.test(value); - if (isNoiseValue) return value.slice(0, -1); - const hasUserReviver = typeof userReviver === "function"; - if (!hasUserReviver) return value; - return userReviver(key, value, context5); - }; - JSONParseV2 = (text, reviver) => { - return JSON.parse(text, (key, value, context5) => { - const isNumber2 = typeof value === "number"; - const isOutOfBounds = value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER; - const isBigNumber = isNumber2 && isOutOfBounds; - const isInt = context5 && intRegex.test(context5.source); - const isBigInt = isBigNumber && isInt; - if (isBigInt) return BigInt(context5.source); - const hasCustomReviver = typeof reviver === "function"; - if (!hasCustomReviver) return value; - return reviver(key, value, context5); - }); - }; - MAX_INT = Number.MAX_SAFE_INTEGER.toString(); - MAX_DIGITS = MAX_INT.length; - stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g; - noiseValueWithQuotes = /^"-?\d+n+"$/; - applyReviverIteratively = (parsed, userReviver) => { - const rootHolder = { "": parsed }; - const stack = [{ parent: rootHolder, key: "", visited: false }]; - while (stack.length > 0) { - const node = stack[stack.length - 1]; - if (!node.visited) { - node.visited = true; - const value = node.parent[node.key]; - const isComplexObject = value !== null && typeof value === "object"; - if (isComplexObject) { - const keys = Object.keys(value); - for (let i = keys.length - 1; i >= 0; i--) { - stack.push({ parent: value, key: keys[i], visited: false }); - } - } - } else { - const { parent, key } = node; - let value = parent[key]; - if (typeof value === "string") { - const isCustomFormatBigInt = customFormat.test(value); - if (isCustomFormatBigInt) { - value = BigInt(value.slice(0, -1)); - } else { - const isNoise = noiseValue.test(value); - if (isNoise) value = value.slice(0, -1); - } - } - const hasUserReviver = typeof userReviver === "function"; - if (hasUserReviver) { - value = userReviver.call(parent, key, value); - } - const isDeleted = value === void 0; - if (isDeleted) { - delete parent[key]; - } else { - parent[key] = value; - } - stack.pop(); - } - } - return rootHolder[""]; - }; - serializeBigInts = (text) => { - return text.replace( - stringsOrLargeNumbers, - (match2, digits, fractional, exponential) => { - const isString3 = match2[0] === '"'; - const isNoise = isString3 && noiseValueWithQuotes.test(match2); - if (isNoise) return match2.substring(0, match2.length - 1) + 'n"'; - const hasFractionalOrExponential = fractional || exponential; - const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT); - const isStandardValue = isString3 || hasFractionalOrExponential || isLessThanMaxSafeInt; - if (isStandardValue) return match2; - return '"' + match2 + 'n"'; - } - ); - }; - JSONParse = (text, reviver) => { - if (!text) return originalParse(text, reviver); - try { - if (isContextSourceSupported()) return JSONParseV2(text, reviver); - const serializedData = serializeBigInts(text); - return originalParse( - serializedData, - (key, value, context5) => convertMarkedBigIntsReviver(key, value, context5, reviver) - ); - } catch (error3) { - if (error3 instanceof RangeError) { - const serializedData = serializeBigInts(text); - const parsed = originalParse(serializedData); - return applyReviverIteratively(parsed, reviver); - } - throw error3; - } - }; - } -}); - -// node_modules/@octokit/request-error/dist-src/index.js -var RequestError; -var init_dist_src = __esm({ - "node_modules/@octokit/request-error/dist-src/index.js"() { - RequestError = class extends Error { - name; - /** - * http status code - */ - status; - /** - * Request options that lead to the error. - */ - request; - /** - * Response object if a response was received - */ - response; - constructor(message, statusCode, options) { - super(message, { cause: options.cause }); - this.name = "HttpError"; - this.status = Number.parseInt(statusCode); - if (Number.isNaN(this.status)) { - this.status = 0; - } - if ("response" in options) { - this.response = options.response; - } - const requestCopy = Object.assign({}, options.request); - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace( - /(? [ - name, - String(value) - ]) - ); - let fetchResponse; - try { - fetchResponse = await fetch(requestOptions.url, { - method: requestOptions.method, - body, - redirect: requestOptions.request?.redirect, - headers: requestHeaders, - signal: requestOptions.request?.signal, - // duplex must be set if request.body is ReadableStream or Async Iterables. - // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. - ...requestOptions.body && { duplex: "half" } - }); - } catch (error3) { - let message = "Unknown Error"; - if (error3 instanceof Error) { - if (error3.name === "AbortError") { - error3.status = 500; - throw error3; - } - message = error3.message; - if (error3.name === "TypeError" && "cause" in error3) { - if (error3.cause instanceof Error) { - message = error3.cause.message; - } else if (typeof error3.cause === "string") { - message = error3.cause; - } - } - } - const requestError = new RequestError(message, 500, { - request: requestOptions - }); - requestError.cause = error3; - throw requestError; - } - const status = fetchResponse.status; - const url2 = fetchResponse.url; - const responseHeaders = {}; - for (const [key, value] of fetchResponse.headers) { - responseHeaders[key] = value; - } - const octokitResponse = { - url: url2, - status, - headers: responseHeaders, - data: "" - }; - if ("deprecation" in responseHeaders) { - const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/); - const deprecationLink = matches && matches.pop(); - log.warn( - `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` - ); - } - if (status === 204 || status === 205) { - return octokitResponse; - } - if (requestOptions.method === "HEAD") { - if (status < 400) { - return octokitResponse; - } - throw new RequestError(fetchResponse.statusText, status, { - response: octokitResponse, - request: requestOptions - }); - } - if (status === 304) { - octokitResponse.data = await getResponseData(fetchResponse); - throw new RequestError("Not modified", status, { - response: octokitResponse, - request: requestOptions - }); - } - if (status >= 400) { - octokitResponse.data = await getResponseData(fetchResponse); - throw new RequestError(toErrorMessage(octokitResponse.data), status, { - response: octokitResponse, - request: requestOptions - }); - } - octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body; - return octokitResponse; -} -async function getResponseData(response) { - const contentType = response.headers.get("content-type"); - if (!contentType) { - return response.text().catch(noop); - } - const mimetype = (0, import_content_type.parse)(contentType); - if (isJSONResponse(mimetype)) { - let text = ""; - try { - text = await response.text(); - return JSONParse(text); - } catch (err) { - return text; - } - } else if (mimetype.type.startsWith("text/") || // `application/octet-stream` is the canonical "arbitrary binary" type - // (RFC 2046) and must never be decoded as text, even when the response - // carries a (misleading) `charset=utf-8` parameter — see #751. - mimetype.parameters.charset?.toLowerCase() === "utf-8" && mimetype.type !== "application/octet-stream") { - return response.text().catch(noop); - } else { - return response.arrayBuffer().catch( - /* v8 ignore next -- @preserve */ - () => new ArrayBuffer(0) - ); - } -} -function isJSONResponse(mimetype) { - return mimetype.type === "application/json" || mimetype.type === "application/scim+json"; -} -function toErrorMessage(data) { - if (typeof data === "string") { - return data; - } - if (data instanceof ArrayBuffer) { - return "Unknown error"; - } - if (typeof data === "object" && data !== null && "message" in data) { - const objectData = data; - const suffix = "documentation_url" in objectData ? ` - ${objectData.documentation_url}` : ""; - return Array.isArray(objectData.errors) ? `${objectData.message}: ${objectData.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${objectData.message}${suffix}`; - } - return `Unknown error: ${JSON.stringify(data)}`; -} -function withDefaults2(oldEndpoint, newDefaults) { - const endpoint2 = oldEndpoint.defaults(newDefaults); - const newApi = function(route, parameters) { - const endpointOptions = endpoint2.merge(route, parameters); - if (!endpointOptions.request || !endpointOptions.request.hook) { - return fetchWrapper(endpoint2.parse(endpointOptions)); - } - const request22 = (route2, parameters2) => { - return fetchWrapper( - endpoint2.parse(endpoint2.merge(route2, parameters2)) - ); - }; - Object.assign(request22, { - endpoint: endpoint2, - defaults: withDefaults2.bind(null, endpoint2) - }); - return endpointOptions.request.hook(request22, endpointOptions); - }; - return Object.assign(newApi, { - endpoint: endpoint2, - defaults: withDefaults2.bind(null, endpoint2) - }); -} -var import_content_type, VERSION2, defaults_default, noop, request; -var init_dist_bundle2 = __esm({ - "node_modules/@octokit/request/dist-bundle/index.js"() { - init_dist_bundle(); - init_universal_user_agent3(); - import_content_type = __toESM(require_dist(), 1); - init_json_with_bigint(); - init_dist_src(); - VERSION2 = "10.0.13"; - defaults_default = { - headers: { - "user-agent": `octokit-request.js/${VERSION2} ${getUserAgent3()}` - } - }; - noop = () => ""; - request = withDefaults2(endpoint, defaults_default); - } -}); - -// node_modules/@octokit/graphql/node_modules/universal-user-agent/index.js -function getUserAgent4() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } - if (typeof process === "object" && process.version !== void 0) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; - } - return ""; -} -var init_universal_user_agent4 = __esm({ - "node_modules/@octokit/graphql/node_modules/universal-user-agent/index.js"() { - } -}); - -// node_modules/@octokit/graphql/dist-bundle/index.js -function _buildMessageForResponseErrors(data) { - return `Request failed due to following response errors: -` + data.errors.map((e) => ` - ${e.message}`).join("\n"); -} -function graphql(request22, query, options) { - if (options) { - if (typeof query === "string" && "query" in options) { - return Promise.reject( - new Error(`[@octokit/graphql] "query" cannot be used as variable name`) - ); - } - for (const key in options) { - if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; - return Promise.reject( - new Error( - `[@octokit/graphql] "${key}" cannot be used as variable name` - ) - ); - } - } - const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; - const requestOptions = Object.keys( - parsedOptions - ).reduce((result, key) => { - if (NON_VARIABLE_OPTIONS.includes(key)) { - result[key] = parsedOptions[key]; - return result; - } - if (!result.variables) { - result.variables = {}; - } - result.variables[key] = parsedOptions[key]; - return result; - }, {}); - const baseUrl = parsedOptions.baseUrl || request22.endpoint.DEFAULTS.baseUrl; - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); - } - return request22(requestOptions).then((response) => { - if (response.data.errors) { - const headers = {}; - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } - throw new GraphqlResponseError( - requestOptions, - headers, - response.data - ); - } - return response.data.data; - }); -} -function withDefaults3(request22, newDefaults) { - const newRequest = request22.defaults(newDefaults); - const newApi = (query, options) => { - return graphql(newRequest, query, options); - }; - return Object.assign(newApi, { - defaults: withDefaults3.bind(null, newRequest), - endpoint: newRequest.endpoint - }); -} -function withCustomRequest(customRequest) { - return withDefaults3(customRequest, { - method: "POST", - url: "/graphql" - }); -} -var VERSION3, GraphqlResponseError, NON_VARIABLE_OPTIONS, FORBIDDEN_VARIABLE_OPTIONS, GHES_V3_SUFFIX_REGEX, graphql2; -var init_dist_bundle3 = __esm({ - "node_modules/@octokit/graphql/dist-bundle/index.js"() { - init_dist_bundle2(); - init_universal_user_agent4(); - VERSION3 = "0.0.0-development"; - GraphqlResponseError = class extends Error { - constructor(request22, headers, response) { - super(_buildMessageForResponseErrors(response)); - this.request = request22; - this.headers = headers; - this.response = response; - this.errors = response.errors; - this.data = response.data; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - } - request; - headers; - response; - name = "GraphqlResponseError"; - errors; - data; - }; - NON_VARIABLE_OPTIONS = [ - "method", - "baseUrl", - "url", - "headers", - "request", - "query", - "mediaType", - "operationName" - ]; - FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; - GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; - graphql2 = withDefaults3(request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION3} ${getUserAgent4()}` - }, - method: "POST", - url: "/graphql" - }); - } -}); - -// node_modules/@octokit/auth-token/dist-bundle/index.js -async function auth(token) { - const isApp = isJWT(token); - const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_"); - const isUserToServer = token.startsWith("ghu_"); - const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; - return { - type: "token", - token, - tokenType - }; -} -function withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } - return `token ${token}`; -} -async function hook(token, request3, route, parameters) { - const endpoint2 = request3.endpoint.merge( - route, - parameters - ); - endpoint2.headers.authorization = withAuthorizationPrefix(token); - return request3(endpoint2); -} -var b64url, sep, jwtRE, isJWT, createTokenAuth; -var init_dist_bundle4 = __esm({ - "node_modules/@octokit/auth-token/dist-bundle/index.js"() { - b64url = "(?:[a-zA-Z0-9_-]+)"; - sep = "\\."; - jwtRE = new RegExp(`^${b64url}${sep}${b64url}${sep}${b64url}$`); - isJWT = jwtRE.test.bind(jwtRE); - createTokenAuth = function createTokenAuth2(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } - if (typeof token !== "string") { - throw new Error( - "[@octokit/auth-token] Token passed to createTokenAuth is not a string" - ); - } - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); - }; - } -}); - -// node_modules/@octokit/core/dist-src/version.js -var VERSION4; -var init_version = __esm({ - "node_modules/@octokit/core/dist-src/version.js"() { - VERSION4 = "7.0.7"; - } -}); - -// node_modules/@octokit/core/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - Octokit: () => Octokit -}); -function createLogger(logger = {}) { - if (typeof logger.debug !== "function") { - logger.debug = noop2; - } - if (typeof logger.info !== "function") { - logger.info = noop2; - } - if (typeof logger.warn !== "function") { - logger.warn = consoleWarn; - } - if (typeof logger.error !== "function") { - logger.error = consoleError; - } - return logger; -} -var noop2, consoleWarn, consoleError, userAgentTrail, Octokit; -var init_dist_src2 = __esm({ - "node_modules/@octokit/core/dist-src/index.js"() { - init_universal_user_agent(); - init_before_after_hook(); - init_dist_bundle2(); - init_dist_bundle3(); - init_dist_bundle4(); - init_version(); - noop2 = () => { - }; - consoleWarn = console.warn.bind(console); - consoleError = console.error.bind(console); - userAgentTrail = `octokit-core.js/${VERSION4} ${getUserAgent()}`; - Octokit = class { - static VERSION = VERSION4; - static defaults(defaults3) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; - if (typeof defaults3 === "function") { - super(defaults3(options)); - return; - } - super( - Object.assign( - {}, - defaults3, - options, - options.userAgent && defaults3.userAgent ? { - userAgent: `${options.userAgent} ${defaults3.userAgent}` - } : null - ) - ); - } - }; - return OctokitWithDefaults; - } - static plugins = []; - /** - * Attach a plugin (or many) to your Octokit instance. - * - * @example - * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) - */ - static plugin(...newPlugins) { - const currentPlugins = this.plugins; - const NewOctokit = class extends this { - static plugins = currentPlugins.concat( - newPlugins.filter((plugin) => !currentPlugins.includes(plugin)) - ); - }; - return NewOctokit; - } - constructor(options = {}) { - const hook2 = new before_after_hook_default.Collection(); - const requestDefaults = { - baseUrl: request.endpoint.DEFAULTS.baseUrl, - headers: {}, - request: Object.assign({}, options.request, { - // @ts-ignore internal usage only, no need to type - hook: hook2.bind(null, "request") - }), - mediaType: { - previews: [], - format: "" - } - }; - requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail; - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; - } - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; - } - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; - } - this.request = request.defaults(requestDefaults); - this.graphql = withCustomRequest(this.request).defaults(requestDefaults); - this.log = createLogger(options.log); - this.hook = hook2; - if (!options.authStrategy) { - if (!options.auth) { - this.auth = async () => ({ - type: "unauthenticated" - }); - } else { - const auth2 = createTokenAuth(options.auth); - hook2.wrap("request", auth2.hook); - this.auth = auth2; - } - } else { - const { authStrategy, ...otherOptions } = options; - const auth2 = authStrategy( - Object.assign( - { - request: this.request, - log: this.log, - // we pass the current octokit instance as well as its constructor options - // to allow for authentication strategies that return a new octokit instance - // that shares the same internal state as the current one. The original - // requirement for this was the "event-octokit" authentication strategy - // of https://github.com/probot/octokit-auth-probot. - octokit: this, - octokitOptions: otherOptions - }, - options.auth - ) - ); - hook2.wrap("request", auth2.hook); - this.auth = auth2; - } - const classConstructor = this.constructor; - for (let i = 0; i < classConstructor.plugins.length; ++i) { - Object.assign(this, classConstructor.plugins[i](this, options)); - } - } - // assigned during constructor - request; - graphql; - log; - hook; - // TODO: type `octokit.auth` based on passed options.authStrategy - auth; - }; - } -}); - -// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js -var VERSION5; -var init_version2 = __esm({ - "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { - VERSION5 = "17.0.0"; - } -}); - -// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js -var Endpoints, endpoints_default; -var init_endpoints = __esm({ - "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { - Endpoints = { - actions: { - addCustomLabelsToSelfHostedRunnerForOrg: [ - "POST /orgs/{org}/actions/runners/{runner_id}/labels" - ], - addCustomLabelsToSelfHostedRunnerForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - addRepoAccessToSelfHostedRunnerGroupInOrg: [ - "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}" - ], - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" - ], - addSelectedRepoToOrgVariable: [ - "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" - ], - approveWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve" - ], - cancelWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel" - ], - createEnvironmentVariable: [ - "POST /repos/{owner}/{repo}/environments/{environment_name}/variables" - ], - createHostedRunnerForOrg: ["POST /orgs/{org}/actions/hosted-runners"], - createOrUpdateEnvironmentSecret: [ - "PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" - ], - createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}" - ], - createOrgVariable: ["POST /orgs/{org}/actions/variables"], - createRegistrationTokenForOrg: [ - "POST /orgs/{org}/actions/runners/registration-token" - ], - createRegistrationTokenForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/registration-token" - ], - createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], - createRemoveTokenForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/remove-token" - ], - createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"], - createWorkflowDispatch: [ - "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" - ], - deleteActionsCacheById: [ - "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}" - ], - deleteActionsCacheByKey: [ - "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}" - ], - deleteArtifact: [ - "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}" - ], - deleteCustomImageFromOrg: [ - "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}" - ], - deleteCustomImageVersionFromOrg: [ - "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}" - ], - deleteEnvironmentSecret: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" - ], - deleteEnvironmentVariable: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" - ], - deleteHostedRunnerForOrg: [ - "DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], - deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}" - ], - deleteRepoVariable: [ - "DELETE /repos/{owner}/{repo}/actions/variables/{name}" - ], - deleteSelfHostedRunnerFromOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}" - ], - deleteSelfHostedRunnerFromRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}" - ], - deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], - deleteWorkflowRunLogs: [ - "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs" - ], - disableSelectedRepositoryGithubActionsOrganization: [ - "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}" - ], - disableWorkflow: [ - "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable" - ], - downloadArtifact: [ - "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}" - ], - downloadJobLogsForWorkflowRun: [ - "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs" - ], - downloadWorkflowRunAttemptLogs: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs" - ], - downloadWorkflowRunLogs: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs" - ], - enableSelectedRepositoryGithubActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}" - ], - enableWorkflow: [ - "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable" - ], - forceCancelWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel" - ], - generateRunnerJitconfigForOrg: [ - "POST /orgs/{org}/actions/runners/generate-jitconfig" - ], - generateRunnerJitconfigForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig" - ], - getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], - getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], - getActionsCacheUsageByRepoForOrg: [ - "GET /orgs/{org}/actions/cache/usage-by-repository" - ], - getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], - getAllowedActionsOrganization: [ - "GET /orgs/{org}/actions/permissions/selected-actions" - ], - getAllowedActionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" - ], - getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - getCustomImageForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}" - ], - getCustomImageVersionForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}" - ], - getCustomOidcSubClaimForRepo: [ - "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" - ], - getEnvironmentPublicKey: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key" - ], - getEnvironmentSecret: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" - ], - getEnvironmentVariable: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" - ], - getGithubActionsDefaultWorkflowPermissionsOrganization: [ - "GET /orgs/{org}/actions/permissions/workflow" - ], - getGithubActionsDefaultWorkflowPermissionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/workflow" - ], - getGithubActionsPermissionsOrganization: [ - "GET /orgs/{org}/actions/permissions" - ], - getGithubActionsPermissionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions" - ], - getHostedRunnerForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" - ], - getHostedRunnersGithubOwnedImagesForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/images/github-owned" - ], - getHostedRunnersLimitsForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/limits" - ], - getHostedRunnersMachineSpecsForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/machine-sizes" - ], - getHostedRunnersPartnerImagesForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/images/partner" - ], - getHostedRunnersPlatformsForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/platforms" - ], - getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], - getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], - getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"], - getPendingDeploymentsForRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - ], - getRepoPermissions: [ - "GET /repos/{owner}/{repo}/actions/permissions", - {}, - { renamed: ["actions", "getGithubActionsPermissionsRepository"] } - ], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"], - getReviewsForRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals" - ], - getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], - getSelfHostedRunnerForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/{runner_id}" - ], - getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], - getWorkflowAccessToRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/access" - ], - getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], - getWorkflowRunAttempt: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}" - ], - getWorkflowRunUsage: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing" - ], - getWorkflowUsage: [ - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing" - ], - listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], - listCustomImageVersionsForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions" - ], - listCustomImagesForOrg: [ - "GET /orgs/{org}/actions/hosted-runners/images/custom" - ], - listEnvironmentSecrets: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets" - ], - listEnvironmentVariables: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/variables" - ], - listGithubHostedRunnersInGroupForOrg: [ - "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners" - ], - listHostedRunnersForOrg: ["GET /orgs/{org}/actions/hosted-runners"], - listJobsForWorkflowRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs" - ], - listJobsForWorkflowRunAttempt: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs" - ], - listLabelsForSelfHostedRunnerForOrg: [ - "GET /orgs/{org}/actions/runners/{runner_id}/labels" - ], - listLabelsForSelfHostedRunnerForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], - listOrgVariables: ["GET /orgs/{org}/actions/variables"], - listRepoOrganizationSecrets: [ - "GET /repos/{owner}/{repo}/actions/organization-secrets" - ], - listRepoOrganizationVariables: [ - "GET /repos/{owner}/{repo}/actions/organization-variables" - ], - listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], - listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"], - listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], - listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], - listRunnerApplicationsForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/downloads" - ], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/actions/secrets/{secret_name}/repositories" - ], - listSelectedReposForOrgVariable: [ - "GET /orgs/{org}/actions/variables/{name}/repositories" - ], - listSelectedRepositoriesEnabledGithubActionsOrganization: [ - "GET /orgs/{org}/actions/permissions/repositories" - ], - listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], - listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], - listWorkflowRunArtifacts: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts" - ], - listWorkflowRuns: [ - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs" - ], - listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], - reRunJobForWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" - ], - reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], - reRunWorkflowFailedJobs: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" - ], - removeAllCustomLabelsFromSelfHostedRunnerForOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}/labels" - ], - removeAllCustomLabelsFromSelfHostedRunnerForRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - removeCustomLabelFromSelfHostedRunnerForOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}" - ], - removeCustomLabelFromSelfHostedRunnerForRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" - ], - removeSelectedRepoFromOrgVariable: [ - "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" - ], - reviewCustomGatesForRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" - ], - reviewPendingDeploymentsForRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - ], - setAllowedActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/selected-actions" - ], - setAllowedActionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions" - ], - setCustomLabelsForSelfHostedRunnerForOrg: [ - "PUT /orgs/{org}/actions/runners/{runner_id}/labels" - ], - setCustomLabelsForSelfHostedRunnerForRepo: [ - "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - setCustomOidcSubClaimForRepo: [ - "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" - ], - setGithubActionsDefaultWorkflowPermissionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/workflow" - ], - setGithubActionsDefaultWorkflowPermissionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/workflow" - ], - setGithubActionsPermissionsOrganization: [ - "PUT /orgs/{org}/actions/permissions" - ], - setGithubActionsPermissionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories" - ], - setSelectedReposForOrgVariable: [ - "PUT /orgs/{org}/actions/variables/{name}/repositories" - ], - setSelectedRepositoriesEnabledGithubActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/repositories" - ], - setWorkflowAccessToRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/access" - ], - updateEnvironmentVariable: [ - "PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" - ], - updateHostedRunnerForOrg: [ - "PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" - ], - updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"], - updateRepoVariable: [ - "PATCH /repos/{owner}/{repo}/actions/variables/{name}" - ] - }, - activity: { - checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], - deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], - deleteThreadSubscription: [ - "DELETE /notifications/threads/{thread_id}/subscription" - ], - getFeeds: ["GET /feeds"], - getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], - getThread: ["GET /notifications/threads/{thread_id}"], - getThreadSubscriptionForAuthenticatedUser: [ - "GET /notifications/threads/{thread_id}/subscription" - ], - listEventsForAuthenticatedUser: ["GET /users/{username}/events"], - listNotificationsForAuthenticatedUser: ["GET /notifications"], - listOrgEventsForAuthenticatedUser: [ - "GET /users/{username}/events/orgs/{org}" - ], - listPublicEvents: ["GET /events"], - listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], - listPublicEventsForUser: ["GET /users/{username}/events/public"], - listPublicOrgEvents: ["GET /orgs/{org}/events"], - listReceivedEventsForUser: ["GET /users/{username}/received_events"], - listReceivedPublicEventsForUser: [ - "GET /users/{username}/received_events/public" - ], - listRepoEvents: ["GET /repos/{owner}/{repo}/events"], - listRepoNotificationsForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/notifications" - ], - listReposStarredByAuthenticatedUser: ["GET /user/starred"], - listReposStarredByUser: ["GET /users/{username}/starred"], - listReposWatchedByUser: ["GET /users/{username}/subscriptions"], - listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], - listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], - listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], - markNotificationsAsRead: ["PUT /notifications"], - markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], - markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], - markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], - setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], - setThreadSubscription: [ - "PUT /notifications/threads/{thread_id}/subscription" - ], - starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], - unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] - }, - apps: { - addRepoToInstallation: [ - "PUT /user/installations/{installation_id}/repositories/{repository_id}", - {}, - { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] } - ], - addRepoToInstallationForAuthenticatedUser: [ - "PUT /user/installations/{installation_id}/repositories/{repository_id}" - ], - checkToken: ["POST /applications/{client_id}/token"], - createFromManifest: ["POST /app-manifests/{code}/conversions"], - createInstallationAccessToken: [ - "POST /app/installations/{installation_id}/access_tokens" - ], - deleteAuthorization: ["DELETE /applications/{client_id}/grant"], - deleteInstallation: ["DELETE /app/installations/{installation_id}"], - deleteToken: ["DELETE /applications/{client_id}/token"], - getAuthenticated: ["GET /app"], - getBySlug: ["GET /apps/{app_slug}"], - getInstallation: ["GET /app/installations/{installation_id}"], - getOrgInstallation: ["GET /orgs/{org}/installation"], - getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], - getSubscriptionPlanForAccount: [ - "GET /marketplace_listing/accounts/{account_id}" - ], - getSubscriptionPlanForAccountStubbed: [ - "GET /marketplace_listing/stubbed/accounts/{account_id}" - ], - getUserInstallation: ["GET /users/{username}/installation"], - getWebhookConfigForApp: ["GET /app/hook/config"], - getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], - listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], - listAccountsForPlanStubbed: [ - "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts" - ], - listInstallationReposForAuthenticatedUser: [ - "GET /user/installations/{installation_id}/repositories" - ], - listInstallationRequestsForAuthenticatedApp: [ - "GET /app/installation-requests" - ], - listInstallations: ["GET /app/installations"], - listInstallationsForAuthenticatedUser: ["GET /user/installations"], - listPlans: ["GET /marketplace_listing/plans"], - listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], - listReposAccessibleToInstallation: ["GET /installation/repositories"], - listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], - listSubscriptionsForAuthenticatedUserStubbed: [ - "GET /user/marketplace_purchases/stubbed" - ], - listWebhookDeliveries: ["GET /app/hook/deliveries"], - redeliverWebhookDelivery: [ - "POST /app/hook/deliveries/{delivery_id}/attempts" - ], - removeRepoFromInstallation: [ - "DELETE /user/installations/{installation_id}/repositories/{repository_id}", - {}, - { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] } - ], - removeRepoFromInstallationForAuthenticatedUser: [ - "DELETE /user/installations/{installation_id}/repositories/{repository_id}" - ], - resetToken: ["PATCH /applications/{client_id}/token"], - revokeInstallationAccessToken: ["DELETE /installation/token"], - scopeToken: ["POST /applications/{client_id}/token/scoped"], - suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], - unsuspendInstallation: [ - "DELETE /app/installations/{installation_id}/suspended" - ], - updateWebhookConfigForApp: ["PATCH /app/hook/config"] - }, - billing: { - getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], - getGithubActionsBillingUser: [ - "GET /users/{username}/settings/billing/actions" - ], - getGithubBillingPremiumRequestUsageReportOrg: [ - "GET /organizations/{org}/settings/billing/premium_request/usage" - ], - getGithubBillingPremiumRequestUsageReportUser: [ - "GET /users/{username}/settings/billing/premium_request/usage" - ], - getGithubBillingUsageReportOrg: [ - "GET /organizations/{org}/settings/billing/usage" - ], - getGithubBillingUsageReportUser: [ - "GET /users/{username}/settings/billing/usage" - ], - getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], - getGithubPackagesBillingUser: [ - "GET /users/{username}/settings/billing/packages" - ], - getSharedStorageBillingOrg: [ - "GET /orgs/{org}/settings/billing/shared-storage" - ], - getSharedStorageBillingUser: [ - "GET /users/{username}/settings/billing/shared-storage" - ] - }, - campaigns: { - createCampaign: ["POST /orgs/{org}/campaigns"], - deleteCampaign: ["DELETE /orgs/{org}/campaigns/{campaign_number}"], - getCampaignSummary: ["GET /orgs/{org}/campaigns/{campaign_number}"], - listOrgCampaigns: ["GET /orgs/{org}/campaigns"], - updateCampaign: ["PATCH /orgs/{org}/campaigns/{campaign_number}"] - }, - checks: { - create: ["POST /repos/{owner}/{repo}/check-runs"], - createSuite: ["POST /repos/{owner}/{repo}/check-suites"], - get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], - getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], - listAnnotations: [ - "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations" - ], - listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], - listForSuite: [ - "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs" - ], - listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], - rerequestRun: [ - "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest" - ], - rerequestSuite: [ - "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest" - ], - setSuitesPreferences: [ - "PATCH /repos/{owner}/{repo}/check-suites/preferences" - ], - update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] - }, - codeScanning: { - commitAutofix: [ - "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits" - ], - createAutofix: [ - "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix" - ], - createVariantAnalysis: [ - "POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses" - ], - deleteAnalysis: [ - "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}" - ], - deleteCodeqlDatabase: [ - "DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" - ], - getAlert: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", - {}, - { renamedParameters: { alert_id: "alert_number" } } - ], - getAnalysis: [ - "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}" - ], - getAutofix: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix" - ], - getCodeqlDatabase: [ - "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" - ], - getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"], - getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], - getVariantAnalysis: [ - "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}" - ], - getVariantAnalysisRepoTask: [ - "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}" - ], - listAlertInstances: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances" - ], - listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], - listAlertsInstances: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", - {}, - { renamed: ["codeScanning", "listAlertInstances"] } - ], - listCodeqlDatabases: [ - "GET /repos/{owner}/{repo}/code-scanning/codeql/databases" - ], - listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" - ], - updateDefaultSetup: [ - "PATCH /repos/{owner}/{repo}/code-scanning/default-setup" - ], - uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] - }, - codeSecurity: { - attachConfiguration: [ - "POST /orgs/{org}/code-security/configurations/{configuration_id}/attach" - ], - attachEnterpriseConfiguration: [ - "POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach" - ], - createConfiguration: ["POST /orgs/{org}/code-security/configurations"], - createConfigurationForEnterprise: [ - "POST /enterprises/{enterprise}/code-security/configurations" - ], - deleteConfiguration: [ - "DELETE /orgs/{org}/code-security/configurations/{configuration_id}" - ], - deleteConfigurationForEnterprise: [ - "DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}" - ], - detachConfiguration: [ - "DELETE /orgs/{org}/code-security/configurations/detach" - ], - getConfiguration: [ - "GET /orgs/{org}/code-security/configurations/{configuration_id}" - ], - getConfigurationForRepository: [ - "GET /repos/{owner}/{repo}/code-security-configuration" - ], - getConfigurationsForEnterprise: [ - "GET /enterprises/{enterprise}/code-security/configurations" - ], - getConfigurationsForOrg: ["GET /orgs/{org}/code-security/configurations"], - getDefaultConfigurations: [ - "GET /orgs/{org}/code-security/configurations/defaults" - ], - getDefaultConfigurationsForEnterprise: [ - "GET /enterprises/{enterprise}/code-security/configurations/defaults" - ], - getRepositoriesForConfiguration: [ - "GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories" - ], - getRepositoriesForEnterpriseConfiguration: [ - "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories" - ], - getSingleConfigurationForEnterprise: [ - "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}" - ], - setConfigurationAsDefault: [ - "PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults" - ], - setConfigurationAsDefaultForEnterprise: [ - "PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults" - ], - updateConfiguration: [ - "PATCH /orgs/{org}/code-security/configurations/{configuration_id}" - ], - updateEnterpriseConfiguration: [ - "PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}" - ] - }, - codesOfConduct: { - getAllCodesOfConduct: ["GET /codes_of_conduct"], - getConductCode: ["GET /codes_of_conduct/{key}"] - }, - codespaces: { - addRepositoryForSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - checkPermissionsForDevcontainer: [ - "GET /repos/{owner}/{repo}/codespaces/permissions_check" - ], - codespaceMachinesForAuthenticatedUser: [ - "GET /user/codespaces/{codespace_name}/machines" - ], - createForAuthenticatedUser: ["POST /user/codespaces"], - createOrUpdateOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}" - ], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - createOrUpdateSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}" - ], - createWithPrForAuthenticatedUser: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces" - ], - createWithRepoForAuthenticatedUser: [ - "POST /repos/{owner}/{repo}/codespaces" - ], - deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], - deleteFromOrganization: [ - "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - deleteSecretForAuthenticatedUser: [ - "DELETE /user/codespaces/secrets/{secret_name}" - ], - exportForAuthenticatedUser: [ - "POST /user/codespaces/{codespace_name}/exports" - ], - getCodespacesForUserInOrg: [ - "GET /orgs/{org}/members/{username}/codespaces" - ], - getExportDetailsForAuthenticatedUser: [ - "GET /user/codespaces/{codespace_name}/exports/{export_id}" - ], - getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], - getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"], - getPublicKeyForAuthenticatedUser: [ - "GET /user/codespaces/secrets/public-key" - ], - getRepoPublicKey: [ - "GET /repos/{owner}/{repo}/codespaces/secrets/public-key" - ], - getRepoSecret: [ - "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - getSecretForAuthenticatedUser: [ - "GET /user/codespaces/secrets/{secret_name}" - ], - listDevcontainersInRepositoryForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/devcontainers" - ], - listForAuthenticatedUser: ["GET /user/codespaces"], - listInOrganization: [ - "GET /orgs/{org}/codespaces", - {}, - { renamedParameters: { org_id: "org" } } - ], - listInRepositoryForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces" - ], - listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], - listRepositoriesForSecretForAuthenticatedUser: [ - "GET /user/codespaces/secrets/{secret_name}/repositories" - ], - listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories" - ], - preFlightWithRepoForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/new" - ], - publishForAuthenticatedUser: [ - "POST /user/codespaces/{codespace_name}/publish" - ], - removeRepositoryForSecretForAuthenticatedUser: [ - "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - repoMachinesForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/machines" - ], - setRepositoriesForSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}/repositories" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories" - ], - startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], - stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], - stopInOrganization: [ - "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop" - ], - updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] - }, - copilot: { - addCopilotSeatsForTeams: [ - "POST /orgs/{org}/copilot/billing/selected_teams" - ], - addCopilotSeatsForUsers: [ - "POST /orgs/{org}/copilot/billing/selected_users" - ], - cancelCopilotSeatAssignmentForTeams: [ - "DELETE /orgs/{org}/copilot/billing/selected_teams" - ], - cancelCopilotSeatAssignmentForUsers: [ - "DELETE /orgs/{org}/copilot/billing/selected_users" - ], - copilotMetricsForOrganization: ["GET /orgs/{org}/copilot/metrics"], - copilotMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/metrics"], - getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"], - getCopilotSeatDetailsForUser: [ - "GET /orgs/{org}/members/{username}/copilot" - ], - listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] - }, - credentials: { revoke: ["POST /credentials/revoke"] }, - dependabot: { - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" - ], - createOrUpdateOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}" - ], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"], - getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], - getRepoPublicKey: [ - "GET /repos/{owner}/{repo}/dependabot/secrets/public-key" - ], - getRepoSecret: [ - "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - listAlertsForEnterprise: [ - "GET /enterprises/{enterprise}/dependabot/alerts" - ], - listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"], - listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" - ], - repositoryAccessForOrg: [ - "GET /organizations/{org}/dependabot/repository-access" - ], - setRepositoryAccessDefaultLevel: [ - "PUT /organizations/{org}/dependabot/repository-access/default-level" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories" - ], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}" - ], - updateRepositoryAccessForOrg: [ - "PATCH /organizations/{org}/dependabot/repository-access" - ] - }, - dependencyGraph: { - createRepositorySnapshot: [ - "POST /repos/{owner}/{repo}/dependency-graph/snapshots" - ], - diffRange: [ - "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}" - ], - exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"] - }, - emojis: { get: ["GET /emojis"] }, - enterpriseTeamMemberships: { - add: [ - "PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" - ], - bulkAdd: [ - "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add" - ], - bulkRemove: [ - "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove" - ], - get: [ - "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" - ], - list: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"], - remove: [ - "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" - ] - }, - enterpriseTeamOrganizations: { - add: [ - "PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" - ], - bulkAdd: [ - "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add" - ], - bulkRemove: [ - "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove" - ], - delete: [ - "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" - ], - getAssignment: [ - "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" - ], - getAssignments: [ - "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations" - ] - }, - enterpriseTeams: { - create: ["POST /enterprises/{enterprise}/teams"], - delete: ["DELETE /enterprises/{enterprise}/teams/{team_slug}"], - get: ["GET /enterprises/{enterprise}/teams/{team_slug}"], - list: ["GET /enterprises/{enterprise}/teams"], - update: ["PATCH /enterprises/{enterprise}/teams/{team_slug}"] - }, - gists: { - checkIsStarred: ["GET /gists/{gist_id}/star"], - create: ["POST /gists"], - createComment: ["POST /gists/{gist_id}/comments"], - delete: ["DELETE /gists/{gist_id}"], - deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], - fork: ["POST /gists/{gist_id}/forks"], - get: ["GET /gists/{gist_id}"], - getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], - getRevision: ["GET /gists/{gist_id}/{sha}"], - list: ["GET /gists"], - listComments: ["GET /gists/{gist_id}/comments"], - listCommits: ["GET /gists/{gist_id}/commits"], - listForUser: ["GET /users/{username}/gists"], - listForks: ["GET /gists/{gist_id}/forks"], - listPublic: ["GET /gists/public"], - listStarred: ["GET /gists/starred"], - star: ["PUT /gists/{gist_id}/star"], - unstar: ["DELETE /gists/{gist_id}/star"], - update: ["PATCH /gists/{gist_id}"], - updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] - }, - git: { - createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], - createCommit: ["POST /repos/{owner}/{repo}/git/commits"], - createRef: ["POST /repos/{owner}/{repo}/git/refs"], - createTag: ["POST /repos/{owner}/{repo}/git/tags"], - createTree: ["POST /repos/{owner}/{repo}/git/trees"], - deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], - getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], - getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], - getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], - getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], - getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], - listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], - updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] - }, - gitignore: { - getAllTemplates: ["GET /gitignore/templates"], - getTemplate: ["GET /gitignore/templates/{name}"] - }, - hostedCompute: { - createNetworkConfigurationForOrg: [ - "POST /orgs/{org}/settings/network-configurations" - ], - deleteNetworkConfigurationFromOrg: [ - "DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}" - ], - getNetworkConfigurationForOrg: [ - "GET /orgs/{org}/settings/network-configurations/{network_configuration_id}" - ], - getNetworkSettingsForOrg: [ - "GET /orgs/{org}/settings/network-settings/{network_settings_id}" - ], - listNetworkConfigurationsForOrg: [ - "GET /orgs/{org}/settings/network-configurations" - ], - updateNetworkConfigurationForOrg: [ - "PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}" - ] - }, - interactions: { - getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], - getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], - getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], - getRestrictionsForYourPublicRepos: [ - "GET /user/interaction-limits", - {}, - { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] } - ], - removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], - removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], - removeRestrictionsForRepo: [ - "DELETE /repos/{owner}/{repo}/interaction-limits" - ], - removeRestrictionsForYourPublicRepos: [ - "DELETE /user/interaction-limits", - {}, - { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] } - ], - setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], - setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], - setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], - setRestrictionsForYourPublicRepos: [ - "PUT /user/interaction-limits", - {}, - { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] } - ] - }, - issues: { - addAssignees: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees" - ], - addBlockedByDependency: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by" - ], - addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], - addSubIssue: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues" - ], - checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], - checkUserCanBeAssignedToIssue: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}" - ], - create: ["POST /repos/{owner}/{repo}/issues"], - createComment: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/comments" - ], - createLabel: ["POST /repos/{owner}/{repo}/labels"], - createMilestone: ["POST /repos/{owner}/{repo}/milestones"], - deleteComment: [ - "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}" - ], - deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], - deleteMilestone: [ - "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}" - ], - get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], - getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], - getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], - getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], - getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], - getParent: ["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"], - list: ["GET /issues"], - listAssignees: ["GET /repos/{owner}/{repo}/assignees"], - listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], - listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], - listDependenciesBlockedBy: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by" - ], - listDependenciesBlocking: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking" - ], - listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], - listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], - listEventsForTimeline: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline" - ], - listForAuthenticatedUser: ["GET /user/issues"], - listForOrg: ["GET /orgs/{org}/issues"], - listForRepo: ["GET /repos/{owner}/{repo}/issues"], - listLabelsForMilestone: [ - "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels" - ], - listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], - listLabelsOnIssue: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/labels" - ], - listMilestones: ["GET /repos/{owner}/{repo}/milestones"], - listSubIssues: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues" - ], - lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], - removeAllLabels: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels" - ], - removeAssignees: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees" - ], - removeDependencyBlockedBy: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}" - ], - removeLabel: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}" - ], - removeSubIssue: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue" - ], - reprioritizeSubIssue: [ - "PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority" - ], - setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], - unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], - update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], - updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], - updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], - updateMilestone: [ - "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}" - ] - }, - licenses: { - get: ["GET /licenses/{license}"], - getAllCommonlyUsed: ["GET /licenses"], - getForRepo: ["GET /repos/{owner}/{repo}/license"] - }, - markdown: { - render: ["POST /markdown"], - renderRaw: [ - "POST /markdown/raw", - { headers: { "content-type": "text/plain; charset=utf-8" } } - ] - }, - meta: { - get: ["GET /meta"], - getAllVersions: ["GET /versions"], - getOctocat: ["GET /octocat"], - getZen: ["GET /zen"], - root: ["GET /"] - }, - migrations: { - deleteArchiveForAuthenticatedUser: [ - "DELETE /user/migrations/{migration_id}/archive" - ], - deleteArchiveForOrg: [ - "DELETE /orgs/{org}/migrations/{migration_id}/archive" - ], - downloadArchiveForOrg: [ - "GET /orgs/{org}/migrations/{migration_id}/archive" - ], - getArchiveForAuthenticatedUser: [ - "GET /user/migrations/{migration_id}/archive" - ], - getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], - getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], - listForAuthenticatedUser: ["GET /user/migrations"], - listForOrg: ["GET /orgs/{org}/migrations"], - listReposForAuthenticatedUser: [ - "GET /user/migrations/{migration_id}/repositories" - ], - listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], - listReposForUser: [ - "GET /user/migrations/{migration_id}/repositories", - {}, - { renamed: ["migrations", "listReposForAuthenticatedUser"] } - ], - startForAuthenticatedUser: ["POST /user/migrations"], - startForOrg: ["POST /orgs/{org}/migrations"], - unlockRepoForAuthenticatedUser: [ - "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock" - ], - unlockRepoForOrg: [ - "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock" - ] - }, - oidc: { - getOidcCustomSubTemplateForOrg: [ - "GET /orgs/{org}/actions/oidc/customization/sub" - ], - updateOidcCustomSubTemplateForOrg: [ - "PUT /orgs/{org}/actions/oidc/customization/sub" - ] - }, - orgs: { - addSecurityManagerTeam: [ - "PUT /orgs/{org}/security-managers/teams/{team_slug}", - {}, - { - deprecated: "octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team" - } - ], - assignTeamToOrgRole: [ - "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" - ], - assignUserToOrgRole: [ - "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" - ], - blockUser: ["PUT /orgs/{org}/blocks/{username}"], - cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], - checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], - checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], - checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], - convertMemberToOutsideCollaborator: [ - "PUT /orgs/{org}/outside_collaborators/{username}" - ], - createArtifactStorageRecord: [ - "POST /orgs/{org}/artifacts/metadata/storage-record" - ], - createInvitation: ["POST /orgs/{org}/invitations"], - createIssueType: ["POST /orgs/{org}/issue-types"], - createWebhook: ["POST /orgs/{org}/hooks"], - customPropertiesForOrgsCreateOrUpdateOrganizationValues: [ - "PATCH /organizations/{org}/org-properties/values" - ], - customPropertiesForOrgsGetOrganizationValues: [ - "GET /organizations/{org}/org-properties/values" - ], - customPropertiesForReposCreateOrUpdateOrganizationDefinition: [ - "PUT /orgs/{org}/properties/schema/{custom_property_name}" - ], - customPropertiesForReposCreateOrUpdateOrganizationDefinitions: [ - "PATCH /orgs/{org}/properties/schema" - ], - customPropertiesForReposCreateOrUpdateOrganizationValues: [ - "PATCH /orgs/{org}/properties/values" - ], - customPropertiesForReposDeleteOrganizationDefinition: [ - "DELETE /orgs/{org}/properties/schema/{custom_property_name}" - ], - customPropertiesForReposGetOrganizationDefinition: [ - "GET /orgs/{org}/properties/schema/{custom_property_name}" - ], - customPropertiesForReposGetOrganizationDefinitions: [ - "GET /orgs/{org}/properties/schema" - ], - customPropertiesForReposGetOrganizationValues: [ - "GET /orgs/{org}/properties/values" - ], - delete: ["DELETE /orgs/{org}"], - deleteAttestationsBulk: ["POST /orgs/{org}/attestations/delete-request"], - deleteAttestationsById: [ - "DELETE /orgs/{org}/attestations/{attestation_id}" - ], - deleteAttestationsBySubjectDigest: [ - "DELETE /orgs/{org}/attestations/digest/{subject_digest}" - ], - deleteIssueType: ["DELETE /orgs/{org}/issue-types/{issue_type_id}"], - deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], - disableSelectedRepositoryImmutableReleasesOrganization: [ - "DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}" - ], - enableSelectedRepositoryImmutableReleasesOrganization: [ - "PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}" - ], - get: ["GET /orgs/{org}"], - getImmutableReleasesSettings: [ - "GET /orgs/{org}/settings/immutable-releases" - ], - getImmutableReleasesSettingsRepositories: [ - "GET /orgs/{org}/settings/immutable-releases/repositories" - ], - getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], - getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], - getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], - getOrgRulesetHistory: ["GET /orgs/{org}/rulesets/{ruleset_id}/history"], - getOrgRulesetVersion: [ - "GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}" - ], - getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], - getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], - getWebhookDelivery: [ - "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}" - ], - list: ["GET /organizations"], - listAppInstallations: ["GET /orgs/{org}/installations"], - listArtifactStorageRecords: [ - "GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records" - ], - listAttestationRepositories: ["GET /orgs/{org}/attestations/repositories"], - listAttestations: ["GET /orgs/{org}/attestations/{subject_digest}"], - listAttestationsBulk: [ - "POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}" - ], - listBlockedUsers: ["GET /orgs/{org}/blocks"], - listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], - listForAuthenticatedUser: ["GET /user/orgs"], - listForUser: ["GET /users/{username}/orgs"], - listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], - listIssueTypes: ["GET /orgs/{org}/issue-types"], - listMembers: ["GET /orgs/{org}/members"], - listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], - listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], - listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], - listOrgRoles: ["GET /orgs/{org}/organization-roles"], - listOrganizationFineGrainedPermissions: [ - "GET /orgs/{org}/organization-fine-grained-permissions" - ], - listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], - listPatGrantRepositories: [ - "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" - ], - listPatGrantRequestRepositories: [ - "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories" - ], - listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"], - listPatGrants: ["GET /orgs/{org}/personal-access-tokens"], - listPendingInvitations: ["GET /orgs/{org}/invitations"], - listPublicMembers: ["GET /orgs/{org}/public_members"], - listSecurityManagerTeams: [ - "GET /orgs/{org}/security-managers", - {}, - { - deprecated: "octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams" - } - ], - listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], - listWebhooks: ["GET /orgs/{org}/hooks"], - pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: [ - "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" - ], - removeMember: ["DELETE /orgs/{org}/members/{username}"], - removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], - removeOutsideCollaborator: [ - "DELETE /orgs/{org}/outside_collaborators/{username}" - ], - removePublicMembershipForAuthenticatedUser: [ - "DELETE /orgs/{org}/public_members/{username}" - ], - removeSecurityManagerTeam: [ - "DELETE /orgs/{org}/security-managers/teams/{team_slug}", - {}, - { - deprecated: "octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team" - } - ], - reviewPatGrantRequest: [ - "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}" - ], - reviewPatGrantRequestsInBulk: [ - "POST /orgs/{org}/personal-access-token-requests" - ], - revokeAllOrgRolesTeam: [ - "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" - ], - revokeAllOrgRolesUser: [ - "DELETE /orgs/{org}/organization-roles/users/{username}" - ], - revokeOrgRoleTeam: [ - "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" - ], - revokeOrgRoleUser: [ - "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" - ], - setImmutableReleasesSettings: [ - "PUT /orgs/{org}/settings/immutable-releases" - ], - setImmutableReleasesSettingsRepositories: [ - "PUT /orgs/{org}/settings/immutable-releases/repositories" - ], - setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], - setPublicMembershipForAuthenticatedUser: [ - "PUT /orgs/{org}/public_members/{username}" - ], - unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], - update: ["PATCH /orgs/{org}"], - updateIssueType: ["PUT /orgs/{org}/issue-types/{issue_type_id}"], - updateMembershipForAuthenticatedUser: [ - "PATCH /user/memberships/orgs/{org}" - ], - updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"], - updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"], - updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], - updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] - }, - packages: { - deletePackageForAuthenticatedUser: [ - "DELETE /user/packages/{package_type}/{package_name}" - ], - deletePackageForOrg: [ - "DELETE /orgs/{org}/packages/{package_type}/{package_name}" - ], - deletePackageForUser: [ - "DELETE /users/{username}/packages/{package_type}/{package_name}" - ], - deletePackageVersionForAuthenticatedUser: [ - "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - deletePackageVersionForOrg: [ - "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - deletePackageVersionForUser: [ - "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getAllPackageVersionsForAPackageOwnedByAnOrg: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", - {}, - { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] } - ], - getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions", - {}, - { - renamed: [ - "packages", - "getAllPackageVersionsForPackageOwnedByAuthenticatedUser" - ] - } - ], - getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions" - ], - getAllPackageVersionsForPackageOwnedByOrg: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions" - ], - getAllPackageVersionsForPackageOwnedByUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}/versions" - ], - getPackageForAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}" - ], - getPackageForOrganization: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}" - ], - getPackageForUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}" - ], - getPackageVersionForAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getPackageVersionForOrganization: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getPackageVersionForUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - listDockerMigrationConflictingPackagesForAuthenticatedUser: [ - "GET /user/docker/conflicts" - ], - listDockerMigrationConflictingPackagesForOrganization: [ - "GET /orgs/{org}/docker/conflicts" - ], - listDockerMigrationConflictingPackagesForUser: [ - "GET /users/{username}/docker/conflicts" - ], - listPackagesForAuthenticatedUser: ["GET /user/packages"], - listPackagesForOrganization: ["GET /orgs/{org}/packages"], - listPackagesForUser: ["GET /users/{username}/packages"], - restorePackageForAuthenticatedUser: [ - "POST /user/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageForOrg: [ - "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageForUser: [ - "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageVersionForAuthenticatedUser: [ - "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ], - restorePackageVersionForOrg: [ - "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ], - restorePackageVersionForUser: [ - "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ] - }, - privateRegistries: { - createOrgPrivateRegistry: ["POST /orgs/{org}/private-registries"], - deleteOrgPrivateRegistry: [ - "DELETE /orgs/{org}/private-registries/{secret_name}" - ], - getOrgPrivateRegistry: ["GET /orgs/{org}/private-registries/{secret_name}"], - getOrgPublicKey: ["GET /orgs/{org}/private-registries/public-key"], - listOrgPrivateRegistries: ["GET /orgs/{org}/private-registries"], - updateOrgPrivateRegistry: [ - "PATCH /orgs/{org}/private-registries/{secret_name}" - ] - }, - projects: { - addItemForOrg: ["POST /orgs/{org}/projectsV2/{project_number}/items"], - addItemForUser: [ - "POST /users/{username}/projectsV2/{project_number}/items" - ], - deleteItemForOrg: [ - "DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}" - ], - deleteItemForUser: [ - "DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}" - ], - getFieldForOrg: [ - "GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}" - ], - getFieldForUser: [ - "GET /users/{username}/projectsV2/{project_number}/fields/{field_id}" - ], - getForOrg: ["GET /orgs/{org}/projectsV2/{project_number}"], - getForUser: ["GET /users/{username}/projectsV2/{project_number}"], - getOrgItem: ["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"], - getUserItem: [ - "GET /users/{username}/projectsV2/{project_number}/items/{item_id}" - ], - listFieldsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields"], - listFieldsForUser: [ - "GET /users/{username}/projectsV2/{project_number}/fields" - ], - listForOrg: ["GET /orgs/{org}/projectsV2"], - listForUser: ["GET /users/{username}/projectsV2"], - listItemsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/items"], - listItemsForUser: [ - "GET /users/{username}/projectsV2/{project_number}/items" - ], - updateItemForOrg: [ - "PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}" - ], - updateItemForUser: [ - "PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}" - ] - }, - pulls: { - checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - create: ["POST /repos/{owner}/{repo}/pulls"], - createReplyForReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" - ], - createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - createReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments" - ], - deletePendingReview: [ - "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - deleteReviewComment: [ - "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}" - ], - dismissReview: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" - ], - get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], - getReview: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - list: ["GET /repos/{owner}/{repo}/pulls"], - listCommentsForReview: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments" - ], - listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], - listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], - listRequestedReviewers: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - listReviewComments: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments" - ], - listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], - listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - removeRequestedReviewers: [ - "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - requestReviewers: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - submitReview: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" - ], - update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], - updateBranch: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch" - ], - updateReview: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - updateReviewComment: [ - "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}" - ] - }, - rateLimit: { get: ["GET /rate_limit"] }, - reactions: { - createForCommitComment: [ - "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions" - ], - createForIssue: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions" - ], - createForIssueComment: [ - "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - ], - createForPullRequestReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - ], - createForRelease: [ - "POST /repos/{owner}/{repo}/releases/{release_id}/reactions" - ], - createForTeamDiscussionCommentInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - ], - createForTeamDiscussionInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - ], - deleteForCommitComment: [ - "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForIssue: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}" - ], - deleteForIssueComment: [ - "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForPullRequestComment: [ - "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForRelease: [ - "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}" - ], - deleteForTeamDiscussion: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}" - ], - deleteForTeamDiscussionComment: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}" - ], - listForCommitComment: [ - "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions" - ], - listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - listForIssueComment: [ - "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - ], - listForPullRequestReviewComment: [ - "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - ], - listForRelease: [ - "GET /repos/{owner}/{repo}/releases/{release_id}/reactions" - ], - listForTeamDiscussionCommentInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - ], - listForTeamDiscussionInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - ] - }, - repos: { - acceptInvitation: [ - "PATCH /user/repository_invitations/{invitation_id}", - {}, - { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] } - ], - acceptInvitationForAuthenticatedUser: [ - "PATCH /user/repository_invitations/{invitation_id}" - ], - addAppAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], - addStatusCheckContexts: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - addTeamAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - addUserAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - cancelPagesDeployment: [ - "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" - ], - checkAutomatedSecurityFixes: [ - "GET /repos/{owner}/{repo}/automated-security-fixes" - ], - checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], - checkImmutableReleases: ["GET /repos/{owner}/{repo}/immutable-releases"], - checkPrivateVulnerabilityReporting: [ - "GET /repos/{owner}/{repo}/private-vulnerability-reporting" - ], - checkVulnerabilityAlerts: [ - "GET /repos/{owner}/{repo}/vulnerability-alerts" - ], - codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], - compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], - compareCommitsWithBasehead: [ - "GET /repos/{owner}/{repo}/compare/{basehead}" - ], - createAttestation: ["POST /repos/{owner}/{repo}/attestations"], - createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], - createCommitComment: [ - "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments" - ], - createCommitSignatureProtection: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], - createDeployKey: ["POST /repos/{owner}/{repo}/keys"], - createDeployment: ["POST /repos/{owner}/{repo}/deployments"], - createDeploymentBranchPolicy: [ - "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - ], - createDeploymentProtectionRule: [ - "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - ], - createDeploymentStatus: [ - "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - ], - createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], - createForAuthenticatedUser: ["POST /user/repos"], - createFork: ["POST /repos/{owner}/{repo}/forks"], - createInOrg: ["POST /orgs/{org}/repos"], - createOrUpdateEnvironment: [ - "PUT /repos/{owner}/{repo}/environments/{environment_name}" - ], - createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], - createOrgRuleset: ["POST /orgs/{org}/rulesets"], - createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], - createPagesSite: ["POST /repos/{owner}/{repo}/pages"], - createRelease: ["POST /repos/{owner}/{repo}/releases"], - createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], - createUsingTemplate: [ - "POST /repos/{template_owner}/{template_repo}/generate" - ], - createWebhook: ["POST /repos/{owner}/{repo}/hooks"], - customPropertiesForReposCreateOrUpdateRepositoryValues: [ - "PATCH /repos/{owner}/{repo}/properties/values" - ], - customPropertiesForReposGetRepositoryValues: [ - "GET /repos/{owner}/{repo}/properties/values" - ], - declineInvitation: [ - "DELETE /user/repository_invitations/{invitation_id}", - {}, - { renamed: ["repos", "declineInvitationForAuthenticatedUser"] } - ], - declineInvitationForAuthenticatedUser: [ - "DELETE /user/repository_invitations/{invitation_id}" - ], - delete: ["DELETE /repos/{owner}/{repo}"], - deleteAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" - ], - deleteAdminBranchProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - deleteAnEnvironment: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}" - ], - deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], - deleteBranchProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection" - ], - deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], - deleteCommitSignatureProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], - deleteDeployment: [ - "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}" - ], - deleteDeploymentBranchPolicy: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], - deleteInvitation: [ - "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}" - ], - deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"], - deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], - deletePullRequestReviewProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], - deleteReleaseAsset: [ - "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}" - ], - deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], - disableAutomatedSecurityFixes: [ - "DELETE /repos/{owner}/{repo}/automated-security-fixes" - ], - disableDeploymentProtectionRule: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" - ], - disableImmutableReleases: [ - "DELETE /repos/{owner}/{repo}/immutable-releases" - ], - disablePrivateVulnerabilityReporting: [ - "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting" - ], - disableVulnerabilityAlerts: [ - "DELETE /repos/{owner}/{repo}/vulnerability-alerts" - ], - downloadArchive: [ - "GET /repos/{owner}/{repo}/zipball/{ref}", - {}, - { renamed: ["repos", "downloadZipballArchive"] } - ], - downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], - downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], - enableAutomatedSecurityFixes: [ - "PUT /repos/{owner}/{repo}/automated-security-fixes" - ], - enableImmutableReleases: ["PUT /repos/{owner}/{repo}/immutable-releases"], - enablePrivateVulnerabilityReporting: [ - "PUT /repos/{owner}/{repo}/private-vulnerability-reporting" - ], - enableVulnerabilityAlerts: [ - "PUT /repos/{owner}/{repo}/vulnerability-alerts" - ], - generateReleaseNotes: [ - "POST /repos/{owner}/{repo}/releases/generate-notes" - ], - get: ["GET /repos/{owner}/{repo}"], - getAccessRestrictions: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" - ], - getAdminBranchProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - getAllDeploymentProtectionRules: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - ], - getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], - getAllStatusCheckContexts: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - ], - getAllTopics: ["GET /repos/{owner}/{repo}/topics"], - getAppsWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - ], - getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], - getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], - getBranchProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection" - ], - getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"], - getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], - getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], - getCollaboratorPermissionLevel: [ - "GET /repos/{owner}/{repo}/collaborators/{username}/permission" - ], - getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], - getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], - getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], - getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], - getCommitSignatureProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], - getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], - getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], - getCustomDeploymentProtectionRule: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" - ], - getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], - getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], - getDeploymentBranchPolicy: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - getDeploymentStatus: [ - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" - ], - getEnvironment: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}" - ], - getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], - getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], - getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"], - getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"], - getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"], - getOrgRulesets: ["GET /orgs/{org}/rulesets"], - getPages: ["GET /repos/{owner}/{repo}/pages"], - getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], - getPagesDeployment: [ - "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" - ], - getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], - getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], - getPullRequestReviewProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], - getReadme: ["GET /repos/{owner}/{repo}/readme"], - getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], - getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], - getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], - getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], - getRepoRuleSuite: [ - "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" - ], - getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"], - getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - getRepoRulesetHistory: [ - "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history" - ], - getRepoRulesetVersion: [ - "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}" - ], - getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"], - getStatusChecksProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - getTeamsWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - ], - getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], - getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], - getUsersWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - ], - getViews: ["GET /repos/{owner}/{repo}/traffic/views"], - getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], - getWebhookConfigForRepo: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/config" - ], - getWebhookDelivery: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}" - ], - listActivities: ["GET /repos/{owner}/{repo}/activity"], - listAttestations: [ - "GET /repos/{owner}/{repo}/attestations/{subject_digest}" - ], - listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], - listBranches: ["GET /repos/{owner}/{repo}/branches"], - listBranchesForHeadCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head" - ], - listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], - listCommentsForCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments" - ], - listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], - listCommitStatusesForRef: [ - "GET /repos/{owner}/{repo}/commits/{ref}/statuses" - ], - listCommits: ["GET /repos/{owner}/{repo}/commits"], - listContributors: ["GET /repos/{owner}/{repo}/contributors"], - listCustomDeploymentRuleIntegrations: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps" - ], - listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], - listDeploymentBranchPolicies: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - ], - listDeploymentStatuses: [ - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - ], - listDeployments: ["GET /repos/{owner}/{repo}/deployments"], - listForAuthenticatedUser: ["GET /user/repos"], - listForOrg: ["GET /orgs/{org}/repos"], - listForUser: ["GET /users/{username}/repos"], - listForks: ["GET /repos/{owner}/{repo}/forks"], - listInvitations: ["GET /repos/{owner}/{repo}/invitations"], - listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], - listLanguages: ["GET /repos/{owner}/{repo}/languages"], - listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], - listPublic: ["GET /repositories"], - listPullRequestsAssociatedWithCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" - ], - listReleaseAssets: [ - "GET /repos/{owner}/{repo}/releases/{release_id}/assets" - ], - listReleases: ["GET /repos/{owner}/{repo}/releases"], - listTags: ["GET /repos/{owner}/{repo}/tags"], - listTeams: ["GET /repos/{owner}/{repo}/teams"], - listWebhookDeliveries: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries" - ], - listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], - merge: ["POST /repos/{owner}/{repo}/merges"], - mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], - pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: [ - "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" - ], - removeAppAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - removeCollaborator: [ - "DELETE /repos/{owner}/{repo}/collaborators/{username}" - ], - removeStatusCheckContexts: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - removeStatusCheckProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - removeTeamAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - removeUserAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], - replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], - requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], - setAdminBranchProtection: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - setAppAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - setStatusCheckContexts: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - setTeamAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - setUserAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], - transfer: ["POST /repos/{owner}/{repo}/transfer"], - update: ["PATCH /repos/{owner}/{repo}"], - updateBranchProtection: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection" - ], - updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], - updateDeploymentBranchPolicy: [ - "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], - updateInvitation: [ - "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}" - ], - updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"], - updatePullRequestReviewProtection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], - updateReleaseAsset: [ - "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}" - ], - updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - updateStatusCheckPotection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", - {}, - { renamed: ["repos", "updateStatusCheckProtection"] } - ], - updateStatusCheckProtection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], - updateWebhookConfigForRepo: [ - "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config" - ], - uploadReleaseAsset: [ - "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", - { baseUrl: "https://uploads.github.com" } - ] - }, - search: { - code: ["GET /search/code"], - commits: ["GET /search/commits"], - issuesAndPullRequests: ["GET /search/issues"], - labels: ["GET /search/labels"], - repos: ["GET /search/repositories"], - topics: ["GET /search/topics"], - users: ["GET /search/users"] - }, - secretScanning: { - createPushProtectionBypass: [ - "POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses" - ], - getAlert: [ - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - ], - getScanHistory: ["GET /repos/{owner}/{repo}/secret-scanning/scan-history"], - listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], - listLocationsForAlert: [ - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations" - ], - listOrgPatternConfigs: [ - "GET /orgs/{org}/secret-scanning/pattern-configurations" - ], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - ], - updateOrgPatternConfigs: [ - "PATCH /orgs/{org}/secret-scanning/pattern-configurations" - ] - }, - securityAdvisories: { - createFork: [ - "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" - ], - createPrivateVulnerabilityReport: [ - "POST /repos/{owner}/{repo}/security-advisories/reports" - ], - createRepositoryAdvisory: [ - "POST /repos/{owner}/{repo}/security-advisories" - ], - createRepositoryAdvisoryCveRequest: [ - "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve" - ], - getGlobalAdvisory: ["GET /advisories/{ghsa_id}"], - getRepositoryAdvisory: [ - "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}" - ], - listGlobalAdvisories: ["GET /advisories"], - listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"], - listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"], - updateRepositoryAdvisory: [ - "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}" - ] - }, - teams: { - addOrUpdateMembershipForUserInOrg: [ - "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - addOrUpdateRepoPermissionsInOrg: [ - "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - checkPermissionsForRepoInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - create: ["POST /orgs/{org}/teams"], - createDiscussionCommentInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - ], - createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], - deleteDiscussionCommentInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - deleteDiscussionInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], - getByName: ["GET /orgs/{org}/teams/{team_slug}"], - getDiscussionCommentInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - getDiscussionInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - getMembershipForUserInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - list: ["GET /orgs/{org}/teams"], - listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], - listDiscussionCommentsInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - ], - listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], - listForAuthenticatedUser: ["GET /user/teams"], - listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], - listPendingInvitationsInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/invitations" - ], - listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], - removeMembershipForUserInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - removeRepoInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - updateDiscussionCommentInOrg: [ - "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - updateDiscussionInOrg: [ - "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] - }, - users: { - addEmailForAuthenticated: [ - "POST /user/emails", - {}, - { renamed: ["users", "addEmailForAuthenticatedUser"] } - ], - addEmailForAuthenticatedUser: ["POST /user/emails"], - addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"], - block: ["PUT /user/blocks/{username}"], - checkBlocked: ["GET /user/blocks/{username}"], - checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], - checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], - createGpgKeyForAuthenticated: [ - "POST /user/gpg_keys", - {}, - { renamed: ["users", "createGpgKeyForAuthenticatedUser"] } - ], - createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], - createPublicSshKeyForAuthenticated: [ - "POST /user/keys", - {}, - { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] } - ], - createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], - createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"], - deleteAttestationsBulk: [ - "POST /users/{username}/attestations/delete-request" - ], - deleteAttestationsById: [ - "DELETE /users/{username}/attestations/{attestation_id}" - ], - deleteAttestationsBySubjectDigest: [ - "DELETE /users/{username}/attestations/digest/{subject_digest}" - ], - deleteEmailForAuthenticated: [ - "DELETE /user/emails", - {}, - { renamed: ["users", "deleteEmailForAuthenticatedUser"] } - ], - deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], - deleteGpgKeyForAuthenticated: [ - "DELETE /user/gpg_keys/{gpg_key_id}", - {}, - { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] } - ], - deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], - deletePublicSshKeyForAuthenticated: [ - "DELETE /user/keys/{key_id}", - {}, - { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] } - ], - deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], - deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"], - deleteSshSigningKeyForAuthenticatedUser: [ - "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" - ], - follow: ["PUT /user/following/{username}"], - getAuthenticated: ["GET /user"], - getById: ["GET /user/{account_id}"], - getByUsername: ["GET /users/{username}"], - getContextForUser: ["GET /users/{username}/hovercard"], - getGpgKeyForAuthenticated: [ - "GET /user/gpg_keys/{gpg_key_id}", - {}, - { renamed: ["users", "getGpgKeyForAuthenticatedUser"] } - ], - getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], - getPublicSshKeyForAuthenticated: [ - "GET /user/keys/{key_id}", - {}, - { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] } - ], - getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], - getSshSigningKeyForAuthenticatedUser: [ - "GET /user/ssh_signing_keys/{ssh_signing_key_id}" - ], - list: ["GET /users"], - listAttestations: ["GET /users/{username}/attestations/{subject_digest}"], - listAttestationsBulk: [ - "POST /users/{username}/attestations/bulk-list{?per_page,before,after}" - ], - listBlockedByAuthenticated: [ - "GET /user/blocks", - {}, - { renamed: ["users", "listBlockedByAuthenticatedUser"] } - ], - listBlockedByAuthenticatedUser: ["GET /user/blocks"], - listEmailsForAuthenticated: [ - "GET /user/emails", - {}, - { renamed: ["users", "listEmailsForAuthenticatedUser"] } - ], - listEmailsForAuthenticatedUser: ["GET /user/emails"], - listFollowedByAuthenticated: [ - "GET /user/following", - {}, - { renamed: ["users", "listFollowedByAuthenticatedUser"] } - ], - listFollowedByAuthenticatedUser: ["GET /user/following"], - listFollowersForAuthenticatedUser: ["GET /user/followers"], - listFollowersForUser: ["GET /users/{username}/followers"], - listFollowingForUser: ["GET /users/{username}/following"], - listGpgKeysForAuthenticated: [ - "GET /user/gpg_keys", - {}, - { renamed: ["users", "listGpgKeysForAuthenticatedUser"] } - ], - listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], - listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], - listPublicEmailsForAuthenticated: [ - "GET /user/public_emails", - {}, - { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] } - ], - listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], - listPublicKeysForUser: ["GET /users/{username}/keys"], - listPublicSshKeysForAuthenticated: [ - "GET /user/keys", - {}, - { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] } - ], - listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], - listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"], - listSocialAccountsForUser: ["GET /users/{username}/social_accounts"], - listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"], - listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"], - setPrimaryEmailVisibilityForAuthenticated: [ - "PATCH /user/email/visibility", - {}, - { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] } - ], - setPrimaryEmailVisibilityForAuthenticatedUser: [ - "PATCH /user/email/visibility" - ], - unblock: ["DELETE /user/blocks/{username}"], - unfollow: ["DELETE /user/following/{username}"], - updateAuthenticated: ["PATCH /user"] - } - }; - endpoints_default = Endpoints; - } -}); - -// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js -function endpointsToMethods(octokit) { - const newMethods = {}; - for (const scope of endpointMethodsMap.keys()) { - newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler); - } - return newMethods; -} -function decorate(octokit, scope, methodName, defaults3, decorations) { - const requestWithDefaults = octokit.request.defaults(defaults3); - function withDecorations(...args) { - let options = requestWithDefaults.endpoint.merge(...args); - if (decorations.mapToData) { - options = Object.assign({}, options, { - data: options[decorations.mapToData], - [decorations.mapToData]: void 0 - }); - return requestWithDefaults(options); - } - if (decorations.renamed) { - const [newScope, newMethodName] = decorations.renamed; - octokit.log.warn( - `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()` - ); - } - if (decorations.deprecated) { - octokit.log.warn(decorations.deprecated); - } - if (decorations.renamedParameters) { - const options2 = requestWithDefaults.endpoint.merge(...args); - for (const [name, alias] of Object.entries( - decorations.renamedParameters - )) { - if (name in options2) { - octokit.log.warn( - `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead` - ); - if (!(alias in options2)) { - options2[alias] = options2[name]; - } - delete options2[name]; - } - } - return requestWithDefaults(options2); - } - return requestWithDefaults(...args); - } - return Object.assign(withDecorations, requestWithDefaults); -} -var endpointMethodsMap, handler; -var init_endpoints_to_methods = __esm({ - "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { - init_endpoints(); - endpointMethodsMap = /* @__PURE__ */ new Map(); - for (const [scope, endpoints] of Object.entries(endpoints_default)) { - for (const [methodName, endpoint2] of Object.entries(endpoints)) { - const [route, defaults3, decorations] = endpoint2; - const [method, url2] = route.split(/ /); - const endpointDefaults = Object.assign( - { - method, - url: url2 - }, - defaults3 - ); - if (!endpointMethodsMap.has(scope)) { - endpointMethodsMap.set(scope, /* @__PURE__ */ new Map()); - } - endpointMethodsMap.get(scope).set(methodName, { - scope, - methodName, - endpointDefaults, - decorations - }); - } - } - handler = { - has({ scope }, methodName) { - return endpointMethodsMap.get(scope).has(methodName); - }, - getOwnPropertyDescriptor(target, methodName) { - return { - value: this.get(target, methodName), - // ensures method is in the cache - configurable: true, - writable: true, - enumerable: true - }; - }, - defineProperty(target, methodName, descriptor) { - Object.defineProperty(target.cache, methodName, descriptor); - return true; - }, - deleteProperty(target, methodName) { - delete target.cache[methodName]; - return true; - }, - ownKeys({ scope }) { - return [...endpointMethodsMap.get(scope).keys()]; - }, - set(target, methodName, value) { - return target.cache[methodName] = value; - }, - get({ octokit, scope, cache }, methodName) { - if (cache[methodName]) { - return cache[methodName]; - } - const method = endpointMethodsMap.get(scope).get(methodName); - if (!method) { - return void 0; - } - const { endpointDefaults, decorations } = method; - if (decorations) { - cache[methodName] = decorate( - octokit, - scope, - methodName, - endpointDefaults, - decorations - ); - } else { - cache[methodName] = octokit.request.defaults(endpointDefaults); - } - return cache[methodName]; - } - }; - } -}); - -// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js -var dist_src_exports2 = {}; -__export(dist_src_exports2, { - legacyRestEndpointMethods: () => legacyRestEndpointMethods, - restEndpointMethods: () => restEndpointMethods -}); -function restEndpointMethods(octokit) { - const api = endpointsToMethods(octokit); - return { - rest: api - }; -} -function legacyRestEndpointMethods(octokit) { - const api = endpointsToMethods(octokit); - return { - ...api, - rest: api - }; -} -var init_dist_src3 = __esm({ - "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { - init_version2(); - init_endpoints_to_methods(); - restEndpointMethods.VERSION = VERSION5; - legacyRestEndpointMethods.VERSION = VERSION5; - } -}); - -// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js -var dist_bundle_exports = {}; -__export(dist_bundle_exports, { - composePaginateRest: () => composePaginateRest, - isPaginatingEndpoint: () => isPaginatingEndpoint, - paginateRest: () => paginateRest, - paginatingEndpoints: () => paginatingEndpoints -}); -function normalizePaginatedListResponse(response) { - if (!response.data) { - return { - ...response, - data: [] - }; - } - const responseNeedsNormalization = ("total_count" in response.data || "total_commits" in response.data) && !("url" in response.data); - if (!responseNeedsNormalization) return response; - const incompleteResults = response.data.incomplete_results; - const repositorySelection = response.data.repository_selection; - const totalCount = response.data.total_count; - const totalCommits = response.data.total_commits; - delete response.data.incomplete_results; - delete response.data.repository_selection; - delete response.data.total_count; - delete response.data.total_commits; - const namespaceKey = Object.keys(response.data)[0]; - const data = response.data[namespaceKey]; - response.data = data; - if (typeof incompleteResults !== "undefined") { - response.data.incomplete_results = incompleteResults; - } - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; - } - response.data.total_count = totalCount; - response.data.total_commits = totalCommits; - return response; -} -function iterator(octokit, route, parameters) { - const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); - const requestMethod = typeof route === "function" ? route : octokit.request; - const method = options.method; - const headers = options.headers; - let url2 = options.url; - return { - [Symbol.asyncIterator]: () => ({ - async next() { - if (!url2) return { done: true }; - try { - const response = await requestMethod({ method, url: url2, headers }); - const normalizedResponse = normalizePaginatedListResponse(response); - url2 = ((normalizedResponse.headers.link || "").match( - /<([^<>]+)>;\s*rel="next"/ - ) || [])[1]; - if (!url2 && "total_commits" in normalizedResponse.data) { - const parsedUrl = new URL(normalizedResponse.url); - const params = parsedUrl.searchParams; - const page = parseInt(params.get("page") || "1", 10); - const per_page = parseInt(params.get("per_page") || "250", 10); - if (page * per_page < normalizedResponse.data.total_commits) { - params.set("page", String(page + 1)); - url2 = parsedUrl.toString(); - } - } - return { value: normalizedResponse }; - } catch (error3) { - if (error3.status !== 409) throw error3; - url2 = ""; - return { - value: { - status: 200, - headers: {}, - data: [] - } - }; - } - } - }) - }; -} -function paginate(octokit, route, parameters, mapFn) { - if (typeof parameters === "function") { - mapFn = parameters; - parameters = void 0; - } - return gather( - octokit, - [], - iterator(octokit, route, parameters)[Symbol.asyncIterator](), - mapFn - ); -} -function gather(octokit, results, iterator2, mapFn) { - return iterator2.next().then((result) => { - if (result.done) { - return results; - } - let earlyExit = false; - function done() { - earlyExit = true; - } - results = results.concat( - mapFn ? mapFn(result.value, done) : result.value.data - ); - if (earlyExit) { - return results; - } - return gather(octokit, results, iterator2, mapFn); - }); -} -function isPaginatingEndpoint(arg) { - if (typeof arg === "string") { - return paginatingEndpoints.includes(arg); - } else { - return false; - } -} -function paginateRest(octokit) { - return { - paginate: Object.assign(paginate.bind(null, octokit), { - iterator: iterator.bind(null, octokit) - }) - }; -} -var VERSION6, composePaginateRest, paginatingEndpoints; -var init_dist_bundle5 = __esm({ - "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { - VERSION6 = "0.0.0-development"; - composePaginateRest = Object.assign(paginate, { - iterator - }); - paginatingEndpoints = [ - "GET /advisories", - "GET /app/hook/deliveries", - "GET /app/installation-requests", - "GET /app/installations", - "GET /assignments/{assignment_id}/accepted_assignments", - "GET /classrooms", - "GET /classrooms/{classroom_id}/assignments", - "GET /enterprises/{enterprise}/code-security/configurations", - "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories", - "GET /enterprises/{enterprise}/dependabot/alerts", - "GET /enterprises/{enterprise}/teams", - "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships", - "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations", - "GET /events", - "GET /gists", - "GET /gists/public", - "GET /gists/starred", - "GET /gists/{gist_id}/comments", - "GET /gists/{gist_id}/commits", - "GET /gists/{gist_id}/forks", - "GET /installation/repositories", - "GET /issues", - "GET /licenses", - "GET /marketplace_listing/plans", - "GET /marketplace_listing/plans/{plan_id}/accounts", - "GET /marketplace_listing/stubbed/plans", - "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", - "GET /networks/{owner}/{repo}/events", - "GET /notifications", - "GET /organizations", - "GET /organizations/{org}/dependabot/repository-access", - "GET /orgs/{org}/actions/cache/usage-by-repository", - "GET /orgs/{org}/actions/hosted-runners", - "GET /orgs/{org}/actions/permissions/repositories", - "GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories", - "GET /orgs/{org}/actions/runner-groups", - "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners", - "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", - "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", - "GET /orgs/{org}/actions/runners", - "GET /orgs/{org}/actions/secrets", - "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", - "GET /orgs/{org}/actions/variables", - "GET /orgs/{org}/actions/variables/{name}/repositories", - "GET /orgs/{org}/attestations/repositories", - "GET /orgs/{org}/attestations/{subject_digest}", - "GET /orgs/{org}/blocks", - "GET /orgs/{org}/campaigns", - "GET /orgs/{org}/code-scanning/alerts", - "GET /orgs/{org}/code-security/configurations", - "GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories", - "GET /orgs/{org}/codespaces", - "GET /orgs/{org}/codespaces/secrets", - "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories", - "GET /orgs/{org}/copilot/billing/seats", - "GET /orgs/{org}/copilot/metrics", - "GET /orgs/{org}/dependabot/alerts", - "GET /orgs/{org}/dependabot/secrets", - "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", - "GET /orgs/{org}/events", - "GET /orgs/{org}/failed_invitations", - "GET /orgs/{org}/hooks", - "GET /orgs/{org}/hooks/{hook_id}/deliveries", - "GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}", - "GET /orgs/{org}/insights/api/subject-stats", - "GET /orgs/{org}/insights/api/user-stats/{user_id}", - "GET /orgs/{org}/installations", - "GET /orgs/{org}/invitations", - "GET /orgs/{org}/invitations/{invitation_id}/teams", - "GET /orgs/{org}/issues", - "GET /orgs/{org}/members", - "GET /orgs/{org}/members/{username}/codespaces", - "GET /orgs/{org}/migrations", - "GET /orgs/{org}/migrations/{migration_id}/repositories", - "GET /orgs/{org}/organization-roles/{role_id}/teams", - "GET /orgs/{org}/organization-roles/{role_id}/users", - "GET /orgs/{org}/outside_collaborators", - "GET /orgs/{org}/packages", - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", - "GET /orgs/{org}/personal-access-token-requests", - "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories", - "GET /orgs/{org}/personal-access-tokens", - "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories", - "GET /orgs/{org}/private-registries", - "GET /orgs/{org}/projects", - "GET /orgs/{org}/projectsV2", - "GET /orgs/{org}/projectsV2/{project_number}/fields", - "GET /orgs/{org}/projectsV2/{project_number}/items", - "GET /orgs/{org}/properties/values", - "GET /orgs/{org}/public_members", - "GET /orgs/{org}/repos", - "GET /orgs/{org}/rulesets", - "GET /orgs/{org}/rulesets/rule-suites", - "GET /orgs/{org}/rulesets/{ruleset_id}/history", - "GET /orgs/{org}/secret-scanning/alerts", - "GET /orgs/{org}/security-advisories", - "GET /orgs/{org}/settings/immutable-releases/repositories", - "GET /orgs/{org}/settings/network-configurations", - "GET /orgs/{org}/team/{team_slug}/copilot/metrics", - "GET /orgs/{org}/teams", - "GET /orgs/{org}/teams/{team_slug}/discussions", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", - "GET /orgs/{org}/teams/{team_slug}/invitations", - "GET /orgs/{org}/teams/{team_slug}/members", - "GET /orgs/{org}/teams/{team_slug}/projects", - "GET /orgs/{org}/teams/{team_slug}/repos", - "GET /orgs/{org}/teams/{team_slug}/teams", - "GET /projects/{project_id}/collaborators", - "GET /repos/{owner}/{repo}/actions/artifacts", - "GET /repos/{owner}/{repo}/actions/caches", - "GET /repos/{owner}/{repo}/actions/organization-secrets", - "GET /repos/{owner}/{repo}/actions/organization-variables", - "GET /repos/{owner}/{repo}/actions/runners", - "GET /repos/{owner}/{repo}/actions/runs", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", - "GET /repos/{owner}/{repo}/actions/secrets", - "GET /repos/{owner}/{repo}/actions/variables", - "GET /repos/{owner}/{repo}/actions/workflows", - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", - "GET /repos/{owner}/{repo}/activity", - "GET /repos/{owner}/{repo}/assignees", - "GET /repos/{owner}/{repo}/attestations/{subject_digest}", - "GET /repos/{owner}/{repo}/branches", - "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", - "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", - "GET /repos/{owner}/{repo}/code-scanning/alerts", - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", - "GET /repos/{owner}/{repo}/code-scanning/analyses", - "GET /repos/{owner}/{repo}/codespaces", - "GET /repos/{owner}/{repo}/codespaces/devcontainers", - "GET /repos/{owner}/{repo}/codespaces/secrets", - "GET /repos/{owner}/{repo}/collaborators", - "GET /repos/{owner}/{repo}/comments", - "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/commits", - "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", - "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", - "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", - "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", - "GET /repos/{owner}/{repo}/commits/{ref}/status", - "GET /repos/{owner}/{repo}/commits/{ref}/statuses", - "GET /repos/{owner}/{repo}/compare/{basehead}", - "GET /repos/{owner}/{repo}/compare/{base}...{head}", - "GET /repos/{owner}/{repo}/contributors", - "GET /repos/{owner}/{repo}/dependabot/alerts", - "GET /repos/{owner}/{repo}/dependabot/secrets", - "GET /repos/{owner}/{repo}/deployments", - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", - "GET /repos/{owner}/{repo}/environments", - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies", - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps", - "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets", - "GET /repos/{owner}/{repo}/environments/{environment_name}/variables", - "GET /repos/{owner}/{repo}/events", - "GET /repos/{owner}/{repo}/forks", - "GET /repos/{owner}/{repo}/hooks", - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", - "GET /repos/{owner}/{repo}/invitations", - "GET /repos/{owner}/{repo}/issues", - "GET /repos/{owner}/{repo}/issues/comments", - "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/issues/events", - "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", - "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by", - "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking", - "GET /repos/{owner}/{repo}/issues/{issue_number}/events", - "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", - "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", - "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues", - "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", - "GET /repos/{owner}/{repo}/keys", - "GET /repos/{owner}/{repo}/labels", - "GET /repos/{owner}/{repo}/milestones", - "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", - "GET /repos/{owner}/{repo}/notifications", - "GET /repos/{owner}/{repo}/pages/builds", - "GET /repos/{owner}/{repo}/projects", - "GET /repos/{owner}/{repo}/pulls", - "GET /repos/{owner}/{repo}/pulls/comments", - "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", - "GET /repos/{owner}/{repo}/releases", - "GET /repos/{owner}/{repo}/releases/{release_id}/assets", - "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", - "GET /repos/{owner}/{repo}/rules/branches/{branch}", - "GET /repos/{owner}/{repo}/rulesets", - "GET /repos/{owner}/{repo}/rulesets/rule-suites", - "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history", - "GET /repos/{owner}/{repo}/secret-scanning/alerts", - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", - "GET /repos/{owner}/{repo}/security-advisories", - "GET /repos/{owner}/{repo}/stargazers", - "GET /repos/{owner}/{repo}/subscribers", - "GET /repos/{owner}/{repo}/tags", - "GET /repos/{owner}/{repo}/teams", - "GET /repos/{owner}/{repo}/topics", - "GET /repositories", - "GET /search/code", - "GET /search/commits", - "GET /search/issues", - "GET /search/labels", - "GET /search/repositories", - "GET /search/topics", - "GET /search/users", - "GET /teams/{team_id}/discussions", - "GET /teams/{team_id}/discussions/{discussion_number}/comments", - "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", - "GET /teams/{team_id}/discussions/{discussion_number}/reactions", - "GET /teams/{team_id}/invitations", - "GET /teams/{team_id}/members", - "GET /teams/{team_id}/projects", - "GET /teams/{team_id}/repos", - "GET /teams/{team_id}/teams", - "GET /user/blocks", - "GET /user/codespaces", - "GET /user/codespaces/secrets", - "GET /user/emails", - "GET /user/followers", - "GET /user/following", - "GET /user/gpg_keys", - "GET /user/installations", - "GET /user/installations/{installation_id}/repositories", - "GET /user/issues", - "GET /user/keys", - "GET /user/marketplace_purchases", - "GET /user/marketplace_purchases/stubbed", - "GET /user/memberships/orgs", - "GET /user/migrations", - "GET /user/migrations/{migration_id}/repositories", - "GET /user/orgs", - "GET /user/packages", - "GET /user/packages/{package_type}/{package_name}/versions", - "GET /user/public_emails", - "GET /user/repos", - "GET /user/repository_invitations", - "GET /user/social_accounts", - "GET /user/ssh_signing_keys", - "GET /user/starred", - "GET /user/subscriptions", - "GET /user/teams", - "GET /users", - "GET /users/{username}/attestations/{subject_digest}", - "GET /users/{username}/events", - "GET /users/{username}/events/orgs/{org}", - "GET /users/{username}/events/public", - "GET /users/{username}/followers", - "GET /users/{username}/following", - "GET /users/{username}/gists", - "GET /users/{username}/gpg_keys", - "GET /users/{username}/keys", - "GET /users/{username}/orgs", - "GET /users/{username}/packages", - "GET /users/{username}/projects", - "GET /users/{username}/projectsV2", - "GET /users/{username}/projectsV2/{project_number}/fields", - "GET /users/{username}/projectsV2/{project_number}/items", - "GET /users/{username}/received_events", - "GET /users/{username}/received_events/public", - "GET /users/{username}/repos", - "GET /users/{username}/social_accounts", - "GET /users/{username}/ssh_signing_keys", - "GET /users/{username}/starred", - "GET /users/{username}/subscriptions" - ]; - paginateRest.VERSION = VERSION6; - } -}); - -// node_modules/@actions/github/lib/utils.js -var require_utils4 = __commonJS({ - "node_modules/@actions/github/lib/utils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.GitHub = exports2.defaults = exports2.context = void 0; - exports2.getOctokitOptions = getOctokitOptions2; - var Context = __importStar2(require_context()); - var Utils = __importStar2(require_utils3()); - var core_1 = (init_dist_src2(), __toCommonJS(dist_src_exports)); - var plugin_rest_endpoint_methods_1 = (init_dist_src3(), __toCommonJS(dist_src_exports2)); - var plugin_paginate_rest_1 = (init_dist_bundle5(), __toCommonJS(dist_bundle_exports)); - exports2.context = new Context.Context(); - var baseUrl = Utils.getApiBaseUrl(); - exports2.defaults = { - baseUrl, - request: { - agent: Utils.getProxyAgent(baseUrl), - fetch: Utils.getProxyFetch(baseUrl) - } - }; - exports2.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports2.defaults); - function getOctokitOptions2(token, options) { - const opts = Object.assign({}, options || {}); - const auth2 = Utils.getAuthString(token, opts); - if (auth2) { - opts.auth = auth2; - } - return opts; - } - } -}); - -// node_modules/@actions/github/lib/github.js -var require_github = __commonJS({ - "node_modules/@actions/github/lib/github.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.context = void 0; - exports2.getOctokit = getOctokit; - var Context = __importStar2(require_context()); - var utils_1 = require_utils4(); - exports2.context = new Context.Context(); - function getOctokit(token, options, ...additionalPlugins) { - const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins); - return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options)); - } - } -}); - -// node_modules/semver/internal/constants.js -var require_constants6 = __commonJS({ - "node_modules/semver/internal/constants.js"(exports2, module2) { - "use strict"; - var SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; - var RELEASE_TYPES = [ - "major", - "premajor", - "minor", - "preminor", - "patch", - "prepatch", - "prerelease" - ]; - module2.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 1, - FLAG_LOOSE: 2 - }; - } -}); - -// node_modules/semver/internal/debug.js -var require_debug = __commonJS({ - "node_modules/semver/internal/debug.js"(exports2, module2) { - "use strict"; - var debug6 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug6; - } -}); - -// node_modules/semver/internal/re.js -var require_re = __commonJS({ - "node_modules/semver/internal/re.js"(exports2, module2) { - "use strict"; - var { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH - } = require_constants6(); - var debug6 = require_debug(); - exports2 = module2.exports = {}; - var re = exports2.re = []; - var safeRe = exports2.safeRe = []; - var src = exports2.src = []; - var safeSrc = exports2.safeSrc = []; - var t = exports2.t = {}; - var R = 0; - var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; - var safeRegexReplacements = [ - ["\\s", 1], - ["\\d", MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] - ]; - var makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); - } - return value; - }; - var createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value); - const index2 = R++; - debug6(name, index2, value); - t[name] = index2; - src[index2] = value; - safeSrc[index2] = safe; - re[index2] = new RegExp(value, isGlobal ? "g" : void 0); - safeRe[index2] = new RegExp(safe, isGlobal ? "g" : void 0); - }; - createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); - createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); - createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); - createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); - createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); - createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); - createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); - createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); - createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); - createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); - createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); - createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); - createToken("FULL", `^${src[t.FULLPLAIN]}$`); - createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); - createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); - createToken("GTLT", "((?:<|>)?=?)"); - createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); - createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); - createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); - createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); - createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); - createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); - createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); - createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); - createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); - createToken("COERCERTL", src[t.COERCE], true); - createToken("COERCERTLFULL", src[t.COERCEFULL], true); - createToken("LONETILDE", "(?:~>?)"); - createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); - exports2.tildeTrimReplace = "$1~"; - createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); - createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); - createToken("LONECARET", "(?:\\^)"); - createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); - exports2.caretTrimReplace = "$1^"; - createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); - createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); - createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); - createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); - createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); - exports2.comparatorTrimReplace = "$1$2$3"; - createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); - createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); - createToken("STAR", "(<|>)?=?\\s*\\*"); - createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); - createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); - } -}); - -// node_modules/semver/internal/parse-options.js -var require_parse_options = __commonJS({ - "node_modules/semver/internal/parse-options.js"(exports2, module2) { - "use strict"; - var looseOption = Object.freeze({ loose: true }); - var emptyOpts = Object.freeze({}); - var parseOptions = (options) => { - if (!options) { - return emptyOpts; - } - if (typeof options !== "object") { - return looseOption; - } - return options; - }; - module2.exports = parseOptions; - } -}); - -// node_modules/semver/internal/identifiers.js -var require_identifiers = __commonJS({ - "node_modules/semver/internal/identifiers.js"(exports2, module2) { - "use strict"; - var numeric2 = /^[0-9]+$/; - var compareIdentifiers = (a, b) => { - if (typeof a === "number" && typeof b === "number") { - return a === b ? 0 : a < b ? -1 : 1; - } - const anum = numeric2.test(a); - const bnum = numeric2.test(b); - if (anum && bnum) { - a = +a; - b = +b; - } - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; - }; - var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); - module2.exports = { - compareIdentifiers, - rcompareIdentifiers - }; - } -}); - -// node_modules/semver/classes/semver.js -var require_semver = __commonJS({ - "node_modules/semver/classes/semver.js"(exports2, module2) { - "use strict"; - var debug6 = require_debug(); - var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6(); - var { safeRe: re, t } = require_re(); - var parseOptions = require_parse_options(); - var { compareIdentifiers } = require_identifiers(); - var isPrereleaseIdentifier = (prerelease, identifier) => { - const identifiers = identifier.split("."); - if (identifiers.length > prerelease.length) { - return false; - } - for (let i = 0; i < identifiers.length; i++) { - if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) { - return false; - } - } - return true; - }; - var SemVer = class _SemVer { - constructor(version, options) { - options = parseOptions(options); - if (version instanceof _SemVer) { - if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { - return version; - } else { - version = version.version; - } - } else if (typeof version !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); - } - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ); - } - debug6("SemVer", version, options); - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); - if (!m) { - throw new TypeError(`Invalid Version: ${version}`); - } - this.raw = version; - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); - } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); - } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); - } - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split(".").map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - return id; - }); - } - this.build = m[5] ? m[5].split(".") : []; - this.format(); - } - format() { - this.version = `${this.major}.${this.minor}.${this.patch}`; - if (this.prerelease.length) { - this.version += `-${this.prerelease.join(".")}`; - } - return this.version; - } - toString() { - return this.version; - } - compare(other) { - debug6("SemVer.compare", this.version, this.options, other); - if (!(other instanceof _SemVer)) { - if (typeof other === "string" && other === this.version) { - return 0; - } - other = new _SemVer(other, this.options); - } - if (other.version === this.version) { - return 0; - } - return this.compareMain(other) || this.comparePre(other); - } - compareMain(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); - } - if (this.major < other.major) { - return -1; - } - if (this.major > other.major) { - return 1; - } - if (this.minor < other.minor) { - return -1; - } - if (this.minor > other.minor) { - return 1; - } - if (this.patch < other.patch) { - return -1; - } - if (this.patch > other.patch) { - return 1; - } - return 0; - } - comparePre(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); - } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; - } - let i = 0; - do { - const a = this.prerelease[i]; - const b = other.prerelease[i]; - debug6("prerelease compare", i, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); - } - compareBuild(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); - } - let i = 0; - do { - const a = this.build[i]; - const b = other.build[i]; - debug6("build compare", i, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); - } - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc(release2, identifier, identifierBase) { - if (release2.startsWith("pre")) { - if (!identifier && identifierBase === false) { - throw new Error("invalid increment argument: identifier is empty"); - } - if (identifier) { - const match2 = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); - if (!match2 || match2[1] !== identifier) { - throw new Error(`invalid identifier: ${identifier}`); - } - } - } - switch (release2) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier, identifierBase); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier, identifierBase); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier, identifierBase); - this.inc("pre", identifier, identifierBase); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier, identifierBase); - } - this.inc("pre", identifier, identifierBase); - break; - case "release": - if (this.prerelease.length === 0) { - throw new Error(`version ${this.raw} is not a prerelease`); - } - this.prerelease.length = 0; - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case "pre": { - const base = Number(identifierBase) ? 1 : 0; - if (this.prerelease.length === 0) { - this.prerelease = [base]; - } else { - let i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === "number") { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) { - if (identifier === this.prerelease.join(".") && identifierBase === false) { - throw new Error("invalid increment argument: identifier already exists"); - } - this.prerelease.push(base); - } - } - if (identifier) { - let prerelease = [identifier, base]; - if (identifierBase === false) { - prerelease = [identifier]; - } - if (isPrereleaseIdentifier(this.prerelease, identifier)) { - const prereleaseBase = this.prerelease[identifier.split(".").length]; - if (isNaN(prereleaseBase)) { - this.prerelease = prerelease; - } - } else { - this.prerelease = prerelease; - } - } - break; - } - default: - throw new Error(`invalid increment argument: ${release2}`); - } - this.raw = this.format(); - if (this.build.length) { - this.raw += `+${this.build.join(".")}`; - } - return this; - } - }; - module2.exports = SemVer; - } -}); - -// node_modules/semver/functions/parse.js -var require_parse2 = __commonJS({ - "node_modules/semver/functions/parse.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var parse3 = (version, options, throwErrors = false) => { - if (version instanceof SemVer) { - return version; - } - try { - return new SemVer(version, options); - } catch (er) { - if (!throwErrors) { - return null; - } - throw er; - } - }; - module2.exports = parse3; - } -}); - -// node_modules/semver/functions/valid.js -var require_valid = __commonJS({ - "node_modules/semver/functions/valid.js"(exports2, module2) { - "use strict"; - var parse3 = require_parse2(); - var valid4 = (version, options) => { - const v = parse3(version, options); - return v ? v.version : null; - }; - module2.exports = valid4; - } -}); - -// node_modules/semver/functions/clean.js -var require_clean = __commonJS({ - "node_modules/semver/functions/clean.js"(exports2, module2) { - "use strict"; - var parse3 = require_parse2(); - var clean3 = (version, options) => { - const s = parse3(version.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; - }; - module2.exports = clean3; - } -}); - -// node_modules/semver/functions/inc.js -var require_inc = __commonJS({ - "node_modules/semver/functions/inc.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var inc = (version, release2, options, identifier, identifierBase) => { - if (typeof options === "string") { - identifierBase = identifier; - identifier = options; - options = void 0; - } - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release2, identifier, identifierBase).version; - } catch (er) { - return null; - } - }; - module2.exports = inc; - } -}); - -// node_modules/semver/functions/diff.js -var require_diff = __commonJS({ - "node_modules/semver/functions/diff.js"(exports2, module2) { - "use strict"; - var parse3 = require_parse2(); - var diff = (version1, version2) => { - const v1 = parse3(version1, null, true); - const v2 = parse3(version2, null, true); - const comparison = v1.compare(v2); - if (comparison === 0) { - return null; - } - const v1Higher = comparison > 0; - const highVersion = v1Higher ? v1 : v2; - const lowVersion = v1Higher ? v2 : v1; - const highHasPre = !!highVersion.prerelease.length; - const lowHasPre = !!lowVersion.prerelease.length; - if (lowHasPre && !highHasPre) { - if (!lowVersion.patch && !lowVersion.minor) { - return "major"; - } - if (lowVersion.compareMain(highVersion) === 0) { - if (lowVersion.minor && !lowVersion.patch) { - return "minor"; - } - return "patch"; - } - } - const prefix = highHasPre ? "pre" : ""; - if (v1.major !== v2.major) { - return prefix + "major"; - } - if (v1.minor !== v2.minor) { - return prefix + "minor"; - } - if (v1.patch !== v2.patch) { - return prefix + "patch"; - } - return "prerelease"; - }; - module2.exports = diff; - } -}); - -// node_modules/semver/functions/major.js -var require_major = __commonJS({ - "node_modules/semver/functions/major.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var major = (a, loose) => new SemVer(a, loose).major; - module2.exports = major; - } -}); - -// node_modules/semver/functions/minor.js -var require_minor = __commonJS({ - "node_modules/semver/functions/minor.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var minor = (a, loose) => new SemVer(a, loose).minor; - module2.exports = minor; - } -}); - -// node_modules/semver/functions/patch.js -var require_patch = __commonJS({ - "node_modules/semver/functions/patch.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var patch = (a, loose) => new SemVer(a, loose).patch; - module2.exports = patch; - } -}); - -// node_modules/semver/functions/prerelease.js -var require_prerelease = __commonJS({ - "node_modules/semver/functions/prerelease.js"(exports2, module2) { - "use strict"; - var parse3 = require_parse2(); - var prerelease = (version, options) => { - const parsed = parse3(version, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; - }; - module2.exports = prerelease; - } -}); - -// node_modules/semver/functions/compare.js -var require_compare = __commonJS({ - "node_modules/semver/functions/compare.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var compare3 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); - module2.exports = compare3; - } -}); - -// node_modules/semver/functions/rcompare.js -var require_rcompare = __commonJS({ - "node_modules/semver/functions/rcompare.js"(exports2, module2) { - "use strict"; - var compare3 = require_compare(); - var rcompare3 = (a, b, loose) => compare3(b, a, loose); - module2.exports = rcompare3; - } -}); - -// node_modules/semver/functions/compare-loose.js -var require_compare_loose = __commonJS({ - "node_modules/semver/functions/compare-loose.js"(exports2, module2) { - "use strict"; - var compare3 = require_compare(); - var compareLoose = (a, b) => compare3(a, b, true); - module2.exports = compareLoose; - } -}); - -// node_modules/semver/functions/compare-build.js -var require_compare_build = __commonJS({ - "node_modules/semver/functions/compare-build.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose); - const versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); - }; - module2.exports = compareBuild; - } -}); - -// node_modules/semver/functions/sort.js -var require_sort = __commonJS({ - "node_modules/semver/functions/sort.js"(exports2, module2) { - "use strict"; - var compareBuild = require_compare_build(); - var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)); - module2.exports = sort; - } -}); - -// node_modules/semver/functions/rsort.js -var require_rsort = __commonJS({ - "node_modules/semver/functions/rsort.js"(exports2, module2) { - "use strict"; - var compareBuild = require_compare_build(); - var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)); - module2.exports = rsort; - } -}); - -// node_modules/semver/functions/gt.js -var require_gt = __commonJS({ - "node_modules/semver/functions/gt.js"(exports2, module2) { - "use strict"; - var compare3 = require_compare(); - var gt = (a, b, loose) => compare3(a, b, loose) > 0; - module2.exports = gt; - } -}); - -// node_modules/semver/functions/lt.js -var require_lt = __commonJS({ - "node_modules/semver/functions/lt.js"(exports2, module2) { - "use strict"; - var compare3 = require_compare(); - var lt2 = (a, b, loose) => compare3(a, b, loose) < 0; - module2.exports = lt2; - } -}); - -// node_modules/semver/functions/eq.js -var require_eq = __commonJS({ - "node_modules/semver/functions/eq.js"(exports2, module2) { - "use strict"; - var compare3 = require_compare(); - var eq = (a, b, loose) => compare3(a, b, loose) === 0; - module2.exports = eq; - } -}); - -// node_modules/semver/functions/neq.js -var require_neq = __commonJS({ - "node_modules/semver/functions/neq.js"(exports2, module2) { - "use strict"; - var compare3 = require_compare(); - var neq = (a, b, loose) => compare3(a, b, loose) !== 0; - module2.exports = neq; - } -}); - -// node_modules/semver/functions/gte.js -var require_gte = __commonJS({ - "node_modules/semver/functions/gte.js"(exports2, module2) { - "use strict"; - var compare3 = require_compare(); - var gte7 = (a, b, loose) => compare3(a, b, loose) >= 0; - module2.exports = gte7; - } -}); - -// node_modules/semver/functions/lte.js -var require_lte = __commonJS({ - "node_modules/semver/functions/lte.js"(exports2, module2) { - "use strict"; - var compare3 = require_compare(); - var lte2 = (a, b, loose) => compare3(a, b, loose) <= 0; - module2.exports = lte2; - } -}); - -// node_modules/semver/functions/cmp.js -var require_cmp = __commonJS({ - "node_modules/semver/functions/cmp.js"(exports2, module2) { - "use strict"; - var eq = require_eq(); - var neq = require_neq(); - var gt = require_gt(); - var gte7 = require_gte(); - var lt2 = require_lt(); - var lte2 = require_lte(); - var cmp = (a, op, b, loose) => { - switch (op) { - case "===": - if (typeof a === "object") { - a = a.version; - } - if (typeof b === "object") { - b = b.version; - } - return a === b; - case "!==": - if (typeof a === "object") { - a = a.version; - } - if (typeof b === "object") { - b = b.version; - } - return a !== b; - case "": - case "=": - case "==": - return eq(a, b, loose); - case "!=": - return neq(a, b, loose); - case ">": - return gt(a, b, loose); - case ">=": - return gte7(a, b, loose); - case "<": - return lt2(a, b, loose); - case "<=": - return lte2(a, b, loose); - default: - throw new TypeError(`Invalid operator: ${op}`); - } - }; - module2.exports = cmp; - } -}); - -// node_modules/semver/functions/coerce.js -var require_coerce = __commonJS({ - "node_modules/semver/functions/coerce.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var parse3 = require_parse2(); - var { safeRe: re, t } = require_re(); - var coerce3 = (version, options) => { - if (version instanceof SemVer) { - return version; - } - if (typeof version === "number") { - version = String(version); - } - if (typeof version !== "string") { - return null; - } - options = options || {}; - let match2 = null; - if (!options.rtl) { - match2 = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); - } else { - const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; - let next; - while ((next = coerceRtlRegex.exec(version)) && (!match2 || match2.index + match2[0].length !== version.length)) { - if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) { - match2 = next; - } - coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; - } - coerceRtlRegex.lastIndex = -1; - } - if (match2 === null) { - return null; - } - const major = match2[2]; - const minor = match2[3] || "0"; - const patch = match2[4] || "0"; - const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : ""; - const build2 = options.includePrerelease && match2[6] ? `+${match2[6]}` : ""; - return parse3(`${major}.${minor}.${patch}${prerelease}${build2}`, options); - }; - module2.exports = coerce3; - } -}); - -// node_modules/semver/functions/truncate.js -var require_truncate = __commonJS({ - "node_modules/semver/functions/truncate.js"(exports2, module2) { - "use strict"; - var parse3 = require_parse2(); - var constants = require_constants6(); - var SemVer = require_semver(); - var truncate = (version, truncation, options) => { - if (!constants.RELEASE_TYPES.includes(truncation)) { - return null; - } - const clonedVersion = cloneInputVersion(version, options); - return clonedVersion && doTruncation(clonedVersion, truncation); - }; - var cloneInputVersion = (version, options) => { - const versionStringToParse = version instanceof SemVer ? version.version : version; - return parse3(versionStringToParse, options); - }; - var doTruncation = (version, truncation) => { - if (isPrerelease(truncation)) { - return version.version; - } - version.prerelease = []; - switch (truncation) { - case "major": - version.minor = 0; - version.patch = 0; - break; - case "minor": - version.patch = 0; - break; - } - return version.format(); - }; - var isPrerelease = (type) => { - return type.startsWith("pre"); - }; - module2.exports = truncate; - } -}); - -// node_modules/semver/internal/lrucache.js -var require_lrucache = __commonJS({ - "node_modules/semver/internal/lrucache.js"(exports2, module2) { - "use strict"; - var LRUCache = class { - constructor() { - this.max = 1e3; - this.map = /* @__PURE__ */ new Map(); - } - get(key) { - const value = this.map.get(key); - if (value === void 0) { - return void 0; - } else { - this.map.delete(key); - this.map.set(key, value); - return value; - } - } - delete(key) { - return this.map.delete(key); - } - set(key, value) { - const deleted = this.delete(key); - if (!deleted && value !== void 0) { - if (this.map.size >= this.max) { - const firstKey = this.map.keys().next().value; - this.delete(firstKey); - } - this.map.set(key, value); - } - return this; - } - }; - module2.exports = LRUCache; - } -}); - -// node_modules/semver/classes/range.js -var require_range = __commonJS({ - "node_modules/semver/classes/range.js"(exports2, module2) { - "use strict"; - var SPACE_CHARACTERS = /\s+/g; - var Range2 = class _Range { - constructor(range2, options) { - options = parseOptions(options); - if (range2 instanceof _Range) { - if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) { - return range2; - } else { - return new _Range(range2.raw, options); - } - } - if (range2 instanceof Comparator) { - this.raw = range2.value; - this.set = [[range2]]; - this.formatted = void 0; - return this; - } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range2.trim().replace(SPACE_CHARACTERS, " "); - this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`); - } - if (this.set.length > 1) { - const first = this.set[0]; - this.set = this.set.filter((c) => !isNullSet(c[0])); - if (this.set.length === 0) { - this.set = [first]; - } else if (this.set.length > 1) { - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c]; - break; - } - } - } - } - this.formatted = void 0; - } - get range() { - if (this.formatted === void 0) { - this.formatted = ""; - for (let i = 0; i < this.set.length; i++) { - if (i > 0) { - this.formatted += "||"; - } - const comps = this.set[i]; - for (let k = 0; k < comps.length; k++) { - if (k > 0) { - this.formatted += " "; - } - this.formatted += comps[k].toString().trim(); - } - } - } - return this.formatted; - } - format() { - return this.range; - } - toString() { - return this.range; - } - parseRange(range2) { - range2 = range2.replace(BUILDSTRIPRE, ""); - const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); - const memoKey = memoOpts + ":" + range2; - const cached = cache.get(memoKey); - if (cached) { - return cached; - } - const loose = this.options.loose; - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; - range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease)); - debug6("hyphen replace", range2); - range2 = range2.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug6("comparator trim", range2); - range2 = range2.replace(re[t.TILDETRIM], tildeTrimReplace); - debug6("tilde trim", range2); - range2 = range2.replace(re[t.CARETTRIM], caretTrimReplace); - debug6("caret trim", range2); - let rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); - if (loose) { - rangeList = rangeList.filter((comp) => { - debug6("loose invalid filter", comp, this.options); - return !!comp.match(re[t.COMPARATORLOOSE]); - }); - } - debug6("range list", rangeList); - const rangeMap = /* @__PURE__ */ new Map(); - const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp]; - } - rangeMap.set(comp.value, comp); - } - if (rangeMap.size > 1 && rangeMap.has("")) { - rangeMap.delete(""); - } - const result = [...rangeMap.values()]; - cache.set(memoKey, result); - return result; - } - intersects(range2, options) { - if (!(range2 instanceof _Range)) { - throw new TypeError("a Range is required"); - } - return this.set.some((thisComparators) => { - return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => { - return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); - } - // if ANY of the sets match ALL of its comparators, then pass - test(version) { - if (!version) { - return false; - } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } - } - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true; - } - } - return false; - } - }; - module2.exports = Range2; - var LRU = require_lrucache(); - var cache = new LRU(); - var parseOptions = require_parse_options(); - var Comparator = require_comparator(); - var debug6 = require_debug(); - var SemVer = require_semver(); - var { - safeRe: re, - src, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace - } = require_re(); - var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants6(); - var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g"); - var isNullSet = (c) => c.value === "<0.0.0-0"; - var isAny = (c) => c.value === ""; - var isSatisfiable = (comparators, options) => { - let result = true; - const remainingComparators = comparators.slice(); - let testComparator = remainingComparators.pop(); - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); - } - return result; - }; - var parseComparator = (comp, options) => { - comp = comp.replace(re[t.BUILD], ""); - debug6("comp", comp, options); - comp = replaceCarets(comp, options); - debug6("caret", comp); - comp = replaceTildes(comp, options); - debug6("tildes", comp); - comp = replaceXRanges(comp, options); - debug6("xrange", comp); - comp = replaceStars(comp, options); - debug6("stars", comp); - return comp; - }; - var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; - var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p); - var replaceTildes = (comp, options) => { - return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); - }; - var replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; - const z = options.includePrerelease ? "-0" : ""; - return comp.replace(r, (_2, M, m, p, pr) => { - debug6("tilde", comp, _2, M, m, p, pr); - let ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; - } else if (isX(p)) { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; - } else if (pr) { - debug6("replaceTilde pr", pr); - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } else { - ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; - } - debug6("tilde return", ret); - return ret; - }); - }; - var replaceCarets = (comp, options) => { - return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); - }; - var replaceCaret = (comp, options) => { - debug6("caret", comp, options); - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; - const z = options.includePrerelease ? "-0" : ""; - return comp.replace(r, (_2, M, m, p, pr) => { - debug6("caret", comp, _2, M, m, p, pr); - let ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; - } else if (isX(p)) { - if (M === "0") { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; - } - } else if (pr) { - debug6("replaceCaret pr", pr); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } - } else { - ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; - } - } else { - debug6("no pr"); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; - } - } else { - ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; - } - } - debug6("caret return", ret); - return ret; - }); - }; - var replaceXRanges = (comp, options) => { - debug6("replaceXRanges", comp, options); - return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); - }; - var replaceXRange = (comp, options) => { - comp = comp.trim(); - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug6("xRange", comp, ret, gtlt, M, m, p, pr); - if (invalidXRangeOrder(M, m, p)) { - return comp; - } - const xM = isX(M); - const xm = xM || isX(m); - const xp = xm || isX(p); - const anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; - } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m = 0; - } - p = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M = +M + 1; - } else { - m = +m + 1; - } - } - if (gtlt === "<") { - pr = "-0"; - } - ret = `${gtlt + M}.${m}.${p}${pr}`; - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; - } else if (xp) { - ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; - } - debug6("xRange return", ret); - return ret; - }); - }; - var replaceStars = (comp, options) => { - debug6("replaceStars", comp, options); - return comp.trim().replace(re[t.STAR], ""); - }; - var replaceGTE0 = (comp, options) => { - debug6("replaceGTE0", comp, options); - return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); - }; - var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? "-0" : ""}`; - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; - } else if (fpr) { - from = `>=${from}`; - } else { - from = `>=${from}${incPr ? "-0" : ""}`; - } - if (isX(tM)) { - to = ""; - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0`; - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0`; - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}`; - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0`; - } else { - to = `<=${to}`; - } - return `${from} ${to}`.trim(); - }; - var testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false; - } - } - if (version.prerelease.length && !options.includePrerelease) { - for (let i = 0; i < set.length; i++) { - debug6(set[i].semver); - if (set[i].semver === Comparator.ANY) { - continue; - } - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } - } - } - return false; - } - return true; - }; - } -}); - -// node_modules/semver/classes/comparator.js -var require_comparator = __commonJS({ - "node_modules/semver/classes/comparator.js"(exports2, module2) { - "use strict"; - var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); - var Comparator = class _Comparator { - static get ANY() { - return ANY; - } - constructor(comp, options) { - options = parseOptions(options); - if (comp instanceof _Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } - } - comp = comp.trim().split(/\s+/).join(" "); - debug6("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; - } - debug6("comp", this); - } - parse(comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - const m = comp.match(r); - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`); - } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; - } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); - } - } - toString() { - return this.value; - } - test(version) { - debug6("Comparator.test", version, this.options.loose); - if (this.semver === ANY || version === ANY) { - return true; - } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } - } - return cmp(version, this.operator, this.semver, this.options); - } - intersects(comp, options) { - if (!(comp instanceof _Comparator)) { - throw new TypeError("a Comparator is required"); - } - if (this.operator === "") { - if (this.value === "") { - return true; - } - return new Range2(comp.value, options).test(this.value); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; - } - return new Range2(this.value, options).test(comp.semver); - } - options = parseOptions(options); - if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { - return false; - } - if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { - return false; - } - if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { - return true; - } - if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { - return true; - } - if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { - return true; - } - if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { - return true; - } - if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { - return true; - } - return false; - } - }; - module2.exports = Comparator; - var parseOptions = require_parse_options(); - var { safeRe: re, t } = require_re(); - var cmp = require_cmp(); - var debug6 = require_debug(); - var SemVer = require_semver(); - var Range2 = require_range(); - } -}); - -// node_modules/semver/functions/satisfies.js -var require_satisfies = __commonJS({ - "node_modules/semver/functions/satisfies.js"(exports2, module2) { - "use strict"; - var Range2 = require_range(); - var satisfies2 = (version, range2, options) => { - try { - range2 = new Range2(range2, options); - } catch (er) { - return false; - } - return range2.test(version); - }; - module2.exports = satisfies2; - } -}); - -// node_modules/semver/ranges/to-comparators.js -var require_to_comparators = __commonJS({ - "node_modules/semver/ranges/to-comparators.js"(exports2, module2) { - "use strict"; - var Range2 = require_range(); - var toComparators = (range2, options) => new Range2(range2, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")); - module2.exports = toComparators; - } -}); - -// node_modules/semver/ranges/max-satisfying.js -var require_max_satisfying = __commonJS({ - "node_modules/semver/ranges/max-satisfying.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var Range2 = require_range(); - var maxSatisfying = (versions, range2, options) => { - let max = null; - let maxSV = null; - let rangeObj = null; - try { - rangeObj = new Range2(range2, options); - } catch (er) { - return null; - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; - }; - module2.exports = maxSatisfying; - } -}); - -// node_modules/semver/ranges/min-satisfying.js -var require_min_satisfying = __commonJS({ - "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var Range2 = require_range(); - var minSatisfying = (versions, range2, options) => { - let min = null; - let minSV = null; - let rangeObj = null; - try { - rangeObj = new Range2(range2, options); - } catch (er) { - return null; - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; - }; - module2.exports = minSatisfying; - } -}); - -// node_modules/semver/ranges/min-version.js -var require_min_version = __commonJS({ - "node_modules/semver/ranges/min-version.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var Range2 = require_range(); - var gt = require_gt(); - var minVersion = (range2, loose) => { - range2 = new Range2(range2, loose); - let minver = new SemVer("0.0.0"); - if (range2.test(minver)) { - return minver; - } - minver = new SemVer("0.0.0-0"); - if (range2.test(minver)) { - return minver; - } - minver = null; - for (let i = 0; i < range2.set.length; ++i) { - const comparators = range2.set[i]; - let setMin = null; - comparators.forEach((comparator) => { - const compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - compver.raw = compver.format(); - /* fallthrough */ - case "": - case ">=": - if (!setMin || gt(compver, setMin)) { - setMin = compver; - } - break; - case "<": - case "<=": - break; - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`); - } - }); - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin; - } - } - if (minver && range2.test(minver)) { - return minver; - } - return null; - }; - module2.exports = minVersion; - } -}); - -// node_modules/semver/ranges/valid.js -var require_valid2 = __commonJS({ - "node_modules/semver/ranges/valid.js"(exports2, module2) { - "use strict"; - var Range2 = require_range(); - var validRange = (range2, options) => { - try { - return new Range2(range2, options).range || "*"; - } catch (er) { - return null; - } - }; - module2.exports = validRange; - } -}); - -// node_modules/semver/ranges/outside.js -var require_outside = __commonJS({ - "node_modules/semver/ranges/outside.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var Comparator = require_comparator(); - var { ANY } = Comparator; - var Range2 = require_range(); - var satisfies2 = require_satisfies(); - var gt = require_gt(); - var lt2 = require_lt(); - var lte2 = require_lte(); - var gte7 = require_gte(); - var outside = (version, range2, hilo, options) => { - version = new SemVer(version, options); - range2 = new Range2(range2, options); - let gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte2; - ltfn = lt2; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt2; - ltefn = gte7; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - if (satisfies2(version, range2, options)) { - return false; - } - for (let i = 0; i < range2.set.length; ++i) { - const comparators = range2.set[i]; - let high = null; - let low = null; - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); - if (high.operator === comp || high.operator === ecomp) { - return false; - } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; - }; - module2.exports = outside; - } -}); - -// node_modules/semver/ranges/gtr.js -var require_gtr = __commonJS({ - "node_modules/semver/ranges/gtr.js"(exports2, module2) { - "use strict"; - var outside = require_outside(); - var gtr = (version, range2, options) => outside(version, range2, ">", options); - module2.exports = gtr; - } -}); - -// node_modules/semver/ranges/ltr.js -var require_ltr = __commonJS({ - "node_modules/semver/ranges/ltr.js"(exports2, module2) { - "use strict"; - var outside = require_outside(); - var ltr = (version, range2, options) => outside(version, range2, "<", options); - module2.exports = ltr; - } -}); - -// node_modules/semver/ranges/intersects.js -var require_intersects = __commonJS({ - "node_modules/semver/ranges/intersects.js"(exports2, module2) { - "use strict"; - var Range2 = require_range(); - var intersects = (r1, r2, options) => { - r1 = new Range2(r1, options); - r2 = new Range2(r2, options); - return r1.intersects(r2, options); - }; - module2.exports = intersects; - } -}); - -// node_modules/semver/ranges/simplify.js -var require_simplify = __commonJS({ - "node_modules/semver/ranges/simplify.js"(exports2, module2) { - "use strict"; - var satisfies2 = require_satisfies(); - var compare3 = require_compare(); - module2.exports = (versions, range2, options) => { - const set = []; - let first = null; - let prev = null; - const v = versions.sort((a, b) => compare3(a, b, options)); - for (const version of v) { - const included = satisfies2(version, range2, options); - if (included) { - prev = version; - if (!first) { - first = version; - } - } else { - if (prev) { - set.push([first, prev]); - } - prev = null; - first = null; - } - } - if (first) { - set.push([first, null]); - } - const ranges = []; - for (const [min, max] of set) { - if (min === max) { - ranges.push(min); - } else if (!max && min === v[0]) { - ranges.push("*"); - } else if (!max) { - ranges.push(`>=${min}`); - } else if (min === v[0]) { - ranges.push(`<=${max}`); - } else { - ranges.push(`${min} - ${max}`); - } - } - const simplified = ranges.join(" || "); - const original = typeof range2.raw === "string" ? range2.raw : String(range2); - return simplified.length < original.length ? simplified : range2; - }; - } -}); - -// node_modules/semver/ranges/subset.js -var require_subset = __commonJS({ - "node_modules/semver/ranges/subset.js"(exports2, module2) { - "use strict"; - var Range2 = require_range(); - var Comparator = require_comparator(); - var { ANY } = Comparator; - var satisfies2 = require_satisfies(); - var compare3 = require_compare(); - var subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true; - } - sub = new Range2(sub, options); - dom = new Range2(dom, options); - let sawNonNull = false; - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options); - sawNonNull = sawNonNull || isSub !== null; - if (isSub) { - continue OUTER; - } - } - if (sawNonNull) { - return false; - } - } - return true; - }; - var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; - var minimumVersion2 = [new Comparator(">=0.0.0")]; - var simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true; - } - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true; - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease; - } else { - sub = minimumVersion2; - } - } - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true; - } else { - dom = minimumVersion2; - } - } - const eqSet = /* @__PURE__ */ new Set(); - let gt, lt2; - for (const c of sub) { - if (c.operator === ">" || c.operator === ">=") { - gt = higherGT(gt, c, options); - } else if (c.operator === "<" || c.operator === "<=") { - lt2 = lowerLT(lt2, c, options); - } else { - eqSet.add(c.semver); - } - } - if (eqSet.size > 1) { - return null; - } - let gtltComp; - if (gt && lt2) { - gtltComp = compare3(gt.semver, lt2.semver, options); - if (gtltComp > 0) { - return null; - } else if (gtltComp === 0 && (gt.operator !== ">=" || lt2.operator !== "<=")) { - return null; - } - } - for (const eq of eqSet) { - if (gt && !satisfies2(eq, String(gt), options)) { - return null; - } - if (lt2 && !satisfies2(eq, String(lt2), options)) { - return null; - } - for (const c of dom) { - if (!satisfies2(eq, String(c), options)) { - return false; - } - } - return true; - } - let higher, lower; - let hasDomLT, hasDomGT; - let needDomLTPre = lt2 && !options.includePrerelease && lt2.semver.prerelease.length ? lt2.semver : false; - let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt2.operator === "<" && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false; - } - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; - hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false; - } - } - if (c.operator === ">" || c.operator === ">=") { - higher = higherGT(gt, c, options); - if (higher === c && higher !== gt) { - return false; - } - } else if (gt.operator === ">=" && !c.test(gt.semver)) { - return false; - } - } - if (lt2) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false; - } - } - if (c.operator === "<" || c.operator === "<=") { - lower = lowerLT(lt2, c, options); - if (lower === c && lower !== lt2) { - return false; - } - } else if (lt2.operator === "<=" && !c.test(lt2.semver)) { - return false; - } - } - if (!c.operator && (lt2 || gt) && gtltComp !== 0) { - return false; - } - } - if (gt && hasDomLT && !lt2 && gtltComp !== 0) { - return false; - } - if (lt2 && hasDomGT && !gt && gtltComp !== 0) { - return false; - } - if (needDomGTPre || needDomLTPre) { - return false; - } - return true; - }; - var higherGT = (a, b, options) => { - if (!a) { - return b; - } - const comp = compare3(a.semver, b.semver, options); - return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a; - }; - var lowerLT = (a, b, options) => { - if (!a) { - return b; - } - const comp = compare3(a.semver, b.semver, options); - return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a; - }; - module2.exports = subset; - } -}); - -// node_modules/semver/index.js -var require_semver2 = __commonJS({ - "node_modules/semver/index.js"(exports2, module2) { - "use strict"; - var internalRe = require_re(); - var constants = require_constants6(); - var SemVer = require_semver(); - var identifiers = require_identifiers(); - var parse3 = require_parse2(); - var valid4 = require_valid(); - var clean3 = require_clean(); - var inc = require_inc(); - var diff = require_diff(); - var major = require_major(); - var minor = require_minor(); - var patch = require_patch(); - var prerelease = require_prerelease(); - var compare3 = require_compare(); - var rcompare3 = require_rcompare(); - var compareLoose = require_compare_loose(); - var compareBuild = require_compare_build(); - var sort = require_sort(); - var rsort = require_rsort(); - var gt = require_gt(); - var lt2 = require_lt(); - var eq = require_eq(); - var neq = require_neq(); - var gte7 = require_gte(); - var lte2 = require_lte(); - var cmp = require_cmp(); - var coerce3 = require_coerce(); - var truncate = require_truncate(); - var Comparator = require_comparator(); - var Range2 = require_range(); - var satisfies2 = require_satisfies(); - var toComparators = require_to_comparators(); - var maxSatisfying = require_max_satisfying(); - var minSatisfying = require_min_satisfying(); - var minVersion = require_min_version(); - var validRange = require_valid2(); - var outside = require_outside(); - var gtr = require_gtr(); - var ltr = require_ltr(); - var intersects = require_intersects(); - var simplifyRange = require_simplify(); - var subset = require_subset(); - module2.exports = { - parse: parse3, - valid: valid4, - clean: clean3, - inc, - diff, - major, - minor, - patch, - prerelease, - compare: compare3, - rcompare: rcompare3, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt: lt2, - eq, - neq, - gte: gte7, - lte: lte2, - cmp, - coerce: coerce3, - truncate, - Comparator, - Range: Range2, - satisfies: satisfies2, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers - }; - } -}); - -// node_modules/bottleneck/light.js -var require_light = __commonJS({ - "node_modules/bottleneck/light.js"(exports2, module2) { - (function(global2, factory) { - typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.Bottleneck = factory(); - })(exports2, (function() { - "use strict"; - var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; - function getCjsExportFromNamespace(n) { - return n && n["default"] || n; - } - var load2 = function(received, defaults3, onto = {}) { - var k, ref, v; - for (k in defaults3) { - v = defaults3[k]; - onto[k] = (ref = received[k]) != null ? ref : v; - } - return onto; - }; - var overwrite = function(received, defaults3, onto = {}) { - var k, v; - for (k in received) { - v = received[k]; - if (defaults3[k] !== void 0) { - onto[k] = v; - } - } - return onto; - }; - var parser = { - load: load2, - overwrite - }; - var DLList; - DLList = class DLList { - constructor(incr, decr) { - this.incr = incr; - this.decr = decr; - this._first = null; - this._last = null; - this.length = 0; - } - push(value) { - var node; - this.length++; - if (typeof this.incr === "function") { - this.incr(); - } - node = { - value, - prev: this._last, - next: null - }; - if (this._last != null) { - this._last.next = node; - this._last = node; - } else { - this._first = this._last = node; - } - return void 0; - } - shift() { - var value; - if (this._first == null) { - return; - } else { - this.length--; - if (typeof this.decr === "function") { - this.decr(); - } - } - value = this._first.value; - if ((this._first = this._first.next) != null) { - this._first.prev = null; - } else { - this._last = null; - } - return value; - } - first() { - if (this._first != null) { - return this._first.value; - } - } - getArray() { - var node, ref, results; - node = this._first; - results = []; - while (node != null) { - results.push((ref = node, node = node.next, ref.value)); - } - return results; - } - forEachShift(cb) { - var node; - node = this.shift(); - while (node != null) { - cb(node), node = this.shift(); - } - return void 0; - } - debug() { - var node, ref, ref1, ref2, results; - node = this._first; - results = []; - while (node != null) { - results.push((ref = node, node = node.next, { - value: ref.value, - prev: (ref1 = ref.prev) != null ? ref1.value : void 0, - next: (ref2 = ref.next) != null ? ref2.value : void 0 - })); - } - return results; - } - }; - var DLList_1 = DLList; - var Events; - Events = class Events { - constructor(instance) { - this.instance = instance; - this._events = {}; - if (this.instance.on != null || this.instance.once != null || this.instance.removeAllListeners != null) { - throw new Error("An Emitter already exists for this object"); - } - this.instance.on = (name, cb) => { - return this._addListener(name, "many", cb); - }; - this.instance.once = (name, cb) => { - return this._addListener(name, "once", cb); - }; - this.instance.removeAllListeners = (name = null) => { - if (name != null) { - return delete this._events[name]; - } else { - return this._events = {}; - } - }; - } - _addListener(name, status, cb) { - var base; - if ((base = this._events)[name] == null) { - base[name] = []; - } - this._events[name].push({ cb, status }); - return this.instance; - } - listenerCount(name) { - if (this._events[name] != null) { - return this._events[name].length; - } else { - return 0; - } - } - async trigger(name, ...args) { - var e, promises6; - try { - if (name !== "debug") { - this.trigger("debug", `Event triggered: ${name}`, args); - } - if (this._events[name] == null) { - return; - } - this._events[name] = this._events[name].filter(function(listener) { - return listener.status !== "none"; - }); - promises6 = this._events[name].map(async (listener) => { - var e2, returned; - if (listener.status === "none") { - return; - } - if (listener.status === "once") { - listener.status = "none"; - } - try { - returned = typeof listener.cb === "function" ? listener.cb(...args) : void 0; - if (typeof (returned != null ? returned.then : void 0) === "function") { - return await returned; - } else { - return returned; - } - } catch (error3) { - e2 = error3; - { - this.trigger("error", e2); - } - return null; - } - }); - return (await Promise.all(promises6)).find(function(x) { - return x != null; - }); - } catch (error3) { - e = error3; - { - this.trigger("error", e); - } - return null; - } - } - }; - var Events_1 = Events; - var DLList$1, Events$1, Queues; - DLList$1 = DLList_1; - Events$1 = Events_1; - Queues = class Queues { - constructor(num_priorities) { - var i; - this.Events = new Events$1(this); - this._length = 0; - this._lists = (function() { - var j, ref, results; - results = []; - for (i = j = 1, ref = num_priorities; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) { - results.push(new DLList$1((() => { - return this.incr(); - }), (() => { - return this.decr(); - }))); - } - return results; - }).call(this); - } - incr() { - if (this._length++ === 0) { - return this.Events.trigger("leftzero"); - } - } - decr() { - if (--this._length === 0) { - return this.Events.trigger("zero"); - } - } - push(job) { - return this._lists[job.options.priority].push(job); - } - queued(priority) { - if (priority != null) { - return this._lists[priority].length; - } else { - return this._length; - } - } - shiftAll(fn) { - return this._lists.forEach(function(list) { - return list.forEachShift(fn); - }); - } - getFirst(arr = this._lists) { - var j, len, list; - for (j = 0, len = arr.length; j < len; j++) { - list = arr[j]; - if (list.length > 0) { - return list; - } - } - return []; - } - shiftLastFrom(priority) { - return this.getFirst(this._lists.slice(priority).reverse()).shift(); - } - }; - var Queues_1 = Queues; - var BottleneckError; - BottleneckError = class BottleneckError extends Error { - }; - var BottleneckError_1 = BottleneckError; - var BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1; - NUM_PRIORITIES = 10; - DEFAULT_PRIORITY = 5; - parser$1 = parser; - BottleneckError$1 = BottleneckError_1; - Job = class Job { - constructor(task, args, options, jobDefaults, rejectOnDrop, Events2, _states, Promise2) { - this.task = task; - this.args = args; - this.rejectOnDrop = rejectOnDrop; - this.Events = Events2; - this._states = _states; - this.Promise = Promise2; - this.options = parser$1.load(options, jobDefaults); - this.options.priority = this._sanitizePriority(this.options.priority); - if (this.options.id === jobDefaults.id) { - this.options.id = `${this.options.id}-${this._randomIndex()}`; - } - this.promise = new this.Promise((_resolve, _reject) => { - this._resolve = _resolve; - this._reject = _reject; - }); - this.retryCount = 0; - } - _sanitizePriority(priority) { - var sProperty; - sProperty = ~~priority !== priority ? DEFAULT_PRIORITY : priority; - if (sProperty < 0) { - return 0; - } else if (sProperty > NUM_PRIORITIES - 1) { - return NUM_PRIORITIES - 1; - } else { - return sProperty; - } - } - _randomIndex() { - return Math.random().toString(36).slice(2); - } - doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { - if (this._states.remove(this.options.id)) { - if (this.rejectOnDrop) { - this._reject(error3 != null ? error3 : new BottleneckError$1(message)); - } - this.Events.trigger("dropped", { args: this.args, options: this.options, task: this.task, promise: this.promise }); - return true; - } else { - return false; - } - } - _assertStatus(expected) { - var status; - status = this._states.jobStatus(this.options.id); - if (!(status === expected || expected === "DONE" && status === null)) { - throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`); - } - } - doReceive() { - this._states.start(this.options.id); - return this.Events.trigger("received", { args: this.args, options: this.options }); - } - doQueue(reachedHWM, blocked) { - this._assertStatus("RECEIVED"); - this._states.next(this.options.id); - return this.Events.trigger("queued", { args: this.args, options: this.options, reachedHWM, blocked }); - } - doRun() { - if (this.retryCount === 0) { - this._assertStatus("QUEUED"); - this._states.next(this.options.id); - } else { - this._assertStatus("EXECUTING"); - } - return this.Events.trigger("scheduled", { args: this.args, options: this.options }); - } - async doExecute(chained, clearGlobalState, run9, free) { - var error3, eventInfo, passed; - if (this.retryCount === 0) { - this._assertStatus("RUNNING"); - this._states.next(this.options.id); - } else { - this._assertStatus("EXECUTING"); - } - eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount }; - this.Events.trigger("executing", eventInfo); - try { - passed = await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args)); - if (clearGlobalState()) { - this.doDone(eventInfo); - await free(this.options, eventInfo); - this._assertStatus("DONE"); - return this._resolve(passed); - } - } catch (error1) { - error3 = error1; - return this._onFailure(error3, eventInfo, clearGlobalState, run9, free); - } - } - doExpire(clearGlobalState, run9, free) { - var error3, eventInfo; - if (this._states.jobStatus(this.options.id === "RUNNING")) { - this._states.next(this.options.id); - } - this._assertStatus("EXECUTING"); - eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount }; - error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error3, eventInfo, clearGlobalState, run9, free); - } - async _onFailure(error3, eventInfo, clearGlobalState, run9, free) { - var retry2, retryAfter; - if (clearGlobalState()) { - retry2 = await this.Events.trigger("failed", error3, eventInfo); - if (retry2 != null) { - retryAfter = ~~retry2; - this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); - this.retryCount++; - return run9(retryAfter); - } else { - this.doDone(eventInfo); - await free(this.options, eventInfo); - this._assertStatus("DONE"); - return this._reject(error3); - } - } - } - doDone(eventInfo) { - this._assertStatus("EXECUTING"); - this._states.next(this.options.id); - return this.Events.trigger("done", eventInfo); - } - }; - var Job_1 = Job; - var BottleneckError$2, LocalDatastore, parser$2; - parser$2 = parser; - BottleneckError$2 = BottleneckError_1; - LocalDatastore = class LocalDatastore { - constructor(instance, storeOptions, storeInstanceOptions) { - this.instance = instance; - this.storeOptions = storeOptions; - this.clientId = this.instance._randomIndex(); - parser$2.load(storeInstanceOptions, storeInstanceOptions, this); - this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now(); - this._running = 0; - this._done = 0; - this._unblockTime = 0; - this.ready = this.Promise.resolve(); - this.clients = {}; - this._startHeartbeat(); - } - _startHeartbeat() { - var base; - if (this.heartbeat == null && (this.storeOptions.reservoirRefreshInterval != null && this.storeOptions.reservoirRefreshAmount != null || this.storeOptions.reservoirIncreaseInterval != null && this.storeOptions.reservoirIncreaseAmount != null)) { - return typeof (base = this.heartbeat = setInterval(() => { - var amount, incr, maximum, now, reservoir; - now = Date.now(); - if (this.storeOptions.reservoirRefreshInterval != null && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) { - this._lastReservoirRefresh = now; - this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount; - this.instance._drainAll(this.computeCapacity()); - } - if (this.storeOptions.reservoirIncreaseInterval != null && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) { - ({ - reservoirIncreaseAmount: amount, - reservoirIncreaseMaximum: maximum, - reservoir - } = this.storeOptions); - this._lastReservoirIncrease = now; - incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount; - if (incr > 0) { - this.storeOptions.reservoir += incr; - return this.instance._drainAll(this.computeCapacity()); - } - } - }, this.heartbeatInterval)).unref === "function" ? base.unref() : void 0; - } else { - return clearInterval(this.heartbeat); - } - } - async __publish__(message) { - await this.yieldLoop(); - return this.instance.Events.trigger("message", message.toString()); - } - async __disconnect__(flush) { - await this.yieldLoop(); - clearInterval(this.heartbeat); - return this.Promise.resolve(); - } - yieldLoop(t = 0) { - return new this.Promise(function(resolve14, reject) { - return setTimeout(resolve14, t); - }); - } - computePenalty() { - var ref; - return (ref = this.storeOptions.penalty) != null ? ref : 15 * this.storeOptions.minTime || 5e3; - } - async __updateSettings__(options) { - await this.yieldLoop(); - parser$2.overwrite(options, options, this.storeOptions); - this._startHeartbeat(); - this.instance._drainAll(this.computeCapacity()); - return true; - } - async __running__() { - await this.yieldLoop(); - return this._running; - } - async __queued__() { - await this.yieldLoop(); - return this.instance.queued(); - } - async __done__() { - await this.yieldLoop(); - return this._done; - } - async __groupCheck__(time) { - await this.yieldLoop(); - return this._nextRequest + this.timeout < time; - } - computeCapacity() { - var maxConcurrent, reservoir; - ({ maxConcurrent, reservoir } = this.storeOptions); - if (maxConcurrent != null && reservoir != null) { - return Math.min(maxConcurrent - this._running, reservoir); - } else if (maxConcurrent != null) { - return maxConcurrent - this._running; - } else if (reservoir != null) { - return reservoir; - } else { - return null; - } - } - conditionsCheck(weight) { - var capacity; - capacity = this.computeCapacity(); - return capacity == null || weight <= capacity; - } - async __incrementReservoir__(incr) { - var reservoir; - await this.yieldLoop(); - reservoir = this.storeOptions.reservoir += incr; - this.instance._drainAll(this.computeCapacity()); - return reservoir; - } - async __currentReservoir__() { - await this.yieldLoop(); - return this.storeOptions.reservoir; - } - isBlocked(now) { - return this._unblockTime >= now; - } - check(weight, now) { - return this.conditionsCheck(weight) && this._nextRequest - now <= 0; - } - async __check__(weight) { - var now; - await this.yieldLoop(); - now = Date.now(); - return this.check(weight, now); - } - async __register__(index2, weight, expiration) { - var now, wait; - await this.yieldLoop(); - now = Date.now(); - if (this.conditionsCheck(weight)) { - this._running += weight; - if (this.storeOptions.reservoir != null) { - this.storeOptions.reservoir -= weight; - } - wait = Math.max(this._nextRequest - now, 0); - this._nextRequest = now + wait + this.storeOptions.minTime; - return { - success: true, - wait, - reservoir: this.storeOptions.reservoir - }; - } else { - return { - success: false - }; - } - } - strategyIsBlock() { - return this.storeOptions.strategy === 3; - } - async __submit__(queueLength, weight) { - var blocked, now, reachedHWM; - await this.yieldLoop(); - if (this.storeOptions.maxConcurrent != null && weight > this.storeOptions.maxConcurrent) { - throw new BottleneckError$2(`Impossible to add a job having a weight of ${weight} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`); - } - now = Date.now(); - reachedHWM = this.storeOptions.highWater != null && queueLength === this.storeOptions.highWater && !this.check(weight, now); - blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now)); - if (blocked) { - this._unblockTime = now + this.computePenalty(); - this._nextRequest = this._unblockTime + this.storeOptions.minTime; - this.instance._dropAllQueued(); - } - return { - reachedHWM, - blocked, - strategy: this.storeOptions.strategy - }; - } - async __free__(index2, weight) { - await this.yieldLoop(); - this._running -= weight; - this._done += weight; - this.instance._drainAll(this.computeCapacity()); - return { - running: this._running - }; - } - }; - var LocalDatastore_1 = LocalDatastore; - var BottleneckError$3, States; - BottleneckError$3 = BottleneckError_1; - States = class States { - constructor(status1) { - this.status = status1; - this._jobs = {}; - this.counts = this.status.map(function() { - return 0; - }); - } - next(id) { - var current, next; - current = this._jobs[id]; - next = current + 1; - if (current != null && next < this.status.length) { - this.counts[current]--; - this.counts[next]++; - return this._jobs[id]++; - } else if (current != null) { - this.counts[current]--; - return delete this._jobs[id]; - } - } - start(id) { - var initial; - initial = 0; - this._jobs[id] = initial; - return this.counts[initial]++; - } - remove(id) { - var current; - current = this._jobs[id]; - if (current != null) { - this.counts[current]--; - delete this._jobs[id]; - } - return current != null; - } - jobStatus(id) { - var ref; - return (ref = this.status[this._jobs[id]]) != null ? ref : null; - } - statusJobs(status) { - var k, pos, ref, results, v; - if (status != null) { - pos = this.status.indexOf(status); - if (pos < 0) { - throw new BottleneckError$3(`status must be one of ${this.status.join(", ")}`); - } - ref = this._jobs; - results = []; - for (k in ref) { - v = ref[k]; - if (v === pos) { - results.push(k); - } - } - return results; - } else { - return Object.keys(this._jobs); - } - } - statusCounts() { - return this.counts.reduce(((acc, v, i) => { - acc[this.status[i]] = v; - return acc; - }), {}); - } - }; - var States_1 = States; - var DLList$2, Sync; - DLList$2 = DLList_1; - Sync = class Sync { - constructor(name, Promise2) { - this.schedule = this.schedule.bind(this); - this.name = name; - this.Promise = Promise2; - this._running = 0; - this._queue = new DLList$2(); - } - isEmpty() { - return this._queue.length === 0; - } - async _tryToRun() { - var args, cb, error3, reject, resolve14, returned, task; - if (this._running < 1 && this._queue.length > 0) { - this._running++; - ({ task, args, resolve: resolve14, reject } = this._queue.shift()); - cb = await (async function() { - try { - returned = await task(...args); - return function() { - return resolve14(returned); - }; - } catch (error1) { - error3 = error1; - return function() { - return reject(error3); - }; - } - })(); - this._running--; - this._tryToRun(); - return cb(); - } - } - schedule(task, ...args) { - var promise, reject, resolve14; - resolve14 = reject = null; - promise = new this.Promise(function(_resolve, _reject) { - resolve14 = _resolve; - return reject = _reject; - }); - this._queue.push({ task, args, resolve: resolve14, reject }); - this._tryToRun(); - return promise; - } - }; - var Sync_1 = Sync; - var version = "2.19.5"; - var version$1 = { - version - }; - var version$2 = /* @__PURE__ */ Object.freeze({ - version, - default: version$1 - }); - var require$$2 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); - var require$$3 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); - var require$$4 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); - var Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3; - parser$3 = parser; - Events$2 = Events_1; - RedisConnection$1 = require$$2; - IORedisConnection$1 = require$$3; - Scripts$1 = require$$4; - Group = (function() { - class Group2 { - constructor(limiterOptions = {}) { - this.deleteKey = this.deleteKey.bind(this); - this.limiterOptions = limiterOptions; - parser$3.load(this.limiterOptions, this.defaults, this); - this.Events = new Events$2(this); - this.instances = {}; - this.Bottleneck = Bottleneck_1; - this._startAutoCleanup(); - this.sharedConnection = this.connection != null; - if (this.connection == null) { - if (this.limiterOptions.datastore === "redis") { - this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, { Events: this.Events })); - } else if (this.limiterOptions.datastore === "ioredis") { - this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, { Events: this.Events })); - } - } - } - key(key = "") { - var ref; - return (ref = this.instances[key]) != null ? ref : (() => { - var limiter; - limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, { - id: `${this.id}-${key}`, - timeout: this.timeout, - connection: this.connection - })); - this.Events.trigger("created", limiter, key); - return limiter; - })(); - } - async deleteKey(key = "") { - var deleted, instance; - instance = this.instances[key]; - if (this.connection) { - deleted = await this.connection.__runCommand__(["del", ...Scripts$1.allKeys(`${this.id}-${key}`)]); - } - if (instance != null) { - delete this.instances[key]; - await instance.disconnect(); - } - return instance != null || deleted > 0; - } - limiters() { - var k, ref, results, v; - ref = this.instances; - results = []; - for (k in ref) { - v = ref[k]; - results.push({ - key: k, - limiter: v - }); - } - return results; - } - keys() { - return Object.keys(this.instances); - } - async clusterKeys() { - var cursor, end, found, i, k, keys, len, next, start; - if (this.connection == null) { - return this.Promise.resolve(this.keys()); - } - keys = []; - cursor = null; - start = `b_${this.id}-`.length; - end = "_settings".length; - while (cursor !== 0) { - [next, found] = await this.connection.__runCommand__(["scan", cursor != null ? cursor : 0, "match", `b_${this.id}-*_settings`, "count", 1e4]); - cursor = ~~next; - for (i = 0, len = found.length; i < len; i++) { - k = found[i]; - keys.push(k.slice(start, -end)); - } - } - return keys; - } - _startAutoCleanup() { - var base; - clearInterval(this.interval); - return typeof (base = this.interval = setInterval(async () => { - var e, k, ref, results, time, v; - time = Date.now(); - ref = this.instances; - results = []; - for (k in ref) { - v = ref[k]; - try { - if (await v._store.__groupCheck__(time)) { - results.push(this.deleteKey(k)); - } else { - results.push(void 0); - } - } catch (error3) { - e = error3; - results.push(v.Events.trigger("error", e)); - } - } - return results; - }, this.timeout / 2)).unref === "function" ? base.unref() : void 0; - } - updateSettings(options = {}) { - parser$3.overwrite(options, this.defaults, this); - parser$3.overwrite(options, options, this.limiterOptions); - if (options.timeout != null) { - return this._startAutoCleanup(); - } - } - disconnect(flush = true) { - var ref; - if (!this.sharedConnection) { - return (ref = this.connection) != null ? ref.disconnect(flush) : void 0; - } - } - } - Group2.prototype.defaults = { - timeout: 1e3 * 60 * 5, - connection: null, - Promise, - id: "group-key" - }; - return Group2; - }).call(commonjsGlobal); - var Group_1 = Group; - var Batcher, Events$3, parser$4; - parser$4 = parser; - Events$3 = Events_1; - Batcher = (function() { - class Batcher2 { - constructor(options = {}) { - this.options = options; - parser$4.load(this.options, this.defaults, this); - this.Events = new Events$3(this); - this._arr = []; - this._resetPromise(); - this._lastFlush = Date.now(); - } - _resetPromise() { - return this._promise = new this.Promise((res, rej) => { - return this._resolve = res; - }); - } - _flush() { - clearTimeout(this._timeout); - this._lastFlush = Date.now(); - this._resolve(); - this.Events.trigger("batch", this._arr); - this._arr = []; - return this._resetPromise(); - } - add(data) { - var ret; - this._arr.push(data); - ret = this._promise; - if (this._arr.length === this.maxSize) { - this._flush(); - } else if (this.maxTime != null && this._arr.length === 1) { - this._timeout = setTimeout(() => { - return this._flush(); - }, this.maxTime); - } - return ret; - } - } - Batcher2.prototype.defaults = { - maxTime: null, - maxSize: null, - Promise - }; - return Batcher2; - }).call(commonjsGlobal); - var Batcher_1 = Batcher; - var require$$4$1 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); - var require$$8 = getCjsExportFromNamespace(version$2); - var Bottleneck2, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, splice = [].splice; - NUM_PRIORITIES$1 = 10; - DEFAULT_PRIORITY$1 = 5; - parser$5 = parser; - Queues$1 = Queues_1; - Job$1 = Job_1; - LocalDatastore$1 = LocalDatastore_1; - RedisDatastore$1 = require$$4$1; - Events$4 = Events_1; - States$1 = States_1; - Sync$1 = Sync_1; - Bottleneck2 = (function() { - class Bottleneck3 { - constructor(options = {}, ...invalid) { - var storeInstanceOptions, storeOptions; - this._addToQueue = this._addToQueue.bind(this); - this._validateOptions(options, invalid); - parser$5.load(options, this.instanceDefaults, this); - this._queues = new Queues$1(NUM_PRIORITIES$1); - this._scheduled = {}; - this._states = new States$1(["RECEIVED", "QUEUED", "RUNNING", "EXECUTING"].concat(this.trackDoneStatus ? ["DONE"] : [])); - this._limiter = null; - this.Events = new Events$4(this); - this._submitLock = new Sync$1("submit", this.Promise); - this._registerLock = new Sync$1("register", this.Promise); - storeOptions = parser$5.load(options, this.storeDefaults, {}); - this._store = (function() { - if (this.datastore === "redis" || this.datastore === "ioredis" || this.connection != null) { - storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {}); - return new RedisDatastore$1(this, storeOptions, storeInstanceOptions); - } else if (this.datastore === "local") { - storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {}); - return new LocalDatastore$1(this, storeOptions, storeInstanceOptions); - } else { - throw new Bottleneck3.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`); - } - }).call(this); - this._queues.on("leftzero", () => { - var ref; - return (ref = this._store.heartbeat) != null ? typeof ref.ref === "function" ? ref.ref() : void 0 : void 0; - }); - this._queues.on("zero", () => { - var ref; - return (ref = this._store.heartbeat) != null ? typeof ref.unref === "function" ? ref.unref() : void 0 : void 0; - }); - } - _validateOptions(options, invalid) { - if (!(options != null && typeof options === "object" && invalid.length === 0)) { - throw new Bottleneck3.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1."); - } - } - ready() { - return this._store.ready; - } - clients() { - return this._store.clients; - } - channel() { - return `b_${this.id}`; - } - channel_client() { - return `b_${this.id}_${this._store.clientId}`; - } - publish(message) { - return this._store.__publish__(message); - } - disconnect(flush = true) { - return this._store.__disconnect__(flush); - } - chain(_limiter) { - this._limiter = _limiter; - return this; - } - queued(priority) { - return this._queues.queued(priority); - } - clusterQueued() { - return this._store.__queued__(); - } - empty() { - return this.queued() === 0 && this._submitLock.isEmpty(); - } - running() { - return this._store.__running__(); - } - done() { - return this._store.__done__(); - } - jobStatus(id) { - return this._states.jobStatus(id); - } - jobs(status) { - return this._states.statusJobs(status); - } - counts() { - return this._states.statusCounts(); - } - _randomIndex() { - return Math.random().toString(36).slice(2); - } - check(weight = 1) { - return this._store.__check__(weight); - } - _clearGlobalState(index2) { - if (this._scheduled[index2] != null) { - clearTimeout(this._scheduled[index2].expiration); - delete this._scheduled[index2]; - return true; - } else { - return false; - } - } - async _free(index2, job, options, eventInfo) { - var e, running; - try { - ({ running } = await this._store.__free__(index2, options.weight)); - this.Events.trigger("debug", `Freed ${options.id}`, eventInfo); - if (running === 0 && this.empty()) { - return this.Events.trigger("idle"); - } - } catch (error1) { - e = error1; - return this.Events.trigger("error", e); - } - } - _run(index2, job, wait) { - var clearGlobalState, free, run9; - job.doRun(); - clearGlobalState = this._clearGlobalState.bind(this, index2); - run9 = this._run.bind(this, index2, job); - free = this._free.bind(this, index2, job); - return this._scheduled[index2] = { - timeout: setTimeout(() => { - return job.doExecute(this._limiter, clearGlobalState, run9, free); - }, wait), - expiration: job.options.expiration != null ? setTimeout(function() { - return job.doExpire(clearGlobalState, run9, free); - }, wait + job.options.expiration) : void 0, - job - }; - } - _drainOne(capacity) { - return this._registerLock.schedule(() => { - var args, index2, next, options, queue2; - if (this.queued() === 0) { - return this.Promise.resolve(null); - } - queue2 = this._queues.getFirst(); - ({ options, args } = next = queue2.first()); - if (capacity != null && options.weight > capacity) { - return this.Promise.resolve(null); - } - this.Events.trigger("debug", `Draining ${options.id}`, { args, options }); - index2 = this._randomIndex(); - return this._store.__register__(index2, options.weight, options.expiration).then(({ success, wait, reservoir }) => { - var empty; - this.Events.trigger("debug", `Drained ${options.id}`, { success, args, options }); - if (success) { - queue2.shift(); - empty = this.empty(); - if (empty) { - this.Events.trigger("empty"); - } - if (reservoir === 0) { - this.Events.trigger("depleted", empty); - } - this._run(index2, next, wait); - return this.Promise.resolve(options.weight); - } else { - return this.Promise.resolve(null); - } - }); - }); - } - _drainAll(capacity, total = 0) { - return this._drainOne(capacity).then((drained) => { - var newCapacity; - if (drained != null) { - newCapacity = capacity != null ? capacity - drained : capacity; - return this._drainAll(newCapacity, total + drained); - } else { - return this.Promise.resolve(total); - } - }).catch((e) => { - return this.Events.trigger("error", e); - }); - } - _dropAllQueued(message) { - return this._queues.shiftAll(function(job) { - return job.doDrop({ message }); - }); - } - stop(options = {}) { - var done, waitForExecuting; - options = parser$5.load(options, this.stopDefaults); - waitForExecuting = (at) => { - var finished; - finished = () => { - var counts; - counts = this._states.counts; - return counts[0] + counts[1] + counts[2] + counts[3] === at; - }; - return new this.Promise((resolve14, reject) => { - if (finished()) { - return resolve14(); - } else { - return this.on("done", () => { - if (finished()) { - this.removeAllListeners("done"); - return resolve14(); - } - }); - } - }); - }; - done = options.dropWaitingJobs ? (this._run = function(index2, next) { - return next.doDrop({ - message: options.dropErrorMessage - }); - }, this._drainOne = () => { - return this.Promise.resolve(null); - }, this._registerLock.schedule(() => { - return this._submitLock.schedule(() => { - var k, ref, v; - ref = this._scheduled; - for (k in ref) { - v = ref[k]; - if (this.jobStatus(v.job.options.id) === "RUNNING") { - clearTimeout(v.timeout); - clearTimeout(v.expiration); - v.job.doDrop({ - message: options.dropErrorMessage - }); - } - } - this._dropAllQueued(options.dropErrorMessage); - return waitForExecuting(0); - }); - })) : this.schedule({ - priority: NUM_PRIORITIES$1 - 1, - weight: 0 - }, () => { - return waitForExecuting(1); - }); - this._receive = function(job) { - return job._reject(new Bottleneck3.prototype.BottleneckError(options.enqueueErrorMessage)); - }; - this.stop = () => { - return this.Promise.reject(new Bottleneck3.prototype.BottleneckError("stop() has already been called")); - }; - return done; - } - async _addToQueue(job) { - var args, blocked, error3, options, reachedHWM, shifted, strategy; - ({ args, options } = job); - try { - ({ reachedHWM, blocked, strategy } = await this._store.__submit__(this.queued(), options.weight)); - } catch (error1) { - error3 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); - job.doDrop({ error: error3 }); - return false; - } - if (blocked) { - job.doDrop(); - return true; - } else if (reachedHWM) { - shifted = strategy === Bottleneck3.prototype.strategy.LEAK ? this._queues.shiftLastFrom(options.priority) : strategy === Bottleneck3.prototype.strategy.OVERFLOW_PRIORITY ? this._queues.shiftLastFrom(options.priority + 1) : strategy === Bottleneck3.prototype.strategy.OVERFLOW ? job : void 0; - if (shifted != null) { - shifted.doDrop(); - } - if (shifted == null || strategy === Bottleneck3.prototype.strategy.OVERFLOW) { - if (shifted == null) { - job.doDrop(); - } - return reachedHWM; - } - } - job.doQueue(reachedHWM, blocked); - this._queues.push(job); - await this._drainAll(); - return reachedHWM; - } - _receive(job) { - if (this._states.jobStatus(job.options.id) != null) { - job._reject(new Bottleneck3.prototype.BottleneckError(`A job with the same id already exists (id=${job.options.id})`)); - return false; - } else { - job.doReceive(); - return this._submitLock.schedule(this._addToQueue, job); - } - } - submit(...args) { - var cb, fn, job, options, ref, ref1, task; - if (typeof args[0] === "function") { - ref = args, [fn, ...args] = ref, [cb] = splice.call(args, -1); - options = parser$5.load({}, this.jobDefaults); - } else { - ref1 = args, [options, fn, ...args] = ref1, [cb] = splice.call(args, -1); - options = parser$5.load(options, this.jobDefaults); - } - task = (...args2) => { - return new this.Promise(function(resolve14, reject) { - return fn(...args2, function(...args3) { - return (args3[0] != null ? reject : resolve14)(args3); - }); - }); - }; - job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); - job.promise.then(function(args2) { - return typeof cb === "function" ? cb(...args2) : void 0; - }).catch(function(args2) { - if (Array.isArray(args2)) { - return typeof cb === "function" ? cb(...args2) : void 0; - } else { - return typeof cb === "function" ? cb(args2) : void 0; - } - }); - return this._receive(job); - } - schedule(...args) { - var job, options, task; - if (typeof args[0] === "function") { - [task, ...args] = args; - options = {}; - } else { - [options, task, ...args] = args; - } - job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); - this._receive(job); - return job.promise; - } - wrap(fn) { - var schedule, wrapped; - schedule = this.schedule.bind(this); - wrapped = function(...args) { - return schedule(fn.bind(this), ...args); - }; - wrapped.withOptions = function(options, ...args) { - return schedule(options, fn, ...args); - }; - return wrapped; - } - async updateSettings(options = {}) { - await this._store.__updateSettings__(parser$5.overwrite(options, this.storeDefaults)); - parser$5.overwrite(options, this.instanceDefaults, this); - return this; - } - currentReservoir() { - return this._store.__currentReservoir__(); - } - incrementReservoir(incr = 0) { - return this._store.__incrementReservoir__(incr); - } - } - Bottleneck3.default = Bottleneck3; - Bottleneck3.Events = Events$4; - Bottleneck3.version = Bottleneck3.prototype.version = require$$8.version; - Bottleneck3.strategy = Bottleneck3.prototype.strategy = { - LEAK: 1, - OVERFLOW: 2, - OVERFLOW_PRIORITY: 4, - BLOCK: 3 - }; - Bottleneck3.BottleneckError = Bottleneck3.prototype.BottleneckError = BottleneckError_1; - Bottleneck3.Group = Bottleneck3.prototype.Group = Group_1; - Bottleneck3.RedisConnection = Bottleneck3.prototype.RedisConnection = require$$2; - Bottleneck3.IORedisConnection = Bottleneck3.prototype.IORedisConnection = require$$3; - Bottleneck3.Batcher = Bottleneck3.prototype.Batcher = Batcher_1; - Bottleneck3.prototype.jobDefaults = { - priority: DEFAULT_PRIORITY$1, - weight: 1, - expiration: null, - id: "" - }; - Bottleneck3.prototype.storeDefaults = { - maxConcurrent: null, - minTime: 0, - highWater: null, - strategy: Bottleneck3.prototype.strategy.LEAK, - penalty: null, - reservoir: null, - reservoirRefreshInterval: null, - reservoirRefreshAmount: null, - reservoirIncreaseInterval: null, - reservoirIncreaseAmount: null, - reservoirIncreaseMaximum: null - }; - Bottleneck3.prototype.localStoreDefaults = { - Promise, - timeout: null, - heartbeatInterval: 250 - }; - Bottleneck3.prototype.redisStoreDefaults = { - Promise, - timeout: null, - heartbeatInterval: 5e3, - clientTimeout: 1e4, - Redis: null, - clientOptions: {}, - clusterNodes: null, - clearDatastore: false, - connection: null - }; - Bottleneck3.prototype.instanceDefaults = { - datastore: "local", - connection: null, - id: "", - rejectOnDrop: true, - trackDoneStatus: false, - Promise - }; - Bottleneck3.prototype.stopDefaults = { - enqueueErrorMessage: "This limiter has been stopped and cannot accept new jobs.", - dropWaitingJobs: true, - dropErrorMessage: "This limiter has been stopped." - }; - return Bottleneck3; - }).call(commonjsGlobal); - var Bottleneck_1 = Bottleneck2; - var lib = Bottleneck_1; - return lib; - })); - } -}); - -// node_modules/jsonschema/lib/helpers.js -var require_helpers = __commonJS({ - "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { - "use strict"; - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema, path30, name, argument) { - if (Array.isArray(path30)) { - this.path = path30; - this.property = path30.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else if (path30 !== void 0) { - this.property = path30; - } - if (message) { - this.message = message; - } - if (schema) { - var id = schema.$id || schema.id; - this.schema = id || schema; - } - if (instance !== void 0) { - this.instance = instance; - } - this.name = name; - this.argument = argument; - this.stack = this.toString(); - }; - ValidationError.prototype.toString = function toString2() { - return this.property + " " + this.message; - }; - var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema, options, ctx) { - this.instance = instance; - this.schema = schema; - this.options = options; - this.path = ctx.path; - this.propertyPath = ctx.propertyPath; - this.errors = []; - this.throwError = options && options.throwError; - this.throwFirst = options && options.throwFirst; - this.throwAll = options && options.throwAll; - this.disableFormat = options && options.disableFormat === true; - }; - ValidatorResult.prototype.addError = function addError(detail) { - var err; - if (typeof detail == "string") { - err = new ValidationError(detail, this.instance, this.schema, this.path); - } else { - if (!detail) throw new Error("Missing error detail"); - if (!detail.message) throw new Error("Missing error message"); - if (!detail.name) throw new Error("Missing validator type"); - err = new ValidationError(detail.message, this.instance, this.schema, this.path, detail.name, detail.argument); - } - this.errors.push(err); - if (this.throwFirst) { - throw new ValidatorResultError(this); - } else if (this.throwError) { - throw err; - } - return err; - }; - ValidatorResult.prototype.importErrors = function importErrors(res) { - if (typeof res == "string" || res && res.validatorType) { - this.addError(res); - } else if (res && res.errors) { - this.errors = this.errors.concat(res.errors); - } - }; - function stringizer(v, i) { - return i + ": " + v.toString() + "\n"; - } - ValidatorResult.prototype.toString = function toString2(res) { - return this.errors.map(stringizer).join(""); - }; - Object.defineProperty(ValidatorResult.prototype, "valid", { get: function() { - return !this.errors.length; - } }); - module2.exports.ValidatorResultError = ValidatorResultError; - function ValidatorResultError(result) { - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(this, ValidatorResultError); - } - this.instance = result.instance; - this.schema = result.schema; - this.options = result.options; - this.errors = result.errors; - } - ValidatorResultError.prototype = new Error(); - ValidatorResultError.prototype.constructor = ValidatorResultError; - ValidatorResultError.prototype.name = "Validation Error"; - var SchemaError = exports2.SchemaError = function SchemaError2(msg, schema) { - this.message = msg; - this.schema = schema; - Error.call(this, msg); - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(this, SchemaError2); - } - }; - SchemaError.prototype = Object.create( - Error.prototype, - { - constructor: { value: SchemaError, enumerable: false }, - name: { value: "SchemaError", enumerable: false } - } - ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema, options, path30, base, schemas) { - this.schema = schema; - this.options = options; - if (Array.isArray(path30)) { - this.path = path30; - this.propertyPath = path30.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else { - this.propertyPath = path30; - } - this.base = base; - this.schemas = schemas; - }; - SchemaContext.prototype.resolve = function resolve14(target) { - return (() => resolveUrl(this.base, target))(); - }; - SchemaContext.prototype.makeChild = function makeChild(schema, propertyName) { - var path30 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); - var id = schema.$id || schema.id; - let base = (() => resolveUrl(this.base, id || ""))(); - var ctx = new SchemaContext(schema, this.options, path30, base, Object.create(this.schemas)); - if (id && !ctx.schemas[base]) { - ctx.schemas[base] = schema; - } - return ctx; - }; - var FORMAT_REGEXPS = exports2.FORMAT_REGEXPS = { - // 7.3.1. Dates, Times, and Duration - "date-time": /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/, - "date": /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/, - "time": /^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/, - "duration": /P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i, - // 7.3.2. Email Addresses - // TODO: fix the email production - "email": /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/, - "idn-email": /^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u, - // 7.3.3. Hostnames - // 7.3.4. IP Addresses - "ip-address": /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, - // FIXME whitespace is invalid - "ipv6": /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/, - // 7.3.5. Resource Identifiers - // TODO: A more accurate regular expression for "uri" goes: - // [A-Za-z][+\-.0-9A-Za-z]*:((/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?)?#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])|/?%[0-9A-Fa-f]{2}|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*(#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?)? - "uri": /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/, - "uri-reference": /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/, - "iri": /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/, - "iri-reference": /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u, - "uuid": /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i, - // 7.3.6. uri-template - "uri-template": /(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu, - // 7.3.7. JSON Pointers - "json-pointer": /^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu, - "relative-json-pointer": /^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu, - // hostname regex from: http://stackoverflow.com/a/1420225/5628 - "hostname": /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, - "host-name": /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, - "utc-millisec": function(input) { - return typeof input === "string" && parseFloat(input) === parseInt(input, 10) && !isNaN(input); - }, - // 7.3.8. regex - "regex": function(input) { - var result = true; - try { - new RegExp(input); - } catch (e) { - result = false; - } - return result; - }, - // Other definitions - // "style" was removed from JSON Schema in draft-4 and is deprecated - "style": /[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/, - // "color" was removed from JSON Schema in draft-4 and is deprecated - "color": /^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/, - "phone": /^\+(?:[0-9] ?){6,14}[0-9]$/, - "alpha": /^[a-zA-Z]+$/, - "alphanumeric": /^[a-zA-Z0-9]+$/ - }; - FORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex; - FORMAT_REGEXPS.pattern = FORMAT_REGEXPS.regex; - FORMAT_REGEXPS.ipv4 = FORMAT_REGEXPS["ip-address"]; - exports2.isFormat = function isFormat(input, format, validator) { - if (typeof input === "string" && FORMAT_REGEXPS[format] !== void 0) { - if (FORMAT_REGEXPS[format] instanceof RegExp) { - return FORMAT_REGEXPS[format].test(input); - } - if (typeof FORMAT_REGEXPS[format] === "function") { - return FORMAT_REGEXPS[format](input); - } - } else if (validator && validator.customFormats && typeof validator.customFormats[format] === "function") { - return validator.customFormats[format](input); - } - return true; - }; - var makeSuffix = exports2.makeSuffix = function makeSuffix2(key) { - key = key.toString(); - if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { - return "." + key; - } - if (key.match(/^\d+$/)) { - return "[" + key + "]"; - } - return "[" + JSON.stringify(key) + "]"; - }; - exports2.deepCompareStrict = function deepCompareStrict(a, b) { - if (typeof a !== typeof b) { - return false; - } - if (Array.isArray(a)) { - if (!Array.isArray(b)) { - return false; - } - if (a.length !== b.length) { - return false; - } - return a.every(function(v, i) { - return deepCompareStrict(a[i], b[i]); - }); - } - if (typeof a === "object") { - if (!a || !b) { - return a === b; - } - var aKeys = Object.keys(a); - var bKeys = Object.keys(b); - if (aKeys.length !== bKeys.length) { - return false; - } - return aKeys.every(function(v) { - return deepCompareStrict(a[v], b[v]); - }); - } - return a === b; - }; - function deepMerger(target, dst, e, i) { - if (typeof e === "object") { - dst[i] = deepMerge(target[i], e); - } else { - if (target.indexOf(e) === -1) { - dst.push(e); - } - } - } - function copyist(src, dst, key) { - dst[key] = src[key]; - } - function copyistWithDeepMerge(target, src, dst, key) { - if (typeof src[key] !== "object" || !src[key]) { - dst[key] = src[key]; - } else { - if (!target[key]) { - dst[key] = src[key]; - } else { - dst[key] = deepMerge(target[key], src[key]); - } - } - } - function deepMerge(target, src) { - var array2 = Array.isArray(src); - var dst = array2 && [] || {}; - if (array2) { - target = target || []; - dst = dst.concat(target); - src.forEach(deepMerger.bind(null, target, dst)); - } else { - if (target && typeof target === "object") { - Object.keys(target).forEach(copyist.bind(null, target, dst)); - } - Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); - } - return dst; - } - module2.exports.deepMerge = deepMerge; - exports2.objectGetPath = function objectGetPath(o, s) { - var parts = s.split("/").slice(1); - var k; - while (typeof (k = parts.shift()) == "string") { - var n = decodeURIComponent(k.replace(/~0/, "~").replace(/~1/g, "/")); - if (!(n in o)) return; - o = o[n]; - } - return o; - }; - function pathEncoder(v) { - return "/" + encodeURIComponent(v).replace(/~/g, "%7E"); - } - exports2.encodePath = function encodePointer(a) { - return a.map(pathEncoder).join(""); - }; - exports2.getDecimalPlaces = function getDecimalPlaces(number2) { - var decimalPlaces = 0; - if (isNaN(number2)) return decimalPlaces; - if (typeof number2 !== "number") { - number2 = Number(number2); - } - var parts = number2.toString().split("e"); - if (parts.length === 2) { - if (parts[1][0] !== "-") { - return decimalPlaces; - } else { - decimalPlaces = Number(parts[1].slice(1)); - } - } - var decimalParts = parts[0].split("."); - if (decimalParts.length === 2) { - decimalPlaces += decimalParts[1].length; - } - return decimalPlaces; - }; - exports2.isSchema = function isSchema(val) { - return typeof val === "object" && val || typeof val === "boolean"; - }; - var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { - const resolvedUrl = new URL(to, new URL(from, "resolve://")); - if (resolvedUrl.protocol === "resolve:") { - const { pathname, search, hash: hash2 } = resolvedUrl; - return pathname + search + hash2; - } - return resolvedUrl.toString(); - }; - } -}); - -// node_modules/jsonschema/lib/attribute.js -var require_attribute = __commonJS({ - "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { - "use strict"; - var helpers = require_helpers(); - var ValidatorResult = helpers.ValidatorResult; - var SchemaError = helpers.SchemaError; - var attribute = {}; - attribute.ignoreProperties = { - // informative properties - "id": true, - "default": true, - "description": true, - "title": true, - // arguments to other properties - "additionalItems": true, - "then": true, - "else": true, - // special-handled properties - "$schema": true, - "$ref": true, - "extends": true - }; - var validators = attribute.validators = {}; - validators.type = function validateType(instance, schema, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema, options, ctx); - var types2 = Array.isArray(schema.type) ? schema.type : [schema.type]; - if (!types2.some(this.testType.bind(this, instance, schema, options, ctx))) { - var list = types2.map(function(v) { - if (!v) return; - var id = v.$id || v.id; - return id ? "<" + id + ">" : v + ""; - }); - result.addError({ - name: "type", - argument: list, - message: "is not of a type(s) " + list - }); - } - return result; - }; - function testSchemaNoThrow(instance, options, ctx, callback, schema) { - var throwError2 = options.throwError; - var throwAll = options.throwAll; - options.throwError = false; - options.throwAll = false; - var res = this.validateSchema(instance, schema, options, ctx); - options.throwError = throwError2; - options.throwAll = throwAll; - if (!res.valid && callback instanceof Function) { - callback(res); - } - return res.valid; - } - validators.anyOf = function validateAnyOf(instance, schema, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema, options, ctx); - var inner = new ValidatorResult(instance, schema, options, ctx); - if (!Array.isArray(schema.anyOf)) { - throw new SchemaError("anyOf must be an array"); - } - if (!schema.anyOf.some( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - )) { - var list = schema.anyOf.map(function(v, i) { - var id = v.$id || v.id; - if (id) return "<" + id + ">"; - return v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; - }); - if (options.nestedErrors) { - result.importErrors(inner); - } - result.addError({ - name: "anyOf", - argument: list, - message: "is not any of " + list.join(",") - }); - } - return result; - }; - validators.allOf = function validateAllOf(instance, schema, options, ctx) { - if (instance === void 0) { - return null; - } - if (!Array.isArray(schema.allOf)) { - throw new SchemaError("allOf must be an array"); - } - var result = new ValidatorResult(instance, schema, options, ctx); - var self2 = this; - schema.allOf.forEach(function(v, i) { - var valid4 = self2.validateSchema(instance, v, options, ctx); - if (!valid4.valid) { - var id = v.$id || v.id; - var msg = id || v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; - result.addError({ - name: "allOf", - argument: { id: msg, length: valid4.errors.length, valid: valid4 }, - message: "does not match allOf schema " + msg + " with " + valid4.errors.length + " error[s]:" - }); - result.importErrors(valid4); - } - }); - return result; - }; - validators.oneOf = function validateOneOf(instance, schema, options, ctx) { - if (instance === void 0) { - return null; - } - if (!Array.isArray(schema.oneOf)) { - throw new SchemaError("oneOf must be an array"); - } - var result = new ValidatorResult(instance, schema, options, ctx); - var inner = new ValidatorResult(instance, schema, options, ctx); - var count = schema.oneOf.filter( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - ).length; - var list = schema.oneOf.map(function(v, i) { - var id = v.$id || v.id; - return id || v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; - }); - if (count !== 1) { - if (options.nestedErrors) { - result.importErrors(inner); - } - result.addError({ - name: "oneOf", - argument: list, - message: "is not exactly one from " + list.join(",") - }); - } - return result; - }; - validators.if = function validateIf(instance, schema, options, ctx) { - if (instance === void 0) return null; - if (!helpers.isSchema(schema.if)) throw new Error('Expected "if" keyword to be a schema'); - var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema.if); - var result = new ValidatorResult(instance, schema, options, ctx); - var res; - if (ifValid) { - if (schema.then === void 0) return; - if (!helpers.isSchema(schema.then)) throw new Error('Expected "then" keyword to be a schema'); - res = this.validateSchema(instance, schema.then, options, ctx.makeChild(schema.then)); - result.importErrors(res); - } else { - if (schema.else === void 0) return; - if (!helpers.isSchema(schema.else)) throw new Error('Expected "else" keyword to be a schema'); - res = this.validateSchema(instance, schema.else, options, ctx.makeChild(schema.else)); - result.importErrors(res); - } - return result; - }; - function getEnumerableProperty(object2, key) { - if (Object.hasOwnProperty.call(object2, key)) return object2[key]; - if (!(key in object2)) return; - while (object2 = Object.getPrototypeOf(object2)) { - if (Object.propertyIsEnumerable.call(object2, key)) return object2[key]; - } - } - validators.propertyNames = function validatePropertyNames(instance, schema, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var subschema = schema.propertyNames !== void 0 ? schema.propertyNames : {}; - if (!helpers.isSchema(subschema)) throw new SchemaError('Expected "propertyNames" to be a schema (object or boolean)'); - for (var property in instance) { - if (getEnumerableProperty(instance, property) !== void 0) { - var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema)); - result.importErrors(res); - } - } - return result; - }; - validators.properties = function validateProperties(instance, schema, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var properties = schema.properties || {}; - for (var property in properties) { - var subschema = properties[property]; - if (subschema === void 0) { - continue; - } else if (subschema === null) { - throw new SchemaError('Unexpected null, expected schema in "properties"'); - } - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, subschema, options, ctx); - } - var prop = getEnumerableProperty(instance, property); - var res = this.validateSchema(prop, subschema, options, ctx.makeChild(subschema, property)); - if (res.instance !== result.instance[property]) result.instance[property] = res.instance; - result.importErrors(res); - } - return result; - }; - function testAdditionalProperty(instance, schema, options, ctx, property, result) { - if (!this.types.object(instance)) return; - if (schema.properties && schema.properties[property] !== void 0) { - return; - } - if (schema.additionalProperties === false) { - result.addError({ - name: "additionalProperties", - argument: property, - message: "is not allowed to have the additional property " + JSON.stringify(property) - }); - } else { - var additionalProperties = schema.additionalProperties || {}; - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, additionalProperties, options, ctx); - } - var res = this.validateSchema(instance[property], additionalProperties, options, ctx.makeChild(additionalProperties, property)); - if (res.instance !== result.instance[property]) result.instance[property] = res.instance; - result.importErrors(res); - } - } - validators.patternProperties = function validatePatternProperties(instance, schema, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var patternProperties = schema.patternProperties || {}; - for (var property in instance) { - var test = true; - for (var pattern in patternProperties) { - var subschema = patternProperties[pattern]; - if (subschema === void 0) { - continue; - } else if (subschema === null) { - throw new SchemaError('Unexpected null, expected schema in "patternProperties"'); - } - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); - } - if (!regexp.test(property)) { - continue; - } - test = false; - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, subschema, options, ctx); - } - var res = this.validateSchema(instance[property], subschema, options, ctx.makeChild(subschema, property)); - if (res.instance !== result.instance[property]) result.instance[property] = res.instance; - result.importErrors(res); - } - if (test) { - testAdditionalProperty.call(this, instance, schema, options, ctx, property, result); - } - } - return result; - }; - validators.additionalProperties = function validateAdditionalProperties(instance, schema, options, ctx) { - if (!this.types.object(instance)) return; - if (schema.patternProperties) { - return null; - } - var result = new ValidatorResult(instance, schema, options, ctx); - for (var property in instance) { - testAdditionalProperty.call(this, instance, schema, options, ctx, property, result); - } - return result; - }; - validators.minProperties = function validateMinProperties(instance, schema, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length >= schema.minProperties)) { - result.addError({ - name: "minProperties", - argument: schema.minProperties, - message: "does not meet minimum property length of " + schema.minProperties - }); - } - return result; - }; - validators.maxProperties = function validateMaxProperties(instance, schema, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length <= schema.maxProperties)) { - result.addError({ - name: "maxProperties", - argument: schema.maxProperties, - message: "does not meet maximum property length of " + schema.maxProperties - }); - } - return result; - }; - validators.items = function validateItems(instance, schema, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema.items === void 0) return; - var result = new ValidatorResult(instance, schema, options, ctx); - instance.every(function(value, i) { - if (Array.isArray(schema.items)) { - var items = schema.items[i] === void 0 ? schema.additionalItems : schema.items[i]; - } else { - var items = schema.items; - } - if (items === void 0) { - return true; - } - if (items === false) { - result.addError({ - name: "items", - message: "additionalItems not permitted" - }); - return false; - } - var res = self2.validateSchema(value, items, options, ctx.makeChild(items, i)); - if (res.instance !== result.instance[i]) result.instance[i] = res.instance; - result.importErrors(res); - return true; - }); - return result; - }; - validators.contains = function validateContains(instance, schema, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema.contains === void 0) return; - if (!helpers.isSchema(schema.contains)) throw new Error('Expected "contains" keyword to be a schema'); - var result = new ValidatorResult(instance, schema, options, ctx); - var count = instance.some(function(value, i) { - var res = self2.validateSchema(value, schema.contains, options, ctx.makeChild(schema.contains, i)); - return res.errors.length === 0; - }); - if (count === false) { - result.addError({ - name: "contains", - argument: schema.contains, - message: "must contain an item matching given schema" - }); - } - return result; - }; - validators.minimum = function validateMinimum(instance, schema, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - if (schema.exclusiveMinimum && schema.exclusiveMinimum === true) { - if (!(instance > schema.minimum)) { - result.addError({ - name: "minimum", - argument: schema.minimum, - message: "must be greater than " + schema.minimum - }); - } - } else { - if (!(instance >= schema.minimum)) { - result.addError({ - name: "minimum", - argument: schema.minimum, - message: "must be greater than or equal to " + schema.minimum - }); - } - } - return result; - }; - validators.maximum = function validateMaximum(instance, schema, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - if (schema.exclusiveMaximum && schema.exclusiveMaximum === true) { - if (!(instance < schema.maximum)) { - result.addError({ - name: "maximum", - argument: schema.maximum, - message: "must be less than " + schema.maximum - }); - } - } else { - if (!(instance <= schema.maximum)) { - result.addError({ - name: "maximum", - argument: schema.maximum, - message: "must be less than or equal to " + schema.maximum - }); - } - } - return result; - }; - validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema, options, ctx) { - if (typeof schema.exclusiveMinimum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var valid4 = instance > schema.exclusiveMinimum; - if (!valid4) { - result.addError({ - name: "exclusiveMinimum", - argument: schema.exclusiveMinimum, - message: "must be strictly greater than " + schema.exclusiveMinimum - }); - } - return result; - }; - validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema, options, ctx) { - if (typeof schema.exclusiveMaximum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var valid4 = instance < schema.exclusiveMaximum; - if (!valid4) { - result.addError({ - name: "exclusiveMaximum", - argument: schema.exclusiveMaximum, - message: "must be strictly less than " + schema.exclusiveMaximum - }); - } - return result; - }; - var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema, options, ctx, validationType, errorMessage) { - if (!this.types.number(instance)) return; - var validationArgument = schema[validationType]; - if (validationArgument == 0) { - throw new SchemaError(validationType + " cannot be zero"); - } - var result = new ValidatorResult(instance, schema, options, ctx); - var instanceDecimals = helpers.getDecimalPlaces(instance); - var divisorDecimals = helpers.getDecimalPlaces(validationArgument); - var maxDecimals = Math.max(instanceDecimals, divisorDecimals); - var multiplier = Math.pow(10, maxDecimals); - if (Math.round(instance * multiplier) % Math.round(validationArgument * multiplier) !== 0) { - result.addError({ - name: validationType, - argument: validationArgument, - message: errorMessage + JSON.stringify(validationArgument) - }); - } - return result; - }; - validators.multipleOf = function validateMultipleOf(instance, schema, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); - }; - validators.divisibleBy = function validateDivisibleBy(instance, schema, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); - }; - validators.required = function validateRequired(instance, schema, options, ctx) { - var result = new ValidatorResult(instance, schema, options, ctx); - if (instance === void 0 && schema.required === true) { - result.addError({ - name: "required", - message: "is required" - }); - } else if (this.types.object(instance) && Array.isArray(schema.required)) { - schema.required.forEach(function(n) { - if (getEnumerableProperty(instance, n) === void 0) { - result.addError({ - name: "required", - argument: n, - message: "requires property " + JSON.stringify(n) - }); - } - }); - } - return result; - }; - validators.pattern = function validatePattern(instance, schema, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var pattern = schema.pattern; - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); - } - if (!instance.match(regexp)) { - result.addError({ - name: "pattern", - argument: schema.pattern, - message: "does not match pattern " + JSON.stringify(schema.pattern.toString()) - }); - } - return result; - }; - validators.format = function validateFormat(instance, schema, options, ctx) { - if (instance === void 0) return; - var result = new ValidatorResult(instance, schema, options, ctx); - if (!result.disableFormat && !helpers.isFormat(instance, schema.format, this)) { - result.addError({ - name: "format", - argument: schema.format, - message: "does not conform to the " + JSON.stringify(schema.format) + " format" - }); - } - return result; - }; - validators.minLength = function validateMinLength(instance, schema, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length >= schema.minLength)) { - result.addError({ - name: "minLength", - argument: schema.minLength, - message: "does not meet minimum length of " + schema.minLength - }); - } - return result; - }; - validators.maxLength = function validateMaxLength(instance, schema, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length <= schema.maxLength)) { - result.addError({ - name: "maxLength", - argument: schema.maxLength, - message: "does not meet maximum length of " + schema.maxLength - }); - } - return result; - }; - validators.minItems = function validateMinItems(instance, schema, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - if (!(instance.length >= schema.minItems)) { - result.addError({ - name: "minItems", - argument: schema.minItems, - message: "does not meet minimum length of " + schema.minItems - }); - } - return result; - }; - validators.maxItems = function validateMaxItems(instance, schema, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - if (!(instance.length <= schema.maxItems)) { - result.addError({ - name: "maxItems", - argument: schema.maxItems, - message: "does not meet maximum length of " + schema.maxItems - }); - } - return result; - }; - function testArrays(v, i, a) { - var j, len = a.length; - for (j = i + 1, len; j < len; j++) { - if (helpers.deepCompareStrict(v, a[j])) { - return false; - } - } - return true; - } - validators.uniqueItems = function validateUniqueItems(instance, schema, options, ctx) { - if (schema.uniqueItems !== true) return; - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - if (!instance.every(testArrays)) { - result.addError({ - name: "uniqueItems", - message: "contains duplicate item" - }); - } - return result; - }; - validators.dependencies = function validateDependencies(instance, schema, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - for (var property in schema.dependencies) { - if (instance[property] === void 0) { - continue; - } - var dep = schema.dependencies[property]; - var childContext = ctx.makeChild(dep, property); - if (typeof dep == "string") { - dep = [dep]; - } - if (Array.isArray(dep)) { - dep.forEach(function(prop) { - if (instance[prop] === void 0) { - result.addError({ - // FIXME there's two different "dependencies" errors here with slightly different outputs - // Can we make these the same? Or should we create different error types? - name: "dependencies", - argument: childContext.propertyPath, - message: "property " + prop + " not found, required by " + childContext.propertyPath - }); - } - }); - } else { - var res = this.validateSchema(instance, dep, options, childContext); - if (result.instance !== res.instance) result.instance = res.instance; - if (res && res.errors.length) { - result.addError({ - name: "dependencies", - argument: childContext.propertyPath, - message: "does not meet dependency required by " + childContext.propertyPath - }); - result.importErrors(res); - } - } - } - return result; - }; - validators["enum"] = function validateEnum(instance, schema, options, ctx) { - if (instance === void 0) { - return null; - } - if (!Array.isArray(schema["enum"])) { - throw new SchemaError("enum expects an array", schema); - } - var result = new ValidatorResult(instance, schema, options, ctx); - if (!schema["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { - result.addError({ - name: "enum", - argument: schema["enum"], - message: "is not one of enum values: " + schema["enum"].map(String).join(",") - }); - } - return result; - }; - validators["const"] = function validateEnum(instance, schema, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema, options, ctx); - if (!helpers.deepCompareStrict(schema["const"], instance)) { - result.addError({ - name: "const", - argument: schema["const"], - message: "does not exactly match expected constant: " + schema["const"] - }); - } - return result; - }; - validators.not = validators.disallow = function validateNot(instance, schema, options, ctx) { - var self2 = this; - if (instance === void 0) return null; - var result = new ValidatorResult(instance, schema, options, ctx); - var notTypes = schema.not || schema.disallow; - if (!notTypes) return null; - if (!Array.isArray(notTypes)) notTypes = [notTypes]; - notTypes.forEach(function(type) { - if (self2.testType(instance, schema, options, ctx, type)) { - var id = type && (type.$id || type.id); - var schemaId = id || type; - result.addError({ - name: "not", - argument: schemaId, - message: "is of prohibited type " + schemaId - }); - } - }); - return result; - }; - module2.exports = attribute; - } -}); - -// node_modules/jsonschema/lib/scan.js -var require_scan = __commonJS({ - "node_modules/jsonschema/lib/scan.js"(exports2, module2) { - "use strict"; - var helpers = require_helpers(); - module2.exports.SchemaScanResult = SchemaScanResult; - function SchemaScanResult(found, ref) { - this.id = found; - this.ref = ref; - } - module2.exports.scan = function scan(base, schema) { - function scanSchema(baseuri, schema2) { - if (!schema2 || typeof schema2 != "object") return; - if (schema2.$ref) { - let resolvedUri = helpers.resolveUrl(baseuri, schema2.$ref); - ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; - return; - } - var id = schema2.$id || schema2.id; - let resolvedBase = helpers.resolveUrl(baseuri, id); - var ourBase = id ? resolvedBase : baseuri; - if (ourBase) { - if (ourBase.indexOf("#") < 0) ourBase += "#"; - if (found[ourBase]) { - if (!helpers.deepCompareStrict(found[ourBase], schema2)) { - throw new Error("Schema <" + ourBase + "> already exists with different definition"); - } - return found[ourBase]; - } - found[ourBase] = schema2; - if (ourBase[ourBase.length - 1] == "#") { - found[ourBase.substring(0, ourBase.length - 1)] = schema2; - } - } - scanArray(ourBase + "/items", Array.isArray(schema2.items) ? schema2.items : [schema2.items]); - scanArray(ourBase + "/extends", Array.isArray(schema2.extends) ? schema2.extends : [schema2.extends]); - scanSchema(ourBase + "/additionalItems", schema2.additionalItems); - scanObject(ourBase + "/properties", schema2.properties); - scanSchema(ourBase + "/additionalProperties", schema2.additionalProperties); - scanObject(ourBase + "/definitions", schema2.definitions); - scanObject(ourBase + "/patternProperties", schema2.patternProperties); - scanObject(ourBase + "/dependencies", schema2.dependencies); - scanArray(ourBase + "/disallow", schema2.disallow); - scanArray(ourBase + "/allOf", schema2.allOf); - scanArray(ourBase + "/anyOf", schema2.anyOf); - scanArray(ourBase + "/oneOf", schema2.oneOf); - scanSchema(ourBase + "/not", schema2.not); - } - function scanArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - scanSchema(baseuri + "/" + i, schemas[i]); - } - } - function scanObject(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - scanSchema(baseuri + "/" + p, schemas[p]); - } - } - var found = {}; - var ref = {}; - scanSchema(base, schema); - return new SchemaScanResult(found, ref); - }; - } -}); - -// node_modules/jsonschema/lib/validator.js -var require_validator = __commonJS({ - "node_modules/jsonschema/lib/validator.js"(exports2, module2) { - "use strict"; - var attribute = require_attribute(); - var helpers = require_helpers(); - var scanSchema = require_scan().scan; - var ValidatorResult = helpers.ValidatorResult; - var ValidatorResultError = helpers.ValidatorResultError; - var SchemaError = helpers.SchemaError; - var SchemaContext = helpers.SchemaContext; - var anonymousBase = "/"; - var Validator3 = function Validator4() { - this.customFormats = Object.create(Validator4.prototype.customFormats); - this.schemas = {}; - this.unresolvedRefs = []; - this.types = Object.create(types2); - this.attributes = Object.create(attribute.validators); - }; - Validator3.prototype.customFormats = {}; - Validator3.prototype.schemas = null; - Validator3.prototype.types = null; - Validator3.prototype.attributes = null; - Validator3.prototype.unresolvedRefs = null; - Validator3.prototype.addSchema = function addSchema(schema, base) { - var self2 = this; - if (!schema) { - return null; - } - var scan = scanSchema(base || anonymousBase, schema); - var ourUri = base || schema.$id || schema.id; - for (var uri in scan.id) { - this.schemas[uri] = scan.id[uri]; - } - for (var uri in scan.ref) { - this.unresolvedRefs.push(uri); - } - this.unresolvedRefs = this.unresolvedRefs.filter(function(uri2) { - return typeof self2.schemas[uri2] === "undefined"; - }); - return this.schemas[ourUri]; - }; - Validator3.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - this.addSubSchema(baseuri, schemas[i]); - } - }; - Validator3.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - this.addSubSchema(baseuri, schemas[p]); - } - }; - Validator3.prototype.setSchemas = function setSchemas(schemas) { - this.schemas = schemas; - }; - Validator3.prototype.getSchema = function getSchema(urn) { - return this.schemas[urn]; - }; - Validator3.prototype.validate = function validate2(instance, schema, options, ctx) { - if (typeof schema !== "boolean" && typeof schema !== "object" || schema === null) { - throw new SchemaError("Expected `schema` to be an object or boolean"); - } - if (!options) { - options = {}; - } - var id = schema.$id || schema.id; - let base = helpers.resolveUrl(options.base, id || ""); - if (!ctx) { - ctx = new SchemaContext(schema, options, [], base, Object.create(this.schemas)); - if (!ctx.schemas[base]) { - ctx.schemas[base] = schema; - } - var found = scanSchema(base, schema); - for (var n in found.id) { - var sch = found.id[n]; - ctx.schemas[n] = sch; - } - } - if (options.required && instance === void 0) { - var result = new ValidatorResult(instance, schema, options, ctx); - result.addError("is required, but is undefined"); - return result; - } - var result = this.validateSchema(instance, schema, options, ctx); - if (!result) { - throw new Error("Result undefined"); - } else if (options.throwAll && result.errors.length) { - throw new ValidatorResultError(result); - } - return result; - }; - function shouldResolve(schema) { - var ref = typeof schema === "string" ? schema : schema.$ref; - if (typeof ref == "string") return ref; - return false; - } - Validator3.prototype.validateSchema = function validateSchema2(instance, schema, options, ctx) { - var result = new ValidatorResult(instance, schema, options, ctx); - if (typeof schema === "boolean") { - if (schema === true) { - schema = {}; - } else if (schema === false) { - schema = { type: [] }; - } - } else if (!schema) { - throw new Error("schema is undefined"); - } - if (schema["extends"]) { - if (Array.isArray(schema["extends"])) { - var schemaobj = { schema, ctx }; - schema["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); - schema = schemaobj.schema; - schemaobj.schema = null; - schemaobj.ctx = null; - schemaobj = null; - } else { - schema = helpers.deepMerge(schema, this.superResolve(schema["extends"], ctx)); - } - } - var switchSchema = shouldResolve(schema); - if (switchSchema) { - var resolved = this.resolve(schema, switchSchema, ctx); - var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas); - return this.validateSchema(instance, resolved.subschema, options, subctx); - } - var skipAttributes = options && options.skipAttributes || []; - for (var key in schema) { - if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { - var validatorErr = null; - var validator = this.attributes[key]; - if (validator) { - validatorErr = validator.call(this, instance, schema, options, ctx); - } else if (options.allowUnknownAttributes === false) { - throw new SchemaError("Unsupported attribute: " + key, schema); - } - if (validatorErr) { - result.importErrors(validatorErr); - } - } - } - if (typeof options.rewrite == "function") { - var value = options.rewrite.call(this, instance, schema, options, ctx); - result.instance = value; - } - return result; - }; - Validator3.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { - schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); - }; - Validator3.prototype.superResolve = function superResolve(schema, ctx) { - var ref = shouldResolve(schema); - if (ref) { - return this.resolve(schema, ref, ctx).subschema; - } - return schema; - }; - Validator3.prototype.resolve = function resolve14(schema, switchSchema, ctx) { - switchSchema = ctx.resolve(switchSchema); - if (ctx.schemas[switchSchema]) { - return { subschema: ctx.schemas[switchSchema], switchSchema }; - } - let parsed = new URL(switchSchema, "thismessage::/"); - let fragment = parsed.hash; - var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); - if (!document2 || !ctx.schemas[document2]) { - throw new SchemaError("no such schema <" + switchSchema + ">", schema); - } - var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); - if (subschema === void 0) { - throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema); - } - return { subschema, switchSchema }; - }; - Validator3.prototype.testType = function validateType(instance, schema, options, ctx, type) { - if (type === void 0) { - return; - } else if (type === null) { - throw new SchemaError('Unexpected null in "type" keyword'); - } - if (typeof this.types[type] == "function") { - return this.types[type].call(this, instance); - } - if (type && typeof type == "object") { - var res = this.validateSchema(instance, type, options, ctx); - return res === void 0 || !(res && res.errors.length); - } - return true; - }; - var types2 = Validator3.prototype.types = {}; - types2.string = function testString(instance) { - return typeof instance == "string"; - }; - types2.number = function testNumber(instance) { - return typeof instance == "number" && isFinite(instance); - }; - types2.integer = function testInteger(instance) { - return typeof instance == "number" && instance % 1 === 0; - }; - types2.boolean = function testBoolean(instance) { - return typeof instance == "boolean"; - }; - types2.array = function testArray(instance) { - return Array.isArray(instance); - }; - types2["null"] = function testNull(instance) { - return instance === null; - }; - types2.date = function testDate(instance) { - return instance instanceof Date; - }; - types2.any = function testAny(instance) { - return true; - }; - types2.object = function testObject(instance) { - return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); - }; - module2.exports = Validator3; - } -}); - -// node_modules/jsonschema/lib/index.js -var require_lib2 = __commonJS({ - "node_modules/jsonschema/lib/index.js"(exports2, module2) { - "use strict"; - var Validator3 = module2.exports.Validator = require_validator(); - module2.exports.ValidatorResult = require_helpers().ValidatorResult; - module2.exports.ValidatorResultError = require_helpers().ValidatorResultError; - module2.exports.ValidationError = require_helpers().ValidationError; - module2.exports.SchemaError = require_helpers().SchemaError; - module2.exports.SchemaScanResult = require_scan().SchemaScanResult; - module2.exports.scan = require_scan().scan; - module2.exports.validate = function(instance, schema, options) { - var v = new Validator3(); - return v.validate(instance, schema, options); - }; - } -}); - -// src/db-config-schema.json -var require_db_config_schema = __commonJS({ - "src/db-config-schema.json"(exports2, module2) { - module2.exports = { - $schema: "https://json-schema.org/draft/2020-12/schema", - title: "CodeQL Database Configuration", - description: "Format of the config file supplied by the user for CodeQL analysis", - type: "object", - properties: { - name: { - type: "string", - description: "Name of the configuration" - }, - "disable-default-queries": { - type: "boolean", - description: "Whether to disable default queries" - }, - queries: { - type: "array", - description: "List of additional queries to run", - items: { - $ref: "#/definitions/QuerySpec" - } - }, - "paths-ignore": { - type: "array", - description: "Paths to ignore during analysis", - items: { - type: "string" - } - }, - paths: { - type: "array", - description: "Paths to include in analysis", - items: { - type: "string" - } - }, - packs: { - description: "Query packs to include. Can be a simple array for single-language analysis or an object with language-specific arrays for multi-language analysis", - oneOf: [ - { - type: "array", - items: { - type: "string" - } - }, - { - type: "object", - additionalProperties: { - type: "array", - items: { - type: "string" - } - } - } - ] - }, - "query-filters": { - type: "array", - description: "Set of query filters to include and exclude extra queries based on CodeQL query suite include and exclude properties", - items: { - $ref: "#/definitions/QueryFilter" - } - } - }, - additionalProperties: true, - definitions: { - QuerySpec: { - type: "object", - description: "Detailed query specification object", - properties: { - name: { - type: "string", - description: "Optional name for the query" - }, - uses: { - type: "string", - description: "The query or query suite to use" - } - }, - required: ["uses"], - additionalProperties: false - }, - QueryFilter: { - description: "Query filter that can either include or exclude queries", - oneOf: [ - { - $ref: "#/definitions/ExcludeQueryFilter" - }, - { - $ref: "#/definitions/IncludeQueryFilter" - }, - {} - ] - }, - ExcludeQueryFilter: { - type: "object", - description: "Filter to exclude queries", - properties: { - exclude: { - type: "object", - description: "Queries to exclude", - additionalProperties: { - oneOf: [ - { - type: "array", - items: { - type: "string" - } - }, - { - type: "string" - } - ] - } - } - }, - required: ["exclude"], - additionalProperties: false - }, - IncludeQueryFilter: { - type: "object", - description: "Filter to include queries", - properties: { - include: { - type: "object", - description: "Queries to include", - additionalProperties: { - oneOf: [ - { - type: "array", - items: { - type: "string" - } - }, - { - type: "string" - } - ] - } - } - }, - required: ["include"], - additionalProperties: false - } - } - }; - } -}); - -// node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = getOptions; - var core31 = __importStar2(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - matchDirectories: true, - omitBrokenSymbolicLinks: true, - excludeHiddenFiles: false - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core31.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core31.debug(`implicitDescendants '${result.implicitDescendants}'`); - } - if (typeof copy.matchDirectories === "boolean") { - result.matchDirectories = copy.matchDirectories; - core31.debug(`matchDirectories '${result.matchDirectories}'`); - } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core31.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); - } - if (typeof copy.excludeHiddenFiles === "boolean") { - result.excludeHiddenFiles = copy.excludeHiddenFiles; - core31.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); - } - } - return result; - } - } -}); - -// node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.dirname = dirname6; - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - exports2.hasRoot = hasRoot; - exports2.normalizeSeparators = normalizeSeparators; - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path30 = __importStar2(require("path")); - var assert_1 = __importDefault2(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname6(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - let result = path30.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; - } - function ensureAbsoluteRoot(root, itemPath) { - (0, assert_1.default)(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - (0, assert_1.default)(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); - if (hasAbsoluteRoot(itemPath)) { - return itemPath; - } - if (IS_WINDOWS) { - if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { - let cwd = process.cwd(); - (0, assert_1.default)(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); - if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { - if (itemPath.length === 2) { - return `${itemPath[0]}:\\${cwd.substr(3)}`; - } else { - if (!cwd.endsWith("\\")) { - cwd += "\\"; - } - return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; - } - } else { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; - } - } else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { - const cwd = process.cwd(); - (0, assert_1.default)(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); - return `${cwd[0]}:\\${itemPath.substr(1)}`; - } - } - (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path30.sep; - } - return root + itemPath; - } - function hasAbsoluteRoot(itemPath) { - (0, assert_1.default)(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); - itemPath = normalizeSeparators(itemPath); - if (IS_WINDOWS) { - return itemPath.startsWith("\\\\") || /^[A-Z]:\\/i.test(itemPath); - } - return itemPath.startsWith("/"); - } - function hasRoot(itemPath) { - (0, assert_1.default)(itemPath, `isRooted parameter 'itemPath' must not be empty`); - itemPath = normalizeSeparators(itemPath); - if (IS_WINDOWS) { - return itemPath.startsWith("\\") || /^[A-Z]:/i.test(itemPath); - } - return itemPath.startsWith("/"); - } - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); - } - return p.replace(/\/\/+/g, "/"); - } - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; - } - p = normalizeSeparators(p); - if (!p.endsWith(path30.sep)) { - return p; - } - if (p === path30.sep) { - return p; - } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; - } - return p.substr(0, p.length - 1); - } - } -}); - -// node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/glob/lib/internal-match-kind.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MatchKind = void 0; - var MatchKind; - (function(MatchKind2) { - MatchKind2[MatchKind2["None"] = 0] = "None"; - MatchKind2[MatchKind2["Directory"] = 1] = "Directory"; - MatchKind2[MatchKind2["File"] = 2] = "File"; - MatchKind2[MatchKind2["All"] = 3] = "All"; - })(MatchKind || (exports2.MatchKind = MatchKind = {})); - } -}); - -// node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSearchPaths = getSearchPaths; - exports2.match = match2; - exports2.partialMatch = partialMatch; - var pathHelper = __importStar2(require_internal_path_helper()); - var internal_match_kind_1 = require_internal_match_kind(); - var IS_WINDOWS = process.platform === "win32"; - function getSearchPaths(patterns) { - patterns = patterns.filter((x) => !x.negate); - const searchPathMap = {}; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - searchPathMap[key] = "candidate"; - } - const result = []; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - if (searchPathMap[key] === "included") { - continue; - } - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; - } - tempKey = parent; - parent = pathHelper.dirname(tempKey); - } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; - } - } - return result; - } - function match2(patterns, itemPath) { - let result = internal_match_kind_1.MatchKind.None; - for (const pattern of patterns) { - if (pattern.negate) { - result &= ~pattern.match(itemPath); - } else { - result |= pattern.match(itemPath); - } - } - return result; - } - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); - } - } -}); - -// node_modules/concat-map/index.js -var require_concat_map = __commonJS({ - "node_modules/concat-map/index.js"(exports2, module2) { - module2.exports = function(xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray2(x)) res.push.apply(res, x); - else res.push(x); - } - return res; - }; - var isArray2 = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; - }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced2; - function balanced2(a, b, str) { - if (a instanceof RegExp) a = maybeMatch2(a, str); - if (b instanceof RegExp) b = maybeMatch2(b, str); - var r = range2(a, b, str); - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; - } - function maybeMatch2(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; - } - balanced2.range = range2; - function range2(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [begs.pop(), bi]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - bi = str.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length) { - result = [left, right]; - } - } - return result; - } - } -}); - -// node_modules/brace-expansion/index.js -var require_brace_expansion = __commonJS({ - "node_modules/brace-expansion/index.js"(exports2, module2) { - var concatMap = require_concat_map(); - var balanced2 = require_balanced_match(); - module2.exports = expandTop; - var escSlash2 = "\0SLASH" + Math.random() + "\0"; - var escOpen2 = "\0OPEN" + Math.random() + "\0"; - var escClose2 = "\0CLOSE" + Math.random() + "\0"; - var escComma2 = "\0COMMA" + Math.random() + "\0"; - var escPeriod2 = "\0PERIOD" + Math.random() + "\0"; - var EXPANSION_MAX2 = 1e5; - var EXPANSION_MAX_LENGTH2 = 4e6; - function numeric2(str) { - return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); - } - function escapeBraces2(str) { - return str.split("\\\\").join(escSlash2).split("\\{").join(escOpen2).split("\\}").join(escClose2).split("\\,").join(escComma2).split("\\.").join(escPeriod2); - } - function unescapeBraces2(str) { - return str.split(escSlash2).join("\\").split(escOpen2).join("{").split(escClose2).join("}").split(escComma2).join(",").split(escPeriod2).join("."); - } - function parseCommaParts2(str) { - if (!str) - return [""]; - var parts = []; - var m = balanced2("{", "}", str); - if (!m) - return str.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts2(post); - if (post.length) { - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); - } - parts.push.apply(parts, p); - return parts; - } - function expandTop(str, options) { - if (!str) - return []; - options = options || {}; - var max = options.max == null ? EXPANSION_MAX2 : options.max; - var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH2 : options.maxLength; - if (str.substr(0, 2) === "{}") { - str = "\\{\\}" + str.substr(2); - } - return expand3(escapeBraces2(str), max, maxLength, true).map(unescapeBraces2); - } - function embrace2(str) { - return "{" + str + "}"; - } - function isPadded2(el) { - return /^-?0\d/.test(el); - } - function lte2(i, y) { - return i <= y; - } - function gte7(i, y) { - return i >= y; - } - function combine2(acc, base, pre, values, max, maxLength, dropEmpties, outBase) { - var out = []; - var length = 0; - for (var a = 0; a < acc.length; a++) { - for (var v = 0; v < values.length; v++) { - if (out.length >= max) return out; - var expansion = acc[a] + pre + values[v]; - if (dropEmpties && expansion.length === base[a]) continue; - if (length + expansion.length > maxLength) return out; - out.push(expansion); - outBase.push(base[a]); - length += expansion.length; - } - } - return out; - } - function expandSequence2(body, isAlphaSequence, max, maxLength) { - var n = body.split(/\.\./); - var N = []; - if (n[0] === void 0 || n[1] === void 0) { - return N; - } - var x = numeric2(n[0]); - var y = numeric2(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric2(n[2])), 1) : 1; - var test = lte2; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte7; - } - var pad = n.some(isPadded2); - var length = 0; - for (var i = x; test(i, y) && N.length < max; i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === "\\") { - c = ""; - } - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join("0"); - if (i < 0) { - c = "-" + z + c.slice(1); - } else { - c = z + c; - } - } - } - } - if (length + c.length > maxLength) break; - N.push(c); - length += c.length; - } - return N; - } - function expand3(str, max, maxLength, isTop) { - var acc = [""]; - var accBase = [0]; - var dropEmpties = false; - var firstGroup = true; - var nextBase; - for (; ; ) { - var m = balanced2("{", "}", str); - if (!m) { - return combine2(acc, accBase, str, [""], max, maxLength, dropEmpties, []); - } - var pre = m.pre; - if (/\$$/.test(pre)) { - return combine2(acc, accBase, str, [""], max, maxLength, dropEmpties, []); - } - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(",") >= 0; - if (!isSequence && !isOptions) { - if (m.post.match(/,(?!,).*\}/)) { - str = m.pre + "{" + m.body + escClose2 + m.post; - isTop = true; - firstGroup = true; - dropEmpties = false; - accBase = []; - for (var b = 0; b < acc.length; b++) { - accBase.push(acc[b].length); - } - continue; - } - return combine2( - acc, - accBase, - pre + "{" + m.body + "}" + m.post, - [""], - max, - maxLength, - dropEmpties, - [] - ); - } - if (firstGroup) { - dropEmpties = isTop && !isSequence; - firstGroup = false; - } - var values; - if (isSequence) { - values = expandSequence2(m.body, isAlphaSequence, max, maxLength); - } else { - var n = parseCommaParts2(m.body); - if (n.length === 1 && n[0] !== void 0) { - n = expand3(n[0], max, maxLength, false).map(embrace2); - if (n.length === 1) { - nextBase = []; - acc = combine2( - acc, - accBase, - pre + n[0], - [""], - max, - maxLength, - dropEmpties && !m.post.length, - nextBase - ); - accBase = nextBase; - if (!m.post.length) break; - str = m.post; - continue; - } - } - var dropsEmpties = dropEmpties && !m.post.length && !pre; - for (var d = 0; dropsEmpties && d < acc.length; d++) { - if (acc[d].length !== accBase[d]) { - dropsEmpties = false; - } - } - values = []; - var valuesLength = 0; - outer: for (var j = 0; j < n.length; j++) { - var expanded = expand3(n[j], max, maxLength, false); - for (var k = 0; k < expanded.length; k++) { - var v = expanded[k]; - if (dropsEmpties && !v) continue; - if (values.length >= max || valuesLength + v.length > maxLength) { - break outer; - } - values.push(v); - valuesLength += v.length; - } - } - } - nextBase = []; - acc = combine2( - acc, - accBase, - pre, - values, - max, - maxLength, - dropEmpties && !m.post.length, - nextBase - ); - accBase = nextBase; - if (!m.post.length) break; - str = m.post; - } - return acc; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch2; - minimatch2.Minimatch = Minimatch2; - var path30 = (function() { - try { - return require("path"); - } catch (e) { - } - })() || { - sep: "/" - }; - minimatch2.sep = path30.sep; - var GLOBSTAR2 = minimatch2.GLOBSTAR = Minimatch2.GLOBSTAR = {}; - var expand3 = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark3 = "[^/]"; - var star3 = qmark3 + "*?"; - var twoStarDot2 = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot2 = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials2 = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set, c) { - set[c] = true; - return set; - }, {}); - } - var slashSplit = /\/+/; - minimatch2.filter = filter2; - function filter2(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch2(p, pattern, options); - }; - } - function ext2(a, b) { - b = b || {}; - var t = {}; - Object.keys(a).forEach(function(k) { - t[k] = a[k]; - }); - Object.keys(b).forEach(function(k) { - t[k] = b[k]; - }); - return t; - } - minimatch2.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch2; - } - var orig = minimatch2; - var m = function minimatch3(p, pattern, options) { - return orig(p, pattern, ext2(def, options)); - }; - m.Minimatch = function Minimatch3(pattern, options) { - return new orig.Minimatch(pattern, ext2(def, options)); - }; - m.Minimatch.defaults = function defaults3(options) { - return orig.defaults(ext2(def, options)).Minimatch; - }; - m.filter = function filter3(pattern, options) { - return orig.filter(pattern, ext2(def, options)); - }; - m.defaults = function defaults3(options) { - return orig.defaults(ext2(def, options)); - }; - m.makeRe = function makeRe3(pattern, options) { - return orig.makeRe(pattern, ext2(def, options)); - }; - m.braceExpand = function braceExpand3(pattern, options) { - return orig.braceExpand(pattern, ext2(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext2(def, options)); - }; - return m; - }; - Minimatch2.defaults = function(def) { - return minimatch2.defaults(def).Minimatch; - }; - function minimatch2(p, pattern, options) { - assertValidPattern2(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; - } - return new Minimatch2(pattern, options).match(p); - } - function Minimatch2(pattern, options) { - if (!(this instanceof Minimatch2)) { - return new Minimatch2(pattern, options); - } - assertValidPattern2(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path30.sep !== "/") { - pattern = pattern.split(path30.sep).join("/"); - } - this.options = options; - this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch2.prototype.debug = function() { - }; - Minimatch2.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; - } - if (!pattern) { - this.empty = true; - return; - } - this.parseNegate(); - var set = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug6() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set); - set = this.globParts = set.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set); - set = set.map(function(s, si, set2) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set); - set = set.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set); - this.set = set; - } - Minimatch2.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate2 = false; - var options = this.options; - var negateOffset = 0; - if (options.nonegate) return; - for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { - negate2 = !negate2; - negateOffset++; - } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate2; - } - minimatch2.braceExpand = function(pattern, options) { - return braceExpand2(pattern, options); - }; - Minimatch2.prototype.braceExpand = braceExpand2; - function braceExpand2(pattern, options) { - if (!options) { - if (this instanceof Minimatch2) { - options = this.options; - } else { - options = {}; - } - } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern2(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; - } - return expand3(pattern); - } - var MAX_PATTERN_LENGTH2 = 1024 * 64; - var assertValidPattern2 = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); - } - if (pattern.length > MAX_PATTERN_LENGTH2) { - throw new TypeError("pattern is too long"); - } - }; - Minimatch2.prototype.parse = parse3; - var SUBPARSE = {}; - function parse3(pattern, isSub) { - assertValidPattern2(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR2; - else - pattern = "*"; - } - if (pattern === "") return ""; - var re = ""; - var hasMagic = !!options.nocase; - var escaping = false; - var patternListStack = []; - var negativeLists = []; - var stateChar; - var inClass = false; - var reClassStart = -1; - var classStart = -1; - var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; - var self2 = this; - function clearStateChar() { - if (stateChar) { - switch (stateChar) { - case "*": - re += star3; - hasMagic = true; - break; - case "?": - re += qmark3; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; - } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; - } - } - for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { - this.debug("%s %s %s %j", pattern, i, re, c); - if (escaping && reSpecials2[c]) { - re += "\\" + c; - escaping = false; - continue; - } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; - } - case "\\": - clearStateChar(); - escaping = true; - continue; - // the various stateChar values - // for the "extglob" stuff. - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); - if (inClass) { - this.debug(" in class"); - if (c === "!" && i === classStart + 1) c = "^"; - re += c; - continue; - } - if (c === "*" && stateChar === "*") continue; - self2.debug("call clearStateChar %j", stateChar); - clearStateChar(); - stateChar = c; - if (options.noext) clearStateChar(); - continue; - case "(": - if (inClass) { - re += "("; - continue; - } - if (!stateChar) { - re += "\\("; - continue; - } - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }); - re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; - this.debug("plType %j %j", stateChar, re); - stateChar = false; - continue; - case ")": - if (inClass || !patternListStack.length) { - re += "\\)"; - continue; - } - clearStateChar(); - hasMagic = true; - var pl = patternListStack.pop(); - re += pl.close; - if (pl.type === "!") { - negativeLists.push(pl); - } - pl.reEnd = re.length; - continue; - case "|": - if (inClass || !patternListStack.length || escaping) { - re += "\\|"; - escaping = false; - continue; - } - clearStateChar(); - re += "|"; - continue; - // these are mostly the same in regexp and glob - case "[": - clearStateChar(); - if (inClass) { - re += "\\" + c; - continue; - } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; - } - var cs = pattern.substring(classStart + 1, i); - try { - RegExp("[" + cs + "]"); - } catch (er) { - var sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; - hasMagic = hasMagic || sp[1]; - inClass = false; - continue; - } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials2[c] && !(c === "^" && inClass)) { - re += "\\"; - } - re += c; - } - } - if (inClass) { - cs = pattern.substr(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; - } - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length); - this.debug("setting tail", re, pl); - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_2, $1, $2) { - if (!$2) { - $2 = "\\"; - } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star3 : pl.type === "?" ? qmark3 : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; - } - clearStateChar(); - if (escaping) { - re += "\\\\"; - } - var addPatternStart2 = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart2 = true; - } - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n]; - var nlBefore = re.slice(0, nl.reStart); - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); - var nlAfter = re.slice(nl.reEnd); - nlLast += nlAfter; - var openParensBefore = nlBefore.split("(").length - 1; - var cleanAfter = nlAfter; - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); - } - nlAfter = cleanAfter; - var dollar = ""; - if (nlAfter === "" && isSub !== SUBPARSE) { - dollar = "$"; - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; - } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; - } - if (addPatternStart2) { - re = patternStart + re; - } - if (isSub === SUBPARSE) { - return [re, hasMagic]; - } - if (!hasMagic) { - return globUnescape(pattern); - } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); - } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch2.makeRe = function(pattern, options) { - return new Minimatch2(pattern, options || {}).makeRe(); - }; - Minimatch2.prototype.makeRe = makeRe2; - function makeRe2() { - if (this.regexp || this.regexp === false) return this.regexp; - var set = this.set; - if (!set.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star3 : options.dot ? twoStarDot2 : twoStarNoDot2; - var flags = options.nocase ? "i" : ""; - var re = set.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR2 ? twoStar : typeof p === "string" ? regExpEscape3(p) : p._src; - }).join("\\/"); - }).join("|"); - re = "^(?:" + re + ")$"; - if (this.negate) re = "^(?!" + re + ").*$"; - try { - this.regexp = new RegExp(re, flags); - } catch (ex) { - this.regexp = false; - } - return this.regexp; - } - minimatch2.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch2(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch2.prototype.match = function match2(f, partial) { - if (typeof partial === "undefined") partial = this.partial; - this.debug("match", f, this.pattern); - if (this.comment) return false; - if (this.empty) return f === ""; - if (f === "/" && partial) return true; - var options = this.options; - if (path30.sep !== "/") { - f = f.split(path30.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set = this.set; - this.debug(this.pattern, "set", set); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set.length; i++) { - var pattern = set[i]; - var file = f; - if (options.matchBase && pattern.length === 1) { - file = [filename]; - } - var hit = this.matchOne(file, pattern, partial); - if (hit) { - if (options.flipNegate) return true; - return !this.negate; - } - } - if (options.flipNegate) return false; - return this.negate; - }; - Minimatch2.prototype.matchOne = function(file, pattern, partial) { - if (pattern.indexOf(GLOBSTAR2) !== -1) { - return this._matchGlobstar(file, pattern, partial, 0, 0); - } - return this._matchOne(file, pattern, partial, 0, 0); - }; - Minimatch2.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { - var i; - var firstgs = -1; - for (i = patternIndex; i < pattern.length; i++) { - if (pattern[i] === GLOBSTAR2) { - firstgs = i; - break; - } - } - var lastgs = -1; - for (i = pattern.length - 1; i >= 0; i--) { - if (pattern[i] === GLOBSTAR2) { - lastgs = i; - break; - } - } - var head = pattern.slice(patternIndex, firstgs); - var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); - var tail = partial ? [] : pattern.slice(lastgs + 1); - if (head.length) { - var fileHead = file.slice(fileIndex, fileIndex + head.length); - if (!this._matchOne(fileHead, head, partial, 0, 0)) { - return false; - } - fileIndex += head.length; - } - var fileTailMatch = 0; - if (tail.length) { - if (tail.length + fileIndex > file.length) return false; - var tailStart = file.length - tail.length; - if (this._matchOne(file, tail, partial, tailStart, 0)) { - fileTailMatch = tail.length; - } else { - if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { - return false; - } - tailStart--; - if (!this._matchOne(file, tail, partial, tailStart, 0)) { - return false; - } - fileTailMatch = tail.length + 1; - } - } - if (!body.length) { - var sawSome = !!fileTailMatch; - for (i = fileIndex; i < file.length - fileTailMatch; i++) { - var f = String(file[i]); - sawSome = true; - if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { - return false; - } - } - return partial || sawSome; - } - var bodySegments = [[[], 0]]; - var currentBody = bodySegments[0]; - var nonGsParts = 0; - var nonGsPartsSums = [0]; - for (var bi = 0; bi < body.length; bi++) { - var b = body[bi]; - if (b === GLOBSTAR2) { - nonGsPartsSums.push(nonGsParts); - currentBody = [[], 0]; - bodySegments.push(currentBody); - } else { - currentBody[0].push(b); - nonGsParts++; - } - } - var idx = bodySegments.length - 1; - var fileLength = file.length - fileTailMatch; - for (var si = 0; si < bodySegments.length; si++) { - bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); - } - return !!this._matchGlobStarBodySections( - file, - bodySegments, - fileIndex, - 0, - partial, - 0, - !!fileTailMatch - ); - }; - Minimatch2.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { - var bs = bodySegments[bodyIndex]; - if (!bs) { - for (var i = fileIndex; i < file.length; i++) { - sawTail = true; - var f = file[i]; - if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { - return false; - } - } - return sawTail; - } - var body = bs[0]; - var after = bs[1]; - while (fileIndex <= after) { - var m = this._matchOne( - file.slice(0, fileIndex + body.length), - body, - partial, - fileIndex, - 0 - ); - if (m && globStarDepth < this.maxGlobstarRecursion) { - var sub = this._matchGlobStarBodySections( - file, - bodySegments, - fileIndex + body.length, - bodyIndex + 1, - partial, - globStarDepth + 1, - sawTail - ); - if (sub !== false) { - return sub; - } - } - var f = file[fileIndex]; - if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { - return false; - } - fileIndex++; - } - return partial || null; - }; - Minimatch2.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { - var fi, pi, fl, pl; - for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { - this.debug("matchOne loop"); - var p = pattern[pi]; - var f = file[fi]; - this.debug(pattern, p, f); - if (p === false || p === GLOBSTAR2) return false; - var hit; - if (typeof p === "string") { - hit = f === p; - this.debug("string match", p, f, hit); - } else { - hit = f.match(p); - this.debug("pattern match", p, f, hit); - } - if (!hit) return false; - } - if (fi === fl && pi === pl) { - return true; - } else if (fi === fl) { - return partial; - } else if (pi === pl) { - return fi === fl - 1 && file[fi] === ""; - } - throw new Error("wtf?"); - }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape3(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } - } -}); - -// node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/glob/lib/internal-path.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path30 = __importStar2(require("path")); - var pathHelper = __importStar2(require_internal_path_helper()); - var assert_1 = __importDefault2(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - var Path = class { - /** - * Constructs a Path - * @param itemPath Path or array of segments - */ - constructor(itemPath) { - this.segments = []; - if (typeof itemPath === "string") { - (0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path30.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename2 = path30.basename(remaining); - this.segments.unshift(basename2); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - (0, assert_1.default)(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); - for (let i = 0; i < itemPath.length; i++) { - let segment = itemPath[i]; - (0, assert_1.default)(segment, `Parameter 'itemPath' must not contain any empty segments`); - segment = pathHelper.normalizeSeparators(itemPath[i]); - if (i === 0 && pathHelper.hasRoot(segment)) { - segment = pathHelper.safeTrimTrailingSeparator(segment); - (0, assert_1.default)(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - (0, assert_1.default)(!segment.includes(path30.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } - } - } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path30.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path30.sep; - } - result += this.segments[i]; - } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os7 = __importStar2(require("os")); - var path30 = __importStar2(require("path")); - var pathHelper = __importStar2(require_internal_path_helper()); - var assert_1 = __importDefault2(require("assert")); - var minimatch_1 = require_minimatch(); - var internal_match_kind_1 = require_internal_match_kind(); - var internal_path_1 = require_internal_path(); - var IS_WINDOWS = process.platform === "win32"; - var Pattern = class _Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir2) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - (0, assert_1.default)(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[0]); - (0, assert_1.default)(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); - pattern = new internal_path_1.Path(segments).toString().trim(); - if (patternOrNegate) { - pattern = `!${pattern}`; - } - } - while (pattern.startsWith("!")) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); - } - pattern = _Pattern.fixupPattern(pattern, homedir2); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path30.sep); - pattern = pathHelper.safeTrimTrailingSeparator(pattern); - let foundGlob = false; - const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); - this.searchPath = new internal_path_1.Path(searchSegments).toString(); - this.rootRegExp = new RegExp(_Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? "i" : ""); - this.isImplicitPattern = isImplicitPattern; - const minimatchOptions = { - dot: true, - nobrace: true, - nocase: IS_WINDOWS, - nocomment: true, - noext: true, - nonegate: true - }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); - } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path30.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path30.sep}`; - } - } else { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - } - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; - } - return internal_match_kind_1.MatchKind.None; - } - /** - * Indicates whether the pattern may match descendants of the specified path - */ - partialMatch(itemPath) { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (pathHelper.dirname(itemPath) === itemPath) { - return this.rootRegExp.test(itemPath); - } - return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); - } - /** - * Escapes glob patterns within a path - */ - static globEscape(s) { - return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); - } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir2) { - (0, assert_1.default)(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - (0, assert_1.default)(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - (0, assert_1.default)(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); - pattern = pathHelper.normalizeSeparators(pattern); - if (pattern === "." || pattern.startsWith(`.${path30.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path30.sep}`)) { - homedir2 = homedir2 || os7.homedir(); - (0, assert_1.default)(homedir2, "Unable to determine HOME directory"); - (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir2), `Expected HOME directory to be a rooted path. Actual '${homedir2}'`); - pattern = _Pattern.globEscape(homedir2) + pattern.substr(1); - } else if (IS_WINDOWS && (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { - let root = pathHelper.ensureAbsoluteRoot("C:\\dummy-root", pattern.substr(0, 2)); - if (pattern.length > 2 && !root.endsWith("\\")) { - root += "\\"; - } - pattern = _Pattern.globEscape(root) + pattern.substr(2); - } else if (IS_WINDOWS && (pattern === "\\" || pattern.match(/^\\[^\\]/))) { - let root = pathHelper.ensureAbsoluteRoot("C:\\dummy-root", "\\"); - if (!root.endsWith("\\")) { - root += "\\"; - } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); - } - /** - * Attempts to unescape a pattern segment to create a literal path segment. - * Otherwise returns empty string. - */ - static getLiteral(segment) { - let literal = ""; - for (let i = 0; i < segment.length; i++) { - const c = segment[i]; - if (c === "\\" && !IS_WINDOWS && i + 1 < segment.length) { - literal += segment[++i]; - continue; - } else if (c === "*" || c === "?") { - return ""; - } else if (c === "[" && i + 1 < segment.length) { - let set = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set += c2; - } - } - if (closed >= 0) { - if (set.length > 1) { - return ""; - } - if (set) { - literal += set; - i = closed; - continue; - } - } - } - literal += c; - } - return literal; - } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); - } - }; - exports2.Pattern = Pattern; - } -}); - -// node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/glob/lib/internal-search-state.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SearchState = void 0; - var SearchState = class { - constructor(path30, level) { - this.path = path30; - this.level = level; - } - }; - exports2.SearchState = SearchState; - } -}); - -// node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/glob/lib/internal-globber.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues2 = exports2 && exports2.__asyncValues || function(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function(v) { - return new Promise(function(resolve14, reject) { - v = o[n](v), settle(resolve14, reject, v.done, v.value); - }); - }; - } - function settle(resolve14, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve14({ value: v2, done: d }); - }, reject); - } - }; - var __await2 = exports2 && exports2.__await || function(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); - }; - var __asyncGenerator2 = exports2 && exports2.__asyncGenerator || function(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function awaitReturn(f) { - return function(v) { - return Promise.resolve(v).then(f, reject); - }; - } - function verb(n, f) { - if (g[n]) { - i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - if (f) i[n] = f(i[n]); - } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); - } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core31 = __importStar2(require_core()); - var fs32 = __importStar2(require("fs")); - var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path30 = __importStar2(require("path")); - var patternHelper = __importStar2(require_internal_pattern_helper()); - var internal_match_kind_1 = require_internal_match_kind(); - var internal_pattern_1 = require_internal_pattern(); - var internal_search_state_1 = require_internal_search_state(); - var IS_WINDOWS = process.platform === "win32"; - var DefaultGlobber = class _DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); - } - getSearchPaths() { - return this.searchPaths.slice(); - } - glob() { - return __awaiter2(this, void 0, void 0, function* () { - var _a2, e_1, _b, _c; - const result = []; - try { - for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a2 = _f.done, !_a2; _d = true) { - _c = _f.value; - _d = false; - const itemPath = _c; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a2 && (_b = _e.return)) yield _b.call(_e); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); - } - globGenerator() { - return __asyncGenerator2(this, arguments, function* globGenerator_1() { - const options = globOptionsHelper.getOptions(this.options); - const patterns = []; - for (const pattern of this.patterns) { - patterns.push(pattern); - if (options.implicitDescendants && (pattern.trailingSeparator || pattern.segments[pattern.segments.length - 1] !== "**")) { - patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat("**"))); - } - } - const stack = []; - for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core31.debug(`Search path '${searchPath}'`); - try { - yield __await2(fs32.promises.lstat(searchPath)); - } catch (err) { - if (err.code === "ENOENT") { - continue; - } - throw err; - } - stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); - } - const traversalChain = []; - while (stack.length) { - const item = stack.pop(); - const match2 = patternHelper.match(patterns, item.path); - const partialMatch = !!match2 || patternHelper.partialMatch(patterns, item.path); - if (!match2 && !partialMatch) { - continue; - } - const stats = yield __await2( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (options.excludeHiddenFiles && path30.basename(item.path).match(/^\./)) { - continue; - } - if (stats.isDirectory()) { - if (match2 & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { - yield yield __await2(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await2(fs32.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path30.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match2 & internal_match_kind_1.MatchKind.File) { - yield yield __await2(item.path); - } - } - }); - } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter2(this, void 0, void 0, function* () { - const result = new _DefaultGlobber(options); - if (IS_WINDOWS) { - patterns = patterns.replace(/\r\n/g, "\n"); - patterns = patterns.replace(/\r/g, "\n"); - } - const lines = patterns.split("\n").map((x) => x.trim()); - for (const line of lines) { - if (!line || line.startsWith("#")) { - continue; - } else { - result.patterns.push(new internal_pattern_1.Pattern(line)); - } - } - result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); - return result; - }); - } - static stat(item, options, traversalChain) { - return __awaiter2(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs32.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core31.debug(`Broken symlink '${item.path}'`); - return void 0; - } - throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); - } - throw err; - } - } else { - stats = yield fs32.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs32.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core31.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; - } - traversalChain.push(realPath); - } - return stats; - }); - } - }; - exports2.DefaultGlobber = DefaultGlobber; - } -}); - -// node_modules/@actions/glob/lib/internal-hash-files.js -var require_internal_hash_files = __commonJS({ - "node_modules/@actions/glob/lib/internal-hash-files.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues2 = exports2 && exports2.__asyncValues || function(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function(v) { - return new Promise(function(resolve14, reject) { - v = o[n](v), settle(resolve14, reject, v.done, v.value); - }); - }; - } - function settle(resolve14, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve14({ value: v2, done: d }); - }, reject); - } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = hashFiles2; - var crypto3 = __importStar2(require("crypto")); - var core31 = __importStar2(require_core()); - var fs32 = __importStar2(require("fs")); - var stream2 = __importStar2(require("stream")); - var util3 = __importStar2(require("util")); - var path30 = __importStar2(require("path")); - function hashFiles2(globber_1, currentWorkspace_1) { - return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { - var _a2, e_1, _b, _c; - var _d; - const writeDelegate = verbose ? core31.info : core31.debug; - let hasMatch = false; - const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const result = crypto3.createHash("sha256"); - let count = 0; - try { - for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a2 = _g.done, !_a2; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path30.sep}`)) { - writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); - continue; - } - if (fs32.statSync(file).isDirectory()) { - writeDelegate(`Skip directory '${file}'.`); - continue; - } - const hash2 = crypto3.createHash("sha256"); - const pipeline2 = util3.promisify(stream2.pipeline); - yield pipeline2(fs32.createReadStream(file), hash2); - result.write(hash2.digest()); - count++; - if (!hasMatch) { - hasMatch = true; - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a2 && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - result.end(); - if (hasMatch) { - writeDelegate(`Found ${count} files to hash.`); - return result.digest("hex"); - } else { - writeDelegate(`No matches found for glob`); - return ""; - } - }); - } - } -}); - -// node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/glob/lib/glob.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.create = create3; - exports2.hashFiles = hashFiles2; - var internal_globber_1 = require_internal_globber(); - var internal_hash_files_1 = require_internal_hash_files(); - function create3(patterns, options) { - return __awaiter2(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); - } - function hashFiles2(patterns_1) { - return __awaiter2(this, arguments, void 0, function* (patterns, currentWorkspace = "", options, verbose = false) { - let followSymbolicLinks = true; - if (options && typeof options.followSymbolicLinks === "boolean") { - followSymbolicLinks = options.followSymbolicLinks; - } - const globber = yield create3(patterns, { followSymbolicLinks }); - return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); - }); - } - } -}); - -// node_modules/@actions/cache/node_modules/semver/semver.js -var require_semver3 = __commonJS({ - "node_modules/@actions/cache/node_modules/semver/semver.js"(exports2, module2) { - exports2 = module2.exports = SemVer; - var debug6; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug6 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug6 = function() { - }; - } - exports2.SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; - var re = exports2.re = []; - var safeRe = exports2.safeRe = []; - var src = exports2.src = []; - var t = exports2.tokens = {}; - var R = 0; - function tok(n) { - t[n] = R++; - } - var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; - var safeRegexReplacements = [ - ["\\s", 1], - ["\\d", MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] - ]; - function makeSafeRe(value) { - for (var i2 = 0; i2 < safeRegexReplacements.length; i2++) { - var token = safeRegexReplacements[i2][0]; - var max = safeRegexReplacements[i2][1]; - value = value.split(token + "*").join(token + "{0," + max + "}").split(token + "+").join(token + "{1," + max + "}"); - } - return value; - } - tok("NUMERICIDENTIFIER"); - src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*"; - tok("NUMERICIDENTIFIERLOOSE"); - src[t.NUMERICIDENTIFIERLOOSE] = "\\d+"; - tok("NONNUMERICIDENTIFIER"); - src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*"; - tok("MAINVERSION"); - src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")"; - tok("MAINVERSIONLOOSE"); - src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")"; - tok("PRERELEASEIDENTIFIER"); - src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; - tok("PRERELEASEIDENTIFIERLOOSE"); - src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; - tok("PRERELEASE"); - src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))"; - tok("PRERELEASELOOSE"); - src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))"; - tok("BUILDIDENTIFIER"); - src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + "+"; - tok("BUILD"); - src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))"; - tok("FULL"); - tok("FULLPLAIN"); - src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?"; - src[t.FULL] = "^" + src[t.FULLPLAIN] + "$"; - tok("LOOSEPLAIN"); - src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?"; - tok("LOOSE"); - src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$"; - tok("GTLT"); - src[t.GTLT] = "((?:<|>)?=?)"; - tok("XRANGEIDENTIFIERLOOSE"); - src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"; - tok("XRANGEIDENTIFIER"); - src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*"; - tok("XRANGEPLAIN"); - src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?"; - tok("XRANGEPLAINLOOSE"); - src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?"; - tok("XRANGE"); - src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$"; - tok("XRANGELOOSE"); - src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$"; - tok("COERCE"); - src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])"; - tok("COERCERTL"); - re[t.COERCERTL] = new RegExp(src[t.COERCE], "g"); - safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), "g"); - tok("LONETILDE"); - src[t.LONETILDE] = "(?:~>?)"; - tok("TILDETRIM"); - src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+"; - re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g"); - safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), "g"); - var tildeTrimReplace = "$1~"; - tok("TILDE"); - src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$"; - tok("TILDELOOSE"); - src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$"; - tok("LONECARET"); - src[t.LONECARET] = "(?:\\^)"; - tok("CARETTRIM"); - src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+"; - re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g"); - safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), "g"); - var caretTrimReplace = "$1^"; - tok("CARET"); - src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$"; - tok("CARETLOOSE"); - src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$"; - tok("COMPARATORLOOSE"); - src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$"; - tok("COMPARATOR"); - src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$"; - tok("COMPARATORTRIM"); - src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")"; - re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g"); - safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), "g"); - var comparatorTrimReplace = "$1$2$3"; - tok("HYPHENRANGE"); - src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$"; - tok("HYPHENRANGELOOSE"); - src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$"; - tok("STAR"); - src[t.STAR] = "(<|>)?=?\\s*\\*"; - for (i = 0; i < R; i++) { - debug6(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse3; - function parse3(version, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (version instanceof SemVer) { - return version; - } - if (typeof version !== "string") { - return null; - } - if (version.length > MAX_LENGTH) { - return null; - } - var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version)) { - return null; - } - try { - return new SemVer(version, options); - } catch (er) { - return null; - } - } - exports2.valid = valid4; - function valid4(version, options) { - var v = parse3(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse3(version.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; - } - exports2.SemVer = SemVer; - function SemVer(version, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; - } else { - version = version.version; - } - } else if (typeof version !== "string") { - throw new TypeError("Invalid Version: " + version); - } - if (version.length > MAX_LENGTH) { - throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); - } - if (!(this instanceof SemVer)) { - return new SemVer(version, options); - } - debug6("SemVer", version, options); - this.options = options; - this.loose = !!options.loose; - var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); - if (!m) { - throw new TypeError("Invalid Version: " + version); - } - this.raw = version; - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); - } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); - } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); - } - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split(".").map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - return id; - }); - } - this.build = m[5] ? m[5].split(".") : []; - this.format(); - } - SemVer.prototype.format = function() { - this.version = this.major + "." + this.minor + "." + this.patch; - if (this.prerelease.length) { - this.version += "-" + this.prerelease.join("."); - } - return this.version; - }; - SemVer.prototype.toString = function() { - return this.version; - }; - SemVer.prototype.compare = function(other) { - debug6("SemVer.compare", this.version, this.options, other); - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - return this.compareMain(other) || this.comparePre(other); - }; - SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); - }; - SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; - } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug6("prerelease compare", i2, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i2); - }; - SemVer.prototype.compareBuild = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - var i2 = 0; - do { - var a = this.build[i2]; - var b = other.build[i2]; - debug6("prerelease compare", i2, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i2); - }; - SemVer.prototype.inc = function(release2, identifier) { - switch (release2) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier); - this.inc("pre", identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier); - } - this.inc("pre", identifier); - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case "pre": - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - var i2 = this.prerelease.length; - while (--i2 >= 0) { - if (typeof this.prerelease[i2] === "number") { - this.prerelease[i2]++; - i2 = -2; - } - } - if (i2 === -1) { - this.prerelease.push(0); - } - } - if (identifier) { - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - break; - default: - throw new Error("invalid increment argument: " + release2); - } - this.format(); - this.raw = this.version; - return this; - }; - exports2.inc = inc; - function inc(version, release2, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; - } - try { - return new SemVer(version, loose).inc(release2, identifier).version; - } catch (er) { - return null; - } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse3(version1); - var v2 = parse3(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; - } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } - } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric2 = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric2.test(a); - var bnum = numeric2.test(b); - if (anum && bnum) { - a = +a; - b = +b; - } - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; - } - exports2.rcompareIdentifiers = rcompareIdentifiers; - function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); - } - exports2.major = major; - function major(a, loose) { - return new SemVer(a, loose).major; - } - exports2.minor = minor; - function minor(a, loose) { - return new SemVer(a, loose).minor; - } - exports2.patch = patch; - function patch(a, loose) { - return new SemVer(a, loose).patch; - } - exports2.compare = compare3; - function compare3(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare3(a, b, true); - } - exports2.compareBuild = compareBuild; - function compareBuild(a, b, loose) { - var versionA = new SemVer(a, loose); - var versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); - } - exports2.rcompare = rcompare3; - function rcompare3(a, b, loose) { - return compare3(b, a, loose); - } - exports2.sort = sort; - function sort(list, loose) { - return list.sort(function(a, b) { - return exports2.compareBuild(a, b, loose); - }); - } - exports2.rsort = rsort; - function rsort(list, loose) { - return list.sort(function(a, b) { - return exports2.compareBuild(b, a, loose); - }); - } - exports2.gt = gt; - function gt(a, b, loose) { - return compare3(a, b, loose) > 0; - } - exports2.lt = lt2; - function lt2(a, b, loose) { - return compare3(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare3(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare3(a, b, loose) !== 0; - } - exports2.gte = gte7; - function gte7(a, b, loose) { - return compare3(a, b, loose) >= 0; - } - exports2.lte = lte2; - function lte2(a, b, loose) { - return compare3(a, b, loose) <= 0; - } - exports2.cmp = cmp; - function cmp(a, op, b, loose) { - switch (op) { - case "===": - if (typeof a === "object") - a = a.version; - if (typeof b === "object") - b = b.version; - return a === b; - case "!==": - if (typeof a === "object") - a = a.version; - if (typeof b === "object") - b = b.version; - return a !== b; - case "": - case "=": - case "==": - return eq(a, b, loose); - case "!=": - return neq(a, b, loose); - case ">": - return gt(a, b, loose); - case ">=": - return gte7(a, b, loose); - case "<": - return lt2(a, b, loose); - case "<=": - return lte2(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); - } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } - } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug6("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; - } - debug6("comp", this); - } - var ANY = {}; - Comparator.prototype.parse = function(comp) { - var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var m = comp.match(r); - if (!m) { - throw new TypeError("Invalid comparator: " + comp); - } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; - } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); - } - }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug6("Comparator.test", version, this.options.loose); - if (this.semver === ANY || version === ANY) { - return true; - } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } - } - return cmp(version, this.operator, this.semver, this.options); - }; - Comparator.prototype.intersects = function(comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError("a Comparator is required"); - } - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; - } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; - } - rangeTmp = new Range2(this.value, options); - return satisfies2(comp.semver, rangeTmp, options); - } - var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">"); - var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<"); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<="); - var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<")); - var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">")); - return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; - }; - exports2.Range = Range2; - function Range2(range2, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (range2 instanceof Range2) { - if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) { - return range2; - } else { - return new Range2(range2.raw, options); - } - } - if (range2 instanceof Comparator) { - return new Range2(range2.value, options); - } - if (!(this instanceof Range2)) { - return new Range2(range2, options); - } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range2.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range3) { - return this.parseRange(range3.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); - } - this.format(); - } - Range2.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(" ").trim(); - }).join("||").trim(); - return this.range; - }; - Range2.prototype.toString = function() { - return this.range; - }; - Range2.prototype.parseRange = function(range2) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range2 = range2.replace(hr, hyphenReplace); - debug6("hyphen replace", range2); - range2 = range2.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug6("comparator trim", range2, safeRe[t.COMPARATORTRIM]); - range2 = range2.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range2 = range2.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range2 = range2.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set = range2.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set; - }; - Range2.prototype.intersects = function(range2, options) { - if (!(range2 instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range2.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); - }; - function isSatisfiable(comparators, options) { - var result = true; - var remainingComparators = comparators.slice(); - var testComparator = remainingComparators.pop(); - while (result && remainingComparators.length) { - result = remainingComparators.every(function(otherComparator) { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); - } - return result; - } - exports2.toComparators = toComparators; - function toComparators(range2, options) { - return new Range2(range2, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug6("comp", comp, options); - comp = replaceCarets(comp, options); - debug6("caret", comp); - comp = replaceTildes(comp, options); - debug6("tildes", comp); - comp = replaceXRanges(comp, options); - debug6("xrange", comp); - comp = replaceStars(comp, options); - debug6("stars", comp); - return comp; - } - function isX(id) { - return !id || id.toLowerCase() === "x" || id === "*"; - } - function replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceTilde(comp2, options); - }).join(" "); - } - function replaceTilde(comp, options) { - var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; - return comp.replace(r, function(_2, M, m, p, pr) { - debug6("tilde", comp, _2, M, m, p, pr); - var ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; - } else if (isX(p)) { - ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; - } else if (pr) { - debug6("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } - debug6("tilde return", ret); - return ret; - }); - } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug6("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_2, M, m, p, pr) { - debug6("caret", comp, _2, M, m, p, pr); - var ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; - } else if (isX(p)) { - if (M === "0") { - ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0"; - } - } else if (pr) { - debug6("replaceCaret pr", pr); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1); - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; - } - } else { - debug6("no pr"); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } - } else { - ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; - } - } - debug6("caret return", ret); - return ret; - }); - } - function replaceXRanges(comp, options) { - debug6("replaceXRanges", comp, options); - return comp.split(/\s+/).map(function(comp2) { - return replaceXRange(comp2, options); - }).join(" "); - } - function replaceXRange(comp, options) { - comp = comp.trim(); - var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug6("xRange", comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; - } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m = 0; - } - p = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M = +M + 1; - } else { - m = +m + 1; - } - } - ret = gtlt + M + "." + m + "." + p + pr; - } else if (xm) { - ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr; - } else if (xp) { - ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr; - } - debug6("xRange return", ret); - return ret; - }); - } - function replaceStars(comp, options) { - debug6("replaceStars", comp, options); - return comp.trim().replace(safeRe[t.STAR], ""); - } - function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = ">=" + fM + ".0.0"; - } else if (isX(fp)) { - from = ">=" + fM + "." + fm + ".0"; - } else { - from = ">=" + from; - } - if (isX(tM)) { - to = ""; - } else if (isX(tm)) { - to = "<" + (+tM + 1) + ".0.0"; - } else if (isX(tp)) { - to = "<" + tM + "." + (+tm + 1) + ".0"; - } else if (tpr) { - to = "<=" + tM + "." + tm + "." + tp + "-" + tpr; - } else { - to = "<=" + to; - } - return (from + " " + to).trim(); - } - Range2.prototype.test = function(version) { - if (!version) { - return false; - } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } - } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } - } - return false; - }; - function testSet(set, version, options) { - for (var i2 = 0; i2 < set.length; i2++) { - if (!set[i2].test(version)) { - return false; - } - } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set.length; i2++) { - debug6(set[i2].semver); - if (set[i2].semver === ANY) { - continue; - } - if (set[i2].semver.prerelease.length > 0) { - var allowed = set[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } - } - } - return false; - } - return true; - } - exports2.satisfies = satisfies2; - function satisfies2(version, range2, options) { - try { - range2 = new Range2(range2, options); - } catch (er) { - return false; - } - return range2.test(version); - } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range2, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range2, options); - } catch (er) { - return null; - } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; - } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range2, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range2, options); - } catch (er) { - return null; - } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; - } - exports2.minVersion = minVersion; - function minVersion(range2, loose) { - range2 = new Range2(range2, loose); - var minver = new SemVer("0.0.0"); - if (range2.test(minver)) { - return minver; - } - minver = new SemVer("0.0.0-0"); - if (range2.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range2.set.length; ++i2) { - var comparators = range2.set[i2]; - comparators.forEach(function(comparator) { - var compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - compver.raw = compver.format(); - /* fallthrough */ - case "": - case ">=": - if (!minver || gt(minver, compver)) { - minver = compver; - } - break; - case "<": - case "<=": - break; - /* istanbul ignore next */ - default: - throw new Error("Unexpected operation: " + comparator.operator); - } - }); - } - if (minver && range2.test(minver)) { - return minver; - } - return null; - } - exports2.validRange = validRange; - function validRange(range2, options) { - try { - return new Range2(range2, options).range || "*"; - } catch (er) { - return null; - } - } - exports2.ltr = ltr; - function ltr(version, range2, options) { - return outside(version, range2, "<", options); - } - exports2.gtr = gtr; - function gtr(version, range2, options) { - return outside(version, range2, ">", options); - } - exports2.outside = outside; - function outside(version, range2, hilo, options) { - version = new SemVer(version, options); - range2 = new Range2(range2, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte2; - ltfn = lt2; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt2; - ltefn = gte7; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - if (satisfies2(version, range2, options)) { - return false; - } - for (var i2 = 0; i2 < range2.set.length; ++i2) { - var comparators = range2.set[i2]; - var high = null; - var low = null; - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); - if (high.operator === comp || high.operator === ecomp) { - return false; - } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse3(version, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; - } - exports2.intersects = intersects; - function intersects(r1, r2, options) { - r1 = new Range2(r1, options); - r2 = new Range2(r2, options); - return r1.intersects(r2); - } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; - } - if (typeof version === "number") { - version = String(version); - } - if (typeof version !== "string") { - return null; - } - options = options || {}; - var match2 = null; - if (!options.rtl) { - match2 = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match2 || match2.index + match2[0].length !== version.length)) { - if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) { - match2 = next; - } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } - safeRe[t.COERCERTL].lastIndex = -1; - } - if (match2 === null) { - return null; - } - return parse3(match2[2] + "." + (match2[3] || "0") + "." + (match2[4] || "0"), options); - } - } -}); - -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheReadDeniedMessagePrefix = exports2.CacheFileSizeLimit = exports2.ManifestFilename = exports2.TarFilename = exports2.SystemTarPathOnWindows = exports2.GnuTarPathOnWindows = exports2.SocketTimeout = exports2.DefaultRetryDelay = exports2.DefaultRetryAttempts = exports2.ArchiveToolType = exports2.CompressionMethod = exports2.CacheFilename = void 0; - var CacheFilename; - (function(CacheFilename2) { - CacheFilename2["Gzip"] = "cache.tgz"; - CacheFilename2["Zstd"] = "cache.tzst"; - })(CacheFilename || (exports2.CacheFilename = CacheFilename = {})); - var CompressionMethod; - (function(CompressionMethod2) { - CompressionMethod2["Gzip"] = "gzip"; - CompressionMethod2["ZstdWithoutLong"] = "zstd-without-long"; - CompressionMethod2["Zstd"] = "zstd"; - })(CompressionMethod || (exports2.CompressionMethod = CompressionMethod = {})); - var ArchiveToolType; - (function(ArchiveToolType2) { - ArchiveToolType2["GNU"] = "gnu"; - ArchiveToolType2["BSD"] = "bsd"; - })(ArchiveToolType || (exports2.ArchiveToolType = ArchiveToolType = {})); - exports2.DefaultRetryAttempts = 2; - exports2.DefaultRetryDelay = 5e3; - exports2.SocketTimeout = 5e3; - exports2.GnuTarPathOnWindows = `${process.env["PROGRAMFILES"]}\\Git\\usr\\bin\\tar.exe`; - exports2.SystemTarPathOnWindows = `${process.env["SYSTEMDRIVE"]}\\Windows\\System32\\tar.exe`; - exports2.TarFilename = "cache.tar"; - exports2.ManifestFilename = "manifest.txt"; - exports2.CacheFileSizeLimit = 10 * Math.pow(1024, 3); - exports2.CacheReadDeniedMessagePrefix = "cache read denied:"; - } -}); - -// node_modules/@actions/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues2 = exports2 && exports2.__asyncValues || function(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function(v) { - return new Promise(function(resolve14, reject) { - v = o[n](v), settle(resolve14, reject, v.done, v.value); - }); - }; - } - function settle(resolve14, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve14({ value: v2, done: d }); - }, reject); - } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTempDirectory = createTempDirectory; - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - exports2.resolvePaths = resolvePaths; - exports2.unlinkFile = unlinkFile; - exports2.getCompressionMethod = getCompressionMethod; - exports2.getCacheFileName = getCacheFileName; - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - exports2.assertDefined = assertDefined; - exports2.getCacheVersion = getCacheVersion; - exports2.getRuntimeToken = getRuntimeToken; - var core31 = __importStar2(require_core()); - var exec3 = __importStar2(require_exec()); - var glob2 = __importStar2(require_glob()); - var io9 = __importStar2(require_io()); - var crypto3 = __importStar2(require("crypto")); - var fs32 = __importStar2(require("fs")); - var path30 = __importStar2(require("path")); - var semver11 = __importStar2(require_semver3()); - var util3 = __importStar2(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter2(this, void 0, void 0, function* () { - const IS_WINDOWS = process.platform === "win32"; - let tempDirectory = process.env["RUNNER_TEMP"] || ""; - if (!tempDirectory) { - let baseLocation; - if (IS_WINDOWS) { - baseLocation = process.env["USERPROFILE"] || "C:\\"; - } else { - if (process.platform === "darwin") { - baseLocation = "/Users"; - } else { - baseLocation = "/home"; - } - } - tempDirectory = path30.join(baseLocation, "actions", "temp"); - } - const dest = path30.join(tempDirectory, crypto3.randomUUID()); - yield io9.mkdirP(dest); - return dest; - }); - } - function getArchiveFileSizeInBytes(filePath) { - return fs32.statSync(filePath).size; - } - function resolvePaths(patterns) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2, e_1, _b, _c; - var _d; - const paths = []; - const workspace = (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const globber = yield glob2.create(patterns.join("\n"), { - implicitDescendants: false - }); - try { - for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a2 = _g.done, !_a2; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path30.relative(workspace, file).replace(new RegExp(`\\${path30.sep}`, "g"), "/"); - core31.debug(`Matched: ${relativeFile}`); - if (relativeFile === "") { - paths.push("."); - } else { - paths.push(`${relativeFile}`); - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a2 && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); - } - function unlinkFile(filePath) { - return __awaiter2(this, void 0, void 0, function* () { - return util3.promisify(fs32.unlink)(filePath); - }); - } - function getVersion(app_1) { - return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { - let versionOutput = ""; - additionalArgs.push("--version"); - core31.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec3.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() - } - }); - } catch (err) { - core31.debug(err.message); - } - versionOutput = versionOutput.trim(); - core31.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter2(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver11.clean(versionOutput); - core31.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; - } - }); - } - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; - } - function getGnuTarPathOnWindows() { - return __awaiter2(this, void 0, void 0, function* () { - if (fs32.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io9.which("tar") : ""; - }); - } - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; - } - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); - } - components.push(versionSalt); - return crypto3.createHash("sha256").update(components.join("|")).digest("hex"); - } - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); - } - return token; - } - } -}); - -// node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports = {}; -__export(tslib_es6_exports, { - __addDisposableResource: () => __addDisposableResource, - __assign: () => __assign, - __asyncDelegator: () => __asyncDelegator, - __asyncGenerator: () => __asyncGenerator, - __asyncValues: () => __asyncValues, - __await: () => __await, - __awaiter: () => __awaiter, - __classPrivateFieldGet: () => __classPrivateFieldGet, - __classPrivateFieldIn: () => __classPrivateFieldIn, - __classPrivateFieldSet: () => __classPrivateFieldSet, - __createBinding: () => __createBinding, - __decorate: () => __decorate, - __disposeResources: () => __disposeResources, - __esDecorate: () => __esDecorate, - __exportStar: () => __exportStar, - __extends: () => __extends, - __generator: () => __generator, - __importDefault: () => __importDefault, - __importStar: () => __importStar, - __makeTemplateObject: () => __makeTemplateObject, - __metadata: () => __metadata, - __param: () => __param, - __propKey: () => __propKey, - __read: () => __read, - __rest: () => __rest, - __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension, - __runInitializers: () => __runInitializers, - __setFunctionName: () => __setFunctionName, - __spread: () => __spread, - __spreadArray: () => __spreadArray, - __spreadArrays: () => __spreadArrays, - __values: () => __values2, - default: () => tslib_es6_default -}); -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} -function __param(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { - if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); - return f; - } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _2, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context5 = {}; - for (var p in contextIn) context5[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context5.access[p] = contextIn.access[p]; - context5.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); - }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context5); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_2 = accept(result.get)) descriptor.get = _2; - if (_2 = accept(result.set)) descriptor.set = _2; - if (_2 = accept(result.init)) initializers.unshift(_2); - } else if (_2 = accept(result)) { - if (kind === "field") initializers.unshift(_2); - else descriptor[key] = _2; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -} -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -} -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _2 = { label: 0, sent: function() { - if (t[0] & 1) throw t[1]; - return t[1]; - }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { - return this; - }), g; - function verb(n) { - return function(v) { - return step([n, v]); - }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_2 = 0)), _2) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _2.label++; - return { value: op[1], done: false }; - case 5: - _2.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _2.ops.pop(); - _2.trys.pop(); - continue; - default: - if (!(t = _2.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _2 = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _2.label = op[1]; - break; - } - if (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; - } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; - } - if (t[2]) _2.ops.pop(); - _2.trys.pop(); - continue; - } - op = body.call(thisArg, _2); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; - } - if (op[0] & 5) throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } -} -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} -function __values2(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function() { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } catch (error3) { - e = { error: error3 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function awaitReturn(f) { - return function(v) { - return Promise.resolve(v).then(f, reject); - }; - } - function verb(n, f) { - if (g[n]) { - i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - if (f) i[n] = f(i[n]); - } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); - } -} -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function(e) { - throw e; - }), verb("return"), i[Symbol.iterator] = function() { - return this; - }, i; - function verb(n, f) { - i[n] = o[n] ? function(v) { - return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values2 === "function" ? __values2(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function(v) { - return new Promise(function(resolve14, reject) { - v = o[n](v), settle(resolve14, reject, v.done, v.value); - }); - }; - } - function settle(resolve14, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve14({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; -} -function __importDefault(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; -} -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); - } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { - fail(e); - return next(); - }); - } else s |= 1; - } catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -function __rewriteRelativeImportExtension(path30, preserveJsx) { - if (typeof path30 === "string" && /^\.\.?\//.test(path30)) { - return path30.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext2 || !cm) ? m : d + ext2 + "." + cm.toLowerCase() + "js"; - }); - } - return path30; -} -var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/tslib/tslib.es6.mjs"() { - extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { - d2.__proto__ = b2; - } || function(d2, b2) { - for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p]; - }; - return extendStatics(d, b); - }; - __assign = function() { - __assign = Object.assign || function __assign2(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error3, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error3, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, - __rewriteRelativeImportExtension - }; - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/abort-controller/AbortError.js -var require_AbortError = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/abort-controller/AbortError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/log.js -var require_log = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/log.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.log = log; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_os_1 = require("node:os"); - var node_util_1 = tslib_1.__importDefault(require("node:util")); - var node_process_1 = tslib_1.__importDefault(require("node:process")); - function log(message, ...args) { - node_process_1.default.stderr.write(`${node_util_1.default.format(message, ...args)}${node_os_1.EOL}`); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/debug.js -var require_debug2 = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/debug.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var log_js_1 = require_log(); - var debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; - var enabledString; - var enabledNamespaces = []; - var skippedNamespaces = []; - var debuggers = []; - if (debugEnvVariable) { - enable(debugEnvVariable); - } - var debugObj = Object.assign((namespace) => { - return createDebugger(namespace); - }, { - enable, - enabled, - disable, - log: log_js_1.log - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const namespaceList = namespaces.split(",").map((ns) => ns.trim()); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(ns.substring(1)); - } else { - enabledNamespaces.push(ns); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); - } - } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; - } - for (const skipped of skippedNamespaces) { - if (namespaceMatches(namespace, skipped)) { - return false; - } - } - for (const enabledNamespace of enabledNamespaces) { - if (namespaceMatches(namespace, enabledNamespace)) { - return true; - } - } - return false; - } - function namespaceMatches(namespace, patternToMatch) { - if (patternToMatch.indexOf("*") === -1) { - return namespace === patternToMatch; - } - let pattern = patternToMatch; - if (patternToMatch.indexOf("**") !== -1) { - const patternParts = []; - let lastCharacter = ""; - for (const character of patternToMatch) { - if (character === "*" && lastCharacter === "*") { - continue; - } else { - lastCharacter = character; - patternParts.push(character); - } - } - pattern = patternParts.join(""); - } - let namespaceIndex = 0; - let patternIndex = 0; - const patternLength = pattern.length; - const namespaceLength = namespace.length; - let lastWildcard = -1; - let lastWildcardNamespace = -1; - while (namespaceIndex < namespaceLength && patternIndex < patternLength) { - if (pattern[patternIndex] === "*") { - lastWildcard = patternIndex; - patternIndex++; - if (patternIndex === patternLength) { - return true; - } - while (namespace[namespaceIndex] !== pattern[patternIndex]) { - namespaceIndex++; - if (namespaceIndex === namespaceLength) { - return false; - } - } - lastWildcardNamespace = namespaceIndex; - namespaceIndex++; - patternIndex++; - continue; - } else if (pattern[patternIndex] === namespace[namespaceIndex]) { - patternIndex++; - namespaceIndex++; - } else if (lastWildcard >= 0) { - patternIndex = lastWildcard + 1; - namespaceIndex = lastWildcardNamespace + 1; - if (namespaceIndex === namespaceLength) { - return false; - } - while (namespace[namespaceIndex] !== pattern[patternIndex]) { - namespaceIndex++; - if (namespaceIndex === namespaceLength) { - return false; - } - } - lastWildcardNamespace = namespaceIndex; - namespaceIndex++; - patternIndex++; - continue; - } else { - return false; - } - } - const namespaceDone = namespaceIndex === namespace.length; - const patternDone = patternIndex === pattern.length; - const trailingWildCard = patternIndex === pattern.length - 1 && pattern[patternIndex] === "*"; - return namespaceDone && (patternDone || trailingWildCard); - } - function disable() { - const result = enabledString || ""; - enable(""); - return result; - } - function createDebugger(namespace) { - const newDebugger = Object.assign(debug6, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend - }); - function debug6(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index2 = debuggers.indexOf(this); - if (index2 >= 0) { - debuggers.splice(index2, 1); - return true; - } - return false; - } - function extend(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; - } - exports2.default = debugObj; - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/logger.js -var require_logger = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/logger.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TypeSpecRuntimeLogger = void 0; - exports2.createLoggerContext = createLoggerContext; - exports2.setLogLevel = setLogLevel; - exports2.getLogLevel = getLogLevel; - exports2.createClientLogger = createClientLogger; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var debug_js_1 = tslib_1.__importDefault(require_debug2()); - var TYPESPEC_RUNTIME_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 - }; - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function isTypeSpecRuntimeLogLevel(level) { - return TYPESPEC_RUNTIME_LOG_LEVELS.includes(level); - } - function createLoggerContext(options) { - const registeredLoggers = /* @__PURE__ */ new Set(); - const logLevelFromEnv = typeof process !== "undefined" && process.env && process.env[options.logLevelEnvVarName] || void 0; - let logLevel; - const clientLogger = (0, debug_js_1.default)(options.namespace); - clientLogger.log = (...args) => { - debug_js_1.default.log(...args); - }; - function contextSetLogLevel(level) { - if (level && !isTypeSpecRuntimeLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${TYPESPEC_RUNTIME_LOG_LEVELS.join(",")}`); - } - logLevel = level; - const enabledNamespaces = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces.push(logger.namespace); - } - } - debug_js_1.default.enable(enabledNamespaces.join(",")); - } - if (logLevelFromEnv) { - if (isTypeSpecRuntimeLogLevel(logLevelFromEnv)) { - contextSetLogLevel(logLevelFromEnv); - } else { - console.error(`${options.logLevelEnvVarName} set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${TYPESPEC_RUNTIME_LOG_LEVELS.join(", ")}.`); - } - } - function shouldEnable(logger) { - return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); - } - function createLogger2(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces = debug_js_1.default.disable(); - debug_js_1.default.enable(enabledNamespaces + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; - } - function contextGetLogLevel() { - return logLevel; - } - function contextCreateClientLogger(namespace) { - const clientRootLogger = clientLogger.extend(namespace); - patchLogMethod(clientLogger, clientRootLogger); - return { - error: createLogger2(clientRootLogger, "error"), - warning: createLogger2(clientRootLogger, "warning"), - info: createLogger2(clientRootLogger, "info"), - verbose: createLogger2(clientRootLogger, "verbose") - }; - } - return { - setLogLevel: contextSetLogLevel, - getLogLevel: contextGetLogLevel, - createClientLogger: contextCreateClientLogger, - logger: clientLogger - }; - } - var context5 = createLoggerContext({ - logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", - namespace: "typeSpecRuntime" - }); - exports2.TypeSpecRuntimeLogger = context5.logger; - function setLogLevel(logLevel) { - context5.setLogLevel(logLevel); - } - function getLogLevel() { - return context5.getLogLevel(); - } - function createClientLogger(namespace) { - return context5.createClientLogger(namespace); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); - } - function* headerIterator(map) { - for (const entry of map.values()) { - yield [entry.name, entry.value]; - } - } - var HttpHeadersImpl = class { - _headersMap; - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); - } - } - } - /** - * Set a header in this collection with the provided name and value. The name is - * case-insensitive. - * @param name - The name of the header to set. This value is case-insensitive. - * @param value - The value of the header to set. - */ - set(name, value) { - this._headersMap.set(normalizeName(name), { name, value: String(value).trim() }); - } - /** - * Get the header value for the provided header name, or undefined if no header exists in this - * collection with the provided name. - * @param name - The name of the header. This value is case-insensitive. - */ - get(name) { - return this._headersMap.get(normalizeName(name))?.value; - } - /** - * Get whether or not this header collection contains a header entry for the provided header name. - * @param name - The name of the header to set. This value is case-insensitive. - */ - has(name) { - return this._headersMap.has(normalizeName(name)); - } - /** - * Remove the header with the provided headerName. - * @param name - The name of the header to remove. - */ - delete(name) { - this._headersMap.delete(normalizeName(name)); - } - /** - * Get the JSON object representation of this HTTP header collection. - */ - toJSON(options = {}) { - const result = {}; - if (options.preserveCase) { - for (const entry of this._headersMap.values()) { - result[entry.name] = entry.value; - } - } else { - for (const [normalizedName, entry] of this._headersMap) { - result[normalizedName] = entry.value; - } - } - return result; - } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJSON({ preserveCase: true })); - } - /** - * Iterate over tuples of header [name, value] pairs. - */ - [Symbol.iterator]() { - return headerIterator(this._headersMap); - } - }; - function createHttpHeaders(rawHeaders) { - return new HttpHeadersImpl(rawHeaders); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/schemes.js -var require_schemes = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/schemes.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/oauth2Flows.js -var require_oauth2Flows = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/oauth2Flows.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID; - function randomUUID() { - return crypto.randomUUID(); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/pipelineRequest.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var uuidUtils_js_1 = require_uuidUtils(); - var PipelineRequestImpl = class { - url; - method; - headers; - timeout; - withCredentials; - body; - multipartBody; - formData; - streamResponseStatusCodes; - enableBrowserStreams; - proxySettings; - disableKeepAlive; - abortSignal; - requestId; - allowInsecureConnection; - onUploadProgress; - onDownloadProgress; - requestOverrides; - authSchemes; - constructor(options) { - this.url = options.url; - this.body = options.body; - this.headers = options.headers ?? (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = options.method ?? "GET"; - this.timeout = options.timeout ?? 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = options.disableKeepAlive ?? false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = options.withCredentials ?? false; - this.abortSignal = options.abortSignal; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, uuidUtils_js_1.randomUUID)(); - this.allowInsecureConnection = options.allowInsecureConnection ?? false; - this.enableBrowserStreams = options.enableBrowserStreams ?? false; - this.requestOverrides = options.requestOverrides; - this.authSchemes = options.authSchemes; - } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createEmptyPipeline = createEmptyPipeline; - var ValidPhaseNames = /* @__PURE__ */ new Set(["Deserialize", "Serialize", "Retry", "Sign"]); - var HttpPipeline = class _HttpPipeline { - _policies = []; - _orderedPolicies; - constructor(policies) { - this._policies = policies?.slice(0) ?? []; - this._orderedPolicies = void 0; - } - addPolicy(policy, options = {}) { - if (options.phase && options.afterPhase) { - throw new Error("Policies inside a phase cannot specify afterPhase."); - } - if (options.phase && !ValidPhaseNames.has(options.phase)) { - throw new Error(`Invalid phase name: ${options.phase}`); - } - if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { - throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); - } - this._policies.push({ - policy, - options - }); - this._orderedPolicies = void 0; - } - removePolicy(options) { - const removedPolicies = []; - this._policies = this._policies.filter((policyDescriptor) => { - if (options.name && policyDescriptor.policy.name === options.name || options.phase && policyDescriptor.options.phase === options.phase) { - removedPolicies.push(policyDescriptor.policy); - return false; - } else { - return true; - } - }); - this._orderedPolicies = void 0; - return removedPolicies; - } - sendRequest(httpClient, request3) { - const policies = this.getOrderedPolicies(); - const pipeline2 = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline2(request3); - } - getOrderedPolicies() { - if (!this._orderedPolicies) { - this._orderedPolicies = this.orderPolicies(); - } - return this._orderedPolicies; - } - clone() { - return new _HttpPipeline(this._policies); - } - static create() { - return new _HttpPipeline(); - } - orderPolicies() { - const result = []; - const policyMap = /* @__PURE__ */ new Map(); - function createPhase(name) { - return { - name, - policies: /* @__PURE__ */ new Set(), - hasRun: false, - hasAfterPolicies: false - }; - } - const serializePhase = createPhase("Serialize"); - const noPhase = createPhase("None"); - const deserializePhase = createPhase("Deserialize"); - const retryPhase = createPhase("Retry"); - const signPhase = createPhase("Sign"); - const orderedPhases = [serializePhase, noPhase, deserializePhase, retryPhase, signPhase]; - function getPhase(phase) { - if (phase === "Retry") { - return retryPhase; - } else if (phase === "Serialize") { - return serializePhase; - } else if (phase === "Deserialize") { - return deserializePhase; - } else if (phase === "Sign") { - return signPhase; - } else { - return noPhase; - } - } - for (const descriptor of this._policies) { - const policy = descriptor.policy; - const options = descriptor.options; - const policyName = policy.name; - if (policyMap.has(policyName)) { - throw new Error("Duplicate policy names not allowed in pipeline"); - } - const node = { - policy, - dependsOn: /* @__PURE__ */ new Set(), - dependants: /* @__PURE__ */ new Set() - }; - if (options.afterPhase) { - node.afterPhase = getPhase(options.afterPhase); - node.afterPhase.hasAfterPolicies = true; - } - policyMap.set(policyName, node); - const phase = getPhase(options.phase); - phase.policies.add(node); - } - for (const descriptor of this._policies) { - const { policy, options } = descriptor; - const policyName = policy.name; - const node = policyMap.get(policyName); - if (!node) { - throw new Error(`Missing node for policy ${policyName}`); - } - if (options.afterPolicies) { - for (const afterPolicyName of options.afterPolicies) { - const afterNode = policyMap.get(afterPolicyName); - if (afterNode) { - node.dependsOn.add(afterNode); - afterNode.dependants.add(node); - } - } - } - if (options.beforePolicies) { - for (const beforePolicyName of options.beforePolicies) { - const beforeNode = policyMap.get(beforePolicyName); - if (beforeNode) { - beforeNode.dependsOn.add(node); - node.dependants.add(beforeNode); - } - } - } - } - function walkPhase(phase) { - phase.hasRun = true; - for (const node of phase.policies) { - if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) { - continue; - } - if (node.dependsOn.size === 0) { - result.push(node.policy); - for (const dependant of node.dependants) { - dependant.dependsOn.delete(node); - } - policyMap.delete(node.policy.name); - phase.policies.delete(node); - } - } - } - function walkPhases() { - for (const phase of orderedPhases) { - walkPhase(phase); - if (phase.policies.size > 0 && phase !== noPhase) { - if (!noPhase.hasRun) { - walkPhase(noPhase); - } - return; - } - if (phase.hasAfterPolicies) { - walkPhase(noPhase); - } - } - } - let iteration = 0; - while (policyMap.size > 0) { - iteration++; - const initialResultLength = result.length; - walkPhases(); - if (result.length <= initialResultLength && iteration > 1) { - throw new Error("Cannot satisfy policy dependencies due to requirements cycle."); - } - } - return result; - } - }; - function createEmptyPipeline() { - return HttpPipeline.create(); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js -var require_object = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { - return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/error.js -var require_error = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - var object_js_1 = require_object(); - function isError(e) { - if ((0, object_js_1.isObject)(e)) { - const hasName = typeof e.name === "string"; - const hasMessage = typeof e.message === "string"; - return hasName && hasMessage; - } - return false; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.custom = void 0; - var node_util_1 = require("node:util"); - exports2.custom = node_util_1.inspect.custom; - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var object_js_1 = require_object(); - var RedactedString = "REDACTED"; - var defaultAllowedHeaderNames = [ - "x-ms-client-request-id", - "x-ms-return-client-request-id", - "x-ms-useragent", - "x-ms-correlation-request-id", - "x-ms-request-id", - "client-request-id", - "ms-cv", - "return-client-request-id", - "traceparent", - "Access-Control-Allow-Credentials", - "Access-Control-Allow-Headers", - "Access-Control-Allow-Methods", - "Access-Control-Allow-Origin", - "Access-Control-Expose-Headers", - "Access-Control-Max-Age", - "Access-Control-Request-Headers", - "Access-Control-Request-Method", - "Origin", - "Accept", - "Accept-Encoding", - "Cache-Control", - "Connection", - "Content-Length", - "Content-Type", - "Date", - "ETag", - "Expires", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Unmodified-Since", - "Last-Modified", - "Pragma", - "Request-Id", - "Retry-After", - "Server", - "Transfer-Encoding", - "User-Agent", - "WWW-Authenticate" - ]; - var defaultAllowedQueryParameters = ["api-version"]; - var Sanitizer = class { - allowedHeaderNames; - allowedQueryParameters; - constructor({ additionalAllowedHeaderNames: allowedHeaderNames = [], additionalAllowedQueryParameters: allowedQueryParameters = [] } = {}) { - allowedHeaderNames = defaultAllowedHeaderNames.concat(allowedHeaderNames); - allowedQueryParameters = defaultAllowedQueryParameters.concat(allowedQueryParameters); - this.allowedHeaderNames = new Set(allowedHeaderNames.map((n) => n.toLowerCase())); - this.allowedQueryParameters = new Set(allowedQueryParameters.map((p) => p.toLowerCase())); - } - /** - * Sanitizes an object for logging. - * @param obj - The object to sanitize - * @returns - The sanitized object as a string - */ - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return { - ...value, - name: value.name, - message: value.message - }; - } - if (key === "headers") { - return this.sanitizeHeaders(value); - } else if (key === "url") { - return this.sanitizeUrl(value); - } else if (key === "query") { - return this.sanitizeQuery(value); - } else if (key === "body") { - return void 0; - } else if (key === "response") { - return void 0; - } else if (key === "operationSpec") { - return void 0; - } else if (Array.isArray(value) || (0, object_js_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); - } - /** - * Sanitizes a URL for logging. - * @param value - The URL to sanitize - * @returns - The sanitized URL as a string - */ - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url2 = new URL(value); - if (!url2.search) { - return value; - } - for (const [key] of url2.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url2.searchParams.set(key, RedactedString); - } - } - return url2.toString(); - } - sanitizeHeaders(obj) { - const sanitized = {}; - for (const key of Object.keys(obj)) { - if (this.allowedHeaderNames.has(key.toLowerCase())) { - sanitized[key] = obj[key]; - } else { - sanitized[key] = RedactedString; - } - } - return sanitized; - } - sanitizeQuery(value) { - if (typeof value !== "object" || value === null) { - return value; - } - const sanitized = {}; - for (const k of Object.keys(value)) { - if (this.allowedQueryParameters.has(k.toLowerCase())) { - sanitized[k] = value[k]; - } else { - sanitized[k] = RedactedString; - } - } - return sanitized; - } - }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/restError.js -var require_restError = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/restError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RestError = void 0; - exports2.isRestError = isRestError; - var error_js_1 = require_error(); - var inspect_js_1 = require_inspect(); - var sanitizer_js_1 = require_sanitizer(); - var errorSanitizer = new sanitizer_js_1.Sanitizer(); - var RestError = class _RestError extends Error { - /** - * Something went wrong when making the request. - * This means the actual request failed for some reason, - * such as a DNS issue or the connection being lost. - */ - static REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - /** - * This means that parsing the response from the server failed. - * It may have been malformed. - */ - static PARSE_ERROR = "PARSE_ERROR"; - /** - * The code of the error itself (use statics on RestError if possible.) - */ - code; - /** - * The HTTP status code of the request (if applicable.) - */ - statusCode; - /** - * The request that was made. - * This property is non-enumerable. - */ - request; - /** - * The response received (if any.) - * This property is non-enumerable. - */ - response; - /** - * Bonus property set by the throw site. - */ - details; - constructor(message, options = {}) { - super(message); - this.name = "RestError"; - this.code = options.code; - this.statusCode = options.statusCode; - Object.defineProperty(this, "request", { value: options.request, enumerable: false }); - Object.defineProperty(this, "response", { value: options.response, enumerable: false }); - const agent = this.request?.agent ? { - maxFreeSockets: this.request.agent.maxFreeSockets, - maxSockets: this.request.agent.maxSockets - } : void 0; - Object.defineProperty(this, inspect_js_1.custom, { - value: () => { - return `RestError: ${this.message} - ${errorSanitizer.sanitize({ - ...this, - request: { ...this.request, agent }, - response: this.response - })}`; - }, - enumerable: false - }); - Object.setPrototypeOf(this, _RestError.prototype); - } - }; - exports2.RestError = RestError; - function isRestError(e) { - if (e instanceof RestError) { - return true; - } - return (0, error_js_1.isError)(e) && e.name === "RestError"; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/bytesEncoding.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uint8ArrayToString = uint8ArrayToString; - exports2.stringToUint8Array = stringToUint8Array; - function uint8ArrayToString(bytes, format) { - return Buffer.from(bytes).toString(format); - } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/log.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_js_1 = require_logger(); - exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getBodyLength = getBodyLength; - exports2.createNodeHttpClient = createNodeHttpClient; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_http_1 = tslib_1.__importDefault(require("node:http")); - var node_https_1 = tslib_1.__importDefault(require("node:https")); - var node_zlib_1 = tslib_1.__importDefault(require("node:zlib")); - var node_stream_1 = require("node:stream"); - var AbortError_js_1 = require_AbortError(); - var httpHeaders_js_1 = require_httpHeaders(); - var restError_js_1 = require_restError(); - var log_js_1 = require_log2(); - var sanitizer_js_1 = require_sanitizer(); - var DEFAULT_TLS_SETTINGS = {}; - function isReadableStream(body) { - return body && typeof body.pipe === "function"; - } - function isStreamComplete(stream2) { - if (stream2.readable === false) { - return Promise.resolve(); - } - return new Promise((resolve14) => { - const handler2 = () => { - resolve14(); - stream2.removeListener("close", handler2); - stream2.removeListener("end", handler2); - stream2.removeListener("error", handler2); - }; - stream2.on("close", handler2); - stream2.on("end", handler2); - stream2.on("error", handler2); - }); - } - function isArrayBuffer(body) { - return body && typeof body.byteLength === "number"; - } - var ReportTransform = class extends node_stream_1.Transform { - loadedBytes = 0; - progressCallback; - // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type - _transform(chunk, _encoding, callback) { - this.push(chunk); - this.loadedBytes += chunk.length; - try { - this.progressCallback({ loadedBytes: this.loadedBytes }); - callback(); - } catch (e) { - callback(e); - } - } - constructor(progressCallback) { - super(); - this.progressCallback = progressCallback; - } - }; - var NodeHttpClient = class { - cachedHttpAgent; - cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - /** - * Makes a request over an underlying transport layer and returns the response. - * @param request - The request to be made. - */ - async sendRequest(request3) { - const abortController = new AbortController(); - let abortListener; - if (request3.abortSignal) { - if (request3.abortSignal.aborted) { - throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); - } - abortListener = (event) => { - if (event.type === "abort") { - abortController.abort(); - } - }; - request3.abortSignal.addEventListener("abort", abortListener); - } - let timeoutId; - if (request3.timeout > 0) { - timeoutId = setTimeout(() => { - const sanitizer = new sanitizer_js_1.Sanitizer(); - log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request3.url)}' timed out. canceling...`); - abortController.abort(); - }, request3.timeout); - } - const acceptEncoding = request3.headers.get("Accept-Encoding"); - const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); - let body = typeof request3.body === "function" ? request3.body() : request3.body; - if (body && !request3.headers.has("Content-Length")) { - const bodyLength = getBodyLength(body); - if (bodyLength !== null) { - request3.headers.set("Content-Length", bodyLength); - } - } - let responseStream; - try { - if (body && request3.onUploadProgress) { - const onUploadProgress = request3.onUploadProgress; - const uploadReportStream = new ReportTransform(onUploadProgress); - uploadReportStream.on("error", (e) => { - log_js_1.logger.error("Error in upload progress", e); - }); - if (isReadableStream(body)) { - body.pipe(uploadReportStream); - } else { - uploadReportStream.end(body); - } - body = uploadReportStream; - } - const res = await this.makeRequest(request3, abortController, body); - if (timeoutId !== void 0) { - clearTimeout(timeoutId); - } - const headers = getResponseHeaders(res); - const status = res.statusCode ?? 0; - const response = { - status, - headers, - request: request3 - }; - if (request3.method === "HEAD") { - res.resume(); - return response; - } - responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res; - const onDownloadProgress = request3.onDownloadProgress; - if (onDownloadProgress) { - const downloadReportStream = new ReportTransform(onDownloadProgress); - downloadReportStream.on("error", (e) => { - log_js_1.logger.error("Error in download progress", e); - }); - responseStream.pipe(downloadReportStream); - responseStream = downloadReportStream; - } - if ( - // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - request3.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request3.streamResponseStatusCodes?.has(response.status) - ) { - response.readableStreamBody = responseStream; - } else { - response.bodyAsText = await streamToText(responseStream); - } - return response; - } finally { - if (request3.abortSignal && abortListener) { - let uploadStreamDone = Promise.resolve(); - if (isReadableStream(body)) { - uploadStreamDone = isStreamComplete(body); - } - let downloadStreamDone = Promise.resolve(); - if (isReadableStream(responseStream)) { - downloadStreamDone = isStreamComplete(responseStream); - } - Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - if (abortListener) { - request3.abortSignal?.removeEventListener("abort", abortListener); - } - }).catch((e) => { - log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); - }); - } - } - } - makeRequest(request3, abortController, body) { - const url2 = new URL(request3.url); - const isInsecure = url2.protocol !== "https:"; - if (isInsecure && !request3.allowInsecureConnection) { - throw new Error(`Cannot connect to ${request3.url} while allowInsecureConnection is false.`); - } - const agent = request3.agent ?? this.getOrCreateAgent(request3, isInsecure); - const options = { - agent, - hostname: url2.hostname, - path: `${url2.pathname}${url2.search}`, - port: url2.port, - method: request3.method, - headers: request3.headers.toJSON({ preserveCase: true }), - ...request3.requestOverrides - }; - return new Promise((resolve14, reject) => { - const req = isInsecure ? node_http_1.default.request(options, resolve14) : node_https_1.default.request(options, resolve14); - req.once("error", (err) => { - reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request: request3 })); - }); - abortController.signal.addEventListener("abort", () => { - const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); - req.destroy(abortError); - reject(abortError); - }); - if (body && isReadableStream(body)) { - body.pipe(req); - } else if (body) { - if (typeof body === "string" || Buffer.isBuffer(body)) { - req.end(body); - } else if (isArrayBuffer(body)) { - req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body)); - } else { - log_js_1.logger.error("Unrecognized body type", body); - reject(new restError_js_1.RestError("Unrecognized body type")); - } - } else { - req.end(); - } - }); - } - getOrCreateAgent(request3, isInsecure) { - const disableKeepAlive = request3.disableKeepAlive; - if (isInsecure) { - if (disableKeepAlive) { - return node_http_1.default.globalAgent; - } - if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); - } - return this.cachedHttpAgent; - } else { - if (disableKeepAlive && !request3.tlsSettings) { - return node_https_1.default.globalAgent; - } - const tlsSettings = request3.tlsSettings ?? DEFAULT_TLS_SETTINGS; - let agent = this.cachedHttpsAgents.get(tlsSettings); - if (agent && agent.options.keepAlive === !disableKeepAlive) { - return agent; - } - log_js_1.logger.info("No cached TLS Agent exist, creating a new Agent"); - agent = new node_https_1.default.Agent({ - // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive, - // Since we are spreading, if no tslSettings were provided, nothing is added to the agent options. - ...tlsSettings - }); - this.cachedHttpsAgents.set(tlsSettings, agent); - return agent; - } - } - }; - function getResponseHeaders(res) { - const headers = (0, httpHeaders_js_1.createHttpHeaders)(); - for (const header of Object.keys(res.headers)) { - const value = res.headers[header]; - if (Array.isArray(value)) { - if (value.length > 0) { - headers.set(header, value[0]); - } - } else if (value) { - headers.set(header, value); - } - } - return headers; - } - function getDecodedResponseStream(stream2, headers) { - const contentEncoding = headers.get("Content-Encoding"); - if (contentEncoding === "gzip") { - const unzip = node_zlib_1.default.createGunzip(); - stream2.pipe(unzip); - return unzip; - } else if (contentEncoding === "deflate") { - const inflate = node_zlib_1.default.createInflate(); - stream2.pipe(inflate); - return inflate; - } - return stream2; - } - function streamToText(stream2) { - return new Promise((resolve14, reject) => { - const buffer = []; - stream2.on("data", (chunk) => { - if (Buffer.isBuffer(chunk)) { - buffer.push(chunk); - } else { - buffer.push(Buffer.from(chunk)); - } - }); - stream2.on("end", () => { - resolve14(Buffer.concat(buffer).toString("utf8")); - }); - stream2.on("error", (e) => { - if (e && e?.name === "AbortError") { - reject(e); - } else { - reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { - code: restError_js_1.RestError.PARSE_ERROR - })); - } - }); - }); - } - function getBodyLength(body) { - if (!body) { - return 0; - } else if (Buffer.isBuffer(body)) { - return body.length; - } else if (isReadableStream(body)) { - return null; - } else if (isArrayBuffer(body)) { - return body.byteLength; - } else if (typeof body === "string") { - return Buffer.from(body).length; - } else { - return null; - } - } - function createNodeHttpClient() { - return new NodeHttpClient(); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js -var require_defaultHttpClient = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createDefaultHttpClient = createDefaultHttpClient; - var nodeHttpClient_js_1 = require_nodeHttpClient(); - function createDefaultHttpClient() { - return (0, nodeHttpClient_js_1.createNodeHttpClient)(); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/logPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logPolicyName = void 0; - exports2.logPolicy = logPolicy; - var log_js_1 = require_log2(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - const logger = options.logger ?? log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request3, next) { - if (!logger.enabled) { - return next(request3); - } - logger(`Request: ${sanitizer.sanitize(request3)}`); - const response = await next(request3); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/redirectPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.redirectPolicyName = void 0; - exports2.redirectPolicy = redirectPolicy; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request3, next) { - const response = await next(request3); - return handleRedirect(next, response, maxRetries); - } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request: request3, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request3.method) || status === 302 && allowedRedirect.includes(request3.method) || status === 303 && request3.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url2 = new URL(locationHeader, request3.url); - request3.url = url2.toString(); - if (status === 303) { - request3.method = "GET"; - request3.headers.delete("Content-Length"); - delete request3.body; - } - request3.headers.delete("Authorization"); - const res = await next(request3); - return handleRedirect(next, res, maxRetries, currentRetries + 1); - } - return response; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgentPlatform.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getHeaderName = getHeaderName; - exports2.setPlatformSpecificData = setPlatformSpecificData; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_os_1 = tslib_1.__importDefault(require("node:os")); - var node_process_1 = tslib_1.__importDefault(require("node:process")); - function getHeaderName() { - return "User-Agent"; - } - async function setPlatformSpecificData(map) { - if (node_process_1.default && node_process_1.default.versions) { - const osInfo = `${node_os_1.default.type()} ${node_os_1.default.release()}; ${node_os_1.default.arch()}`; - const versions = node_process_1.default.versions; - if (versions.bun) { - map.set("Bun", `${versions.bun} (${osInfo})`); - } else if (versions.deno) { - map.set("Deno", `${versions.deno} (${osInfo})`); - } else if (versions.node) { - map.set("Node", `${versions.node} (${osInfo})`); - } - } - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/constants.js -var require_constants8 = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_RETRY_POLICY_COUNT = exports2.SDK_VERSION = void 0; - exports2.SDK_VERSION = "0.3.2"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgent.js -var require_userAgent = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgent.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUserAgentHeaderName = getUserAgentHeaderName; - exports2.getUserAgentValue = getUserAgentValue; - var userAgentPlatform_js_1 = require_userAgentPlatform(); - var constants_js_1 = require_constants8(); - function getUserAgentString(telemetryInfo) { - const parts = []; - for (const [key, value] of telemetryInfo) { - const token = value ? `${key}/${value}` : key; - parts.push(token); - } - return parts.join(" "); - } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); - } - async function getUserAgentValue(prefix) { - const runtimeInfo = /* @__PURE__ */ new Map(); - runtimeInfo.set("ts-http-runtime", constants_js_1.SDK_VERSION); - await (0, userAgentPlatform_js_1.setPlatformSpecificData)(runtimeInfo); - const defaultAgent = getUserAgentString(runtimeInfo); - const userAgentValue = prefix ? `${prefix} ${defaultAgent}` : defaultAgent; - return userAgentValue; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/userAgentPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.userAgentPolicyName = void 0; - exports2.userAgentPolicy = userAgentPolicy; - var userAgent_js_1 = require_userAgent(); - var UserAgentHeaderName = (0, userAgent_js_1.getUserAgentHeaderName)(); - exports2.userAgentPolicyName = "userAgentPolicy"; - function userAgentPolicy(options = {}) { - const userAgentValue = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - return { - name: exports2.userAgentPolicyName, - async sendRequest(request3, next) { - if (!request3.headers.has(UserAgentHeaderName)) { - request3.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.decompressResponsePolicyName = void 0; - exports2.decompressResponsePolicy = decompressResponsePolicy; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request3, next) { - if (request3.method !== "HEAD") { - request3.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/random.js -var require_random = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/random.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; - function getRandomIntegerInclusive(min, max) { - min = Math.ceil(min); - max = Math.floor(max); - const offset = Math.floor(Math.random() * (max - min + 1)); - return offset + min; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/delay.js -var require_delay = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/delay.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.calculateRetryDelay = calculateRetryDelay; - var random_js_1 = require_random(); - function calculateRetryDelay(retryAttempt, config) { - const exponentialDelay = config.retryDelayInMs * Math.pow(2, retryAttempt); - const clampedDelay = Math.min(config.maxRetryDelayInMs, exponentialDelay); - const retryAfterInMs = clampedDelay / 2 + (0, random_js_1.getRandomIntegerInclusive)(0, clampedDelay / 2); - return { retryAfterInMs }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var AbortError_js_1 = require_AbortError(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve14, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new AbortError_js_1.AbortError(options?.abortErrorMsg ? options?.abortErrorMsg : StandardAbortMessage)); - }; - const removeListeners = () => { - if (options?.abortSignal && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); - } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); - } - removeListeners(); - return rejectOnAbort(); - }; - if (options?.abortSignal && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve14(value); - }, delayInMs); - if (options?.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); - } - }); - } - function parseHeaderValueAsNumber(response, headerName) { - const value = response.headers.get(headerName); - if (!value) - return; - const valueAsNum = Number(value); - if (Number.isNaN(valueAsNum)) - return; - return valueAsNum; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; - exports2.throttlingRetryStrategy = throttlingRetryStrategy; - var helpers_js_1 = require_helpers2(); - var RetryAfterHeader = "Retry-After"; - var AllRetryAfterHeaders = ["retry-after-ms", "x-ms-retry-after-ms", RetryAfterHeader]; - function getRetryAfterInMs(response) { - if (!(response && [429, 503].includes(response.status))) - return void 0; - try { - for (const header of AllRetryAfterHeaders) { - const retryAfterValue = (0, helpers_js_1.parseHeaderValueAsNumber)(response, header); - if (retryAfterValue === 0 || retryAfterValue) { - const multiplyingFactor = header === RetryAfterHeader ? 1e3 : 1; - return retryAfterValue * multiplyingFactor; - } - } - const retryAfterHeader = response.headers.get(RetryAfterHeader); - if (!retryAfterHeader) - return; - const date = Date.parse(retryAfterHeader); - const diff = date - Date.now(); - return Number.isFinite(diff) ? Math.max(0, diff) : void 0; - } catch { - return void 0; - } - } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); - } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; - } - return { - retryAfterInMs - }; - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var delay_js_1 = require_delay(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - const retryInterval = options.retryDelayInMs ?? DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = options.maxRetryDelayInMs ?? DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - return { - name: "exponentialRetryStrategy", - retry({ retryCount, response, responseError }) { - const matchedSystemError = isSystemError(responseError); - const ignoreSystemErrors = matchedSystemError && options.ignoreSystemErrors; - const isExponential = isExponentialRetryResponse(response); - const ignoreExponentialResponse = isExponential && options.ignoreHttpStatusCodes; - const unknownResponse = response && ((0, throttlingRetryStrategy_js_1.isThrottlingRetryResponse)(response) || !isExponential); - if (unknownResponse || ignoreExponentialResponse || ignoreSystemErrors) { - return { skipStrategy: true }; - } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; - } - return (0, delay_js_1.calculateRetryDelay)(retryCount, { - retryDelayInMs: retryInterval, - maxRetryDelayInMs: maxRetryInterval - }); - } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); - } - function isSystemError(err) { - if (!err) { - return false; - } - return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/retryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryPolicy = retryPolicy; - var helpers_js_1 = require_helpers2(); - var AbortError_js_1 = require_AbortError(); - var logger_js_1 = require_logger(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_js_1.createClientLogger)("ts-http-runtime retryPolicy"); - var retryPolicyName = "retryPolicy"; - function retryPolicy(strategies, options = { maxRetries: constants_js_1.DEFAULT_RETRY_POLICY_COUNT }) { - const logger = options.logger || retryPolicyLogger; - return { - name: retryPolicyName, - async sendRequest(request3, next) { - let response; - let responseError; - let retryCount = -1; - retryRequest: while (true) { - retryCount += 1; - response = void 0; - responseError = void 0; - try { - logger.info(`Retry ${retryCount}: Attempting to send request`, request3.requestId); - response = await next(request3); - logger.info(`Retry ${retryCount}: Received a response from request`, request3.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request3.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if (request3.abortSignal?.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new AbortError_js_1.AbortError(); - throw abortError; - } - if (retryCount >= (options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT)) { - logger.info(`Retry ${retryCount}: Maximum retries reached. Returning the last received response, or throwing the last received error.`); - if (responseError) { - throw responseError; - } else if (response) { - return response; - } else { - throw new Error("Maximum retries reached with no response or error to throw"); - } - } - logger.info(`Retry ${retryCount}: Processing ${strategies.length} retry strategies.`); - strategiesLoop: for (const strategy of strategies) { - const strategyLogger = strategy.logger || logger; - strategyLogger.info(`Retry ${retryCount}: Processing retry strategy ${strategy.name}.`); - const modifiers = strategy.retry({ - retryCount, - response, - responseError - }); - if (modifiers.skipStrategy) { - strategyLogger.info(`Retry ${retryCount}: Skipped.`); - continue strategiesLoop; - } - const { errorToThrow, retryAfterInMs, redirectTo } = modifiers; - if (errorToThrow) { - strategyLogger.error(`Retry ${retryCount}: Retry strategy ${strategy.name} throws error:`, errorToThrow); - throw errorToThrow; - } - if (retryAfterInMs || retryAfterInMs === 0) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} retries after ${retryAfterInMs}`); - await (0, helpers_js_1.delay)(retryAfterInMs, void 0, { abortSignal: request3.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request3.url = redirectTo; - continue retryRequest; - } - } - if (responseError) { - logger.info(`None of the retry strategies could work with the received error. Throwing it.`); - throw responseError; - } - if (response) { - logger.info(`None of the retry strategies could work with the received response. Returning it.`); - return response; - } - } - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/defaultRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.defaultRetryPolicyName = void 0; - exports2.defaultRetryPolicy = defaultRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.defaultRetryPolicyName = "defaultRetryPolicy"; - function defaultRetryPolicy(options = {}) { - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/checkEnvironment.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isBun = exports2.isDeno = exports2.isWebWorker = exports2.isBrowser = void 0; - exports2.isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; - exports2.isWebWorker = typeof self === "object" && typeof self?.importScripts === "function" && (self.constructor?.name === "DedicatedWorkerGlobalScope" || self.constructor?.name === "ServiceWorkerGlobalScope" || self.constructor?.name === "SharedWorkerGlobalScope"); - exports2.isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined"; - exports2.isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; - exports2.isNodeLike = typeof globalThis.process !== "undefined" && Boolean(globalThis.process.version) && Boolean(globalThis.process.versions?.node); - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/formDataPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.formDataPolicyName = void 0; - exports2.formDataPolicy = formDataPolicy; - var bytesEncoding_js_1 = require_bytesEncoding(); - var checkEnvironment_js_1 = require_checkEnvironment(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - formDataMap[key] ??= []; - formDataMap[key].push(value); - } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request3, next) { - if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request3.body instanceof FormData) { - request3.formData = formDataToFormDataMap(request3.body); - request3.body = void 0; - } - if (request3.formData) { - const contentType = request3.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request3.body = wwwFormUrlEncode(request3.formData); - } else { - await prepareFormData(request3.formData, request3); - } - request3.formData = void 0; - } - return next(request3); - } - }; - } - function wwwFormUrlEncode(formData) { - const urlSearchParams = new URLSearchParams(); - for (const [key, value] of Object.entries(formData)) { - if (Array.isArray(value)) { - for (const subValue of value) { - urlSearchParams.append(key, subValue.toString()); - } - } else { - urlSearchParams.append(key, value.toString()); - } - } - return urlSearchParams.toString(); - } - async function prepareFormData(formData, request3) { - const contentType = request3.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request3.headers.set("Content-Type", contentType ?? "multipart/form-data"); - const parts = []; - for (const [fieldName, values] of Object.entries(formData)) { - for (const value of Array.isArray(values) ? values : [values]) { - if (typeof value === "string") { - parts.push({ - headers: (0, httpHeaders_js_1.createHttpHeaders)({ - "Content-Disposition": `form-data; name="${fieldName}"` - }), - body: (0, bytesEncoding_js_1.stringToUint8Array)(value, "utf-8") - }); - } else if (value === void 0 || value === null || typeof value !== "object") { - throw new Error(`Unexpected value for key ${fieldName}: ${value}. Value should be serialized to string first.`); - } else { - const fileName = value.name || "blob"; - const headers = (0, httpHeaders_js_1.createHttpHeaders)(); - headers.set("Content-Disposition", `form-data; name="${fieldName}"; filename="${fileName}"`); - headers.set("Content-Type", value.type || "application/octet-stream"); - parts.push({ - headers, - body: value - }); - } - } - } - request3.multipartBody = { parts }; - } - } -}); - -// node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/ms/index.js"(exports2, module2) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse3(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); - }; - function parse3(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match2) { - return; - } - var n = parseFloat(match2[1]); - var type = (match2[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/debug/src/common.js -var require_common = __commonJS({ - "node_modules/debug/src/common.js"(exports2, module2) { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce3; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key) => { - createDebug[key] = env[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash2 = 0; - for (let i = 0; i < namespace.length; i++) { - hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i); - hash2 |= 0; - } - return createDebug.colors[Math.abs(hash2) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug6(...args) { - if (!debug6.enabled) { - return; - } - const self2 = debug6; - const curr = Number(/* @__PURE__ */ new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index2 = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format) => { - if (match2 === "%%") { - return "%"; - } - index2++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index2]; - match2 = formatter.call(self2, val); - args.splice(index2, 1); - index2--; - } - return match2; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug6.namespace = namespace; - debug6.useColors = createDebug.useColors(); - debug6.color = createDebug.selectColor(namespace); - debug6.extend = extend; - debug6.destroy = createDebug.destroy; - Object.defineProperty(debug6, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug6); - } - return debug6; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); - for (const ns of split) { - if (ns[0] === "-") { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { - if (template[templateIndex] === "*") { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; - } - } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; - } - return templateIndex === template.length; - } - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - return false; - } - function coerce3(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; - } -}); - -// node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/debug/src/browser.js"(exports2, module2) { - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.storage = localstorage(); - exports2.destroy = /* @__PURE__ */ (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports2.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - let m; - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index2 = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match2) => { - if (match2 === "%%") { - return; - } - index2++; - if (match2 === "%c") { - lastC = index2; - } - }); - args.splice(lastC, 0, c); - } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error3) { - } - } - function load2() { - let r; - try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error3) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error3) { - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error3) { - return "[UnexpectedJSONParseError]: " + error3.message; - } - }; - } -}); - -// node_modules/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports2, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os7 = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os7.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util3 = require("util"); - exports2.init = init2; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util3.deprecate( - () => { - }, - "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." - ); - exports2.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor = require_supports_color(); - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports2.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error3) { - } - exports2.inspectOpts = Object.keys(process.env).filter((key) => { - return /^debug_/i.test(key); - }).reduce((obj, key) => { - const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_2, k) => { - return k.toUpperCase(); - }); - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name} \x1B[0m`; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; - } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util3.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load2() { - return process.env.DEBUG; - } - function init2(debug6) { - debug6.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug6.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util3.inspect(v, this.inspectOpts); - }; - } -}); - -// node_modules/debug/src/index.js -var require_src = __commonJS({ - "node_modules/debug/src/index.js"(exports2, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node(); - } - } -}); - -// node_modules/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar2(require("http")); - var https3 = __importStar2(require("https")); - async function toBuffer(stream2) { - let length = 0; - const chunks = []; - for await (const chunk of stream2) { - length += chunk.length; - chunks.push(chunk); - } - return Buffer.concat(chunks, length); - } - exports2.toBuffer = toBuffer; - async function json(stream2) { - const buf = await toBuffer(stream2); - const str = buf.toString("utf8"); - try { - return JSON.parse(str); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str})`; - throw err; - } - } - exports2.json = json; - function req(url2, opts = {}) { - const href = typeof url2 === "string" ? url2 : url2.href; - const req2 = (href.startsWith("https:") ? https3 : http).request(url2, opts); - const promise = new Promise((resolve14, reject) => { - req2.once("response", resolve14).once("error", reject).end(); - }); - req2.then = promise.then.bind(promise); - return req2; - } - exports2.req = req; - } -}); - -// node_modules/agent-base/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/agent-base/dist/index.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Agent = void 0; - var net = __importStar2(require("net")); - var http = __importStar2(require("http")); - var https_1 = require("https"); - __exportStar2(require_helpers3(), exports2); - var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState"); - var Agent = class extends http.Agent { - constructor(opts) { - super(opts); - this[INTERNAL] = {}; - } - /** - * Determine whether this is an `http` or `https` request. - */ - isSecureEndpoint(options) { - if (options) { - if (typeof options.secureEndpoint === "boolean") { - return options.secureEndpoint; - } - if (typeof options.protocol === "string") { - return options.protocol === "https:"; - } - } - const { stack } = new Error(); - if (typeof stack !== "string") - return false; - return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1); - } - // In order to support async signatures in `connect()` and Node's native - // connection pooling in `http.Agent`, the array of sockets for each origin - // has to be updated synchronously. This is so the length of the array is - // accurate when `addRequest()` is next called. We achieve this by creating a - // fake socket and adding it to `sockets[origin]` and incrementing - // `totalSocketCount`. - incrementSockets(name) { - if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { - return null; - } - if (!this.sockets[name]) { - this.sockets[name] = []; - } - const fakeSocket = new net.Socket({ writable: false }); - this.sockets[name].push(fakeSocket); - this.totalSocketCount++; - return fakeSocket; - } - decrementSockets(name, socket) { - if (!this.sockets[name] || socket === null) { - return; - } - const sockets = this.sockets[name]; - const index2 = sockets.indexOf(socket); - if (index2 !== -1) { - sockets.splice(index2, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } - } - } - // In order to properly update the socket pool, we need to call `getName()` on - // the core `https.Agent` if it is a secureEndpoint. - getName(options) { - const secureEndpoint = typeof options.secureEndpoint === "boolean" ? options.secureEndpoint : this.isSecureEndpoint(options); - if (secureEndpoint) { - return https_1.Agent.prototype.getName.call(this, options); - } - return super.getName(options); - } - createSocket(req, options, cb) { - const connectOpts = { - ...options, - secureEndpoint: this.isSecureEndpoint(options) - }; - const name = this.getName(connectOpts); - const fakeSocket = this.incrementSockets(name); - Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => { - this.decrementSockets(name, fakeSocket); - if (socket instanceof http.Agent) { - try { - return socket.addRequest(req, connectOpts); - } catch (err) { - return cb(err); - } - } - this[INTERNAL].currentSocket = socket; - super.createSocket(req, options, cb); - }, (err) => { - this.decrementSockets(name, fakeSocket); - cb(err); - }); - } - createConnection() { - const socket = this[INTERNAL].currentSocket; - this[INTERNAL].currentSocket = void 0; - if (!socket) { - throw new Error("No socket was returned in the `connect()` function"); - } - return socket; - } - get defaultPort() { - return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); - } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; - } - } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); - } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; - } - } - }; - exports2.Agent = Agent; - } -}); - -// node_modules/https-proxy-agent/dist/parse-proxy-response.js -var require_parse_proxy_response = __commonJS({ - "node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) { - "use strict"; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.parseProxyResponse = void 0; - var debug_1 = __importDefault2(require_src()); - var debug6 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve14, reject) => { - let buffersLength = 0; - const buffers = []; - function read() { - const b = socket.read(); - if (b) - ondata(b); - else - socket.once("readable", read); - } - function cleanup() { - socket.removeListener("end", onend); - socket.removeListener("error", onerror); - socket.removeListener("readable", read); - } - function onend() { - cleanup(); - debug6("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); - } - function onerror(err) { - cleanup(); - debug6("onerror %o", err); - reject(err); - } - function ondata(b) { - buffers.push(b); - buffersLength += b.length; - const buffered = Buffer.concat(buffers, buffersLength); - const endOfHeaders = buffered.indexOf("\r\n\r\n"); - if (endOfHeaders === -1) { - debug6("have not received end of HTTP headers yet..."); - read(); - return; - } - const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n"); - const firstLine = headerParts.shift(); - if (!firstLine) { - socket.destroy(); - return reject(new Error("No header received from proxy CONNECT response")); - } - const firstLineParts = firstLine.split(" "); - const statusCode = +firstLineParts[1]; - const statusText = firstLineParts.slice(2).join(" "); - const headers = {}; - for (const header of headerParts) { - if (!header) - continue; - const firstColon = header.indexOf(":"); - if (firstColon === -1) { - socket.destroy(); - return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); - } - const key = header.slice(0, firstColon).toLowerCase(); - const value = header.slice(firstColon + 1).trimStart(); - const current = headers[key]; - if (typeof current === "string") { - headers[key] = [current, value]; - } else if (Array.isArray(current)) { - current.push(value); - } else { - headers[key] = value; - } - } - debug6("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve14({ - connect: { - statusCode, - statusText, - headers - }, - buffered - }); - } - socket.on("error", onerror); - socket.on("end", onend); - read(); - }); - } - exports2.parseProxyResponse = parseProxyResponse; - } -}); - -// node_modules/https-proxy-agent/dist/index.js -var require_dist3 = __commonJS({ - "node_modules/https-proxy-agent/dist/index.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar2(require("net")); - var tls = __importStar2(require("tls")); - var assert_1 = __importDefault2(require("assert")); - var debug_1 = __importDefault2(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug6 = (0, debug_1.default)("https-proxy-agent"); - var setServernameFromNonIpHost = (options) => { - if (options.servername === void 0 && options.host && !net.isIP(options.host)) { - return { - ...options, - servername: options.host - }; - } - return options; - }; - var HttpsProxyAgent2 = class extends agent_base_1.Agent { - constructor(proxy, opts) { - super(opts); - this.options = { path: void 0 }; - this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy; - this.proxyHeaders = opts?.headers ?? {}; - debug6("Creating new HttpsProxyAgent instance: %o", this.proxy.href); - const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); - const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; - this.connectOpts = { - // Attempt to negotiate http/1.1 for proxy servers that support http/2 - ALPNProtocols: ["http/1.1"], - ...opts ? omit2(opts, "headers") : null, - host, - port - }; - } - /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. - */ - async connect(req, opts) { - const { proxy } = this; - if (!opts.host) { - throw new TypeError('No "host" provided'); - } - let socket; - if (proxy.protocol === "https:") { - debug6("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); - } else { - debug6("Creating `net.Socket`: %o", this.connectOpts); - socket = net.connect(this.connectOpts); - } - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; - let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r -`; - if (proxy.username || proxy.password) { - const auth2 = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth2).toString("base64")}`; - } - headers.Host = `${host}:${opts.port}`; - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; - } - for (const name of Object.keys(headers)) { - payload += `${name}: ${headers[name]}\r -`; - } - const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket); - socket.write(`${payload}\r -`); - const { connect, buffered } = await proxyResponsePromise; - req.emit("proxyConnect", connect); - this.emit("proxyConnect", connect, req); - if (connect.statusCode === 200) { - req.once("socket", resume); - if (opts.secureEndpoint) { - debug6("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit2(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); - } - return socket; - } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug6("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; - } - }; - HttpsProxyAgent2.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent2; - function resume(socket) { - socket.resume(); - } - function omit2(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - } -}); - -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpProxyAgent = void 0; - var net = __importStar2(require("net")); - var tls = __importStar2(require("tls")); - var debug_1 = __importDefault2(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug6 = (0, debug_1.default)("http-proxy-agent"); - var HttpProxyAgent = class extends agent_base_1.Agent { - constructor(proxy, opts) { - super(opts); - this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy; - this.proxyHeaders = opts?.headers ?? {}; - debug6("Creating new HttpProxyAgent instance: %o", this.proxy.href); - const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); - const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; - this.connectOpts = { - ...opts ? omit2(opts, "headers") : null, - host, - port - }; - } - addRequest(req, opts) { - req._header = null; - this.setRequestProps(req, opts); - super.addRequest(req, opts); - } - setRequestProps(req, opts) { - const { proxy } = this; - const protocol = opts.secureEndpoint ? "https:" : "http:"; - const hostname = req.getHeader("host") || "localhost"; - const base = `${protocol}//${hostname}`; - const url2 = new url_1.URL(req.path, base); - if (opts.port !== 80) { - url2.port = String(opts.port); - } - req.path = String(url2); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth2 = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth2).toString("base64")}`; - } - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; - } - for (const name of Object.keys(headers)) { - const value = headers[name]; - if (value) { - req.setHeader(name, value); - } - } - } - async connect(req, opts) { - req._header = null; - if (!req.path.includes("://")) { - this.setRequestProps(req, opts); - } - let first; - let endOfHeaders; - debug6("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug6("Patching connection write() output buffer with updated header"); - first = req.outputData[0].data; - endOfHeaders = first.indexOf("\r\n\r\n") + 4; - req.outputData[0].data = req._header + first.substring(endOfHeaders); - debug6("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug6("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug6("Creating `net.Socket`: %o", this.connectOpts); - socket = net.connect(this.connectOpts); - } - await (0, events_1.once)(socket, "connect"); - return socket; - } - }; - HttpProxyAgent.protocols = ["http", "https"]; - exports2.HttpProxyAgent = HttpProxyAgent; - function omit2(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/proxyPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.globalNoProxyList = exports2.proxyPolicyName = void 0; - exports2.loadNoProxy = loadNoProxy; - exports2.getDefaultProxySettings = getDefaultProxySettings; - exports2.proxyPolicy = proxyPolicy; - var https_proxy_agent_1 = require_dist3(); - var http_proxy_agent_1 = require_dist4(); - var log_js_1 = require_log2(); - var HTTPS_PROXY = "HTTPS_PROXY"; - var HTTP_PROXY = "HTTP_PROXY"; - var ALL_PROXY = "ALL_PROXY"; - var NO_PROXY = "NO_PROXY"; - exports2.proxyPolicyName = "proxyPolicy"; - exports2.globalNoProxyList = []; - var noProxyListLoaded = false; - var globalBypassedMap = /* @__PURE__ */ new Map(); - function getEnvironmentValue(name) { - if (process.env[name]) { - return process.env[name]; - } else if (process.env[name.toLowerCase()]) { - return process.env[name.toLowerCase()]; - } - return void 0; - } - function loadEnvironmentProxyValue() { - if (!process) { - return void 0; - } - const httpsProxy = getEnvironmentValue(HTTPS_PROXY); - const allProxy = getEnvironmentValue(ALL_PROXY); - const httpProxy = getEnvironmentValue(HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; - } - function isBypassed(uri, noProxyList, bypassedMap) { - if (noProxyList.length === 0) { - return false; - } - const host = new URL(uri).hostname; - if (bypassedMap?.has(host)) { - return bypassedMap.get(host); - } - let isBypassedFlag = false; - for (const pattern of noProxyList) { - if (pattern[0] === ".") { - if (host.endsWith(pattern)) { - isBypassedFlag = true; - } else { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } else { - if (host === pattern) { - isBypassedFlag = true; - } - } - } - bypassedMap?.set(host, isBypassedFlag); - return isBypassedFlag; - } - function loadNoProxy() { - const noProxy = getEnvironmentValue(NO_PROXY); - noProxyListLoaded = true; - if (noProxy) { - return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); - } - return []; - } - function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return void 0; - } - } - const parsedUrl = new URL(proxyUrl); - const schema = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema + parsedUrl.hostname, - port: Number.parseInt(parsedUrl.port || "80"), - username: parsedUrl.username, - password: parsedUrl.password - }; - } - function getDefaultProxySettingsInternal() { - const envProxy = loadEnvironmentProxyValue(); - return envProxy ? new URL(envProxy) : void 0; - } - function getUrlFromProxySettings(settings) { - let parsedProxyUrl; - try { - parsedProxyUrl = new URL(settings.host); - } catch { - throw new Error(`Expecting a valid host string in proxy settings, but found "${settings.host}".`); - } - parsedProxyUrl.port = String(settings.port); - if (settings.username) { - parsedProxyUrl.username = settings.username; - } - if (settings.password) { - parsedProxyUrl.password = settings.password; - } - return parsedProxyUrl; - } - function setProxyAgentOnRequest(request3, cachedAgents, proxyUrl) { - if (request3.agent) { - return; - } - const url2 = new URL(request3.url); - const isInsecure = url2.protocol !== "https:"; - if (request3.tlsSettings) { - log_js_1.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored."); - } - const headers = request3.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); - } - request3.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); - } - request3.agent = cachedAgents.httpsProxyAgent; - } - } - function proxyPolicy(proxySettings, options) { - if (!noProxyListLoaded) { - exports2.globalNoProxyList.push(...loadNoProxy()); - } - const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); - const cachedAgents = {}; - return { - name: exports2.proxyPolicyName, - async sendRequest(request3, next) { - if (!request3.proxySettings && defaultProxy && !isBypassed(request3.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request3, cachedAgents, defaultProxy); - } else if (request3.proxySettings) { - setProxyAgentOnRequest(request3, cachedAgents, getUrlFromProxySettings(request3.proxySettings)); - } - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/agentPolicy.js -var require_agentPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/agentPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.agentPolicyName = void 0; - exports2.agentPolicy = agentPolicy; - exports2.agentPolicyName = "agentPolicy"; - function agentPolicy(agent) { - return { - name: exports2.agentPolicyName, - sendRequest: async (req, next) => { - if (!req.agent) { - req.agent = agent; - } - return next(req); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/tlsPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tlsPolicyName = void 0; - exports2.tlsPolicy = tlsPolicy; - exports2.tlsPolicyName = "tlsPolicy"; - function tlsPolicy(tlsSettings) { - return { - name: exports2.tlsPolicyName, - sendRequest: async (req, next) => { - if (!req.tlsSettings) { - req.tlsSettings = tlsSettings; - } - return next(req); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - exports2.isBinaryBody = isBinaryBody; - exports2.isReadableStream = isReadableStream; - exports2.isBlob = isBlob; - function isNodeReadableStream(x) { - return Boolean(x && typeof x["pipe"] === "function"); - } - function isWebReadableStream(x) { - return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); - } - function isBinaryBody(body) { - return body !== void 0 && (body instanceof Uint8Array || isReadableStream(body) || typeof body === "function" || body instanceof Blob); - } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); - } - function isBlob(x) { - return typeof x.stream === "function"; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var stream_1 = require("stream"); - var typeGuards_js_1 = require_typeGuards(); - async function* streamAsyncIterator() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = await reader.read(); - if (done) { - return; - } - yield value; - } - } finally { - reader.releaseLock(); - } - } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } - } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return stream_1.Readable.fromWeb(stream2); - } else { - return stream2; - } - } - function toStream(source) { - if (source instanceof Uint8Array) { - return stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return ensureNodeStream(source.stream()); - } else { - return ensureNodeStream(source); - } - } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return stream_1.Readable.from((async function* () { - for (const stream2 of streams) { - for await (const chunk of stream2) { - yield chunk; - } - } - })()); - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/multipartPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.multipartPolicyName = void 0; - exports2.multipartPolicy = multipartPolicy; - var bytesEncoding_js_1 = require_bytesEncoding(); - var typeGuards_js_1 = require_typeGuards(); - var uuidUtils_js_1 = require_uuidUtils(); - var concat_js_1 = require_concat(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, uuidUtils_js_1.randomUUID)()}`; - } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; - } - return result; - } - function getLength(source) { - if (source instanceof Uint8Array) { - return source.byteLength; - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return source.size === -1 ? void 0 : source.size; - } else { - return void 0; - } - } - function getTotalLength(sources) { - let total = 0; - for (const source of sources) { - const partLength = getLength(source); - if (partLength === void 0) { - return void 0; - } else { - total += partLength; - } - } - return total; - } - async function buildRequestBody(request3, parts, boundary) { - const sources = [ - (0, bytesEncoding_js_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, bytesEncoding_js_1.stringToUint8Array)("\r\n", "utf-8"), - (0, bytesEncoding_js_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, bytesEncoding_js_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, bytesEncoding_js_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, bytesEncoding_js_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request3.headers.set("Content-Length", contentLength); - } - request3.body = await (0, concat_js_1.concat)(sources); - } - exports2.multipartPolicyName = "multipartPolicy"; - var maxBoundaryLength = 70; - var validBoundaryCharacters = new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`); - function assertValidBoundary(boundary) { - if (boundary.length > maxBoundaryLength) { - throw new Error(`Multipart boundary "${boundary}" exceeds maximum length of 70 characters`); - } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); - } - } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request3, next) { - if (!request3.multipartBody) { - return next(request3); - } - if (request3.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request3.multipartBody.boundary; - const contentTypeHeader = request3.headers.get("Content-Type") ?? "multipart/mixed"; - const parsedHeader = contentTypeHeader.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/); - if (!parsedHeader) { - throw new Error(`Got multipart request body, but content-type header was not multipart: ${contentTypeHeader}`); - } - const [, contentType, parsedBoundary] = parsedHeader; - if (parsedBoundary && boundary && parsedBoundary !== boundary) { - throw new Error(`Multipart boundary was specified as ${parsedBoundary} in the header, but got ${boundary} in the request body`); - } - boundary ??= parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); - } - request3.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request3, request3.multipartBody.parts, boundary); - request3.multipartBody = void 0; - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createPipelineFromOptions = createPipelineFromOptions; - var logPolicy_js_1 = require_logPolicy(); - var pipeline_js_1 = require_pipeline(); - var redirectPolicy_js_1 = require_redirectPolicy(); - var userAgentPolicy_js_1 = require_userAgentPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var checkEnvironment_js_1 = require_checkEnvironment(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var agentPolicy_js_1 = require_agentPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var multipartPolicy_js_1 = require_multipartPolicy(); - function createPipelineFromOptions(options) { - const pipeline2 = (0, pipeline_js_1.createEmptyPipeline)(); - if (checkEnvironment_js_1.isNodeLike) { - if (options.agent) { - pipeline2.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); - } - if (options.tlsOptions) { - pipeline2.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline2.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline2.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline2.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline2.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline2.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline2.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - if (checkEnvironment_js_1.isNodeLike) { - pipeline2.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline2.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline2; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/apiVersionPolicy.js -var require_apiVersionPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/apiVersionPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.apiVersionPolicyName = void 0; - exports2.apiVersionPolicy = apiVersionPolicy; - exports2.apiVersionPolicyName = "ApiVersionPolicy"; - function apiVersionPolicy(options) { - return { - name: exports2.apiVersionPolicyName, - sendRequest: (req, next) => { - const url2 = new URL(req.url); - if (!url2.searchParams.get("api-version") && options.apiVersion) { - req.url = `${req.url}${Array.from(url2.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; - } - return next(req); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/credentials.js -var require_credentials = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/credentials.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isOAuth2TokenCredential = isOAuth2TokenCredential; - exports2.isBearerTokenCredential = isBearerTokenCredential; - exports2.isBasicCredential = isBasicCredential; - exports2.isApiKeyCredential = isApiKeyCredential; - function isOAuth2TokenCredential(credential) { - return "getOAuth2Token" in credential; - } - function isBearerTokenCredential(credential) { - return "getBearerToken" in credential; - } - function isBasicCredential(credential) { - return "username" in credential && "password" in credential; - } - function isApiKeyCredential(credential) { - return "key" in credential; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/checkInsecureConnection.js -var require_checkInsecureConnection = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/checkInsecureConnection.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ensureSecureConnection = ensureSecureConnection; - var log_js_1 = require_log2(); - var insecureConnectionWarningEmmitted = false; - function allowInsecureConnection(request3, options) { - if (options.allowInsecureConnection && request3.allowInsecureConnection) { - const url2 = new URL(request3.url); - if (url2.hostname === "localhost" || url2.hostname === "127.0.0.1") { - return true; - } - } - return false; - } - function emitInsecureConnectionWarning() { - const warning14 = "Sending token over insecure transport. Assume any token issued is compromised."; - log_js_1.logger.warning(warning14); - if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { - insecureConnectionWarningEmmitted = true; - process.emitWarning(warning14); - } - } - function ensureSecureConnection(request3, options) { - if (!request3.url.toLowerCase().startsWith("https://")) { - if (allowInsecureConnection(request3, options)) { - emitInsecureConnectionWarning(); - } else { - throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); - } - } - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js -var require_apiKeyAuthenticationPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.apiKeyAuthenticationPolicyName = void 0; - exports2.apiKeyAuthenticationPolicy = apiKeyAuthenticationPolicy; - var checkInsecureConnection_js_1 = require_checkInsecureConnection(); - exports2.apiKeyAuthenticationPolicyName = "apiKeyAuthenticationPolicy"; - function apiKeyAuthenticationPolicy(options) { - return { - name: exports2.apiKeyAuthenticationPolicyName, - async sendRequest(request3, next) { - (0, checkInsecureConnection_js_1.ensureSecureConnection)(request3, options); - const scheme = (request3.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); - if (!scheme) { - return next(request3); - } - if (scheme.apiKeyLocation !== "header") { - throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); - } - request3.headers.set(scheme.name, options.credential.key); - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/basicAuthenticationPolicy.js -var require_basicAuthenticationPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/basicAuthenticationPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.basicAuthenticationPolicyName = void 0; - exports2.basicAuthenticationPolicy = basicAuthenticationPolicy; - var bytesEncoding_js_1 = require_bytesEncoding(); - var checkInsecureConnection_js_1 = require_checkInsecureConnection(); - exports2.basicAuthenticationPolicyName = "bearerAuthenticationPolicy"; - function basicAuthenticationPolicy(options) { - return { - name: exports2.basicAuthenticationPolicyName, - async sendRequest(request3, next) { - (0, checkInsecureConnection_js_1.ensureSecureConnection)(request3, options); - const scheme = (request3.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); - if (!scheme) { - return next(request3); - } - const { username, password } = options.credential; - const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); - request3.headers.set("Authorization", `Basic ${headerValue}`); - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js -var require_bearerAuthenticationPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.bearerAuthenticationPolicyName = void 0; - exports2.bearerAuthenticationPolicy = bearerAuthenticationPolicy; - var checkInsecureConnection_js_1 = require_checkInsecureConnection(); - exports2.bearerAuthenticationPolicyName = "bearerAuthenticationPolicy"; - function bearerAuthenticationPolicy(options) { - return { - name: exports2.bearerAuthenticationPolicyName, - async sendRequest(request3, next) { - (0, checkInsecureConnection_js_1.ensureSecureConnection)(request3, options); - const scheme = (request3.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); - if (!scheme) { - return next(request3); - } - const token = await options.credential.getBearerToken({ - abortSignal: request3.abortSignal - }); - request3.headers.set("Authorization", `Bearer ${token}`); - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js -var require_oauth2AuthenticationPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.oauth2AuthenticationPolicyName = void 0; - exports2.oauth2AuthenticationPolicy = oauth2AuthenticationPolicy; - var checkInsecureConnection_js_1 = require_checkInsecureConnection(); - exports2.oauth2AuthenticationPolicyName = "oauth2AuthenticationPolicy"; - function oauth2AuthenticationPolicy(options) { - return { - name: exports2.oauth2AuthenticationPolicyName, - async sendRequest(request3, next) { - (0, checkInsecureConnection_js_1.ensureSecureConnection)(request3, options); - const scheme = (request3.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); - if (!scheme) { - return next(request3); - } - const token = await options.credential.getOAuth2Token(scheme.flows, { - abortSignal: request3.abortSignal - }); - request3.headers.set("Authorization", `Bearer ${token}`); - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/clientHelpers.js -var require_clientHelpers = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/clientHelpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createDefaultPipeline = createDefaultPipeline; - exports2.getCachedDefaultHttpsClient = getCachedDefaultHttpsClient; - var defaultHttpClient_js_1 = require_defaultHttpClient(); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - var apiVersionPolicy_js_1 = require_apiVersionPolicy(); - var credentials_js_1 = require_credentials(); - var apiKeyAuthenticationPolicy_js_1 = require_apiKeyAuthenticationPolicy(); - var basicAuthenticationPolicy_js_1 = require_basicAuthenticationPolicy(); - var bearerAuthenticationPolicy_js_1 = require_bearerAuthenticationPolicy(); - var oauth2AuthenticationPolicy_js_1 = require_oauth2AuthenticationPolicy(); - var cachedHttpClient; - function createDefaultPipeline(options = {}) { - const pipeline2 = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); - pipeline2.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); - const { credential, authSchemes, allowInsecureConnection } = options; - if (credential) { - if ((0, credentials_js_1.isApiKeyCredential)(credential)) { - pipeline2.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); - } else if ((0, credentials_js_1.isBasicCredential)(credential)) { - pipeline2.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); - } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { - pipeline2.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); - } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { - pipeline2.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); - } - } - return pipeline2; - } - function getCachedDefaultHttpsClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); - } - return cachedHttpClient; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js -var require_multipart = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.buildBodyPart = buildBodyPart; - exports2.buildMultipartBody = buildMultipartBody; - var restError_js_1 = require_restError(); - var httpHeaders_js_1 = require_httpHeaders(); - var bytesEncoding_js_1 = require_bytesEncoding(); - var typeGuards_js_1 = require_typeGuards(); - function getHeaderValue(descriptor, headerName) { - if (descriptor.headers) { - const actualHeaderName = Object.keys(descriptor.headers).find((x) => x.toLowerCase() === headerName.toLowerCase()); - if (actualHeaderName) { - return descriptor.headers[actualHeaderName]; - } - } - return void 0; - } - function getPartContentType(descriptor) { - const contentTypeHeader = getHeaderValue(descriptor, "content-type"); - if (contentTypeHeader) { - return contentTypeHeader; - } - if (descriptor.contentType === null) { - return void 0; - } - if (descriptor.contentType) { - return descriptor.contentType; - } - const { body } = descriptor; - if (body === null || body === void 0) { - return void 0; - } - if (typeof body === "string" || typeof body === "number" || typeof body === "boolean") { - return "text/plain; charset=UTF-8"; - } - if (body instanceof Blob) { - return body.type || "application/octet-stream"; - } - if ((0, typeGuards_js_1.isBinaryBody)(body)) { - return "application/octet-stream"; - } - return "application/json"; - } - function escapeDispositionField(value) { - return JSON.stringify(value); - } - function getContentDisposition(descriptor) { - const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); - if (contentDispositionHeader) { - return contentDispositionHeader; - } - if (descriptor.dispositionType === void 0 && descriptor.name === void 0 && descriptor.filename === void 0) { - return void 0; - } - const dispositionType = descriptor.dispositionType ?? "form-data"; - let disposition = dispositionType; - if (descriptor.name) { - disposition += `; name=${escapeDispositionField(descriptor.name)}`; - } - let filename = void 0; - if (descriptor.filename) { - filename = descriptor.filename; - } else if (typeof File !== "undefined" && descriptor.body instanceof File) { - const filenameFromFile = descriptor.body.name; - if (filenameFromFile !== "") { - filename = filenameFromFile; - } - } - if (filename) { - disposition += `; filename=${escapeDispositionField(filename)}`; - } - return disposition; - } - function normalizeBody(body, contentType) { - if (body === void 0) { - return new Uint8Array([]); - } - if ((0, typeGuards_js_1.isBinaryBody)(body)) { - return body; - } - if (typeof body === "string" || typeof body === "number" || typeof body === "boolean") { - return (0, bytesEncoding_js_1.stringToUint8Array)(String(body), "utf-8"); - } - if (contentType && /application\/(.+\+)?json(;.+)?/i.test(String(contentType))) { - return (0, bytesEncoding_js_1.stringToUint8Array)(JSON.stringify(body), "utf-8"); - } - throw new restError_js_1.RestError(`Unsupported body/content-type combination: ${body}, ${contentType}`); - } - function buildBodyPart(descriptor) { - const contentType = getPartContentType(descriptor); - const contentDisposition = getContentDisposition(descriptor); - const headers = (0, httpHeaders_js_1.createHttpHeaders)(descriptor.headers ?? {}); - if (contentType) { - headers.set("content-type", contentType); - } - if (contentDisposition) { - headers.set("content-disposition", contentDisposition); - } - const body = normalizeBody(descriptor.body, contentType); - return { - headers, - body - }; - } - function buildMultipartBody(parts) { - return { parts: parts.map(buildBodyPart) }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/sendRequest.js -var require_sendRequest = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/sendRequest.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sendRequest = sendRequest; - var restError_js_1 = require_restError(); - var httpHeaders_js_1 = require_httpHeaders(); - var pipelineRequest_js_1 = require_pipelineRequest(); - var clientHelpers_js_1 = require_clientHelpers(); - var typeGuards_js_1 = require_typeGuards(); - var multipart_js_1 = require_multipart(); - async function sendRequest(method, url2, pipeline2, options = {}, customHttpClient) { - const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); - const request3 = buildPipelineRequest(method, url2, options); - try { - const response = await pipeline2.sendRequest(httpClient, request3); - const headers = response.headers.toJSON(); - const stream2 = response.readableStreamBody ?? response.browserStreamBody; - const parsedBody = options.responseAsStream || stream2 !== void 0 ? void 0 : getResponseBody(response); - const body = stream2 ?? parsedBody; - if (options?.onResponse) { - options.onResponse({ ...response, request: request3, rawHeaders: headers, parsedBody }); - } - return { - request: request3, - headers, - status: `${response.status}`, - body - }; - } catch (e) { - if ((0, restError_js_1.isRestError)(e) && e.response && options.onResponse) { - const { response } = e; - const rawHeaders = response.headers.toJSON(); - options?.onResponse({ ...response, request: request3, rawHeaders }, e); - } - throw e; - } - } - function getRequestContentType(options = {}) { - return options.contentType ?? options.headers?.["content-type"] ?? getContentType(options.body); - } - function getContentType(body) { - if (ArrayBuffer.isView(body)) { - return "application/octet-stream"; - } - if (typeof body === "string") { - try { - JSON.parse(body); - return "application/json"; - } catch (error3) { - return void 0; - } - } - return "application/json"; - } - function buildPipelineRequest(method, url2, options = {}) { - const requestContentType = getRequestContentType(options); - const { body, multipartBody } = getRequestBody(options.body, requestContentType); - const hasContent = body !== void 0 || multipartBody !== void 0; - const headers = (0, httpHeaders_js_1.createHttpHeaders)({ - ...options.headers ? options.headers : {}, - accept: options.accept ?? options.headers?.accept ?? "application/json", - ...hasContent && requestContentType && { - "content-type": requestContentType - } - }); - return (0, pipelineRequest_js_1.createPipelineRequest)({ - url: url2, - method, - body, - multipartBody, - headers, - allowInsecureConnection: options.allowInsecureConnection, - abortSignal: options.abortSignal, - onUploadProgress: options.onUploadProgress, - onDownloadProgress: options.onDownloadProgress, - timeout: options.timeout, - enableBrowserStreams: true, - streamResponseStatusCodes: options.responseAsStream ? /* @__PURE__ */ new Set([Number.POSITIVE_INFINITY]) : void 0 - }); - } - function getRequestBody(body, contentType = "") { - if (body === void 0) { - return { body: void 0 }; - } - if (typeof FormData !== "undefined" && body instanceof FormData) { - return { body }; - } - if ((0, typeGuards_js_1.isReadableStream)(body)) { - return { body }; - } - if (ArrayBuffer.isView(body)) { - return { body: body instanceof Uint8Array ? body : JSON.stringify(body) }; - } - const firstType = contentType.split(";")[0]; - switch (firstType) { - case "application/json": - return { body: JSON.stringify(body) }; - case "multipart/form-data": - if (Array.isArray(body)) { - return { multipartBody: (0, multipart_js_1.buildMultipartBody)(body) }; - } - return { body: JSON.stringify(body) }; - case "text/plain": - return { body: String(body) }; - default: - if (typeof body === "string") { - return { body }; - } - return { body: JSON.stringify(body) }; - } - } - function getResponseBody(response) { - const contentType = response.headers.get("content-type") ?? ""; - const firstType = contentType.split(";")[0]; - const bodyToParse = response.bodyAsText ?? ""; - if (firstType === "text/plain") { - return String(bodyToParse); - } - try { - return bodyToParse ? JSON.parse(bodyToParse) : void 0; - } catch (error3) { - if (firstType === "application/json") { - throw createParseError(response, error3); - } - return String(bodyToParse); - } - } - function createParseError(response, err) { - const msg = `Error "${err}" occurred while parsing the response body - ${response.bodyAsText}.`; - const errCode = err.code ?? restError_js_1.RestError.PARSE_ERROR; - return new restError_js_1.RestError(msg, { - code: errCode, - statusCode: response.status, - request: response.request, - response - }); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js -var require_urlHelpers = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.buildRequestUrl = buildRequestUrl; - exports2.buildBaseUrl = buildBaseUrl; - exports2.replaceAll = replaceAll; - function isQueryParameterWithOptions(x) { - const value = x.value; - return value !== void 0 && value.toString !== void 0 && typeof value.toString === "function"; - } - function buildRequestUrl(endpoint2, routePath, pathParameters, options = {}) { - if (routePath.startsWith("https://") || routePath.startsWith("http://")) { - return routePath; - } - endpoint2 = buildBaseUrl(endpoint2, options); - routePath = buildRoutePath(routePath, pathParameters, options); - const requestUrl = appendQueryParams(`${endpoint2}/${routePath}`, options); - const url2 = new URL(requestUrl); - return url2.toString().replace(/([^:]\/)\/+/g, "$1"); - } - function getQueryParamValue(key, allowReserved, style, param) { - let separator; - if (style === "pipeDelimited") { - separator = "|"; - } else if (style === "spaceDelimited") { - separator = "%20"; - } else { - separator = ","; - } - let paramValues; - if (Array.isArray(param)) { - paramValues = param; - } else if (typeof param === "object" && param.toString === Object.prototype.toString) { - paramValues = Object.entries(param).flat(); - } else { - paramValues = [param]; - } - const value = paramValues.map((p) => { - if (p === null || p === void 0) { - return ""; - } - if (!p.toString || typeof p.toString !== "function") { - throw new Error(`Query parameters must be able to be represented as string, ${key} can't`); - } - const rawValue = p.toISOString !== void 0 ? p.toISOString() : p.toString(); - return allowReserved ? rawValue : encodeURIComponent(rawValue); - }).join(separator); - return `${allowReserved ? key : encodeURIComponent(key)}=${value}`; - } - function appendQueryParams(url2, options = {}) { - if (!options.queryParameters) { - return url2; - } - const parsedUrl = new URL(url2); - const queryParams = options.queryParameters; - const paramStrings = []; - for (const key of Object.keys(queryParams)) { - const param = queryParams[key]; - if (param === void 0 || param === null) { - continue; - } - const hasMetadata = isQueryParameterWithOptions(param); - const rawValue = hasMetadata ? param.value : param; - const explode = hasMetadata ? param.explode ?? false : false; - const style = hasMetadata && param.style ? param.style : "form"; - if (explode) { - if (Array.isArray(rawValue)) { - for (const item of rawValue) { - paramStrings.push(getQueryParamValue(key, options.skipUrlEncoding ?? false, style, item)); - } - } else if (typeof rawValue === "object") { - for (const [actualKey, value] of Object.entries(rawValue)) { - paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); - } - } else { - throw new Error("explode can only be set to true for objects and arrays"); - } - } else { - paramStrings.push(getQueryParamValue(key, options.skipUrlEncoding ?? false, style, rawValue)); - } - } - if (parsedUrl.search !== "") { - parsedUrl.search += "&"; - } - parsedUrl.search += paramStrings.join("&"); - return parsedUrl.toString(); - } - function buildBaseUrl(endpoint2, options) { - if (!options.pathParameters) { - return endpoint2; - } - const pathParams = options.pathParameters; - for (const [key, param] of Object.entries(pathParams)) { - if (param === void 0 || param === null) { - throw new Error(`Path parameters ${key} must not be undefined or null`); - } - if (!param.toString || typeof param.toString !== "function") { - throw new Error(`Path parameters must be able to be represented as string, ${key} can't`); - } - let value = param.toISOString !== void 0 ? param.toISOString() : String(param); - if (!options.skipUrlEncoding) { - value = encodeURIComponent(param); - } - endpoint2 = replaceAll(endpoint2, `{${key}}`, value) ?? ""; - } - return endpoint2; - } - function buildRoutePath(routePath, pathParameters, options = {}) { - for (const pathParam of pathParameters) { - const allowReserved = typeof pathParam === "object" && (pathParam.allowReserved ?? false); - let value = typeof pathParam === "object" ? pathParam.value : pathParam; - if (!options.skipUrlEncoding && !allowReserved) { - value = encodeURIComponent(value); - } - routePath = routePath.replace(/\{[\w-]+\}/, String(value)); - } - return routePath; - } - function replaceAll(value, searchValue, replaceValue) { - return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/getClient.js -var require_getClient = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/getClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getClient = getClient; - var clientHelpers_js_1 = require_clientHelpers(); - var sendRequest_js_1 = require_sendRequest(); - var urlHelpers_js_1 = require_urlHelpers(); - var checkEnvironment_js_1 = require_checkEnvironment(); - function getClient(endpoint2, clientOptions = {}) { - const pipeline2 = clientOptions.pipeline ?? (0, clientHelpers_js_1.createDefaultPipeline)(clientOptions); - if (clientOptions.additionalPolicies?.length) { - for (const { policy, position } of clientOptions.additionalPolicies) { - const afterPhase = position === "perRetry" ? "Sign" : void 0; - pipeline2.addPolicy(policy, { - afterPhase - }); - } - } - const { allowInsecureConnection, httpClient } = clientOptions; - const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path30, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path30, args, { allowInsecureConnection, ...requestOptions }); - return { - get: (requestOptions = {}) => { - return buildOperation("GET", getUrl(requestOptions), pipeline2, requestOptions, allowInsecureConnection, httpClient); - }, - post: (requestOptions = {}) => { - return buildOperation("POST", getUrl(requestOptions), pipeline2, requestOptions, allowInsecureConnection, httpClient); - }, - put: (requestOptions = {}) => { - return buildOperation("PUT", getUrl(requestOptions), pipeline2, requestOptions, allowInsecureConnection, httpClient); - }, - patch: (requestOptions = {}) => { - return buildOperation("PATCH", getUrl(requestOptions), pipeline2, requestOptions, allowInsecureConnection, httpClient); - }, - delete: (requestOptions = {}) => { - return buildOperation("DELETE", getUrl(requestOptions), pipeline2, requestOptions, allowInsecureConnection, httpClient); - }, - head: (requestOptions = {}) => { - return buildOperation("HEAD", getUrl(requestOptions), pipeline2, requestOptions, allowInsecureConnection, httpClient); - }, - options: (requestOptions = {}) => { - return buildOperation("OPTIONS", getUrl(requestOptions), pipeline2, requestOptions, allowInsecureConnection, httpClient); - }, - trace: (requestOptions = {}) => { - return buildOperation("TRACE", getUrl(requestOptions), pipeline2, requestOptions, allowInsecureConnection, httpClient); - } - }; - }; - return { - path: client, - pathUnchecked: client, - pipeline: pipeline2 - }; - } - function buildOperation(method, url2, pipeline2, options, allowInsecureConnection, httpClient) { - allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; - return { - then: function(onFulfilled, onrejected) { - return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline2, { ...options, allowInsecureConnection }, httpClient).then(onFulfilled, onrejected); - }, - async asBrowserStream() { - if (checkEnvironment_js_1.isNodeLike) { - throw new Error("`asBrowserStream` is supported only in the browser environment. Use `asNodeStream` instead to obtain the response body stream. If you require a Web stream of the response in Node, consider using `Readable.toWeb` on the result of `asNodeStream`."); - } else { - return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline2, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); - } - }, - async asNodeStream() { - if (checkEnvironment_js_1.isNodeLike) { - return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline2, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); - } else { - throw new Error("`isNodeStream` is not supported in the browser environment. Use `asBrowserStream` to obtain the response body stream."); - } - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/operationOptionHelpers.js -var require_operationOptionHelpers = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/operationOptionHelpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.operationOptionsToRequestParameters = operationOptionsToRequestParameters; - function operationOptionsToRequestParameters(options) { - return { - allowInsecureConnection: options.requestOptions?.allowInsecureConnection, - timeout: options.requestOptions?.timeout, - skipUrlEncoding: options.requestOptions?.skipUrlEncoding, - abortSignal: options.abortSignal, - onUploadProgress: options.requestOptions?.onUploadProgress, - onDownloadProgress: options.requestOptions?.onDownloadProgress, - headers: { ...options.requestOptions?.headers }, - onResponse: options.onResponse - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/restError.js -var require_restError2 = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/restError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createRestError = createRestError; - var restError_js_1 = require_restError(); - var httpHeaders_js_1 = require_httpHeaders(); - function createRestError(messageOrResponse, response) { - const resp = typeof messageOrResponse === "string" ? response : messageOrResponse; - const internalError = resp.body?.error ?? resp.body; - const message = typeof messageOrResponse === "string" ? messageOrResponse : internalError?.message ?? `Unexpected status code: ${resp.status}`; - return new restError_js_1.RestError(message, { - statusCode: statusCodeToNumber(resp.status), - code: internalError?.code, - request: resp.request, - response: toPipelineResponse(resp) - }); - } - function toPipelineResponse(response) { - return { - headers: (0, httpHeaders_js_1.createHttpHeaders)(response.headers), - request: response.request, - status: statusCodeToNumber(response.status) ?? -1 - }; - } - function statusCodeToNumber(statusCode) { - const status = Number.parseInt(statusCode); - return Number.isNaN(status) ? void 0 : status; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/index.js -var require_commonjs = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createRestError = exports2.operationOptionsToRequestParameters = exports2.getClient = exports2.createDefaultHttpClient = exports2.uint8ArrayToString = exports2.stringToUint8Array = exports2.isRestError = exports2.RestError = exports2.createEmptyPipeline = exports2.createPipelineRequest = exports2.createHttpHeaders = exports2.TypeSpecRuntimeLogger = exports2.setLogLevel = exports2.getLogLevel = exports2.createClientLogger = exports2.AbortError = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var AbortError_js_1 = require_AbortError(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); - var logger_js_1 = require_logger(); - Object.defineProperty(exports2, "createClientLogger", { enumerable: true, get: function() { - return logger_js_1.createClientLogger; - } }); - Object.defineProperty(exports2, "getLogLevel", { enumerable: true, get: function() { - return logger_js_1.getLogLevel; - } }); - Object.defineProperty(exports2, "setLogLevel", { enumerable: true, get: function() { - return logger_js_1.setLogLevel; - } }); - Object.defineProperty(exports2, "TypeSpecRuntimeLogger", { enumerable: true, get: function() { - return logger_js_1.TypeSpecRuntimeLogger; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - tslib_1.__exportStar(require_schemes(), exports2); - tslib_1.__exportStar(require_oauth2Flows(), exports2); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - var pipeline_js_1 = require_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var restError_js_1 = require_restError(); - Object.defineProperty(exports2, "RestError", { enumerable: true, get: function() { - return restError_js_1.RestError; - } }); - Object.defineProperty(exports2, "isRestError", { enumerable: true, get: function() { - return restError_js_1.isRestError; - } }); - var bytesEncoding_js_1 = require_bytesEncoding(); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - Object.defineProperty(exports2, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var getClient_js_1 = require_getClient(); - Object.defineProperty(exports2, "getClient", { enumerable: true, get: function() { - return getClient_js_1.getClient; - } }); - var operationOptionHelpers_js_1 = require_operationOptionHelpers(); - Object.defineProperty(exports2, "operationOptionsToRequestParameters", { enumerable: true, get: function() { - return operationOptionHelpers_js_1.operationOptionsToRequestParameters; - } }); - var restError_js_2 = require_restError2(); - Object.defineProperty(exports2, "createRestError", { enumerable: true, get: function() { - return restError_js_2.createRestError; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createEmptyPipeline = createEmptyPipeline; - var ts_http_runtime_1 = require_commonjs(); - function createEmptyPipeline() { - return (0, ts_http_runtime_1.createEmptyPipeline)(); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/internal.js -var require_internal = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/internal.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createLoggerContext = void 0; - var logger_js_1 = require_logger(); - Object.defineProperty(exports2, "createLoggerContext", { enumerable: true, get: function() { - return logger_js_1.createLoggerContext; - } }); - } -}); - -// node_modules/@azure/logger/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/logger/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureLogger = void 0; - exports2.setLogLevel = setLogLevel; - exports2.getLogLevel = getLogLevel; - exports2.createClientLogger = createClientLogger; - var logger_1 = require_internal(); - var context5 = (0, logger_1.createLoggerContext)({ - logLevelEnvVarName: "AZURE_LOG_LEVEL", - namespace: "azure" - }); - exports2.AzureLogger = context5.logger; - function setLogLevel(level) { - context5.setLogLevel(level); - } - function getLogLevel() { - return context5.getLogLevel(); - } - function createClientLogger(namespace) { - return context5.createClientLogger(namespace); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_1 = require_commonjs2(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryPolicyName = void 0; - exports2.exponentialRetryPolicy = exponentialRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.exponentialRetryPolicyName = "exponentialRetryPolicy"; - function exponentialRetryPolicy(options = {}) { - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)({ - ...options, - ignoreSystemErrors: true - }) - ], { - maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.systemErrorRetryPolicyName = void 0; - exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; - function systemErrorRetryPolicy(options = {}) { - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)({ - ...options, - ignoreHttpStatusCodes: true - }) - ], { - maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.throttlingRetryPolicyName = void 0; - exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; - function throttlingRetryPolicy(options = {}) { - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/internal.js -var require_internal2 = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/internal.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.userAgentPolicyName = exports2.userAgentPolicy = exports2.tlsPolicyName = exports2.tlsPolicy = exports2.redirectPolicyName = exports2.redirectPolicy = exports2.getDefaultProxySettings = exports2.proxyPolicyName = exports2.proxyPolicy = exports2.multipartPolicyName = exports2.multipartPolicy = exports2.logPolicyName = exports2.logPolicy = exports2.formDataPolicyName = exports2.formDataPolicy = exports2.throttlingRetryPolicyName = exports2.throttlingRetryPolicy = exports2.systemErrorRetryPolicyName = exports2.systemErrorRetryPolicy = exports2.retryPolicy = exports2.exponentialRetryPolicyName = exports2.exponentialRetryPolicy = exports2.defaultRetryPolicyName = exports2.defaultRetryPolicy = exports2.decompressResponsePolicyName = exports2.decompressResponsePolicy = exports2.agentPolicyName = exports2.agentPolicy = void 0; - var agentPolicy_js_1 = require_agentPolicy(); - Object.defineProperty(exports2, "agentPolicy", { enumerable: true, get: function() { - return agentPolicy_js_1.agentPolicy; - } }); - Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { - return agentPolicy_js_1.agentPolicyName; - } }); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { - return decompressResponsePolicy_js_1.decompressResponsePolicy; - } }); - Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { - return decompressResponsePolicy_js_1.decompressResponsePolicyName; - } }); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicyName; - } }); - var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); - Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { - return exponentialRetryPolicy_js_1.exponentialRetryPolicy; - } }); - Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { - return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; - } }); - var retryPolicy_js_1 = require_retryPolicy(); - Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { - return retryPolicy_js_1.retryPolicy; - } }); - var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); - Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { - return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; - } }); - Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { - return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; - } }); - var throttlingRetryPolicy_js_1 = require_throttlingRetryPolicy(); - Object.defineProperty(exports2, "throttlingRetryPolicy", { enumerable: true, get: function() { - return throttlingRetryPolicy_js_1.throttlingRetryPolicy; - } }); - Object.defineProperty(exports2, "throttlingRetryPolicyName", { enumerable: true, get: function() { - return throttlingRetryPolicy_js_1.throttlingRetryPolicyName; - } }); - var formDataPolicy_js_1 = require_formDataPolicy(); - Object.defineProperty(exports2, "formDataPolicy", { enumerable: true, get: function() { - return formDataPolicy_js_1.formDataPolicy; - } }); - Object.defineProperty(exports2, "formDataPolicyName", { enumerable: true, get: function() { - return formDataPolicy_js_1.formDataPolicyName; - } }); - var logPolicy_js_1 = require_logPolicy(); - Object.defineProperty(exports2, "logPolicy", { enumerable: true, get: function() { - return logPolicy_js_1.logPolicy; - } }); - Object.defineProperty(exports2, "logPolicyName", { enumerable: true, get: function() { - return logPolicy_js_1.logPolicyName; - } }); - var multipartPolicy_js_1 = require_multipartPolicy(); - Object.defineProperty(exports2, "multipartPolicy", { enumerable: true, get: function() { - return multipartPolicy_js_1.multipartPolicy; - } }); - Object.defineProperty(exports2, "multipartPolicyName", { enumerable: true, get: function() { - return multipartPolicy_js_1.multipartPolicyName; - } }); - var proxyPolicy_js_1 = require_proxyPolicy(); - Object.defineProperty(exports2, "proxyPolicy", { enumerable: true, get: function() { - return proxyPolicy_js_1.proxyPolicy; - } }); - Object.defineProperty(exports2, "proxyPolicyName", { enumerable: true, get: function() { - return proxyPolicy_js_1.proxyPolicyName; - } }); - Object.defineProperty(exports2, "getDefaultProxySettings", { enumerable: true, get: function() { - return proxyPolicy_js_1.getDefaultProxySettings; - } }); - var redirectPolicy_js_1 = require_redirectPolicy(); - Object.defineProperty(exports2, "redirectPolicy", { enumerable: true, get: function() { - return redirectPolicy_js_1.redirectPolicy; - } }); - Object.defineProperty(exports2, "redirectPolicyName", { enumerable: true, get: function() { - return redirectPolicy_js_1.redirectPolicyName; - } }); - var tlsPolicy_js_1 = require_tlsPolicy(); - Object.defineProperty(exports2, "tlsPolicy", { enumerable: true, get: function() { - return tlsPolicy_js_1.tlsPolicy; - } }); - Object.defineProperty(exports2, "tlsPolicyName", { enumerable: true, get: function() { - return tlsPolicy_js_1.tlsPolicyName; - } }); - var userAgentPolicy_js_1 = require_userAgentPolicy(); - Object.defineProperty(exports2, "userAgentPolicy", { enumerable: true, get: function() { - return userAgentPolicy_js_1.userAgentPolicy; - } }); - Object.defineProperty(exports2, "userAgentPolicyName", { enumerable: true, get: function() { - return userAgentPolicy_js_1.userAgentPolicyName; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logPolicyName = void 0; - exports2.logPolicy = logPolicy; - var log_js_1 = require_log3(); - var policies_1 = require_internal2(); - exports2.logPolicyName = policies_1.logPolicyName; - function logPolicy(options = {}) { - return (0, policies_1.logPolicy)({ - logger: log_js_1.logger.info, - ...options - }); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.redirectPolicyName = void 0; - exports2.redirectPolicy = redirectPolicy; - var policies_1 = require_internal2(); - exports2.redirectPolicyName = policies_1.redirectPolicyName; - function redirectPolicy(options = {}) { - return (0, policies_1.redirectPolicy)(options); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getHeaderName = getHeaderName; - exports2.setPlatformSpecificData = setPlatformSpecificData; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_os_1 = tslib_1.__importDefault(require("node:os")); - var node_process_1 = tslib_1.__importDefault(require("node:process")); - function getHeaderName() { - return "User-Agent"; - } - async function setPlatformSpecificData(map) { - if (node_process_1.default && node_process_1.default.versions) { - const osInfo = `${node_os_1.default.type()} ${node_os_1.default.release()}; ${node_os_1.default.arch()}`; - const versions = node_process_1.default.versions; - if (versions.bun) { - map.set("Bun", `${versions.bun} (${osInfo})`); - } else if (versions.deno) { - map.set("Deno", `${versions.deno} (${osInfo})`); - } else if (versions.node) { - map.set("Node", `${versions.node} (${osInfo})`); - } - } - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants9 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_RETRY_POLICY_COUNT = exports2.SDK_VERSION = void 0; - exports2.SDK_VERSION = "1.22.2"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUserAgentHeaderName = getUserAgentHeaderName; - exports2.getUserAgentValue = getUserAgentValue; - var userAgentPlatform_js_1 = require_userAgentPlatform2(); - var constants_js_1 = require_constants9(); - function getUserAgentString(telemetryInfo) { - const parts = []; - for (const [key, value] of telemetryInfo) { - const token = value ? `${key}/${value}` : key; - parts.push(token); - } - return parts.join(" "); - } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); - } - async function getUserAgentValue(prefix) { - const runtimeInfo = /* @__PURE__ */ new Map(); - runtimeInfo.set("core-rest-pipeline", constants_js_1.SDK_VERSION); - await (0, userAgentPlatform_js_1.setPlatformSpecificData)(runtimeInfo); - const defaultAgent = getUserAgentString(runtimeInfo); - const userAgentValue = prefix ? `${prefix} ${defaultAgent}` : defaultAgent; - return userAgentValue; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.userAgentPolicyName = void 0; - exports2.userAgentPolicy = userAgentPolicy; - var userAgent_js_1 = require_userAgent2(); - var UserAgentHeaderName = (0, userAgent_js_1.getUserAgentHeaderName)(); - exports2.userAgentPolicyName = "userAgentPolicy"; - function userAgentPolicy(options = {}) { - const userAgentValue = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - return { - name: exports2.userAgentPolicyName, - async sendRequest(request3, next) { - if (!request3.headers.has(UserAgentHeaderName)) { - request3.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request3); - } - }; - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var node_crypto_1 = require("node:crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, node_crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); - } - async function computeSha256Hash(content, encoding) { - return (0, node_crypto_1.createHash)("sha256").update(content).digest(encoding); - } - } -}); - -// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/internal.js -var require_internal3 = __commonJS({ - "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/internal.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = exports2.uint8ArrayToString = exports2.stringToUint8Array = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.calculateRetryDelay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - var random_js_1 = require_random(); - Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { - return random_js_1.getRandomIntegerInclusive; - } }); - var object_js_1 = require_object(); - Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { - return object_js_1.isObject; - } }); - var error_js_1 = require_error(); - Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { - return error_js_1.isError; - } }); - var sha256_js_1 = require_sha256(); - Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { - return sha256_js_1.computeSha256Hash; - } }); - Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { - return sha256_js_1.computeSha256Hmac; - } }); - var uuidUtils_js_1 = require_uuidUtils(); - Object.defineProperty(exports2, "randomUUID", { enumerable: true, get: function() { - return uuidUtils_js_1.randomUUID; - } }); - var checkEnvironment_js_1 = require_checkEnvironment(); - Object.defineProperty(exports2, "isBrowser", { enumerable: true, get: function() { - return checkEnvironment_js_1.isBrowser; - } }); - Object.defineProperty(exports2, "isBun", { enumerable: true, get: function() { - return checkEnvironment_js_1.isBun; - } }); - Object.defineProperty(exports2, "isNodeLike", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNodeLike; - } }); - Object.defineProperty(exports2, "isNodeRuntime", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNodeRuntime; - } }); - Object.defineProperty(exports2, "isDeno", { enumerable: true, get: function() { - return checkEnvironment_js_1.isDeno; - } }); - Object.defineProperty(exports2, "isReactNative", { enumerable: true, get: function() { - return checkEnvironment_js_1.isReactNative; - } }); - Object.defineProperty(exports2, "isWebWorker", { enumerable: true, get: function() { - return checkEnvironment_js_1.isWebWorker; - } }); - var bytesEncoding_js_1 = require_bytesEncoding(); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - Object.defineProperty(exports2, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - var sanitizer_js_1 = require_sanitizer(); - Object.defineProperty(exports2, "Sanitizer", { enumerable: true, get: function() { - return sanitizer_js_1.Sanitizer; - } }); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/aborterUtils.js -var require_aborterUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/aborterUtils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.cancelablePromiseRace = cancelablePromiseRace; - async function cancelablePromiseRace(abortablePromiseBuilders, options) { - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - options?.abortSignal?.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - options?.abortSignal?.removeEventListener("abort", abortHandler); - } - } - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError_js_1 = require_AbortError2(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js -var require_createAbortablePromise = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createAbortablePromise = createAbortablePromise; - var abort_controller_1 = require_commonjs3(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; - return new Promise((resolve14, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); - } - function removeListeners() { - abortSignal?.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort?.(); - removeListeners(); - rejectOnAbort(); - } - if (abortSignal?.aborted) { - return rejectOnAbort(); - } - try { - buildPromise((x) => { - removeListeners(); - resolve14(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); - } - abortSignal?.addEventListener("abort", onAbort); - }); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/delay.js -var require_delay2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/delay.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.calculateRetryDelay = calculateRetryDelay; - var createAbortablePromise_js_1 = require_createAbortablePromise(); - var util_1 = require_internal3(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options ?? {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve14) => { - token = setTimeout(resolve14, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg ?? StandardAbortMessage - }); - } - function calculateRetryDelay(retryAttempt, config) { - const exponentialDelay = config.retryDelayInMs * Math.pow(2, retryAttempt); - const clampedDelay = Math.min(config.maxRetryDelayInMs, exponentialDelay); - const retryAfterInMs = clampedDelay / 2 + (0, util_1.getRandomIntegerInclusive)(0, clampedDelay / 2); - return { retryAfterInMs }; - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getErrorMessage = getErrorMessage2; - var util_1 = require_internal3(); - function getErrorMessage2(e) { - if ((0, util_1.isError)(e)) { - return e.message; - } else { - let stringified; - try { - if (typeof e === "object" && e) { - stringified = JSON.stringify(e); - } else { - stringified = String(e); - } - } catch (err) { - stringified = "[unable to stringify input]"; - } - return `Unknown error ${stringified}`; - } - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined3; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined3(thing) { - return typeof thing !== "undefined" && thing !== null; - } - function isObjectWithProperties(thing, properties) { - if (!isDefined3(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; - } - function objectHasProperty(thing, property) { - return isDefined3(thing) && typeof thing === "object" && property in thing; - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs4 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isWebWorker = exports2.isReactNative = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isDeno = exports2.isBun = exports2.isBrowser = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.getErrorMessage = exports2.delay = exports2.createAbortablePromise = exports2.cancelablePromiseRace = void 0; - exports2.calculateRetryDelay = calculateRetryDelay; - exports2.computeSha256Hash = computeSha256Hash; - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; - exports2.isError = isError; - exports2.isObject = isObject2; - exports2.randomUUID = randomUUID; - exports2.uint8ArrayToString = uint8ArrayToString; - exports2.stringToUint8Array = stringToUint8Array; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var tspRuntime = tslib_1.__importStar(require_internal3()); - var aborterUtils_js_1 = require_aborterUtils(); - Object.defineProperty(exports2, "cancelablePromiseRace", { enumerable: true, get: function() { - return aborterUtils_js_1.cancelablePromiseRace; - } }); - var createAbortablePromise_js_1 = require_createAbortablePromise(); - Object.defineProperty(exports2, "createAbortablePromise", { enumerable: true, get: function() { - return createAbortablePromise_js_1.createAbortablePromise; - } }); - var delay_js_1 = require_delay2(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - var error_js_1 = require_error2(); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - var typeGuards_js_1 = require_typeGuards2(); - Object.defineProperty(exports2, "isDefined", { enumerable: true, get: function() { - return typeGuards_js_1.isDefined; - } }); - Object.defineProperty(exports2, "isObjectWithProperties", { enumerable: true, get: function() { - return typeGuards_js_1.isObjectWithProperties; - } }); - Object.defineProperty(exports2, "objectHasProperty", { enumerable: true, get: function() { - return typeGuards_js_1.objectHasProperty; - } }); - function calculateRetryDelay(retryAttempt, config) { - return tspRuntime.calculateRetryDelay(retryAttempt, config); - } - function computeSha256Hash(content, encoding) { - return tspRuntime.computeSha256Hash(content, encoding); - } - function computeSha256Hmac(key, stringToSign, encoding) { - return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); - } - function getRandomIntegerInclusive(min, max) { - return tspRuntime.getRandomIntegerInclusive(min, max); - } - function isError(e) { - return tspRuntime.isError(e); - } - function isObject2(input) { - return tspRuntime.isObject(input); - } - function randomUUID() { - return tspRuntime.randomUUID(); - } - exports2.isBrowser = tspRuntime.isBrowser; - exports2.isBun = tspRuntime.isBun; - exports2.isDeno = tspRuntime.isDeno; - exports2.isNode = tspRuntime.isNodeLike; - exports2.isNodeLike = tspRuntime.isNodeLike; - exports2.isNodeRuntime = tspRuntime.isNodeRuntime; - exports2.isReactNative = tspRuntime.isReactNative; - exports2.isWebWorker = tspRuntime.isWebWorker; - function uint8ArrayToString(bytes, format) { - return tspRuntime.uint8ArrayToString(bytes, format); - } - function stringToUint8Array(value, format) { - return tspRuntime.stringToUint8Array(value, format); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.js -var require_file2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hasRawContent = hasRawContent; - exports2.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs4(); - function isNodeReadableStream(x) { - return Boolean(x && typeof x["pipe"] === "function"); - } - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - bytes: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = /* @__PURE__ */ Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; - } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob; - } - } - function createFileFromStream(stream2, name, options = {}) { - return { - ...unimplementedMethods, - type: options.type ?? "", - lastModified: options.lastModified ?? (/* @__PURE__ */ new Date()).getTime(), - webkitRelativePath: options.webkitRelativePath ?? "", - size: options.size ?? -1, - name, - stream: () => { - const s = stream2(); - if (isNodeReadableStream(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); - } - return s; - }, - [rawContent]: stream2 - }; - } - function createFile(content, name, options = {}) { - if (core_util_1.isNodeLike) { - return { - ...unimplementedMethods, - type: options.type ?? "", - lastModified: options.lastModified ?? (/* @__PURE__ */ new Date()).getTime(), - webkitRelativePath: options.webkitRelativePath ?? "", - size: content.byteLength, - name, - arrayBuffer: async () => content.buffer, - stream: () => new Blob([toArrayBuffer(content)]).stream(), - [rawContent]: () => content - }; - } else { - return new File([toArrayBuffer(content)], name, options); - } - } - function toArrayBuffer(source) { - if ("resize" in source.buffer) { - return source; - } - return source.map((x) => x); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.multipartPolicyName = void 0; - exports2.multipartPolicy = multipartPolicy; - var policies_1 = require_internal2(); - var file_js_1 = require_file2(); - exports2.multipartPolicyName = policies_1.multipartPolicyName; - function multipartPolicy() { - const tspPolicy = (0, policies_1.multipartPolicy)(); - return { - name: exports2.multipartPolicyName, - sendRequest: async (request3, next) => { - if (request3.multipartBody) { - for (const part of request3.multipartBody.parts) { - if ((0, file_js_1.hasRawContent)(part.body)) { - part.body = (0, file_js_1.getRawContent)(part.body); - } - } - } - return tspPolicy.sendRequest(request3, next); - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.decompressResponsePolicyName = void 0; - exports2.decompressResponsePolicy = decompressResponsePolicy; - var policies_1 = require_internal2(); - exports2.decompressResponsePolicyName = policies_1.decompressResponsePolicyName; - function decompressResponsePolicy() { - return (0, policies_1.decompressResponsePolicy)(); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.defaultRetryPolicyName = void 0; - exports2.defaultRetryPolicy = defaultRetryPolicy; - var policies_1 = require_internal2(); - exports2.defaultRetryPolicyName = policies_1.defaultRetryPolicyName; - function defaultRetryPolicy(options = {}) { - return (0, policies_1.defaultRetryPolicy)(options); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.formDataPolicyName = void 0; - exports2.formDataPolicy = formDataPolicy; - var policies_1 = require_internal2(); - exports2.formDataPolicyName = policies_1.formDataPolicyName; - function formDataPolicy() { - return (0, policies_1.formDataPolicy)(); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.proxyPolicyName = void 0; - exports2.getDefaultProxySettings = getDefaultProxySettings; - exports2.proxyPolicy = proxyPolicy; - var policies_1 = require_internal2(); - exports2.proxyPolicyName = policies_1.proxyPolicyName; - function getDefaultProxySettings(proxyUrl) { - return (0, policies_1.getDefaultProxySettings)(proxyUrl); - } - function proxyPolicy(proxySettings, options) { - return (0, policies_1.proxyPolicy)(proxySettings, options); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/setClientRequestIdPolicy.js -var require_setClientRequestIdPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/setClientRequestIdPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.setClientRequestIdPolicyName = void 0; - exports2.setClientRequestIdPolicy = setClientRequestIdPolicy; - exports2.setClientRequestIdPolicyName = "setClientRequestIdPolicy"; - function setClientRequestIdPolicy(requestIdHeaderName = "x-ms-client-request-id") { - return { - name: exports2.setClientRequestIdPolicyName, - async sendRequest(request3, next) { - if (!request3.headers.has(requestIdHeaderName)) { - request3.headers.set(requestIdHeaderName, request3.requestId); - } - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/agentPolicy.js -var require_agentPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/agentPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.agentPolicyName = void 0; - exports2.agentPolicy = agentPolicy; - var policies_1 = require_internal2(); - exports2.agentPolicyName = policies_1.agentPolicyName; - function agentPolicy(agent) { - return (0, policies_1.agentPolicy)(agent); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tlsPolicyName = void 0; - exports2.tlsPolicy = tlsPolicy; - var policies_1 = require_internal2(); - exports2.tlsPolicyName = policies_1.tlsPolicyName; - function tlsPolicy(tlsSettings) { - return (0, policies_1.tlsPolicy)(tlsSettings); - } - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js -var require_tracingContext = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TracingContextImpl = exports2.knownContextKeys = void 0; - exports2.createTracingContext = createTracingContext; - exports2.knownContextKeys = { - span: /* @__PURE__ */ Symbol.for("@azure/core-tracing span"), - namespace: /* @__PURE__ */ Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context5 = new TracingContextImpl(options.parentContext); - if (options.span) { - context5 = context5.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context5 = context5.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context5; - } - var TracingContextImpl = class _TracingContextImpl { - _contextMap; - constructor(initialContext) { - this._contextMap = initialContext instanceof _TracingContextImpl ? new Map(initialContext._contextMap) : /* @__PURE__ */ new Map(); - } - setValue(key, value) { - const newContext = new _TracingContextImpl(this); - newContext._contextMap.set(key, value); - return newContext; - } - getValue(key) { - return this._contextMap.get(key); - } - deleteValue(key) { - const newContext = new _TracingContextImpl(this); - newContext._contextMap.delete(key); - return newContext; - } - }; - exports2.TracingContextImpl = TracingContextImpl; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/state.js -var require_state = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/state.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.state = void 0; - exports2.state = { - instrumenterImplementation: void 0 - }; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js -var require_instrumenter = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - exports2.useInstrumenter = useInstrumenter; - exports2.getInstrumenter = getInstrumenter; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - }, - addEvent: () => { - } - }; - } - function createDefaultInstrumenter() { - return { - createRequestHeaders: () => { - return {}; - }, - parseTraceparentHeader: () => { - return void 0; - }, - startSpan: (_name, spanOptions) => { - return { - span: createDefaultTracingSpan(), - tracingContext: (0, tracingContext_js_1.createTracingContext)({ parentContext: spanOptions.tracingContext }) - }; - }, - withContext(_context, callback, ...callbackArgs) { - return callback(...callbackArgs); - } - }; - } - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; - } - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js -var require_tracingClient = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTracingClient = createTracingClient; - var instrumenter_js_1 = require_instrumenter(); - var tracingContext_js_1 = require_tracingContext(); - function createTracingClient(options) { - const { namespace, packageName, packageVersion } = options; - function startSpan(name, operationOptions, spanOptions) { - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, { - ...spanOptions, - packageName, - packageVersion, - tracingContext: operationOptions?.tracingOptions?.tracingContext - }); - let tracingContext = startSpanResult.tracingContext; - const span = startSpanResult.span; - if (!tracingContext.getValue(tracingContext_js_1.knownContextKeys.namespace)) { - tracingContext = tracingContext.setValue(tracingContext_js_1.knownContextKeys.namespace, namespace); - } - span.setAttribute("az.namespace", tracingContext.getValue(tracingContext_js_1.knownContextKeys.namespace)); - const updatedOptions = Object.assign({}, operationOptions, { - tracingOptions: { ...operationOptions?.tracingOptions, tracingContext } - }); - return { - span, - updatedOptions - }; - } - async function withSpan(name, operationOptions, callback, spanOptions) { - const { span, updatedOptions } = startSpan(name, operationOptions, spanOptions); - try { - const result = await withContext(updatedOptions.tracingOptions.tracingContext, () => Promise.resolve(callback(updatedOptions, span))); - span.setStatus({ status: "success" }); - return result; - } catch (err) { - span.setStatus({ status: "error", error: err }); - throw err; - } finally { - span.end(); - } - } - function withContext(context5, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context5, callback, ...callbackArgs); - } - function parseTraceparentHeader(traceparentHeader) { - return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); - } - function createRequestHeaders(tracingContext) { - return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); - } - return { - startSpan, - withSpan, - withContext, - parseTraceparentHeader, - createRequestHeaders - }; - } - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs5 = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTracingClient = exports2.useInstrumenter = void 0; - var instrumenter_js_1 = require_instrumenter(); - Object.defineProperty(exports2, "useInstrumenter", { enumerable: true, get: function() { - return instrumenter_js_1.useInstrumenter; - } }); - var tracingClient_js_1 = require_tracingClient(); - Object.defineProperty(exports2, "createTracingClient", { enumerable: true, get: function() { - return tracingClient_js_1.createTracingClient; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RestError = void 0; - exports2.isRestError = isRestError; - var ts_http_runtime_1 = require_commonjs(); - exports2.RestError = ts_http_runtime_1.RestError; - function isRestError(e) { - return (0, ts_http_runtime_1.isRestError)(e); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tracingPolicy.js -var require_tracingPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tracingPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tracingPolicyName = void 0; - exports2.tracingPolicy = tracingPolicy; - var core_tracing_1 = require_commonjs5(); - var constants_js_1 = require_constants9(); - var userAgent_js_1 = require_userAgent2(); - var log_js_1 = require_log3(); - var core_util_1 = require_commonjs4(); - var restError_js_1 = require_restError3(); - var util_1 = require_internal3(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new util_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request3, next) { - if (!tracingClient) { - return next(request3); - } - const userAgent2 = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request3.url), - "http.method": request3.method, - "http.user_agent": userAgent2, - requestId: request3.requestId - }; - if (userAgent2) { - spanAttributes["http.user_agent"] = userAgent2; - } - const { span, tracingContext } = tryCreateSpan(tracingClient, request3, spanAttributes) ?? {}; - if (!span || !tracingContext) { - return next(request3); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request3); - tryProcessResponse(span, response); - return response; - } catch (err) { - tryProcessError(span, err); - throw err; - } - } - }; - } - function tryCreateTracingClient() { - try { - return (0, core_tracing_1.createTracingClient)({ - namespace: "", - packageName: "@azure/core-rest-pipeline", - packageVersion: constants_js_1.SDK_VERSION - }); - } catch (e) { - log_js_1.logger.warning(`Error when creating the TracingClient: ${(0, core_util_1.getErrorMessage)(e)}`); - return void 0; - } - } - function tryCreateSpan(tracingClient, request3, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request3.method}`, { tracingOptions: request3.tracingOptions }, { - spanKind: "client", - spanAttributes - }); - if (!span.isRecording()) { - span.end(); - return void 0; - } - const headers = tracingClient.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); - for (const [key, value] of Object.entries(headers)) { - request3.headers.set(key, value); - } - return { span, tracingContext: updatedOptions.tracingOptions.tracingContext }; - } catch (e) { - log_js_1.logger.warning(`Skipping creating a tracing span due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - return void 0; - } - } - function tryProcessError(span, error3) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error3) ? error3 : void 0 - }); - if ((0, restError_js_1.isRestError)(error3) && error3.statusCode) { - span.setAttribute("http.status_code", error3.statusCode); - } - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } - } - function tryProcessResponse(span, response) { - try { - span.setAttribute("http.status_code", response.status); - const serviceRequestId = response.headers.get("x-ms-request-id"); - if (serviceRequestId) { - span.setAttribute("serviceRequestId", serviceRequestId); - } - if (response.status >= 400) { - span.setStatus({ - status: "error" - }); - } - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/wrapAbortSignal.js -var require_wrapAbortSignal = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/wrapAbortSignal.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.wrapAbortSignalLike = wrapAbortSignalLike; - function wrapAbortSignalLike(abortSignalLike) { - if (abortSignalLike instanceof AbortSignal) { - return { abortSignal: abortSignalLike }; - } - if (abortSignalLike.aborted) { - return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; - } - const controller = new AbortController(); - let needsCleanup = true; - function cleanup() { - if (needsCleanup) { - abortSignalLike.removeEventListener("abort", listener); - needsCleanup = false; - } - } - function listener() { - controller.abort(abortSignalLike.reason); - cleanup(); - } - abortSignalLike.addEventListener("abort", listener); - return { abortSignal: controller.signal, cleanup }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/wrapAbortSignalLikePolicy.js -var require_wrapAbortSignalLikePolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/wrapAbortSignalLikePolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.wrapAbortSignalLikePolicyName = void 0; - exports2.wrapAbortSignalLikePolicy = wrapAbortSignalLikePolicy; - var wrapAbortSignal_js_1 = require_wrapAbortSignal(); - exports2.wrapAbortSignalLikePolicyName = "wrapAbortSignalLikePolicy"; - function wrapAbortSignalLikePolicy() { - return { - name: exports2.wrapAbortSignalLikePolicyName, - sendRequest: async (request3, next) => { - if (!request3.abortSignal) { - return next(request3); - } - const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request3.abortSignal); - request3.abortSignal = abortSignal; - try { - return await next(request3); - } finally { - cleanup?.(); - } - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createPipelineFromOptions = createPipelineFromOptions; - var logPolicy_js_1 = require_logPolicy2(); - var pipeline_js_1 = require_pipeline2(); - var redirectPolicy_js_1 = require_redirectPolicy2(); - var userAgentPolicy_js_1 = require_userAgentPolicy2(); - var multipartPolicy_js_1 = require_multipartPolicy2(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy2(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy2(); - var formDataPolicy_js_1 = require_formDataPolicy2(); - var core_util_1 = require_commonjs4(); - var proxyPolicy_js_1 = require_proxyPolicy2(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var agentPolicy_js_1 = require_agentPolicy2(); - var tlsPolicy_js_1 = require_tlsPolicy2(); - var tracingPolicy_js_1 = require_tracingPolicy(); - var wrapAbortSignalLikePolicy_js_1 = require_wrapAbortSignalLikePolicy(); - function createPipelineFromOptions(options) { - const pipeline2 = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.agent) { - pipeline2.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); - } - if (options.tlsOptions) { - pipeline2.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline2.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline2.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline2.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); - pipeline2.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline2.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline2.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); - pipeline2.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline2.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline2.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline2.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline2.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline2; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js -var require_defaultHttpClient2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createDefaultHttpClient = createDefaultHttpClient; - var ts_http_runtime_1 = require_commonjs(); - var wrapAbortSignal_js_1 = require_wrapAbortSignal(); - function createDefaultHttpClient() { - const client = (0, ts_http_runtime_1.createDefaultHttpClient)(); - return { - async sendRequest(request3) { - const { abortSignal, cleanup } = request3.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request3.abortSignal) : {}; - try { - request3.abortSignal = abortSignal; - return await client.sendRequest(request3); - } finally { - cleanup?.(); - } - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - var ts_http_runtime_1 = require_commonjs(); - function createHttpHeaders(rawHeaders) { - return (0, ts_http_runtime_1.createHttpHeaders)(rawHeaders); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createPipelineRequest = createPipelineRequest; - var ts_http_runtime_1 = require_commonjs(); - function createPipelineRequest(options) { - return (0, ts_http_runtime_1.createPipelineRequest)(options); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryPolicyName = void 0; - exports2.exponentialRetryPolicy = exponentialRetryPolicy; - var policies_1 = require_internal2(); - exports2.exponentialRetryPolicyName = policies_1.exponentialRetryPolicyName; - function exponentialRetryPolicy(options = {}) { - return (0, policies_1.exponentialRetryPolicy)(options); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.systemErrorRetryPolicyName = void 0; - exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var policies_1 = require_internal2(); - exports2.systemErrorRetryPolicyName = policies_1.systemErrorRetryPolicyName; - function systemErrorRetryPolicy(options = {}) { - return (0, policies_1.systemErrorRetryPolicy)(options); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.throttlingRetryPolicyName = void 0; - exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var policies_1 = require_internal2(); - exports2.throttlingRetryPolicyName = policies_1.throttlingRetryPolicyName; - function throttlingRetryPolicy(options = {}) { - return (0, policies_1.throttlingRetryPolicy)(options); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryPolicy = retryPolicy; - var logger_1 = require_commonjs2(); - var constants_js_1 = require_constants9(); - var policies_1 = require_internal2(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline retryPolicy"); - function retryPolicy(strategies, options = { maxRetries: constants_js_1.DEFAULT_RETRY_POLICY_COUNT }) { - return (0, policies_1.retryPolicy)(strategies, { - logger: retryPolicyLogger, - ...options - }); - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js -var require_tokenCycler = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var core_util_1 = require_commonjs4(); - exports2.DEFAULT_CYCLER_OPTIONS = { - forcedRefreshWindowInMs: 1e3, - // Force waiting for a refresh 1s before the token expires - retryIntervalInMs: 3e3, - // Allow refresh attempts every 3s - refreshWindowInMs: 1e3 * 60 * 2 - // Start refreshing 2m before expiry - }; - async function beginRefresh(getAccessToken, retryIntervalInMs, refreshTimeout) { - async function tryGetAccessToken() { - if (Date.now() < refreshTimeout) { - try { - return await getAccessToken(); - } catch { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); - } - return finalToken; - } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, core_util_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; - } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = { - ...exports2.DEFAULT_CYCLER_OPTIONS, - ...tokenCyclerOptions - }; - const cycler = { - /** - * Produces true if a refresh job is currently in progress. - */ - get isRefreshing() { - return refreshWorker !== null; - }, - /** - * Produces true if the cycler SHOULD refresh (we are within the refresh - * window and not already refreshing) - */ - get shouldRefresh() { - if (cycler.isRefreshing) { - return false; - } - if (token?.refreshAfterTimestamp && token.refreshAfterTimestamp < Date.now()) { - return true; - } - return (token?.expiresOnTimestamp ?? 0) - options.refreshWindowInMs < Date.now(); - }, - /** - * Produces true if the cycler MUST refresh (null or nearly-expired - * token). - */ - get mustRefresh() { - return token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now(); - } - }; - function refresh(scopes, getTokenOptions) { - if (!cycler.isRefreshing) { - const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions); - refreshWorker = beginRefresh( - tryGetAccessToken, - options.retryIntervalInMs, - // If we don't have a token, then we should timeout immediately - token?.expiresOnTimestamp ?? Date.now() - ).then((_token) => { - refreshWorker = null; - token = _token; - tenantId = getTokenOptions.tenantId; - return token; - }).catch((reason) => { - refreshWorker = null; - token = null; - tenantId = void 0; - throw reason; - }); - } - return refreshWorker; - } - return async (scopes, tokenOptions) => { - const hasClaimChallenge = Boolean(tokenOptions.claims); - const tenantIdChanged = tenantId !== tokenOptions.tenantId; - if (hasClaimChallenge) { - token = null; - } - const mustRefresh = tenantIdChanged || hasClaimChallenge || cycler.mustRefresh; - if (mustRefresh) { - return refresh(scopes, tokenOptions); - } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); - } - return token; - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js -var require_bearerTokenAuthenticationPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - exports2.parseChallenges = parseChallenges; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log3(); - var restError_js_1 = require_restError3(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function trySendRequest(request3, next) { - try { - return [await next(request3), void 0]; - } catch (e) { - if ((0, restError_js_1.isRestError)(e) && e.response) { - return [e.response, e]; - } else { - throw e; - } - } - } - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request: request3 } = options; - const getTokenOptions = { - abortSignal: request3.abortSignal, - tracingOptions: request3.tracingOptions, - enableCae: true - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); - } - } - function isChallengeResponse(response) { - return response.status === 401 && response.headers.has("WWW-Authenticate"); - } - async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { - const { scopes } = onChallengeOptions; - const accessToken = await onChallengeOptions.getAccessToken(scopes, { - enableCae: true, - claims: caeClaims - }); - if (!accessToken) { - return false; - } - onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); - return true; - } - function bearerTokenAuthenticationPolicy(options) { - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = { - authorizeRequest: challengeCallbacks?.authorizeRequest?.bind(challengeCallbacks) ?? defaultAuthorizeRequest, - authorizeRequestOnChallenge: challengeCallbacks?.authorizeRequestOnChallenge?.bind(challengeCallbacks) - }; - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); - return { - name: exports2.bearerTokenAuthenticationPolicyName, - /** - * If there's no challenge parameter: - * - It will try to retrieve the token using the cache, or the credential's getToken. - * - Then it will try the next policy with or without the retrieved token. - * - * It uses the challenge parameters to: - * - Skip a first attempt to get the token from the credential if there's no cached token, - * since it expects the token to be retrievable only after the challenge. - * - Prepare the outgoing request if the `prepareRequest` method has been provided. - * - Send an initial request to receive the challenge if it fails. - * - Process a challenge if the response contains it. - * - Retrieve a token with the challenge information, then re-send the request. - */ - async sendRequest(request3, next) { - if (!request3.url.toLowerCase().startsWith("https://")) { - throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); - } - await callbacks.authorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request: request3, - getAccessToken, - logger - }); - let response; - let error3; - let shouldSendRequest; - [response, error3] = await trySendRequest(request3, next); - if (isChallengeResponse(response)) { - let claims = getCaeChallengeClaims(response.headers.get("WWW-Authenticate")); - if (claims) { - let parsedClaim; - try { - parsedClaim = atob(claims); - } catch (e) { - logger.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${claims}`); - return response; - } - shouldSendRequest = await authorizeRequestOnCaeChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - response, - request: request3, - getAccessToken, - logger - }, parsedClaim); - if (shouldSendRequest) { - [response, error3] = await trySendRequest(request3, next); - } - } else if (callbacks.authorizeRequestOnChallenge) { - shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request: request3, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - [response, error3] = await trySendRequest(request3, next); - } - if (isChallengeResponse(response)) { - claims = getCaeChallengeClaims(response.headers.get("WWW-Authenticate")); - if (claims) { - let parsedClaim; - try { - parsedClaim = atob(claims); - } catch (e) { - logger.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${claims}`); - return response; - } - shouldSendRequest = await authorizeRequestOnCaeChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - response, - request: request3, - getAccessToken, - logger - }, parsedClaim); - if (shouldSendRequest) { - [response, error3] = await trySendRequest(request3, next); - } - } - } - } - } - if (error3) { - throw error3; - } else { - return response; - } - } - }; - } - function parseChallenges(challenges) { - const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; - const paramRegex = /(\w+)="([^"]*)"/g; - const parsedChallenges = []; - let match2; - while ((match2 = challengeRegex.exec(challenges)) !== null) { - const scheme = match2[1]; - const paramsString = match2[2]; - const params = {}; - let paramMatch; - while ((paramMatch = paramRegex.exec(paramsString)) !== null) { - params[paramMatch[1]] = paramMatch[2]; - } - parsedChallenges.push({ scheme, params }); - } - return parsedChallenges; - } - function getCaeChallengeClaims(challenges) { - if (!challenges) { - return; - } - const parsedChallenges = parseChallenges(challenges); - return parsedChallenges.find((x) => x.scheme === "Bearer" && x.params.claims && x.params.error === "insufficient_claims")?.params.claims; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/ndJsonPolicy.js -var require_ndJsonPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/ndJsonPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { - return { - name: exports2.ndJsonPolicyName, - async sendRequest(request3, next) { - if (typeof request3.body === "string" && request3.body.startsWith("[")) { - const body = JSON.parse(request3.body); - if (Array.isArray(body)) { - request3.body = body.map((item) => JSON.stringify(item) + "\n").join(""); - } - } - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/auxiliaryAuthenticationHeaderPolicy.js -var require_auxiliaryAuthenticationHeaderPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/auxiliaryAuthenticationHeaderPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log3(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - const { scopes, getAccessToken, request: request3 } = options; - const getTokenOptions = { - abortSignal: request3.abortSignal, - tracingOptions: request3.tracingOptions - }; - return (await getAccessToken(scopes, getTokenOptions))?.token ?? ""; - } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); - return { - name: exports2.auxiliaryAuthenticationHeaderPolicyName, - async sendRequest(request3, next) { - if (!request3.url.toLowerCase().startsWith("https://")) { - throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs."); - } - if (!credentials || credentials.length === 0) { - logger.info(`${exports2.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`); - return next(request3); - } - const tokenPromises = []; - for (const credential of credentials) { - let getAccessToken = tokenCyclerMap.get(credential); - if (!getAccessToken) { - getAccessToken = (0, tokenCycler_js_1.createTokenCycler)(credential); - tokenCyclerMap.set(credential, getAccessToken); - } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request: request3, - getAccessToken, - logger - })); - } - const auxiliaryTokens = (await Promise.all(tokenPromises)).filter((token) => Boolean(token)); - if (auxiliaryTokens.length === 0) { - logger.warning(`None of the auxiliary tokens are valid. ${AUTHORIZATION_AUXILIARY_HEADER} header will not be set.`); - return next(request3); - } - request3.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs6 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createFileFromStream = exports2.createFile = exports2.agentPolicyName = exports2.agentPolicy = exports2.auxiliaryAuthenticationHeaderPolicyName = exports2.auxiliaryAuthenticationHeaderPolicy = exports2.ndJsonPolicyName = exports2.ndJsonPolicy = exports2.bearerTokenAuthenticationPolicyName = exports2.bearerTokenAuthenticationPolicy = exports2.formDataPolicyName = exports2.formDataPolicy = exports2.tlsPolicyName = exports2.tlsPolicy = exports2.userAgentPolicyName = exports2.userAgentPolicy = exports2.defaultRetryPolicy = exports2.tracingPolicyName = exports2.tracingPolicy = exports2.retryPolicy = exports2.throttlingRetryPolicyName = exports2.throttlingRetryPolicy = exports2.systemErrorRetryPolicyName = exports2.systemErrorRetryPolicy = exports2.redirectPolicyName = exports2.redirectPolicy = exports2.getDefaultProxySettings = exports2.proxyPolicyName = exports2.proxyPolicy = exports2.multipartPolicyName = exports2.multipartPolicy = exports2.logPolicyName = exports2.logPolicy = exports2.setClientRequestIdPolicyName = exports2.setClientRequestIdPolicy = exports2.exponentialRetryPolicyName = exports2.exponentialRetryPolicy = exports2.decompressResponsePolicyName = exports2.decompressResponsePolicy = exports2.isRestError = exports2.RestError = exports2.createPipelineRequest = exports2.createHttpHeaders = exports2.createDefaultHttpClient = exports2.createPipelineFromOptions = exports2.createEmptyPipeline = void 0; - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions2(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient2(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders2(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest2(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - var restError_js_1 = require_restError3(); - Object.defineProperty(exports2, "RestError", { enumerable: true, get: function() { - return restError_js_1.RestError; - } }); - Object.defineProperty(exports2, "isRestError", { enumerable: true, get: function() { - return restError_js_1.isRestError; - } }); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy2(); - Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { - return decompressResponsePolicy_js_1.decompressResponsePolicy; - } }); - Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { - return decompressResponsePolicy_js_1.decompressResponsePolicyName; - } }); - var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy2(); - Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { - return exponentialRetryPolicy_js_1.exponentialRetryPolicy; - } }); - Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { - return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; - } }); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - Object.defineProperty(exports2, "setClientRequestIdPolicy", { enumerable: true, get: function() { - return setClientRequestIdPolicy_js_1.setClientRequestIdPolicy; - } }); - Object.defineProperty(exports2, "setClientRequestIdPolicyName", { enumerable: true, get: function() { - return setClientRequestIdPolicy_js_1.setClientRequestIdPolicyName; - } }); - var logPolicy_js_1 = require_logPolicy2(); - Object.defineProperty(exports2, "logPolicy", { enumerable: true, get: function() { - return logPolicy_js_1.logPolicy; - } }); - Object.defineProperty(exports2, "logPolicyName", { enumerable: true, get: function() { - return logPolicy_js_1.logPolicyName; - } }); - var multipartPolicy_js_1 = require_multipartPolicy2(); - Object.defineProperty(exports2, "multipartPolicy", { enumerable: true, get: function() { - return multipartPolicy_js_1.multipartPolicy; - } }); - Object.defineProperty(exports2, "multipartPolicyName", { enumerable: true, get: function() { - return multipartPolicy_js_1.multipartPolicyName; - } }); - var proxyPolicy_js_1 = require_proxyPolicy2(); - Object.defineProperty(exports2, "proxyPolicy", { enumerable: true, get: function() { - return proxyPolicy_js_1.proxyPolicy; - } }); - Object.defineProperty(exports2, "proxyPolicyName", { enumerable: true, get: function() { - return proxyPolicy_js_1.proxyPolicyName; - } }); - Object.defineProperty(exports2, "getDefaultProxySettings", { enumerable: true, get: function() { - return proxyPolicy_js_1.getDefaultProxySettings; - } }); - var redirectPolicy_js_1 = require_redirectPolicy2(); - Object.defineProperty(exports2, "redirectPolicy", { enumerable: true, get: function() { - return redirectPolicy_js_1.redirectPolicy; - } }); - Object.defineProperty(exports2, "redirectPolicyName", { enumerable: true, get: function() { - return redirectPolicy_js_1.redirectPolicyName; - } }); - var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy2(); - Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { - return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; - } }); - Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { - return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; - } }); - var throttlingRetryPolicy_js_1 = require_throttlingRetryPolicy2(); - Object.defineProperty(exports2, "throttlingRetryPolicy", { enumerable: true, get: function() { - return throttlingRetryPolicy_js_1.throttlingRetryPolicy; - } }); - Object.defineProperty(exports2, "throttlingRetryPolicyName", { enumerable: true, get: function() { - return throttlingRetryPolicy_js_1.throttlingRetryPolicyName; - } }); - var retryPolicy_js_1 = require_retryPolicy2(); - Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { - return retryPolicy_js_1.retryPolicy; - } }); - var tracingPolicy_js_1 = require_tracingPolicy(); - Object.defineProperty(exports2, "tracingPolicy", { enumerable: true, get: function() { - return tracingPolicy_js_1.tracingPolicy; - } }); - Object.defineProperty(exports2, "tracingPolicyName", { enumerable: true, get: function() { - return tracingPolicy_js_1.tracingPolicyName; - } }); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy2(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - var userAgentPolicy_js_1 = require_userAgentPolicy2(); - Object.defineProperty(exports2, "userAgentPolicy", { enumerable: true, get: function() { - return userAgentPolicy_js_1.userAgentPolicy; - } }); - Object.defineProperty(exports2, "userAgentPolicyName", { enumerable: true, get: function() { - return userAgentPolicy_js_1.userAgentPolicyName; - } }); - var tlsPolicy_js_1 = require_tlsPolicy2(); - Object.defineProperty(exports2, "tlsPolicy", { enumerable: true, get: function() { - return tlsPolicy_js_1.tlsPolicy; - } }); - Object.defineProperty(exports2, "tlsPolicyName", { enumerable: true, get: function() { - return tlsPolicy_js_1.tlsPolicyName; - } }); - var formDataPolicy_js_1 = require_formDataPolicy2(); - Object.defineProperty(exports2, "formDataPolicy", { enumerable: true, get: function() { - return formDataPolicy_js_1.formDataPolicy; - } }); - Object.defineProperty(exports2, "formDataPolicyName", { enumerable: true, get: function() { - return formDataPolicy_js_1.formDataPolicyName; - } }); - var bearerTokenAuthenticationPolicy_js_1 = require_bearerTokenAuthenticationPolicy(); - Object.defineProperty(exports2, "bearerTokenAuthenticationPolicy", { enumerable: true, get: function() { - return bearerTokenAuthenticationPolicy_js_1.bearerTokenAuthenticationPolicy; - } }); - Object.defineProperty(exports2, "bearerTokenAuthenticationPolicyName", { enumerable: true, get: function() { - return bearerTokenAuthenticationPolicy_js_1.bearerTokenAuthenticationPolicyName; - } }); - var ndJsonPolicy_js_1 = require_ndJsonPolicy(); - Object.defineProperty(exports2, "ndJsonPolicy", { enumerable: true, get: function() { - return ndJsonPolicy_js_1.ndJsonPolicy; - } }); - Object.defineProperty(exports2, "ndJsonPolicyName", { enumerable: true, get: function() { - return ndJsonPolicy_js_1.ndJsonPolicyName; - } }); - var auxiliaryAuthenticationHeaderPolicy_js_1 = require_auxiliaryAuthenticationHeaderPolicy(); - Object.defineProperty(exports2, "auxiliaryAuthenticationHeaderPolicy", { enumerable: true, get: function() { - return auxiliaryAuthenticationHeaderPolicy_js_1.auxiliaryAuthenticationHeaderPolicy; - } }); - Object.defineProperty(exports2, "auxiliaryAuthenticationHeaderPolicyName", { enumerable: true, get: function() { - return auxiliaryAuthenticationHeaderPolicy_js_1.auxiliaryAuthenticationHeaderPolicyName; - } }); - var agentPolicy_js_1 = require_agentPolicy2(); - Object.defineProperty(exports2, "agentPolicy", { enumerable: true, get: function() { - return agentPolicy_js_1.agentPolicy; - } }); - Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { - return agentPolicy_js_1.agentPolicyName; - } }); - var file_js_1 = require_file2(); - Object.defineProperty(exports2, "createFile", { enumerable: true, get: function() { - return file_js_1.createFile; - } }); - Object.defineProperty(exports2, "createFileFromStream", { enumerable: true, get: function() { - return file_js_1.createFileFromStream; - } }); - } -}); - -// node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js -var require_azureKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureKeyCredential = void 0; - var AzureKeyCredential = class { - _key; - /** - * The value of the key to be used in authentication - */ - get key() { - return this._key; - } - /** - * Create an instance of an AzureKeyCredential for use - * with a service client. - * - * @param key - The initial value of the key to use in authentication - */ - constructor(key) { - if (!key) { - throw new Error("key must be a non-empty string"); - } - this._key = key; - } - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newKey - The new key value to be used - */ - update(newKey) { - this._key = newKey; - } - }; - exports2.AzureKeyCredential = AzureKeyCredential; - } -}); - -// node_modules/@azure/core-auth/dist/commonjs/keyCredential.js -var require_keyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/keyCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs4(); - function isKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; - } - } -}); - -// node_modules/@azure/core-auth/dist/commonjs/azureNamedKeyCredential.js -var require_azureNamedKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureNamedKeyCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureNamedKeyCredential = void 0; - exports2.isNamedKeyCredential = isNamedKeyCredential; - var core_util_1 = require_commonjs4(); - var AzureNamedKeyCredential = class { - _key; - _name; - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; - } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; - } - /** - * Create an instance of an AzureNamedKeyCredential for use - * with a service client. - * - * @param name - The initial value of the name to use in authentication. - * @param key - The initial value of the key to use in authentication. - */ - constructor(name, key) { - if (!name || !key) { - throw new TypeError("name and key must be non-empty strings"); - } - this._name = name; - this._key = key; - } - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newName - The new name value to be used. - * @param newKey - The new key value to be used. - */ - update(newName, newKey) { - if (!newName || !newKey) { - throw new TypeError("newName and newKey must be non-empty strings"); - } - this._name = newName; - this._key = newKey; - } - }; - exports2.AzureNamedKeyCredential = AzureNamedKeyCredential; - function isNamedKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["name", "key"]) && typeof credential.key === "string" && typeof credential.name === "string"; - } - } -}); - -// node_modules/@azure/core-auth/dist/commonjs/azureSASCredential.js -var require_azureSASCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureSASCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureSASCredential = void 0; - exports2.isSASCredential = isSASCredential; - var core_util_1 = require_commonjs4(); - var AzureSASCredential = class { - _signature; - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; - } - /** - * Create an instance of an AzureSASCredential for use - * with a service client. - * - * @param signature - The initial value of the shared access signature to use in authentication - */ - constructor(signature) { - if (!signature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = signature; - } - /** - * Change the value of the signature. - * - * Updates will take effect upon the next request after - * updating the signature value. - * - * @param newSignature - The new shared access signature value to be used - */ - update(newSignature) { - if (!newSignature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = newSignature; - } - }; - exports2.AzureSASCredential = AzureSASCredential; - function isSASCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; - } - } -}); - -// node_modules/@azure/core-auth/dist/commonjs/tokenCredential.js -var require_tokenCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/tokenCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isBearerToken = isBearerToken; - exports2.isPopToken = isPopToken; - exports2.isTokenCredential = isTokenCredential; - function isBearerToken(accessToken) { - return !accessToken.tokenType || accessToken.tokenType === "Bearer"; - } - function isPopToken(accessToken) { - return accessToken.tokenType === "pop"; - } - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); - } - } -}); - -// node_modules/@azure/core-auth/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isTokenCredential = exports2.isSASCredential = exports2.AzureSASCredential = exports2.isNamedKeyCredential = exports2.AzureNamedKeyCredential = exports2.isKeyCredential = exports2.AzureKeyCredential = void 0; - var azureKeyCredential_js_1 = require_azureKeyCredential(); - Object.defineProperty(exports2, "AzureKeyCredential", { enumerable: true, get: function() { - return azureKeyCredential_js_1.AzureKeyCredential; - } }); - var keyCredential_js_1 = require_keyCredential(); - Object.defineProperty(exports2, "isKeyCredential", { enumerable: true, get: function() { - return keyCredential_js_1.isKeyCredential; - } }); - var azureNamedKeyCredential_js_1 = require_azureNamedKeyCredential(); - Object.defineProperty(exports2, "AzureNamedKeyCredential", { enumerable: true, get: function() { - return azureNamedKeyCredential_js_1.AzureNamedKeyCredential; - } }); - Object.defineProperty(exports2, "isNamedKeyCredential", { enumerable: true, get: function() { - return azureNamedKeyCredential_js_1.isNamedKeyCredential; - } }); - var azureSASCredential_js_1 = require_azureSASCredential(); - Object.defineProperty(exports2, "AzureSASCredential", { enumerable: true, get: function() { - return azureSASCredential_js_1.AzureSASCredential; - } }); - Object.defineProperty(exports2, "isSASCredential", { enumerable: true, get: function() { - return azureSASCredential_js_1.isSASCredential; - } }); - var tokenCredential_js_1 = require_tokenCredential(); - Object.defineProperty(exports2, "isTokenCredential", { enumerable: true, get: function() { - return tokenCredential_js_1.isTokenCredential; - } }); - } -}); - -// node_modules/@azure/core-http-compat/dist/commonjs/policies/disableKeepAlivePolicy.js -var require_disableKeepAlivePolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/disableKeepAlivePolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.disableKeepAlivePolicyName = void 0; - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request3, next) { - request3.disableKeepAlive = true; - return next(request3); - } - }; - } - function pipelineContainsDisableKeepAlivePolicy(pipeline2) { - return pipeline2.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/base64.js -var require_base64 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/base64.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.encodeString = encodeString; - exports2.encodeByteArray = encodeByteArray; - exports2.decodeString = decodeString; - exports2.decodeStringToString = decodeStringToString; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); - } - function decodeString(value) { - return Buffer.from(value, "base64"); - } - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/interfaces.js -var require_interfaces = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/interfaces.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; - } -}); - -// node_modules/@azure/core-client/dist/commonjs/utils.js -var require_utils5 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isPrimitiveBody = isPrimitiveBody; - exports2.isDuration = isDuration; - exports2.isValidUuid = isValidUuid; - exports2.flattenResponse = flattenResponse; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || mapperTypeName?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i) !== null || value === void 0 || value === null); - } - var validateISODuration = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; - function isDuration(value) { - return validateISODuration.test(value); - } - var validUuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i; - function isValidUuid(uuid) { - return validUuidRegex.test(uuid); - } - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = { - ...responseObject.headers, - ...responseObject.body - }; - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? { - ...responseObject.headers, - body: responseObject.body - } : combinedHeadersAndBody; - } - } - function flattenResponse(fullResponse, responseSpec) { - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return { - ...parsedHeaders, - body: fullResponse.parsedBody - }; - } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper?.nullable); - const expectedBodyTypeName = bodyMapper?.type.name; - if (expectedBodyTypeName === "Stream") { - return { - ...parsedHeaders, - blobBody: fullResponse.blobBody, - readableStreamBody: fullResponse.readableStreamBody - }; - } - const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {}; - const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); - if (expectedBodyTypeName === "Sequence" || isPageableResponse) { - const arrayResponse = fullResponse.parsedBody ?? []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = fullResponse.parsedBody?.[key]; - } - } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; - } - } - return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; - } - return handleNullableResponseAndWrappableBody({ - body: fullResponse.parsedBody, - headers: parsedHeaders, - hasNullableType: isNullable, - shouldWrapBody: isPrimitiveBody(fullResponse.parsedBody, expectedBodyTypeName) - }); - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/serializer.js -var require_serializer = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MapperTypeNames = void 0; - exports2.createSerializer = createSerializer; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - modelMappers; - isXML; - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; - } - /** - * @deprecated Removing the constraints validation on client side. - */ - validateConstraints(mapper, value, objectName) { - const failValidation = (constraintName, constraintValue) => { - throw new Error(`"${objectName}" with value "${value}" should satisfy the constraint "${constraintName}": ${constraintValue}.`); - }; - if (mapper.constraints && value !== void 0 && value !== null) { - const { ExclusiveMaximum, ExclusiveMinimum, InclusiveMaximum, InclusiveMinimum, MaxItems, MaxLength, MinItems, MinLength, MultipleOf, Pattern, UniqueItems } = mapper.constraints; - if (ExclusiveMaximum !== void 0 && value >= ExclusiveMaximum) { - failValidation("ExclusiveMaximum", ExclusiveMaximum); - } - if (ExclusiveMinimum !== void 0 && value <= ExclusiveMinimum) { - failValidation("ExclusiveMinimum", ExclusiveMinimum); - } - if (InclusiveMaximum !== void 0 && value > InclusiveMaximum) { - failValidation("InclusiveMaximum", InclusiveMaximum); - } - if (InclusiveMinimum !== void 0 && value < InclusiveMinimum) { - failValidation("InclusiveMinimum", InclusiveMinimum); - } - if (MaxItems !== void 0 && value.length > MaxItems) { - failValidation("MaxItems", MaxItems); - } - if (MaxLength !== void 0 && value.length > MaxLength) { - failValidation("MaxLength", MaxLength); - } - if (MinItems !== void 0 && value.length < MinItems) { - failValidation("MinItems", MinItems); - } - if (MinLength !== void 0 && value.length < MinLength) { - failValidation("MinLength", MinLength); - } - if (MultipleOf !== void 0 && value % MultipleOf !== 0) { - failValidation("MultipleOf", MultipleOf); - } - if (Pattern) { - const pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; - if (typeof value !== "string" || value.match(pattern) === null) { - failValidation("Pattern", Pattern); - } - } - if (UniqueItems && value.some((item, i, ar) => ar.indexOf(item) !== i)) { - failValidation("UniqueItems", UniqueItems); - } - } - } - /** - * Serialize the given object based on its metadata defined in the mapper - * - * @param mapper - The mapper which defines the metadata of the serializable object - * - * @param object - A valid Javascript object to be serialized - * - * @param objectName - Name of the serialized object - * - * @param options - additional options to serialization - * - * @returns A valid serialized Javascript object - */ - serialize(mapper, object2, objectName, options = { xml: {} }) { - const updatedOptions = { - xml: { - rootName: options.xml.rootName ?? "", - includeRoot: options.xml.includeRoot ?? false, - xmlCharKey: options.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY - } - }; - let payload = {}; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; - } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; - } - if (mapper.isConstant) { - object2 = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object2 === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && (object2 === void 0 || object2 === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object2 === null) { - throw new Error(`${objectName} cannot be null.`); - } - if (object2 === void 0 || object2 === null) { - payload = object2; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object2; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object2); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object2); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object2, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object2); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object2); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object2, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object2, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object2, objectName, Boolean(this.isXML), updatedOptions); - } - } - return payload; - } - /** - * Deserialize the given object based on its metadata defined in the mapper - * - * @param mapper - The mapper which defines the metadata of the serializable object - * - * @param responseBody - A valid Javascript entity to be deserialized - * - * @param objectName - Name of the deserialized object - * - * @param options - Controls behavior of XML parser and builder. - * - * @returns A valid deserialized Javascript object - */ - deserialize(mapper, responseBody, objectName, options = { xml: {} }) { - const updatedOptions = { - xml: { - rootName: options.xml.rootName ?? "", - includeRoot: options.xml.includeRoot ?? false, - xmlCharKey: options.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: options.ignoreUnknownProperties ?? false - }; - if (responseBody === void 0 || responseBody === null) { - if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { - responseBody = []; - } - if (mapper.defaultValue !== void 0) { - responseBody = mapper.defaultValue; - } - return responseBody; - } - let payload; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; - } - if (mapperType.match(/^Composite$/i) !== null) { - payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); - } else { - if (this.isXML) { - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (responseBody[interfaces_js_1.XML_ATTRKEY] !== void 0 && responseBody[xmlCharKey] !== void 0) { - responseBody = responseBody[xmlCharKey]; - } - } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; - } - } else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; - } else if (responseBody === "false") { - payload = false; - } else { - payload = responseBody; - } - } else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { - payload = responseBody; - } else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { - payload = new Date(responseBody); - } else if (mapperType.match(/^UnixTime$/i) !== null) { - payload = unixTimeToDate(responseBody); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = base64.decodeString(responseBody); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = base64UrlToByteArray(responseBody); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); - } - } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - } - }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); - } - function trimEnd(str, ch) { - let len = str.length; - while (len - 1 >= 0 && str[len - 1] === ch) { - --len; - } - return str.substr(0, len); - } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; - } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); - } - const str = base64.encodeByteArray(buffer); - return trimEnd(str, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str) { - if (!str) { - return void 0; - } - if (str && typeof str.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); - } - str = str.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str); - } - function splitSerializeName(prop) { - const classes = []; - let partialclass = ""; - if (prop) { - const subwords = prop.split("."); - for (const item of subwords) { - if (item.charAt(item.length - 1) === "\\") { - partialclass += item.substr(0, item.length - 1) + "."; - } else { - partialclass += item; - classes.push(partialclass); - partialclass = ""; - } - } - } - return classes; - } - function dateToUnixTime(d) { - if (!d) { - return void 0; - } - if (typeof d.valueOf() === "string") { - d = new Date(d); - } - return Math.floor(d.getTime() / 1e3); - } - function unixTimeToDate(n) { - if (!n) { - return void 0; - } - return new Date(n * 1e3); - } - function serializeBasicTypes(typeName, objectName, value) { - if (value !== null && value !== void 0) { - if (typeName.match(/^Number$/i) !== null) { - if (typeof value !== "number") { - throw new Error(`${objectName} with value ${value} must be of type number.`); - } - } else if (typeName.match(/^String$/i) !== null) { - if (typeof value.valueOf() !== "string") { - throw new Error(`${objectName} with value "${value}" must be of type string.`); - } - } else if (typeName.match(/^Uuid$/i) !== null) { - if (!(typeof value.valueOf() === "string" && (0, utils_js_1.isValidUuid)(value))) { - throw new Error(`${objectName} with value "${value}" must be of type string and a valid uuid.`); - } - } else if (typeName.match(/^Boolean$/i) !== null) { - if (typeof value !== "boolean") { - throw new Error(`${objectName} with value ${value} must be of type boolean.`); - } - } else if (typeName.match(/^Stream$/i) !== null) { - const objectType = typeof value; - if (objectType !== "string" && typeof value.pipe !== "function" && // NodeJS.ReadableStream - typeof value.tee !== "function" && // browser ReadableStream - !(value instanceof ArrayBuffer) && !ArrayBuffer.isView(value) && // File objects count as a type of Blob, so we want to use instanceof explicitly - !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob) && objectType !== "function") { - throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, ReadableStream, or () => ReadableStream.`); - } - } - } - return value; - } - function serializeEnumType(objectName, allowedValues, value) { - if (!allowedValues) { - throw new Error(`Please provide a set of allowedValues to validate ${objectName} as an Enum Type.`); - } - const isPresent = allowedValues.some((item) => { - if (typeof item.valueOf() === "string") { - return item.toLowerCase() === value.toLowerCase(); - } - return item === value; - }); - if (!isPresent) { - throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); - } - return value; - } - function serializeByteArrayType(objectName, value) { - if (value !== void 0 && value !== null) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); - } - value = base64.encodeByteArray(value); - } - return value; - } - function serializeBase64UrlType(objectName, value) { - if (value !== void 0 && value !== null) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); - } - value = bufferToBase64Url(value); - } - return value; - } - function serializeDateTypes(typeName, value, objectName) { - if (value !== void 0 && value !== null) { - if (typeName.match(/^Date$/i) !== null) { - if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { - throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`); - } - value = value instanceof Date ? value.toISOString().substring(0, 10) : new Date(value).toISOString().substring(0, 10); - } else if (typeName.match(/^DateTime$/i) !== null) { - if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { - throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`); - } - value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); - } else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { - if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { - throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123 format.`); - } - value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); - } else if (typeName.match(/^UnixTime$/i) !== null) { - if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { - throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`); - } - value = dateToUnixTime(value); - } else if (typeName.match(/^TimeSpan$/i) !== null) { - if (!(0, utils_js_1.isDuration)(value)) { - throw new Error(`${objectName} must be a string in ISO 8601 format. Instead was "${value}".`); - } - } - } - return value; - } - function serializeSequenceType(serializer, mapper, object2, objectName, isXml, options) { - if (!Array.isArray(object2)) { - throw new Error(`${objectName} must be of type Array.`); - } - let elementType = mapper.type.element; - if (!elementType || typeof elementType !== "object") { - throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${objectName}.`); - } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = serializer.modelMappers[elementType.type.className] ?? elementType; - } - const tempArray = []; - for (let i = 0; i < object2.length; i++) { - const serializedValue = serializer.serialize(elementType, object2[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = { ...serializedValue }; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; - } else { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; - } - } else { - tempArray[i] = serializedValue; - } - } - return tempArray; - } - function serializeDictionaryType(serializer, mapper, object2, objectName, isXml, options) { - if (typeof object2 !== "object") { - throw new Error(`${objectName} must be of type object.`); - } - const valueType = mapper.type.value; - if (!valueType || typeof valueType !== "object") { - throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${objectName}.`); - } - const tempDictionary = {}; - for (const key of Object.keys(object2)) { - const serializedValue = serializer.serialize(valueType, object2[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); - } - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - const result = tempDictionary; - result[interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: mapper.xmlNamespace }; - return result; - } - return tempDictionary; - } - function resolveAdditionalProperties(serializer, mapper, objectName) { - const additionalProperties = mapper.type.additionalProperties; - if (!additionalProperties && mapper.type.className) { - const modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - return modelMapper?.type.additionalProperties; - } - return additionalProperties; - } - function resolveReferencedMapper(serializer, mapper, objectName) { - const className = mapper.type.className; - if (!className) { - throw new Error(`Class name for model "${objectName}" is not provided in the mapper "${JSON.stringify(mapper, void 0, 2)}".`); - } - return serializer.modelMappers[className]; - } - function resolveModelProperties(serializer, mapper, objectName) { - let modelProps = mapper.type.modelProperties; - if (!modelProps) { - const modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - if (!modelMapper) { - throw new Error(`mapper() cannot be null or undefined for model "${mapper.type.className}".`); - } - modelProps = modelMapper?.type.modelProperties; - if (!modelProps) { - throw new Error(`modelProperties cannot be null or undefined in the mapper "${JSON.stringify(modelMapper)}" of type "${mapper.type.className}" for object "${objectName}".`); - } - } - return modelProps; - } - function serializeCompositeType(serializer, mapper, object2, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object2, "clientName"); - } - if (object2 !== void 0 && object2 !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; - } - let propName; - let parentObject = payload; - if (serializer.isXML) { - if (propertyMapper.xmlIsWrapped) { - propName = propertyMapper.xmlName; - } else { - propName = propertyMapper.xmlElementName || propertyMapper.xmlName; - } - } else { - const paths = splitSerializeName(propertyMapper.serializedName); - propName = paths.pop(); - for (const pathName of paths) { - const childObject = parentObject[pathName]; - if ((childObject === void 0 || childObject === null) && (object2[key] !== void 0 && object2[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } - } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = { - ...parentObject[interfaces_js_1.XML_ATTRKEY], - [xmlnsKey]: mapper.xmlNamespace - }; - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object2[key]; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator && polymorphicDiscriminator.clientName === key && (toSerialize === void 0 || toSerialize === null)) { - toSerialize = mapper.serializedName; - } - const serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options); - if (serializedValue !== void 0 && propName !== void 0 && propName !== null) { - const value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); - if (isXml && propertyMapper.xmlIsAttribute) { - parentObject[interfaces_js_1.XML_ATTRKEY] = parentObject[interfaces_js_1.XML_ATTRKEY] || {}; - parentObject[interfaces_js_1.XML_ATTRKEY][propName] = serializedValue; - } else if (isXml && propertyMapper.xmlIsWrapped) { - parentObject[propName] = { [propertyMapper.xmlElementName]: value }; - } else { - parentObject[propName] = value; - } - } - } - } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object2) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object2[clientPropName], objectName + '["' + clientPropName + '"]', options); - } - } - } - return payload; - } - return object2; - } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; - } - const xmlnsKey = propertyMapper.xmlNamespacePrefix ? `xmlns:${propertyMapper.xmlNamespacePrefix}` : "xmlns"; - const xmlNamespace = { [xmlnsKey]: propertyMapper.xmlNamespace }; - if (["Composite"].includes(propertyMapper.type.name)) { - if (serializedValue[interfaces_js_1.XML_ATTRKEY]) { - return serializedValue; - } else { - const result2 = { ...serializedValue }; - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } - } - const result = {}; - result[options.xml.xmlCharKey] = serializedValue; - result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result; - } - function isSpecialXmlProperty(propertyName, options) { - return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); - } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - const xmlCharKey = options.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); - } - const modelProps = resolveModelProperties(serializer, mapper, objectName); - let instance = {}; - const handledPropertyNames = []; - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - const paths = splitSerializeName(modelProps[key].serializedName); - handledPropertyNames.push(paths[0]); - const { serializedName, xmlName, xmlElementName } = propertyMapper; - let propertyObjectName = objectName; - if (serializedName !== "" && serializedName !== void 0) { - propertyObjectName = objectName + "." + serializedName; - } - const headerCollectionPrefix = propertyMapper.headerCollectionPrefix; - if (headerCollectionPrefix) { - const dictionary = {}; - for (const headerKey of Object.keys(responseBody)) { - if (headerKey.startsWith(headerCollectionPrefix)) { - dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); - } - handledPropertyNames.push(headerKey); - } - instance[key] = dictionary; - } else if (serializer.isXML) { - if (propertyMapper.xmlIsAttribute && responseBody[interfaces_js_1.XML_ATTRKEY]) { - instance[key] = serializer.deserialize(propertyMapper, responseBody[interfaces_js_1.XML_ATTRKEY][xmlName], propertyObjectName, options); - } else if (propertyMapper.xmlIsMsText) { - if (responseBody[xmlCharKey] !== void 0) { - instance[key] = responseBody[xmlCharKey]; - } else if (typeof responseBody === "string") { - instance[key] = responseBody; - } - } else { - const propertyName = xmlElementName || xmlName || serializedName; - if (propertyMapper.xmlIsWrapped) { - const wrapped = responseBody[xmlName]; - const elementList = wrapped?.[xmlElementName] ?? []; - instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); - handledPropertyNames.push(xmlName); - } else { - const property = responseBody[propertyName]; - instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options); - handledPropertyNames.push(propertyName); - } - } - } else { - let propertyInstance; - let res = responseBody; - let steps = 0; - for (const item of paths) { - if (!res) - break; - steps++; - res = res[item]; - } - if (res === null && steps < paths.length) { - res = void 0; - } - propertyInstance = res; - const polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; - if (polymorphicDiscriminator && key === polymorphicDiscriminator.clientName && (propertyInstance === void 0 || propertyInstance === null)) { - propertyInstance = mapper.serializedName; - } - let serializedValue; - if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { - propertyInstance = responseBody[key]; - const arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - for (const [k, v] of Object.entries(instance)) { - if (!Object.prototype.hasOwnProperty.call(arrayInstance, k)) { - arrayInstance[k] = v; - } - } - instance = arrayInstance; - } else if (propertyInstance !== void 0 || propertyMapper.defaultValue !== void 0) { - serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - instance[key] = serializedValue; - } - } - } - const additionalPropertiesMapper = mapper.type.additionalProperties; - if (additionalPropertiesMapper) { - const isAdditionalProperty = (responsePropName) => { - for (const clientPropName in modelProps) { - const paths = splitSerializeName(modelProps[clientPropName].serializedName); - if (paths[0] === responsePropName) { - return false; - } - } - return true; - }; - for (const responsePropName in responseBody) { - if (isAdditionalProperty(responsePropName)) { - instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); - } - } - } else if (responseBody && !options.ignoreUnknownProperties) { - for (const key of Object.keys(responseBody)) { - if (instance[key] === void 0 && !handledPropertyNames.includes(key) && !isSpecialXmlProperty(key, options)) { - instance[key] = responseBody[key]; - } - } - } - return instance; - } - function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) { - const value = mapper.type.value; - if (!value || typeof value !== "object") { - throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${objectName}`); - } - if (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; - } - return responseBody; - } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - let element = mapper.type.element; - if (!element || typeof element !== "object") { - throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${objectName}`); - } - if (responseBody) { - if (!Array.isArray(responseBody)) { - responseBody = [responseBody]; - } - if (element.type.name === "Composite" && element.type.className) { - element = serializer.modelMappers[element.type.className] ?? element; - } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); - } - return tempArray; - } - return responseBody; - } - function getIndexDiscriminator(discriminators, discriminatorValue, typeName) { - const typeNamesToCheck = [typeName]; - while (typeNamesToCheck.length) { - const currentName = typeNamesToCheck.shift(); - const indexDiscriminator = discriminatorValue === currentName ? discriminatorValue : currentName + "." + discriminatorValue; - if (Object.prototype.hasOwnProperty.call(discriminators, indexDiscriminator)) { - return discriminators[indexDiscriminator]; - } else { - for (const [name, mapper] of Object.entries(discriminators)) { - if (name.startsWith(currentName + ".") && mapper.type.uberParent === currentName && mapper.type.className) { - typeNamesToCheck.push(mapper.type.className); - } - } - } - } - return void 0; - } - function getPolymorphicMapper(serializer, mapper, object2, polymorphicPropertyName) { - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); - } - const discriminatorValue = object2[discriminatorName]; - const typeName = mapper.type.uberParent ?? mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } - } - } - } - return mapper; - } - function getPolymorphicDiscriminatorRecursively(serializer, mapper) { - return mapper.type.polymorphicDiscriminator || getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) || getPolymorphicDiscriminatorSafely(serializer, mapper.type.className); - } - function getPolymorphicDiscriminatorSafely(serializer, typeName) { - return typeName && serializer.modelMappers[typeName] && serializer.modelMappers[typeName].type.polymorphicDiscriminator; - } - exports2.MapperTypeNames = { - Base64Url: "Base64Url", - Boolean: "Boolean", - ByteArray: "ByteArray", - Composite: "Composite", - Date: "Date", - DateTime: "DateTime", - DateTimeRfc1123: "DateTimeRfc1123", - Dictionary: "Dictionary", - Enum: "Enum", - Number: "Number", - Object: "Object", - Sequence: "Sequence", - String: "String", - Stream: "Stream", - TimeSpan: "TimeSpan", - UnixTime: "UnixTime" - }; - } -}); - -// node_modules/@azure/core-client/dist/commonjs/state.js -var require_state2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/state.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; - } -}); - -// node_modules/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - exports2.getOperationRequestInfo = getOperationRequestInfo; - var state_js_1 = require_state2(); - function getOperationArgumentValueFromParameter(operationArguments, parameter, fallbackObject) { - let parameterPath = parameter.parameterPath; - const parameterMapper = parameter.mapper; - let value; - if (typeof parameterPath === "string") { - parameterPath = [parameterPath]; - } - if (Array.isArray(parameterPath)) { - if (parameterPath.length > 0) { - if (parameterMapper.isConstant) { - value = parameterMapper.defaultValue; - } else { - let propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath); - if (!propertySearchResult.propertyFound && fallbackObject) { - propertySearchResult = getPropertyFromParameterPath(fallbackObject, parameterPath); - } - let useDefaultValue = false; - if (!propertySearchResult.propertyFound) { - useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; - } - value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue; - } - } - } else { - if (parameterMapper.required) { - value = {}; - } - for (const propertyName in parameterPath) { - const propertyMapper = parameterMapper.type.modelProperties[propertyName]; - const propertyPath = parameterPath[propertyName]; - const propertyValue = getOperationArgumentValueFromParameter(operationArguments, { - parameterPath: propertyPath, - mapper: propertyMapper - }, fallbackObject); - if (propertyValue !== void 0) { - if (!value) { - value = {}; - } - value[propertyName] = propertyValue; - } - } - } - return value; - } - function getPropertyFromParameterPath(parent, parameterPath) { - const result = { propertyFound: false }; - let i = 0; - for (; i < parameterPath.length; ++i) { - const parameterPathPart = parameterPath[i]; - if (parent && parameterPathPart in parent) { - parent = parent[parameterPathPart]; - } else { - break; - } - } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; - } - var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request3) { - return originalRequestSymbol in request3; - } - function getOperationRequestInfo(request3) { - if (hasOriginalRequest(request3)) { - return getOperationRequestInfo(request3[originalRequestSymbol]); - } - let info8 = state_js_1.state.operationRequestMap.get(request3); - if (!info8) { - info8 = {}; - state_js_1.state.operationRequestMap.set(request3, info8); - } - return info8; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.deserializationPolicyName = void 0; - exports2.deserializationPolicy = deserializationPolicy; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs6(); - var serializer_js_1 = require_serializer(); - var operationHelpers_js_1 = require_operationHelpers(); - var defaultJsonContentTypes = ["application/json", "text/json"]; - var defaultXmlContentTypes = ["application/xml", "application/atom+xml"]; - exports2.deserializationPolicyName = "deserializationPolicy"; - function deserializationPolicy(options = {}) { - const jsonContentTypes = options.expectedContentTypes?.json ?? defaultJsonContentTypes; - const xmlContentTypes = options.expectedContentTypes?.xml ?? defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: serializerOptions?.xml.rootName ?? "", - includeRoot: serializerOptions?.xml.includeRoot ?? false, - xmlCharKey: serializerOptions?.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY - } - }; - return { - name: exports2.deserializationPolicyName, - async sendRequest(request3, next) { - const response = await next(request3); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); - } - }; - } - function getOperationResponseMap(parsedResponse) { - let result; - const request3 = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request3); - const operationSpec = operationInfo?.operationSpec; - if (operationSpec) { - if (!operationInfo?.operationResponseGetter) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); - } - } - return result; - } - function shouldDeserializeResponse(parsedResponse) { - const request3 = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request3); - const shouldDeserialize = operationInfo?.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); - } - return result; - } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse3(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; - } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo?.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; - } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error3) { - throw error3; - } else if (shouldReturnResponse) { - return parsedResponse; - } - if (responseSpec) { - if (responseSpec.bodyMapper) { - let valueToDeserialize = parsedResponse.parsedBody; - if (operationSpec.isXML && responseSpec.bodyMapper.type.name === serializer_js_1.MapperTypeNames.Sequence) { - valueToDeserialize = typeof valueToDeserialize === "object" ? valueToDeserialize[responseSpec.bodyMapper.xmlElementName] : []; - } - try { - parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options); - } catch (deserializeError) { - const restError = new core_rest_pipeline_1.RestError(`Error ${deserializeError} occurred in deserializing the responseBody - ${parsedResponse.bodyAsText}`, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - throw restError; - } - } else if (operationSpec.httpMethod === "HEAD") { - parsedResponse.parsedBody = response.status >= 200 && response.status < 300; - } - if (responseSpec.headersMapper) { - parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); - } - } - return parsedResponse; - } - function isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; - } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - const isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300; - const isExpectedStatusCode = isOperationSpecEmpty(operationSpec) ? isSuccessByStatus : !!responseSpec; - if (isExpectedStatusCode) { - if (responseSpec) { - if (!responseSpec.isError) { - return { error: null, shouldReturnResponse: false }; - } - } else { - return { error: null, shouldReturnResponse: false }; - } - } - const errorResponseSpec = responseSpec ?? operationSpec.responses.default; - const initialErrorMessage = parsedResponse.request.streamResponseStatusCodes?.has(parsedResponse.status) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error3 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec && !(parsedResponse.parsedBody?.error?.code && parsedResponse.parsedBody?.error?.message)) { - throw error3; - } - const defaultBodyMapper = errorResponseSpec?.bodyMapper; - const defaultHeadersMapper = errorResponseSpec?.headersMapper; - try { - if (parsedResponse.parsedBody) { - const parsedBody = parsedResponse.parsedBody; - let deserializedError; - if (defaultBodyMapper) { - let valueToDeserialize = parsedBody; - if (operationSpec.isXML && defaultBodyMapper.type.name === serializer_js_1.MapperTypeNames.Sequence) { - valueToDeserialize = []; - const elementName = defaultBodyMapper.xmlElementName; - if (typeof parsedBody === "object" && elementName) { - valueToDeserialize = parsedBody[elementName]; - } - } - deserializedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody", options); - } - const internalError = parsedBody.error || deserializedError || parsedBody; - error3.code = internalError.code; - if (internalError.message) { - error3.message = internalError.message; - } - if (defaultBodyMapper) { - error3.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error3.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error3.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; - } - return { error: error3, shouldReturnResponse: false }; - } - async function parse3(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - if (!operationResponse.request.streamResponseStatusCodes?.has(operationResponse.status) && operationResponse.bodyAsText) { - const text = operationResponse.bodyAsText; - const contentType = operationResponse.headers.get("Content-Type") || ""; - const contentComponents = !contentType ? [] : contentType.split(";").map((component) => component.toLowerCase()); - try { - if (contentComponents.length === 0 || contentComponents.some((component) => jsonContentTypes.indexOf(component) !== -1)) { - operationResponse.parsedBody = JSON.parse(text); - return operationResponse; - } else if (contentComponents.some((component) => xmlContentTypes.indexOf(component) !== -1)) { - if (!parseXML) { - throw new Error("Parsing XML not supported."); - } - const body = await parseXML(text, opts.xml); - operationResponse.parsedBody = body; - return operationResponse; - } - } catch (err) { - const msg = `Error "${err}" occurred while parsing the response body - ${operationResponse.bodyAsText}.`; - const errCode = err.code || core_rest_pipeline_1.RestError.PARSE_ERROR; - const e = new core_rest_pipeline_1.RestError(msg, { - code: errCode, - statusCode: operationResponse.status, - request: operationResponse.request, - response: operationResponse - }); - throw e; - } - } - return operationResponse; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js -var require_interfaceHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - exports2.getPathStringFromParameter = getPathStringFromParameter; - var serializer_js_1 = require_serializer(); - function getStreamingResponseStatusCodes(operationSpec) { - const result = /* @__PURE__ */ new Set(); - for (const statusCode in operationSpec.responses) { - const operationResponse = operationSpec.responses[statusCode]; - if (operationResponse.bodyMapper && operationResponse.bodyMapper.type.name === serializer_js_1.MapperTypeNames.Stream) { - result.add(Number(statusCode)); - } - } - return result; - } - function getPathStringFromParameter(parameter) { - const { parameterPath, mapper } = parameter; - let result; - if (typeof parameterPath === "string") { - result = parameterPath; - } else if (Array.isArray(parameterPath)) { - result = parameterPath.join("."); - } else { - result = mapper.serializedName; - } - return result; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.serializationPolicyName = void 0; - exports2.serializationPolicy = serializationPolicy; - exports2.serializeHeaders = serializeHeaders; - exports2.serializeRequestBody = serializeRequestBody; - var interfaces_js_1 = require_interfaces(); - var operationHelpers_js_1 = require_operationHelpers(); - var serializer_js_1 = require_serializer(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - exports2.serializationPolicyName = "serializationPolicy"; - function serializationPolicy(options = {}) { - const stringifyXML = options.stringifyXML; - return { - name: exports2.serializationPolicyName, - async sendRequest(request3, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request3); - const operationSpec = operationInfo?.operationSpec; - const operationArguments = operationInfo?.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request3, operationArguments, operationSpec); - serializeRequestBody(request3, operationArguments, operationSpec, stringifyXML); - } - return next(request3); - } - }; - } - function serializeHeaders(request3, operationArguments, operationSpec) { - if (operationSpec.headerParameters) { - for (const headerParameter of operationSpec.headerParameters) { - let headerValue = (0, operationHelpers_js_1.getOperationArgumentValueFromParameter)(operationArguments, headerParameter); - if (headerValue !== null && headerValue !== void 0 || headerParameter.mapper.required) { - headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter)); - const headerCollectionPrefix = headerParameter.mapper.headerCollectionPrefix; - if (headerCollectionPrefix) { - for (const key of Object.keys(headerValue)) { - request3.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request3.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } - } - } - const customHeaders = operationArguments.options?.requestOptions?.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request3.headers.set(customHeaderName, customHeaders[customHeaderName]); - } - } - } - function serializeRequestBody(request3, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - const serializerOptions = operationArguments.options?.serializerOptions; - const updatedOptions = { - xml: { - rootName: serializerOptions?.xml.rootName ?? "", - includeRoot: serializerOptions?.xml.includeRoot ?? false, - xmlCharKey: serializerOptions?.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request3.body = (0, operationHelpers_js_1.getOperationArgumentValueFromParameter)(operationArguments, operationSpec.requestBody); - const bodyMapper = operationSpec.requestBody.mapper; - const { required, serializedName, xmlName, xmlElementName, xmlNamespace, xmlNamespacePrefix, nullable } = bodyMapper; - const typeName = bodyMapper.type.name; - try { - if (request3.body !== void 0 && request3.body !== null || nullable && request3.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request3.body = operationSpec.serializer.serialize(bodyMapper, request3.body, requestBodyParameterPathString, updatedOptions); - const isStream2 = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request3.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request3.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream2) { - request3.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (operationSpec.contentType?.match("text/plain") || operationSpec.mediaType === "text")) { - return; - } else if (!isStream2) { - request3.body = JSON.stringify(request3.body); - } - } - } catch (error3) { - throw new Error(`Error "${error3.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request3.formData = {}; - for (const formDataParameter of operationSpec.formDataParameters) { - const formDataParameterValue = (0, operationHelpers_js_1.getOperationArgumentValueFromParameter)(operationArguments, formDataParameter); - if (formDataParameterValue !== void 0 && formDataParameterValue !== null) { - const formDataParameterPropertyName = formDataParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter); - request3.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } - } - } - } - function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) { - if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { - const result = {}; - result[options.xml.xmlCharKey] = serializedValue; - result[interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: xmlNamespace }; - return result; - } - return serializedValue; - } - function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; - } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; - } - const result = { [elementName]: obj }; - result[interfaces_js_1.XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace }; - return result; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/pipeline.js -var require_pipeline3 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = createClientPipeline; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs6(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline2 = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); - if (options.credentialOptions) { - pipeline2.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); - } - pipeline2.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline2.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline2; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/httpClientCache.js -var require_httpClientCache = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/httpClientCache.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; - var core_rest_pipeline_1 = require_commonjs6(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); - } - return cachedHttpClient; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js -var require_urlHelpers2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRequestUrl = getRequestUrl; - exports2.appendQueryParams = appendQueryParams; - var operationHelpers_js_1 = require_operationHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var CollectionFormatToDelimiterMap = { - CSV: ",", - SSV: " ", - Multi: "Multi", - TSV: " ", - Pipes: "|" - }; - function getRequestUrl(baseUri, operationSpec, operationArguments, fallbackObject) { - const urlReplacements = calculateUrlReplacements(operationSpec, operationArguments, fallbackObject); - let isAbsolutePath = false; - let requestUrl = replaceAll(baseUri, urlReplacements); - if (operationSpec.path) { - let path30 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path30.startsWith("/")) { - path30 = path30.substring(1); - } - if (isAbsoluteUrl(path30)) { - requestUrl = path30; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path30); - } - } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); - } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - const result = /* @__PURE__ */ new Map(); - if (operationSpec.urlParameters?.length) { - for (const urlParameter of operationSpec.urlParameters) { - let urlParameterValue = (0, operationHelpers_js_1.getOperationArgumentValueFromParameter)(operationArguments, urlParameter, fallbackObject); - const parameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(urlParameter); - urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, parameterPathString); - if (!urlParameter.skipEncoding) { - urlParameterValue = encodeURIComponent(urlParameterValue); - } - result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); - } - } - return result; - } - function isAbsoluteUrl(url2) { - return url2.includes("://"); - } - function appendPath(url2, pathToAppend) { - if (!pathToAppend) { - return url2; - } - const parsedUrl = new URL(url2); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path30 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path30; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; - } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if (operationSpec.queryParameters?.length) { - for (const queryParameter of operationSpec.queryParameters) { - if (queryParameter.mapper.type.name === "Sequence" && queryParameter.mapper.serializedName) { - sequenceParams.add(queryParameter.mapper.serializedName); - } - let queryParameterValue = (0, operationHelpers_js_1.getOperationArgumentValueFromParameter)(operationArguments, queryParameter, fallbackObject); - if (queryParameterValue !== void 0 && queryParameterValue !== null || queryParameter.mapper.required) { - queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter)); - const delimiter = queryParameter.collectionFormat ? CollectionFormatToDelimiterMap[queryParameter.collectionFormat] : ""; - if (Array.isArray(queryParameterValue)) { - queryParameterValue = queryParameterValue.map((item) => { - if (item === null || item === void 0) { - return ""; - } - return item; - }); - } - if (queryParameter.collectionFormat === "Multi" && queryParameterValue.length === 0) { - continue; - } else if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "SSV" || queryParameter.collectionFormat === "TSV")) { - queryParameterValue = queryParameterValue.join(delimiter); - } - if (!queryParameter.skipEncoding) { - if (Array.isArray(queryParameterValue)) { - queryParameterValue = queryParameterValue.map((item) => { - return encodeURIComponent(item); - }); - } else { - queryParameterValue = encodeURIComponent(queryParameterValue); - } - } - if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "CSV" || queryParameter.collectionFormat === "Pipes")) { - queryParameterValue = queryParameterValue.join(delimiter); - } - result.set(queryParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter), queryParameterValue); - } - } - } - return { - queryParams: result, - sequenceParams - }; - } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; - } - queryString = queryString.slice(1); - const pairs = queryString.split("&"); - for (const pair of pairs) { - const [name, value] = pair.split("=", 2); - const existingValue = result.get(name); - if (existingValue) { - if (Array.isArray(existingValue)) { - existingValue.push(value); - } else { - result.set(name, [existingValue, value]); - } - } else { - result.set(name, value); - } - } - return result; - } - function appendQueryParams(url2, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url2; - } - const parsedUrl = new URL(url2); - const combinedParams = simpleParseQueryParams(parsedUrl.search); - for (const [name, value] of queryParams) { - const existingValue = combinedParams.get(name); - if (Array.isArray(existingValue)) { - if (Array.isArray(value)) { - existingValue.push(...value); - const valueSet = new Set(existingValue); - combinedParams.set(name, Array.from(valueSet)); - } else { - existingValue.push(value); - } - } else if (existingValue) { - if (Array.isArray(value)) { - value.unshift(existingValue); - } else if (sequenceParams.has(name)) { - combinedParams.set(name, [existingValue, value]); - } - if (!noOverwrite) { - combinedParams.set(name, value); - } - } else { - combinedParams.set(name, value); - } - } - const searchPieces = []; - for (const [name, value] of combinedParams) { - if (typeof value === "string") { - searchPieces.push(`${name}=${value}`); - } else if (Array.isArray(value)) { - for (const subValue of value) { - searchPieces.push(`${name}=${subValue}`); - } - } else { - searchPieces.push(`${name}=${value}`); - } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log4 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_1 = require_commonjs2(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); - } -}); - -// node_modules/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs6(); - var pipeline_js_1 = require_pipeline3(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers2(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log4(); - var ServiceClient = class { - /** - * If specified, this is the base URI that requests will be made against for this ServiceClient. - * If it is not specified, then all OperationSpecs must contain a baseUrl property. - */ - _endpoint; - /** - * The default request content type for the service. - * Used if no requestContentType is present on an OperationSpec. - */ - _requestContentType; - /** - * Set to true if the request is sent over HTTP instead of HTTPS - */ - _allowInsecureConnection; - /** - * The HTTP client that will be used to send requests. - */ - _httpClient; - /** - * The pipeline used by this client to make requests - */ - pipeline; - /** - * The ServiceClient constructor - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - this._requestContentType = options.requestContentType; - this._endpoint = options.endpoint ?? options.baseUri; - if (options.baseUri) { - log_js_1.logger.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."); - } - this._allowInsecureConnection = options.allowInsecureConnection; - this._httpClient = options.httpClient || (0, httpClientCache_js_1.getCachedDefaultHttpClient)(); - this.pipeline = options.pipeline || createDefaultPipeline(options); - if (options.additionalPolicies?.length) { - for (const { policy, position } of options.additionalPolicies) { - const afterPhase = position === "perRetry" ? "Sign" : void 0; - this.pipeline.addPolicy(policy, { - afterPhase - }); - } - } - } - /** - * Send the provided httpRequest. - */ - async sendRequest(request3) { - return this.pipeline.sendRequest(this._httpClient, request3); - } - /** - * Send an HTTP request that is populated using the provided OperationSpec. - * @typeParam T - The typed result of the request, based on the OperationSpec. - * @param operationArguments - The arguments that the HTTP request's templated values will be populated from. - * @param operationSpec - The OperationSpec to use to populate the httpRequest. - */ - async sendOperationRequest(operationArguments, operationSpec) { - const endpoint2 = operationSpec.baseUrl || this._endpoint; - if (!endpoint2) { - throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use."); - } - const url2 = (0, urlHelpers_js_1.getRequestUrl)(endpoint2, operationSpec, operationArguments, this); - const request3 = (0, core_rest_pipeline_1.createPipelineRequest)({ - url: url2 - }); - request3.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request3); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request3.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request3.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request3.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request3.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request3.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request3.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request3.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request3.allowInsecureConnection = true; - } - if (request3.streamResponseStatusCodes === void 0) { - request3.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request3); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options?.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error3) { - if (typeof error3 === "object" && error3?.response) { - const rawResponse = error3.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error3.statusCode] || operationSpec.responses["default"]); - error3.details = flatResponse; - if (options?.onResponse) { - options.onResponse(rawResponse, flatResponse, error3); - } - } - throw error3; - } - } - }; - exports2.ServiceClient = ServiceClient; - function createDefaultPipeline(options) { - const credentialScopes = getCredentialScopes(options); - const credentialOptions = options.credential && credentialScopes ? { credentialScopes, credential: options.credential } : void 0; - return (0, pipeline_js_1.createClientPipeline)({ - ...options, - credentialOptions - }); - } - function getCredentialScopes(options) { - if (options.credentialScopes) { - return options.credentialScopes; - } - if (options.endpoint) { - return `${options.endpoint}/.default`; - } - if (options.baseUri) { - return `${options.baseUri}/.default`; - } - if (options.credential && !options.credentialScopes) { - throw new Error(`When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy`); - } - return void 0; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.parseCAEChallenge = parseCAEChallenge; - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; - var log_js_1 = require_log4(); - var base64_js_1 = require_base64(); - function parseCAEChallenge(challenges) { - const bearerChallenges = `, ${challenges.trim()}`.split(", Bearer ").filter((x) => x); - return bearerChallenges.map((challenge) => { - const challengeParts = `${challenge.trim()}, `.split('", ').filter((x) => x); - const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split('="'))); - return keyValuePairs.reduce((a, b) => ({ ...a, ...b }), {}); - }); - } - async function authorizeRequestOnClaimChallenge(onChallengeOptions) { - const { scopes, response } = onChallengeOptions; - const logger = onChallengeOptions.logger || log_js_1.logger; - const challenge = response.headers.get("WWW-Authenticate"); - if (!challenge) { - logger.info(`The WWW-Authenticate header was missing. Failed to perform the Continuous Access Evaluation authentication flow.`); - return false; - } - const challenges = parseCAEChallenge(challenge) || []; - const parsedChallenge = challenges.find((x) => x.claims); - if (!parsedChallenge) { - logger.info(`The WWW-Authenticate header was missing the necessary "claims" to perform the Continuous Access Evaluation authentication flow.`); - return false; - } - const accessToken = await onChallengeOptions.getAccessToken(parsedChallenge.scope ? [parsedChallenge.scope] : scopes, { - claims: (0, base64_js_1.decodeStringToString)(parsedChallenge.claims) - }); - if (!accessToken) { - return false; - } - onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); - return true; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.authorizeRequestOnTenantChallenge = void 0; - var Constants = { - DefaultScope: "/.default", - /** - * Defines constants for use with HTTP headers. - */ - HeaderConstants: { - /** - * The Authorization header. - */ - AUTHORIZATION: "authorization" - } - }; - function isUuid(text) { - return /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(text); - } - var authorizeRequestOnTenantChallenge = async (challengeOptions) => { - const requestOptions = requestToOptions(challengeOptions.request); - const challenge = getChallenge(challengeOptions.response); - if (challenge) { - const challengeInfo = parseChallenge(challenge); - const challengeScopes = buildScopes(challengeOptions, challengeInfo); - const tenantId = extractTenantId(challengeInfo); - if (!tenantId) { - return false; - } - const accessToken = await challengeOptions.getAccessToken(challengeScopes, { - ...requestOptions, - tenantId - }); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); - return true; - } - return false; - }; - exports2.authorizeRequestOnTenantChallenge = authorizeRequestOnTenantChallenge; - function extractTenantId(challengeInfo) { - const parsedAuthUri = new URL(challengeInfo.authorization_uri); - const pathSegments = parsedAuthUri.pathname.split("/"); - const tenantId = pathSegments[1]; - if (tenantId && isUuid(tenantId)) { - return tenantId; - } - return void 0; - } - function buildScopes(challengeOptions, challengeInfo) { - if (!challengeInfo.resource_id) { - return challengeOptions.scopes; - } - const challengeScopes = new URL(challengeInfo.resource_id); - challengeScopes.pathname = Constants.DefaultScope; - let scope = challengeScopes.toString(); - if (scope === "https://disk.azure.com/.default") { - scope = "https://disk.azure.com//.default"; - } - return [scope]; - } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; - } - function parseChallenge(challenge) { - const bearerChallenge = challenge.slice("Bearer ".length); - const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x) => x); - const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split("="))); - return keyValuePairs.reduce((a, b) => ({ ...a, ...b }), {}); - } - function requestToOptions(request3) { - return { - abortSignal: request3.abortSignal, - requestOptions: { - timeout: request3.timeout - }, - tracingOptions: request3.tracingOptions - }; - } - } -}); - -// node_modules/@azure/core-client/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.authorizeRequestOnTenantChallenge = exports2.authorizeRequestOnClaimChallenge = exports2.serializationPolicyName = exports2.serializationPolicy = exports2.deserializationPolicyName = exports2.deserializationPolicy = exports2.XML_CHARKEY = exports2.XML_ATTRKEY = exports2.createClientPipeline = exports2.ServiceClient = exports2.MapperTypeNames = exports2.createSerializer = void 0; - var serializer_js_1 = require_serializer(); - Object.defineProperty(exports2, "createSerializer", { enumerable: true, get: function() { - return serializer_js_1.createSerializer; - } }); - Object.defineProperty(exports2, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; - } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; - } }); - var pipeline_js_1 = require_pipeline3(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; - } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; - } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; - } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; - } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; - } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; - } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; - } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; - } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; - } }); - } -}); - -// node_modules/@azure/core-http-compat/dist/commonjs/util.js -var require_util9 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpHeaders = void 0; - exports2.toPipelineRequest = toPipelineRequest; - exports2.toWebResourceLike = toWebResourceLike; - exports2.toHttpHeadersLike = toHttpHeadersLike; - var core_rest_pipeline_1 = require_commonjs6(); - var originalRequestSymbol = /* @__PURE__ */ Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request3 = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request3) { - request3.headers = headers; - return request3; - } else { - const newRequest = (0, core_rest_pipeline_1.createPipelineRequest)({ - url: webResource.url, - method: webResource.method, - headers, - withCredentials: webResource.withCredentials, - timeout: webResource.timeout, - requestId: webResource.requestId, - abortSignal: webResource.abortSignal, - body: webResource.body, - formData: webResource.formData, - disableKeepAlive: !!webResource.keepAlive, - onDownloadProgress: webResource.onDownloadProgress, - onUploadProgress: webResource.onUploadProgress, - proxySettings: webResource.proxySettings, - streamResponseStatusCodes: webResource.streamResponseStatusCodes, - agent: webResource.agent, - requestOverrides: webResource.requestOverrides - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } - } - function toWebResourceLike(request3, options) { - const originalRequest = options?.originalRequest ?? request3; - const webResource = { - url: request3.url, - method: request3.method, - headers: toHttpHeadersLike(request3.headers), - withCredentials: request3.withCredentials, - timeout: request3.timeout, - requestId: request3.headers.get("x-ms-client-request-id") || request3.requestId, - abortSignal: request3.abortSignal, - body: request3.body, - formData: request3.formData, - keepAlive: !!request3.disableKeepAlive, - onDownloadProgress: request3.onDownloadProgress, - onUploadProgress: request3.onUploadProgress, - proxySettings: request3.proxySettings, - streamResponseStatusCodes: request3.streamResponseStatusCodes, - agent: request3.agent, - requestOverrides: request3.requestOverrides, - clone() { - throw new Error("Cannot clone a non-proxied WebResourceLike"); - }, - prepare() { - throw new Error("WebResourceLike.prepare() is not supported by @azure/core-http-compat"); - }, - validateRequestProperties() { - } - }; - if (options?.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request3; - } else if (prop === "clone") { - return () => { - return toWebResourceLike(toPipelineRequest(webResource, { originalRequest }), { - createProxy: true, - originalRequest - }); - }; - } - return Reflect.get(target, prop, receiver); - }, - set(target, prop, value, receiver) { - if (prop === "keepAlive") { - request3.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes", - "agent", - "requestOverrides" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request3[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - function getHeaderKey(headerName) { - return headerName.toLowerCase(); - } - var HttpHeaders = class _HttpHeaders { - _headersMap; - constructor(rawHeaders) { - this._headersMap = {}; - if (rawHeaders) { - for (const headerName in rawHeaders) { - this.set(headerName, rawHeaders[headerName]); - } - } - } - /** - * Set a header in this collection with the provided name and value. The name is - * case-insensitive. - * @param headerName - The name of the header to set. This value is case-insensitive. - * @param headerValue - The value of the header to set. - */ - set(headerName, headerValue) { - this._headersMap[getHeaderKey(headerName)] = { - name: headerName, - value: headerValue.toString() - }; - } - /** - * Get the header value for the provided header name, or undefined if no header exists in this - * collection with the provided name. - * @param headerName - The name of the header. - */ - get(headerName) { - const header = this._headersMap[getHeaderKey(headerName)]; - return !header ? void 0 : header.value; - } - /** - * Get whether or not this header collection contains a header entry for the provided header name. - */ - contains(headerName) { - return !!this._headersMap[getHeaderKey(headerName)]; - } - /** - * Remove the header with the provided headerName. Return whether or not the header existed and - * was removed. - * @param headerName - The name of the header to remove. - */ - remove(headerName) { - const result = this.contains(headerName); - delete this._headersMap[getHeaderKey(headerName)]; - return result; - } - /** - * Get the headers that are contained this collection as an object. - */ - rawHeaders() { - return this.toJson({ preserveCase: true }); - } - /** - * Get the headers that are contained in this collection as an array. - */ - headersArray() { - const headers = []; - for (const headerKey in this._headersMap) { - headers.push(this._headersMap[headerKey]); - } - return headers; - } - /** - * Get the header names that are contained in this collection. - */ - headerNames() { - const headerNames = []; - const headers = this.headersArray(); - for (let i = 0; i < headers.length; ++i) { - headerNames.push(headers[i].name); - } - return headerNames; - } - /** - * Get the header values that are contained in this collection. - */ - headerValues() { - const headerValues = []; - const headers = this.headersArray(); - for (let i = 0; i < headers.length; ++i) { - headerValues.push(headers[i].value); - } - return headerValues; - } - /** - * Get the JSON object representation of this HTTP header collection. - */ - toJson(options = {}) { - const result = {}; - if (options.preserveCase) { - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - result[header.name] = header.value; - } - } else { - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - result[getHeaderKey(header.name)] = header.value; - } - } - return result; - } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJson({ preserveCase: true })); - } - /** - * Create a deep clone/copy of this HttpHeaders collection. - */ - clone() { - const resultPreservingCasing = {}; - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - resultPreservingCasing[header.name] = header.value; - } - return new _HttpHeaders(resultPreservingCasing); - } - }; - exports2.HttpHeaders = HttpHeaders; - } -}); - -// node_modules/@azure/core-http-compat/dist/commonjs/response.js -var require_response2 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCompatResponse = toCompatResponse; - exports2.toPipelineResponse = toPipelineResponse; - var core_rest_pipeline_1 = require_commonjs6(); - var util_js_1 = require_util9(); - var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request3 = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options?.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request3; - } else if (prop === originalResponse) { - return response; - } - return Reflect.get(target, prop, receiver); - }, - set(target, prop, value, receiver) { - if (prop === "headers") { - headers = value; - } else if (prop === "request") { - request3 = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return { - ...response, - request: request3, - headers - }; - } - } - function toPipelineResponse(compatResponse) { - const extendedCompatResponse = compatResponse; - const response = extendedCompatResponse[originalResponse]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(compatResponse.headers.toJson({ preserveCase: true })); - if (response) { - response.headers = headers; - return response; - } else { - return { - ...compatResponse, - headers, - request: (0, util_js_1.toPipelineRequest)(compatResponse.request) - }; - } - } - } -}); - -// node_modules/@azure/core-http-compat/dist/commonjs/extendedClient.js -var require_extendedClient = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/extendedClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs6(); - var core_client_1 = require_commonjs8(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - super(options); - if (options.keepAliveOptions?.enable === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (options.redirectOptions?.handleRedirects === false) { - this.pipeline.removePolicy({ - name: core_rest_pipeline_1.redirectPolicyName - }); - } - } - /** - * Compatible send operation request function. - * - * @param operationArguments - Operation arguments - * @param operationSpec - Operation Spec - * @returns - */ - async sendOperationRequest(operationArguments, operationSpec) { - const userProvidedCallBack = operationArguments?.options?.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error3) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error3); - } - } - operationArguments.options = { - ...operationArguments.options, - onResponse - }; - const result = await super.sendOperationRequest(operationArguments, operationSpec); - if (lastResponse) { - Object.defineProperty(result, "_response", { - value: (0, response_js_1.toCompatResponse)(lastResponse) - }); - } - return result; - } - }; - exports2.ExtendedServiceClient = ExtendedServiceClient; - } -}); - -// node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; - var util_js_1 = require_util9(); - var response_js_1 = require_response2(); - var HttpPipelineLogLevel; - (function(HttpPipelineLogLevel2) { - HttpPipelineLogLevel2[HttpPipelineLogLevel2["ERROR"] = 1] = "ERROR"; - HttpPipelineLogLevel2[HttpPipelineLogLevel2["INFO"] = 3] = "INFO"; - HttpPipelineLogLevel2[HttpPipelineLogLevel2["OFF"] = 0] = "OFF"; - HttpPipelineLogLevel2[HttpPipelineLogLevel2["WARNING"] = 2] = "WARNING"; - })(HttpPipelineLogLevel || (exports2.HttpPipelineLogLevel = HttpPipelineLogLevel = {})); - var mockRequestPolicyOptions = { - log(_logLevel, _message) { - }, - shouldLog(_logLevel) { - return false; - } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); - return { - name: exports2.requestPolicyFactoryPolicyName, - async sendRequest(request3, next) { - let httpPipeline = { - async sendRequest(httpRequest) { - const response2 = await next((0, util_js_1.toPipelineRequest)(httpRequest)); - return (0, response_js_1.toCompatResponse)(response2, { createProxy: true }); - } - }; - for (const factory of orderedFactories) { - httpPipeline = factory.create(httpPipeline, mockRequestPolicyOptions); - } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request3, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); - } - }; - } - } -}); - -// node_modules/@azure/core-http-compat/dist/commonjs/httpClientAdapter.js -var require_httpClientAdapter = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/httpClientAdapter.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.convertHttpClient = convertHttpClient; - var response_js_1 = require_response2(); - var util_js_1 = require_util9(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request3) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request3, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; - } - } -}); - -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toHttpHeadersLike = exports2.convertHttpClient = exports2.disableKeepAlivePolicyName = exports2.HttpPipelineLogLevel = exports2.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.ExtendedServiceClient = void 0; - var extendedClient_js_1 = require_extendedClient(); - Object.defineProperty(exports2, "ExtendedServiceClient", { enumerable: true, get: function() { - return extendedClient_js_1.ExtendedServiceClient; - } }); - var requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; - } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; - } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; - } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; - } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; - } }); - var util_js_1 = require_util9(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; - } }); - } -}); - -// node_modules/fast-xml-parser/lib/fxp.cjs -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/lib/fxp.cjs"(exports2, module2) { - (() => { - "use strict"; - var t = { d: (e2, n2) => { - for (var i2 in n2) t.o(n2, i2) && !t.o(e2, i2) && Object.defineProperty(e2, i2, { enumerable: true, get: n2[i2] }); - }, o: (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), r: (t2) => { - "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true }); - } }, e = {}; - t.r(e), t.d(e, { XMLBuilder: () => Bt, XMLParser: () => Tt, XMLValidator: () => Ut }); - const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); - function s(t2, e2) { - const n2 = []; - let i2 = e2.exec(t2); - for (; i2; ) { - const s2 = []; - s2.startIndex = e2.lastIndex - i2[0].length; - const r2 = i2.length; - for (let t3 = 0; t3 < r2; t3++) s2.push(i2[t3]); - n2.push(s2), i2 = e2.exec(t2); - } - return n2; - } - const r = function(t2) { - return !(null == i.exec(t2)); - }, o = ["hasOwnProperty", "toString", "valueOf", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"], a = ["__proto__", "constructor", "prototype"], h = { allowBooleanAttributes: false, unpairedTags: [] }; - function l(t2, e2) { - e2 = Object.assign({}, h, e2); - const n2 = []; - let i2 = false, s2 = false; - "\uFEFF" === t2[0] && (t2 = t2.substr(1)); - for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { - if (r2 += 2, r2 = p(t2, r2), r2.err) return r2; - } else { - if ("<" !== t2[r2]) { - if (u(t2[r2])) continue; - return b("InvalidChar", "char '" + t2[r2] + "' is not expected.", w(t2, r2)); - } - { - let o2 = r2; - if (r2++, "!" === t2[r2]) { - r2 = c(t2, r2); - continue; - } - { - let a2 = false; - "/" === t2[r2] && (a2 = true, r2++); - let h2 = ""; - for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; - if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !E(h2)) { - let e3; - return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", b("InvalidTag", e3, w(t2, r2)); - } - const l2 = g(t2, r2); - if (false === l2) return b("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", w(t2, r2)); - let d2 = l2.value; - if (r2 = l2.index, "/" === d2[d2.length - 1]) { - const n3 = r2 - d2.length; - d2 = d2.substring(0, d2.length - 1); - const s3 = x(d2, e2); - if (true !== s3) return b(s3.err.code, s3.err.msg, w(t2, n3 + s3.err.line)); - i2 = true; - } else if (a2) { - if (!l2.tagClosed) return b("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", w(t2, r2)); - if (d2.trim().length > 0) return b("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", w(t2, o2)); - if (0 === n2.length) return b("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", w(t2, o2)); - { - const e3 = n2.pop(); - if (h2 !== e3.tagName) { - let n3 = w(t2, e3.tagStartPos); - return b("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", w(t2, o2)); - } - 0 == n2.length && (s2 = true); - } - } else { - const a3 = x(d2, e2); - if (true !== a3) return b(a3.err.code, a3.err.msg, w(t2, r2 - d2.length + a3.err.line)); - if (true === s2) return b("InvalidXml", "Multiple possible root nodes found.", w(t2, r2)); - -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; - } - for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { - if ("!" === t2[r2 + 1]) { - r2++, r2 = c(t2, r2); - continue; - } - if ("?" !== t2[r2 + 1]) break; - if (r2 = p(t2, ++r2), r2.err) return r2; - } else if ("&" === t2[r2]) { - const e3 = N(t2, r2); - if (-1 == e3) return b("InvalidChar", "char '&' is not expected.", w(t2, r2)); - r2 = e3; - } else if (true === s2 && !u(t2[r2])) return b("InvalidXml", "Extra text at the end", w(t2, r2)); - "<" === t2[r2] && r2--; - } - } - } - return i2 ? 1 == n2.length ? b("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", w(t2, n2[0].tagStartPos)) : !(n2.length > 0) || b("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : b("InvalidXml", "Start tag expected.", 1); - } - function u(t2) { - return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; - } - function p(t2, e2) { - const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { - const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return b("InvalidXml", "XML declaration allowed only at the start of the document.", w(t2, e2)); - if ("?" == t2[e2] && ">" == t2[e2 + 1]) { - e2++; - break; - } - continue; - } - return e2; - } - function c(t2, e2) { - if (t2.length > e2 + 5 && "-" === t2[e2 + 1] && "-" === t2[e2 + 2]) { - for (e2 += 3; e2 < t2.length; e2++) if ("-" === t2[e2] && "-" === t2[e2 + 1] && ">" === t2[e2 + 2]) { - e2 += 2; - break; - } - } else if (t2.length > e2 + 8 && "D" === t2[e2 + 1] && "O" === t2[e2 + 2] && "C" === t2[e2 + 3] && "T" === t2[e2 + 4] && "Y" === t2[e2 + 5] && "P" === t2[e2 + 6] && "E" === t2[e2 + 7]) { - let n2 = 1; - for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) n2++; - else if (">" === t2[e2] && (n2--, 0 === n2)) break; - } else if (t2.length > e2 + 9 && "[" === t2[e2 + 1] && "C" === t2[e2 + 2] && "D" === t2[e2 + 3] && "A" === t2[e2 + 4] && "T" === t2[e2 + 5] && "A" === t2[e2 + 6] && "[" === t2[e2 + 7]) { - for (e2 += 8; e2 < t2.length; e2++) if ("]" === t2[e2] && "]" === t2[e2 + 1] && ">" === t2[e2 + 2]) { - e2 += 2; - break; - } - } - return e2; - } - const d = '"', f = "'"; - function g(t2, e2) { - let n2 = "", i2 = "", s2 = false; - for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === f) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); - else if (">" === t2[e2] && "" === i2) { - s2 = true; - break; - } - n2 += t2[e2]; - } - return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; - } - const m = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function x(t2, e2) { - const n2 = s(t2, m), i2 = {}; - for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return b("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", v(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return b("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", v(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return b("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", v(n2[t3])); - const s2 = n2[t3][2]; - if (!y(s2)) return b("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", v(n2[t3])); - if (Object.prototype.hasOwnProperty.call(i2, s2)) return b("InvalidAttr", "Attribute '" + s2 + "' is repeated.", v(n2[t3])); - i2[s2] = 1; - } - return true; - } - function N(t2, e2) { - if (";" === t2[++e2]) return -1; - if ("#" === t2[e2]) return (function(t3, e3) { - let n3 = /\d/; - for ("x" === t3[e3] && (e3++, n3 = /[\da-fA-F]/); e3 < t3.length; e3++) { - if (";" === t3[e3]) return e3; - if (!t3[e3].match(n3)) break; - } - return -1; - })(t2, ++e2); - let n2 = 0; - for (; e2 < t2.length; e2++, n2++) if (!(t2[e2].match(/\w/) && n2 < 20)) { - if (";" === t2[e2]) break; - return -1; - } - return e2; - } - function b(t2, e2, n2) { - return { err: { code: t2, msg: e2, line: n2.line || n2, col: n2.col } }; - } - function y(t2) { - return r(t2); - } - function E(t2) { - return r(t2); - } - function w(t2, e2) { - const n2 = t2.substring(0, e2).split(/\r?\n/); - return { line: n2.length, col: n2[n2.length - 1].length + 1 }; - } - function v(t2) { - return t2.startIndex + t2[1].length; - } - const S = (t2) => o.includes(t2) ? "__" + t2 : t2, _2 = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(t2, e2) { - return e2; - }, attributeValueProcessor: function(t2, e2) { - return e2; - }, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, entityDecoder: null, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, n2) { - return t2; - }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true, jPath: true, onDangerousProperty: S }; - function A(t2, e2) { - if ("string" != typeof t2) return; - const n2 = t2.toLowerCase(); - if (o.some((t3) => n2 === t3.toLowerCase())) throw new Error(`[SECURITY] Invalid ${e2}: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); - if (a.some((t3) => n2 === t3.toLowerCase())) throw new Error(`[SECURITY] Invalid ${e2}: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); - } - function T(t2, e2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 1e4, maxTotalExpansions: 1 / 0, maxExpandedLength: 1e5, maxEntityCount: 1e3, allowedTags: null, tagFilter: null, appliesTo: "all" } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: Math.max(1, t2.maxEntitySize ?? 1e4), maxExpansionDepth: Math.max(1, t2.maxExpansionDepth ?? 1e4), maxTotalExpansions: Math.max(1, t2.maxTotalExpansions ?? 1 / 0), maxExpandedLength: Math.max(1, t2.maxExpandedLength ?? 1e5), maxEntityCount: Math.max(1, t2.maxEntityCount ?? 1e3), allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null, appliesTo: t2.appliesTo ?? "all" } : T(true); - } - const C = function(t2) { - const e2 = Object.assign({}, _2, t2), n2 = [{ value: e2.attributeNamePrefix, name: "attributeNamePrefix" }, { value: e2.attributesGroupName, name: "attributesGroupName" }, { value: e2.textNodeName, name: "textNodeName" }, { value: e2.cdataPropName, name: "cdataPropName" }, { value: e2.commentPropName, name: "commentPropName" }]; - for (const { value: t3, name: e3 } of n2) t3 && A(t3, e3); - return null === e2.onDangerousProperty && (e2.onDangerousProperty = S), e2.processEntities = T(e2.processEntities, e2.htmlEntities), e2.unpairedTagsSet = new Set(e2.unpairedTags), e2.stopNodes && Array.isArray(e2.stopNodes) && (e2.stopNodes = e2.stopNodes.map((t3) => "string" == typeof t3 && t3.startsWith("*.") ? ".." + t3.substring(2) : t3)), e2; - }; - let P; - P = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); - class O { - constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); - } - add(t2, e2) { - "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); - } - addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][P] = { startIndex: e2 }); - } - static getMetaDataSymbol() { - return P; - } - } - class $ { - constructor(t2) { - this.suppressValidationErr = !t2, this.options = t2; - } - readDocType(t2, e2) { - const n2 = /* @__PURE__ */ Object.create(null); - let i2 = 0; - if ("O" !== t2[e2 + 3] || "C" !== t2[e2 + 4] || "T" !== t2[e2 + 5] || "Y" !== t2[e2 + 6] || "P" !== t2[e2 + 7] || "E" !== t2[e2 + 8]) throw new Error("Invalid Tag instead of DOCTYPE"); - { - e2 += 9; - let s2 = 1, r2 = false, o2 = false, a2 = ""; - for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || o2) if (">" === t2[e2]) { - if (o2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (o2 = false, s2--) : s2--, 0 === s2) break; - } else "[" === t2[e2] ? r2 = true : a2 += t2[e2]; - else { - if (r2 && D(t2, "!ENTITY", e2)) { - let s3, r3; - if (e2 += 7, [s3, r3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === r3.indexOf("&")) { - if (false !== this.options.enabled && null != this.options.maxEntityCount && i2 >= this.options.maxEntityCount) throw new Error(`Entity count (${i2 + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`); - n2[s3] = r3, i2++; - } - } else if (r2 && D(t2, "!ELEMENT", e2)) { - e2 += 8; - const { index: n3 } = this.readElementExp(t2, e2 + 1); - e2 = n3; - } else if (r2 && D(t2, "!ATTLIST", e2)) e2 += 8; - else if (r2 && D(t2, "!NOTATION", e2)) { - e2 += 9; - const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); - e2 = n3; - } else { - if (!D(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); - o2 = true; - } - s2++, a2 = ""; - } - if (0 !== s2) throw new Error("Unclosed DOCTYPE"); - } - return { entities: n2, i: e2 }; - } - readEntityExp(t2, e2) { - const n2 = e2 = I(t2, e2); - for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) e2++; - let i2 = t2.substring(n2, e2); - if (M(i2), e2 = I(t2, e2), !this.suppressValidationErr) { - if ("SYSTEM" === t2.substring(e2, e2 + 6).toUpperCase()) throw new Error("External entities are not supported"); - if ("%" === t2[e2]) throw new Error("Parameter entities are not supported"); - } - let s2 = ""; - if ([e2, s2] = this.readIdentifierVal(t2, e2, "entity"), false !== this.options.enabled && null != this.options.maxEntitySize && s2.length > this.options.maxEntitySize) throw new Error(`Entity "${i2}" size (${s2.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`); - return [i2, s2, --e2]; - } - readNotationExp(t2, e2) { - const n2 = e2 = I(t2, e2); - for (; e2 < t2.length && !/\s/.test(t2[e2]); ) e2++; - let i2 = t2.substring(n2, e2); - !this.suppressValidationErr && M(i2), e2 = I(t2, e2); - const s2 = t2.substring(e2, e2 + 6).toUpperCase(); - if (!this.suppressValidationErr && "SYSTEM" !== s2 && "PUBLIC" !== s2) throw new Error(`Expected SYSTEM or PUBLIC, found "${s2}"`); - e2 += s2.length, e2 = I(t2, e2); - let r2 = null, o2 = null; - if ("PUBLIC" === s2) [e2, r2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, o2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); - else if ("SYSTEM" === s2 && ([e2, o2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !o2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); - return { notationName: i2, publicIdentifier: r2, systemIdentifier: o2, index: --e2 }; - } - readIdentifierVal(t2, e2, n2) { - let i2 = ""; - const s2 = t2[e2]; - if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); - const r2 = ++e2; - for (; e2 < t2.length && t2[e2] !== s2; ) e2++; - if (i2 = t2.substring(r2, e2), t2[e2] !== s2) throw new Error(`Unterminated ${n2} value`); - return [++e2, i2]; - } - readElementExp(t2, e2) { - const n2 = e2 = I(t2, e2); - for (; e2 < t2.length && !/\s/.test(t2[e2]); ) e2++; - let i2 = t2.substring(n2, e2); - if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); - let s2 = ""; - if ("E" === t2[e2 = I(t2, e2)] && D(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && D(t2, "NY", e2)) e2 += 2; - else if ("(" === t2[e2]) { - const n3 = ++e2; - for (; e2 < t2.length && ")" !== t2[e2]; ) e2++; - if (s2 = t2.substring(n3, e2), ")" !== t2[e2]) throw new Error("Unterminated content model"); - } else if (!this.suppressValidationErr) throw new Error(`Invalid Element Expression, found "${t2[e2]}"`); - return { elementName: i2, contentModel: s2.trim(), index: e2 }; - } - readAttlistExp(t2, e2) { - let n2 = e2 = I(t2, e2); - for (; e2 < t2.length && !/\s/.test(t2[e2]); ) e2++; - let i2 = t2.substring(n2, e2); - for (M(i2), n2 = e2 = I(t2, e2); e2 < t2.length && !/\s/.test(t2[e2]); ) e2++; - let s2 = t2.substring(n2, e2); - if (!M(s2)) throw new Error(`Invalid attribute name: "${s2}"`); - e2 = I(t2, e2); - let r2 = ""; - if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (r2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); - e2++; - let n3 = []; - for (; e2 < t2.length && ")" !== t2[e2]; ) { - const i3 = e2; - for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) e2++; - let s3 = t2.substring(i3, e2); - if (s3 = s3.trim(), !M(s3)) throw new Error(`Invalid notation name: "${s3}"`); - n3.push(s3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); - } - if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); - e2++, r2 += " (" + n3.join("|") + ")"; - } else { - const n3 = e2; - for (; e2 < t2.length && !/\s/.test(t2[e2]); ) e2++; - r2 += t2.substring(n3, e2); - const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; - if (!this.suppressValidationErr && !i3.includes(r2.toUpperCase())) throw new Error(`Invalid attribute type: "${r2}"`); - } - e2 = I(t2, e2); - let o2 = ""; - return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (o2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (o2 = "#IMPLIED", e2 += 7) : [e2, o2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: s2, attributeType: r2, defaultValue: o2, index: e2 }; - } - } - const I = (t2, e2) => { - for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; - return e2; - }; - function D(t2, e2, n2) { - for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; - return true; - } - function M(t2) { - if (r(t2)) return t2; - throw new Error(`Invalid entity name ${t2}`); - } - const j = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, L = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true, infinity: "original" }; - const k = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - class F { - constructor(t2) { - this._matcher = t2; - } - get separator() { - return this._matcher.separator; - } - getCurrentTag() { - const t2 = this._matcher.path; - return t2.length > 0 ? t2[t2.length - 1].tag : void 0; - } - getCurrentNamespace() { - const t2 = this._matcher.path; - return t2.length > 0 ? t2[t2.length - 1].namespace : void 0; - } - getAttrValue(t2) { - const e2 = this._matcher.path; - if (0 !== e2.length) return e2[e2.length - 1].values?.[t2]; - } - hasAttr(t2) { - const e2 = this._matcher.path; - if (0 === e2.length) return false; - const n2 = e2[e2.length - 1]; - return void 0 !== n2.values && t2 in n2.values; - } - getPosition() { - const t2 = this._matcher.path; - return 0 === t2.length ? -1 : t2[t2.length - 1].position ?? 0; - } - getCounter() { - const t2 = this._matcher.path; - return 0 === t2.length ? -1 : t2[t2.length - 1].counter ?? 0; - } - getIndex() { - return this.getPosition(); - } - getDepth() { - return this._matcher.path.length; - } - toString(t2, e2 = true) { - return this._matcher.toString(t2, e2); - } - toArray() { - return this._matcher.path.map((t2) => t2.tag); - } - matches(t2) { - return this._matcher.matches(t2); - } - matchesAny(t2) { - return t2.matchesAny(this._matcher); - } - } - class R { - constructor(t2 = {}) { - this.separator = t2.separator || ".", this.path = [], this.siblingStacks = [], this._pathStringCache = null, this._view = new F(this); - } - push(t2, e2 = null, n2 = null) { - this._pathStringCache = null, this.path.length > 0 && (this.path[this.path.length - 1].values = void 0); - const i2 = this.path.length; - this.siblingStacks[i2] || (this.siblingStacks[i2] = /* @__PURE__ */ new Map()); - const s2 = this.siblingStacks[i2], r2 = n2 ? `${n2}:${t2}` : t2, o2 = s2.get(r2) || 0; - let a2 = 0; - for (const t3 of s2.values()) a2 += t3; - s2.set(r2, o2 + 1); - const h2 = { tag: t2, position: a2, counter: o2 }; - null != n2 && (h2.namespace = n2), null != e2 && (h2.values = e2), this.path.push(h2); - } - pop() { - if (0 === this.path.length) return; - this._pathStringCache = null; - const t2 = this.path.pop(); - return this.siblingStacks.length > this.path.length + 1 && (this.siblingStacks.length = this.path.length + 1), t2; - } - updateCurrent(t2) { - if (this.path.length > 0) { - const e2 = this.path[this.path.length - 1]; - null != t2 && (e2.values = t2); - } - } - getCurrentTag() { - return this.path.length > 0 ? this.path[this.path.length - 1].tag : void 0; - } - getCurrentNamespace() { - return this.path.length > 0 ? this.path[this.path.length - 1].namespace : void 0; - } - getAttrValue(t2) { - if (0 !== this.path.length) return this.path[this.path.length - 1].values?.[t2]; - } - hasAttr(t2) { - if (0 === this.path.length) return false; - const e2 = this.path[this.path.length - 1]; - return void 0 !== e2.values && t2 in e2.values; - } - getPosition() { - return 0 === this.path.length ? -1 : this.path[this.path.length - 1].position ?? 0; - } - getCounter() { - return 0 === this.path.length ? -1 : this.path[this.path.length - 1].counter ?? 0; - } - getIndex() { - return this.getPosition(); - } - getDepth() { - return this.path.length; - } - toString(t2, e2 = true) { - const n2 = t2 || this.separator; - if (n2 === this.separator && true === e2) { - if (null !== this._pathStringCache) return this._pathStringCache; - const t3 = this.path.map((t4) => t4.namespace ? `${t4.namespace}:${t4.tag}` : t4.tag).join(n2); - return this._pathStringCache = t3, t3; - } - return this.path.map((t3) => e2 && t3.namespace ? `${t3.namespace}:${t3.tag}` : t3.tag).join(n2); - } - toArray() { - return this.path.map((t2) => t2.tag); - } - reset() { - this._pathStringCache = null, this.path = [], this.siblingStacks = []; - } - matches(t2) { - const e2 = t2.segments; - return 0 !== e2.length && (t2.hasDeepWildcard() ? this._matchWithDeepWildcard(e2) : this._matchSimple(e2)); - } - _matchSimple(t2) { - if (this.path.length !== t2.length) return false; - for (let e2 = 0; e2 < t2.length; e2++) if (!this._matchSegment(t2[e2], this.path[e2], e2 === this.path.length - 1)) return false; - return true; - } - _matchWithDeepWildcard(t2) { - let e2 = this.path.length - 1, n2 = t2.length - 1; - for (; n2 >= 0 && e2 >= 0; ) { - const i2 = t2[n2]; - if ("deep-wildcard" === i2.type) { - if (n2--, n2 < 0) return true; - const i3 = t2[n2]; - let s2 = false; - for (let t3 = e2; t3 >= 0; t3--) if (this._matchSegment(i3, this.path[t3], t3 === this.path.length - 1)) { - e2 = t3 - 1, n2--, s2 = true; - break; - } - if (!s2) return false; - } else { - if (!this._matchSegment(i2, this.path[e2], e2 === this.path.length - 1)) return false; - e2--, n2--; - } - } - return n2 < 0; - } - _matchSegment(t2, e2, n2) { - if ("*" !== t2.tag && t2.tag !== e2.tag) return false; - if (void 0 !== t2.namespace && "*" !== t2.namespace && t2.namespace !== e2.namespace) return false; - if (void 0 !== t2.attrName) { - if (!n2) return false; - if (!e2.values || !(t2.attrName in e2.values)) return false; - if (void 0 !== t2.attrValue && String(e2.values[t2.attrName]) !== String(t2.attrValue)) return false; - } - if (void 0 !== t2.position) { - if (!n2) return false; - const i2 = e2.counter ?? 0; - if ("first" === t2.position && 0 !== i2) return false; - if ("odd" === t2.position && i2 % 2 != 1) return false; - if ("even" === t2.position && i2 % 2 != 0) return false; - if ("nth" === t2.position && i2 !== t2.positionValue) return false; - } - return true; - } - matchesAny(t2) { - return t2.matchesAny(this); - } - snapshot() { - return { path: this.path.map((t2) => ({ ...t2 })), siblingStacks: this.siblingStacks.map((t2) => new Map(t2)) }; - } - restore(t2) { - this._pathStringCache = null, this.path = t2.path.map((t3) => ({ ...t3 })), this.siblingStacks = t2.siblingStacks.map((t3) => new Map(t3)); - } - readOnly() { - return this._view; - } - } - class G { - constructor(t2, e2 = {}, n2) { - this.pattern = t2, this.separator = e2.separator || ".", this.segments = this._parse(t2), this.data = n2, this._hasDeepWildcard = this.segments.some((t3) => "deep-wildcard" === t3.type), this._hasAttributeCondition = this.segments.some((t3) => void 0 !== t3.attrName), this._hasPositionSelector = this.segments.some((t3) => void 0 !== t3.position); - } - _parse(t2) { - const e2 = []; - let n2 = 0, i2 = ""; - for (; n2 < t2.length; ) t2[n2] === this.separator ? n2 + 1 < t2.length && t2[n2 + 1] === this.separator ? (i2.trim() && (e2.push(this._parseSegment(i2.trim())), i2 = ""), e2.push({ type: "deep-wildcard" }), n2 += 2) : (i2.trim() && e2.push(this._parseSegment(i2.trim())), i2 = "", n2++) : (i2 += t2[n2], n2++); - return i2.trim() && e2.push(this._parseSegment(i2.trim())), e2; - } - _parseSegment(t2) { - const e2 = { type: "tag" }; - let n2 = null, i2 = t2; - const s2 = t2.match(/^([^\[]+)(\[[^\]]*\])(.*)$/); - if (s2 && (i2 = s2[1] + s2[3], s2[2])) { - const t3 = s2[2].slice(1, -1); - t3 && (n2 = t3); - } - let r2, o2, a2 = i2; - if (i2.includes("::")) { - const e3 = i2.indexOf("::"); - if (r2 = i2.substring(0, e3).trim(), a2 = i2.substring(e3 + 2).trim(), !r2) throw new Error(`Invalid namespace in pattern: ${t2}`); - } - let h2 = null; - if (a2.includes(":")) { - const t3 = a2.lastIndexOf(":"), e3 = a2.substring(0, t3).trim(), n3 = a2.substring(t3 + 1).trim(); - ["first", "last", "odd", "even"].includes(n3) || /^nth\(\d+\)$/.test(n3) ? (o2 = e3, h2 = n3) : o2 = a2; - } else o2 = a2; - if (!o2) throw new Error(`Invalid segment pattern: ${t2}`); - if (e2.tag = o2, r2 && (e2.namespace = r2), n2) if (n2.includes("=")) { - const t3 = n2.indexOf("="); - e2.attrName = n2.substring(0, t3).trim(), e2.attrValue = n2.substring(t3 + 1).trim(); - } else e2.attrName = n2.trim(); - if (h2) { - const t3 = h2.match(/^nth\((\d+)\)$/); - t3 ? (e2.position = "nth", e2.positionValue = parseInt(t3[1], 10)) : e2.position = h2; - } - return e2; - } - get length() { - return this.segments.length; - } - hasDeepWildcard() { - return this._hasDeepWildcard; - } - hasAttributeCondition() { - return this._hasAttributeCondition; - } - hasPositionSelector() { - return this._hasPositionSelector; - } - toString() { - return this.pattern; - } - } - class B { - constructor() { - this._byDepthAndTag = /* @__PURE__ */ new Map(), this._wildcardByDepth = /* @__PURE__ */ new Map(), this._deepWildcards = [], this._patterns = /* @__PURE__ */ new Set(), this._sealed = false; - } - add(t2) { - if (this._sealed) throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions."); - if (this._patterns.has(t2.pattern)) return this; - if (this._patterns.add(t2.pattern), t2.hasDeepWildcard()) return this._deepWildcards.push(t2), this; - const e2 = t2.length, n2 = t2.segments[t2.segments.length - 1], i2 = n2?.tag; - if (i2 && "*" !== i2) { - const n3 = `${e2}:${i2}`; - this._byDepthAndTag.has(n3) || this._byDepthAndTag.set(n3, []), this._byDepthAndTag.get(n3).push(t2); - } else this._wildcardByDepth.has(e2) || this._wildcardByDepth.set(e2, []), this._wildcardByDepth.get(e2).push(t2); - return this; - } - addAll(t2) { - for (const e2 of t2) this.add(e2); - return this; - } - has(t2) { - return this._patterns.has(t2.pattern); - } - get size() { - return this._patterns.size; - } - seal() { - return this._sealed = true, this; - } - get isSealed() { - return this._sealed; - } - matchesAny(t2) { - return null !== this.findMatch(t2); - } - findMatch(t2) { - const e2 = t2.getDepth(), n2 = `${e2}:${t2.getCurrentTag()}`, i2 = this._byDepthAndTag.get(n2); - if (i2) { - for (let e3 = 0; e3 < i2.length; e3++) if (t2.matches(i2[e3])) return i2[e3]; - } - const s2 = this._wildcardByDepth.get(e2); - if (s2) { - for (let e3 = 0; e3 < s2.length; e3++) if (t2.matches(s2[e3])) return s2[e3]; - } - for (let e3 = 0; e3 < this._deepWildcards.length; e3++) if (t2.matches(this._deepWildcards[e3])) return this._deepWildcards[e3]; - return null; - } - } - const U = { cent: "\xA2", pound: "\xA3", curren: "\xA4", yen: "\xA5", euro: "\u20AC", dollar: "$", euro: "\u20AC", fnof: "\u0192", inr: "\u20B9", af: "\u060B", birr: "\u1265\u122D", peso: "\u20B1", rub: "\u20BD", won: "\u20A9", yuan: "\xA5", cedil: "\xB8" }, W = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' }, X = { nbsp: "\xA0", copy: "\xA9", reg: "\xAE", trade: "\u2122", mdash: "\u2014", ndash: "\u2013", hellip: "\u2026", laquo: "\xAB", raquo: "\xBB", lsquo: "\u2018", rsquo: "\u2019", ldquo: "\u201C", rdquo: "\u201D", bull: "\u2022", para: "\xB6", sect: "\xA7", deg: "\xB0", frac12: "\xBD", frac14: "\xBC", frac34: "\xBE" }, Y = new Set("!?\\\\/[]$%{}^&*()<>|+"); - function z(t2) { - if ("#" === t2[0]) throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t2}"`); - for (const e2 of t2) if (Y.has(e2)) throw new Error(`[EntityReplacer] Invalid character '${e2}' in entity name: "${t2}"`); - return t2; - } - function q(...t2) { - const e2 = /* @__PURE__ */ Object.create(null); - for (const n2 of t2) if (n2) for (const t3 of Object.keys(n2)) { - const i2 = n2[t3]; - if ("string" == typeof i2) e2[t3] = i2; - else if (i2 && "object" == typeof i2 && void 0 !== i2.val) { - const n3 = i2.val; - "string" == typeof n3 && (e2[t3] = n3); - } - } - return e2; - } - const Z = "external", J = "base", K = "all", Q = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 }), H = /* @__PURE__ */ new Set([9, 10, 13]); - class tt { - constructor(t2 = {}) { - var e2; - this._limit = t2.limit || {}, this._maxTotalExpansions = this._limit.maxTotalExpansions || 0, this._maxExpandedLength = this._limit.maxExpandedLength || 0, this._postCheck = "function" == typeof t2.postCheck ? t2.postCheck : (t3) => t3, this._limitTiers = (e2 = this._limit.applyLimitsTo ?? Z) && e2 !== Z ? e2 === K ? /* @__PURE__ */ new Set([K]) : e2 === J ? /* @__PURE__ */ new Set([J]) : Array.isArray(e2) ? new Set(e2) : /* @__PURE__ */ new Set([Z]) : /* @__PURE__ */ new Set([Z]), this._numericAllowed = t2.numericAllowed ?? true, this._baseMap = q(W, t2.namedEntities || null), this._externalMap = /* @__PURE__ */ Object.create(null), this._inputMap = /* @__PURE__ */ Object.create(null), this._totalExpansions = 0, this._expandedLength = 0, this._removeSet = new Set(t2.remove && Array.isArray(t2.remove) ? t2.remove : []), this._leaveSet = new Set(t2.leave && Array.isArray(t2.leave) ? t2.leave : []); - const n2 = (function(t3) { - if (!t3) return { xmlVersion: 1, onLevel: Q.allow, nullLevel: Q.remove }; - const e3 = 1.1 === t3.xmlVersion ? 1.1 : 1, n3 = Q[t3.onNCR] ?? Q.allow, i2 = Q[t3.nullNCR] ?? Q.remove; - return { xmlVersion: e3, onLevel: n3, nullLevel: Math.max(i2, Q.remove) }; - })(t2.ncr); - this._ncrXmlVersion = n2.xmlVersion, this._ncrOnLevel = n2.onLevel, this._ncrNullLevel = n2.nullLevel; - } - setExternalEntities(t2) { - if (t2) for (const e2 of Object.keys(t2)) z(e2); - this._externalMap = q(t2); - } - addExternalEntity(t2, e2) { - z(t2), "string" == typeof e2 && -1 === e2.indexOf("&") && (this._externalMap[t2] = e2); - } - addInputEntities(t2) { - this._totalExpansions = 0, this._expandedLength = 0, this._inputMap = q(t2); - } - reset() { - return this._inputMap = /* @__PURE__ */ Object.create(null), this._totalExpansions = 0, this._expandedLength = 0, this; - } - setXmlVersion(t2) { - this._ncrXmlVersion = 1.1 === t2 ? 1.1 : 1; - } - decode(t2) { - if ("string" != typeof t2 || 0 === t2.length) return t2; - const e2 = t2, n2 = [], i2 = t2.length; - let s2 = 0, r2 = 0; - const o2 = this._maxTotalExpansions > 0, a2 = this._maxExpandedLength > 0, h2 = o2 || a2; - for (; r2 < i2; ) { - if (38 !== t2.charCodeAt(r2)) { - r2++; - continue; - } - let e3 = r2 + 1; - for (; e3 < i2 && 59 !== t2.charCodeAt(e3) && e3 - r2 <= 32; ) e3++; - if (e3 >= i2 || 59 !== t2.charCodeAt(e3)) { - r2++; - continue; - } - const l3 = t2.slice(r2 + 1, e3); - if (0 === l3.length) { - r2++; - continue; - } - let u2, p2; - if (this._removeSet.has(l3)) u2 = "", void 0 === p2 && (p2 = Z); - else { - if (this._leaveSet.has(l3)) { - r2++; - continue; - } - if (35 === l3.charCodeAt(0)) { - const t3 = this._resolveNCR(l3); - if (void 0 === t3) { - r2++; - continue; - } - u2 = t3, p2 = J; - } else { - const t3 = this._resolveName(l3); - u2 = t3?.value, p2 = t3?.tier; - } - } - if (void 0 !== u2) { - if (r2 > s2 && n2.push(t2.slice(s2, r2)), n2.push(u2), s2 = e3 + 1, r2 = s2, h2 && this._tierCounts(p2)) { - if (o2 && (this._totalExpansions++, this._totalExpansions > this._maxTotalExpansions)) throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`); - if (a2) { - const t3 = u2.length - (l3.length + 2); - if (t3 > 0 && (this._expandedLength += t3, this._expandedLength > this._maxExpandedLength)) throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`); - } - } - } else r2++; - } - s2 < i2 && n2.push(t2.slice(s2)); - const l2 = 0 === n2.length ? t2 : n2.join(""); - return this._postCheck(l2, e2); - } - _tierCounts(t2) { - return !!this._limitTiers.has(K) || this._limitTiers.has(t2); - } - _resolveName(t2) { - return t2 in this._inputMap ? { value: this._inputMap[t2], tier: Z } : t2 in this._externalMap ? { value: this._externalMap[t2], tier: Z } : t2 in this._baseMap ? { value: this._baseMap[t2], tier: J } : void 0; - } - _classifyNCR(t2) { - return 0 === t2 ? this._ncrNullLevel : t2 >= 55296 && t2 <= 57343 || 1 === this._ncrXmlVersion && t2 >= 1 && t2 <= 31 && !H.has(t2) ? Q.remove : -1; - } - _applyNCRAction(t2, e2, n2) { - switch (t2) { - case Q.allow: - return String.fromCodePoint(n2); - case Q.remove: - return ""; - case Q.leave: - return; - case Q.throw: - throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e2}; (U+${n2.toString(16).toUpperCase().padStart(4, "0")})`); - default: - return String.fromCodePoint(n2); - } - } - _resolveNCR(t2) { - const e2 = t2.charCodeAt(1); - let n2; - if (n2 = 120 === e2 || 88 === e2 ? parseInt(t2.slice(2), 16) : parseInt(t2.slice(1), 10), Number.isNaN(n2) || n2 < 0 || n2 > 1114111) return; - const i2 = this._classifyNCR(n2); - if (!this._numericAllowed && i2 < Q.remove) return; - const s2 = -1 === i2 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, i2); - return this._applyNCRAction(s2, t2, n2); - } - } - function et(t2, e2) { - if (!t2) return {}; - const n2 = e2.attributesGroupName ? t2[e2.attributesGroupName] : t2; - if (!n2) return {}; - const i2 = {}; - for (const t3 in n2) t3.startsWith(e2.attributeNamePrefix) ? i2[t3.substring(e2.attributeNamePrefix.length)] = n2[t3] : i2[t3] = n2[t3]; - return i2; - } - function nt(t2) { - if (!t2 || "string" != typeof t2) return; - const e2 = t2.indexOf(":"); - if (-1 !== e2 && e2 > 0) { - const n2 = t2.substring(0, e2); - if ("xmlns" !== n2) return n2; - } - } - class it { - constructor(t2) { - var e2; - this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.parseXml = ht, this.parseTextData = st, this.resolveNameSpace = rt, this.buildAttributesMap = at, this.isItStopNode = ct, this.replaceEntitiesValue = ut, this.readStopNodeData = mt, this.saveTextToParentTag = pt, this.addChild = lt2, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { - for (const n3 of e2) { - if ("string" == typeof n3 && t3 === n3) return true; - if (n3 instanceof RegExp && n3.test(t3)) return true; - } - } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0; - let n2 = { ...W }; - this.options.entityDecoder ? this.entityDecoder = this.options.entityDecoder : ("object" == typeof this.options.htmlEntities ? n2 = this.options.htmlEntities : true === this.options.htmlEntities && (n2 = { ...X, ...U }), this.entityDecoder = new tt({ namedEntities: n2, numericAllowed: this.options.htmlEntities, limit: { maxTotalExpansions: this.options.processEntities.maxTotalExpansions, maxExpandedLength: this.options.processEntities.maxExpandedLength, applyLimitsTo: this.options.processEntities.appliesTo } })), this.matcher = new R(), this.readonlyMatcher = this.matcher.readOnly(), this.isCurrentNodeStopNode = false, this.stopNodeExpressionsSet = new B(); - const i2 = this.options.stopNodes; - if (i2 && i2.length > 0) { - for (let t3 = 0; t3 < i2.length; t3++) { - const e3 = i2[t3]; - "string" == typeof e3 ? this.stopNodeExpressionsSet.add(new G(e3)) : e3 instanceof G && this.stopNodeExpressionsSet.add(e3); - } - this.stopNodeExpressionsSet.seal(); - } - } - } - function st(t2, e2, n2, i2, s2, r2, o2) { - const a2 = this.options; - if (void 0 !== t2 && (a2.trimValues && !i2 && (t2 = t2.trim()), t2.length > 0)) { - o2 || (t2 = this.replaceEntitiesValue(t2, e2, n2)); - const i3 = a2.jPath ? n2.toString() : n2, h2 = a2.tagValueProcessor(e2, t2, i3, s2, r2); - return null == h2 ? t2 : typeof h2 != typeof t2 || h2 !== t2 ? h2 : a2.trimValues || t2.trim() === t2 ? xt(t2, a2.parseTagValue, a2.numberParseOptions) : t2; - } - } - function rt(t2) { - if (this.options.removeNSPrefix) { - const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; - if ("xmlns" === e2[0]) return ""; - 2 === e2.length && (t2 = n2 + e2[1]); - } - return t2; - } - const ot = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function at(t2, e2, n2, i2 = false) { - const r2 = this.options; - if (true === i2 || true !== r2.ignoreAttributes && "string" == typeof t2) { - const i3 = s(t2, ot), o2 = i3.length, a2 = {}, h2 = new Array(o2); - let l2 = false; - const u2 = {}; - for (let t3 = 0; t3 < o2; t3++) { - const e3 = this.resolveNameSpace(i3[t3][1]), s2 = i3[t3][4]; - if (e3.length && void 0 !== s2) { - let i4 = s2; - r2.trimValues && (i4 = i4.trim()), i4 = this.replaceEntitiesValue(i4, n2, this.readonlyMatcher), h2[t3] = i4, u2[e3] = i4, l2 = true; - } - } - l2 && "object" == typeof e2 && e2.updateCurrent && e2.updateCurrent(u2); - const p2 = r2.jPath ? e2.toString() : this.readonlyMatcher; - let c2 = false; - for (let t3 = 0; t3 < o2; t3++) { - const e3 = this.resolveNameSpace(i3[t3][1]); - if (this.ignoreAttributesFn(e3, p2)) continue; - let n3 = r2.attributeNamePrefix + e3; - if (e3.length) if (r2.transformAttributeName && (n3 = r2.transformAttributeName(n3)), n3 = bt(n3, r2), void 0 !== i3[t3][4]) { - const i4 = h2[t3], s2 = r2.attributeValueProcessor(e3, i4, p2); - a2[n3] = null == s2 ? i4 : typeof s2 != typeof i4 || s2 !== i4 ? s2 : xt(i4, r2.parseAttributeValue, r2.numberParseOptions), c2 = true; - } else r2.allowBooleanAttributes && (a2[n3] = true, c2 = true); - } - if (!c2) return; - if (r2.attributesGroupName) { - const t3 = {}; - return t3[r2.attributesGroupName] = a2, t3; - } - return a2; - } - } - const ht = function(t2) { - t2 = t2.replace(/\r\n?/g, "\n"); - const e2 = new O("!xml"); - let n2 = e2, i2 = ""; - this.matcher.reset(), this.entityDecoder.reset(), this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const s2 = this.options, r2 = new $(s2.processEntities), o2 = t2.length; - for (let a2 = 0; a2 < o2; a2++) if ("<" === t2[a2]) { - const h2 = t2.charCodeAt(a2 + 1); - if (47 === h2) { - const e3 = dt(t2, ">", a2, "Closing Tag is not closed."); - let r3 = t2.substring(a2 + 2, e3).trim(); - if (s2.removeNSPrefix) { - const t3 = r3.indexOf(":"); - -1 !== t3 && (r3 = r3.substr(t3 + 1)); - } - r3 = Nt(s2.transformTagName, r3, "", s2).tagName, n2 && (i2 = this.saveTextToParentTag(i2, n2, this.readonlyMatcher)); - const o3 = this.matcher.getCurrentTag(); - if (r3 && s2.unpairedTagsSet.has(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); - o3 && s2.unpairedTagsSet.has(o3) && (this.matcher.pop(), this.tagsNodeStack.pop()), this.matcher.pop(), this.isCurrentNodeStopNode = false, n2 = this.tagsNodeStack.pop(), i2 = "", a2 = e3; - } else if (63 === h2) { - let e3 = gt(t2, a2, false, "?>"); - if (!e3) throw new Error("Pi Tag is not closed."); - i2 = this.saveTextToParentTag(i2, n2, this.readonlyMatcher); - const r3 = this.buildAttributesMap(e3.tagExp, this.matcher, e3.tagName, true); - if (r3) { - const t3 = r3[this.options.attributeNamePrefix + "version"]; - this.entityDecoder.setXmlVersion(Number(t3) || 1); - } - if (s2.ignoreDeclaration && "?xml" === e3.tagName || s2.ignorePiTags) ; - else { - const t3 = new O(e3.tagName); - t3.add(s2.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && true !== s2.ignoreAttributes && (t3[":@"] = r3), this.addChild(n2, t3, this.readonlyMatcher, a2); - } - a2 = e3.closeIndex + 1; - } else if (33 === h2 && 45 === t2.charCodeAt(a2 + 2) && 45 === t2.charCodeAt(a2 + 3)) { - const e3 = dt(t2, "-->", a2 + 4, "Comment is not closed."); - if (s2.commentPropName) { - const r3 = t2.substring(a2 + 4, e3 - 2); - i2 = this.saveTextToParentTag(i2, n2, this.readonlyMatcher), n2.add(s2.commentPropName, [{ [s2.textNodeName]: r3 }]); - } - a2 = e3; - } else if (33 === h2 && 68 === t2.charCodeAt(a2 + 2)) { - const e3 = r2.readDocType(t2, a2); - this.entityDecoder.addInputEntities(e3.entities), a2 = e3.i; - } else if (33 === h2 && 91 === t2.charCodeAt(a2 + 2)) { - const e3 = dt(t2, "]]>", a2, "CDATA is not closed.") - 2, r3 = t2.substring(a2 + 9, e3); - i2 = this.saveTextToParentTag(i2, n2, this.readonlyMatcher); - let o3 = this.parseTextData(r3, n2.tagname, this.readonlyMatcher, true, false, true, true); - null == o3 && (o3 = ""), s2.cdataPropName ? n2.add(s2.cdataPropName, [{ [s2.textNodeName]: r3 }]) : n2.add(s2.textNodeName, o3), a2 = e3 + 2; - } else { - let r3 = gt(t2, a2, s2.removeNSPrefix); - if (!r3) { - const e3 = t2.substring(Math.max(0, a2 - 50), Math.min(o2, a2 + 50)); - throw new Error(`readTagExp returned undefined at position ${a2}. Context: "${e3}"`); - } - let h3 = r3.tagName; - const l2 = r3.rawTagName; - let u2 = r3.tagExp, p2 = r3.attrExpPresent, c2 = r3.closeIndex; - if ({ tagName: h3, tagExp: u2 } = Nt(s2.transformTagName, h3, u2, s2), s2.strictReservedNames && (h3 === s2.commentPropName || h3 === s2.cdataPropName || h3 === s2.textNodeName || h3 === s2.attributesGroupName)) throw new Error(`Invalid tag name: ${h3}`); - n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, this.readonlyMatcher, false)); - const d2 = n2; - d2 && s2.unpairedTagsSet.has(d2.tagname) && (n2 = this.tagsNodeStack.pop(), this.matcher.pop()); - let f2 = false; - u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1 && (f2 = true, "/" === h3[h3.length - 1] ? (h3 = h3.substr(0, h3.length - 1), u2 = h3) : u2 = u2.substr(0, u2.length - 1), p2 = h3 !== u2); - let g2, m2 = null, x2 = {}; - g2 = nt(l2), h3 !== e2.tagname && this.matcher.push(h3, {}, g2), h3 !== u2 && p2 && (m2 = this.buildAttributesMap(u2, this.matcher, h3), m2 && (x2 = et(m2, s2))), h3 !== e2.tagname && (this.isCurrentNodeStopNode = this.isItStopNode()); - const N2 = a2; - if (this.isCurrentNodeStopNode) { - let e3 = ""; - if (f2) a2 = r3.closeIndex; - else if (s2.unpairedTagsSet.has(h3)) a2 = r3.closeIndex; - else { - const n3 = this.readStopNodeData(t2, l2, c2 + 1); - if (!n3) throw new Error(`Unexpected end of ${l2}`); - a2 = n3.i, e3 = n3.tagContent; - } - const i3 = new O(h3); - m2 && (i3[":@"] = m2), i3.add(s2.textNodeName, e3), this.matcher.pop(), this.isCurrentNodeStopNode = false, this.addChild(n2, i3, this.readonlyMatcher, N2); - } else { - if (f2) { - ({ tagName: h3, tagExp: u2 } = Nt(s2.transformTagName, h3, u2, s2)); - const t3 = new O(h3); - m2 && (t3[":@"] = m2), this.addChild(n2, t3, this.readonlyMatcher, N2), this.matcher.pop(), this.isCurrentNodeStopNode = false; - } else { - if (s2.unpairedTagsSet.has(h3)) { - const t3 = new O(h3); - m2 && (t3[":@"] = m2), this.addChild(n2, t3, this.readonlyMatcher, N2), this.matcher.pop(), this.isCurrentNodeStopNode = false, a2 = r3.closeIndex; - continue; - } - { - const t3 = new O(h3); - if (this.tagsNodeStack.length > s2.maxNestedTags) throw new Error("Maximum nested tags exceeded"); - this.tagsNodeStack.push(n2), m2 && (t3[":@"] = m2), this.addChild(n2, t3, this.readonlyMatcher, N2), n2 = t3; - } - } - i2 = "", a2 = c2; - } - } - } else i2 += t2[a2]; - return e2.child; - }; - function lt2(t2, e2, n2, i2) { - this.options.captureMetaData || (i2 = void 0); - const s2 = this.options.jPath ? n2.toString() : n2, r2 = this.options.updateTag(e2.tagname, s2, e2[":@"]); - false === r2 || ("string" == typeof r2 ? (e2.tagname = r2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); - } - function ut(t2, e2, n2) { - const i2 = this.options.processEntities; - if (!i2 || !i2.enabled) return t2; - if (i2.allowedTags) { - const s2 = this.options.jPath ? n2.toString() : n2; - if (!(Array.isArray(i2.allowedTags) ? i2.allowedTags.includes(e2) : i2.allowedTags(e2, s2))) return t2; - } - if (i2.tagFilter) { - const s2 = this.options.jPath ? n2.toString() : n2; - if (!i2.tagFilter(e2, s2)) return t2; - } - return this.entityDecoder.decode(t2); - } - function pt(t2, e2, n2, i2) { - return t2 && (void 0 === i2 && (i2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, n2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, i2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; - } - function ct() { - return 0 !== this.stopNodeExpressionsSet.size && this.matcher.matchesAny(this.stopNodeExpressionsSet); - } - function dt(t2, e2, n2, i2) { - const s2 = t2.indexOf(e2, n2); - if (-1 === s2) throw new Error(i2); - return s2 + e2.length - 1; - } - function ft(t2, e2, n2, i2) { - const s2 = t2.indexOf(e2, n2); - if (-1 === s2) throw new Error(i2); - return s2; - } - function gt(t2, e2, n2, i2 = ">") { - const s2 = (function(t3, e3, n3 = ">") { - let i3 = 0; - const s3 = [], r3 = t3.length, o3 = n3.charCodeAt(0), a3 = n3.length > 1 ? n3.charCodeAt(1) : -1; - for (let n4 = e3; n4 < r3; n4++) { - const e4 = t3.charCodeAt(n4); - if (i3) e4 === i3 && (i3 = 0); - else if (34 === e4 || 39 === e4) i3 = e4; - else if (e4 === o3) { - if (-1 === a3) return { data: String.fromCharCode(...s3), index: n4 }; - if (t3.charCodeAt(n4 + 1) === a3) return { data: String.fromCharCode(...s3), index: n4 }; - } else if (9 === e4) { - s3.push(32); - continue; - } - s3.push(e4); - } - })(t2, e2 + 1, i2); - if (!s2) return; - let r2 = s2.data; - const o2 = s2.index, a2 = r2.search(/\s/); - let h2 = r2, l2 = true; - -1 !== a2 && (h2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); - const u2 = h2; - if (n2) { - const t3 = h2.indexOf(":"); - -1 !== t3 && (h2 = h2.substr(t3 + 1), l2 = h2 !== s2.data.substr(t3 + 1)); - } - return { tagName: h2, tagExp: r2, closeIndex: o2, attrExpPresent: l2, rawTagName: u2 }; - } - function mt(t2, e2, n2) { - const i2 = n2; - let s2 = 1; - const r2 = t2.length; - for (; n2 < r2; n2++) if ("<" === t2[n2]) { - const r3 = t2.charCodeAt(n2 + 1); - if (47 === r3) { - const r4 = ft(t2, ">", n2, `${e2} is not closed`); - if (t2.substring(n2 + 2, r4).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(i2, n2), i: r4 }; - n2 = r4; - } else if (63 === r3) n2 = dt(t2, "?>", n2 + 1, "StopNode is not closed."); - else if (33 === r3 && 45 === t2.charCodeAt(n2 + 2) && 45 === t2.charCodeAt(n2 + 3)) n2 = dt(t2, "-->", n2 + 3, "StopNode is not closed."); - else if (33 === r3 && 91 === t2.charCodeAt(n2 + 2)) n2 = dt(t2, "]]>", n2, "StopNode is not closed.") - 2; - else { - const i3 = gt(t2, n2, ">"); - i3 && ((i3 && i3.tagName) === e2 && "/" !== i3.tagExp[i3.tagExp.length - 1] && s2++, n2 = i3.closeIndex); - } - } - } - function xt(t2, e2, n2) { - if (e2 && "string" == typeof t2) { - const e3 = t2.trim(); - return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, L, e4), !t3 || "string" != typeof t3) return t3; - let n3 = t3.trim(); - if (0 === n3.length) return t3; - if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; - if ("0" === n3) return 0; - if (e4.hex && j.test(n3)) return (function(t4) { - if (parseInt) return parseInt(t4, 16); - if (Number.parseInt) return Number.parseInt(t4, 16); - if (window && window.parseInt) return window.parseInt(t4, 16); - throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); - })(n3); - if (isFinite(n3)) { - if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { - if (!n4.eNotation) return t4; - const i3 = e5.match(k); - if (i3) { - let s2 = i3[1] || ""; - const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; - return o2.length > 1 && a2 ? t4 : (1 !== o2.length || !i3[3].startsWith(`.${r2}`) && i3[3][0] !== r2) && o2.length > 0 ? n4.leadingZeros && !a2 ? (e5 = (i3[1] || "") + i3[3], Number(e5)) : t4 : Number(e5); - } - return t4; - })(t3, n3, e4); - { - const s2 = V.exec(n3); - if (s2) { - const r2 = s2[1] || "", o2 = s2[2]; - let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; - const h2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; - if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !h2)) return t3; - { - const i3 = Number(n3), s3 = String(i3); - if (0 === i3) return i3; - if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; - if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; - let h3 = o2 ? a2 : n3; - return o2 ? h3 === s3 || r2 + h3 === s3 ? i3 : t3 : h3 === s3 || h3 === r2 + s3 ? i3 : t3; - } - } - return t3; - } - } - var i2; - return (function(t4, e5, n4) { - const i3 = e5 === 1 / 0; - switch (n4.infinity.toLowerCase()) { - case "null": - return null; - case "infinity": - return e5; - case "string": - return i3 ? "Infinity" : "-Infinity"; - default: - return t4; - } - })(t3, Number(n3), e4); - })(t2, n2); - } - return void 0 !== t2 ? t2 : ""; - } - function Nt(t2, e2, n2, i2) { - if (t2) { - const i3 = t2(e2); - n2 === e2 && (n2 = i3), e2 = i3; - } - return { tagName: e2 = bt(e2, i2), tagExp: n2 }; - } - function bt(t2, e2) { - if (a.includes(t2)) throw new Error(`[SECURITY] Invalid name: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); - return o.includes(t2) ? e2.onDangerousProperty(t2) : t2; - } - const yt = O.getMetaDataSymbol(); - function Et(t2, e2) { - if (!t2 || "object" != typeof t2) return {}; - if (!e2) return t2; - const n2 = {}; - for (const i2 in t2) i2.startsWith(e2) ? n2[i2.substring(e2.length)] = t2[i2] : n2[i2] = t2[i2]; - return n2; - } - function wt(t2, e2, n2, i2) { - return vt(t2, e2, n2, i2); - } - function vt(t2, e2, n2, i2) { - let s2; - const r2 = {}; - for (let o2 = 0; o2 < t2.length; o2++) { - const a2 = t2[o2], h2 = St(a2); - if (void 0 !== h2 && h2 !== e2.textNodeName) { - const t3 = Et(a2[":@"] || {}, e2.attributeNamePrefix); - n2.push(h2, t3); - } - if (h2 === e2.textNodeName) void 0 === s2 ? s2 = a2[h2] : s2 += "" + a2[h2]; - else { - if (void 0 === h2) continue; - if (a2[h2]) { - let t3 = vt(a2[h2], e2, n2, i2); - const s3 = At(t3, e2); - if (a2[":@"] ? _t(t3, a2[":@"], i2, e2) : 1 !== Object.keys(t3).length || void 0 === t3[e2.textNodeName] || e2.alwaysCreateTextNode ? 0 === Object.keys(t3).length && (e2.alwaysCreateTextNode ? t3[e2.textNodeName] = "" : t3 = "") : t3 = t3[e2.textNodeName], void 0 !== a2[yt] && "object" == typeof t3 && null !== t3 && (t3[yt] = a2[yt]), void 0 !== r2[h2] && Object.prototype.hasOwnProperty.call(r2, h2)) Array.isArray(r2[h2]) || (r2[h2] = [r2[h2]]), r2[h2].push(t3); - else { - const n3 = e2.jPath ? i2.toString() : i2; - e2.isArray(h2, n3, s3) ? r2[h2] = [t3] : r2[h2] = t3; - } - void 0 !== h2 && h2 !== e2.textNodeName && n2.pop(); - } - } - } - return "string" == typeof s2 ? s2.length > 0 && (r2[e2.textNodeName] = s2) : void 0 !== s2 && (r2[e2.textNodeName] = s2), r2; - } - function St(t2) { - const e2 = Object.keys(t2); - for (let t3 = 0; t3 < e2.length; t3++) { - const n2 = e2[t3]; - if (":@" !== n2) return n2; - } - } - function _t(t2, e2, n2, i2) { - if (e2) { - const s2 = Object.keys(e2), r2 = s2.length; - for (let o2 = 0; o2 < r2; o2++) { - const r3 = s2[o2], a2 = r3.startsWith(i2.attributeNamePrefix) ? r3.substring(i2.attributeNamePrefix.length) : r3, h2 = i2.jPath ? n2.toString() + "." + a2 : n2; - i2.isArray(r3, h2, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; - } - } - } - function At(t2, e2) { - const { textNodeName: n2 } = e2, i2 = Object.keys(t2).length; - return 0 === i2 || !(1 !== i2 || !t2[n2] && "boolean" != typeof t2[n2] && 0 !== t2[n2]); - } - class Tt { - constructor(t2) { - this.externalEntities = {}, this.options = C(t2); - } - parse(t2, e2) { - if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); - else if ("string" != typeof t2) throw new Error("XML data is accepted in String or Bytes[] form."); - if (e2) { - true === e2 && (e2 = {}); - const n3 = l(t2, e2); - if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); - } - const n2 = new it(this.options); - n2.entityDecoder.setExternalEntities(this.externalEntities); - const i2 = n2.parseXml(t2); - return this.options.preserveOrder || void 0 === i2 ? i2 : wt(i2, this.options, n2.matcher, n2.readonlyMatcher); - } - addEntity(t2, e2) { - if (-1 !== e2.indexOf("&")) throw new Error("Entity value can't have '&'"); - if (-1 !== t2.indexOf("&") || -1 !== t2.indexOf(";")) throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - if ("&" === e2) throw new Error("An entity with value '&' is not permitted"); - this.externalEntities[t2] = e2; - } - static getMetaDataSymbol() { - return O.getMetaDataSymbol(); - } - } - function Ct(t2, e2) { - let n2 = ""; - e2.format && e2.indentBy.length > 0 && (n2 = "\n"); - const i2 = []; - if (e2.stopNodes && Array.isArray(e2.stopNodes)) for (let t3 = 0; t3 < e2.stopNodes.length; t3++) { - const n3 = e2.stopNodes[t3]; - "string" == typeof n3 ? i2.push(new G(n3)) : n3 instanceof G && i2.push(n3); - } - return Pt(t2, e2, n2, new R(), i2); - } - function Pt(t2, e2, n2, i2, s2) { - let r2 = "", o2 = false; - if (e2.maxNestedTags && i2.getDepth() > e2.maxNestedTags) throw new Error("Maximum nested tags exceeded"); - if (!Array.isArray(t2)) { - if (null != t2) { - let n3 = t2.toString(); - return n3 = Vt(n3, e2), n3; - } - return ""; - } - for (let a2 = 0; a2 < t2.length; a2++) { - const h2 = t2[a2], l2 = Dt(h2); - if (void 0 === l2) continue; - const u2 = Ot(h2[":@"], e2); - i2.push(l2, u2); - const p2 = jt(i2, s2); - if (l2 === e2.textNodeName) { - let t3 = h2[l2]; - p2 || (t3 = e2.tagValueProcessor(l2, t3), t3 = Vt(t3, e2)), o2 && (r2 += n2), r2 += t3, o2 = false, i2.pop(); - continue; - } - if (l2 === e2.cdataPropName) { - o2 && (r2 += n2); - const t3 = h2[l2][0][e2.textNodeName]; - r2 += `/g, "]]]]>")}]]>`, o2 = false, i2.pop(); - continue; - } - if (l2 === e2.commentPropName) { - const t3 = h2[l2][0][e2.textNodeName]; - r2 += n2 + ``, o2 = true, i2.pop(); - continue; - } - if ("?" === l2[0]) { - const t3 = Mt(h2[":@"], e2, p2), s3 = "?xml" === l2 ? "" : n2; - let a3 = h2[l2][0][e2.textNodeName]; - a3 = 0 !== a3.length ? " " + a3 : "", r2 += s3 + `<${l2}${a3}${t3}?>`, o2 = true, i2.pop(); - continue; - } - let c2 = n2; - "" !== c2 && (c2 += e2.indentBy); - const d2 = n2 + `<${l2}${Mt(h2[":@"], e2, p2)}`; - let f2; - f2 = p2 ? $t(h2[l2], e2) : Pt(h2[l2], e2, c2, i2, s2), -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? r2 += d2 + ">" : r2 += d2 + "/>" : f2 && 0 !== f2.length || !e2.suppressEmptyNode ? f2 && f2.endsWith(">") ? r2 += d2 + `>${f2}${n2}` : (r2 += d2 + ">", f2 && "" !== n2 && (f2.includes("/>") || f2.includes("`) : r2 += d2 + "/>", o2 = true, i2.pop(); - } - return r2; - } - function Ot(t2, e2) { - if (!t2 || e2.ignoreAttributes) return null; - const n2 = {}; - let i2 = false; - for (let s2 in t2) Object.prototype.hasOwnProperty.call(t2, s2) && (n2[s2.startsWith(e2.attributeNamePrefix) ? s2.substr(e2.attributeNamePrefix.length) : s2] = t2[s2], i2 = true); - return i2 ? n2 : null; - } - function $t(t2, e2) { - if (!Array.isArray(t2)) return null != t2 ? t2.toString() : ""; - let n2 = ""; - for (let i2 = 0; i2 < t2.length; i2++) { - const s2 = t2[i2], r2 = Dt(s2); - if (r2 === e2.textNodeName) n2 += s2[r2]; - else if (r2 === e2.cdataPropName) n2 += s2[r2][0][e2.textNodeName]; - else if (r2 === e2.commentPropName) n2 += s2[r2][0][e2.textNodeName]; - else { - if (r2 && "?" === r2[0]) continue; - if (r2) { - const t3 = It(s2[":@"], e2), i3 = $t(s2[r2], e2); - i3 && 0 !== i3.length ? n2 += `<${r2}${t3}>${i3}` : n2 += `<${r2}${t3}/>`; - } - } - } - return n2; - } - function It(t2, e2) { - let n2 = ""; - if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; - let s2 = t2[i2]; - true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; - } - return n2; - } - function Dt(t2) { - const e2 = Object.keys(t2); - for (let n2 = 0; n2 < e2.length; n2++) { - const i2 = e2[n2]; - if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; - } - } - function Mt(t2, e2, n2) { - let i2 = ""; - if (t2 && !e2.ignoreAttributes) for (let s2 in t2) { - if (!Object.prototype.hasOwnProperty.call(t2, s2)) continue; - let r2; - n2 ? r2 = t2[s2] : (r2 = e2.attributeValueProcessor(s2, t2[s2]), r2 = Vt(r2, e2)), true === r2 && e2.suppressBooleanAttributes ? i2 += ` ${s2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${s2.substr(e2.attributeNamePrefix.length)}="${r2}"`; - } - return i2; - } - function jt(t2, e2) { - if (!e2 || 0 === e2.length) return false; - for (let n2 = 0; n2 < e2.length; n2++) if (t2.matches(e2[n2])) return true; - return false; - } - function Vt(t2, e2) { - if (t2 && t2.length > 0 && e2.processEntities) for (let n2 = 0; n2 < e2.entities.length; n2++) { - const i2 = e2.entities[n2]; - t2 = t2.replace(i2.regex, i2.val); - } - return t2; - } - const Lt = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { - return e2; - }, attributeValueProcessor: function(t2, e2) { - return e2; - }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: true, stopNodes: [], oneListGroup: false, maxNestedTags: 100, jPath: true }; - function kt(t2) { - if (this.options = Object.assign({}, Lt, t2), this.options.stopNodes && Array.isArray(this.options.stopNodes) && (this.options.stopNodes = this.options.stopNodes.map((t3) => "string" == typeof t3 && t3.startsWith("*.") ? ".." + t3.substring(2) : t3)), this.stopNodeExpressions = [], this.options.stopNodes && Array.isArray(this.options.stopNodes)) for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { - const e3 = this.options.stopNodes[t3]; - "string" == typeof e3 ? this.stopNodeExpressions.push(new G(e3)) : e3 instanceof G && this.stopNodeExpressions.push(e3); - } - var e2; - true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { - return false; - } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { - for (const n2 of e2) { - if ("string" == typeof n2 && t3 === n2) return true; - if (n2 instanceof RegExp && n2.test(t3)) return true; - } - } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Gt), this.processTextOrObjNode = Ft, this.options.format ? (this.indentate = Rt, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { - return ""; - }, this.tagEndChar = ">", this.newLine = ""); - } - function Ft(t2, e2, n2, i2) { - const s2 = this.extractAttributes(t2); - if (i2.push(e2, s2), this.checkStopNode(i2)) { - const s3 = this.buildRawContent(t2), r3 = this.buildAttributesForStopNode(t2); - return i2.pop(), this.buildObjectNode(s3, e2, r3, n2); - } - const r2 = this.j2x(t2, n2 + 1, i2); - return i2.pop(), void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, r2.attrStr, n2, i2) : this.buildObjectNode(r2.val, e2, r2.attrStr, n2); - } - function Rt(t2) { - return this.options.indentBy.repeat(t2); - } - function Gt(t2) { - return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); - } - kt.prototype.build = function(t2) { - if (this.options.preserveOrder) return Ct(t2, this.options); - { - Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }); - const e2 = new R(); - return this.j2x(t2, 0, e2).val; - } - }, kt.prototype.j2x = function(t2, e2, n2) { - let i2 = "", s2 = ""; - if (this.options.maxNestedTags && n2.getDepth() >= this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); - const r2 = this.options.jPath ? n2.toString() : n2, o2 = this.checkStopNode(n2); - for (let a2 in t2) if (Object.prototype.hasOwnProperty.call(t2, a2)) if (void 0 === t2[a2]) this.isAttribute(a2) && (s2 += ""); - else if (null === t2[a2]) this.isAttribute(a2) || a2 === this.options.cdataPropName ? s2 += "" : "?" === a2[0] ? s2 += this.indentate(e2) + "<" + a2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + a2 + "/" + this.tagEndChar; - else if (t2[a2] instanceof Date) s2 += this.buildTextValNode(t2[a2], a2, "", e2, n2); - else if ("object" != typeof t2[a2]) { - const h2 = this.isAttribute(a2); - if (h2 && !this.ignoreAttributesFn(h2, r2)) i2 += this.buildAttrPairStr(h2, "" + t2[a2], o2); - else if (!h2) if (a2 === this.options.textNodeName) { - let e3 = this.options.tagValueProcessor(a2, "" + t2[a2]); - s2 += this.replaceEntitiesValue(e3); - } else { - n2.push(a2); - const i3 = this.checkStopNode(n2); - if (n2.pop(), i3) { - const n3 = "" + t2[a2]; - s2 += "" === n3 ? this.indentate(e2) + "<" + a2 + this.closeTag(a2) + this.tagEndChar : this.indentate(e2) + "<" + a2 + ">" + n3 + "" + t4 + "${t3}`; - else if ("object" == typeof t3 && null !== t3) { - const i3 = this.buildRawContent(t3), s2 = this.buildAttributesForStopNode(t3); - e2 += "" === i3 ? `<${n2}${s2}/>` : `<${n2}${s2}>${i3}`; - } - } else if ("object" == typeof i2 && null !== i2) { - const t3 = this.buildRawContent(i2), s2 = this.buildAttributesForStopNode(i2); - e2 += "" === t3 ? `<${n2}${s2}/>` : `<${n2}${s2}>${t3}`; - } else e2 += `<${n2}>${i2}`; - } - return e2; - }, kt.prototype.buildAttributesForStopNode = function(t2) { - if (!t2 || "object" != typeof t2) return ""; - let e2 = ""; - if (this.options.attributesGroupName && t2[this.options.attributesGroupName]) { - const n2 = t2[this.options.attributesGroupName]; - for (let t3 in n2) { - if (!Object.prototype.hasOwnProperty.call(n2, t3)) continue; - const i2 = t3.startsWith(this.options.attributeNamePrefix) ? t3.substring(this.options.attributeNamePrefix.length) : t3, s2 = n2[t3]; - true === s2 && this.options.suppressBooleanAttributes ? e2 += " " + i2 : e2 += " " + i2 + '="' + s2 + '"'; - } - } else for (let n2 in t2) { - if (!Object.prototype.hasOwnProperty.call(t2, n2)) continue; - const i2 = this.isAttribute(n2); - if (i2) { - const s2 = t2[n2]; - true === s2 && this.options.suppressBooleanAttributes ? e2 += " " + i2 : e2 += " " + i2 + '="' + s2 + '"'; - } - } - return e2; - }, kt.prototype.buildObjectNode = function(t2, e2, n2, i2) { - if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; - { - let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; - } - }, kt.prototype.closeTag = function(t2) { - let e2 = ""; - return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>/g, "]]]]>"); - return this.indentate(i2) + `` + this.newLine; - } - if (false !== this.options.commentPropName && e2 === this.options.commentPropName) { - const e3 = String(t2).replace(/--/g, "- -").replace(/-$/, "- "); - return this.indentate(i2) + `` + this.newLine; - } - if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; - { - let s3 = this.options.tagValueProcessor(e2, t2); - return s3 = this.replaceEntitiesValue(s3), "" === s3 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s3 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { - const n2 = this.options.entities[e2]; - t2 = t2.replace(n2.regex, n2.val); - } - return t2; - }; - const Bt = kt, Ut = { validate: l }; - module2.exports = e; - })(); - } -}); - -// node_modules/@azure/core-xml/dist/commonjs/xml.common.js -var require_xml_common = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.common.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; - } -}); - -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a2; - return { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a2 = options.xmlCharKey) !== null && _a2 !== void 0 ? _a2 : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false - }; - } - function getSerializerOptions(options = {}) { - var _a2, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a2 = options.rootName) !== null && _a2 !== void 0 ? _a2 : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); - } - function getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true, trimValues: false }); - } - function stringifyXML(obj, opts = {}) { - const parserOptions = getSerializerOptions(opts); - const j2x = new fast_xml_parser_1.XMLBuilder(parserOptions); - const node = { [parserOptions.rootNodeName]: obj }; - const xmlData = j2x.build(node); - return `${xmlData}`.replace(/\n/g, ""); - } - async function parseXML(str, opts = {}) { - if (!str) { - throw new Error("Document is empty"); - } - const validation = fast_xml_parser_1.XMLValidator.validate(str); - if (validation !== true) { - throw validation; - } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; - } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; - } - } - return parsedXml; - } - } -}); - -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs10 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.XML_CHARKEY = exports2.XML_ATTRKEY = exports2.parseXML = exports2.stringifyXML = void 0; - var xml_js_1 = require_xml(); - Object.defineProperty(exports2, "stringifyXML", { enumerable: true, get: function() { - return xml_js_1.stringifyXML; - } }); - Object.defineProperty(exports2, "parseXML", { enumerable: true, get: function() { - return xml_js_1.parseXML; - } }); - var xml_common_js_1 = require_xml_common(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return xml_common_js_1.XML_ATTRKEY; - } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return xml_common_js_1.XML_CHARKEY; - } }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/log.js -var require_log5 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/log.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_1 = require_commonjs2(); - exports2.logger = (0, logger_1.createClientLogger)("storage-blob"); - } -}); - -// node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError3 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs11 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/RequestPolicy.js -var require_RequestPolicy = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/RequestPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BaseRequestPolicy = void 0; - var BaseRequestPolicy = class { - _nextPolicy; - _options; - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; - } - /** - * Get whether or not a log with the provided log level should be logged. - * @param logLevel - The log level of the log that will be logged. - * @returns Whether or not a log with the provided log level should be logged. - */ - shouldLog(logLevel) { - return this._options.shouldLog(logLevel); - } - /** - * Attempt to log the provided message to the provided logger. If no logger was provided or if - * the log level does not meat the logger's threshold, then nothing will be logged. - * @param logLevel - The log level of this log. - * @param message - The message of this log. - */ - log(logLevel, message) { - this._options.log(logLevel, message); - } - }; - exports2.BaseRequestPolicy = BaseRequestPolicy; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/constants.js -var require_constants10 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PathStylePorts = exports2.BlobDoesNotUseCustomerSpecifiedEncryption = exports2.BlobUsesCustomerSpecifiedEncryptionMsg = exports2.StorageBlobLoggingAllowedQueryParameters = exports2.StorageBlobLoggingAllowedHeaderNames = exports2.DevelopmentConnectionString = exports2.EncryptionAlgorithmAES25 = exports2.HTTP_VERSION_1_1 = exports2.HTTP_LINE_ENDING = exports2.BATCH_MAX_PAYLOAD_IN_BYTES = exports2.BATCH_MAX_REQUEST = exports2.SIZE_1_MB = exports2.ETagAny = exports2.ETagNone = exports2.HeaderConstants = exports2.HTTPURLConnection = exports2.URLConstants = exports2.StorageOAuthScopes = exports2.REQUEST_TIMEOUT = exports2.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = exports2.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = exports2.DEFAULT_BLOCK_BUFFER_SIZE_BYTES = exports2.BLOCK_BLOB_MAX_BLOCKS = exports2.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = exports2.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = exports2.SERVICE_VERSION = exports2.SDK_VERSION = void 0; - exports2.SDK_VERSION = "12.29.1"; - exports2.SERVICE_VERSION = "2025-11-05"; - exports2.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - exports2.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - exports2.BLOCK_BLOB_MAX_BLOCKS = 5e4; - exports2.DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - exports2.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - exports2.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - exports2.REQUEST_TIMEOUT = 100 * 1e3; - exports2.StorageOAuthScopes = "https://storage.azure.com/.default"; - exports2.URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" - } - }; - exports2.HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - exports2.HeaderConstants = { - AUTHORIZATION: "Authorization", - AUTHORIZATION_SCHEME: "Bearer", - CONTENT_ENCODING: "Content-Encoding", - CONTENT_ID: "Content-ID", - CONTENT_LANGUAGE: "Content-Language", - CONTENT_LENGTH: "Content-Length", - CONTENT_MD5: "Content-Md5", - CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding", - CONTENT_TYPE: "Content-Type", - COOKIE: "Cookie", - DATE: "date", - IF_MATCH: "if-match", - IF_MODIFIED_SINCE: "if-modified-since", - IF_NONE_MATCH: "if-none-match", - IF_UNMODIFIED_SINCE: "if-unmodified-since", - PREFIX_FOR_STORAGE: "x-ms-", - RANGE: "Range", - USER_AGENT: "User-Agent", - X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id", - X_MS_COPY_SOURCE: "x-ms-copy-source", - X_MS_DATE: "x-ms-date", - X_MS_ERROR_CODE: "x-ms-error-code", - X_MS_VERSION: "x-ms-version", - X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code" - }; - exports2.ETagNone = ""; - exports2.ETagAny = "*"; - exports2.SIZE_1_MB = 1 * 1024 * 1024; - exports2.BATCH_MAX_REQUEST = 256; - exports2.BATCH_MAX_PAYLOAD_IN_BYTES = 4 * exports2.SIZE_1_MB; - exports2.HTTP_LINE_ENDING = "\r\n"; - exports2.HTTP_VERSION_1_1 = "HTTP/1.1"; - exports2.EncryptionAlgorithmAES25 = "AES256"; - exports2.DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - exports2.StorageBlobLoggingAllowedHeaderNames = [ - "Access-Control-Allow-Origin", - "Cache-Control", - "Content-Length", - "Content-Type", - "Date", - "Request-Id", - "traceparent", - "Transfer-Encoding", - "User-Agent", - "x-ms-client-request-id", - "x-ms-date", - "x-ms-error-code", - "x-ms-request-id", - "x-ms-return-client-request-id", - "x-ms-version", - "Accept-Ranges", - "Content-Disposition", - "Content-Encoding", - "Content-Language", - "Content-MD5", - "Content-Range", - "ETag", - "Last-Modified", - "Server", - "Vary", - "x-ms-content-crc64", - "x-ms-copy-action", - "x-ms-copy-completion-time", - "x-ms-copy-id", - "x-ms-copy-progress", - "x-ms-copy-status", - "x-ms-has-immutability-policy", - "x-ms-has-legal-hold", - "x-ms-lease-state", - "x-ms-lease-status", - "x-ms-range", - "x-ms-request-server-encrypted", - "x-ms-server-encrypted", - "x-ms-snapshot", - "x-ms-source-range", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Unmodified-Since", - "x-ms-access-tier", - "x-ms-access-tier-change-time", - "x-ms-access-tier-inferred", - "x-ms-account-kind", - "x-ms-archive-status", - "x-ms-blob-append-offset", - "x-ms-blob-cache-control", - "x-ms-blob-committed-block-count", - "x-ms-blob-condition-appendpos", - "x-ms-blob-condition-maxsize", - "x-ms-blob-content-disposition", - "x-ms-blob-content-encoding", - "x-ms-blob-content-language", - "x-ms-blob-content-length", - "x-ms-blob-content-md5", - "x-ms-blob-content-type", - "x-ms-blob-public-access", - "x-ms-blob-sequence-number", - "x-ms-blob-type", - "x-ms-copy-destination-snapshot", - "x-ms-creation-time", - "x-ms-default-encryption-scope", - "x-ms-delete-snapshots", - "x-ms-delete-type-permanent", - "x-ms-deny-encryption-scope-override", - "x-ms-encryption-algorithm", - "x-ms-if-sequence-number-eq", - "x-ms-if-sequence-number-le", - "x-ms-if-sequence-number-lt", - "x-ms-incremental-copy", - "x-ms-lease-action", - "x-ms-lease-break-period", - "x-ms-lease-duration", - "x-ms-lease-id", - "x-ms-lease-time", - "x-ms-page-write", - "x-ms-proposed-lease-id", - "x-ms-range-get-content-md5", - "x-ms-rehydrate-priority", - "x-ms-sequence-number-action", - "x-ms-sku-name", - "x-ms-source-content-md5", - "x-ms-source-if-match", - "x-ms-source-if-modified-since", - "x-ms-source-if-none-match", - "x-ms-source-if-unmodified-since", - "x-ms-tag-count", - "x-ms-encryption-key-sha256", - "x-ms-copy-source-error-code", - "x-ms-copy-source-status-code", - "x-ms-if-tags", - "x-ms-source-if-tags" - ]; - exports2.StorageBlobLoggingAllowedQueryParameters = [ - "comp", - "maxresults", - "rscc", - "rscd", - "rsce", - "rscl", - "rsct", - "se", - "si", - "sip", - "sp", - "spr", - "sr", - "srt", - "ss", - "st", - "sv", - "include", - "marker", - "prefix", - "copyid", - "restype", - "blockid", - "blocklisttype", - "delimiter", - "prevsnapshot", - "ske", - "skoid", - "sks", - "skt", - "sktid", - "skv", - "snapshot" - ]; - exports2.BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - exports2.BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - exports2.PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.common.js -var require_utils_common = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/utils.common.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.escapeURLPath = escapeURLPath; - exports2.getValueInConnString = getValueInConnString; - exports2.extractConnectionStringParts = extractConnectionStringParts; - exports2.appendToURLPath = appendToURLPath; - exports2.setURLParameter = setURLParameter; - exports2.getURLParameter = getURLParameter; - exports2.setURLHost = setURLHost; - exports2.getURLPath = getURLPath; - exports2.getURLScheme = getURLScheme; - exports2.getURLPathAndQuery = getURLPathAndQuery; - exports2.getURLQueries = getURLQueries; - exports2.appendToURLQuery = appendToURLQuery; - exports2.truncatedISO8061Date = truncatedISO8061Date; - exports2.base64encode = base64encode; - exports2.base64decode = base64decode; - exports2.generateBlockID = generateBlockID; - exports2.delay = delay2; - exports2.padStart = padStart2; - exports2.sanitizeURL = sanitizeURL; - exports2.sanitizeHeaders = sanitizeHeaders; - exports2.iEqual = iEqual; - exports2.getAccountNameFromUrl = getAccountNameFromUrl; - exports2.isIpEndpointStyle = isIpEndpointStyle; - exports2.toBlobTagsString = toBlobTagsString; - exports2.toBlobTags = toBlobTags; - exports2.toTags = toTags; - exports2.toQuerySerialization = toQuerySerialization; - exports2.parseObjectReplicationRecord = parseObjectReplicationRecord; - exports2.attachCredential = attachCredential; - exports2.httpAuthorizationToString = httpAuthorizationToString; - exports2.BlobNameToString = BlobNameToString; - exports2.ConvertInternalResponseOfListBlobFlat = ConvertInternalResponseOfListBlobFlat; - exports2.ConvertInternalResponseOfListBlobHierarchy = ConvertInternalResponseOfListBlobHierarchy; - exports2.ExtractPageRangeInfoItems = ExtractPageRangeInfoItems; - exports2.EscapePath = EscapePath; - exports2.assertResponse = assertResponse; - var core_rest_pipeline_1 = require_commonjs6(); - var core_util_1 = require_commonjs4(); - var constants_js_1 = require_constants10(); - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path30 = urlParsed.pathname; - path30 = path30 || "/"; - path30 = escape3(path30); - urlParsed.pathname = path30; - return urlParsed.toString(); - } - function getProxyUriFromDevConnString(connectionString) { - let proxyUri = ""; - if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) { - const matchCredentials = connectionString.split(";"); - for (const element of matchCredentials) { - if (element.trim().startsWith("DevelopmentStorageProxyUri=")) { - proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1]; - } - } - } - return proxyUri; - } - function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; - } - } - return ""; - } - function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = constants_js_1.DevelopmentConnectionString; - } - let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); - blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; - if (connectionString.search("DefaultEndpointsProtocol=") !== -1 && connectionString.search("AccountKey=") !== -1) { - let defaultEndpointsProtocol = ""; - let accountName = ""; - let accountKey = Buffer.from("accountKey", "base64"); - let endpointSuffix = ""; - accountName = getValueInConnString(connectionString, "AccountName"); - accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64"); - if (!blobEndpoint) { - defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol"); - const protocol = defaultEndpointsProtocol.toLowerCase(); - if (protocol !== "https" && protocol !== "http") { - throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"); - } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); - } - blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; - } - if (!accountName) { - throw new Error("Invalid AccountName in the provided Connection String"); - } else if (accountKey.length === 0) { - throw new Error("Invalid AccountKey in the provided Connection String"); - } - return { - kind: "AccountConnString", - url: blobEndpoint, - accountName, - accountKey, - proxyUri - }; - } else { - let accountSas = getValueInConnString(connectionString, "SharedAccessSignature"); - let accountName = getValueInConnString(connectionString, "AccountName"); - if (!accountName) { - accountName = getAccountNameFromUrl(blobEndpoint); - } - if (!blobEndpoint) { - throw new Error("Invalid BlobEndpoint in the provided SAS Connection String"); - } else if (!accountSas) { - throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String"); - } - if (accountSas.startsWith("?")) { - accountSas = accountSas.substring(1); - } - return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas }; - } - } - function escape3(text) { - return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); - } - function appendToURLPath(url2, name) { - const urlParsed = new URL(url2); - let path30 = urlParsed.pathname; - path30 = path30 ? path30.endsWith("/") ? `${path30}${name}` : `${path30}/${name}` : name; - urlParsed.pathname = path30; - return urlParsed.toString(); - } - function setURLParameter(url2, name, value) { - const urlParsed = new URL(url2); - const encodedName = encodeURIComponent(name); - const encodedValue = value ? encodeURIComponent(value) : void 0; - const searchString = urlParsed.search === "" ? "?" : urlParsed.search; - const searchPieces = []; - for (const pair of searchString.slice(1).split("&")) { - if (pair) { - const [key] = pair.split("=", 2); - if (key !== encodedName) { - searchPieces.push(pair); - } - } - } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); - } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url2, name) { - const urlParsed = new URL(url2); - return urlParsed.searchParams.get(name) ?? void 0; - } - function setURLHost(url2, host) { - const urlParsed = new URL(url2); - urlParsed.hostname = host; - return urlParsed.toString(); - } - function getURLPath(url2) { - try { - const urlParsed = new URL(url2); - return urlParsed.pathname; - } catch (e) { - return void 0; - } - } - function getURLScheme(url2) { - try { - const urlParsed = new URL(url2); - return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; - } catch (e) { - return void 0; - } - } - function getURLPathAndQuery(url2) { - const urlParsed = new URL(url2); - const pathString = urlParsed.pathname; - if (!pathString) { - throw new RangeError("Invalid url without valid path."); - } - let queryString = urlParsed.search || ""; - queryString = queryString.trim(); - if (queryString !== "") { - queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; - } - return `${pathString}${queryString}`; - } - function getURLQueries(url2) { - let queryString = new URL(url2).search; - if (!queryString) { - return {}; - } - queryString = queryString.trim(); - queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString; - let querySubStrings = queryString.split("&"); - querySubStrings = querySubStrings.filter((value) => { - const indexOfEqual = value.indexOf("="); - const lastIndexOfEqual = value.lastIndexOf("="); - return indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1; - }); - const queries = {}; - for (const querySubString of querySubStrings) { - const splitResults = querySubString.split("="); - const key = splitResults[0]; - const value = splitResults[1]; - queries[key] = value; - } - return queries; - } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; - } - urlParsed.search = query; - return urlParsed.toString(); - } - function truncatedISO8061Date(date, withMilliseconds = true) { - const dateString = date.toISOString(); - return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z"; - } - function base64encode(content) { - return !core_util_1.isNodeLike ? btoa(content) : Buffer.from(content).toString("base64"); - } - function base64decode(encodedString) { - return !core_util_1.isNodeLike ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); - } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); - } - const res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve14, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve14(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== void 0) { - aborter.addEventListener("abort", abortHandler); - } - }); - } - function padStart2(currentString, targetLength, padString = " ") { - if (String.prototype.padStart) { - return currentString.padStart(targetLength, padString); - } - padString = padString || " "; - if (currentString.length > targetLength) { - return currentString; - } else { - targetLength = targetLength - currentString.length; - if (targetLength > padString.length) { - padString += padString.repeat(targetLength / padString.length); - } - return padString.slice(0, targetLength) + currentString; - } - } - function sanitizeURL(url2) { - let safeURL = url2; - if (getURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE)) { - safeURL = setURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE, "*****"); - } - return safeURL; - } - function sanitizeHeaders(originalHeader) { - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(); - for (const [name, value] of originalHeader) { - if (name.toLowerCase() === constants_js_1.HeaderConstants.AUTHORIZATION.toLowerCase()) { - headers.set(name, "*****"); - } else if (name.toLowerCase() === constants_js_1.HeaderConstants.X_MS_COPY_SOURCE) { - headers.set(name, sanitizeURL(value)); - } else { - headers.set(name, value); - } - } - return headers; - } - function iEqual(str1, str2) { - return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); - } - function getAccountNameFromUrl(url2) { - const parsedUrl = new URL(url2); - let accountName; - try { - if (parsedUrl.hostname.split(".")[1] === "blob") { - accountName = parsedUrl.hostname.split(".")[0]; - } else if (isIpEndpointStyle(parsedUrl)) { - accountName = parsedUrl.pathname.split("/")[1]; - } else { - accountName = ""; - } - return accountName; - } catch (error3) { - throw new Error("Unable to extract accountName with provided information."); - } - } - function isIpEndpointStyle(parsedUrl) { - const host = parsedUrl.host; - return /^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) || Boolean(parsedUrl.port) && constants_js_1.PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags) { - if (tags === void 0) { - return void 0; - } - const tagPairs = []; - for (const key in tags) { - if (Object.prototype.hasOwnProperty.call(tags, key)) { - const value = tags[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); - } - } - return tagPairs.join("&"); - } - function toBlobTags(tags) { - if (tags === void 0) { - return void 0; - } - const res = { - blobTagSet: [] - }; - for (const key in tags) { - if (Object.prototype.hasOwnProperty.call(tags, key)) { - const value = tags[key]; - res.blobTagSet.push({ - key, - value - }); - } - } - return res; - } - function toTags(tags) { - if (tags === void 0) { - return void 0; - } - const res = {}; - for (const blobTag of tags.blobTagSet) { - res[blobTag.key] = blobTag.value; - } - return res; - } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; - } - switch (textConfiguration.kind) { - case "csv": - return { - format: { - type: "delimited", - delimitedTextConfiguration: { - columnSeparator: textConfiguration.columnSeparator || ",", - fieldQuote: textConfiguration.fieldQuote || "", - recordSeparator: textConfiguration.recordSeparator, - escapeChar: textConfiguration.escapeCharacter || "", - headersPresent: textConfiguration.hasHeaders || false - } - } - }; - case "json": - return { - format: { - type: "json", - jsonTextConfiguration: { - recordSeparator: textConfiguration.recordSeparator - } - } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } - } - }; - case "parquet": - return { - format: { - type: "parquet" - } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); - } - } - function parseObjectReplicationRecord(objectReplicationRecord) { - if (!objectReplicationRecord) { - return void 0; - } - if ("policy-id" in objectReplicationRecord) { - return void 0; - } - const orProperties = []; - for (const key in objectReplicationRecord) { - const ids = key.split("_"); - const policyPrefix = "or-"; - if (ids[0].startsWith(policyPrefix)) { - ids[0] = ids[0].substring(policyPrefix.length); - } - const rule = { - ruleId: ids[1], - replicationStatus: objectReplicationRecord[key] - }; - const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]); - if (policyIndex > -1) { - orProperties[policyIndex].rules.push(rule); - } else { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); - } - } - return orProperties; - } - function attachCredential(thing, credential) { - thing.credential = credential; - return thing; - } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; - } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; - } - } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return { - ...internalResponse, - segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = { - ...blobItemInteral, - name: BlobNameToString(blobItemInteral.name) - }; - return blobItem; - }) - } - }; - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - return { - ...internalResponse, - segment: { - blobPrefixes: internalResponse.segment.blobPrefixes?.map((blobPrefixInternal) => { - const blobPrefix = { - ...blobPrefixInternal, - name: BlobNameToString(blobPrefixInternal.name) - }; - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = { - ...blobItemInteral, - name: BlobNameToString(blobItemInteral.name) - }; - return blobItem; - }) - } - }; - } - function* ExtractPageRangeInfoItems(getPageRangesSegment) { - let pageRange = []; - let clearRange = []; - if (getPageRangesSegment.pageRange) - pageRange = getPageRangesSegment.pageRange; - if (getPageRangesSegment.clearRange) - clearRange = getPageRangesSegment.clearRange; - let pageRangeIndex = 0; - let clearRangeIndex = 0; - while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) { - if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) { - yield { - start: pageRange[pageRangeIndex].start, - end: pageRange[pageRangeIndex].end, - isClear: false - }; - ++pageRangeIndex; - } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; - } - } - for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) { - yield { - start: pageRange[pageRangeIndex].start, - end: pageRange[pageRangeIndex].end, - isClear: false - }; - } - for (; clearRangeIndex < clearRange.length; ++clearRangeIndex) { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - } - } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); - } - return split.join("/"); - } - function assertResponse(response) { - if (`_response` in response) { - return response; - } - throw new TypeError(`Unexpected response object ${response}`); - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicyType.js -var require_StorageRetryPolicyType = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicyType.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageRetryPolicyType = void 0; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (exports2.StorageRetryPolicyType = StorageRetryPolicyType = {})); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicy.js -var require_StorageRetryPolicy = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageRetryPolicy = void 0; - exports2.NewRetryPolicyFactory = NewRetryPolicyFactory; - var abort_controller_1 = require_commonjs11(); - var RequestPolicy_js_1 = require_RequestPolicy(); - var constants_js_1 = require_constants10(); - var utils_common_js_1 = require_utils_common(); - var log_js_1 = require_log5(); - var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType(); - function NewRetryPolicyFactory(retryOptions) { - return { - create: (nextPolicy, options) => { - return new StorageRetryPolicy(nextPolicy, options, retryOptions); - } - }; - } - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { - /** - * RetryOptions. - */ - retryOptions; - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS.secondaryHost - }; - } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request3) { - return this.attemptSendRequest(request3, false, 1); - } - /** - * Decide and perform next retry. Won't mutate request parameter. - * - * @param request - - * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then - * the resource was not found. This may be due to replication delay. So, in this - * case, we'll never try the secondary again for this operation. - * @param attempt - How many retries has been attempted to performed, starting from 1, which includes - * the attempt will be performed by this method call. - */ - async attemptSendRequest(request3, secondaryHas404, attempt) { - const newRequest = request3.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request3.method === "GET" || request3.method === "HEAD" || request3.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = (0, utils_common_js_1.setURLHost)(newRequest.url, this.retryOptions.secondaryHost); - } - if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = (0, utils_common_js_1.setURLParameter)(newRequest.url, constants_js_1.URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); - } - let response; - try { - log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; - } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (err) { - log_js_1.logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw err; - } - } - await this.delay(isPrimaryRetry, attempt, request3.abortSignal); - return this.attemptSendRequest(request3, secondaryHas404, ++attempt); - } - /** - * Decide whether to retry according to last HTTP response and retry counters. - * - * @param isPrimaryRetry - - * @param attempt - - * @param response - - * @param err - - */ - shouldRetry(isPrimaryRetry, attempt, response, err) { - if (attempt >= this.retryOptions.maxTries) { - log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; - } - const retriableErrors = [ - "ETIMEDOUT", - "ESOCKETTIMEDOUT", - "ECONNREFUSED", - "ECONNRESET", - "ENOENT", - "ENOTFOUND", - "TIMEOUT", - "EPIPE", - "REQUEST_SEND_ERROR" - // For default xhr based http client provided in ms-rest-js - ]; - if (err) { - for (const retriableError of retriableErrors) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; - } - } - } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - if (response) { - if (response?.status >= 400) { - const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode); - if (copySourceError !== void 0) { - switch (copySourceError) { - case "InternalError": - case "OperationTimedOut": - case "ServerBusy": - return true; - } - } - } - } - if (err?.code === "PARSE_ERROR" && err?.message.startsWith(`Error "Error: Unclosed root tag`)) { - log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - return false; - } - /** - * Delay a calculated time between retries. - * - * @param isPrimaryRetry - - * @param attempt - - * @param abortSignal - - */ - async delay(isPrimaryRetry, attempt, abortSignal) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (this.retryOptions.retryPolicyType) { - case StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case StorageRetryPolicyType_js_1.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; - } - log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return (0, utils_common_js_1.delay)(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); - } - }; - exports2.StorageRetryPolicy = StorageRetryPolicy; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/StorageRetryPolicyFactory.js -var require_StorageRetryPolicyFactory = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/StorageRetryPolicyFactory.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageRetryPolicyFactory = exports2.StorageRetryPolicy = exports2.StorageRetryPolicyType = void 0; - var StorageRetryPolicy_js_1 = require_StorageRetryPolicy(); - Object.defineProperty(exports2, "StorageRetryPolicy", { enumerable: true, get: function() { - return StorageRetryPolicy_js_1.StorageRetryPolicy; - } }); - var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType(); - Object.defineProperty(exports2, "StorageRetryPolicyType", { enumerable: true, get: function() { - return StorageRetryPolicyType_js_1.StorageRetryPolicyType; - } }); - var StorageRetryPolicyFactory = class { - retryOptions; - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; - } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy_js_1.StorageRetryPolicy(nextPolicy, options, this.retryOptions); - } - }; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/CredentialPolicy.js -var require_CredentialPolicy = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/CredentialPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CredentialPolicy = void 0; - var RequestPolicy_js_1 = require_RequestPolicy(); - var CredentialPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request3) { - return this._nextPolicy.sendRequest(this.signRequest(request3)); - } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request3) { - return request3; - } - }; - exports2.CredentialPolicy = CredentialPolicy; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/SharedKeyComparator.js -var require_SharedKeyComparator = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/SharedKeyComparator.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.compareHeader = compareHeader; - var table_lv0 = new Uint32Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1820, - 0, - 1823, - 1825, - 1827, - 1829, - 0, - 0, - 0, - 1837, - 2051, - 0, - 0, - 1843, - 0, - 3331, - 3354, - 3356, - 3358, - 3360, - 3362, - 3364, - 3366, - 3368, - 3370, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 3586, - 3593, - 3594, - 3610, - 3617, - 3619, - 3621, - 3628, - 3634, - 3637, - 3638, - 3656, - 3665, - 3696, - 3708, - 3710, - 3721, - 3722, - 3729, - 3737, - 3743, - 3746, - 3748, - 3750, - 3751, - 3753, - 0, - 0, - 0, - 1859, - 1860, - 1864, - 3586, - 3593, - 3594, - 3610, - 3617, - 3619, - 3621, - 3628, - 3634, - 3637, - 3638, - 3656, - 3665, - 3696, - 3708, - 3710, - 3721, - 3722, - 3729, - 3737, - 3743, - 3746, - 3748, - 3750, - 3751, - 3753, - 0, - 1868, - 0, - 1872, - 0 - ]); - var table_lv2 = new Uint32Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); - var table_lv4 = new Uint32Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 32786, - 0, - 0, - 0, - 0, - 0, - 33298, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); - function compareHeader(lhs, rhs) { - if (isLessThan(lhs, rhs)) - return -1; - return 1; - } - function isLessThan(lhs, rhs) { - const tables = [table_lv0, table_lv2, table_lv4]; - let curr_level = 0; - let i = 0; - let j = 0; - while (curr_level < tables.length) { - if (curr_level === tables.length - 1 && i !== j) { - return i > j; - } - const weight1 = i < lhs.length ? tables[curr_level][lhs[i].charCodeAt(0)] : 1; - const weight2 = j < rhs.length ? tables[curr_level][rhs[j].charCodeAt(0)] : 1; - if (weight1 === 1 && weight2 === 1) { - i = 0; - j = 0; - ++curr_level; - } else if (weight1 === weight2) { - ++i; - ++j; - } else if (weight1 === 0) { - ++i; - } else if (weight2 === 0) { - ++j; - } else { - return weight1 < weight2; - } - } - return false; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js -var require_StorageSharedKeyCredentialPolicy = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageSharedKeyCredentialPolicy = void 0; - var constants_js_1 = require_constants10(); - var utils_common_js_1 = require_utils_common(); - var CredentialPolicy_js_1 = require_CredentialPolicy(); - var SharedKeyComparator_js_1 = require_SharedKeyComparator(); - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy_js_1.CredentialPolicy { - /** - * Reference to StorageSharedKeyCredential which generates StorageSharedKeyCredentialPolicy - */ - factory; - /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - - */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; - } - /** - * Signs request. - * - * @param request - - */ - signRequest(request3) { - request3.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request3.body && (typeof request3.body === "string" || request3.body !== void 0) && request3.body.length > 0) { - request3.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); - } - const stringToSign = [ - request3.method.toUpperCase(), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.DATE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request3) + this.getCanonicalizedResourceString(request3); - const signature = this.factory.computeHMACSHA256(stringToSign); - request3.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request3; - } - /** - * Retrieve header value according to shared key sign rules. - * @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request3, headerName) { - const value = request3.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; - } - return value; - } - /** - * To construct the CanonicalizedHeaders portion of the signature string, follow these steps: - * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header. - * 2. Convert each HTTP header name to lowercase. - * 3. Sort the headers lexicographically by header name, in ascending order. - * Each header may appear only once in the string. - * 4. Replace any linear whitespace in the header value with a single space. - * 5. Trim any whitespace around the colon in the header. - * 6. Finally, append a new-line character to each canonicalized header in the resulting list. - * Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string. - * - * @param request - - */ - getCanonicalizedHeadersString(request3) { - let headersArray = request3.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index2, array2) => { - if (index2 > 0 && value.name.toLowerCase() === array2[index2 - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; - } - /** - * Retrieves the webResource canonicalized resource string. - * - * @param request - - */ - getCanonicalizedResourceString(request3) { - const path30 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path30}`; - const queries = (0, utils_common_js_1.getURLQueries)(request3.url); - const lowercaseQueries = {}; - if (queries) { - const queryKeys = []; - for (const key in queries) { - if (Object.prototype.hasOwnProperty.call(queries, key)) { - const lowercaseKey = key.toLowerCase(); - lowercaseQueries[lowercaseKey] = queries[key]; - queryKeys.push(lowercaseKey); - } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - }; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/credentials/Credential.js -var require_Credential = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/credentials/Credential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Credential = void 0; - var Credential2 = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); - } - }; - exports2.Credential = Credential2; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/credentials/StorageSharedKeyCredential.js -var require_StorageSharedKeyCredential = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/credentials/StorageSharedKeyCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageSharedKeyCredential = void 0; - var node_crypto_1 = require("node:crypto"); - var StorageSharedKeyCredentialPolicy_js_1 = require_StorageSharedKeyCredentialPolicy(); - var Credential_js_1 = require_Credential(); - var StorageSharedKeyCredential = class extends Credential_js_1.Credential { - /** - * Azure Storage account name; readonly. - */ - accountName; - /** - * Azure Storage account key; readonly. - */ - accountKey; - /** - * Creates an instance of StorageSharedKeyCredential. - * @param accountName - - * @param accountKey - - */ - constructor(accountName, accountKey) { - super(); - this.accountName = accountName; - this.accountKey = Buffer.from(accountKey, "base64"); - } - /** - * Creates a StorageSharedKeyCredentialPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return (0, node_crypto_1.createHmac)("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); - } - }; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/AnonymousCredentialPolicy.js -var require_AnonymousCredentialPolicy = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/AnonymousCredentialPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AnonymousCredentialPolicy = void 0; - var CredentialPolicy_js_1 = require_CredentialPolicy(); - var AnonymousCredentialPolicy = class extends CredentialPolicy_js_1.CredentialPolicy { - /** - * Creates an instance of AnonymousCredentialPolicy. - * @param nextPolicy - - * @param options - - */ - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - }; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/credentials/AnonymousCredential.js -var require_AnonymousCredential = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/credentials/AnonymousCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AnonymousCredential = void 0; - var AnonymousCredentialPolicy_js_1 = require_AnonymousCredentialPolicy(); - var Credential_js_1 = require_Credential(); - var AnonymousCredential = class extends Credential_js_1.Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy_js_1.AnonymousCredentialPolicy(nextPolicy, options); - } - }; - exports2.AnonymousCredential = AnonymousCredential; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/BuffersStream.js -var require_BuffersStream = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/BuffersStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BuffersStream = void 0; - var node_stream_1 = require("node:stream"); - var BuffersStream = class extends node_stream_1.Readable { - buffers; - byteLength; - /** - * The offset of data to be read in the current buffer. - */ - byteOffsetInCurrentBuffer; - /** - * The index of buffer to be read in the array of buffers. - */ - bufferIndex; - /** - * The total length of data already read. - */ - pushedBytesLength; - /** - * Creates an instance of BuffersStream that will emit the data - * contained in the array of buffers. - * - * @param buffers - Array of buffers containing the data - * @param byteLength - The total length of data contained in the buffers - */ - constructor(buffers, byteLength, options) { - super(options); - this.buffers = buffers; - this.byteLength = byteLength; - this.byteOffsetInCurrentBuffer = 0; - this.bufferIndex = 0; - this.pushedBytesLength = 0; - let buffersLength = 0; - for (const buf of this.buffers) { - buffersLength += buf.byteLength; - } - if (buffersLength < this.byteLength) { - throw new Error("Data size shouldn't be larger than the total length of buffers."); - } - } - /** - * Internal _read() that will be called when the stream wants to pull more data in. - * - * @param size - Optional. The size of data to be read - */ - _read(size) { - if (this.pushedBytesLength >= this.byteLength) { - this.push(null); - } - if (!size) { - size = this.readableHighWaterMark; - } - const outBuffers = []; - let i = 0; - while (i < size && this.pushedBytesLength < this.byteLength) { - const remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength; - const remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer; - const remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers); - if (remaining > size - i) { - const end = this.byteOffsetInCurrentBuffer + size - i; - outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); - this.pushedBytesLength += size - i; - this.byteOffsetInCurrentBuffer = end; - i = size; - break; - } else { - const end = this.byteOffsetInCurrentBuffer + remaining; - outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); - if (remaining === remainingCapacityInThisBuffer) { - this.byteOffsetInCurrentBuffer = 0; - this.bufferIndex++; - } else { - this.byteOffsetInCurrentBuffer = end; - } - this.pushedBytesLength += remaining; - i += remaining; - } - } - if (outBuffers.length > 1) { - this.push(Buffer.concat(outBuffers)); - } else if (outBuffers.length === 1) { - this.push(outBuffers[0]); - } - } - }; - exports2.BuffersStream = BuffersStream; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/PooledBuffer.js -var require_PooledBuffer = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/PooledBuffer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PooledBuffer = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var BuffersStream_js_1 = require_BuffersStream(); - var node_buffer_1 = tslib_1.__importDefault(require("node:buffer")); - var maxBufferLength = node_buffer_1.default.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * Internal buffers used to keep the data. - * Each buffer has a length of the maxBufferLength except last one. - */ - buffers = []; - /** - * The total size of internal buffers. - */ - capacity; - /** - * The total size of data contained in internal buffers. - */ - _size; - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.capacity = capacity; - this._size = 0; - const bufferNum = Math.ceil(capacity / maxBufferLength); - for (let i = 0; i < bufferNum; i++) { - let len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength; - if (len === 0) { - len = maxBufferLength; - } - this.buffers.push(Buffer.allocUnsafe(len)); - } - if (buffers) { - this.fill(buffers, totalLength); - } - } - /** - * Fill the internal buffers with data in the input buffers serially - * with respect to the total length and the total capacity of the internal buffers. - * Data copied will be shift out of the input buffers. - * - * @param buffers - Input buffers containing the data to be filled in the pooled buffer - * @param totalLength - Total length of the data to be filled in. - * - */ - fill(buffers, totalLength) { - this._size = Math.min(this.capacity, totalLength); - let i = 0, j = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0; - while (totalCopiedNum < this._size) { - const source = buffers[i]; - const target = this.buffers[j]; - const copiedNum = source.copy(target, targetOffset, sourceOffset); - totalCopiedNum += copiedNum; - sourceOffset += copiedNum; - targetOffset += copiedNum; - if (sourceOffset === source.length) { - i++; - sourceOffset = 0; - } - if (targetOffset === target.length) { - j++; - targetOffset = 0; - } - } - buffers.splice(0, i); - if (buffers.length > 0) { - buffers[0] = buffers[0].slice(sourceOffset); - } - } - /** - * Get the readable stream assembled from all the data in the internal buffers. - * - */ - getReadableStream() { - return new BuffersStream_js_1.BuffersStream(this.buffers, this.size); - } - }; - exports2.PooledBuffer = PooledBuffer; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/BufferScheduler.js -var require_BufferScheduler = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/BufferScheduler.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BufferScheduler = void 0; - var events_1 = require("events"); - var PooledBuffer_js_1 = require_PooledBuffer(); - var BufferScheduler = class { - /** - * Size of buffers in incoming and outgoing queues. This class will try to align - * data read from Readable stream into buffer chunks with bufferSize defined. - */ - bufferSize; - /** - * How many buffers can be created or maintained. - */ - maxBuffers; - /** - * A Node.js Readable stream. - */ - readable; - /** - * OutgoingHandler is an async function triggered by BufferScheduler when there - * are available buffers in outgoing array. - */ - outgoingHandler; - /** - * An internal event emitter. - */ - emitter = new events_1.EventEmitter(); - /** - * Concurrency of executing outgoingHandlers. (0 lesser than concurrency lesser than or equal to maxBuffers) - */ - concurrency; - /** - * An internal offset marker to track data offset in bytes of next outgoingHandler. - */ - offset = 0; - /** - * An internal marker to track whether stream is end. - */ - isStreamEnd = false; - /** - * An internal marker to track whether stream or outgoingHandler returns error. - */ - isError = false; - /** - * How many handlers are executing. - */ - executingOutgoingHandlers = 0; - /** - * Encoding of the input Readable stream which has string data type instead of Buffer. - */ - encoding; - /** - * How many buffers have been allocated. - */ - numBuffers = 0; - /** - * Because this class doesn't know how much data every time stream pops, which - * is defined by highWaterMarker of the stream. So BufferScheduler will cache - * data received from the stream, when data in unresolvedDataArray exceeds the - * blockSize defined, it will try to concat a blockSize of buffer, fill into available - * buffers from incoming and push to outgoing array. - */ - unresolvedDataArray = []; - /** - * How much data consisted in unresolvedDataArray. - */ - unresolvedLength = 0; - /** - * The array includes all the available buffers can be used to fill data from stream. - */ - incoming = []; - /** - * The array (queue) includes all the buffers filled from stream data. - */ - outgoing = []; - /** - * Creates an instance of BufferScheduler. - * - * @param readable - A Node.js Readable stream - * @param bufferSize - Buffer size of every maintained buffer - * @param maxBuffers - How many buffers can be allocated - * @param outgoingHandler - An async function scheduled to be - * triggered when a buffer fully filled - * with stream data - * @param concurrency - Concurrency of executing outgoingHandlers (>0) - * @param encoding - [Optional] Encoding of Readable stream when it's a string stream - */ - constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { - if (bufferSize <= 0) { - throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`); - } - if (maxBuffers <= 0) { - throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); - } - if (concurrency <= 0) { - throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`); - } - this.bufferSize = bufferSize; - this.maxBuffers = maxBuffers; - this.readable = readable; - this.outgoingHandler = outgoingHandler; - this.concurrency = concurrency; - this.encoding = encoding; - } - /** - * Start the scheduler, will return error when stream of any of the outgoingHandlers - * returns error. - * - */ - async do() { - return new Promise((resolve14, reject) => { - this.readable.on("data", (data) => { - data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; - this.appendUnresolvedData(data); - if (!this.resolveData()) { - this.readable.pause(); - } - }); - this.readable.on("error", (err) => { - this.emitter.emit("error", err); - }); - this.readable.on("end", () => { - this.isStreamEnd = true; - this.emitter.emit("checkEnd"); - }); - this.emitter.on("error", (err) => { - this.isError = true; - this.readable.pause(); - reject(err); - }); - this.emitter.on("checkEnd", () => { - if (this.outgoing.length > 0) { - this.triggerOutgoingHandlers(); - return; - } - if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { - if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { - const buffer = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset).then(resolve14).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve14(); - } - } - }); - }); - } - /** - * Insert a new data into unresolved array. - * - * @param data - - */ - appendUnresolvedData(data) { - this.unresolvedDataArray.push(data); - this.unresolvedLength += data.length; - } - /** - * Try to shift a buffer with size in blockSize. The buffer returned may be less - * than blockSize when data in unresolvedDataArray is less than bufferSize. - * - */ - shiftBufferFromUnresolvedDataArray(buffer) { - if (!buffer) { - buffer = new PooledBuffer_js_1.PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer.size; - return buffer; - } - /** - * Resolve data in unresolvedDataArray. For every buffer with size in blockSize - * shifted, it will try to get (or allocate a buffer) from incoming, and fill it, - * then push it into outgoing to be handled by outgoing handler. - * - * Return false when available buffers in incoming are not enough, else true. - * - * @returns Return false when buffers in incoming are not enough, else true. - */ - resolveData() { - while (this.unresolvedLength >= this.bufferSize) { - let buffer; - if (this.incoming.length > 0) { - buffer = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer = this.outgoing.shift(); - if (buffer) { - this.triggerOutgoingHandler(buffer); - } - } while (buffer); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer) { - const bufferLength = buffer.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer) { - this.incoming.push(buffer); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - exports2.BufferScheduler = BufferScheduler; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/cache.js -var require_cache2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/cache.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; - var core_rest_pipeline_1 = require_commonjs6(); - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); - } - return _defaultHttpClient; - } - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/RequestPolicy.js -var require_RequestPolicy2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/RequestPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BaseRequestPolicy = void 0; - var BaseRequestPolicy = class { - _nextPolicy; - _options; - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; - } - /** - * Get whether or not a log with the provided log level should be logged. - * @param logLevel - The log level of the log that will be logged. - * @returns Whether or not a log with the provided log level should be logged. - */ - shouldLog(logLevel) { - return this._options.shouldLog(logLevel); - } - /** - * Attempt to log the provided message to the provided logger. If no logger was provided or if - * the log level does not meat the logger's threshold, then nothing will be logged. - * @param logLevel - The log level of this log. - * @param message - The message of this log. - */ - log(logLevel, message) { - this._options.log(logLevel, message); - } - }; - exports2.BaseRequestPolicy = BaseRequestPolicy; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/utils/constants.js -var require_constants11 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/utils/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PathStylePorts = exports2.DevelopmentConnectionString = exports2.HeaderConstants = exports2.URLConstants = exports2.SDK_VERSION = void 0; - exports2.SDK_VERSION = "1.0.0"; - exports2.URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" - } - }; - exports2.HeaderConstants = { - AUTHORIZATION: "Authorization", - AUTHORIZATION_SCHEME: "Bearer", - CONTENT_ENCODING: "Content-Encoding", - CONTENT_ID: "Content-ID", - CONTENT_LANGUAGE: "Content-Language", - CONTENT_LENGTH: "Content-Length", - CONTENT_MD5: "Content-Md5", - CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding", - CONTENT_TYPE: "Content-Type", - COOKIE: "Cookie", - DATE: "date", - IF_MATCH: "if-match", - IF_MODIFIED_SINCE: "if-modified-since", - IF_NONE_MATCH: "if-none-match", - IF_UNMODIFIED_SINCE: "if-unmodified-since", - PREFIX_FOR_STORAGE: "x-ms-", - RANGE: "Range", - USER_AGENT: "User-Agent", - X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id", - X_MS_COPY_SOURCE: "x-ms-copy-source", - X_MS_DATE: "x-ms-date", - X_MS_ERROR_CODE: "x-ms-error-code", - X_MS_VERSION: "x-ms-version", - X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code" - }; - exports2.DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - exports2.PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/utils/utils.common.js -var require_utils_common2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/utils/utils.common.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.escapeURLPath = escapeURLPath; - exports2.getValueInConnString = getValueInConnString; - exports2.extractConnectionStringParts = extractConnectionStringParts; - exports2.appendToURLPath = appendToURLPath; - exports2.setURLParameter = setURLParameter; - exports2.getURLParameter = getURLParameter; - exports2.setURLHost = setURLHost; - exports2.getURLPath = getURLPath; - exports2.getURLScheme = getURLScheme; - exports2.getURLPathAndQuery = getURLPathAndQuery; - exports2.getURLQueries = getURLQueries; - exports2.appendToURLQuery = appendToURLQuery; - exports2.truncatedISO8061Date = truncatedISO8061Date; - exports2.base64encode = base64encode; - exports2.base64decode = base64decode; - exports2.generateBlockID = generateBlockID; - exports2.delay = delay2; - exports2.padStart = padStart2; - exports2.sanitizeURL = sanitizeURL; - exports2.sanitizeHeaders = sanitizeHeaders; - exports2.iEqual = iEqual; - exports2.getAccountNameFromUrl = getAccountNameFromUrl; - exports2.isIpEndpointStyle = isIpEndpointStyle; - exports2.attachCredential = attachCredential; - exports2.httpAuthorizationToString = httpAuthorizationToString; - exports2.EscapePath = EscapePath; - exports2.assertResponse = assertResponse; - var core_rest_pipeline_1 = require_commonjs6(); - var core_util_1 = require_commonjs4(); - var constants_js_1 = require_constants11(); - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path30 = urlParsed.pathname; - path30 = path30 || "/"; - path30 = escape3(path30); - urlParsed.pathname = path30; - return urlParsed.toString(); - } - function getProxyUriFromDevConnString(connectionString) { - let proxyUri = ""; - if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) { - const matchCredentials = connectionString.split(";"); - for (const element of matchCredentials) { - if (element.trim().startsWith("DevelopmentStorageProxyUri=")) { - proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1]; - } - } - } - return proxyUri; - } - function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; - } - } - return ""; - } - function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = constants_js_1.DevelopmentConnectionString; - } - let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); - blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; - if (connectionString.search("DefaultEndpointsProtocol=") !== -1 && connectionString.search("AccountKey=") !== -1) { - let defaultEndpointsProtocol = ""; - let accountName = ""; - let accountKey = Buffer.from("accountKey", "base64"); - let endpointSuffix = ""; - accountName = getValueInConnString(connectionString, "AccountName"); - accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64"); - if (!blobEndpoint) { - defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol"); - const protocol = defaultEndpointsProtocol.toLowerCase(); - if (protocol !== "https" && protocol !== "http") { - throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"); - } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); - } - blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; - } - if (!accountName) { - throw new Error("Invalid AccountName in the provided Connection String"); - } else if (accountKey.length === 0) { - throw new Error("Invalid AccountKey in the provided Connection String"); - } - return { - kind: "AccountConnString", - url: blobEndpoint, - accountName, - accountKey, - proxyUri - }; - } else { - let accountSas = getValueInConnString(connectionString, "SharedAccessSignature"); - let accountName = getValueInConnString(connectionString, "AccountName"); - if (!accountName) { - accountName = getAccountNameFromUrl(blobEndpoint); - } - if (!blobEndpoint) { - throw new Error("Invalid BlobEndpoint in the provided SAS Connection String"); - } else if (!accountSas) { - throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String"); - } - if (accountSas.startsWith("?")) { - accountSas = accountSas.substring(1); - } - return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas }; - } - } - function escape3(text) { - return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); - } - function appendToURLPath(url2, name) { - const urlParsed = new URL(url2); - let path30 = urlParsed.pathname; - path30 = path30 ? path30.endsWith("/") ? `${path30}${name}` : `${path30}/${name}` : name; - urlParsed.pathname = path30; - return urlParsed.toString(); - } - function setURLParameter(url2, name, value) { - const urlParsed = new URL(url2); - const encodedName = encodeURIComponent(name); - const encodedValue = value ? encodeURIComponent(value) : void 0; - const searchString = urlParsed.search === "" ? "?" : urlParsed.search; - const searchPieces = []; - for (const pair of searchString.slice(1).split("&")) { - if (pair) { - const [key] = pair.split("=", 2); - if (key !== encodedName) { - searchPieces.push(pair); - } - } - } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); - } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url2, name) { - const urlParsed = new URL(url2); - return urlParsed.searchParams.get(name) ?? void 0; - } - function setURLHost(url2, host) { - const urlParsed = new URL(url2); - urlParsed.hostname = host; - return urlParsed.toString(); - } - function getURLPath(url2) { - try { - const urlParsed = new URL(url2); - return urlParsed.pathname; - } catch (e) { - return void 0; - } - } - function getURLScheme(url2) { - try { - const urlParsed = new URL(url2); - return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; - } catch (e) { - return void 0; - } - } - function getURLPathAndQuery(url2) { - const urlParsed = new URL(url2); - const pathString = urlParsed.pathname; - if (!pathString) { - throw new RangeError("Invalid url without valid path."); - } - let queryString = urlParsed.search || ""; - queryString = queryString.trim(); - if (queryString !== "") { - queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; - } - return `${pathString}${queryString}`; - } - function getURLQueries(url2) { - let queryString = new URL(url2).search; - if (!queryString) { - return {}; - } - queryString = queryString.trim(); - queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString; - let querySubStrings = queryString.split("&"); - querySubStrings = querySubStrings.filter((value) => { - const indexOfEqual = value.indexOf("="); - const lastIndexOfEqual = value.lastIndexOf("="); - return indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1; - }); - const queries = {}; - for (const querySubString of querySubStrings) { - const splitResults = querySubString.split("="); - const key = splitResults[0]; - const value = splitResults[1]; - queries[key] = value; - } - return queries; - } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; - } - urlParsed.search = query; - return urlParsed.toString(); - } - function truncatedISO8061Date(date, withMilliseconds = true) { - const dateString = date.toISOString(); - return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z"; - } - function base64encode(content) { - return !core_util_1.isNodeLike ? btoa(content) : Buffer.from(content).toString("base64"); - } - function base64decode(encodedString) { - return !core_util_1.isNodeLike ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); - } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); - } - const res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve14, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve14(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== void 0) { - aborter.addEventListener("abort", abortHandler); - } - }); - } - function padStart2(currentString, targetLength, padString = " ") { - if (String.prototype.padStart) { - return currentString.padStart(targetLength, padString); - } - padString = padString || " "; - if (currentString.length > targetLength) { - return currentString; - } else { - targetLength = targetLength - currentString.length; - if (targetLength > padString.length) { - padString += padString.repeat(targetLength / padString.length); - } - return padString.slice(0, targetLength) + currentString; - } - } - function sanitizeURL(url2) { - let safeURL = url2; - if (getURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE)) { - safeURL = setURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE, "*****"); - } - return safeURL; - } - function sanitizeHeaders(originalHeader) { - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(); - for (const [name, value] of originalHeader) { - if (name.toLowerCase() === constants_js_1.HeaderConstants.AUTHORIZATION.toLowerCase()) { - headers.set(name, "*****"); - } else if (name.toLowerCase() === constants_js_1.HeaderConstants.X_MS_COPY_SOURCE) { - headers.set(name, sanitizeURL(value)); - } else { - headers.set(name, value); - } - } - return headers; - } - function iEqual(str1, str2) { - return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); - } - function getAccountNameFromUrl(url2) { - const parsedUrl = new URL(url2); - let accountName; - try { - if (parsedUrl.hostname.split(".")[1] === "blob") { - accountName = parsedUrl.hostname.split(".")[0]; - } else if (isIpEndpointStyle(parsedUrl)) { - accountName = parsedUrl.pathname.split("/")[1]; - } else { - accountName = ""; - } - return accountName; - } catch (error3) { - throw new Error("Unable to extract accountName with provided information."); - } - } - function isIpEndpointStyle(parsedUrl) { - const host = parsedUrl.host; - return /^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) || Boolean(parsedUrl.port) && constants_js_1.PathStylePorts.includes(parsedUrl.port); - } - function attachCredential(thing, credential) { - thing.credential = credential; - return thing; - } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; - } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); - } - return split.join("/"); - } - function assertResponse(response) { - if (`_response` in response) { - return response; - } - throw new TypeError(`Unexpected response object ${response}`); - } - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageBrowserPolicy.js -var require_StorageBrowserPolicy = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageBrowserPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageBrowserPolicy = void 0; - var RequestPolicy_js_1 = require_RequestPolicy2(); - var core_util_1 = require_commonjs4(); - var constants_js_1 = require_constants11(); - var utils_common_js_1 = require_utils_common2(); - var StorageBrowserPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { - /** - * Creates an instance of StorageBrowserPolicy. - * @param nextPolicy - - * @param options - - */ - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - /** - * Sends out request. - * - * @param request - - */ - async sendRequest(request3) { - if (core_util_1.isNodeLike) { - return this._nextPolicy.sendRequest(request3); - } - if (request3.method.toUpperCase() === "GET" || request3.method.toUpperCase() === "HEAD") { - request3.url = (0, utils_common_js_1.setURLParameter)(request3.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request3.headers.remove(constants_js_1.HeaderConstants.COOKIE); - request3.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request3); - } - }; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/StorageBrowserPolicyFactory.js -var require_StorageBrowserPolicyFactory = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/StorageBrowserPolicyFactory.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageBrowserPolicyFactory = exports2.StorageBrowserPolicy = void 0; - var StorageBrowserPolicy_js_1 = require_StorageBrowserPolicy(); - Object.defineProperty(exports2, "StorageBrowserPolicy", { enumerable: true, get: function() { - return StorageBrowserPolicy_js_1.StorageBrowserPolicy; - } }); - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); - } - }; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/CredentialPolicy.js -var require_CredentialPolicy2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/CredentialPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CredentialPolicy = void 0; - var RequestPolicy_js_1 = require_RequestPolicy2(); - var CredentialPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request3) { - return this._nextPolicy.sendRequest(this.signRequest(request3)); - } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request3) { - return request3; - } - }; - exports2.CredentialPolicy = CredentialPolicy; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/AnonymousCredentialPolicy.js -var require_AnonymousCredentialPolicy2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/AnonymousCredentialPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AnonymousCredentialPolicy = void 0; - var CredentialPolicy_js_1 = require_CredentialPolicy2(); - var AnonymousCredentialPolicy = class extends CredentialPolicy_js_1.CredentialPolicy { - /** - * Creates an instance of AnonymousCredentialPolicy. - * @param nextPolicy - - * @param options - - */ - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - }; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/credentials/Credential.js -var require_Credential2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/credentials/Credential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Credential = void 0; - var Credential2 = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); - } - }; - exports2.Credential = Credential2; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/credentials/AnonymousCredential.js -var require_AnonymousCredential2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/credentials/AnonymousCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AnonymousCredential = void 0; - var AnonymousCredentialPolicy_js_1 = require_AnonymousCredentialPolicy2(); - var Credential_js_1 = require_Credential2(); - var AnonymousCredential = class extends Credential_js_1.Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy_js_1.AnonymousCredentialPolicy(nextPolicy, options); - } - }; - exports2.AnonymousCredential = AnonymousCredential; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/utils/SharedKeyComparator.js -var require_SharedKeyComparator2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/utils/SharedKeyComparator.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.compareHeader = compareHeader; - var table_lv0 = new Uint32Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1820, - 0, - 1823, - 1825, - 1827, - 1829, - 0, - 0, - 0, - 1837, - 2051, - 0, - 0, - 1843, - 0, - 3331, - 3354, - 3356, - 3358, - 3360, - 3362, - 3364, - 3366, - 3368, - 3370, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 3586, - 3593, - 3594, - 3610, - 3617, - 3619, - 3621, - 3628, - 3634, - 3637, - 3638, - 3656, - 3665, - 3696, - 3708, - 3710, - 3721, - 3722, - 3729, - 3737, - 3743, - 3746, - 3748, - 3750, - 3751, - 3753, - 0, - 0, - 0, - 1859, - 1860, - 1864, - 3586, - 3593, - 3594, - 3610, - 3617, - 3619, - 3621, - 3628, - 3634, - 3637, - 3638, - 3656, - 3665, - 3696, - 3708, - 3710, - 3721, - 3722, - 3729, - 3737, - 3743, - 3746, - 3748, - 3750, - 3751, - 3753, - 0, - 1868, - 0, - 1872, - 0 - ]); - var table_lv2 = new Uint32Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 18, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); - var table_lv4 = new Uint32Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 32786, - 0, - 0, - 0, - 0, - 0, - 33298, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); - function compareHeader(lhs, rhs) { - if (isLessThan(lhs, rhs)) - return -1; - return 1; - } - function isLessThan(lhs, rhs) { - const tables = [table_lv0, table_lv2, table_lv4]; - let curr_level = 0; - let i = 0; - let j = 0; - while (curr_level < tables.length) { - if (curr_level === tables.length - 1 && i !== j) { - return i > j; - } - const weight1 = i < lhs.length ? tables[curr_level][lhs[i].charCodeAt(0)] : 1; - const weight2 = j < rhs.length ? tables[curr_level][rhs[j].charCodeAt(0)] : 1; - if (weight1 === 1 && weight2 === 1) { - i = 0; - j = 0; - ++curr_level; - } else if (weight1 === weight2) { - ++i; - ++j; - } else if (weight1 === 0) { - ++i; - } else if (weight2 === 0) { - ++j; - } else { - return weight1 < weight2; - } - } - return false; - } - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js -var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageSharedKeyCredentialPolicy = void 0; - var constants_js_1 = require_constants11(); - var utils_common_js_1 = require_utils_common2(); - var CredentialPolicy_js_1 = require_CredentialPolicy2(); - var SharedKeyComparator_js_1 = require_SharedKeyComparator2(); - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy_js_1.CredentialPolicy { - /** - * Reference to StorageSharedKeyCredential which generates StorageSharedKeyCredentialPolicy - */ - factory; - /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - - */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; - } - /** - * Signs request. - * - * @param request - - */ - signRequest(request3) { - request3.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request3.body && (typeof request3.body === "string" || request3.body !== void 0) && request3.body.length > 0) { - request3.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); - } - const stringToSign = [ - request3.method.toUpperCase(), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.DATE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request3, constants_js_1.HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request3) + this.getCanonicalizedResourceString(request3); - const signature = this.factory.computeHMACSHA256(stringToSign); - request3.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request3; - } - /** - * Retrieve header value according to shared key sign rules. - * @see https://learn.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request3, headerName) { - const value = request3.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; - } - return value; - } - /** - * To construct the CanonicalizedHeaders portion of the signature string, follow these steps: - * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header. - * 2. Convert each HTTP header name to lowercase. - * 3. Sort the headers lexicographically by header name, in ascending order. - * Each header may appear only once in the string. - * 4. Replace any linear whitespace in the header value with a single space. - * 5. Trim any whitespace around the colon in the header. - * 6. Finally, append a new-line character to each canonicalized header in the resulting list. - * Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string. - * - * @param request - - */ - getCanonicalizedHeadersString(request3) { - let headersArray = request3.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index2, array2) => { - if (index2 > 0 && value.name.toLowerCase() === array2[index2 - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; - } - /** - * Retrieves the webResource canonicalized resource string. - * - * @param request - - */ - getCanonicalizedResourceString(request3) { - const path30 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path30}`; - const queries = (0, utils_common_js_1.getURLQueries)(request3.url); - const lowercaseQueries = {}; - if (queries) { - const queryKeys = []; - for (const key in queries) { - if (Object.prototype.hasOwnProperty.call(queries, key)) { - const lowercaseKey = key.toLowerCase(); - lowercaseQueries[lowercaseKey] = queries[key]; - queryKeys.push(lowercaseKey); - } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - }; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/credentials/StorageSharedKeyCredential.js -var require_StorageSharedKeyCredential2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/credentials/StorageSharedKeyCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageSharedKeyCredential = void 0; - var node_crypto_1 = require("node:crypto"); - var StorageSharedKeyCredentialPolicy_js_1 = require_StorageSharedKeyCredentialPolicy2(); - var Credential_js_1 = require_Credential2(); - var StorageSharedKeyCredential = class extends Credential_js_1.Credential { - /** - * Azure Storage account name; readonly. - */ - accountName; - /** - * Azure Storage account key; readonly. - */ - accountKey; - /** - * Creates an instance of StorageSharedKeyCredential. - * @param accountName - - * @param accountKey - - */ - constructor(accountName, accountKey) { - super(); - this.accountName = accountName; - this.accountKey = Buffer.from(accountKey, "base64"); - } - /** - * Creates a StorageSharedKeyCredentialPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return (0, node_crypto_1.createHmac)("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); - } - }; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - } -}); - -// node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError4 = __commonJS({ - "node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs12 = __commonJS({ - "node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError_js_1 = require_AbortError4(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/log.js -var require_log6 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/log.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_1 = require_commonjs2(); - exports2.logger = (0, logger_1.createClientLogger)("storage-common"); - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicyType.js -var require_StorageRetryPolicyType2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicyType.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageRetryPolicyType = void 0; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (exports2.StorageRetryPolicyType = StorageRetryPolicyType = {})); - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicy.js -var require_StorageRetryPolicy2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageRetryPolicy = void 0; - exports2.NewRetryPolicyFactory = NewRetryPolicyFactory; - var abort_controller_1 = require_commonjs12(); - var RequestPolicy_js_1 = require_RequestPolicy2(); - var constants_js_1 = require_constants11(); - var utils_common_js_1 = require_utils_common2(); - var log_js_1 = require_log6(); - var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType2(); - function NewRetryPolicyFactory(retryOptions) { - return { - create: (nextPolicy, options) => { - return new StorageRetryPolicy(nextPolicy, options, retryOptions); - } - }; - } - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { - /** - * RetryOptions. - */ - retryOptions; - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS.secondaryHost - }; - } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request3) { - return this.attemptSendRequest(request3, false, 1); - } - /** - * Decide and perform next retry. Won't mutate request parameter. - * - * @param request - - * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then - * the resource was not found. This may be due to replication delay. So, in this - * case, we'll never try the secondary again for this operation. - * @param attempt - How many retries has been attempted to performed, starting from 1, which includes - * the attempt will be performed by this method call. - */ - async attemptSendRequest(request3, secondaryHas404, attempt) { - const newRequest = request3.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request3.method === "GET" || request3.method === "HEAD" || request3.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = (0, utils_common_js_1.setURLHost)(newRequest.url, this.retryOptions.secondaryHost); - } - if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = (0, utils_common_js_1.setURLParameter)(newRequest.url, constants_js_1.URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); - } - let response; - try { - log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; - } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (err) { - log_js_1.logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw err; - } - } - await this.delay(isPrimaryRetry, attempt, request3.abortSignal); - return this.attemptSendRequest(request3, secondaryHas404, ++attempt); - } - /** - * Decide whether to retry according to last HTTP response and retry counters. - * - * @param isPrimaryRetry - - * @param attempt - - * @param response - - * @param err - - */ - shouldRetry(isPrimaryRetry, attempt, response, err) { - if (attempt >= this.retryOptions.maxTries) { - log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; - } - const retriableErrors = [ - "ETIMEDOUT", - "ESOCKETTIMEDOUT", - "ECONNREFUSED", - "ECONNRESET", - "ENOENT", - "ENOTFOUND", - "TIMEOUT", - "EPIPE", - "REQUEST_SEND_ERROR" - // For default xhr based http client provided in ms-rest-js - ]; - if (err) { - for (const retriableError of retriableErrors) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; - } - } - } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - if (response) { - if (response?.status >= 400) { - const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode); - if (copySourceError !== void 0) { - switch (copySourceError) { - case "InternalError": - case "OperationTimedOut": - case "ServerBusy": - return true; - } - } - } - } - if (err?.code === "PARSE_ERROR" && err?.message.startsWith(`Error "Error: Unclosed root tag`)) { - log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - return false; - } - /** - * Delay a calculated time between retries. - * - * @param isPrimaryRetry - - * @param attempt - - * @param abortSignal - - */ - async delay(isPrimaryRetry, attempt, abortSignal) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (this.retryOptions.retryPolicyType) { - case StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case StorageRetryPolicyType_js_1.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; - } - log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return (0, utils_common_js_1.delay)(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); - } - }; - exports2.StorageRetryPolicy = StorageRetryPolicy; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/StorageRetryPolicyFactory.js -var require_StorageRetryPolicyFactory2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/StorageRetryPolicyFactory.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageRetryPolicyFactory = exports2.StorageRetryPolicy = exports2.StorageRetryPolicyType = void 0; - var StorageRetryPolicy_js_1 = require_StorageRetryPolicy2(); - Object.defineProperty(exports2, "StorageRetryPolicy", { enumerable: true, get: function() { - return StorageRetryPolicy_js_1.StorageRetryPolicy; - } }); - var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType2(); - Object.defineProperty(exports2, "StorageRetryPolicyType", { enumerable: true, get: function() { - return StorageRetryPolicyType_js_1.StorageRetryPolicyType; - } }); - var StorageRetryPolicyFactory = class { - retryOptions; - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; - } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy_js_1.StorageRetryPolicy(nextPolicy, options, this.retryOptions); - } - }; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageBrowserPolicyV2.js -var require_StorageBrowserPolicyV2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageBrowserPolicyV2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageBrowserPolicyName = void 0; - exports2.storageBrowserPolicy = storageBrowserPolicy; - var core_util_1 = require_commonjs4(); - var constants_js_1 = require_constants11(); - var utils_common_js_1 = require_utils_common2(); - exports2.storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: exports2.storageBrowserPolicyName, - async sendRequest(request3, next) { - if (core_util_1.isNodeLike) { - return next(request3); - } - if (request3.method === "GET" || request3.method === "HEAD") { - request3.url = (0, utils_common_js_1.setURLParameter)(request3.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request3.headers.delete(constants_js_1.HeaderConstants.COOKIE); - request3.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js -var require_StorageCorrectContentLengthPolicy = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageCorrectContentLengthPolicyName = void 0; - exports2.storageCorrectContentLengthPolicy = storageCorrectContentLengthPolicy; - var constants_js_1 = require_constants11(); - exports2.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request3) { - if (request3.body && (typeof request3.body === "string" || Buffer.isBuffer(request3.body)) && request3.body.length > 0) { - request3.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); - } - } - return { - name: exports2.storageCorrectContentLengthPolicyName, - async sendRequest(request3, next) { - correctContentLength(request3); - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicyV2.js -var require_StorageRetryPolicyV2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicyV2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageRetryPolicyName = void 0; - exports2.storageRetryPolicy = storageRetryPolicy; - var abort_controller_1 = require_commonjs12(); - var core_rest_pipeline_1 = require_commonjs6(); - var core_util_1 = require_commonjs4(); - var StorageRetryPolicyFactory_js_1 = require_StorageRetryPolicyFactory2(); - var constants_js_1 = require_constants11(); - var utils_common_js_1 = require_utils_common2(); - var log_js_1 = require_log6(); - exports2.storageRetryPolicyName = "storageRetryPolicy"; - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var retriableErrors = [ - "ETIMEDOUT", - "ESOCKETTIMEDOUT", - "ECONNREFUSED", - "ECONNRESET", - "ENOENT", - "ENOTFOUND", - "TIMEOUT", - "EPIPE", - "REQUEST_SEND_ERROR" - ]; - var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - const retryPolicyType = options.retryPolicyType ?? DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = options.maxTries ?? DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = options.retryDelayInMs ?? DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = options.maxRetryDelayInMs ?? DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = options.secondaryHost ?? DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = options.tryTimeoutInMs ?? DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error3 }) { - if (attempt >= maxTries) { - log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; - } - if (error3) { - for (const retriableError of retriableErrors) { - if (error3.name.toUpperCase().includes(retriableError) || error3.message.toUpperCase().includes(retriableError) || error3.code && error3.code.toString().toUpperCase() === retriableError) { - log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; - } - } - if (error3?.code === "PARSE_ERROR" && error3?.message.startsWith(`Error "Error: Unclosed root tag`)) { - log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - } - if (response || error3) { - const statusCode = response?.status ?? error3?.statusCode ?? 0; - if (!isPrimaryRetry && statusCode === 404) { - log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - if (response) { - if (response?.status >= 400) { - const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode); - if (copySourceError !== void 0) { - switch (copySourceError) { - case "InternalError": - case "OperationTimedOut": - case "ServerBusy": - return true; - } - } - } - } - return false; - } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; - } - log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; - } - return { - name: exports2.storageRetryPolicyName, - async sendRequest(request3, next) { - if (tryTimeoutInMs) { - request3.url = (0, utils_common_js_1.setURLParameter)(request3.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request3.url; - const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request3.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error3; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request3.method) || attempt % 2 === 1; - request3.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error3 = void 0; - try { - log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request3); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if ((0, core_rest_pipeline_1.isRestError)(e)) { - log_js_1.logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error3 = e; - } else { - log_js_1.logger.error(`RetryPolicy: Caught error, message: ${(0, core_util_1.getErrorMessage)(e)}`); - throw e; - } - } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error3 }); - if (retryAgain) { - await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request3.abortSignal, RETRY_ABORT_ERROR); - } - attempt++; - } - if (response) { - return response; - } - throw error3 ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error."); - } - }; - } - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js -var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageSharedKeyCredentialPolicyName = void 0; - exports2.storageSharedKeyCredentialPolicy = storageSharedKeyCredentialPolicy; - var node_crypto_1 = require("node:crypto"); - var constants_js_1 = require_constants11(); - var utils_common_js_1 = require_utils_common2(); - var SharedKeyComparator_js_1 = require_SharedKeyComparator2(); - exports2.storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request3) { - request3.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request3.body && (typeof request3.body === "string" || Buffer.isBuffer(request3.body)) && request3.body.length > 0) { - request3.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); - } - const stringToSign = [ - request3.method.toUpperCase(), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.DATE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_MATCH), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request3) + getCanonicalizedResourceString(request3); - const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request3.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request3, headerName) { - const value = request3.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; - } - return value; - } - function getCanonicalizedHeadersString(request3) { - let headersArray = []; - for (const [name, value] of request3.headers) { - if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); - } - } - headersArray.sort((a, b) => { - return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index2, array2) => { - if (index2 > 0 && value.name.toLowerCase() === array2[index2 - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; - } - function getCanonicalizedResourceString(request3) { - const path30 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path30}`; - const queries = (0, utils_common_js_1.getURLQueries)(request3.url); - const lowercaseQueries = {}; - if (queries) { - const queryKeys = []; - for (const key in queries) { - if (Object.prototype.hasOwnProperty.call(queries, key)) { - const lowercaseKey = key.toLowerCase(); - lowercaseQueries[lowercaseKey] = queries[key]; - queryKeys.push(lowercaseKey); - } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - return { - name: exports2.storageSharedKeyCredentialPolicyName, - async sendRequest(request3, next) { - signRequest(request3); - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/policies/StorageRequestFailureDetailsParserPolicy.js -var require_StorageRequestFailureDetailsParserPolicy = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/policies/StorageRequestFailureDetailsParserPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageRequestFailureDetailsParserPolicyName = void 0; - exports2.storageRequestFailureDetailsParserPolicy = storageRequestFailureDetailsParserPolicy; - exports2.storageRequestFailureDetailsParserPolicyName = "storageRequestFailureDetailsParserPolicy"; - function storageRequestFailureDetailsParserPolicy() { - return { - name: exports2.storageRequestFailureDetailsParserPolicyName, - async sendRequest(request3, next) { - try { - const response = await next(request3); - return response; - } catch (err) { - if (typeof err === "object" && err !== null && err.response && err.response.parsedBody) { - if (err.response.parsedBody.code === "InvalidHeaderValue" && err.response.parsedBody.HeaderName === "x-ms-version") { - err.message = "The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information.\n"; - } - } - throw err; - } - } - }; - } - } -}); - -// node_modules/@azure/storage-common/dist/commonjs/index.js -var require_commonjs13 = __commonJS({ - "node_modules/@azure/storage-common/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BaseRequestPolicy = exports2.getCachedDefaultHttpClient = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - tslib_1.__exportStar(require_BufferScheduler(), exports2); - var cache_js_1 = require_cache2(); - Object.defineProperty(exports2, "getCachedDefaultHttpClient", { enumerable: true, get: function() { - return cache_js_1.getCachedDefaultHttpClient; - } }); - tslib_1.__exportStar(require_StorageBrowserPolicyFactory(), exports2); - tslib_1.__exportStar(require_AnonymousCredential2(), exports2); - tslib_1.__exportStar(require_Credential2(), exports2); - tslib_1.__exportStar(require_StorageSharedKeyCredential2(), exports2); - tslib_1.__exportStar(require_StorageRetryPolicyFactory2(), exports2); - var RequestPolicy_js_1 = require_RequestPolicy2(); - Object.defineProperty(exports2, "BaseRequestPolicy", { enumerable: true, get: function() { - return RequestPolicy_js_1.BaseRequestPolicy; - } }); - tslib_1.__exportStar(require_AnonymousCredentialPolicy2(), exports2); - tslib_1.__exportStar(require_CredentialPolicy2(), exports2); - tslib_1.__exportStar(require_StorageBrowserPolicy(), exports2); - tslib_1.__exportStar(require_StorageBrowserPolicyV2(), exports2); - tslib_1.__exportStar(require_StorageCorrectContentLengthPolicy(), exports2); - tslib_1.__exportStar(require_StorageRetryPolicyType2(), exports2); - tslib_1.__exportStar(require_StorageRetryPolicy2(), exports2); - tslib_1.__exportStar(require_StorageRetryPolicyV2(), exports2); - tslib_1.__exportStar(require_StorageSharedKeyCredentialPolicy2(), exports2); - tslib_1.__exportStar(require_StorageSharedKeyCredentialPolicyV2(), exports2); - tslib_1.__exportStar(require_StorageRetryPolicyFactory2(), exports2); - tslib_1.__exportStar(require_StorageRequestFailureDetailsParserPolicy(), exports2); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageBrowserPolicyV2.js -var require_StorageBrowserPolicyV22 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageBrowserPolicyV2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageBrowserPolicyName = void 0; - exports2.storageBrowserPolicy = storageBrowserPolicy; - var core_util_1 = require_commonjs4(); - var constants_js_1 = require_constants10(); - var utils_common_js_1 = require_utils_common(); - exports2.storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: exports2.storageBrowserPolicyName, - async sendRequest(request3, next) { - if (core_util_1.isNodeLike) { - return next(request3); - } - if (request3.method === "GET" || request3.method === "HEAD") { - request3.url = (0, utils_common_js_1.setURLParameter)(request3.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request3.headers.delete(constants_js_1.HeaderConstants.COOKIE); - request3.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicyV2.js -var require_StorageRetryPolicyV22 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicyV2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageRetryPolicyName = void 0; - exports2.storageRetryPolicy = storageRetryPolicy; - var abort_controller_1 = require_commonjs11(); - var core_rest_pipeline_1 = require_commonjs6(); - var core_util_1 = require_commonjs4(); - var StorageRetryPolicyFactory_js_1 = require_StorageRetryPolicyFactory(); - var constants_js_1 = require_constants10(); - var utils_common_js_1 = require_utils_common(); - var log_js_1 = require_log5(); - exports2.storageRetryPolicyName = "storageRetryPolicy"; - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var retriableErrors = [ - "ETIMEDOUT", - "ESOCKETTIMEDOUT", - "ECONNREFUSED", - "ECONNRESET", - "ENOENT", - "ENOTFOUND", - "TIMEOUT", - "EPIPE", - "REQUEST_SEND_ERROR" - ]; - var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - const retryPolicyType = options.retryPolicyType ?? DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = options.maxTries ?? DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = options.retryDelayInMs ?? DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = options.maxRetryDelayInMs ?? DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = options.secondaryHost ?? DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = options.tryTimeoutInMs ?? DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error3 }) { - if (attempt >= maxTries) { - log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; - } - if (error3) { - for (const retriableError of retriableErrors) { - if (error3.name.toUpperCase().includes(retriableError) || error3.message.toUpperCase().includes(retriableError) || error3.code && error3.code.toString().toUpperCase() === retriableError) { - log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; - } - } - if (error3?.code === "PARSE_ERROR" && error3?.message.startsWith(`Error "Error: Unclosed root tag`)) { - log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - } - if (response || error3) { - const statusCode = response?.status ?? error3?.statusCode ?? 0; - if (!isPrimaryRetry && statusCode === 404) { - log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - if (response) { - if (response?.status >= 400) { - const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode); - if (copySourceError !== void 0) { - switch (copySourceError) { - case "InternalError": - case "OperationTimedOut": - case "ServerBusy": - return true; - } - } - } - } - return false; - } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; - } - log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; - } - return { - name: exports2.storageRetryPolicyName, - async sendRequest(request3, next) { - if (tryTimeoutInMs) { - request3.url = (0, utils_common_js_1.setURLParameter)(request3.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request3.url; - const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request3.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error3; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request3.method) || attempt % 2 === 1; - request3.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error3 = void 0; - try { - log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request3); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if ((0, core_rest_pipeline_1.isRestError)(e)) { - log_js_1.logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error3 = e; - } else { - log_js_1.logger.error(`RetryPolicy: Caught error, message: ${(0, core_util_1.getErrorMessage)(e)}`); - throw e; - } - } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error3 }); - if (retryAgain) { - await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request3.abortSignal, RETRY_ABORT_ERROR); - } - attempt++; - } - if (response) { - return response; - } - throw error3 ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error."); - } - }; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js -var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageSharedKeyCredentialPolicyName = void 0; - exports2.storageSharedKeyCredentialPolicy = storageSharedKeyCredentialPolicy; - var node_crypto_1 = require("node:crypto"); - var constants_js_1 = require_constants10(); - var utils_common_js_1 = require_utils_common(); - var SharedKeyComparator_js_1 = require_SharedKeyComparator(); - exports2.storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request3) { - request3.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request3.body && (typeof request3.body === "string" || Buffer.isBuffer(request3.body)) && request3.body.length > 0) { - request3.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); - } - const stringToSign = [ - request3.method.toUpperCase(), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.DATE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_MATCH), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request3, constants_js_1.HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request3) + getCanonicalizedResourceString(request3); - const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request3.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request3, headerName) { - const value = request3.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; - } - return value; - } - function getCanonicalizedHeadersString(request3) { - let headersArray = []; - for (const [name, value] of request3.headers) { - if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); - } - } - headersArray.sort((a, b) => { - return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index2, array2) => { - if (index2 > 0 && value.name.toLowerCase() === array2[index2 - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; - } - function getCanonicalizedResourceString(request3) { - const path30 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path30}`; - const queries = (0, utils_common_js_1.getURLQueries)(request3.url); - const lowercaseQueries = {}; - if (queries) { - const queryKeys = []; - for (const key in queries) { - if (Object.prototype.hasOwnProperty.call(queries, key)) { - const lowercaseKey = key.toLowerCase(); - lowercaseQueries[lowercaseKey] = queries[key]; - queryKeys.push(lowercaseKey); - } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - return { - name: exports2.storageSharedKeyCredentialPolicyName, - async sendRequest(request3, next) { - signRequest(request3); - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageBrowserPolicy.js -var require_StorageBrowserPolicy2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageBrowserPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageBrowserPolicy = void 0; - var RequestPolicy_js_1 = require_RequestPolicy(); - var core_util_1 = require_commonjs4(); - var constants_js_1 = require_constants10(); - var utils_common_js_1 = require_utils_common(); - var StorageBrowserPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { - /** - * Creates an instance of StorageBrowserPolicy. - * @param nextPolicy - - * @param options - - */ - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - /** - * Sends out request. - * - * @param request - - */ - async sendRequest(request3) { - if (core_util_1.isNodeLike) { - return this._nextPolicy.sendRequest(request3); - } - if (request3.method.toUpperCase() === "GET" || request3.method.toUpperCase() === "HEAD") { - request3.url = (0, utils_common_js_1.setURLParameter)(request3.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request3.headers.remove(constants_js_1.HeaderConstants.COOKIE); - request3.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request3); - } - }; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/StorageBrowserPolicyFactory.js -var require_StorageBrowserPolicyFactory2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/StorageBrowserPolicyFactory.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageBrowserPolicyFactory = exports2.StorageBrowserPolicy = void 0; - var StorageBrowserPolicy_js_1 = require_StorageBrowserPolicy2(); - Object.defineProperty(exports2, "StorageBrowserPolicy", { enumerable: true, get: function() { - return StorageBrowserPolicy_js_1.StorageBrowserPolicy; - } }); - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); - } - }; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js -var require_StorageCorrectContentLengthPolicy2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.storageCorrectContentLengthPolicyName = void 0; - exports2.storageCorrectContentLengthPolicy = storageCorrectContentLengthPolicy; - var constants_js_1 = require_constants10(); - exports2.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request3) { - if (request3.body && (typeof request3.body === "string" || Buffer.isBuffer(request3.body)) && request3.body.length > 0) { - request3.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); - } - } - return { - name: exports2.storageCorrectContentLengthPolicyName, - async sendRequest(request3, next) { - correctContentLength(request3); - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/Pipeline.js -var require_Pipeline = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/Pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pipeline = exports2.StorageOAuthScopes = void 0; - exports2.isPipelineLike = isPipelineLike; - exports2.newPipeline = newPipeline; - exports2.getCoreClientOptions = getCoreClientOptions; - exports2.getCredentialFromPipeline = getCredentialFromPipeline; - var core_http_compat_1 = require_commonjs9(); - var core_rest_pipeline_1 = require_commonjs6(); - var core_client_1 = require_commonjs8(); - var core_xml_1 = require_commonjs10(); - var core_auth_1 = require_commonjs7(); - var log_js_1 = require_log5(); - var StorageRetryPolicyFactory_js_1 = require_StorageRetryPolicyFactory(); - var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); - var AnonymousCredential_js_1 = require_AnonymousCredential(); - var constants_js_1 = require_constants10(); - Object.defineProperty(exports2, "StorageOAuthScopes", { enumerable: true, get: function() { - return constants_js_1.StorageOAuthScopes; - } }); - var storage_common_1 = require_commonjs13(); - var StorageBrowserPolicyV2_js_1 = require_StorageBrowserPolicyV22(); - var StorageRetryPolicyV2_js_1 = require_StorageRetryPolicyV22(); - var StorageSharedKeyCredentialPolicyV2_js_1 = require_StorageSharedKeyCredentialPolicyV22(); - var StorageBrowserPolicyFactory_js_1 = require_StorageBrowserPolicyFactory2(); - var StorageCorrectContentLengthPolicy_js_1 = require_StorageCorrectContentLengthPolicy2(); - function isPipelineLike(pipeline2) { - if (!pipeline2 || typeof pipeline2 !== "object") { - return false; - } - const castPipeline = pipeline2; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * A list of chained request policy factories. - */ - factories; - /** - * Configures pipeline logger and HTTP client. - */ - options; - /** - * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. - * - * @param factories - - * @param options - - */ - constructor(factories, options = {}) { - this.factories = factories; - this.options = options; - } - /** - * Transfer Pipeline object to ServiceClientOptions object which is required by - * ServiceClient constructor. - * - * @returns The ServiceClientOptions object from this Pipeline. - */ - toServiceClientOptions() { - return { - httpClient: this.options.httpClient, - requestPolicyFactories: this.factories - }; - } - }; - exports2.Pipeline = Pipeline; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential_js_1.AnonymousCredential(); - } - const pipeline2 = new Pipeline([], pipelineOptions); - pipeline2._credential = credential; - return pipeline2; - } - function processDownlevelPipeline(pipeline2) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline2.factories.length) { - const novelFactories = pipeline2.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: (0, core_http_compat_1.createRequestPolicyFactoryPolicy)(novelFactories), - afterRetry: hasInjector - }; - } - } - return void 0; - } - function getCoreClientOptions(pipeline2) { - const { httpClient: v1Client, ...restOptions } = pipeline2.options; - let httpClient = pipeline2._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); - pipeline2._coreHttpClient = httpClient; - } - let corePipeline = pipeline2._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${constants_js_1.SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = (0, core_client_1.createClientPipeline)({ - ...restOptions, - loggingOptions: { - additionalAllowedHeaderNames: constants_js_1.StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: constants_js_1.StorageBlobLoggingAllowedQueryParameters, - logger: log_js_1.logger.info - }, - userAgentOptions: { - userAgentPrefix - }, - serializationOptions: { - stringifyXML: core_xml_1.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } - } - }, - deserializationOptions: { - parseXML: core_xml_1.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } - } - } - }); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: core_rest_pipeline_1.decompressResponsePolicyName }); - corePipeline.addPolicy((0, StorageCorrectContentLengthPolicy_js_1.storageCorrectContentLengthPolicy)()); - corePipeline.addPolicy((0, StorageRetryPolicyV2_js_1.storageRetryPolicy)(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy((0, storage_common_1.storageRequestFailureDetailsParserPolicy)()); - corePipeline.addPolicy((0, StorageBrowserPolicyV2_js_1.storageBrowserPolicy)()); - const downlevelResults = processDownlevelPipeline(pipeline2); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline2); - if ((0, core_auth_1.isTokenCredential)(credential)) { - corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential, - scopes: restOptions.audience ?? constants_js_1.StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { - corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); - } - pipeline2._corePipeline = corePipeline; - } - return { - ...restOptions, - allowInsecureConnection: true, - httpClient, - pipeline: corePipeline - }; - } - function getCredentialFromPipeline(pipeline2) { - if (pipeline2._credential) { - return pipeline2._credential; - } - let credential = new AnonymousCredential_js_1.AnonymousCredential(); - for (const factory of pipeline2.factories) { - if ((0, core_auth_1.isTokenCredential)(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; - } - } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { - return true; - } - return factory.constructor.name === "StorageSharedKeyCredential"; - } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential_js_1.AnonymousCredential) { - return true; - } - return factory.constructor.name === "AnonymousCredential"; - } - function isCoreHttpBearerTokenFactory(factory) { - return (0, core_auth_1.isTokenCredential)(factory.credential); - } - function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory_js_1.StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; - } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof StorageRetryPolicyFactory_js_1.StorageRetryPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageRetryPolicyFactory"; - } - function isStorageTelemetryPolicyFactory(factory) { - return factory.constructor.name === "TelemetryPolicyFactory"; - } - function isInjectorPolicyFactory(factory) { - return factory.constructor.name === "InjectorPolicyFactory"; - } - function isCoreHttpPolicyFactory(factory) { - const knownPolicies = [ - "GenerateClientRequestIdPolicy", - "TracingPolicy", - "LogPolicy", - "ProxyPolicy", - "DisableResponseDecompressionPolicy", - "KeepAlivePolicy", - "DeserializationPolicy" - ]; - const mockHttpClient = { - sendRequest: async (request3) => { - return { - request: request3, - headers: request3.headers.clone(), - status: 500 - }; - } - }; - const mockRequestPolicyOptions = { - log(_logLevel, _message) { - }, - shouldLog(_logLevel) { - return false; - } - }; - const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions); - const policyName = policyInstance.constructor.name; - return knownPolicies.some((knownPolicyName) => { - return policyName.startsWith(knownPolicyName); - }); - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/index.js -var require_models = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.KnownStorageErrorCode = exports2.KnownBlobExpiryOptions = exports2.KnownFileShareTokenIntent = exports2.KnownEncryptionAlgorithmType = void 0; - var KnownEncryptionAlgorithmType; - (function(KnownEncryptionAlgorithmType2) { - KnownEncryptionAlgorithmType2["AES256"] = "AES256"; - })(KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = KnownEncryptionAlgorithmType = {})); - var KnownFileShareTokenIntent; - (function(KnownFileShareTokenIntent2) { - KnownFileShareTokenIntent2["Backup"] = "backup"; - })(KnownFileShareTokenIntent || (exports2.KnownFileShareTokenIntent = KnownFileShareTokenIntent = {})); - var KnownBlobExpiryOptions; - (function(KnownBlobExpiryOptions2) { - KnownBlobExpiryOptions2["NeverExpire"] = "NeverExpire"; - KnownBlobExpiryOptions2["RelativeToCreation"] = "RelativeToCreation"; - KnownBlobExpiryOptions2["RelativeToNow"] = "RelativeToNow"; - KnownBlobExpiryOptions2["Absolute"] = "Absolute"; - })(KnownBlobExpiryOptions || (exports2.KnownBlobExpiryOptions = KnownBlobExpiryOptions = {})); - var KnownStorageErrorCode; - (function(KnownStorageErrorCode2) { - KnownStorageErrorCode2["AccountAlreadyExists"] = "AccountAlreadyExists"; - KnownStorageErrorCode2["AccountBeingCreated"] = "AccountBeingCreated"; - KnownStorageErrorCode2["AccountIsDisabled"] = "AccountIsDisabled"; - KnownStorageErrorCode2["AuthenticationFailed"] = "AuthenticationFailed"; - KnownStorageErrorCode2["AuthorizationFailure"] = "AuthorizationFailure"; - KnownStorageErrorCode2["ConditionHeadersNotSupported"] = "ConditionHeadersNotSupported"; - KnownStorageErrorCode2["ConditionNotMet"] = "ConditionNotMet"; - KnownStorageErrorCode2["EmptyMetadataKey"] = "EmptyMetadataKey"; - KnownStorageErrorCode2["InsufficientAccountPermissions"] = "InsufficientAccountPermissions"; - KnownStorageErrorCode2["InternalError"] = "InternalError"; - KnownStorageErrorCode2["InvalidAuthenticationInfo"] = "InvalidAuthenticationInfo"; - KnownStorageErrorCode2["InvalidHeaderValue"] = "InvalidHeaderValue"; - KnownStorageErrorCode2["InvalidHttpVerb"] = "InvalidHttpVerb"; - KnownStorageErrorCode2["InvalidInput"] = "InvalidInput"; - KnownStorageErrorCode2["InvalidMd5"] = "InvalidMd5"; - KnownStorageErrorCode2["InvalidMetadata"] = "InvalidMetadata"; - KnownStorageErrorCode2["InvalidQueryParameterValue"] = "InvalidQueryParameterValue"; - KnownStorageErrorCode2["InvalidRange"] = "InvalidRange"; - KnownStorageErrorCode2["InvalidResourceName"] = "InvalidResourceName"; - KnownStorageErrorCode2["InvalidUri"] = "InvalidUri"; - KnownStorageErrorCode2["InvalidXmlDocument"] = "InvalidXmlDocument"; - KnownStorageErrorCode2["InvalidXmlNodeValue"] = "InvalidXmlNodeValue"; - KnownStorageErrorCode2["Md5Mismatch"] = "Md5Mismatch"; - KnownStorageErrorCode2["MetadataTooLarge"] = "MetadataTooLarge"; - KnownStorageErrorCode2["MissingContentLengthHeader"] = "MissingContentLengthHeader"; - KnownStorageErrorCode2["MissingRequiredQueryParameter"] = "MissingRequiredQueryParameter"; - KnownStorageErrorCode2["MissingRequiredHeader"] = "MissingRequiredHeader"; - KnownStorageErrorCode2["MissingRequiredXmlNode"] = "MissingRequiredXmlNode"; - KnownStorageErrorCode2["MultipleConditionHeadersNotSupported"] = "MultipleConditionHeadersNotSupported"; - KnownStorageErrorCode2["OperationTimedOut"] = "OperationTimedOut"; - KnownStorageErrorCode2["OutOfRangeInput"] = "OutOfRangeInput"; - KnownStorageErrorCode2["OutOfRangeQueryParameterValue"] = "OutOfRangeQueryParameterValue"; - KnownStorageErrorCode2["RequestBodyTooLarge"] = "RequestBodyTooLarge"; - KnownStorageErrorCode2["ResourceTypeMismatch"] = "ResourceTypeMismatch"; - KnownStorageErrorCode2["RequestUrlFailedToParse"] = "RequestUrlFailedToParse"; - KnownStorageErrorCode2["ResourceAlreadyExists"] = "ResourceAlreadyExists"; - KnownStorageErrorCode2["ResourceNotFound"] = "ResourceNotFound"; - KnownStorageErrorCode2["ServerBusy"] = "ServerBusy"; - KnownStorageErrorCode2["UnsupportedHeader"] = "UnsupportedHeader"; - KnownStorageErrorCode2["UnsupportedXmlNode"] = "UnsupportedXmlNode"; - KnownStorageErrorCode2["UnsupportedQueryParameter"] = "UnsupportedQueryParameter"; - KnownStorageErrorCode2["UnsupportedHttpVerb"] = "UnsupportedHttpVerb"; - KnownStorageErrorCode2["AppendPositionConditionNotMet"] = "AppendPositionConditionNotMet"; - KnownStorageErrorCode2["BlobAlreadyExists"] = "BlobAlreadyExists"; - KnownStorageErrorCode2["BlobImmutableDueToPolicy"] = "BlobImmutableDueToPolicy"; - KnownStorageErrorCode2["BlobNotFound"] = "BlobNotFound"; - KnownStorageErrorCode2["BlobOverwritten"] = "BlobOverwritten"; - KnownStorageErrorCode2["BlobTierInadequateForContentLength"] = "BlobTierInadequateForContentLength"; - KnownStorageErrorCode2["BlobUsesCustomerSpecifiedEncryption"] = "BlobUsesCustomerSpecifiedEncryption"; - KnownStorageErrorCode2["BlockCountExceedsLimit"] = "BlockCountExceedsLimit"; - KnownStorageErrorCode2["BlockListTooLong"] = "BlockListTooLong"; - KnownStorageErrorCode2["CannotChangeToLowerTier"] = "CannotChangeToLowerTier"; - KnownStorageErrorCode2["CannotVerifyCopySource"] = "CannotVerifyCopySource"; - KnownStorageErrorCode2["ContainerAlreadyExists"] = "ContainerAlreadyExists"; - KnownStorageErrorCode2["ContainerBeingDeleted"] = "ContainerBeingDeleted"; - KnownStorageErrorCode2["ContainerDisabled"] = "ContainerDisabled"; - KnownStorageErrorCode2["ContainerNotFound"] = "ContainerNotFound"; - KnownStorageErrorCode2["ContentLengthLargerThanTierLimit"] = "ContentLengthLargerThanTierLimit"; - KnownStorageErrorCode2["CopyAcrossAccountsNotSupported"] = "CopyAcrossAccountsNotSupported"; - KnownStorageErrorCode2["CopyIdMismatch"] = "CopyIdMismatch"; - KnownStorageErrorCode2["FeatureVersionMismatch"] = "FeatureVersionMismatch"; - KnownStorageErrorCode2["IncrementalCopyBlobMismatch"] = "IncrementalCopyBlobMismatch"; - KnownStorageErrorCode2["IncrementalCopyOfEarlierVersionSnapshotNotAllowed"] = "IncrementalCopyOfEarlierVersionSnapshotNotAllowed"; - KnownStorageErrorCode2["IncrementalCopySourceMustBeSnapshot"] = "IncrementalCopySourceMustBeSnapshot"; - KnownStorageErrorCode2["InfiniteLeaseDurationRequired"] = "InfiniteLeaseDurationRequired"; - KnownStorageErrorCode2["InvalidBlobOrBlock"] = "InvalidBlobOrBlock"; - KnownStorageErrorCode2["InvalidBlobTier"] = "InvalidBlobTier"; - KnownStorageErrorCode2["InvalidBlobType"] = "InvalidBlobType"; - KnownStorageErrorCode2["InvalidBlockId"] = "InvalidBlockId"; - KnownStorageErrorCode2["InvalidBlockList"] = "InvalidBlockList"; - KnownStorageErrorCode2["InvalidOperation"] = "InvalidOperation"; - KnownStorageErrorCode2["InvalidPageRange"] = "InvalidPageRange"; - KnownStorageErrorCode2["InvalidSourceBlobType"] = "InvalidSourceBlobType"; - KnownStorageErrorCode2["InvalidSourceBlobUrl"] = "InvalidSourceBlobUrl"; - KnownStorageErrorCode2["InvalidVersionForPageBlobOperation"] = "InvalidVersionForPageBlobOperation"; - KnownStorageErrorCode2["LeaseAlreadyPresent"] = "LeaseAlreadyPresent"; - KnownStorageErrorCode2["LeaseAlreadyBroken"] = "LeaseAlreadyBroken"; - KnownStorageErrorCode2["LeaseIdMismatchWithBlobOperation"] = "LeaseIdMismatchWithBlobOperation"; - KnownStorageErrorCode2["LeaseIdMismatchWithContainerOperation"] = "LeaseIdMismatchWithContainerOperation"; - KnownStorageErrorCode2["LeaseIdMismatchWithLeaseOperation"] = "LeaseIdMismatchWithLeaseOperation"; - KnownStorageErrorCode2["LeaseIdMissing"] = "LeaseIdMissing"; - KnownStorageErrorCode2["LeaseIsBreakingAndCannotBeAcquired"] = "LeaseIsBreakingAndCannotBeAcquired"; - KnownStorageErrorCode2["LeaseIsBreakingAndCannotBeChanged"] = "LeaseIsBreakingAndCannotBeChanged"; - KnownStorageErrorCode2["LeaseIsBrokenAndCannotBeRenewed"] = "LeaseIsBrokenAndCannotBeRenewed"; - KnownStorageErrorCode2["LeaseLost"] = "LeaseLost"; - KnownStorageErrorCode2["LeaseNotPresentWithBlobOperation"] = "LeaseNotPresentWithBlobOperation"; - KnownStorageErrorCode2["LeaseNotPresentWithContainerOperation"] = "LeaseNotPresentWithContainerOperation"; - KnownStorageErrorCode2["LeaseNotPresentWithLeaseOperation"] = "LeaseNotPresentWithLeaseOperation"; - KnownStorageErrorCode2["MaxBlobSizeConditionNotMet"] = "MaxBlobSizeConditionNotMet"; - KnownStorageErrorCode2["NoAuthenticationInformation"] = "NoAuthenticationInformation"; - KnownStorageErrorCode2["NoPendingCopyOperation"] = "NoPendingCopyOperation"; - KnownStorageErrorCode2["OperationNotAllowedOnIncrementalCopyBlob"] = "OperationNotAllowedOnIncrementalCopyBlob"; - KnownStorageErrorCode2["PendingCopyOperation"] = "PendingCopyOperation"; - KnownStorageErrorCode2["PreviousSnapshotCannotBeNewer"] = "PreviousSnapshotCannotBeNewer"; - KnownStorageErrorCode2["PreviousSnapshotNotFound"] = "PreviousSnapshotNotFound"; - KnownStorageErrorCode2["PreviousSnapshotOperationNotSupported"] = "PreviousSnapshotOperationNotSupported"; - KnownStorageErrorCode2["SequenceNumberConditionNotMet"] = "SequenceNumberConditionNotMet"; - KnownStorageErrorCode2["SequenceNumberIncrementTooLarge"] = "SequenceNumberIncrementTooLarge"; - KnownStorageErrorCode2["SnapshotCountExceeded"] = "SnapshotCountExceeded"; - KnownStorageErrorCode2["SnapshotOperationRateExceeded"] = "SnapshotOperationRateExceeded"; - KnownStorageErrorCode2["SnapshotsPresent"] = "SnapshotsPresent"; - KnownStorageErrorCode2["SourceConditionNotMet"] = "SourceConditionNotMet"; - KnownStorageErrorCode2["SystemInUse"] = "SystemInUse"; - KnownStorageErrorCode2["TargetConditionNotMet"] = "TargetConditionNotMet"; - KnownStorageErrorCode2["UnauthorizedBlobOverwrite"] = "UnauthorizedBlobOverwrite"; - KnownStorageErrorCode2["BlobBeingRehydrated"] = "BlobBeingRehydrated"; - KnownStorageErrorCode2["BlobArchived"] = "BlobArchived"; - KnownStorageErrorCode2["BlobNotArchived"] = "BlobNotArchived"; - KnownStorageErrorCode2["AuthorizationSourceIPMismatch"] = "AuthorizationSourceIPMismatch"; - KnownStorageErrorCode2["AuthorizationProtocolMismatch"] = "AuthorizationProtocolMismatch"; - KnownStorageErrorCode2["AuthorizationPermissionMismatch"] = "AuthorizationPermissionMismatch"; - KnownStorageErrorCode2["AuthorizationServiceMismatch"] = "AuthorizationServiceMismatch"; - KnownStorageErrorCode2["AuthorizationResourceTypeMismatch"] = "AuthorizationResourceTypeMismatch"; - KnownStorageErrorCode2["BlobAccessTierNotSupportedForAccountType"] = "BlobAccessTierNotSupportedForAccountType"; - })(KnownStorageErrorCode || (exports2.KnownStorageErrorCode = KnownStorageErrorCode = {})); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/mappers.js -var require_mappers = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/mappers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ServiceGetUserDelegationKeyHeaders = exports2.ServiceListContainersSegmentExceptionHeaders = exports2.ServiceListContainersSegmentHeaders = exports2.ServiceGetStatisticsExceptionHeaders = exports2.ServiceGetStatisticsHeaders = exports2.ServiceGetPropertiesExceptionHeaders = exports2.ServiceGetPropertiesHeaders = exports2.ServiceSetPropertiesExceptionHeaders = exports2.ServiceSetPropertiesHeaders = exports2.ArrowField = exports2.ArrowConfiguration = exports2.JsonTextConfiguration = exports2.DelimitedTextConfiguration = exports2.QueryFormat = exports2.QuerySerialization = exports2.QueryRequest = exports2.ClearRange = exports2.PageRange = exports2.PageList = exports2.Block = exports2.BlockList = exports2.BlockLookupList = exports2.BlobPrefix = exports2.BlobHierarchyListSegment = exports2.ListBlobsHierarchySegmentResponse = exports2.BlobPropertiesInternal = exports2.BlobName = exports2.BlobItemInternal = exports2.BlobFlatListSegment = exports2.ListBlobsFlatSegmentResponse = exports2.AccessPolicy = exports2.SignedIdentifier = exports2.BlobTag = exports2.BlobTags = exports2.FilterBlobItem = exports2.FilterBlobSegment = exports2.UserDelegationKey = exports2.KeyInfo = exports2.ContainerProperties = exports2.ContainerItem = exports2.ListContainersSegmentResponse = exports2.GeoReplication = exports2.BlobServiceStatistics = exports2.StorageError = exports2.StaticWebsite = exports2.CorsRule = exports2.Metrics = exports2.RetentionPolicy = exports2.Logging = exports2.BlobServiceProperties = void 0; - exports2.BlobUndeleteHeaders = exports2.BlobDeleteExceptionHeaders = exports2.BlobDeleteHeaders = exports2.BlobGetPropertiesExceptionHeaders = exports2.BlobGetPropertiesHeaders = exports2.BlobDownloadExceptionHeaders = exports2.BlobDownloadHeaders = exports2.ContainerGetAccountInfoExceptionHeaders = exports2.ContainerGetAccountInfoHeaders = exports2.ContainerListBlobHierarchySegmentExceptionHeaders = exports2.ContainerListBlobHierarchySegmentHeaders = exports2.ContainerListBlobFlatSegmentExceptionHeaders = exports2.ContainerListBlobFlatSegmentHeaders = exports2.ContainerChangeLeaseExceptionHeaders = exports2.ContainerChangeLeaseHeaders = exports2.ContainerBreakLeaseExceptionHeaders = exports2.ContainerBreakLeaseHeaders = exports2.ContainerRenewLeaseExceptionHeaders = exports2.ContainerRenewLeaseHeaders = exports2.ContainerReleaseLeaseExceptionHeaders = exports2.ContainerReleaseLeaseHeaders = exports2.ContainerAcquireLeaseExceptionHeaders = exports2.ContainerAcquireLeaseHeaders = exports2.ContainerFilterBlobsExceptionHeaders = exports2.ContainerFilterBlobsHeaders = exports2.ContainerSubmitBatchExceptionHeaders = exports2.ContainerSubmitBatchHeaders = exports2.ContainerRenameExceptionHeaders = exports2.ContainerRenameHeaders = exports2.ContainerRestoreExceptionHeaders = exports2.ContainerRestoreHeaders = exports2.ContainerSetAccessPolicyExceptionHeaders = exports2.ContainerSetAccessPolicyHeaders = exports2.ContainerGetAccessPolicyExceptionHeaders = exports2.ContainerGetAccessPolicyHeaders = exports2.ContainerSetMetadataExceptionHeaders = exports2.ContainerSetMetadataHeaders = exports2.ContainerDeleteExceptionHeaders = exports2.ContainerDeleteHeaders = exports2.ContainerGetPropertiesExceptionHeaders = exports2.ContainerGetPropertiesHeaders = exports2.ContainerCreateExceptionHeaders = exports2.ContainerCreateHeaders = exports2.ServiceFilterBlobsExceptionHeaders = exports2.ServiceFilterBlobsHeaders = exports2.ServiceSubmitBatchExceptionHeaders = exports2.ServiceSubmitBatchHeaders = exports2.ServiceGetAccountInfoExceptionHeaders = exports2.ServiceGetAccountInfoHeaders = exports2.ServiceGetUserDelegationKeyExceptionHeaders = void 0; - exports2.PageBlobGetPageRangesHeaders = exports2.PageBlobUploadPagesFromURLExceptionHeaders = exports2.PageBlobUploadPagesFromURLHeaders = exports2.PageBlobClearPagesExceptionHeaders = exports2.PageBlobClearPagesHeaders = exports2.PageBlobUploadPagesExceptionHeaders = exports2.PageBlobUploadPagesHeaders = exports2.PageBlobCreateExceptionHeaders = exports2.PageBlobCreateHeaders = exports2.BlobSetTagsExceptionHeaders = exports2.BlobSetTagsHeaders = exports2.BlobGetTagsExceptionHeaders = exports2.BlobGetTagsHeaders = exports2.BlobQueryExceptionHeaders = exports2.BlobQueryHeaders = exports2.BlobGetAccountInfoExceptionHeaders = exports2.BlobGetAccountInfoHeaders = exports2.BlobSetTierExceptionHeaders = exports2.BlobSetTierHeaders = exports2.BlobAbortCopyFromURLExceptionHeaders = exports2.BlobAbortCopyFromURLHeaders = exports2.BlobCopyFromURLExceptionHeaders = exports2.BlobCopyFromURLHeaders = exports2.BlobStartCopyFromURLExceptionHeaders = exports2.BlobStartCopyFromURLHeaders = exports2.BlobCreateSnapshotExceptionHeaders = exports2.BlobCreateSnapshotHeaders = exports2.BlobBreakLeaseExceptionHeaders = exports2.BlobBreakLeaseHeaders = exports2.BlobChangeLeaseExceptionHeaders = exports2.BlobChangeLeaseHeaders = exports2.BlobRenewLeaseExceptionHeaders = exports2.BlobRenewLeaseHeaders = exports2.BlobReleaseLeaseExceptionHeaders = exports2.BlobReleaseLeaseHeaders = exports2.BlobAcquireLeaseExceptionHeaders = exports2.BlobAcquireLeaseHeaders = exports2.BlobSetMetadataExceptionHeaders = exports2.BlobSetMetadataHeaders = exports2.BlobSetLegalHoldExceptionHeaders = exports2.BlobSetLegalHoldHeaders = exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = exports2.BlobDeleteImmutabilityPolicyHeaders = exports2.BlobSetImmutabilityPolicyExceptionHeaders = exports2.BlobSetImmutabilityPolicyHeaders = exports2.BlobSetHttpHeadersExceptionHeaders = exports2.BlobSetHttpHeadersHeaders = exports2.BlobSetExpiryExceptionHeaders = exports2.BlobSetExpiryHeaders = exports2.BlobUndeleteExceptionHeaders = void 0; - exports2.BlockBlobGetBlockListExceptionHeaders = exports2.BlockBlobGetBlockListHeaders = exports2.BlockBlobCommitBlockListExceptionHeaders = exports2.BlockBlobCommitBlockListHeaders = exports2.BlockBlobStageBlockFromURLExceptionHeaders = exports2.BlockBlobStageBlockFromURLHeaders = exports2.BlockBlobStageBlockExceptionHeaders = exports2.BlockBlobStageBlockHeaders = exports2.BlockBlobPutBlobFromUrlExceptionHeaders = exports2.BlockBlobPutBlobFromUrlHeaders = exports2.BlockBlobUploadExceptionHeaders = exports2.BlockBlobUploadHeaders = exports2.AppendBlobSealExceptionHeaders = exports2.AppendBlobSealHeaders = exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = exports2.AppendBlobAppendBlockFromUrlHeaders = exports2.AppendBlobAppendBlockExceptionHeaders = exports2.AppendBlobAppendBlockHeaders = exports2.AppendBlobCreateExceptionHeaders = exports2.AppendBlobCreateHeaders = exports2.PageBlobCopyIncrementalExceptionHeaders = exports2.PageBlobCopyIncrementalHeaders = exports2.PageBlobUpdateSequenceNumberExceptionHeaders = exports2.PageBlobUpdateSequenceNumberHeaders = exports2.PageBlobResizeExceptionHeaders = exports2.PageBlobResizeHeaders = exports2.PageBlobGetPageRangesDiffExceptionHeaders = exports2.PageBlobGetPageRangesDiffHeaders = exports2.PageBlobGetPageRangesExceptionHeaders = void 0; - exports2.BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", - type: { - name: "Composite", - className: "BlobServiceProperties", - modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", - type: { - name: "Composite", - className: "Logging" - } - }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", - type: { - name: "Composite", - className: "Metrics" - } - }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", - type: { - name: "Composite", - className: "Metrics" - } - }, - cors: { - serializedName: "Cors", - xmlName: "Cors", - xmlIsWrapped: true, - xmlElementName: "CorsRule", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } - } - }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", - type: { - name: "String" - } - }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", - type: { - name: "Composite", - className: "StaticWebsite" - } - } - } - } - }; - exports2.Logging = { - serializedName: "Logging", - type: { - name: "Composite", - className: "Logging", - modelProperties: { - version: { - serializedName: "Version", - required: true, - xmlName: "Version", - type: { - name: "String" - } - }, - deleteProperty: { - serializedName: "Delete", - required: true, - xmlName: "Delete", - type: { - name: "Boolean" - } - }, - read: { - serializedName: "Read", - required: true, - xmlName: "Read", - type: { - name: "Boolean" - } - }, - write: { - serializedName: "Write", - required: true, - xmlName: "Write", - type: { - name: "Boolean" - } - }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - } - } - } - }; - exports2.RetentionPolicy = { - serializedName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy", - modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", - type: { - name: "Number" - } - } - } - } - }; - exports2.Metrics = { - serializedName: "Metrics", - type: { - name: "Composite", - className: "Metrics", - modelProperties: { - version: { - serializedName: "Version", - xmlName: "Version", - type: { - name: "String" - } - }, - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", - type: { - name: "Boolean" - } - }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - } - } - } - }; - exports2.CorsRule = { - serializedName: "CorsRule", - type: { - name: "Composite", - className: "CorsRule", - modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", - required: true, - xmlName: "AllowedOrigins", - type: { - name: "String" - } - }, - allowedMethods: { - serializedName: "AllowedMethods", - required: true, - xmlName: "AllowedMethods", - type: { - name: "String" - } - }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", - type: { - name: "String" - } - }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", - type: { - name: "String" - } - }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", - type: { - name: "Number" - } - } - } - } - }; - exports2.StaticWebsite = { - serializedName: "StaticWebsite", - type: { - name: "Composite", - className: "StaticWebsite", - modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", - type: { - name: "String" - } - }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", - type: { - name: "String" - } - }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", - type: { - name: "String" - } - } - } - } - }; - exports2.StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", - type: { - name: "String" - } - }, - copySourceStatusCode: { - serializedName: "CopySourceStatusCode", - xmlName: "CopySourceStatusCode", - type: { - name: "Number" - } - }, - copySourceErrorCode: { - serializedName: "CopySourceErrorCode", - xmlName: "CopySourceErrorCode", - type: { - name: "String" - } - }, - copySourceErrorMessage: { - serializedName: "CopySourceErrorMessage", - xmlName: "CopySourceErrorMessage", - type: { - name: "String" - } - }, - code: { - serializedName: "Code", - xmlName: "Code", - type: { - name: "String" - } - }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", - type: { - name: "Composite", - className: "BlobServiceStatistics", - modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", - type: { - name: "Composite", - className: "GeoReplication" - } - } - } - } - }; - exports2.GeoReplication = { - serializedName: "GeoReplication", - type: { - name: "Composite", - className: "GeoReplication", - modelProperties: { - status: { - serializedName: "Status", - required: true, - xmlName: "Status", - type: { - name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] - } - }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListContainersSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", - type: { - name: "String" - } - }, - marker: { - serializedName: "Marker", - xmlName: "Marker", - type: { - name: "String" - } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", - type: { - name: "Composite", - className: "ContainerItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", - type: { - name: "String" - } - }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", - type: { - name: "Boolean" - } - }, - version: { - serializedName: "Version", - xmlName: "Version", - type: { - name: "String" - } - }, - properties: { - serializedName: "Properties", - xmlName: "Properties", - type: { - name: "Composite", - className: "ContainerProperties" - } - }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } - }; - exports2.ContainerProperties = { - serializedName: "ContainerProperties", - type: { - name: "Composite", - className: "ContainerProperties", - modelProperties: { - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", - type: { - name: "String" - } - }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } - }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", - type: { - name: "Boolean" - } - }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", - type: { - name: "Boolean" - } - }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", - type: { - name: "String" - } - }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", - type: { - name: "Boolean" - } - }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", - type: { - name: "Number" - } - }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", - type: { - name: "Boolean" - } - } - } - } - }; - exports2.KeyInfo = { - serializedName: "KeyInfo", - type: { - name: "Composite", - className: "KeyInfo", - modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", - type: { - name: "String" - } - } - } - } - }; - exports2.UserDelegationKey = { - serializedName: "UserDelegationKey", - type: { - name: "Composite", - className: "UserDelegationKey", - modelProperties: { - signedObjectId: { - serializedName: "SignedOid", - required: true, - xmlName: "SignedOid", - type: { - name: "String" - } - }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", - type: { - name: "String" - } - }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", - type: { - name: "String" - } - }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", - type: { - name: "String" - } - }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", - type: { - name: "String" - } - }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", - type: { - name: "String" - } - }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", - type: { - name: "String" - } - } - } - } - }; - exports2.FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "FilterBlobSegment", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - where: { - serializedName: "Where", - required: true, - xmlName: "Where", - type: { - name: "String" - } - }, - blobs: { - serializedName: "Blobs", - required: true, - xmlName: "Blobs", - xmlIsWrapped: true, - xmlElementName: "Blob", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } - }; - exports2.FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", - type: { - name: "Composite", - className: "FilterBlobItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", - type: { - name: "String" - } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - type: { - name: "String" - } - }, - tags: { - serializedName: "Tags", - xmlName: "Tags", - type: { - name: "Composite", - className: "BlobTags" - } - } - } - } - }; - exports2.BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", - type: { - name: "Composite", - className: "BlobTags", - modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } - } - } - } - } - }; - exports2.BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", - type: { - name: "Composite", - className: "BlobTag", - modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", - type: { - name: "String" - } - }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", - type: { - name: "String" - } - } - } - } - }; - exports2.SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", - type: { - name: "Composite", - className: "SignedIdentifier", - modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", - type: { - name: "String" - } - }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } - } - } - } - }; - exports2.AccessPolicy = { - serializedName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy", - modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", - type: { - name: "String" - } - }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", - type: { - name: "String" - } - } - } - } - }; - exports2.ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListBlobsFlatSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", - type: { - name: "String" - } - }, - marker: { - serializedName: "Marker", - xmlName: "Marker", - type: { - name: "String" - } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobFlatListSegment" - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobFlatListSegment", - modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } - } - } - } - } - }; - exports2.BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", - type: { - name: "Composite", - className: "BlobItemInternal", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", - type: { - name: "Composite", - className: "BlobName" - } - }, - deleted: { - serializedName: "Deleted", - required: true, - xmlName: "Deleted", - type: { - name: "Boolean" - } - }, - snapshot: { - serializedName: "Snapshot", - required: true, - xmlName: "Snapshot", - type: { - name: "String" - } - }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", - type: { - name: "String" - } - }, - isCurrentVersion: { - serializedName: "IsCurrentVersion", - xmlName: "IsCurrentVersion", - type: { - name: "Boolean" - } - }, - properties: { - serializedName: "Properties", - xmlName: "Properties", - type: { - name: "Composite", - className: "BlobPropertiesInternal" - } - }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", - type: { - name: "Composite", - className: "BlobTags" - } - }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", - type: { - name: "Boolean" - } - } - } - } - }; - exports2.BlobName = { - serializedName: "BlobName", - type: { - name: "Composite", - className: "BlobName", - modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, - type: { - name: "String" - } - } - } - } - }; - exports2.BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", - type: { - name: "Composite", - className: "BlobPropertiesInternal", - modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", - type: { - name: "DateTimeRfc1123" - } - }, - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", - type: { - name: "String" - } - }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", - type: { - name: "Number" - } - }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", - type: { - name: "String" - } - }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", - type: { - name: "String" - } - }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" - } - }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", - type: { - name: "String" - } - }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", - type: { - name: "String" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", - type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] - } - }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", - type: { - name: "String" - } - }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", - type: { - name: "String" - } - }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", - type: { - name: "String" - } - }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", - type: { - name: "Boolean" - } - }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", - type: { - name: "Boolean" - } - }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", - type: { - name: "String" - } - }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", - type: { - name: "Number" - } - }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", - type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] - } - }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", - type: { - name: "Boolean" - } - }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", - type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] - } - }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", - type: { - name: "String" - } - }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", - type: { - name: "DateTimeRfc1123" - } - }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", - type: { - name: "Number" - } - }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", - type: { - name: "DateTimeRfc1123" - } - }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", - type: { - name: "Boolean" - } - }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } - }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", - type: { - name: "Boolean" - } - } - } - } - }; - exports2.ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListBlobsHierarchySegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", - type: { - name: "String" - } - }, - marker: { - serializedName: "Marker", - xmlName: "Marker", - type: { - name: "String" - } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", - type: { - name: "String" - } - }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment" - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment", - modelProperties: { - blobPrefixes: { - serializedName: "BlobPrefixes", - xmlName: "BlobPrefixes", - xmlElementName: "BlobPrefix", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobPrefix" - } - } - } - }, - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } - } - } - } - } - }; - exports2.BlobPrefix = { - serializedName: "BlobPrefix", - type: { - name: "Composite", - className: "BlobPrefix", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", - type: { - name: "Composite", - className: "BlobName" - } - } - } - } - }; - exports2.BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } - }; - exports2.BlockList = { - serializedName: "BlockList", - type: { - name: "Composite", - className: "BlockList", - modelProperties: { - committedBlocks: { - serializedName: "CommittedBlocks", - xmlName: "CommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } - } - }, - uncommittedBlocks: { - serializedName: "UncommittedBlocks", - xmlName: "UncommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } - } - } - } - } - }; - exports2.Block = { - serializedName: "Block", - type: { - name: "Composite", - className: "Block", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", - type: { - name: "String" - } - }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", - type: { - name: "Number" - } - } - } - } - }; - exports2.PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } - } - }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } - }; - exports2.PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", - type: { - name: "Composite", - className: "PageRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", - type: { - name: "Number" - } - } - } - } - }; - exports2.ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", - type: { - name: "Composite", - className: "ClearRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", - type: { - name: "Number" - } - } - } - } - }; - exports2.QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", - type: { - name: "String" - } - }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", - type: { - name: "String" - } - }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", - type: { - name: "Composite", - className: "QuerySerialization" - } - }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", - type: { - name: "Composite", - className: "QuerySerialization" - } - } - } - } - }; - exports2.QuerySerialization = { - serializedName: "QuerySerialization", - type: { - name: "Composite", - className: "QuerySerialization", - modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", - type: { - name: "Composite", - className: "QueryFormat" - } - } - } - } - }; - exports2.QueryFormat = { - serializedName: "QueryFormat", - type: { - name: "Composite", - className: "QueryFormat", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", - type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] - } - }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration" - } - }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration" - } - }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration" - } - }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } - }; - exports2.DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", - type: { - name: "String" - } - }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", - type: { - name: "String" - } - }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", - type: { - name: "String" - } - }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", - type: { - name: "String" - } - }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", - type: { - name: "Boolean" - } - } - } - } - }; - exports2.JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration", - modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", - type: { - name: "String" - } - } - } - } - }; - exports2.ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration", - modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } - } - } - } - } - }; - exports2.ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", - type: { - name: "Composite", - className: "ArrowField", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", - type: { - name: "String" - } - }, - name: { - serializedName: "Name", - xmlName: "Name", - type: { - name: "String" - } - }, - precision: { - serializedName: "Precision", - xmlName: "Precision", - type: { - name: "Number" - } - }, - scale: { - serializedName: "Scale", - xmlName: "Scale", - type: { - name: "Number" - } - } - } - } - }; - exports2.ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", - type: { - name: "Composite", - className: "ServiceSubmitBatchHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", - type: { - name: "Composite", - className: "ServiceFilterBlobsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerCreateHeaders = { - serializedName: "Container_createHeaders", - type: { - name: "Composite", - className: "ContainerCreateHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", - type: { - name: "Composite", - className: "ContainerCreateExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", - type: { - name: "Composite", - className: "ContainerGetPropertiesHeaders", - modelProperties: { - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } - }, - hasImmutabilityPolicy: { - serializedName: "x-ms-has-immutability-policy", - xmlName: "x-ms-has-immutability-policy", - type: { - name: "Boolean" - } - }, - hasLegalHold: { - serializedName: "x-ms-has-legal-hold", - xmlName: "x-ms-has-legal-hold", - type: { - name: "Boolean" - } - }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } - }, - denyEncryptionScopeOverride: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } - }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "x-ms-immutable-storage-with-versioning-enabled", - xmlName: "x-ms-immutable-storage-with-versioning-enabled", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", - type: { - name: "Composite", - className: "ContainerDeleteHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", - type: { - name: "Composite", - className: "ContainerDeleteExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", - type: { - name: "Composite", - className: "ContainerSetMetadataHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", - type: { - name: "Composite", - className: "ContainerGetAccessPolicyHeaders", - modelProperties: { - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", - type: { - name: "Composite", - className: "ContainerSetAccessPolicyHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", - type: { - name: "Composite", - className: "ContainerRestoreHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", - type: { - name: "Composite", - className: "ContainerRestoreExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", - type: { - name: "Composite", - className: "ContainerRenameHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", - type: { - name: "Composite", - className: "ContainerRenameExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", - type: { - name: "Composite", - className: "ContainerAcquireLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", - type: { - name: "Composite", - className: "ContainerReleaseLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", - type: { - name: "Composite", - className: "ContainerRenewLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", - type: { - name: "Composite", - className: "ContainerBreakLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", - type: { - name: "Composite", - className: "ContainerChangeLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", - type: { - name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", - type: { - name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", - type: { - name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", - type: { - name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ContainerGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", - type: { - name: "Boolean" - } - } - } - } - }; - exports2.ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", - type: { - name: "Composite", - className: "BlobDownloadHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - createdOn: { - serializedName: "x-ms-creation-time", - xmlName: "x-ms-creation-time", - type: { - name: "DateTimeRfc1123" - } - }, - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - objectReplicationPolicyId: { - serializedName: "x-ms-or-policy-id", - xmlName: "x-ms-or-policy-id", - type: { - name: "String" - } - }, - objectReplicationRules: { - serializedName: "x-ms-or", - headerCollectionPrefix: "x-ms-or-", - xmlName: "x-ms-or", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", - type: { - name: "Number" - } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", - type: { - name: "String" - } - }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", - type: { - name: "String" - } - }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", - type: { - name: "String" - } - }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", - type: { - name: "String" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", - type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] - } - }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", - type: { - name: "String" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", - type: { - name: "String" - } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", - type: { - name: "Boolean" - } - }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } - }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", - type: { - name: "Number" - } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", - type: { - name: "Boolean" - } - }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - } - } - } - }; - exports2.BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", - type: { - name: "Composite", - className: "BlobDownloadExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobGetPropertiesHeaders = { - serializedName: "Blob_getPropertiesHeaders", - type: { - name: "Composite", - className: "BlobGetPropertiesHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - createdOn: { - serializedName: "x-ms-creation-time", - xmlName: "x-ms-creation-time", - type: { - name: "DateTimeRfc1123" - } - }, - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - objectReplicationPolicyId: { - serializedName: "x-ms-or-policy-id", - xmlName: "x-ms-or-policy-id", - type: { - name: "String" - } - }, - objectReplicationRules: { - serializedName: "x-ms-or", - headerCollectionPrefix: "x-ms-or-", - xmlName: "x-ms-or", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", - type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] - } - }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", - type: { - name: "String" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", - type: { - name: "String" - } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - isIncrementalCopy: { - serializedName: "x-ms-incremental-copy", - xmlName: "x-ms-incremental-copy", - type: { - name: "Boolean" - } - }, - destinationSnapshot: { - serializedName: "x-ms-copy-destination-snapshot", - xmlName: "x-ms-copy-destination-snapshot", - type: { - name: "String" - } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", - type: { - name: "Number" - } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", - type: { - name: "String" - } - }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", - type: { - name: "String" - } - }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", - type: { - name: "String" - } - }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", - type: { - name: "String" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", - type: { - name: "String" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", - type: { - name: "String" - } - }, - accessTierInferred: { - serializedName: "x-ms-access-tier-inferred", - xmlName: "x-ms-access-tier-inferred", - type: { - name: "Boolean" - } - }, - archiveStatus: { - serializedName: "x-ms-archive-status", - xmlName: "x-ms-archive-status", - type: { - name: "String" - } - }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", - type: { - name: "DateTimeRfc1123" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", - type: { - name: "Boolean" - } - }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", - type: { - name: "Number" - } - }, - expiresOn: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "DateTimeRfc1123" - } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", - type: { - name: "Boolean" - } - }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } - }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", - type: { - name: "Composite", - className: "BlobDeleteHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", - type: { - name: "Composite", - className: "BlobDeleteExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", - type: { - name: "Composite", - className: "BlobUndeleteHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", - type: { - name: "Composite", - className: "BlobUndeleteExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", - type: { - name: "Composite", - className: "BlobSetExpiryHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetExpiryExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", - type: { - name: "Composite", - className: "BlobSetHttpHeadersHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", - type: { - name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyExpiry: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - } - } - } - }; - exports2.BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", - type: { - name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", - type: { - name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", - type: { - name: "Composite", - className: "BlobSetLegalHoldHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - } - } - } - }; - exports2.BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", - type: { - name: "Composite", - className: "BlobSetMetadataHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetMetadataExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", - type: { - name: "Composite", - className: "BlobAcquireLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", - type: { - name: "Composite", - className: "BlobReleaseLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", - type: { - name: "Composite", - className: "BlobRenewLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", - type: { - name: "Composite", - className: "BlobChangeLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", - type: { - name: "Composite", - className: "BlobBreakLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } - }; - exports2.BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", - type: { - name: "Composite", - className: "BlobCreateSnapshotHeaders", - modelProperties: { - snapshot: { - serializedName: "x-ms-snapshot", - xmlName: "x-ms-snapshot", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", - type: { - name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", - type: { - name: "Composite", - className: "BlobStartCopyFromURLHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - copySourceErrorCode: { - serializedName: "x-ms-copy-source-error-code", - xmlName: "x-ms-copy-source-error-code", - type: { - name: "String" - } - }, - copySourceStatusCode: { - serializedName: "x-ms-copy-source-status-code", - xmlName: "x-ms-copy-source-status-code", - type: { - name: "Number" - } - } - } - } - }; - exports2.BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - copySourceErrorCode: { - serializedName: "x-ms-copy-source-error-code", - xmlName: "x-ms-copy-source-error-code", - type: { - name: "String" - } - }, - copySourceStatusCode: { - serializedName: "x-ms-copy-source-status-code", - xmlName: "x-ms-copy-source-status-code", - type: { - name: "Number" - } - } - } - } - }; - exports2.BlobAbortCopyFromURLHeaders = { - serializedName: "Blob_abortCopyFromURLHeaders", - type: { - name: "Composite", - className: "BlobAbortCopyFromURLHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobAbortCopyFromURLExceptionHeaders = { - serializedName: "Blob_abortCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobAbortCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetTierHeaders = { - serializedName: "Blob_setTierHeaders", - type: { - name: "Composite", - className: "BlobSetTierHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetTierExceptionHeaders = { - serializedName: "Blob_setTierExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetTierExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobGetAccountInfoHeaders = { - serializedName: "Blob_getAccountInfoHeaders", - type: { - name: "Composite", - className: "BlobGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", - type: { - name: "Boolean" - } - } - } - } - }; - exports2.BlobGetAccountInfoExceptionHeaders = { - serializedName: "Blob_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetAccountInfoExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobQueryHeaders = { - serializedName: "Blob_queryHeaders", - type: { - name: "Composite", - className: "BlobQueryHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", - type: { - name: "Number" - } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", - type: { - name: "String" - } - }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", - type: { - name: "String" - } - }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", - type: { - name: "String" - } - }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", - type: { - name: "String" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", - type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] - } - }, - copyCompletionTime: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", - type: { - name: "String" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", - type: { - name: "String" - } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - } - } - } - }; - exports2.BlobQueryExceptionHeaders = { - serializedName: "Blob_queryExceptionHeaders", - type: { - name: "Composite", - className: "BlobQueryExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobGetTagsHeaders = { - serializedName: "Blob_getTagsHeaders", - type: { - name: "Composite", - className: "BlobGetTagsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobGetTagsExceptionHeaders = { - serializedName: "Blob_getTagsExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetTagsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetTagsHeaders = { - serializedName: "Blob_setTagsHeaders", - type: { - name: "Composite", - className: "BlobSetTagsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetTagsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobCreateHeaders = { - serializedName: "PageBlob_createHeaders", - type: { - name: "Composite", - className: "PageBlobCreateHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobCreateExceptionHeaders = { - serializedName: "PageBlob_createExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobCreateExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobUploadPagesHeaders = { - serializedName: "PageBlob_uploadPagesHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobUploadPagesExceptionHeaders = { - serializedName: "PageBlob_uploadPagesExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobClearPagesHeaders = { - serializedName: "PageBlob_clearPagesHeaders", - type: { - name: "Composite", - className: "PageBlobClearPagesHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobClearPagesExceptionHeaders = { - serializedName: "PageBlob_clearPagesExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobClearPagesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobUploadPagesFromURLHeaders = { - serializedName: "PageBlob_uploadPagesFromURLHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - copySourceErrorCode: { - serializedName: "x-ms-copy-source-error-code", - xmlName: "x-ms-copy-source-error-code", - type: { - name: "String" - } - }, - copySourceStatusCode: { - serializedName: "x-ms-copy-source-status-code", - xmlName: "x-ms-copy-source-status-code", - type: { - name: "Number" - } - } - } - } - }; - exports2.PageBlobGetPageRangesHeaders = { - serializedName: "PageBlob_getPageRangesHeaders", - type: { - name: "Composite", - className: "PageBlobGetPageRangesHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobGetPageRangesExceptionHeaders = { - serializedName: "PageBlob_getPageRangesExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobGetPageRangesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobGetPageRangesDiffHeaders = { - serializedName: "PageBlob_getPageRangesDiffHeaders", - type: { - name: "Composite", - className: "PageBlobGetPageRangesDiffHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobGetPageRangesDiffExceptionHeaders = { - serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobGetPageRangesDiffExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobResizeHeaders = { - serializedName: "PageBlob_resizeHeaders", - type: { - name: "Composite", - className: "PageBlobResizeHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobResizeExceptionHeaders = { - serializedName: "PageBlob_resizeExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobResizeExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobUpdateSequenceNumberHeaders = { - serializedName: "PageBlob_updateSequenceNumberHeaders", - type: { - name: "Composite", - className: "PageBlobUpdateSequenceNumberHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { - serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUpdateSequenceNumberExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobCopyIncrementalHeaders = { - serializedName: "PageBlob_copyIncrementalHeaders", - type: { - name: "Composite", - className: "PageBlobCopyIncrementalHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.PageBlobCopyIncrementalExceptionHeaders = { - serializedName: "PageBlob_copyIncrementalExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobCopyIncrementalExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.AppendBlobCreateHeaders = { - serializedName: "AppendBlob_createHeaders", - type: { - name: "Composite", - className: "AppendBlobCreateHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.AppendBlobCreateExceptionHeaders = { - serializedName: "AppendBlob_createExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobCreateExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.AppendBlobAppendBlockHeaders = { - serializedName: "AppendBlob_appendBlockHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobAppendOffset: { - serializedName: "x-ms-blob-append-offset", - xmlName: "x-ms-blob-append-offset", - type: { - name: "String" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.AppendBlobAppendBlockExceptionHeaders = { - serializedName: "AppendBlob_appendBlockExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.AppendBlobAppendBlockFromUrlHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobAppendOffset: { - serializedName: "x-ms-blob-append-offset", - xmlName: "x-ms-blob-append-offset", - type: { - name: "String" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - copySourceErrorCode: { - serializedName: "x-ms-copy-source-error-code", - xmlName: "x-ms-copy-source-error-code", - type: { - name: "String" - } - }, - copySourceStatusCode: { - serializedName: "x-ms-copy-source-status-code", - xmlName: "x-ms-copy-source-status-code", - type: { - name: "Number" - } - } - } - } - }; - exports2.AppendBlobSealHeaders = { - serializedName: "AppendBlob_sealHeaders", - type: { - name: "Composite", - className: "AppendBlobSealHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", - type: { - name: "Boolean" - } - } - } - } - }; - exports2.AppendBlobSealExceptionHeaders = { - serializedName: "AppendBlob_sealExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobSealExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobUploadHeaders = { - serializedName: "BlockBlob_uploadHeaders", - type: { - name: "Composite", - className: "BlockBlobUploadHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobUploadExceptionHeaders = { - serializedName: "BlockBlob_uploadExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobUploadExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobPutBlobFromUrlHeaders = { - serializedName: "BlockBlob_putBlobFromUrlHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - copySourceErrorCode: { - serializedName: "x-ms-copy-source-error-code", - xmlName: "x-ms-copy-source-error-code", - type: { - name: "String" - } - }, - copySourceStatusCode: { - serializedName: "x-ms-copy-source-status-code", - xmlName: "x-ms-copy-source-status-code", - type: { - name: "Number" - } - } - } - } - }; - exports2.BlockBlobStageBlockHeaders = { - serializedName: "BlockBlob_stageBlockHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockHeaders", - modelProperties: { - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobStageBlockExceptionHeaders = { - serializedName: "BlockBlob_stageBlockExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobStageBlockFromURLHeaders = { - serializedName: "BlockBlob_stageBlockFromURLHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLHeaders", - modelProperties: { - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - copySourceErrorCode: { - serializedName: "x-ms-copy-source-error-code", - xmlName: "x-ms-copy-source-error-code", - type: { - name: "String" - } - }, - copySourceStatusCode: { - serializedName: "x-ms-copy-source-status-code", - xmlName: "x-ms-copy-source-status-code", - type: { - name: "Number" - } - } - } - } - }; - exports2.BlockBlobCommitBlockListHeaders = { - serializedName: "BlockBlob_commitBlockListHeaders", - type: { - name: "Composite", - className: "BlockBlobCommitBlockListHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobCommitBlockListExceptionHeaders = { - serializedName: "BlockBlob_commitBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobCommitBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobGetBlockListHeaders = { - serializedName: "BlockBlob_getBlockListHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - exports2.BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/parameters.js -var require_parameters = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/parameters.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.action3 = exports2.action2 = exports2.leaseId1 = exports2.action1 = exports2.proposedLeaseId = exports2.duration = exports2.action = exports2.comp10 = exports2.sourceLeaseId = exports2.sourceContainerName = exports2.comp9 = exports2.deletedContainerVersion = exports2.deletedContainerName = exports2.comp8 = exports2.containerAcl = exports2.comp7 = exports2.comp6 = exports2.ifUnmodifiedSince = exports2.ifModifiedSince = exports2.leaseId = exports2.preventEncryptionScopeOverride = exports2.defaultEncryptionScope = exports2.access = exports2.metadata = exports2.restype2 = exports2.where = exports2.comp5 = exports2.multipartContentType = exports2.contentLength = exports2.comp4 = exports2.body = exports2.restype1 = exports2.comp3 = exports2.keyInfo = exports2.include = exports2.maxPageSize = exports2.marker = exports2.prefix = exports2.comp2 = exports2.comp1 = exports2.accept1 = exports2.requestId = exports2.version = exports2.timeoutInSeconds = exports2.comp = exports2.restype = exports2.url = exports2.accept = exports2.blobServiceProperties = exports2.contentType = void 0; - exports2.fileRequestIntent = exports2.copySourceTags = exports2.copySourceAuthorization = exports2.sourceContentMD5 = exports2.xMsRequiresSync = exports2.legalHold1 = exports2.sealBlob = exports2.blobTagsString = exports2.copySource = exports2.sourceIfTags = exports2.sourceIfNoneMatch = exports2.sourceIfMatch = exports2.sourceIfUnmodifiedSince = exports2.sourceIfModifiedSince = exports2.rehydratePriority = exports2.tier = exports2.comp14 = exports2.encryptionScope = exports2.legalHold = exports2.comp13 = exports2.immutabilityPolicyMode = exports2.immutabilityPolicyExpiry = exports2.comp12 = exports2.blobContentDisposition = exports2.blobContentLanguage = exports2.blobContentEncoding = exports2.blobContentMD5 = exports2.blobContentType = exports2.blobCacheControl = exports2.expiresOn = exports2.expiryOptions = exports2.comp11 = exports2.blobDeleteType = exports2.deleteSnapshots = exports2.ifTags = exports2.ifNoneMatch = exports2.ifMatch = exports2.encryptionAlgorithm = exports2.encryptionKeySha256 = exports2.encryptionKey = exports2.rangeGetContentCRC64 = exports2.rangeGetContentMD5 = exports2.range = exports2.versionId = exports2.snapshot = exports2.delimiter = exports2.include1 = exports2.proposedLeaseId1 = exports2.action4 = exports2.breakPeriod = void 0; - exports2.listType = exports2.comp25 = exports2.blocks = exports2.blockId = exports2.comp24 = exports2.copySourceBlobProperties = exports2.blobType2 = exports2.comp23 = exports2.sourceRange1 = exports2.appendPosition = exports2.maxSize = exports2.comp22 = exports2.blobType1 = exports2.comp21 = exports2.sequenceNumberAction = exports2.prevSnapshotUrl = exports2.prevsnapshot = exports2.comp20 = exports2.range1 = exports2.sourceContentCrc64 = exports2.sourceRange = exports2.sourceUrl = exports2.pageWrite1 = exports2.ifSequenceNumberEqualTo = exports2.ifSequenceNumberLessThan = exports2.ifSequenceNumberLessThanOrEqualTo = exports2.pageWrite = exports2.comp19 = exports2.accept2 = exports2.body1 = exports2.contentType1 = exports2.blobSequenceNumber = exports2.blobContentLength = exports2.blobType = exports2.transactionalContentCrc64 = exports2.transactionalContentMD5 = exports2.tags = exports2.comp18 = exports2.comp17 = exports2.queryRequest = exports2.tier1 = exports2.comp16 = exports2.copyId = exports2.copyActionAbortConstant = exports2.comp15 = void 0; - var mappers_js_1 = require_mappers(); - exports2.contentType = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } - } - }; - exports2.blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: mappers_js_1.BlobServiceProperties - }; - exports2.accept = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } - } - }; - exports2.url = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" - } - }, - skipEncoding: true - }; - exports2.restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } - } - }; - exports2.comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" - } - } - }; - exports2.version = { - parameterPath: "version", - mapper: { - defaultValue: "2025-11-05", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" - } - } - }; - exports2.requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - } - }; - exports2.accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } - } - }; - exports2.comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" - } - } - }; - exports2.marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" - } - } - }; - exports2.maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" - } - } - }; - exports2.include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } - } - }, - collectionFormat: "CSV" - }; - exports2.keyInfo = { - parameterPath: "keyInfo", - mapper: mappers_js_1.KeyInfo - }; - exports2.comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } - } - }; - exports2.body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } - } - }; - exports2.comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } - } - }; - exports2.multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } - } - }; - exports2.comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } - } - }; - exports2.restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } - } - }; - exports2.metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - }; - exports2.access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } - } - }; - exports2.defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } - } - }; - exports2.preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } - } - }; - exports2.leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - } - }; - exports2.ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } - } - }; - exports2.ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } - } - }; - exports2.comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } - } - }; - exports2.comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } - } - }; - exports2.deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } - } - }; - exports2.comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" - } - } - }; - exports2.sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" - } - } - }; - exports2.comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } - }; - exports2.duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" - } - } - }; - exports2.proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" - } - } - }; - exports2.action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } - }; - exports2.leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - } - }; - exports2.action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } - }; - exports2.action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } - }; - exports2.breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" - } - } - }; - exports2.action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } - }; - exports2.proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" - } - } - }; - exports2.include1 = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListBlobsIncludeItem", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "copy", - "deleted", - "metadata", - "snapshots", - "uncommittedblobs", - "versions", - "tags", - "immutabilitypolicy", - "legalhold", - "deletedwithversions" - ] - } - } - } - }, - collectionFormat: "CSV" - }; - exports2.delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" - } - } - }; - exports2.snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" - } - } - }; - exports2.versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" - } - } - }; - exports2.range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" - } - } - }; - exports2.rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" - } - } - }; - exports2.rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" - } - } - }; - exports2.encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" - } - } - }; - exports2.encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - } - }; - exports2.encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" - } - } - }; - exports2.ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" - } - } - }; - exports2.ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" - } - } - }; - exports2.ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" - } - } - }; - exports2.deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } - } - }; - exports2.blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } - } - }; - exports2.comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } - } - }; - exports2.expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } - } - }; - exports2.blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } - } - }; - exports2.blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } - } - }; - exports2.blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } - } - }; - exports2.blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" - } - } - }; - exports2.blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" - } - } - }; - exports2.blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" - } - } - }; - exports2.comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } - } - }; - exports2.immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - } - }; - exports2.comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - } - }; - exports2.encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - } - }; - exports2.comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.tier = { - parameterPath: ["options", "tier"], - mapper: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", - type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] - } - } - }; - exports2.rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } - } - }; - exports2.sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } - }; - exports2.sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } - } - }; - exports2.sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } - } - }; - exports2.sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } - } - }; - exports2.sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" - } - } - }; - exports2.copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - } - }; - exports2.blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" - } - } - }; - exports2.sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } - } - }; - exports2.legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - } - }; - exports2.xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" - } - } - }; - exports2.sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } - } - }; - exports2.copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } - } - }; - exports2.copySourceTags = { - parameterPath: ["options", "copySourceTags"], - mapper: { - serializedName: "x-ms-copy-source-tag-option", - xmlName: "x-ms-copy-source-tag-option", - type: { - name: "Enum", - allowedValues: ["REPLACE", "COPY"] - } - } - }; - exports2.fileRequestIntent = { - parameterPath: ["options", "fileRequestIntent"], - mapper: { - serializedName: "x-ms-file-request-intent", - xmlName: "x-ms-file-request-intent", - type: { - name: "String" - } - } - }; - exports2.comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" - } - } - }; - exports2.copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" - } - } - }; - exports2.comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.tier1 = { - parameterPath: "tier", - mapper: { - serializedName: "x-ms-access-tier", - required: true, - xmlName: "x-ms-access-tier", - type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] - } - } - }; - exports2.queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: mappers_js_1.QueryRequest - }; - exports2.comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.tags = { - parameterPath: ["options", "tags"], - mapper: mappers_js_1.BlobTags - }; - exports2.transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" - } - } - }; - exports2.transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - } - }; - exports2.blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } - } - }; - exports2.blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } - } - }; - exports2.blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - } - }; - exports2.contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } - } - }; - exports2.body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } - } - }; - exports2.accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } - } - }; - exports2.comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } - } - }; - exports2.ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" - } - } - }; - exports2.ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" - } - } - }; - exports2.ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" - } - } - }; - exports2.pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } - } - }; - exports2.sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - } - }; - exports2.sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" - } - } - }; - exports2.sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" - } - } - }; - exports2.range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" - } - } - }; - exports2.comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" - } - } - }; - exports2.prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" - } - } - }; - exports2.sequenceNumberAction = { - parameterPath: "sequenceNumberAction", - mapper: { - serializedName: "x-ms-sequence-number-action", - required: true, - xmlName: "x-ms-sequence-number-action", - type: { - name: "Enum", - allowedValues: ["max", "update", "increment"] - } - } - }; - exports2.comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } - } - }; - exports2.comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" - } - } - }; - exports2.appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" - } - } - }; - exports2.sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" - } - } - }; - exports2.comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } - } - }; - exports2.copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" - } - } - }; - exports2.comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" - } - } - }; - exports2.blocks = { - parameterPath: "blocks", - mapper: mappers_js_1.BlockLookupList - }; - exports2.comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } - }; - exports2.listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] - } - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/service.js -var require_service = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/service.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ServiceImpl = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var coreClient = tslib_1.__importStar(require_commonjs8()); - var Mappers = tslib_1.__importStar(require_mappers()); - var Parameters = tslib_1.__importStar(require_parameters()); - var ServiceImpl = class { - client; - /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * Sets properties for a storage account's Blob service endpoint, including properties for Storage - * Analytics and CORS (Cross-Origin Resource Sharing) rules - * @param blobServiceProperties The StorageService properties. - * @param options The options parameters. - */ - setProperties(blobServiceProperties, options) { - return this.client.sendOperationRequest({ blobServiceProperties, options }, setPropertiesOperationSpec); - } - /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @param options The options parameters. - */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); - } - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the - * secondary location endpoint when read-access geo-redundant replication is enabled for the storage - * account. - * @param options The options parameters. - */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); - } - /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. - */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); - } - /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * @param keyInfo Key information - * @param options The options parameters. - */ - getUserDelegationKey(keyInfo, options) { - return this.client.sendOperationRequest({ keyInfo, options }, getUserDelegationKeyOperationSpec); - } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); - } - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch - * boundary. Example header value: multipart/mixed; boundary=batch_ - * @param body Initial data - * @param options The options parameters. - */ - submitBatch(contentLength, multipartContentType, body, options) { - return this.client.sendOperationRequest({ contentLength, multipartContentType, body, options }, submitBatchOperationSpec); - } - /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a - * given search expression. Filter blobs searches across all containers within a storage account but - * can be scoped within the expression to a single container. - * @param options The options parameters. - */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } - }; - exports2.ServiceImpl = ServiceImpl; - var xmlSerializer = coreClient.createSerializer( - Mappers, - /* isXml */ - true - ); - var setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: Mappers.ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ServiceSetPropertiesExceptionHeaders - } - }, - requestBody: Parameters.blobServiceProperties, - queryParameters: [ - Parameters.restype, - Parameters.comp, - Parameters.timeoutInSeconds - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.version, - Parameters.requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getPropertiesOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BlobServiceProperties, - headersMapper: Mappers.ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ServiceGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - Parameters.restype, - Parameters.comp, - Parameters.timeoutInSeconds - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BlobServiceStatistics, - headersMapper: Mappers.ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ServiceGetStatisticsExceptionHeaders - } - }, - queryParameters: [ - Parameters.restype, - Parameters.timeoutInSeconds, - Parameters.comp1 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListContainersSegmentResponse, - headersMapper: Mappers.ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ServiceListContainersSegmentExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.comp2, - Parameters.prefix, - Parameters.marker, - Parameters.maxPageSize, - Parameters.include - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.UserDelegationKey, - headersMapper: Mappers.ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ServiceGetUserDelegationKeyExceptionHeaders - } - }, - requestBody: Parameters.keyInfo, - queryParameters: [ - Parameters.restype, - Parameters.timeoutInSeconds, - Parameters.comp3 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.version, - Parameters.requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getAccountInfoOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: Mappers.ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ServiceGetAccountInfoExceptionHeaders - } - }, - queryParameters: [ - Parameters.comp, - Parameters.timeoutInSeconds, - Parameters.restype1 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var submitBatchOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: Mappers.ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ServiceSubmitBatchExceptionHeaders - } - }, - requestBody: Parameters.body, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp4], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.accept, - Parameters.version, - Parameters.requestId, - Parameters.contentLength, - Parameters.multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var filterBlobsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FilterBlobSegment, - headersMapper: Mappers.ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ServiceFilterBlobsExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.marker, - Parameters.maxPageSize, - Parameters.comp5, - Parameters.where - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/container.js -var require_container = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/container.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContainerImpl = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var coreClient = tslib_1.__importStar(require_commonjs8()); - var Mappers = tslib_1.__importStar(require_mappers()); - var Parameters = tslib_1.__importStar(require_parameters()); - var ContainerImpl = class { - client; - /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * creates a new container under the specified account. If the container with the same name already - * exists, the operation fails - * @param options The options parameters. - */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec); - } - /** - * returns all user-defined metadata and system properties for the specified container. The data - * returned does not include the container's list of blobs - * @param options The options parameters. - */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); - } - /** - * operation marks the specified container for deletion. The container and any blobs contained within - * it are later deleted during garbage collection - * @param options The options parameters. - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec); - } - /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec); - } - /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. - */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } - /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. - */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } - /** - * Restores a previously-deleted container. - * @param options The options parameters. - */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); - } - /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. - */ - rename(sourceContainerName, options) { - return this.client.sendOperationRequest({ sourceContainerName, options }, renameOperationSpec); - } - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch - * boundary. Example header value: multipart/mixed; boundary=batch_ - * @param body Initial data - * @param options The options parameters. - */ - submitBatch(contentLength, multipartContentType, body, options) { - return this.client.sendOperationRequest({ contentLength, multipartContentType, body, options }, submitBatchOperationSpec); - } - /** - * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given - * search expression. Filter blobs searches within the given container. - * @param options The options parameters. - */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param options The options parameters. - */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - releaseLease(leaseId, options) { - return this.client.sendOperationRequest({ leaseId, options }, releaseLeaseOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - renewLease(leaseId, options) { - return this.client.sendOperationRequest({ leaseId, options }, renewLeaseOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param options The options parameters. - */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 - * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor - * (String) for a list of valid GUID string formats. - * @param options The options parameters. - */ - changeLease(leaseId, proposedLeaseId, options) { - return this.client.sendOperationRequest({ leaseId, proposedLeaseId, options }, changeLeaseOperationSpec); - } - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. - */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); - } - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix - * element in the response body that acts as a placeholder for all blobs whose names begin with the - * same substring up to the appearance of the delimiter character. The delimiter may be a single - * character or a string. - * @param options The options parameters. - */ - listBlobHierarchySegment(delimiter, options) { - return this.client.sendOperationRequest({ delimiter, options }, listBlobHierarchySegmentOperationSpec); - } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); - } - }; - exports2.ContainerImpl = ContainerImpl; - var xmlSerializer = coreClient.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.ContainerCreateHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerCreateExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.restype2], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.metadata, - Parameters.access, - Parameters.defaultEncryptionScope, - Parameters.preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer - }; - var getPropertiesOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: Mappers.ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.restype2], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId - ], - isXML: true, - serializer: xmlSerializer - }; - var deleteOperationSpec = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: Mappers.ContainerDeleteHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerDeleteExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.restype2], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer - }; - var setMetadataOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.ContainerSetMetadataHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerSetMetadataExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp6 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer - }; - var getAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { name: "Composite", className: "SignedIdentifier" } - } - }, - serializedName: "SignedIdentifiers", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier" - }, - headersMapper: Mappers.ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerGetAccessPolicyExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp7 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId - ], - isXML: true, - serializer: xmlSerializer - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerSetAccessPolicyExceptionHeaders - } - }, - requestBody: Parameters.containerAcl, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp7 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.version, - Parameters.requestId, - Parameters.access, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.ContainerRestoreHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerRestoreExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp8 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.deletedContainerName, - Parameters.deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.ContainerRenameHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerRenameExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp9 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.sourceContainerName, - Parameters.sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: Mappers.ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerSubmitBatchExceptionHeaders - } - }, - requestBody: Parameters.body, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.comp4, - Parameters.restype2 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.accept, - Parameters.version, - Parameters.requestId, - Parameters.contentLength, - Parameters.multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FilterBlobSegment, - headersMapper: Mappers.ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerFilterBlobsExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.marker, - Parameters.maxPageSize, - Parameters.comp5, - Parameters.where, - Parameters.restype2 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerAcquireLeaseExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp10 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.action, - Parameters.duration, - Parameters.proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerReleaseLeaseExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp10 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.action1, - Parameters.leaseId1 - ], - isXML: true, - serializer: xmlSerializer - }; - var renewLeaseOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerRenewLeaseExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp10 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.leaseId1, - Parameters.action2 - ], - isXML: true, - serializer: xmlSerializer - }; - var breakLeaseOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: Mappers.ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerBreakLeaseExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp10 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.action3, - Parameters.breakPeriod - ], - isXML: true, - serializer: xmlSerializer - }; - var changeLeaseOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerChangeLeaseExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.restype2, - Parameters.comp10 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.leaseId1, - Parameters.action4, - Parameters.proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListBlobsFlatSegmentResponse, - headersMapper: Mappers.ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerListBlobFlatSegmentExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.comp2, - Parameters.prefix, - Parameters.marker, - Parameters.maxPageSize, - Parameters.restype2, - Parameters.include1 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListBlobsHierarchySegmentResponse, - headersMapper: Mappers.ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerListBlobHierarchySegmentExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.comp2, - Parameters.prefix, - Parameters.marker, - Parameters.maxPageSize, - Parameters.restype2, - Parameters.include1, - Parameters.delimiter - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: Mappers.ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.ContainerGetAccountInfoExceptionHeaders - } - }, - queryParameters: [ - Parameters.comp, - Parameters.timeoutInSeconds, - Parameters.restype1 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/blob.js -var require_blob = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/blob.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobImpl = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var coreClient = tslib_1.__importStar(require_commonjs8()); - var Mappers = tslib_1.__importStar(require_mappers()); - var Parameters = tslib_1.__importStar(require_parameters()); - var BlobImpl = class { - client; - /** - * Initialize a new instance of the class Blob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Download operation reads or downloads a blob from the system, including its metadata and - * properties. You can also call Download to read a snapshot. - * @param options The options parameters. - */ - download(options) { - return this.client.sendOperationRequest({ options }, downloadOperationSpec); - } - /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system - * properties for the blob. It does not return the content of the blob. - * @param options The options parameters. - */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); - } - /** - * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is - * permanently removed from the storage account. If the storage account's soft delete feature is - * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible - * immediately. However, the blob service retains the blob or snapshot for the number of days specified - * by the DeleteRetentionPolicy section of [Storage service properties] - * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is - * permanently removed from the storage account. Note that you continue to be charged for the - * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the - * "include=deleted" query parameter to discover which blobs and snapshots have been soft deleted. You - * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a - * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 - * (ResourceNotFound). - * @param options The options parameters. - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec); - } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); - } - /** - * Sets the time a blob will expire and be deleted. - * @param expiryOptions Required. Indicates mode of the expiry time - * @param options The options parameters. - */ - setExpiry(expiryOptions, options) { - return this.client.sendOperationRequest({ expiryOptions, options }, setExpiryOperationSpec); - } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); - } - /** - * The Set Immutability Policy operation sets the immutability policy on the blob - * @param options The options parameters. - */ - setImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, setImmutabilityPolicyOperationSpec); - } - /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob - * @param options The options parameters. - */ - deleteImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, deleteImmutabilityPolicyOperationSpec); - } - /** - * The Set Legal Hold operation sets a legal hold on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param options The options parameters. - */ - setLegalHold(legalHold, options) { - return this.client.sendOperationRequest({ legalHold, options }, setLegalHoldOperationSpec); - } - /** - * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more - * name-value pairs - * @param options The options parameters. - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. - */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - releaseLease(leaseId, options) { - return this.client.sendOperationRequest({ leaseId, options }, releaseLeaseOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - renewLease(leaseId, options) { - return this.client.sendOperationRequest({ leaseId, options }, renewLeaseOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 - * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor - * (String) for a list of valid GUID string formats. - * @param options The options parameters. - */ - changeLease(leaseId, proposedLeaseId, options) { - return this.client.sendOperationRequest({ leaseId, proposedLeaseId, options }, changeLeaseOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. - */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec); - } - /** - * The Create Snapshot operation creates a read-only snapshot of a blob - * @param options The options parameters. - */ - createSnapshot(options) { - return this.client.sendOperationRequest({ options }, createSnapshotOperationSpec); - } - /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - startCopyFromURL(copySource, options) { - return this.client.sendOperationRequest({ copySource, options }, startCopyFromURLOperationSpec); - } - /** - * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return - * a response until the copy is complete. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - copyFromURL(copySource, options) { - return this.client.sendOperationRequest({ copySource, options }, copyFromURLOperationSpec); - } - /** - * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination - * blob with zero length and full metadata. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob - * operation. - * @param options The options parameters. - */ - abortCopyFromURL(copyId, options) { - return this.client.sendOperationRequest({ copyId, options }, abortCopyFromURLOperationSpec); - } - /** - * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium - * storage account and on a block blob in a blob storage account (locally redundant storage only). A - * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block - * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's - * ETag. - * @param tier Indicates the tier to be set on the blob. - * @param options The options parameters. - */ - setTier(tier, options) { - return this.client.sendOperationRequest({ tier, options }, setTierOperationSpec); - } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); - } - /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. - */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); - } - /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. - */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); - } - /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. - */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); - } - }; - exports2.BlobImpl = BlobImpl; - var xmlSerializer = coreClient.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: Mappers.BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: Mappers.BlobDownloadHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.versionId - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.range, - Parameters.rangeGetContentMD5, - Parameters.rangeGetContentCRC64, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: Mappers.BlobGetPropertiesHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.versionId - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: Mappers.BlobDeleteHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.versionId, - Parameters.blobDeleteType - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobUndeleteHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobUndeleteExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp8], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobSetExpiryHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp11], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.expiryOptions, - Parameters.expiresOn - ], - isXML: true, - serializer: xmlSerializer - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.blobCacheControl, - Parameters.blobContentType, - Parameters.blobContentMD5, - Parameters.blobContentEncoding, - Parameters.blobContentLanguage, - Parameters.blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.versionId, - Parameters.comp12 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifUnmodifiedSince, - Parameters.immutabilityPolicyExpiry, - Parameters.immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.versionId, - Parameters.comp12 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.versionId, - Parameters.comp13 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.legalHold - ], - isXML: true, - serializer: xmlSerializer - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobSetMetadataHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp6], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.encryptionScope - ], - isXML: true, - serializer: xmlSerializer - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.action, - Parameters.duration, - Parameters.proposedLeaseId, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.action1, - Parameters.leaseId1, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobRenewLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.leaseId1, - Parameters.action2, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobChangeLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.leaseId1, - Parameters.action4, - Parameters.proposedLeaseId1, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: Mappers.BlobBreakLeaseHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.action3, - Parameters.breakPeriod, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp14], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.encryptionScope - ], - isXML: true, - serializer: xmlSerializer - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: Mappers.BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.immutabilityPolicyExpiry, - Parameters.immutabilityPolicyMode, - Parameters.tier, - Parameters.rehydratePriority, - Parameters.sourceIfModifiedSince, - Parameters.sourceIfUnmodifiedSince, - Parameters.sourceIfMatch, - Parameters.sourceIfNoneMatch, - Parameters.sourceIfTags, - Parameters.copySource, - Parameters.blobTagsString, - Parameters.sealBlob, - Parameters.legalHold1 - ], - isXML: true, - serializer: xmlSerializer - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: Mappers.BlobCopyFromURLHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.immutabilityPolicyExpiry, - Parameters.immutabilityPolicyMode, - Parameters.encryptionScope, - Parameters.tier, - Parameters.sourceIfModifiedSince, - Parameters.sourceIfUnmodifiedSince, - Parameters.sourceIfMatch, - Parameters.sourceIfNoneMatch, - Parameters.copySource, - Parameters.blobTagsString, - Parameters.legalHold1, - Parameters.xMsRequiresSync, - Parameters.sourceContentMD5, - Parameters.copySourceAuthorization, - Parameters.copySourceTags, - Parameters.fileRequestIntent - ], - isXML: true, - serializer: xmlSerializer - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: Mappers.BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobAbortCopyFromURLExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.comp15, - Parameters.copyId - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.BlobSetTierHeaders - }, - 202: { - headersMapper: Mappers.BlobSetTierHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobSetTierExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.versionId, - Parameters.comp16 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifTags, - Parameters.rehydratePriority, - Parameters.tier1 - ], - isXML: true, - serializer: xmlSerializer - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: Mappers.BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobGetAccountInfoExceptionHeaders - } - }, - queryParameters: [ - Parameters.comp, - Parameters.timeoutInSeconds, - Parameters.restype1 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1 - ], - isXML: true, - serializer: xmlSerializer - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: Mappers.BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: Mappers.BlobQueryHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobQueryExceptionHeaders - } - }, - requestBody: Parameters.queryRequest, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.comp17 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.version, - Parameters.requestId, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BlobTags, - headersMapper: Mappers.BlobGetTagsHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobGetTagsExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.versionId, - Parameters.comp18 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: Mappers.BlobSetTagsHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlobSetTagsExceptionHeaders - } - }, - requestBody: Parameters.tags, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.versionId, - Parameters.comp18 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.version, - Parameters.requestId, - Parameters.leaseId, - Parameters.ifTags, - Parameters.transactionalContentMD5, - Parameters.transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/pageBlob.js -var require_pageBlob = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/pageBlob.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PageBlobImpl = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var coreClient = tslib_1.__importStar(require_commonjs8()); - var Mappers = tslib_1.__importStar(require_mappers()); - var Parameters = tslib_1.__importStar(require_parameters()); - var PageBlobImpl = class { - client; - /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Create operation creates a new page blob. - * @param contentLength The length of the request. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The - * page blob size must be aligned to a 512-byte boundary. - * @param options The options parameters. - */ - create(contentLength, blobContentLength, options) { - return this.client.sendOperationRequest({ contentLength, blobContentLength, options }, createOperationSpec); - } - /** - * The Upload Pages operation writes a range of pages to a page blob - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - uploadPages(contentLength, body, options) { - return this.client.sendOperationRequest({ contentLength, body, options }, uploadPagesOperationSpec); - } - /** - * The Clear Pages operation clears a set of pages from a page blob - * @param contentLength The length of the request. - * @param options The options parameters. - */ - clearPages(contentLength, options) { - return this.client.sendOperationRequest({ contentLength, options }, clearPagesOperationSpec); - } - /** - * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a - * URL - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. The length of this range should - * match the ContentLength header and x-ms-range/Range destination range header. - * @param contentLength The length of the request. - * @param range The range of bytes to which the source range would be written. The range should be 512 - * aligned and range-end is required. - * @param options The options parameters. - */ - uploadPagesFromURL(sourceUrl, sourceRange, contentLength, range2, options) { - return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range: range2, options }, uploadPagesFromURLOperationSpec); - } - /** - * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a - * page blob - * @param options The options parameters. - */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); - } - /** - * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were - * changed between target blob and previous snapshot. - * @param options The options parameters. - */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); - } - /** - * Resize the Blob - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The - * page blob size must be aligned to a 512-byte boundary. - * @param options The options parameters. - */ - resize(blobContentLength, options) { - return this.client.sendOperationRequest({ blobContentLength, options }, resizeOperationSpec); - } - /** - * Update the sequence number of the blob - * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. - * This property applies to page blobs only. This property indicates how the service should modify the - * blob's sequence number - * @param options The options parameters. - */ - updateSequenceNumber(sequenceNumberAction, options) { - return this.client.sendOperationRequest({ sequenceNumberAction, options }, updateSequenceNumberOperationSpec); - } - /** - * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. - * The snapshot is copied such that only the differential changes between the previously copied - * snapshot are transferred to the destination. The copied snapshots are complete copies of the - * original snapshot and can be read or copied from as usual. This API is supported since REST version - * 2016-05-31. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - copyIncremental(copySource, options) { - return this.client.sendOperationRequest({ copySource, options }, copyIncrementalOperationSpec); - } - }; - exports2.PageBlobImpl = PageBlobImpl; - var xmlSerializer = coreClient.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.PageBlobCreateHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobCreateExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.contentLength, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.blobCacheControl, - Parameters.blobContentType, - Parameters.blobContentMD5, - Parameters.blobContentEncoding, - Parameters.blobContentLanguage, - Parameters.blobContentDisposition, - Parameters.immutabilityPolicyExpiry, - Parameters.immutabilityPolicyMode, - Parameters.encryptionScope, - Parameters.tier, - Parameters.blobTagsString, - Parameters.legalHold1, - Parameters.blobType, - Parameters.blobContentLength, - Parameters.blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: Parameters.body1, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.contentLength, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.range, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.encryptionScope, - Parameters.transactionalContentMD5, - Parameters.transactionalContentCrc64, - Parameters.contentType1, - Parameters.accept2, - Parameters.pageWrite, - Parameters.ifSequenceNumberLessThanOrEqualTo, - Parameters.ifSequenceNumberLessThan, - Parameters.ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.PageBlobClearPagesHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.contentLength, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.range, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.encryptionScope, - Parameters.ifSequenceNumberLessThanOrEqualTo, - Parameters.ifSequenceNumberLessThan, - Parameters.ifSequenceNumberEqualTo, - Parameters.pageWrite1 - ], - isXML: true, - serializer: xmlSerializer - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.contentLength, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.encryptionScope, - Parameters.sourceIfModifiedSince, - Parameters.sourceIfUnmodifiedSince, - Parameters.sourceIfMatch, - Parameters.sourceIfNoneMatch, - Parameters.sourceContentMD5, - Parameters.copySourceAuthorization, - Parameters.fileRequestIntent, - Parameters.pageWrite, - Parameters.ifSequenceNumberLessThanOrEqualTo, - Parameters.ifSequenceNumberLessThan, - Parameters.ifSequenceNumberEqualTo, - Parameters.sourceUrl, - Parameters.sourceRange, - Parameters.sourceContentCrc64, - Parameters.range1 - ], - isXML: true, - serializer: xmlSerializer - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PageList, - headersMapper: Mappers.PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.marker, - Parameters.maxPageSize, - Parameters.snapshot, - Parameters.comp20 - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.range, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PageList, - headersMapper: Mappers.PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.marker, - Parameters.maxPageSize, - Parameters.snapshot, - Parameters.comp20, - Parameters.prevsnapshot - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.range, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.PageBlobResizeHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobResizeExceptionHeaders - } - }, - queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.encryptionScope, - Parameters.blobContentLength - ], - isXML: true, - serializer: xmlSerializer - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.blobSequenceNumber, - Parameters.sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: Mappers.PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp21], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.copySource - ], - isXML: true, - serializer: xmlSerializer - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/appendBlob.js -var require_appendBlob = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/appendBlob.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AppendBlobImpl = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var coreClient = tslib_1.__importStar(require_commonjs8()); - var Mappers = tslib_1.__importStar(require_mappers()); - var Parameters = tslib_1.__importStar(require_parameters()); - var AppendBlobImpl = class { - client; - /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. - */ - create(contentLength, options) { - return this.client.sendOperationRequest({ contentLength, options }, createOperationSpec); - } - /** - * The Append Block operation commits a new block of data to the end of an existing append blob. The - * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to - * AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - appendBlock(contentLength, body, options) { - return this.client.sendOperationRequest({ contentLength, body, options }, appendBlockOperationSpec); - } - /** - * The Append Block operation commits a new block of data to the end of an existing append blob where - * the contents are read from a source url. The Append Block operation is permitted only if the blob - * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version - * 2015-02-21 version or later. - * @param sourceUrl Specify a URL to the copy source. - * @param contentLength The length of the request. - * @param options The options parameters. - */ - appendBlockFromUrl(sourceUrl, contentLength, options) { - return this.client.sendOperationRequest({ sourceUrl, contentLength, options }, appendBlockFromUrlOperationSpec); - } - /** - * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version - * 2019-12-12 version or later. - * @param options The options parameters. - */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); - } - }; - exports2.AppendBlobImpl = AppendBlobImpl; - var xmlSerializer = coreClient.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.AppendBlobCreateHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.contentLength, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.blobCacheControl, - Parameters.blobContentType, - Parameters.blobContentMD5, - Parameters.blobContentEncoding, - Parameters.blobContentLanguage, - Parameters.blobContentDisposition, - Parameters.immutabilityPolicyExpiry, - Parameters.immutabilityPolicyMode, - Parameters.encryptionScope, - Parameters.blobTagsString, - Parameters.legalHold1, - Parameters.blobType1 - ], - isXML: true, - serializer: xmlSerializer - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: Parameters.body1, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp22], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.contentLength, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.encryptionScope, - Parameters.transactionalContentMD5, - Parameters.transactionalContentCrc64, - Parameters.contentType1, - Parameters.accept2, - Parameters.maxSize, - Parameters.appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp22], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.contentLength, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.encryptionScope, - Parameters.sourceIfModifiedSince, - Parameters.sourceIfUnmodifiedSince, - Parameters.sourceIfMatch, - Parameters.sourceIfNoneMatch, - Parameters.sourceContentMD5, - Parameters.copySourceAuthorization, - Parameters.fileRequestIntent, - Parameters.transactionalContentMD5, - Parameters.sourceUrl, - Parameters.sourceContentCrc64, - Parameters.maxSize, - Parameters.appendPosition, - Parameters.sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: Mappers.AppendBlobSealHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.AppendBlobSealExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp23], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.appendPosition - ], - isXML: true, - serializer: xmlSerializer - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/blockBlob.js -var require_blockBlob = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/blockBlob.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlockBlobImpl = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var coreClient = tslib_1.__importStar(require_commonjs8()); - var Mappers = tslib_1.__importStar(require_mappers()); - var Parameters = tslib_1.__importStar(require_parameters()); - var BlockBlobImpl = class { - client; - /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing - * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put - * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a - * partial update of the content of a block blob, use the Put Block List operation. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - upload(contentLength, body, options) { - return this.client.sendOperationRequest({ contentLength, body, options }, uploadOperationSpec); - } - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read - * from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are - * not supported with Put Blob from URL; the content of an existing blob is overwritten with the - * content of the new blob. To perform partial updates to a block blob’s contents using a source URL, - * use the Put Block from URL API in conjunction with Put Block List. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - putBlobFromUrl(contentLength, copySource, options) { - return this.client.sendOperationRequest({ contentLength, copySource, options }, putBlobFromUrlOperationSpec); - } - /** - * The Stage Block operation creates a new block to be committed as part of a blob - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string - * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified - * for the blockid parameter must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - stageBlock(blockId, contentLength, body, options) { - return this.client.sendOperationRequest({ blockId, contentLength, body, options }, stageBlockOperationSpec); - } - /** - * The Stage Block operation creates a new block to be committed as part of a blob where the contents - * are read from a URL. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string - * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified - * for the blockid parameter must be the same size for each block. - * @param contentLength The length of the request. - * @param sourceUrl Specify a URL to the copy source. - * @param options The options parameters. - */ - stageBlockFromURL(blockId, contentLength, sourceUrl, options) { - return this.client.sendOperationRequest({ blockId, contentLength, sourceUrl, options }, stageBlockFromURLOperationSpec); - } - /** - * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the - * blob. In order to be written as part of a blob, a block must have been successfully written to the - * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading - * only those blocks that have changed, then committing the new and existing blocks together. You can - * do this by specifying whether to commit a block from the committed block list or from the - * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list - * it may belong to. - * @param blocks Blob Blocks. - * @param options The options parameters. - */ - commitBlockList(blocks, options) { - return this.client.sendOperationRequest({ blocks, options }, commitBlockListOperationSpec); - } - /** - * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block - * blob - * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted - * blocks, or both lists together. - * @param options The options parameters. - */ - getBlockList(listType, options) { - return this.client.sendOperationRequest({ listType, options }, getBlockListOperationSpec); - } - }; - exports2.BlockBlobImpl = BlockBlobImpl; - var xmlSerializer = coreClient.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.BlockBlobUploadHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlockBlobUploadExceptionHeaders - } - }, - requestBody: Parameters.body1, - queryParameters: [Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.contentLength, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.blobCacheControl, - Parameters.blobContentType, - Parameters.blobContentMD5, - Parameters.blobContentEncoding, - Parameters.blobContentLanguage, - Parameters.blobContentDisposition, - Parameters.immutabilityPolicyExpiry, - Parameters.immutabilityPolicyMode, - Parameters.encryptionScope, - Parameters.tier, - Parameters.blobTagsString, - Parameters.legalHold1, - Parameters.transactionalContentMD5, - Parameters.transactionalContentCrc64, - Parameters.contentType1, - Parameters.accept2, - Parameters.blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [Parameters.timeoutInSeconds], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.contentLength, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.blobCacheControl, - Parameters.blobContentType, - Parameters.blobContentMD5, - Parameters.blobContentEncoding, - Parameters.blobContentLanguage, - Parameters.blobContentDisposition, - Parameters.encryptionScope, - Parameters.tier, - Parameters.sourceIfModifiedSince, - Parameters.sourceIfUnmodifiedSince, - Parameters.sourceIfMatch, - Parameters.sourceIfNoneMatch, - Parameters.sourceIfTags, - Parameters.copySource, - Parameters.blobTagsString, - Parameters.sourceContentMD5, - Parameters.copySourceAuthorization, - Parameters.copySourceTags, - Parameters.fileRequestIntent, - Parameters.transactionalContentMD5, - Parameters.blobType2, - Parameters.copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: Parameters.body1, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.comp24, - Parameters.blockId - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.contentLength, - Parameters.leaseId, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.encryptionScope, - Parameters.transactionalContentMD5, - Parameters.transactionalContentCrc64, - Parameters.contentType1, - Parameters.accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.comp24, - Parameters.blockId - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.contentLength, - Parameters.leaseId, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.encryptionScope, - Parameters.sourceIfModifiedSince, - Parameters.sourceIfUnmodifiedSince, - Parameters.sourceIfMatch, - Parameters.sourceIfNoneMatch, - Parameters.sourceContentMD5, - Parameters.copySourceAuthorization, - Parameters.fileRequestIntent, - Parameters.sourceUrl, - Parameters.sourceContentCrc64, - Parameters.sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: Mappers.BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: Parameters.blocks, - queryParameters: [Parameters.timeoutInSeconds, Parameters.comp25], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.version, - Parameters.requestId, - Parameters.metadata, - Parameters.leaseId, - Parameters.ifModifiedSince, - Parameters.ifUnmodifiedSince, - Parameters.encryptionKey, - Parameters.encryptionKeySha256, - Parameters.encryptionAlgorithm, - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.ifTags, - Parameters.blobCacheControl, - Parameters.blobContentType, - Parameters.blobContentMD5, - Parameters.blobContentEncoding, - Parameters.blobContentLanguage, - Parameters.blobContentDisposition, - Parameters.immutabilityPolicyExpiry, - Parameters.immutabilityPolicyMode, - Parameters.encryptionScope, - Parameters.tier, - Parameters.blobTagsString, - Parameters.legalHold1, - Parameters.transactionalContentMD5, - Parameters.transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BlockList, - headersMapper: Mappers.BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: Mappers.StorageError, - headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - Parameters.timeoutInSeconds, - Parameters.snapshot, - Parameters.comp25, - Parameters.listType - ], - urlParameters: [Parameters.url], - headerParameters: [ - Parameters.version, - Parameters.requestId, - Parameters.accept1, - Parameters.leaseId, - Parameters.ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/index.js -var require_operations = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - tslib_1.__exportStar(require_service(), exports2); - tslib_1.__exportStar(require_container(), exports2); - tslib_1.__exportStar(require_blob(), exports2); - tslib_1.__exportStar(require_pageBlob(), exports2); - tslib_1.__exportStar(require_appendBlob(), exports2); - tslib_1.__exportStar(require_blockBlob(), exports2); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/storageClient.js -var require_storageClient = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/storageClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageClient = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var coreHttpCompat = tslib_1.__importStar(require_commonjs9()); - var index_js_1 = require_operations(); - var StorageClient = class extends coreHttpCompat.ExtendedServiceClient { - url; - version; - /** - * Initializes a new instance of the StorageClient class. - * @param url The URL of the service account, container, or blob that is the target of the desired - * operation. - * @param options The parameter options - */ - constructor(url2, options) { - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults3 = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.29.1`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = { - ...defaults3, - ...options, - userAgentOptions: { - userAgentPrefix - }, - endpoint: options.endpoint ?? options.baseUri ?? "{url}" - }; - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2025-11-05"; - this.service = new index_js_1.ServiceImpl(this); - this.container = new index_js_1.ContainerImpl(this); - this.blob = new index_js_1.BlobImpl(this); - this.pageBlob = new index_js_1.PageBlobImpl(this); - this.appendBlob = new index_js_1.AppendBlobImpl(this); - this.blockBlob = new index_js_1.BlockBlobImpl(this); - } - service; - container; - blob; - pageBlob; - appendBlob; - blockBlob; - }; - exports2.StorageClient = StorageClient; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/service.js -var require_service2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/service.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/container.js -var require_container2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/container.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/blob.js -var require_blob2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/blob.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js -var require_pageBlob2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js -var require_appendBlob2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js -var require_blockBlob2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/index.js -var require_operationsInterfaces = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - tslib_1.__exportStar(require_service2(), exports2); - tslib_1.__exportStar(require_container2(), exports2); - tslib_1.__exportStar(require_blob2(), exports2); - tslib_1.__exportStar(require_pageBlob2(), exports2); - tslib_1.__exportStar(require_appendBlob2(), exports2); - tslib_1.__exportStar(require_blockBlob2(), exports2); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generated/src/index.js -var require_src2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generated/src/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageClient = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - tslib_1.__exportStar(require_models(), exports2); - var storageClient_js_1 = require_storageClient(); - Object.defineProperty(exports2, "StorageClient", { enumerable: true, get: function() { - return storageClient_js_1.StorageClient; - } }); - tslib_1.__exportStar(require_operationsInterfaces(), exports2); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/StorageContextClient.js -var require_StorageContextClient = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/StorageContextClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageContextClient = void 0; - var index_js_1 = require_src2(); - var StorageContextClient = class extends index_js_1.StorageClient { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = { ...operationSpec }; - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); - } - }; - exports2.StorageContextClient = StorageContextClient; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/StorageClient.js -var require_StorageClient = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/StorageClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageClient = void 0; - var StorageContextClient_js_1 = require_StorageContextClient(); - var Pipeline_js_1 = require_Pipeline(); - var utils_common_js_1 = require_utils_common(); - var StorageClient = class { - /** - * Encoded URL string value. - */ - url; - accountName; - /** - * Request policy pipeline. - * - * @internal - */ - pipeline; - /** - * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used. - */ - credential; - /** - * StorageClient is a reference to protocol layer operations entry, which is - * generated by AutoRest generator. - */ - storageClientContext; - /** - */ - isHttps; - /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. - */ - constructor(url2, pipeline2) { - this.url = (0, utils_common_js_1.escapeURLPath)(url2); - this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url2); - this.pipeline = pipeline2; - this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline2)); - this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); - this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline2); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; - } - }; - exports2.StorageClient = StorageClient; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/tracing.js -var require_tracing = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/tracing.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tracingClient = void 0; - var core_tracing_1 = require_commonjs5(); - var constants_js_1 = require_constants10(); - exports2.tracingClient = (0, core_tracing_1.createTracingClient)({ - packageName: "@azure/storage-blob", - packageVersion: constants_js_1.SDK_VERSION, - namespace: "Microsoft.Storage" - }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/BlobSASPermissions.js -var require_BlobSASPermissions = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/BlobSASPermissions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobSASPermissions = void 0; - var BlobSASPermissions = class _BlobSASPermissions { - /** - * Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an - * Error if it encounters a character that does not correspond to a valid permission. - * - * @param permissions - - */ - static parse(permissions) { - const blobSASPermissions = new _BlobSASPermissions(); - for (const char of permissions) { - switch (char) { - case "r": - blobSASPermissions.read = true; - break; - case "a": - blobSASPermissions.add = true; - break; - case "c": - blobSASPermissions.create = true; - break; - case "w": - blobSASPermissions.write = true; - break; - case "d": - blobSASPermissions.delete = true; - break; - case "x": - blobSASPermissions.deleteVersion = true; - break; - case "t": - blobSASPermissions.tag = true; - break; - case "m": - blobSASPermissions.move = true; - break; - case "e": - blobSASPermissions.execute = true; - break; - case "i": - blobSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - blobSASPermissions.permanentDelete = true; - break; - default: - throw new RangeError(`Invalid permission: ${char}`); - } - } - return blobSASPermissions; - } - /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. - * - * @param permissionLike - - */ - static from(permissionLike) { - const blobSASPermissions = new _BlobSASPermissions(); - if (permissionLike.read) { - blobSASPermissions.read = true; - } - if (permissionLike.add) { - blobSASPermissions.add = true; - } - if (permissionLike.create) { - blobSASPermissions.create = true; - } - if (permissionLike.write) { - blobSASPermissions.write = true; - } - if (permissionLike.delete) { - blobSASPermissions.delete = true; - } - if (permissionLike.deleteVersion) { - blobSASPermissions.deleteVersion = true; - } - if (permissionLike.tag) { - blobSASPermissions.tag = true; - } - if (permissionLike.move) { - blobSASPermissions.move = true; - } - if (permissionLike.execute) { - blobSASPermissions.execute = true; - } - if (permissionLike.setImmutabilityPolicy) { - blobSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - blobSASPermissions.permanentDelete = true; - } - return blobSASPermissions; - } - /** - * Specifies Read access granted. - */ - read = false; - /** - * Specifies Add access granted. - */ - add = false; - /** - * Specifies Create access granted. - */ - create = false; - /** - * Specifies Write access granted. - */ - write = false; - /** - * Specifies Delete access granted. - */ - delete = false; - /** - * Specifies Delete version access granted. - */ - deleteVersion = false; - /** - * Specfies Tag access granted. - */ - tag = false; - /** - * Specifies Move access granted. - */ - move = false; - /** - * Specifies Execute access granted. - */ - execute = false; - /** - * Specifies SetImmutabilityPolicy access granted. - */ - setImmutabilityPolicy = false; - /** - * Specifies that Permanent Delete is permitted. - */ - permanentDelete = false; - /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. - * - * @returns A string which represents the BlobSASPermissions - */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.move) { - permissions.push("m"); - } - if (this.execute) { - permissions.push("e"); - } - if (this.setImmutabilityPolicy) { - permissions.push("i"); - } - if (this.permanentDelete) { - permissions.push("y"); - } - return permissions.join(""); - } - }; - exports2.BlobSASPermissions = BlobSASPermissions; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/ContainerSASPermissions.js -var require_ContainerSASPermissions = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/ContainerSASPermissions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContainerSASPermissions = void 0; - var ContainerSASPermissions = class _ContainerSASPermissions { - /** - * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an - * Error if it encounters a character that does not correspond to a valid permission. - * - * @param permissions - - */ - static parse(permissions) { - const containerSASPermissions = new _ContainerSASPermissions(); - for (const char of permissions) { - switch (char) { - case "r": - containerSASPermissions.read = true; - break; - case "a": - containerSASPermissions.add = true; - break; - case "c": - containerSASPermissions.create = true; - break; - case "w": - containerSASPermissions.write = true; - break; - case "d": - containerSASPermissions.delete = true; - break; - case "l": - containerSASPermissions.list = true; - break; - case "t": - containerSASPermissions.tag = true; - break; - case "x": - containerSASPermissions.deleteVersion = true; - break; - case "m": - containerSASPermissions.move = true; - break; - case "e": - containerSASPermissions.execute = true; - break; - case "i": - containerSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - containerSASPermissions.permanentDelete = true; - break; - case "f": - containerSASPermissions.filterByTags = true; - break; - default: - throw new RangeError(`Invalid permission ${char}`); - } - } - return containerSASPermissions; - } - /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. - * - * @param permissionLike - - */ - static from(permissionLike) { - const containerSASPermissions = new _ContainerSASPermissions(); - if (permissionLike.read) { - containerSASPermissions.read = true; - } - if (permissionLike.add) { - containerSASPermissions.add = true; - } - if (permissionLike.create) { - containerSASPermissions.create = true; - } - if (permissionLike.write) { - containerSASPermissions.write = true; - } - if (permissionLike.delete) { - containerSASPermissions.delete = true; - } - if (permissionLike.list) { - containerSASPermissions.list = true; - } - if (permissionLike.deleteVersion) { - containerSASPermissions.deleteVersion = true; - } - if (permissionLike.tag) { - containerSASPermissions.tag = true; - } - if (permissionLike.move) { - containerSASPermissions.move = true; - } - if (permissionLike.execute) { - containerSASPermissions.execute = true; - } - if (permissionLike.setImmutabilityPolicy) { - containerSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - containerSASPermissions.permanentDelete = true; - } - if (permissionLike.filterByTags) { - containerSASPermissions.filterByTags = true; - } - return containerSASPermissions; - } - /** - * Specifies Read access granted. - */ - read = false; - /** - * Specifies Add access granted. - */ - add = false; - /** - * Specifies Create access granted. - */ - create = false; - /** - * Specifies Write access granted. - */ - write = false; - /** - * Specifies Delete access granted. - */ - delete = false; - /** - * Specifies Delete version access granted. - */ - deleteVersion = false; - /** - * Specifies List access granted. - */ - list = false; - /** - * Specfies Tag access granted. - */ - tag = false; - /** - * Specifies Move access granted. - */ - move = false; - /** - * Specifies Execute access granted. - */ - execute = false; - /** - * Specifies SetImmutabilityPolicy access granted. - */ - setImmutabilityPolicy = false; - /** - * Specifies that Permanent Delete is permitted. - */ - permanentDelete = false; - /** - * Specifies that Filter Blobs by Tags is permitted. - */ - filterByTags = false; - /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. - * - * The order of the characters should be as specified here to ensure correctness. - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.list) { - permissions.push("l"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.move) { - permissions.push("m"); - } - if (this.execute) { - permissions.push("e"); - } - if (this.setImmutabilityPolicy) { - permissions.push("i"); - } - if (this.permanentDelete) { - permissions.push("y"); - } - if (this.filterByTags) { - permissions.push("f"); - } - return permissions.join(""); - } - }; - exports2.ContainerSASPermissions = ContainerSASPermissions; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/credentials/UserDelegationKeyCredential.js -var require_UserDelegationKeyCredential = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/credentials/UserDelegationKeyCredential.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UserDelegationKeyCredential = void 0; - var node_crypto_1 = require("node:crypto"); - var UserDelegationKeyCredential = class { - /** - * Azure Storage account name; readonly. - */ - accountName; - /** - * Azure Storage user delegation key; readonly. - */ - userDelegationKey; - /** - * Key value in Buffer type. - */ - key; - /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - - */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return (0, node_crypto_1.createHmac)("sha256", this.key).update(stringToSign, "utf8").digest("base64"); - } - }; - exports2.UserDelegationKeyCredential = UserDelegationKeyCredential; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/SasIPRange.js -var require_SasIPRange = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/SasIPRange.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ipRangeToString = ipRangeToString; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/SASQueryParameters.js -var require_SASQueryParameters = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/SASQueryParameters.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SASQueryParameters = exports2.SASProtocol = void 0; - var SasIPRange_js_1 = require_SasIPRange(); - var utils_common_js_1 = require_utils_common(); - var SASProtocol; - (function(SASProtocol2) { - SASProtocol2["Https"] = "https"; - SASProtocol2["HttpsAndHttp"] = "https,http"; - })(SASProtocol || (exports2.SASProtocol = SASProtocol = {})); - var SASQueryParameters = class { - /** - * The storage API version. - */ - version; - /** - * Optional. The allowed HTTP protocol(s). - */ - protocol; - /** - * Optional. The start time for this SAS token. - */ - startsOn; - /** - * Optional only when identifier is provided. The expiry time for this SAS token. - */ - expiresOn; - /** - * Optional only when identifier is provided. - * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for - * more details. - */ - permissions; - /** - * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} - * for more details. - */ - services; - /** - * Optional. The storage resource types being accessed (only for Account SAS). Please refer to - * {@link AccountSASResourceTypes} for more details. - */ - resourceTypes; - /** - * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). - * - * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy - */ - identifier; - /** - * Optional. Encryption scope to use when sending requests authorized with this SAS URI. - */ - encryptionScope; - /** - * Optional. Specifies which resources are accessible via the SAS (only for {@link BlobSASSignatureValues}). - * @see https://learn.microsoft.com/rest/api/storageservices/create-service-sas#specifying-the-signed-resource-blob-service-only - */ - resource; - /** - * The signature for the SAS token. - */ - signature; - /** - * Value for cache-control header in Blob/File Service SAS. - */ - cacheControl; - /** - * Value for content-disposition header in Blob/File Service SAS. - */ - contentDisposition; - /** - * Value for content-encoding header in Blob/File Service SAS. - */ - contentEncoding; - /** - * Value for content-length header in Blob/File Service SAS. - */ - contentLanguage; - /** - * Value for content-type header in Blob/File Service SAS. - */ - contentType; - /** - * Inner value of getter ipRange. - */ - ipRangeInner; - /** - * The Azure Active Directory object ID in GUID format. - * Property of user delegation key. - */ - signedOid; - /** - * The Azure Active Directory tenant ID in GUID format. - * Property of user delegation key. - */ - signedTenantId; - /** - * The date-time the key is active. - * Property of user delegation key. - */ - signedStartsOn; - /** - * The date-time the key expires. - * Property of user delegation key. - */ - signedExpiresOn; - /** - * Abbreviation of the Azure Storage service that accepts the user delegation key. - * Property of user delegation key. - */ - signedService; - /** - * The service version that created the user delegation key. - * Property of user delegation key. - */ - signedVersion; - /** - * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key - * to perform the action granted by the SAS. The Azure Storage service will ensure that the owner of the user delegation key - * has the required permissions before granting access but no additional permission check for the user specified in - * this value will be performed. This is only used for User Delegation SAS. - */ - preauthorizedAgentObjectId; - /** - * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access. - * This is only used for User Delegation SAS. - */ - correlationId; - /** - * Optional. IP range allowed for this SAS. - * - * @readonly - */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) { - this.version = version; - this.signature = signature; - if (permissionsOrOptions !== void 0 && typeof permissionsOrOptions !== "string") { - this.permissions = permissionsOrOptions.permissions; - this.services = permissionsOrOptions.services; - this.resourceTypes = permissionsOrOptions.resourceTypes; - this.protocol = permissionsOrOptions.protocol; - this.startsOn = permissionsOrOptions.startsOn; - this.expiresOn = permissionsOrOptions.expiresOn; - this.ipRangeInner = permissionsOrOptions.ipRange; - this.identifier = permissionsOrOptions.identifier; - this.encryptionScope = permissionsOrOptions.encryptionScope; - this.resource = permissionsOrOptions.resource; - this.cacheControl = permissionsOrOptions.cacheControl; - this.contentDisposition = permissionsOrOptions.contentDisposition; - this.contentEncoding = permissionsOrOptions.contentEncoding; - this.contentLanguage = permissionsOrOptions.contentLanguage; - this.contentType = permissionsOrOptions.contentType; - if (permissionsOrOptions.userDelegationKey) { - this.signedOid = permissionsOrOptions.userDelegationKey.signedObjectId; - this.signedTenantId = permissionsOrOptions.userDelegationKey.signedTenantId; - this.signedStartsOn = permissionsOrOptions.userDelegationKey.signedStartsOn; - this.signedExpiresOn = permissionsOrOptions.userDelegationKey.signedExpiresOn; - this.signedService = permissionsOrOptions.userDelegationKey.signedService; - this.signedVersion = permissionsOrOptions.userDelegationKey.signedVersion; - this.preauthorizedAgentObjectId = permissionsOrOptions.preauthorizedAgentObjectId; - this.correlationId = permissionsOrOptions.correlationId; - } - } else { - this.services = services; - this.resourceTypes = resourceTypes; - this.expiresOn = expiresOn; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType; - if (userDelegationKey) { - this.signedOid = userDelegationKey.signedObjectId; - this.signedTenantId = userDelegationKey.signedTenantId; - this.signedStartsOn = userDelegationKey.signedStartsOn; - this.signedExpiresOn = userDelegationKey.signedExpiresOn; - this.signedService = userDelegationKey.signedService; - this.signedVersion = userDelegationKey.signedVersion; - this.preauthorizedAgentObjectId = preauthorizedAgentObjectId; - this.correlationId = correlationId; - } - } - } - /** - * Encodes all SAS query parameters into a string that can be appended to a URL. - * - */ - toString() { - const params = [ - "sv", - "ss", - "srt", - "spr", - "st", - "se", - "sip", - "si", - "ses", - "skoid", - // Signed object ID - "sktid", - // Signed tenant ID - "skt", - // Signed key start time - "ske", - // Signed key expiry time - "sks", - // Signed key service - "skv", - // Signed key version - "sr", - "sp", - "sig", - "rscc", - "rscd", - "rsce", - "rscl", - "rsct", - "saoid", - "scid" - ]; - const queries = []; - for (const param of params) { - switch (param) { - case "sv": - this.tryAppendQueryParameter(queries, param, this.version); - break; - case "ss": - this.tryAppendQueryParameter(queries, param, this.services); - break; - case "srt": - this.tryAppendQueryParameter(queries, param, this.resourceTypes); - break; - case "spr": - this.tryAppendQueryParameter(queries, param, this.protocol); - break; - case "st": - this.tryAppendQueryParameter(queries, param, this.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(this.ipRange) : void 0); - break; - case "si": - this.tryAppendQueryParameter(queries, param, this.identifier); - break; - case "ses": - this.tryAppendQueryParameter(queries, param, this.encryptionScope); - break; - case "skoid": - this.tryAppendQueryParameter(queries, param, this.signedOid); - break; - case "sktid": - this.tryAppendQueryParameter(queries, param, this.signedTenantId); - break; - case "skt": - this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.signedExpiresOn, false) : void 0); - break; - case "sks": - this.tryAppendQueryParameter(queries, param, this.signedService); - break; - case "skv": - this.tryAppendQueryParameter(queries, param, this.signedVersion); - break; - case "sr": - this.tryAppendQueryParameter(queries, param, this.resource); - break; - case "sp": - this.tryAppendQueryParameter(queries, param, this.permissions); - break; - case "sig": - this.tryAppendQueryParameter(queries, param, this.signature); - break; - case "rscc": - this.tryAppendQueryParameter(queries, param, this.cacheControl); - break; - case "rscd": - this.tryAppendQueryParameter(queries, param, this.contentDisposition); - break; - case "rsce": - this.tryAppendQueryParameter(queries, param, this.contentEncoding); - break; - case "rscl": - this.tryAppendQueryParameter(queries, param, this.contentLanguage); - break; - case "rsct": - this.tryAppendQueryParameter(queries, param, this.contentType); - break; - case "saoid": - this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId); - break; - case "scid": - this.tryAppendQueryParameter(queries, param, this.correlationId); - break; - } - } - return queries.join("&"); - } - /** - * A private helper method used to filter and append query key/value pairs into an array. - * - * @param queries - - * @param key - - * @param value - - */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - exports2.SASQueryParameters = SASQueryParameters; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/BlobSASSignatureValues.js -var require_BlobSASSignatureValues = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/BlobSASSignatureValues.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.generateBlobSASQueryParametersInternal = generateBlobSASQueryParametersInternal; - var BlobSASPermissions_js_1 = require_BlobSASPermissions(); - var ContainerSASPermissions_js_1 = require_ContainerSASPermissions(); - var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); - var UserDelegationKeyCredential_js_1 = require_UserDelegationKeyCredential(); - var SasIPRange_js_1 = require_SasIPRange(); - var SASQueryParameters_js_1 = require_SASQueryParameters(); - var constants_js_1 = require_constants10(); - var utils_common_js_1 = require_utils_common(); - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : constants_js_1.SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential_js_1.UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version >= "2025-07-05") { - return generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version >= "2015-04-05") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); - } else { - throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key."); - } - } - throw new RangeError("'version' must be >= '2015-04-05'."); - } - function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType), - stringToSign - }; - } - function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType), - stringToSign - }; - } - function generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, void 0, void 0, void 0, blobSASSignatureValues.encryptionScope), - stringToSign - }; - } - function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey), - stringToSign - }; - } - function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId), - stringToSign - }; - } - function generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope), - stringToSign - }; - } - function generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - void 0, - // SignedKeyDelegatedUserTenantId, will be added in a future release. - void 0, - // SignedDelegatedUserObjectId, will be added in future release. - blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope), - stringToSign - }; - } - function getCanonicalName(accountName, containerName, blobName) { - const elements = [`/blob/${accountName}/${containerName}`]; - if (blobName) { - elements.push(`/${blobName}`); - } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : constants_js_1.SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); - } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); - } - if (blobSASSignatureValues.versionId && version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); - } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); - } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); - } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); - } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); - } - if (version < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { - throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission."); - } - if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); - } - if (version < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); - } - if (blobSASSignatureValues.encryptionScope && version < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); - } - blobSASSignatureValues.version = version; - return blobSASSignatureValues; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BlobLeaseClient.js -var require_BlobLeaseClient = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BlobLeaseClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobLeaseClient = void 0; - var core_util_1 = require_commonjs4(); - var constants_js_1 = require_constants10(); - var tracing_js_1 = require_tracing(); - var utils_common_js_1 = require_utils_common(); - var BlobLeaseClient = class { - _leaseId; - _url; - _containerOrBlobOperation; - _isContainer; - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; - } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; - } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId) { - const clientContext = client.storageClientContext; - this._url = client.url; - if (client.name === void 0) { - this._isContainer = true; - this._containerOrBlobOperation = clientContext.container; - } else { - this._isContainer = false; - this._containerOrBlobOperation = clientContext.blob; - } - if (!leaseId) { - leaseId = (0, core_util_1.randomUUID)(); - } - this._leaseId = leaseId; - } - /** - * Establishes and manages a lock on a container for delete operations, or on a blob - * for write and delete operations. - * The lock duration can be 15 to 60 seconds, or can be infinite. - * @see https://learn.microsoft.com/rest/api/storageservices/lease-container - * and - * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob - * - * @param duration - Must be between 15 to 60 seconds, or infinite (-1) - * @param options - option to configure lease management operations. - * @returns Response data for acquire lease operation. - */ - async acquireLease(duration, options = {}) { - if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.tagConditions)) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * To change the ID of the lease. - * @see https://learn.microsoft.com/rest/api/storageservices/lease-container - * and - * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob - * - * @param proposedLeaseId - the proposed new lease Id. - * @param options - option to configure lease management operations. - * @returns Response data for change lease operation. - */ - async changeLease(proposedLeaseId, options = {}) { - if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.tagConditions)) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId; - return response; - }); - } - /** - * To free the lease if it is no longer needed so that another client may - * immediately acquire a lease against the container or the blob. - * @see https://learn.microsoft.com/rest/api/storageservices/lease-container - * and - * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.tagConditions)) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * To renew the lease. - * @see https://learn.microsoft.com/rest/api/storageservices/lease-container - * and - * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.tagConditions)) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - }); - }); - } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://learn.microsoft.com/rest/api/storageservices/lease-container - * and - * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob - * - * @param breakPeriod - Break period - * @param options - Optional options to configure lease management operations. - * @returns Response data for break lease operation. - */ - async breakLease(breakPeriod, options = {}) { - if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.tagConditions)) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - }; - return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); - } - }; - exports2.BlobLeaseClient = BlobLeaseClient; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/RetriableReadableStream.js -var require_RetriableReadableStream = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/RetriableReadableStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetriableReadableStream = void 0; - var abort_controller_1 = require_commonjs11(); - var node_stream_1 = require("node:stream"); - var RetriableReadableStream = class extends node_stream_1.Readable { - start; - offset; - end; - getter; - source; - retries = 0; - maxRetryRequests; - onProgress; - options; - /** - * Creates an instance of RetriableReadableStream. - * - * @param source - The current ReadableStream returned from getter - * @param getter - A method calling downloading request returning - * a new ReadableStream from specified offset - * @param offset - Offset position in original data source to read - * @param count - How much data in original data source to read - * @param options - - */ - constructor(source, getter, offset, count, options = {}) { - super({ highWaterMark: options.highWaterMark }); - this.getter = getter; - this.source = source; - this.start = offset; - this.offset = offset; - this.end = offset + count - 1; - this.maxRetryRequests = options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0; - this.onProgress = options.onProgress; - this.options = options; - this.setSourceEventHandlers(); - } - _read() { - this.source.resume(); - } - setSourceEventHandlers() { - this.source.on("data", this.sourceDataHandler); - this.source.on("end", this.sourceErrorOrEndHandler); - this.source.on("error", this.sourceErrorOrEndHandler); - this.source.on("aborted", this.sourceAbortedHandler); - } - removeSourceEventHandlers() { - this.source.removeListener("data", this.sourceDataHandler); - this.source.removeListener("end", this.sourceErrorOrEndHandler); - this.source.removeListener("error", this.sourceErrorOrEndHandler); - this.source.removeListener("aborted", this.sourceAbortedHandler); - } - sourceDataHandler = (data) => { - if (this.options.doInjectErrorOnce) { - this.options.doInjectErrorOnce = void 0; - this.source.pause(); - this.sourceErrorOrEndHandler(); - this.source.destroy(); - return; - } - this.offset += data.length; - if (this.onProgress) { - this.onProgress({ loadedBytes: this.offset - this.start }); - } - if (!this.push(data)) { - this.source.pause(); - } - }; - sourceAbortedHandler = () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - sourceErrorOrEndHandler = (err) => { - if (err && err.name === "AbortError") { - this.destroy(err); - return; - } - this.removeSourceEventHandlers(); - if (this.offset - 1 === this.end) { - this.push(null); - } else if (this.offset <= this.end) { - if (this.retries < this.maxRetryRequests) { - this.retries += 1; - this.getter(this.offset).then((newSource) => { - this.source = newSource; - this.setSourceEventHandlers(); - return; - }).catch((error3) => { - this.destroy(error3); - }); - } else { - this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`)); - } - } else { - this.destroy(new Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset - 1}`)); - } - }; - _destroy(error3, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error3 === null ? void 0 : error3); - } - }; - exports2.RetriableReadableStream = RetriableReadableStream; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BlobDownloadResponse.js -var require_BlobDownloadResponse = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BlobDownloadResponse.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobDownloadResponse = void 0; - var core_util_1 = require_commonjs4(); - var RetriableReadableStream_js_1 = require_RetriableReadableStream(); - var BlobDownloadResponse = class { - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; - } - /** - * Returns if it was previously specified - * for the file. - * - * @readonly - */ - get cacheControl() { - return this.originalResponse.cacheControl; - } - /** - * Returns the value that was specified - * for the 'x-ms-content-disposition' header and specifies how to process the - * response. - * - * @readonly - */ - get contentDisposition() { - return this.originalResponse.contentDisposition; - } - /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; - } - /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. - * - * @readonly - */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; - } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. - * - * @readonly - */ - get contentLength() { - return this.originalResponse.contentLength; - } - /** - * If the file has an MD5 hash and the - * request is to read the full file, this response header is returned so that - * the client can check for message content integrity. If the request is to - * read a specified range and the 'x-ms-range-get-content-md5' is set to - * true, then the request returns an MD5 hash for the range, as long as the - * range size is less than or equal to 4 MB. If neither of these sets of - * conditions is true, then no value is returned for the 'Content-MD5' - * header. - * - * @readonly - */ - get contentMD5() { - return this.originalResponse.contentMD5; - } - /** - * Indicates the range of bytes returned if - * the client requested a subset of the file by setting the Range request - * header. - * - * @readonly - */ - get contentRange() { - return this.originalResponse.contentRange; - } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly - */ - get contentType() { - return this.originalResponse.contentType; - } - /** - * Conclusion time of the last attempted - * Copy File operation where this file was the destination file. This value - * can specify the time of a completed, aborted, or failed copy attempt. - * - * @readonly - */ - get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly - */ - get copyId() { - return this.originalResponse.copyId; - } - /** - * Contains the number of bytes copied and - * the total bytes in the source in the last attempted Copy File operation - * where this file was the destination file. Can show between 0 and - * Content-Length bytes copied. - * - * @readonly - */ - get copyProgress() { - return this.originalResponse.copyProgress; - } - /** - * URL up to 2KB in length that specifies the - * source file used in the last attempted Copy File operation where this file - * was the destination file. - * - * @readonly - */ - get copySource() { - return this.originalResponse.copySource; - } - /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' - * - * @readonly - */ - get copyStatus() { - return this.originalResponse.copyStatus; - } - /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. - * - * @readonly - */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; - } - /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; - } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly - */ - get leaseStatus() { - return this.originalResponse.leaseStatus; - } - /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. - * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. - * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } - /** - * The error code. - * - * @readonly - */ - get errorCode() { - return this.originalResponse.errorCode; - } - /** - * The value of this header is set to - * true if the file data and application metadata are completely encrypted - * using the specified algorithm. Otherwise, the value is set to false (when - * the file is unencrypted, or if only parts of the file/application metadata - * are encrypted). - * - * @readonly - */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; - } - /** - * If the blob has a MD5 hash, and if - * request contains range header (Range or x-ms-range), this response header - * is returned with the value of the whole blob's MD5 value. This value may - * or may not be equal to the value returned in Content-MD5 header, with the - * latter calculated from the requested range. - * - * @readonly - */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; - } - /** - * Returns the date and time the file was last - * modified. Any operation that modifies the file or its properties updates - * the last modified time. - * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * Returns the UTC date and time generated by the service that indicates the time at which the blob was - * last read or written to. - * - * @readonly - */ - get lastAccessed() { - return this.originalResponse.lastAccessed; - } - /** - * Returns the date and time the blob was created. - * - * @readonly - */ - get createdOn() { - return this.originalResponse.createdOn; - } - /** - * A name-value pair - * to associate with a file storage object. - * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. - * - * @readonly - */ - get requestId() { - return this.originalResponse.requestId; - } - /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. - * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the Blob service used - * to execute the request. - * - * @readonly - */ - get version() { - return this.originalResponse.version; - } - /** - * Indicates the versionId of the downloaded blob version. - * - * @readonly - */ - get versionId() { - return this.originalResponse.versionId; - } - /** - * Indicates whether version of this blob is a current version. - * - * @readonly - */ - get isCurrentVersion() { - return this.originalResponse.isCurrentVersion; - } - /** - * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned - * when the blob was encrypted with a customer-provided key. - * - * @readonly - */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; - } - /** - * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to - * true, then the request returns a crc64 for the range, as long as the range size is less than - * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is - * specified in the same request, it will fail with 400(Bad Request) - */ - get contentCrc64() { - return this.originalResponse.contentCrc64; - } - /** - * Object Replication Policy Id of the destination blob. - * - * @readonly - */ - get objectReplicationDestinationPolicyId() { - return this.originalResponse.objectReplicationDestinationPolicyId; - } - /** - * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. - * - * @readonly - */ - get objectReplicationSourceProperties() { - return this.originalResponse.objectReplicationSourceProperties; - } - /** - * If this blob has been sealed. - * - * @readonly - */ - get isSealed() { - return this.originalResponse.isSealed; - } - /** - * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. - * - * @readonly - */ - get immutabilityPolicyExpiresOn() { - return this.originalResponse.immutabilityPolicyExpiresOn; - } - /** - * Indicates immutability policy mode. - * - * @readonly - */ - get immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; - } - /** - * Indicates if a legal hold is present on the blob. - * - * @readonly - */ - get legalHold() { - return this.originalResponse.legalHold; - } - /** - * The response body as a browser Blob. - * Always undefined in node.js. - * - * @readonly - */ - get contentAsBlob() { - return this.originalResponse.blobBody; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. - * - * It will automatically retry when internal read stream unexpected ends. - * - * @readonly - */ - get readableStreamBody() { - return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - originalResponse; - blobDownloadStream; - /** - * Creates an instance of BlobDownloadResponse. - * - * @param originalResponse - - * @param getter - - * @param offset - - * @param count - - * @param options - - */ - constructor(originalResponse, getter, offset, count, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream_js_1.RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); - } - }; - exports2.BlobDownloadResponse = BlobDownloadResponse; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroConstants.js -var require_AvroConstants = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroConstants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AVRO_SCHEMA_KEY = exports2.AVRO_CODEC_KEY = exports2.AVRO_INIT_BYTES = exports2.AVRO_SYNC_MARKER_SIZE = void 0; - exports2.AVRO_SYNC_MARKER_SIZE = 16; - exports2.AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - exports2.AVRO_CODEC_KEY = "avro.codec"; - exports2.AVRO_SCHEMA_KEY = "avro.schema"; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroParser.js -var require_AvroParser = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroParser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AvroType = exports2.AvroParser = void 0; - var AvroParser = class _AvroParser { - /** - * Reads a fixed number of bytes from the stream. - * - * @param stream - - * @param length - - * @param options - - */ - static async readFixedBytes(stream2, length, options = {}) { - const bytes = await stream2.read(length, { abortSignal: options.abortSignal }); - if (bytes.length !== length) { - throw new Error("Hit stream end."); - } - return bytes; - } - /** - * Reads a single byte from the stream. - * - * @param stream - - * @param options - - */ - static async readByte(stream2, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream2, 1, options); - return buf[0]; - } - // int and long are stored in variable-length zig-zag coding. - // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt - // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types - static async readZigZagLong(stream2, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await _AvroParser.readByte(stream2, options); - haveMoreByte = byte & 128; - zigZagEncoded |= (byte & 127) << significanceInBit; - significanceInBit += 7; - } while (haveMoreByte && significanceInBit < 28); - if (haveMoreByte) { - zigZagEncoded = zigZagEncoded; - significanceInFloat = 268435456; - do { - byte = await _AvroParser.readByte(stream2, options); - zigZagEncoded += (byte & 127) * significanceInFloat; - significanceInFloat *= 128; - } while (byte & 128); - const res = (zigZagEncoded % 2 ? -(zigZagEncoded + 1) : zigZagEncoded) / 2; - if (res < Number.MIN_SAFE_INTEGER || res > Number.MAX_SAFE_INTEGER) { - throw new Error("Integer overflow."); - } - return res; - } - return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); - } - static async readLong(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); - } - static async readInt(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); - } - static async readNull() { - return null; - } - static async readBoolean(stream2, options = {}) { - const b = await _AvroParser.readByte(stream2, options); - if (b === 1) { - return true; - } else if (b === 0) { - return false; - } else { - throw new Error("Byte was not a boolean."); - } - } - static async readFloat(stream2, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream2, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); - } - static async readDouble(stream2, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream2, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); - } - static async readBytes(stream2, options = {}) { - const size = await _AvroParser.readLong(stream2, options); - if (size < 0) { - throw new Error("Bytes size was negative."); - } - return stream2.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream2, options = {}) { - const u8arr = await _AvroParser.readBytes(stream2, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); - } - static async readMapPair(stream2, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream2, options); - const value = await readItemMethod(stream2, options); - return { key, value }; - } - static async readMap(stream2, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs = await _AvroParser.readArray(stream2, readPairMethod, options); - const dict = {}; - for (const pair of pairs) { - dict[pair.key] = pair.value; - } - return dict; - } - static async readArray(stream2, readItemMethod, options = {}) { - const items = []; - for (let count = await _AvroParser.readLong(stream2, options); count !== 0; count = await _AvroParser.readLong(stream2, options)) { - if (count < 0) { - await _AvroParser.readLong(stream2, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream2, options); - items.push(item); - } - } - return items; - } - }; - exports2.AvroParser = AvroParser; - var AvroComplex; - (function(AvroComplex2) { - AvroComplex2["RECORD"] = "record"; - AvroComplex2["ENUM"] = "enum"; - AvroComplex2["ARRAY"] = "array"; - AvroComplex2["MAP"] = "map"; - AvroComplex2["UNION"] = "union"; - AvroComplex2["FIXED"] = "fixed"; - })(AvroComplex || (AvroComplex = {})); - var AvroPrimitive; - (function(AvroPrimitive2) { - AvroPrimitive2["NULL"] = "null"; - AvroPrimitive2["BOOLEAN"] = "boolean"; - AvroPrimitive2["INT"] = "int"; - AvroPrimitive2["LONG"] = "long"; - AvroPrimitive2["FLOAT"] = "float"; - AvroPrimitive2["DOUBLE"] = "double"; - AvroPrimitive2["BYTES"] = "bytes"; - AvroPrimitive2["STRING"] = "string"; - })(AvroPrimitive || (AvroPrimitive = {})); - var AvroType = class _AvroType { - /** - * Determines the AvroType from the Avro Schema. - */ - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - static fromSchema(schema) { - if (typeof schema === "string") { - return _AvroType.fromStringSchema(schema); - } else if (Array.isArray(schema)) { - return _AvroType.fromArraySchema(schema); - } else { - return _AvroType.fromObjectSchema(schema); - } - } - static fromStringSchema(schema) { - switch (schema) { - case AvroPrimitive.NULL: - case AvroPrimitive.BOOLEAN: - case AvroPrimitive.INT: - case AvroPrimitive.LONG: - case AvroPrimitive.FLOAT: - case AvroPrimitive.DOUBLE: - case AvroPrimitive.BYTES: - case AvroPrimitive.STRING: - return new AvroPrimitiveType(schema); - default: - throw new Error(`Unexpected Avro type ${schema}`); - } - } - static fromArraySchema(schema) { - return new AvroUnionType(schema.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema) { - const type = schema.type; - try { - return _AvroType.fromStringSchema(type); - } catch { - } - switch (type) { - case AvroComplex.RECORD: - if (schema.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema}`); - } - if (!schema.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`); - } - const fields = {}; - if (!schema.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`); - } - for (const field of schema.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema.name); - case AvroComplex.ENUM: - if (schema.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema}`); - } - if (!schema.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema}`); - } - return new AvroEnumType(schema.symbols); - case AvroComplex.MAP: - if (!schema.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema}`); - } - return new AvroMapType(_AvroType.fromSchema(schema.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type} in ${schema}`); - } - } - }; - exports2.AvroType = AvroType; - var AvroPrimitiveType = class extends AvroType { - _primitive; - constructor(primitive) { - super(); - this._primitive = primitive; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream2, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream2, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream2, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream2, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream2, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream2, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream2, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream2, options); - default: - throw new Error("Unknown Avro Primitive"); - } - } - }; - var AvroEnumType = class extends AvroType { - _symbols; - constructor(symbols) { - super(); - this._symbols = symbols; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream2, options = {}) { - const value = await AvroParser.readInt(stream2, options); - return this._symbols[value]; - } - }; - var AvroUnionType = class extends AvroType { - _types; - constructor(types2) { - super(); - this._types = types2; - } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); - } - }; - var AvroMapType = class extends AvroType { - _itemType; - constructor(itemType) { - super(); - this._itemType = itemType; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream2, options = {}) { - const readItemMethod = (s, opts) => { - return this._itemType.read(s, opts); - }; - return AvroParser.readMap(stream2, readItemMethod, options); - } - }; - var AvroRecordType = class extends AvroType { - _name; - _fields; - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream2, options = {}) { - const record = {}; - record["$schema"] = this._name; - for (const key in this._fields) { - if (Object.prototype.hasOwnProperty.call(this._fields, key)) { - record[key] = await this._fields[key].read(stream2, options); - } - } - return record; - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/utils/utils.common.js -var require_utils_common3 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/utils/utils.common.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.arraysEqual = arraysEqual; - function arraysEqual(a, b) { - if (a === b) - return true; - if (a == null || b == null) - return false; - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; ++i) { - if (a[i] !== b[i]) - return false; - } - return true; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReader.js -var require_AvroReader = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReader.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AvroReader = void 0; - var AvroConstants_js_1 = require_AvroConstants(); - var AvroParser_js_1 = require_AvroParser(); - var utils_common_js_1 = require_utils_common3(); - var AvroReader = class { - _dataStream; - _headerStream; - _syncMarker; - _metadata; - _itemType; - _itemsRemainingInBlock; - // Remembers where we started if partial data stream was provided. - _initialBlockOffset; - /// The byte offset within the Avro file (both header and data) - /// of the start of the current block. - _blockOffset; - get blockOffset() { - return this._blockOffset; - } - _objectIndex; - get objectIndex() { - return this._objectIndex; - } - _initialized; - constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) { - this._dataStream = dataStream; - this._headerStream = headerStream || dataStream; - this._initialized = false; - this._blockOffset = currentBlockOffset || 0; - this._objectIndex = indexWithinCurrentBlock || 0; - this._initialBlockOffset = currentBlockOffset || 0; - } - async initialize(options = {}) { - const header = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!(0, utils_common_js_1.arraysEqual)(header, AvroConstants_js_1.AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser_js_1.AvroParser.readMap(this._headerStream, AvroParser_js_1.AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AvroConstants_js_1.AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); - } - this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); - this._itemType = AvroParser_js_1.AvroType.fromSchema(schema); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser_js_1.AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - }); - await AvroParser_js_1.AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); - this._initialized = true; - if (this._objectIndex && this._objectIndex > 0) { - for (let i = 0; i < this._objectIndex; i++) { - await this._itemType.read(this._dataStream, { abortSignal: options.abortSignal }); - this._itemsRemainingInBlock--; - } - } - } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; - } - async *parseObjects(options = {}) { - if (!this._initialized) { - await this.initialize(options); - } - while (this.hasNext()) { - const result = await this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - }); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker = await AvroParser_js_1.AvroParser.readFixedBytes(this._dataStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!(0, utils_common_js_1.arraysEqual)(this._syncMarker, marker)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = await AvroParser_js_1.AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - }); - } catch { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - await AvroParser_js_1.AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); - } - } - yield result; - } - } - }; - exports2.AvroReader = AvroReader; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReadable.js -var require_AvroReadable = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReadable.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AvroReadable = void 0; - var AvroReadable = class { - }; - exports2.AvroReadable = AvroReadable; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReadableFromStream.js -var require_AvroReadableFromStream = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReadableFromStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AvroReadableFromStream = void 0; - var AvroReadable_js_1 = require_AvroReadable(); - var abort_controller_1 = require_commonjs11(); - var buffer_1 = require("buffer"); - var ABORT_ERROR = new abort_controller_1.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable_js_1.AvroReadable { - _position; - _readable; - toUint8Array(data) { - if (typeof data === "string") { - return buffer_1.Buffer.from(data); - } - return data; - } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; - } - get position() { - return this._position; - } - async read(size, options = {}) { - if (options.abortSignal?.aborted) { - throw ABORT_ERROR; - } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); - } - if (size === 0) { - return new Uint8Array(); - } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); - } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve14, reject) => { - const cleanUp = () => { - this._readable.removeListener("readable", readableCallback); - this._readable.removeListener("error", rejectCallback); - this._readable.removeListener("end", rejectCallback); - this._readable.removeListener("close", rejectCallback); - if (options.abortSignal) { - options.abortSignal.removeEventListener("abort", abortHandler); - } - }; - const readableCallback = () => { - const callbackChunk = this._readable.read(size); - if (callbackChunk) { - this._position += callbackChunk.length; - cleanUp(); - resolve14(this.toUint8Array(callbackChunk)); - } - }; - const rejectCallback = () => { - cleanUp(); - reject(); - }; - const abortHandler = () => { - cleanUp(); - reject(ABORT_ERROR); - }; - this._readable.on("readable", readableCallback); - this._readable.once("error", rejectCallback); - this._readable.once("end", rejectCallback); - this._readable.once("close", rejectCallback); - if (options.abortSignal) { - options.abortSignal.addEventListener("abort", abortHandler); - } - }); - } - } - }; - exports2.AvroReadableFromStream = AvroReadableFromStream; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/index.js -var require_internal_avro = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AvroReadableFromStream = exports2.AvroReadable = exports2.AvroReader = void 0; - var AvroReader_js_1 = require_AvroReader(); - Object.defineProperty(exports2, "AvroReader", { enumerable: true, get: function() { - return AvroReader_js_1.AvroReader; - } }); - var AvroReadable_js_1 = require_AvroReadable(); - Object.defineProperty(exports2, "AvroReadable", { enumerable: true, get: function() { - return AvroReadable_js_1.AvroReadable; - } }); - var AvroReadableFromStream_js_1 = require_AvroReadableFromStream(); - Object.defineProperty(exports2, "AvroReadableFromStream", { enumerable: true, get: function() { - return AvroReadableFromStream_js_1.AvroReadableFromStream; - } }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/BlobQuickQueryStream.js -var require_BlobQuickQueryStream = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/BlobQuickQueryStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobQuickQueryStream = void 0; - var node_stream_1 = require("node:stream"); - var index_js_1 = require_internal_avro(); - var BlobQuickQueryStream = class extends node_stream_1.Readable { - source; - avroReader; - avroIter; - avroPaused = true; - onProgress; - onError; - /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - - */ - constructor(source, options = {}) { - super(); - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new index_js_1.AvroReader(new index_js_1.AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); - } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); - } - } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema = obj.$schema; - if (typeof schema !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema) { - case "com.microsoft.azure.storage.queryBlobContents.resultData": - { - const data = obj.data; - if (data instanceof Uint8Array === false) { - throw Error("Invalid data in avro result record."); - } - if (!this.push(Buffer.from(data))) { - this.avroPaused = true; - } - } - break; - case "com.microsoft.azure.storage.queryBlobContents.progress": - { - const bytesScanned = obj.bytesScanned; - if (typeof bytesScanned !== "number") { - throw Error("Invalid bytesScanned in avro progress record."); - } - if (this.onProgress) { - this.onProgress({ loadedBytes: bytesScanned }); - } - } - break; - case "com.microsoft.azure.storage.queryBlobContents.end": - if (this.onProgress) { - const totalBytes = obj.totalBytes; - if (typeof totalBytes !== "number") { - throw Error("Invalid totalBytes in avro end record."); - } - this.onProgress({ loadedBytes: totalBytes }); - } - this.push(null); - break; - case "com.microsoft.azure.storage.queryBlobContents.error": - if (this.onError) { - const fatal = obj.fatal; - if (typeof fatal !== "boolean") { - throw Error("Invalid fatal in avro error record."); - } - const name = obj.name; - if (typeof name !== "string") { - throw Error("Invalid name in avro error record."); - } - const description = obj.description; - if (typeof description !== "string") { - throw Error("Invalid description in avro error record."); - } - const position = obj.position; - if (typeof position !== "number") { - throw Error("Invalid position in avro error record."); - } - this.onError({ - position, - name, - isFatal: fatal, - description - }); - } - break; - default: - throw Error(`Unknown schema ${schema} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); - } - }; - exports2.BlobQuickQueryStream = BlobQuickQueryStream; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BlobQueryResponse.js -var require_BlobQueryResponse = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BlobQueryResponse.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobQueryResponse = void 0; - var core_util_1 = require_commonjs4(); - var BlobQuickQueryStream_js_1 = require_BlobQuickQueryStream(); - var BlobQueryResponse = class { - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; - } - /** - * Returns if it was previously specified - * for the file. - * - * @readonly - */ - get cacheControl() { - return this.originalResponse.cacheControl; - } - /** - * Returns the value that was specified - * for the 'x-ms-content-disposition' header and specifies how to process the - * response. - * - * @readonly - */ - get contentDisposition() { - return this.originalResponse.contentDisposition; - } - /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; - } - /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. - * - * @readonly - */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; - } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. - * - * @readonly - */ - get contentLength() { - return this.originalResponse.contentLength; - } - /** - * If the file has an MD5 hash and the - * request is to read the full file, this response header is returned so that - * the client can check for message content integrity. If the request is to - * read a specified range and the 'x-ms-range-get-content-md5' is set to - * true, then the request returns an MD5 hash for the range, as long as the - * range size is less than or equal to 4 MB. If neither of these sets of - * conditions is true, then no value is returned for the 'Content-MD5' - * header. - * - * @readonly - */ - get contentMD5() { - return this.originalResponse.contentMD5; - } - /** - * Indicates the range of bytes returned if - * the client requested a subset of the file by setting the Range request - * header. - * - * @readonly - */ - get contentRange() { - return this.originalResponse.contentRange; - } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly - */ - get contentType() { - return this.originalResponse.contentType; - } - /** - * Conclusion time of the last attempted - * Copy File operation where this file was the destination file. This value - * can specify the time of a completed, aborted, or failed copy attempt. - * - * @readonly - */ - get copyCompletedOn() { - return void 0; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly - */ - get copyId() { - return this.originalResponse.copyId; - } - /** - * Contains the number of bytes copied and - * the total bytes in the source in the last attempted Copy File operation - * where this file was the destination file. Can show between 0 and - * Content-Length bytes copied. - * - * @readonly - */ - get copyProgress() { - return this.originalResponse.copyProgress; - } - /** - * URL up to 2KB in length that specifies the - * source file used in the last attempted Copy File operation where this file - * was the destination file. - * - * @readonly - */ - get copySource() { - return this.originalResponse.copySource; - } - /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' - * - * @readonly - */ - get copyStatus() { - return this.originalResponse.copyStatus; - } - /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. - * - * @readonly - */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; - } - /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; - } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly - */ - get leaseStatus() { - return this.originalResponse.leaseStatus; - } - /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. - * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. - * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The error code. - * - * @readonly - */ - get errorCode() { - return this.originalResponse.errorCode; - } - /** - * The value of this header is set to - * true if the file data and application metadata are completely encrypted - * using the specified algorithm. Otherwise, the value is set to false (when - * the file is unencrypted, or if only parts of the file/application metadata - * are encrypted). - * - * @readonly - */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; - } - /** - * If the blob has a MD5 hash, and if - * request contains range header (Range or x-ms-range), this response header - * is returned with the value of the whole blob's MD5 value. This value may - * or may not be equal to the value returned in Content-MD5 header, with the - * latter calculated from the requested range. - * - * @readonly - */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; - } - /** - * Returns the date and time the file was last - * modified. Any operation that modifies the file or its properties updates - * the last modified time. - * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * A name-value pair - * to associate with a file storage object. - * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. - * - * @readonly - */ - get requestId() { - return this.originalResponse.requestId; - } - /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. - * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the File service used - * to execute the request. - * - * @readonly - */ - get version() { - return this.originalResponse.version; - } - /** - * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned - * when the blob was encrypted with a customer-provided key. - * - * @readonly - */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; - } - /** - * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to - * true, then the request returns a crc64 for the range, as long as the range size is less than - * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is - * specified in the same request, it will fail with 400(Bad Request) - */ - get contentCrc64() { - return this.originalResponse.contentCrc64; - } - /** - * The response body as a browser Blob. - * Always undefined in node.js. - * - * @readonly - */ - get blobBody() { - return void 0; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. - * - * It will parse avor data returned by blob query. - * - * @readonly - */ - get readableStreamBody() { - return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - originalResponse; - blobDownloadStream; - /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - - */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream_js_1.BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlobQueryResponse = BlobQueryResponse; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/models.js -var require_models2 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/models.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StorageBlobAudience = exports2.PremiumPageBlobTier = exports2.BlockBlobTier = void 0; - exports2.toAccessTier = toAccessTier; - exports2.ensureCpkIfSpecified = ensureCpkIfSpecified; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - var constants_js_1 = require_constants10(); - var BlockBlobTier; - (function(BlockBlobTier2) { - BlockBlobTier2["Hot"] = "Hot"; - BlockBlobTier2["Cool"] = "Cool"; - BlockBlobTier2["Cold"] = "Cold"; - BlockBlobTier2["Archive"] = "Archive"; - })(BlockBlobTier || (exports2.BlockBlobTier = BlockBlobTier = {})); - var PremiumPageBlobTier; - (function(PremiumPageBlobTier2) { - PremiumPageBlobTier2["P4"] = "P4"; - PremiumPageBlobTier2["P6"] = "P6"; - PremiumPageBlobTier2["P10"] = "P10"; - PremiumPageBlobTier2["P15"] = "P15"; - PremiumPageBlobTier2["P20"] = "P20"; - PremiumPageBlobTier2["P30"] = "P30"; - PremiumPageBlobTier2["P40"] = "P40"; - PremiumPageBlobTier2["P50"] = "P50"; - PremiumPageBlobTier2["P60"] = "P60"; - PremiumPageBlobTier2["P70"] = "P70"; - PremiumPageBlobTier2["P80"] = "P80"; - })(PremiumPageBlobTier || (exports2.PremiumPageBlobTier = PremiumPageBlobTier = {})); - function toAccessTier(tier) { - if (tier === void 0) { - return void 0; - } - return tier; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); - } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25; - } - } - var StorageBlobAudience; - (function(StorageBlobAudience2) { - StorageBlobAudience2["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience2["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(StorageBlobAudience || (exports2.StorageBlobAudience = StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/PageBlobRangeResponse.js -var require_PageBlobRangeResponse = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/PageBlobRangeResponse.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.rangeResponseFromModel = rangeResponseFromModel; - function rangeResponseFromModel(response) { - const pageRange = (response._response.parsedBody.pageRange || []).map((x) => ({ - offset: x.start, - count: x.end - x.start - })); - const clearRange = (response._response.parsedBody.clearRange || []).map((x) => ({ - offset: x.start, - count: x.end - x.start - })); - return { - ...response, - pageRange, - clearRange, - _response: { - ...response._response, - parsedBody: { - pageRange, - clearRange - } - } - }; - } - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/logger.js -var require_logger2 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/logger.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_1 = require_commonjs2(); - exports2.logger = (0, logger_1.createClientLogger)("core-lro"); - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/poller/constants.js -var require_constants12 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/poller/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.terminalStates = exports2.POLL_INTERVAL_IN_MS = void 0; - exports2.POLL_INTERVAL_IN_MS = 2e3; - exports2.terminalStates = ["succeeded", "canceled", "failed"]; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/poller/operation.js -var require_operation = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/poller/operation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.pollOperation = exports2.initOperation = exports2.deserializeState = void 0; - var logger_js_1 = require_logger2(); - var constants_js_1 = require_constants12(); - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - exports2.deserializeState = deserializeState; - function setStateError(inputs) { - const { state, stateProxy, isOperationError } = inputs; - return (error3) => { - if (isOperationError(error3)) { - stateProxy.setError(state, error3); - stateProxy.setFailed(state); - } - throw error3; - }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; - } - return message + " " + innerMessage; - } - function simplifyError(err) { - let message = err.message; - let code = err.code; - let curErr = err; - while (curErr.innererror) { - curErr = curErr.innererror; - code = curErr.code; - message = appendReadableErrorMessage(message, curErr.message); - } - return { - code, - message - }; - } - function processOperationStatus(result) { - const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; - switch (status) { - case "succeeded": { - stateProxy.setSucceeded(state); - break; - } - case "failed": { - const err = getError === null || getError === void 0 ? void 0 : getError(response); - let postfix = ""; - if (err) { - const { code, message } = simplifyError(err); - postfix = `. ${code}. ${message}`; - } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - logger_js_1.logger.warning(errStr); - break; - } - case "canceled": { - stateProxy.setCanceled(state); - break; - } - } - if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || isDone === void 0 && ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status)) { - stateProxy.setResult(state, buildResult({ - response, - state, - processResult - })); - } - } - function buildResult(inputs) { - const { processResult, response, state } = inputs; - return processResult ? processResult(response, state) : response; - } - async function initOperation(inputs) { - const { init: init2, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init2(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation - }; - logger_js_1.logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; - } - exports2.initOperation = initOperation; - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError - })); - const status = getOperationStatus(response, state); - logger_js_1.logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${constants_js_1.terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), - status - }; - } - } - return { response, status }; - } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus, - state, - stateProxy, - operationLocation, - getResourceLocation, - isOperationError, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!constants_js_1.terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state); - if (location !== void 0) { - const isUpdated = operationLocation !== location; - state.config.operationLocation = location; - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated); - } else - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - } - updateState === null || updateState === void 0 ? void 0 : updateState(state, response); - } - } - exports2.pollOperation = pollOperation; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/http/operation.js -var require_operation2 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/http/operation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.pollHttpOperation = exports2.isOperationError = exports2.getResourceLocation = exports2.getOperationStatus = exports2.getOperationLocation = exports2.initHttpOperation = exports2.getStatusFromInitialResponse = exports2.getErrorFromResponse = exports2.parseRetryAfter = exports2.inferLroMode = void 0; - var operation_js_1 = require_operation(); - var logger_js_1 = require_logger2(); - function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; - } - function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; - } - function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; - } - function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; - } - function findResourceLocation(inputs) { - var _a2; - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - case "PATCH": { - return (_a2 = getDefault()) !== null && _a2 !== void 0 ? _a2 : requestPath; - } - default: { - return getDefault(); - } - } - function getDefault() { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } - } - } - } - function inferLroMode(inputs) { - const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; - const operationLocation = getOperationLocationHeader(rawResponse); - const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); - const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); - const location = getLocationHeader(rawResponse); - const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase(); - if (pollingUrl !== void 0) { - return { - mode: "OperationLocation", - operationLocation: pollingUrl, - resourceLocation: findResourceLocation({ - requestMethod: normalizedRequestMethod, - location, - requestPath, - resourceLocationConfig - }) - }; - } else if (location !== void 0) { - return { - mode: "ResourceLocation", - operationLocation: location - }; - } else if (normalizedRequestMethod === "PUT" && requestPath) { - return { - mode: "Body", - operationLocation: requestPath - }; - } else { - return void 0; - } - } - exports2.inferLroMode = inferLroMode; - function transformStatus(inputs) { - const { status, statusCode } = inputs; - if (typeof status !== "string" && status !== void 0) { - throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); - } - switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) { - case void 0: - return toOperationStatus(statusCode); - case "succeeded": - return "succeeded"; - case "failed": - return "failed"; - case "running": - case "accepted": - case "started": - case "canceling": - case "cancelling": - return "running"; - case "canceled": - case "cancelled": - return "canceled"; - default: { - logger_js_1.logger.verbose(`LRO: unrecognized operation status: ${status}`); - return status; - } - } - } - function getStatus(rawResponse) { - var _a2; - const { status } = (_a2 = rawResponse.body) !== null && _a2 !== void 0 ? _a2 : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a2, _b; - const { properties, provisioningState } = (_a2 = rawResponse.body) !== null && _a2 !== void 0 ? _a2 : {}; - const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function toOperationStatus(statusCode) { - if (statusCode === 202) { - return "running"; - } else if (statusCode < 300) { - return "succeeded"; - } else { - return "failed"; - } - } - function parseRetryAfter({ rawResponse }) { - const retryAfter = rawResponse.headers["retry-after"]; - if (retryAfter !== void 0) { - const retryAfterInSeconds = parseInt(retryAfter); - return isNaN(retryAfterInSeconds) ? calculatePollingIntervalFromDate(new Date(retryAfter)) : retryAfterInSeconds * 1e3; - } - return void 0; - } - exports2.parseRetryAfter = parseRetryAfter; - function getErrorFromResponse(response) { - const error3 = accessBodyProperty(response, "error"); - if (!error3) { - logger_js_1.logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error3.code || !error3.message) { - logger_js_1.logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error3; - } - exports2.getErrorFromResponse = getErrorFromResponse; - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; - } - return void 0; - } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a2; - const mode = (_a2 = state.config.metadata) === null || _a2 === void 0 ? void 0 : _a2["mode"]; - switch (mode) { - case void 0: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } - } - const status = helper(); - return status === "running" && operationLocation === void 0 ? "succeeded" : status; - } - exports2.getStatusFromInitialResponse = getStatusFromInitialResponse; - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return (0, operation_js_1.initOperation)({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig - }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, (config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}); - }, - stateProxy, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse, - getOperationStatus: getStatusFromInitialResponse, - setErrorAsResult - }); - } - exports2.initHttpOperation = initHttpOperation; - function getOperationLocation({ rawResponse }, state) { - var _a2; - const mode = (_a2 = state.config.metadata) === null || _a2 === void 0 ? void 0 : _a2["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); - } - case "Body": - default: { - return void 0; - } - } - } - exports2.getOperationLocation = getOperationLocation; - function getOperationStatus({ rawResponse }, state) { - var _a2; - const mode = (_a2 = state.config.metadata) === null || _a2 === void 0 ? void 0 : _a2["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); - } - case "Body": { - return getProvisioningState(rawResponse); - } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); - } - } - exports2.getOperationStatus = getOperationStatus; - function accessBodyProperty({ flatResponse, rawResponse }, prop) { - var _a2, _b; - return (_a2 = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a2 !== void 0 ? _a2 : (_b = rawResponse.body) === null || _b === void 0 ? void 0 : _b[prop]; - } - function getResourceLocation(res, state) { - const loc = accessBodyProperty(res, "resourceLocation"); - if (loc && typeof loc === "string") { - state.config.resourceLocation = loc; - } - return state.config.resourceLocation; - } - exports2.getResourceLocation = getResourceLocation; - function isOperationError(e) { - return e.name === "RestError"; - } - exports2.isOperationError = isOperationError; - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return (0, operation_js_1.pollOperation)({ - state, - stateProxy, - setDelay, - processResult: processResult ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) : ({ flatResponse }) => flatResponse, - getError: getErrorFromResponse, - updateState, - getPollingInterval: parseRetryAfter, - getOperationLocation, - getOperationStatus, - isOperationError, - getResourceLocation, - options, - /** - * The expansion here is intentional because `lro` could be an object that - * references an inner this, so we need to preserve a reference to it. - */ - poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), - setErrorAsResult - }); - } - exports2.pollHttpOperation = pollHttpOperation; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/poller/poller.js -var require_poller = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/poller/poller.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.buildCreatePoller = void 0; - var operation_js_1 = require_operation(); - var constants_js_1 = require_constants12(); - var core_util_1 = require_commonjs4(); - var createStateProxy = () => ({ - /** - * The state at this point is created to be of type OperationState. - * It will be updated later to be of type TState when the - * customer-provided callback, `updateState`, is called during polling. - */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => state.status = "canceled", - setError: (state, error3) => state.error = error3, - setResult: (state, result) => state.result = result, - setRunning: (state) => state.status = "running", - setSucceeded: (state) => state.status = "succeeded", - setFailed: (state) => state.status = "failed", - getError: (state) => state.error, - getResult: (state) => state.result, - isCanceled: (state) => state.status === "canceled", - isFailed: (state) => state.status === "failed", - isRunning: (state) => state.status === "running", - isSucceeded: (state) => state.status === "succeeded" - }); - function buildCreatePoller(inputs) { - const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init: init2, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = constants_js_1.POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy(); - const withOperationLocation = withOperationLocationCallback ? /* @__PURE__ */ (() => { - let called = false; - return (operationLocation, isUpdated) => { - if (isUpdated) - withOperationLocationCallback(operationLocation); - else if (!called) - withOperationLocationCallback(operationLocation); - called = true; - }; - })() : void 0; - const state = restoreFrom ? (0, operation_js_1.deserializeState)(restoreFrom) : await (0, operation_js_1.initOperation)({ - init: init2, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController = new AbortController(); - const handlers = /* @__PURE__ */ new Map(); - const handleProgressEvents = async () => handlers.forEach((h) => h(state)); - const cancelErrMsg = "Operation was canceled"; - let currentPollIntervalInMs = intervalInMs; - const poller = { - getOperationState: () => state, - getResult: () => state.result, - isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), - isStopped: () => resultPromise === void 0, - stopPolling: () => { - abortController.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = /* @__PURE__ */ Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - function abortListener() { - abortController.abort(); - } - const abortSignal = abortController.signal; - if (inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.aborted) { - abortController.abort(); - } else if (!abortSignal.aborted) { - inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true }); - } - try { - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await (0, core_util_1.delay)(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - } finally { - inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.removeEventListener("abort", abortListener); - } - if (resolveOnUnsuccessful) { - return poller.getResult(); - } else { - switch (state.status) { - case "succeeded": - return poller.getResult(); - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - case "notStarted": - case "running": - throw new Error(`Polling completed without succeeding or failing`); - } - } - })().finally(() => { - resultPromise = void 0; - }), - async poll(pollOptions) { - if (resolveOnUnsuccessful) { - if (poller.isDone()) - return; - } else { - switch (state.status) { - case "succeeded": - return; - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - await (0, operation_js_1.pollOperation)({ - poll, - state, - stateProxy, - getOperationLocation, - isOperationError, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation, - processResult, - getError, - updateState, - options: pollOptions, - setDelay: (pollIntervalInMs) => { - currentPollIntervalInMs = pollIntervalInMs; - }, - setErrorAsResult: !resolveOnUnsuccessful - }); - await handleProgressEvents(); - if (!resolveOnUnsuccessful) { - switch (state.status) { - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - } - }; - return poller; - }; - } - exports2.buildCreatePoller = buildCreatePoller; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/http/poller.js -var require_poller2 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/http/poller.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpPoller = void 0; - var operation_js_1 = require_operation2(); - var poller_js_1 = require_poller(); - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return (0, poller_js_1.buildCreatePoller)({ - getStatusFromInitialResponse: operation_js_1.getStatusFromInitialResponse, - getStatusFromPollResponse: operation_js_1.getOperationStatus, - isOperationError: operation_js_1.isOperationError, - getOperationLocation: operation_js_1.getOperationLocation, - getResourceLocation: operation_js_1.getResourceLocation, - getPollingInterval: operation_js_1.parseRetryAfter, - getError: operation_js_1.getErrorFromResponse, - resolveOnUnsuccessful - })({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = (0, operation_js_1.inferLroMode)({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig - }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, (config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); - } - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js -var require_operation3 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.GenericPollOperation = void 0; - var operation_js_1 = require_operation2(); - var logger_js_1 = require_logger2(); - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error3) => state.error = error3, - setResult: (state, result) => state.result = result, - setRunning: (state) => state.isStarted = true, - setSucceeded: (state) => state.isCompleted = true, - setFailed: () => { - }, - getError: (state) => state.error, - getResult: (state) => state.result, - isCanceled: (state) => !!state.isCancelled, - isFailed: (state) => !!state.error, - isRunning: (state) => !!state.isStarted, - isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error) - }); - var GenericPollOperation = class { - constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { - this.state = state; - this.lro = lro; - this.setErrorAsResult = setErrorAsResult; - this.lroResourceLocationConfig = lroResourceLocationConfig; - this.processResult = processResult; - this.updateState = updateState; - this.isDone = isDone; - } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; - } - async update(options) { - var _a2; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await (0, operation_js_1.initHttpOperation)({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); - } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await (0, operation_js_1.pollHttpOperation)({ - lro: this.lro, - state: this.state, - stateProxy, - processResult: this.processResult, - updateState: updateState ? (state, { rawResponse }) => updateState(state, rawResponse) : void 0, - isDone: isDone ? ({ flatResponse }, state) => isDone(flatResponse, state) : void 0, - options, - setDelay: (intervalInMs) => { - this.pollerConfig.intervalInMs = intervalInMs; - }, - setErrorAsResult: this.setErrorAsResult - }); - } - (_a2 = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a2 === void 0 ? void 0 : _a2.call(options, this.state); - return this; - } - async cancel() { - logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; - } - /** - * Serializes the Poller operation. - */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - exports2.GenericPollOperation = GenericPollOperation; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js -var require_poller3 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Poller = exports2.PollerCancelledError = exports2.PollerStoppedError = void 0; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - exports2.PollerStoppedError = PollerStoppedError; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); - } - }; - exports2.PollerCancelledError = PollerCancelledError; - var Poller = class { - /** - * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. - * - * When writing an implementation of a Poller, this implementation needs to deal with the initialization - * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's - * operation has already been defined, at least its basic properties. The code below shows how to approach - * the definition of the constructor of a new custom poller. - * - * ```ts - * export class MyPoller extends Poller { - * constructor({ - * // Anything you might need outside of the basics - * }) { - * let state: MyOperationState = { - * privateProperty: private, - * publicProperty: public, - * }; - * - * const operation = { - * state, - * update, - * cancel, - * toString - * } - * - * // Sending the operation to the parent's constructor. - * super(operation); - * - * // You can assign more local properties here. - * } - * } - * ``` - * - * Inside of this constructor, a new promise is created. This will be used to - * tell the user when the poller finishes (see `pollUntilDone()`). The promise's - * resolve and reject methods are also used internally to control when to resolve - * or reject anyone waiting for the poller to finish. - * - * The constructor of a custom implementation of a poller is where any serialized version of - * a previous poller's operation should be deserialized into the operation sent to the - * base constructor. For example: - * - * ```ts - * export class MyPoller extends Poller { - * constructor( - * baseOperation: string | undefined - * ) { - * let state: MyOperationState = {}; - * if (baseOperation) { - * state = { - * ...JSON.parse(baseOperation).state, - * ...state - * }; - * } - * const operation = { - * state, - * // ... - * } - * super(operation); - * } - * } - * ``` - * - * @param operation - Must contain the basic properties of `PollOperation`. - */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve14, reject) => { - this.resolve = resolve14; - this.reject = reject; - }); - this.promise.catch(() => { - }); - } - /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. - */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); - } - } - /** - * pollOnce does one polling, by calling to the update method of the underlying - * poll operation to make any relevant change effective. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * @param options - Optional properties passed to the operation's update method. - */ - async pollOnce(options = {}) { - if (!this.isDone()) { - this.operation = await this.operation.update({ - abortSignal: options.abortSignal, - fireProgress: this.fireProgress.bind(this) - }); - } - this.processUpdatedState(); - } - /** - * fireProgress calls the functions passed in via onProgress the method of the poller. - * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. - * - * @param state - The current operation state. - */ - fireProgress(state) { - for (const callback of this.pollProgressCallbacks) { - callback(state); - } - } - /** - * Invokes the underlying operation's cancel method. - */ - async cancelOnce(options = {}) { - this.operation = await this.operation.cancel(options); - } - /** - * Returns a promise that will resolve once a single polling request finishes. - * It does this by calling the update method of the Poller's operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * @param options - Optional properties passed to the operation's update method. - */ - poll(options = {}) { - if (!this.pollOncePromise) { - this.pollOncePromise = this.pollOnce(options); - const clearPollOncePromise = () => { - this.pollOncePromise = void 0; - }; - this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); - } - return this.pollOncePromise; - } - processUpdatedState() { - if (this.operation.state.error) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - this.reject(this.operation.state.error); - throw this.operation.state.error; - } - } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error3 = new PollerCancelledError("Operation was canceled"); - this.reject(error3); - throw error3; - } - } - if (this.isDone() && this.resolve) { - this.resolve(this.getResult()); - } - } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); - } - this.processUpdatedState(); - return this.promise; - } - /** - * Invokes the provided callback after each polling is completed, - * sending the current state of the poller's operation. - * - * It returns a method that can be used to stop receiving updates on the given callback function. - */ - onProgress(callback) { - this.pollProgressCallbacks.push(callback); - return () => { - this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); - }; - } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); - } - /** - * Stops the poller from continuing to poll. - */ - stopPolling() { - if (!this.stopped) { - this.stopped = true; - if (this.reject) { - this.reject(new PollerStoppedError("This poller is already stopped")); - } - } - } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; - } - /** - * Attempts to cancel the underlying operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * If it's called again before it finishes, it will throw an error. - * - * @param options - Optional properties passed to the operation's update method. - */ - cancelOperation(options = {}) { - if (!this.cancelPromise) { - this.cancelPromise = this.cancelOnce(options); - } else if (options.abortSignal) { - throw new Error("A cancel request is currently pending"); - } - return this.cancelPromise; - } - /** - * Returns the state of the operation. - * - * Even though TState will be the same type inside any of the methods of any extension of the Poller class, - * implementations of the pollers can customize what's shared with the public by writing their own - * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller - * and a public type representing a safe to share subset of the properties of the internal state. - * Their definition of getOperationState can then return their public type. - * - * Example: - * - * ```ts - * // Let's say we have our poller's operation state defined as: - * interface MyOperationState extends PollOperationState { - * privateProperty?: string; - * publicProperty?: string; - * } - * - * // To allow us to have a true separation of public and private state, we have to define another interface: - * interface PublicState extends PollOperationState { - * publicProperty?: string; - * } - * - * // Then, we define our Poller as follows: - * export class MyPoller extends Poller { - * // ... More content is needed here ... - * - * public getOperationState(): PublicState { - * const state: PublicState = this.operation.state; - * return { - * // Properties from PollOperationState - * isStarted: state.isStarted, - * isCompleted: state.isCompleted, - * isCancelled: state.isCancelled, - * error: state.error, - * result: state.result, - * - * // The only other property needed by PublicState. - * publicProperty: state.publicProperty - * } - * } - * } - * ``` - * - * You can see this in the tests of this repository, go to the file: - * `../test/utils/testPoller.ts` - * and look for the getOperationState implementation. - */ - getOperationState() { - return this.operation.state; - } - /** - * Returns the result value of the operation, - * regardless of the state of the poller. - * It can return undefined or an incomplete form of the final TResult value - * depending on the implementation. - */ - getResult() { - const state = this.operation.state; - return state.result; - } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); - } - }; - exports2.Poller = Poller; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js -var require_lroEngine = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.LroEngine = void 0; - var operation_js_1 = require_operation3(); - var constants_js_1 = require_constants12(); - var poller_js_1 = require_poller3(); - var operation_js_2 = require_operation(); - var LroEngine = class extends poller_js_1.Poller { - constructor(lro, options) { - const { intervalInMs = constants_js_1.POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? (0, operation_js_2.deserializeState)(resumeFrom) : {}; - const operation = new operation_js_1.GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); - } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve14) => setTimeout(() => resolve14(), this.config.intervalInMs)); - } - }; - exports2.LroEngine = LroEngine; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js -var require_lroEngine2 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.LroEngine = void 0; - var lroEngine_js_1 = require_lroEngine(); - Object.defineProperty(exports2, "LroEngine", { enumerable: true, get: function() { - return lroEngine_js_1.LroEngine; - } }); - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js -var require_pollOperation = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/index.js -var require_commonjs14 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpPoller = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var poller_js_1 = require_poller2(); - Object.defineProperty(exports2, "createHttpPoller", { enumerable: true, get: function() { - return poller_js_1.createHttpPoller; - } }); - tslib_1.__exportStar(require_lroEngine2(), exports2); - tslib_1.__exportStar(require_poller3(), exports2); - tslib_1.__exportStar(require_pollOperation(), exports2); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js -var require_BlobStartCopyFromUrlPoller = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobBeginCopyFromUrlPoller = void 0; - var core_util_1 = require_commonjs4(); - var core_lro_1 = require_commonjs14(); - var BlobBeginCopyFromUrlPoller = class extends core_lro_1.Poller { - intervalInMs; - constructor(options) { - const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; - let state; - if (resumeFrom) { - state = JSON.parse(resumeFrom).state; - } - const operation = makeBlobBeginCopyFromURLPollOperation({ - ...state, - blobClient, - copySource, - startCopyFromURLOptions - }); - super(operation); - if (typeof onProgress === "function") { - this.onProgress(onProgress); - } - this.intervalInMs = intervalInMs; - } - delay() { - return (0, core_util_1.delay)(this.intervalInMs); - } - }; - exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; - var cancel = async function cancel2(options = {}) { - const state = this.state; - const { copyId } = state; - if (state.isCompleted) { - return makeBlobBeginCopyFromURLPollOperation(state); - } - if (!copyId) { - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - } - await state.blobClient.abortCopyFromURL(copyId, { - abortSignal: options.abortSignal - }); - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - }; - var update = async function update2(options = {}) { - const state = this.state; - const { blobClient, copySource, startCopyFromURLOptions } = state; - if (!state.isStarted) { - state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); - state.copyId = result.copyId; - if (result.copyStatus === "success") { - state.result = result; - state.isCompleted = true; - } - } else if (!state.isCompleted) { - try { - const result = await state.blobClient.getProperties({ abortSignal: options.abortSignal }); - const { copyStatus, copyProgress } = result; - const prevCopyProgress = state.copyProgress; - if (copyProgress) { - state.copyProgress = copyProgress; - } - if (copyStatus === "pending" && copyProgress !== prevCopyProgress && typeof options.fireProgress === "function") { - options.fireProgress(state); - } else if (copyStatus === "success") { - state.result = result; - state.isCompleted = true; - } else if (copyStatus === "failed") { - state.error = new Error(`Blob copy failed with reason: "${result.copyStatusDescription || "unknown"}"`); - state.isCompleted = true; - } - } catch (err) { - state.error = err; - state.isCompleted = true; - } - } - return makeBlobBeginCopyFromURLPollOperation(state); - }; - var toString2 = function toString3() { - return JSON.stringify({ state: this.state }, (key, value) => { - if (key === "blobClient") { - return void 0; - } - return value; - }); - }; - function makeBlobBeginCopyFromURLPollOperation(state) { - return { - state: { ...state }, - cancel, - toString: toString2, - update - }; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/Range.js -var require_Range = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/Range.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.rangeToString = rangeToString; - function rangeToString(iRange) { - if (iRange.offset < 0) { - throw new RangeError(`Range.offset cannot be smaller than 0.`); - } - if (iRange.count && iRange.count <= 0) { - throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`); - } - return iRange.count ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` : `bytes=${iRange.offset}-`; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/Batch.js -var require_Batch = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/Batch.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Batch = void 0; - var events_1 = require("events"); - var BatchStates; - (function(BatchStates2) { - BatchStates2[BatchStates2["Good"] = 0] = "Good"; - BatchStates2[BatchStates2["Error"] = 1] = "Error"; - })(BatchStates || (BatchStates = {})); - var Batch = class { - /** - * Concurrency. Must be lager than 0. - */ - concurrency; - /** - * Number of active operations under execution. - */ - actives = 0; - /** - * Number of completed operations under execution. - */ - completed = 0; - /** - * Offset of next operation to be executed. - */ - offset = 0; - /** - * Operation array to be executed. - */ - operations = []; - /** - * States of Batch. When an error happens, state will turn into error. - * Batch will stop execute left operations. - */ - state = BatchStates.Good; - /** - * A private emitter used to pass events inside this class. - */ - emitter; - /** - * Creates an instance of Batch. - * @param concurrency - - */ - constructor(concurrency = 5) { - if (concurrency < 1) { - throw new RangeError("concurrency must be larger than 0"); - } - this.concurrency = concurrency; - this.emitter = new events_1.EventEmitter(); - } - /** - * Add a operation into queue. - * - * @param operation - - */ - addOperation(operation) { - this.operations.push(async () => { - try { - this.actives++; - await operation(); - this.actives--; - this.completed++; - this.parallelExecute(); - } catch (error3) { - this.emitter.emit("error", error3); - } - }); - } - /** - * Start execute operations in the queue. - * - */ - async do() { - if (this.operations.length === 0) { - return Promise.resolve(); - } - this.parallelExecute(); - return new Promise((resolve14, reject) => { - this.emitter.on("finish", resolve14); - this.emitter.on("error", (error3) => { - this.state = BatchStates.Error; - reject(error3); - }); - }); - } - /** - * Get next operation to be executed. Return null when reaching ends. - * - */ - nextOperation() { - if (this.offset < this.operations.length) { - return this.operations[this.offset++]; - } - return null; - } - /** - * Start execute operations. One one the most important difference between - * this method with do() is that do() wraps as an sync method. - * - */ - parallelExecute() { - if (this.state === BatchStates.Error) { - return; - } - if (this.completed >= this.operations.length) { - this.emitter.emit("finish"); - return; - } - while (this.actives < this.concurrency) { - const operation = this.nextOperation(); - if (operation) { - operation(); - } else { - return; - } - } - } - }; - exports2.Batch = Batch; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js -var require_utils6 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.fsCreateReadStream = exports2.fsStat = void 0; - exports2.streamToBuffer = streamToBuffer; - exports2.streamToBuffer2 = streamToBuffer2; - exports2.streamToBuffer3 = streamToBuffer3; - exports2.readStreamToLocalFile = readStreamToLocalFile; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_fs_1 = tslib_1.__importDefault(require("node:fs")); - var node_util_1 = tslib_1.__importDefault(require("node:util")); - var constants_js_1 = require_constants10(); - async function streamToBuffer(stream2, buffer, offset, end, encoding) { - let pos = 0; - const count = end - offset; - return new Promise((resolve14, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); - stream2.on("readable", () => { - if (pos >= count) { - clearTimeout(timeout); - resolve14(); - return; - } - let chunk = stream2.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); - pos += chunkLength; - }); - stream2.on("end", () => { - clearTimeout(timeout); - if (pos < count) { - reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); - } - resolve14(); - }); - stream2.on("error", (msg) => { - clearTimeout(timeout); - reject(msg); - }); - }); - } - async function streamToBuffer2(stream2, buffer, encoding) { - let pos = 0; - const bufferSize = buffer.length; - return new Promise((resolve14, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - if (pos + chunk.length > bufferSize) { - reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); - return; - } - buffer.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - stream2.on("end", () => { - resolve14(pos); - }); - stream2.on("error", reject); - }); - } - async function streamToBuffer3(readableStream, encoding) { - return new Promise((resolve14, reject) => { - const chunks = []; - readableStream.on("data", (data) => { - chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); - }); - readableStream.on("end", () => { - resolve14(Buffer.concat(chunks)); - }); - readableStream.on("error", reject); - }); - } - async function readStreamToLocalFile(rs, file) { - return new Promise((resolve14, reject) => { - const ws = node_fs_1.default.createWriteStream(file); - rs.on("error", (err) => { - reject(err); - }); - ws.on("error", (err) => { - reject(err); - }); - ws.on("close", resolve14); - rs.pipe(ws); - }); - } - exports2.fsStat = node_util_1.default.promisify(node_fs_1.default.stat); - exports2.fsCreateReadStream = node_fs_1.default.createReadStream; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/Clients.js -var require_Clients = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/Clients.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PageBlobClient = exports2.BlockBlobClient = exports2.AppendBlobClient = exports2.BlobClient = void 0; - var core_rest_pipeline_1 = require_commonjs6(); - var core_auth_1 = require_commonjs7(); - var core_util_1 = require_commonjs4(); - var core_util_2 = require_commonjs4(); - var BlobDownloadResponse_js_1 = require_BlobDownloadResponse(); - var BlobQueryResponse_js_1 = require_BlobQueryResponse(); - var AnonymousCredential_js_1 = require_AnonymousCredential(); - var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); - var models_js_1 = require_models2(); - var PageBlobRangeResponse_js_1 = require_PageBlobRangeResponse(); - var Pipeline_js_1 = require_Pipeline(); - var BlobStartCopyFromUrlPoller_js_1 = require_BlobStartCopyFromUrlPoller(); - var Range_js_1 = require_Range(); - var StorageClient_js_1 = require_StorageClient(); - var Batch_js_1 = require_Batch(); - var storage_common_1 = require_commonjs13(); - var constants_js_1 = require_constants10(); - var tracing_js_1 = require_tracing(); - var utils_common_js_1 = require_utils_common(); - var utils_js_1 = require_utils6(); - var BlobSASSignatureValues_js_1 = require_BlobSASSignatureValues(); - var BlobLeaseClient_js_1 = require_BlobLeaseClient(); - var BlobClient = class _BlobClient extends StorageClient_js_1.StorageClient { - /** - * blobContext provided by protocol layer. - */ - blobContext; - _name; - _containerName; - _versionId; - _snapshot; - /** - * The name of the blob. - */ - get name() { - return this._name; - } - /** - * The name of the storage container the blob is associated with. - */ - get containerName() { - return this._containerName; - } - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - options = options || {}; - let pipeline2; - let url2; - if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline2 = credentialOrPipelineOrContainerName; - } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline2 = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (core_util_1.isNodeLike) { - const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); - } - pipeline2 = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url2, pipeline2); - ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); - this.blobContext = this.storageClientContext.blob; - this._snapshot = (0, utils_common_js_1.getURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT); - this._versionId = (0, utils_common_js_1.getURLParameter)(this.url, constants_js_1.URLConstants.Parameters.VERSIONID); - } - /** - * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp. - * Provide "" will remove the snapshot and return a Client to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp - */ - withSnapshot(snapshot) { - return new _BlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? void 0 : snapshot), this.pipeline); - } - /** - * Creates a new BlobClient object pointing to a version of this blob. - * Provide "" will remove the versionId and return a Client to the base blob. - * - * @param versionId - The versionId. - * @returns A new BlobClient object pointing to the version of this blob. - */ - withVersion(versionId) { - return new _BlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.VERSIONID, versionId.length === 0 ? void 0 : versionId), this.pipeline); - } - /** - * Creates a AppendBlobClient object. - * - */ - getAppendBlobClient() { - return new AppendBlobClient(this.url, this.pipeline); - } - /** - * Creates a BlockBlobClient object. - * - */ - getBlockBlobClient() { - return new BlockBlobClient(this.url, this.pipeline); - } - /** - * Creates a PageBlobClient object. - * - */ - getPageBlobClient() { - return new PageBlobClient(this.url, this.pipeline); - } - /** - * Reads or downloads a blob from the system, including its metadata and properties. - * You can also call Get Blob to read a snapshot. - * - * * In Node.js, data returns in a Readable stream readableStreamBody - * * In browsers, data returns in a promise blobBody - * - * @see https://learn.microsoft.com/rest/api/storageservices/get-blob - * - * @param offset - From which position of the blob to download, greater than or equal to 0 - * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined - * @param options - Optional options to Blob Download operation. - * - * - * Example usage (Node.js): - * - * ```ts snippet:ReadmeSampleDownloadBlob_Node - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const blobClient = containerClient.getBlobClient(blobName); - * - * // Get blob content from position 0 to the end - * // In Node.js, get downloaded data by accessing downloadBlockBlobResponse.readableStreamBody - * const downloadBlockBlobResponse = await blobClient.download(); - * if (downloadBlockBlobResponse.readableStreamBody) { - * const downloaded = await streamToString(downloadBlockBlobResponse.readableStreamBody); - * console.log(`Downloaded blob content: ${downloaded}`); - * } - * - * async function streamToString(stream: NodeJS.ReadableStream): Promise { - * const result = await new Promise>((resolve, reject) => { - * const chunks: Buffer[] = []; - * stream.on("data", (data) => { - * chunks.push(Buffer.isBuffer(data) ? data : Buffer.from(data)); - * }); - * stream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * stream.on("error", reject); - * }); - * return result.toString(); - * } - * ``` - * - * Example usage (browser): - * - * ```ts snippet:ReadmeSampleDownloadBlob_Browser - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const blobClient = containerClient.getBlobClient(blobName); - * - * // Get blob content from position 0 to the end - * // In browsers, get downloaded data by accessing downloadBlockBlobResponse.blobBody - * const downloadBlockBlobResponse = await blobClient.download(); - * const blobBody = await downloadBlockBlobResponse.blobBody; - * if (blobBody) { - * const downloaded = await blobBody.text(); - * console.log(`Downloaded blob content: ${downloaded}`); - * } - * ``` - */ - async download(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - const res = (0, utils_common_js_1.assertResponse)(await this.blobContext.download({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - requestOptions: { - onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress - // for Node.js, progress is reported by RetriableReadableStream - }, - range: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), - rangeGetContentMD5: options.rangeGetContentMD5, - rangeGetContentCRC64: options.rangeGetContentCrc64, - snapshot: options.snapshot, - cpkInfo: options.customerProvidedKey, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedRes = { - ...res, - _response: res._response, - // _response is made non-enumerable - objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, - objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) - }; - if (!core_util_1.isNodeLike) { - return wrappedRes; - } - if (options.maxRetryRequests === void 0 || options.maxRetryRequests < 0) { - options.maxRetryRequests = constants_js_1.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; - } - if (res.contentLength === void 0) { - throw new RangeError(`File download response doesn't contain valid content length header`); - } - if (!res.etag) { - throw new RangeError(`File download response doesn't contain valid etag header`); - } - return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { - const updatedDownloadOptions = { - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ifMatch: options.conditions.ifMatch || res.etag, - ifModifiedSince: options.conditions.ifModifiedSince, - ifNoneMatch: options.conditions.ifNoneMatch, - ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: options.conditions?.tagConditions - }, - range: (0, Range_js_1.rangeToString)({ - count: offset + res.contentLength - start, - offset: start - }), - rangeGetContentMD5: options.rangeGetContentMD5, - rangeGetContentCRC64: options.rangeGetContentCrc64, - snapshot: options.snapshot, - cpkInfo: options.customerProvidedKey - }; - return (await this.blobContext.download({ - abortSignal: options.abortSignal, - ...updatedDownloadOptions - })).readableStreamBody; - }, offset, res.contentLength, { - maxRetryRequests: options.maxRetryRequests, - onProgress: options.onProgress - }); - }); - } - /** - * Returns true if the Azure blob resource represented by this client exists; false otherwise. - * - * NOTE: use this function with care since an existing blob might be deleted by other clients or - * applications. Vice versa new blobs might be added by other clients or applications after this - * function completes. - * - * @param options - options to Exists operation. - */ - async exists(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { - try { - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - await this.getProperties({ - abortSignal: options.abortSignal, - customerProvidedKey: options.customerProvidedKey, - conditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - }); - return true; - } catch (e) { - if (e.statusCode === 404) { - return false; - } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { - return true; - } - throw e; - } - }); - } - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. - * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-properties - * - * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if - * they originally contained uppercase characters. This differs from the metadata keys returned by - * the methods of {@link ContainerClient} that list blobs using the `includeMetadata` option, which - * will retain their original casing. - * - * @param options - Optional options to Get Properties operation. - */ - async getProperties(options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - const res = (0, utils_common_js_1.assertResponse)(await this.blobContext.getProperties({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - cpkInfo: options.customerProvidedKey, - tracingOptions: updatedOptions.tracingOptions - })); - return { - ...res, - _response: res._response, - // _response is made non-enumerable - objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, - objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) - }; - }); - } - /** - * Marks the specified blob or snapshot for deletion. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob - * - * @param options - Optional options to Blob Delete operation. - */ - async delete(options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.delete({ - abortSignal: options.abortSignal, - deleteSnapshots: options.deleteSnapshots, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob - * - * @param options - Optional options to Blob Delete operation. - */ - async deleteIfExists(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - try { - const res = (0, utils_common_js_1.assertResponse)(await this.delete(updatedOptions)); - return { - succeeded: true, - ...res, - _response: res._response - // _response is made non-enumerable - }; - } catch (e) { - if (e.details?.errorCode === "BlobNotFound") { - return { - succeeded: false, - ...e.response?.parsedHeaders, - _response: e.response - }; - } - throw e; - } - }); - } - /** - * Restores the contents and metadata of soft deleted blob and any associated - * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29 - * or later. - * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob - * - * @param options - Optional options to Blob Undelete operation. - */ - async undelete(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.undelete({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Sets system properties on the blob. - * - * If no value provided, or no value provided for the specified blob HTTP headers, - * these blob HTTP headers without a value will be cleared. - * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties - * - * @param blobHTTPHeaders - If no value provided, or no value provided for - * the specified blob HTTP headers, these blob HTTP - * headers without a value will be cleared. - * A common header to set is `blobContentType` - * enabling the browser to provide functionality - * based on file type. - * @param options - Optional options to Blob Set HTTP Headers operation. - */ - async setHTTPHeaders(blobHTTPHeaders, options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.setHttpHeaders({ - abortSignal: options.abortSignal, - blobHttpHeaders: blobHTTPHeaders, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger. - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Sets user-defined metadata for the specified blob as one or more name-value pairs. - * - * If no option provided, or no metadata defined in the parameter, the blob - * metadata will be removed. - * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-metadata - * - * @param metadata - Replace existing metadata with this value. - * If no value provided the existing metadata will be removed. - * @param options - Optional options to Set Metadata operation. - */ - async setMetadata(metadata, options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.setMetadata({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Sets tags on the underlying blob. - * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. - * Valid tag key and value characters include lower and upper case letters, digits (0-9), - * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_'). - * - * @param tags - - * @param options - - */ - async setTags(tags, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.setTags({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions, - tags: (0, utils_common_js_1.toBlobTags)(tags) - })); - }); - } - /** - * Gets the tags associated with the underlying blob. - * - * @param options - - */ - async getTags(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this.blobContext.getTags({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = { - ...response, - _response: response._response, - // _response is made non-enumerable - tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} - }; - return wrappedResponse; - }); - } - /** - * Get a {@link BlobLeaseClient} that manages leases on the blob. - * - * @param proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the blob. - */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); - } - /** - * Creates a read-only snapshot of a blob. - * @see https://learn.microsoft.com/rest/api/storageservices/snapshot-blob - * - * @param options - Optional options to the Blob Create Snapshot operation. - */ - async createSnapshot(options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.createSnapshot({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Asynchronously copies a blob to a destination within the storage account. - * This method returns a long running operation poller that allows you to wait - * indefinitely until the copy is completed. - * You can also cancel a copy before it is completed by calling `cancelOperation` on the poller. - * Note that the onProgress callback will not be invoked if the operation completes in the first - * request, and attempting to cancel a completed copy will result in an error being thrown. - * - * In version 2012-02-12 and later, the source for a Copy Blob operation can be - * a committed blob in any Azure storage account. - * Beginning with version 2015-02-21, the source for a Copy Blob operation can be - * an Azure file in any Azure storage account. - * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob - * operation to copy from another storage account. - * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob - * - * ```ts snippet:ClientsBeginCopyFromURL - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const blobClient = containerClient.getBlobClient(blobName); - * - * // Example using automatic polling - * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); - * const automaticResult = await automaticCopyPoller.pollUntilDone(); - * - * // Example using manual polling - * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); - * while (!manualCopyPoller.isDone()) { - * await manualCopyPoller.poll(); - * } - * const manualResult = manualCopyPoller.getResult(); - * - * // Example using progress updates - * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { - * onProgress(state) { - * console.log(`Progress: ${state.copyProgress}`); - * }, - * }); - * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); - * - * // Example using a changing polling interval (default 15 seconds) - * const pollingIntervalCopyPoller = await blobClient.beginCopyFromURL("url", { - * intervalInMs: 1000, // poll blob every 1 second for copy progress - * }); - * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); - * - * // Example using copy cancellation: - * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); - * // cancel operation after starting it. - * try { - * await cancelCopyPoller.cancelOperation(); - * // calls to get the result now throw PollerCancelledError - * cancelCopyPoller.getResult(); - * } catch (err: any) { - * if (err.name === "PollerCancelledError") { - * console.log("The copy was cancelled."); - * } - * } - * ``` - * - * @param copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. - */ - async beginCopyFromURL(copySource, options = {}) { - const client = { - abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), - getProperties: (...args) => this.getProperties(...args), - startCopyFromURL: (...args) => this.startCopyFromURL(...args) - }; - const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ - blobClient: client, - copySource, - intervalInMs: options.intervalInMs, - onProgress: options.onProgress, - resumeFrom: options.resumeFrom, - startCopyFromURLOptions: options - }); - await poller.poll(); - return poller; - } - /** - * Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero - * length and full metadata. Version 2012-02-12 and newer. - * @see https://learn.microsoft.com/rest/api/storageservices/abort-copy-blob - * - * @param copyId - Id of the Copy From URL operation. - * @param options - Optional options to the Blob Abort Copy From URL operation. - */ - async abortCopyFromURL(copyId, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.abortCopyFromURL(copyId, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not - * return a response until the copy is complete. - * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob-from-url - * - * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication - * @param options - - */ - async syncCopyFromURL(copySource, options = {}) { - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - return tracing_js_1.tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.copyFromURL(copySource, { - abortSignal: options.abortSignal, - metadata: options.metadata, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions?.ifMatch, - sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince - }, - sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), - tier: (0, models_js_1.toAccessTier)(options.tier), - blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), - immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, - immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, - legalHold: options.legalHold, - encryptionScope: options.encryptionScope, - copySourceTags: options.copySourceTags, - fileRequestIntent: options.sourceShareTokenIntent, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Sets the tier on a blob. The operation is allowed on a page blob in a premium - * storage account and on a block blob in a blob storage account (locally redundant - * storage only). A premium page blob's tier determines the allowed size, IOPS, - * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive - * storage type. This operation does not update the blob's ETag. - * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-tier - * - * @param tier - The tier to be set on the blob. Valid values are Hot, Cool, or Archive. - * @param options - Optional options to the Blob Set Tier operation. - */ - async setAccessTier(tier, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.setTier((0, models_js_1.toAccessTier)(tier), { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - rehydratePriority: options.rehydratePriority, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - async downloadToBuffer(param1, param2, param3, param4 = {}) { - let buffer; - let offset = 0; - let count = 0; - let options = param4; - if (param1 instanceof Buffer) { - buffer = param1; - offset = param2 || 0; - count = typeof param3 === "number" ? param3 : 0; - } else { - offset = typeof param1 === "number" ? param1 : 0; - count = typeof param2 === "number" ? param2 : 0; - options = param3 || {}; - } - let blockSize = options.blockSize ?? 0; - if (blockSize < 0) { - throw new RangeError("blockSize option must be >= 0"); - } - if (blockSize === 0) { - blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - if (offset < 0) { - throw new RangeError("offset option must be >= 0"); - } - if (count && count <= 0) { - throw new RangeError("count option must be greater than 0"); - } - if (!options.conditions) { - options.conditions = {}; - } - return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { - if (!count) { - const response = await this.getProperties({ - ...options, - tracingOptions: updatedOptions.tracingOptions - }); - count = response.contentLength - offset; - if (count < 0) { - throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`); - } - } - if (!buffer) { - try { - buffer = Buffer.alloc(count); - } catch (error3) { - throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile". ${error3.message}`); - } - } - if (buffer.length < count) { - throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`); - } - let transferProgress = 0; - const batch = new Batch_js_1.Batch(options.concurrency); - for (let off = offset; off < offset + count; off = off + blockSize) { - batch.addOperation(async () => { - let chunkEnd = offset + count; - if (off + blockSize < chunkEnd) { - chunkEnd = off + blockSize; - } - const response = await this.download(off, chunkEnd - off, { - abortSignal: options.abortSignal, - conditions: options.conditions, - maxRetryRequests: options.maxRetryRequestsPerBlock, - customerProvidedKey: options.customerProvidedKey, - tracingOptions: updatedOptions.tracingOptions - }); - const stream2 = response.readableStreamBody; - await (0, utils_js_1.streamToBuffer)(stream2, buffer, off - offset, chunkEnd - offset); - transferProgress += chunkEnd - off; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }); - } - await batch.do(); - return buffer; - }); - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Downloads an Azure Blob to a local file. - * Fails if the the given file path already exits. - * Offset and count are optional, pass 0 and undefined respectively to download the entire blob. - * - * @param filePath - - * @param offset - From which position of the block blob to download. - * @param count - How much data to be downloaded. Will download to the end when passing undefined. - * @param options - Options to Blob download options. - * @returns The response data for blob download operation, - * but with readableStreamBody set to undefined since its - * content is already read and written into a local file - * at the specified path. - */ - async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, { - ...options, - tracingOptions: updatedOptions.tracingOptions - }); - if (response.readableStreamBody) { - await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); - } - response.blobDownloadStream = void 0; - return response; - }); - } - getBlobAndContainerNamesFromUrl() { - let containerName; - let blobName; - try { - const parsedUrl = new URL(this.url); - if (parsedUrl.host.split(".")[1] === "blob") { - const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); - containerName = pathComponents[1]; - blobName = pathComponents[3]; - } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { - const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); - containerName = pathComponents[2]; - blobName = pathComponents[4]; - } else { - const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); - containerName = pathComponents[1]; - blobName = pathComponents[3]; - } - containerName = decodeURIComponent(containerName); - blobName = decodeURIComponent(blobName); - blobName = blobName.replace(/\\/g, "/"); - if (!containerName) { - throw new Error("Provided containerName is invalid."); - } - return { blobName, containerName }; - } catch (error3) { - throw new Error("Unable to extract blobName and containerName with provided information."); - } - } - /** - * Asynchronously copies a blob to a destination within the storage account. - * In version 2012-02-12 and later, the source for a Copy Blob operation can be - * a committed blob in any Azure storage account. - * Beginning with version 2015-02-21, the source for a Copy Blob operation can be - * an Azure file in any Azure storage account. - * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob - * operation to copy from another storage account. - * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob - * - * @param copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. - */ - async startCopyFromURL(copySource, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - sourceIfTags: options.sourceConditions.tagConditions - }, - immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, - immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, - legalHold: options.legalHold, - rehydratePriority: options.rehydratePriority, - tier: (0, models_js_1.toAccessTier)(options.tier), - blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), - sealBlob: options.sealBlob, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Only available for BlobClient constructed with a shared key credential. - * - * Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateSasUrl(options) { - return new Promise((resolve14) => { - if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ - containerName: this._containerName, - blobName: this._name, - snapshotTime: this._snapshot, - versionId: this._versionId, - ...options - }, this.credential).toString(); - resolve14((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); - }); - } - /** - * Only available for BlobClient constructed with a shared key credential. - * - * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on - * the client properties and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - generateSasStringToSign(options) { - if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ - containerName: this._containerName, - blobName: this._name, - snapshotTime: this._snapshot, - versionId: this._versionId, - ...options - }, this.credential).stringToSign; - } - /** - * - * Generates a Blob Service Shared Access Signature (SAS) URI based on - * the client properties and parameters passed in. The SAS is signed by the input user delegation key. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateUserDelegationSasUrl(options, userDelegationKey) { - return new Promise((resolve14) => { - const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ - containerName: this._containerName, - blobName: this._name, - snapshotTime: this._snapshot, - versionId: this._versionId, - ...options - }, userDelegationKey, this.accountName).toString(); - resolve14((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); - }); - } - /** - * Only available for BlobClient constructed with a shared key credential. - * - * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on - * the client properties and parameters passed in. The SAS is signed by the input user delegation key. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateUserDelegationSasStringToSign(options, userDelegationKey) { - return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ - containerName: this._containerName, - blobName: this._name, - snapshotTime: this._snapshot, - versionId: this._versionId, - ...options - }, userDelegationKey, this.accountName).stringToSign; - } - /** - * Delete the immutablility policy on the blob. - * - * @param options - Optional options to delete immutability policy on the blob. - */ - async deleteImmutabilityPolicy(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.deleteImmutabilityPolicy({ - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Set immutability policy on the blob. - * - * @param options - Optional options to set immutability policy on the blob. - */ - async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.setImmutabilityPolicy({ - immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, - immutabilityPolicyMode: immutabilityPolicy.policyMode, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Set legal hold on the blob. - * - * @param options - Optional options to set legal hold on the blob. - */ - async setLegalHold(legalHoldEnabled, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.setLegalHold(legalHoldEnabled, { - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * The Get Account Information operation returns the sku name and account kind - * for the specified account. - * The Get Account Information operation is available on service versions beginning - * with version 2018-03-28. - * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information - * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. - */ - async getAccountInfo(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blobContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - }; - exports2.BlobClient = BlobClient; - var AppendBlobClient = class _AppendBlobClient extends BlobClient { - /** - * appendBlobsContext provided by protocol layer. - */ - appendBlobContext; - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline2; - let url2; - options = options || {}; - if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline2 = credentialOrPipelineOrContainerName; - } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline2 = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (core_util_1.isNodeLike) { - const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); - } - pipeline2 = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url2, pipeline2); - this.appendBlobContext = this.storageClientContext.appendBlob; - } - /** - * Creates a new AppendBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a Client to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot) { - return new _AppendBlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? void 0 : snapshot), this.pipeline); - } - /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * @see https://learn.microsoft.com/rest/api/storageservices/put-blob - * - * @param options - Options to the Append Block Create operation. - * - * - * Example usage: - * - * ```ts snippet:ClientsCreateAppendBlob - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * - * const appendBlobClient = containerClient.getAppendBlobClient(blobName); - * await appendBlobClient.create(); - * ``` - */ - async create(options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.appendBlobContext.create(0, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, - immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, - legalHold: options.legalHold, - blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * If the blob with the same name already exists, the content of the existing blob will remain unchanged. - * @see https://learn.microsoft.com/rest/api/storageservices/put-blob - * - * @param options - - */ - async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: constants_js_1.ETagAny }; - return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - try { - const res = (0, utils_common_js_1.assertResponse)(await this.create({ - ...updatedOptions, - conditions - })); - return { - succeeded: true, - ...res, - _response: res._response - // _response is made non-enumerable - }; - } catch (e) { - if (e.details?.errorCode === "BlobAlreadyExists") { - return { - succeeded: false, - ...e.response?.parsedHeaders, - _response: e.response - }; - } - throw e; - } - }); - } - /** - * Seals the append blob, making it read only. - * - * @param options - - */ - async seal(options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.appendBlobContext.seal({ - abortSignal: options.abortSignal, - appendPositionAccessConditions: options.conditions, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Commits a new block of data to the end of the existing append blob. - * @see https://learn.microsoft.com/rest/api/storageservices/append-block - * - * @param body - Data to be appended. - * @param contentLength - Length of the body in bytes. - * @param options - Options to the Append Block operation. - * - * - * Example usage: - * - * ```ts snippet:ClientsAppendBlock - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * - * const content = "Hello World!"; - * - * // Create a new append blob and append data to the blob. - * const newAppendBlobClient = containerClient.getAppendBlobClient(blobName); - * await newAppendBlobClient.create(); - * await newAppendBlobClient.appendBlock(content, content.length); - * - * // Append data to an existing append blob. - * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); - * await existingAppendBlobClient.appendBlock(content, content.length); - * ``` - */ - async appendBlock(body, contentLength, options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.appendBlobContext.appendBlock(contentLength, body, { - abortSignal: options.abortSignal, - appendPositionAccessConditions: options.conditions, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - requestOptions: { - onUploadProgress: options.onProgress - }, - transactionalContentMD5: options.transactionalContentMD5, - transactionalContentCrc64: options.transactionalContentCrc64, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * The Append Block operation commits a new block of data to the end of an existing append blob - * where the contents are read from a source url. - * @see https://learn.microsoft.com/rest/api/storageservices/append-block-from-url - * - * @param sourceURL - - * The url to the blob that will be the source of the copy. A source blob in the same storage account can - * be authenticated via Shared Key. However, if the source is a blob in another account, the source blob - * must either be public or must be authenticated via a shared access signature. If the source blob is - * public, no authentication is required to perform the operation. - * @param sourceOffset - Offset in source to be appended - * @param count - Number of bytes to be appended as a block - * @param options - - */ - async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { - abortSignal: options.abortSignal, - sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - leaseAccessConditions: options.conditions, - appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions?.ifMatch, - sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince - }, - copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - fileRequestIntent: options.sourceShareTokenIntent, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - }; - exports2.AppendBlobClient = AppendBlobClient; - var BlockBlobClient = class _BlockBlobClient extends BlobClient { - /** - * blobContext provided by protocol layer. - * - * Note. Ideally BlobClient should set BlobClient.blobContext to protected. However, API - * extractor has issue blocking that. Here we redecelare _blobContext in BlockBlobClient. - */ - _blobContext; - /** - * blockBlobContext provided by protocol layer. - */ - blockBlobContext; - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline2; - let url2; - options = options || {}; - if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline2 = credentialOrPipelineOrContainerName; - } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline2 = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (core_util_1.isNodeLike) { - const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); - } - pipeline2 = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url2, pipeline2); - this.blockBlobContext = this.storageClientContext.blockBlob; - this._blobContext = this.storageClientContext.blob; - } - /** - * Creates a new BlockBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a URL to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot) { - return new _BlockBlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? void 0 : snapshot), this.pipeline); - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Quick query for a JSON or CSV formatted blob. - * - * Example usage (Node.js): - * - * ```ts snippet:ClientsQuery - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const blockBlobClient = containerClient.getBlockBlobClient(blobName); - * - * // Query and convert a blob to a string - * const queryBlockBlobResponse = await blockBlobClient.query("select from BlobStorage"); - * if (queryBlockBlobResponse.readableStreamBody) { - * const downloadedBuffer = await streamToBuffer(queryBlockBlobResponse.readableStreamBody); - * const downloaded = downloadedBuffer.toString(); - * console.log(`Query blob content: ${downloaded}`); - * } - * - * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { - * return new Promise((resolve, reject) => { - * const chunks: Buffer[] = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` - * - * @param query - - * @param options - - */ - async query(query, options = {}) { - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - if (!core_util_1.isNodeLike) { - throw new Error("This operation currently is only supported in Node.js."); - } - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this._blobContext.query({ - abortSignal: options.abortSignal, - queryRequest: { - queryType: "SQL", - expression: query, - inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), - outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) - }, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - cpkInfo: options.customerProvidedKey, - tracingOptions: updatedOptions.tracingOptions - })); - return new BlobQueryResponse_js_1.BlobQueryResponse(response, { - abortSignal: options.abortSignal, - onProgress: options.onProgress, - onError: options.onError - }); - }); - } - /** - * Creates a new block blob, or updates the content of an existing block blob. - * Updating an existing block blob overwrites any existing metadata on the blob. - * Partial updates are not supported; the content of the existing blob is - * overwritten with the new content. To perform a partial update of a block blob's, - * use {@link stageBlock} and {@link commitBlockList}. - * - * This is a non-parallel uploading method, please use {@link uploadFile}, - * {@link uploadStream} or {@link uploadBrowserData} for better performance - * with concurrency uploading. - * - * @see https://learn.microsoft.com/rest/api/storageservices/put-blob - * - * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function - * which returns a new Readable stream whose offset is from data source beginning. - * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a - * string including non non-Base64/Hex-encoded characters. - * @param options - Options to the Block Blob Upload operation. - * @returns Response data for the Block Blob Upload operation. - * - * Example usage: - * - * ```ts snippet:ClientsUpload - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const blockBlobClient = containerClient.getBlockBlobClient(blobName); - * - * const content = "Hello world!"; - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` - */ - async upload(body, contentLength, options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.upload(contentLength, body, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - requestOptions: { - onUploadProgress: options.onProgress - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, - immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, - legalHold: options.legalHold, - tier: (0, models_js_1.toAccessTier)(options.tier), - blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Creates a new Block Blob where the contents of the blob are read from a given URL. - * This API is supported beginning with the 2020-04-08 version. Partial updates - * are not supported with Put Blob from URL; the content of an existing blob is overwritten with - * the content of the new blob. To perform partial updates to a block blob’s contents using a - * source URL, use {@link stageBlockFromURL} and {@link commitBlockList}. - * - * @param sourceURL - Specifies the URL of the blob. The value - * may be a URL of up to 2 KB in length that specifies a blob. - * The value should be URL-encoded as it would appear - * in a request URI. The source blob must either be public - * or must be authenticated via a shared access signature. - * If the source blob is public, no authentication is required - * to perform the operation. Here are some examples of source object URLs: - * - https://myaccount.blob.core.windows.net/mycontainer/myblob - * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param options - Optional parameters. - */ - async syncUploadFromURL(sourceURL, options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, { - ...options, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions?.ifMatch, - sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince, - sourceIfTags: options.sourceConditions?.tagConditions - }, - cpkInfo: options.customerProvidedKey, - copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), - tier: (0, models_js_1.toAccessTier)(options.tier), - blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), - copySourceTags: options.copySourceTags, - fileRequestIntent: options.sourceShareTokenIntent, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Uploads the specified block to the block blob's "staging area" to be later - * committed by a call to commitBlockList. - * @see https://learn.microsoft.com/rest/api/storageservices/put-block - * - * @param blockId - A 64-byte value that is base64-encoded - * @param body - Data to upload to the staging area. - * @param contentLength - Number of bytes to upload. - * @param options - Options to the Block Blob Stage Block operation. - * @returns Response data for the Block Blob Stage Block operation. - */ - async stageBlock(blockId, body, contentLength, options = {}) { - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.stageBlock(blockId, contentLength, body, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - requestOptions: { - onUploadProgress: options.onProgress - }, - transactionalContentMD5: options.transactionalContentMD5, - transactionalContentCrc64: options.transactionalContentCrc64, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * The Stage Block From URL operation creates a new block to be committed as part - * of a blob where the contents are read from a URL. - * This API is available starting in version 2018-03-28. - * @see https://learn.microsoft.com/rest/api/storageservices/put-block-from-url - * - * @param blockId - A 64-byte value that is base64-encoded - * @param sourceURL - Specifies the URL of the blob. The value - * may be a URL of up to 2 KB in length that specifies a blob. - * The value should be URL-encoded as it would appear - * in a request URI. The source blob must either be public - * or must be authenticated via a shared access signature. - * If the source blob is public, no authentication is required - * to perform the operation. Here are some examples of source object URLs: - * - https://myaccount.blob.core.windows.net/mycontainer/myblob - * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param offset - From which position of the blob to download, greater than or equal to 0 - * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined - * @param options - Options to the Block Blob Stage Block From URL operation. - * @returns Response data for the Block Blob Stage Block From URL operation. - */ - async stageBlockFromURL(blockId, sourceURL, offset = 0, count, options = {}) { - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.stageBlockFromURL(blockId, 0, sourceURL, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), - fileRequestIntent: options.sourceShareTokenIntent, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Writes a blob by specifying the list of block IDs that make up the blob. - * In order to be written as part of a blob, a block must have been successfully written - * to the server in a prior {@link stageBlock} operation. You can call {@link commitBlockList} to - * update a blob by uploading only those blocks that have changed, then committing the new and existing - * blocks together. Any blocks not specified in the block list and permanently deleted. - * @see https://learn.microsoft.com/rest/api/storageservices/put-block-list - * - * @param blocks - Array of 64-byte value that is base64-encoded - * @param options - Options to the Block Blob Commit Block List operation. - * @returns Response data for the Block Blob Commit Block List operation. - */ - async commitBlockList(blocks, options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.commitBlockList({ latest: blocks }, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, - immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, - legalHold: options.legalHold, - tier: (0, models_js_1.toAccessTier)(options.tier), - blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Returns the list of blocks that have been uploaded as part of a block blob - * using the specified block list filter. - * @see https://learn.microsoft.com/rest/api/storageservices/get-block-list - * - * @param listType - Specifies whether to return the list of committed blocks, - * the list of uncommitted blocks, or both lists together. - * @param options - Options to the Block Blob Get Block List operation. - * @returns Response data for the Block Blob Get Block List operation. - */ - async getBlockList(listType, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - const res = (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.getBlockList(listType, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - })); - if (!res.committedBlocks) { - res.committedBlocks = []; - } - if (!res.uncommittedBlocks) { - res.uncommittedBlocks = []; - } - return res; - }); - } - // High level functions - /** - * Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob. - * - * When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is - * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList} - * to commit the block list. - * - * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is - * `blobContentType`, enabling the browser to provide - * functionality based on file type. - * - * @param data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView - * @param options - - */ - async uploadData(data, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (core_util_1.isNodeLike) { - let buffer; - if (data instanceof Buffer) { - buffer = data; - } else if (data instanceof ArrayBuffer) { - buffer = Buffer.from(data); - } else { - data = data; - buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); - } - return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions); - } else { - const browserBlob = new Blob([data]); - return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); - } - }); - } - /** - * ONLY AVAILABLE IN BROWSERS. - * - * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob. - * - * When buffer length lesser than or equal to 256MB, this method will use 1 upload call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call - * {@link commitBlockList} to commit the block list. - * - * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is - * `blobContentType`, enabling the browser to provide - * functionality based on file type. - * - * @deprecated Use {@link uploadData} instead. - * - * @param browserData - Blob, File, ArrayBuffer or ArrayBufferView - * @param options - Options to upload browser data. - * @returns Response data for the Blob Upload operation. - */ - async uploadBrowserData(browserData, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { - const browserBlob = new Blob([browserData]); - return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); - }); - } - /** - * - * Uploads data to block blob. Requires a bodyFactory as the data source, - * which need to return a {@link HttpRequestBody} object with the offset and size provided. - * - * When data length is no more than the specified {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is - * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList} - * to commit the block list. - * - * @param bodyFactory - - * @param size - size of the data to upload. - * @param options - Options to Upload to Block Blob operation. - * @returns Response data for the Blob Upload operation. - */ - async uploadSeekableInternal(bodyFactory, size, options = {}) { - let blockSize = options.blockSize ?? 0; - if (blockSize < 0 || blockSize > constants_js_1.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${constants_js_1.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); - } - const maxSingleShotSize = options.maxSingleShotSize ?? constants_js_1.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > constants_js_1.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${constants_js_1.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); - } - if (blockSize === 0) { - if (size > constants_js_1.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * constants_js_1.BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`${size} is too larger to upload to a block blob.`); - } - if (size > maxSingleShotSize) { - blockSize = Math.ceil(size / constants_js_1.BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - } - } - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } - if (!options.conditions) { - options.conditions = {}; - } - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { - if (size <= maxSingleShotSize) { - return (0, utils_common_js_1.assertResponse)(await this.upload(bodyFactory(0, size), size, updatedOptions)); - } - const numBlocks = Math.floor((size - 1) / blockSize) + 1; - if (numBlocks > constants_js_1.BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`The buffer's size is too big or the BlockSize is too small;the number of blocks must be <= ${constants_js_1.BLOCK_BLOB_MAX_BLOCKS}`); - } - const blockList = []; - const blockIDPrefix = (0, core_util_2.randomUUID)(); - let transferProgress = 0; - const batch = new Batch_js_1.Batch(options.concurrency); - for (let i = 0; i < numBlocks; i++) { - batch.addOperation(async () => { - const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); - const start = blockSize * i; - const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength = end - start; - blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { - abortSignal: options.abortSignal, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += contentLength; - if (options.onProgress) { - options.onProgress({ - loadedBytes: transferProgress - }); - } - }); - } - await batch.do(); - return this.commitBlockList(blockList, updatedOptions); - }); - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Uploads a local file in blocks to a block blob. - * - * When file size lesser than or equal to 256MB, this method will use 1 upload call to finish the upload. - * Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList - * to commit the block list. - * - * @param filePath - Full path of local file - * @param options - Options to Upload to Block Blob operation. - * @returns Response data for the Blob Upload operation. - */ - async uploadFile(filePath, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await (0, utils_js_1.fsStat)(filePath)).size; - return this.uploadSeekableInternal((offset, count) => { - return () => (0, utils_js_1.fsCreateReadStream)(filePath, { - autoClose: true, - end: count ? offset + count - 1 : Infinity, - start: offset - }); - }, size, { - ...options, - tracingOptions: updatedOptions.tracingOptions - }); - }); - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Uploads a Node.js Readable stream into block blob. - * - * PERFORMANCE IMPROVEMENT TIPS: - * * Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. - * - * @param stream - Node.js Readable stream - * @param bufferSize - Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB - * @param maxConcurrency - Max concurrency indicates the max number of buffers that can be allocated, - * positive correlation with max uploading concurrency. Default value is 5 - * @param options - Options to Upload Stream to Block Blob operation. - * @returns Response data for the Blob Upload operation. - */ - async uploadStream(stream2, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } - if (!options.conditions) { - options.conditions = {}; - } - return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { - let blockNum = 0; - const blockIDPrefix = (0, core_util_2.randomUUID)(); - let transferProgress = 0; - const blockList = []; - const scheduler = new storage_common_1.BufferScheduler( - stream2, - bufferSize, - maxConcurrency, - async (body, length) => { - const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); - blockList.push(blockID); - blockNum++; - await this.stageBlock(blockID, body, length, { - customerProvidedKey: options.customerProvidedKey, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += length; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }, - // concurrency should set a smaller value than maxConcurrency, which is helpful to - // reduce the possibility when a outgoing handler waits for stream data, in - // this situation, outgoing handlers are blocked. - // Outgoing queue shouldn't be empty. - Math.ceil(maxConcurrency / 4 * 3) - ); - await scheduler.do(); - return (0, utils_common_js_1.assertResponse)(await this.commitBlockList(blockList, { - ...options, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - }; - exports2.BlockBlobClient = BlockBlobClient; - var PageBlobClient = class _PageBlobClient extends BlobClient { - /** - * pageBlobsContext provided by protocol layer. - */ - pageBlobContext; - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline2; - let url2; - options = options || {}; - if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline2 = credentialOrPipelineOrContainerName; - } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline2 = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (core_util_1.isNodeLike) { - const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); - } - pipeline2 = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url2, pipeline2); - this.pageBlobContext = this.storageClientContext.pageBlob; - } - /** - * Creates a new PageBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a Client to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot) { - return new _PageBlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? void 0 : snapshot), this.pipeline); - } - /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. - * @see https://learn.microsoft.com/rest/api/storageservices/put-blob - * - * @param size - size of the page blob. - * @param options - Options to the Page Blob Create operation. - * @returns Response data for the Page Blob Create operation. - */ - async create(size, options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.create(0, size, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - blobSequenceNumber: options.blobSequenceNumber, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, - immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, - legalHold: options.legalHold, - tier: (0, models_js_1.toAccessTier)(options.tier), - blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. If the blob with the same name already exists, the content - * of the existing blob will remain unchanged. - * @see https://learn.microsoft.com/rest/api/storageservices/put-blob - * - * @param size - size of the page blob. - * @param options - - */ - async createIfNotExists(size, options = {}) { - return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - try { - const conditions = { ifNoneMatch: constants_js_1.ETagAny }; - const res = (0, utils_common_js_1.assertResponse)(await this.create(size, { - ...options, - conditions, - tracingOptions: updatedOptions.tracingOptions - })); - return { - succeeded: true, - ...res, - _response: res._response - // _response is made non-enumerable - }; - } catch (e) { - if (e.details?.errorCode === "BlobAlreadyExists") { - return { - succeeded: false, - ...e.response?.parsedHeaders, - _response: e.response - }; - } - throw e; - } - }); - } - /** - * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://learn.microsoft.com/rest/api/storageservices/put-page - * - * @param body - Data to upload - * @param offset - Offset of destination page blob - * @param count - Content length of the body, also number of bytes to be uploaded - * @param options - Options to the Page Blob Upload Pages operation. - * @returns Response data for the Page Blob Upload Pages operation. - */ - async uploadPages(body, offset, count, options = {}) { - options.conditions = options.conditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.uploadPages(count, body, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - requestOptions: { - onUploadProgress: options.onProgress - }, - range: (0, Range_js_1.rangeToString)({ offset, count }), - sequenceNumberAccessConditions: options.conditions, - transactionalContentMD5: options.transactionalContentMD5, - transactionalContentCrc64: options.transactionalContentCrc64, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * The Upload Pages operation writes a range of pages to a page blob where the - * contents are read from a URL. - * @see https://learn.microsoft.com/rest/api/storageservices/put-page-from-url - * - * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication - * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source page blob - * @param destOffset - Offset of destination page blob - * @param count - Number of bytes to be uploaded from source page blob - * @param options - - */ - async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); - return tracing_js_1.tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.uploadPagesFromURL(sourceURL, (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), 0, (0, Range_js_1.rangeToString)({ offset: destOffset, count }), { - abortSignal: options.abortSignal, - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - leaseAccessConditions: options.conditions, - sequenceNumberAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions?.ifMatch, - sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), - fileRequestIntent: options.sourceShareTokenIntent, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Frees the specified pages from the page blob. - * @see https://learn.microsoft.com/rest/api/storageservices/put-page - * - * @param offset - Starting byte position of the pages to clear. - * @param count - Number of bytes to clear. - * @param options - Options to the Page Blob Clear Pages operation. - * @returns Response data for the Page Blob Clear Pages operation. - */ - async clearPages(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.clearPages(0, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - range: (0, Range_js_1.rangeToString)({ offset, count }), - sequenceNumberAccessConditions: options.conditions, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to the Page Blob Get Ranges operation. - * @returns Response data for the Page Blob Get Ranges operation. - */ - async getPageRanges(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRanges({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - range: (0, Range_js_1.rangeToString)({ offset, count }), - tracingOptions: updatedOptions.tracingOptions - })); - return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); - }); - } - /** - * getPageRangesSegment returns a single segment of page ranges starting from the - * specified Marker. Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call getPageRangesSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to PageBlob Get Page Ranges Segment operation. - */ - async listPageRangesSegment(offset = 0, count, marker, options = {}) { - return tracing_js_1.tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRanges({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - range: (0, Range_js_1.rangeToString)({ offset, count }), - marker, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel} - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param marker - A string value that identifies the portion of - * the get of page ranges to be returned with the next getting operation. The - * operation returns the ContinuationToken value within the response body if the - * getting operation did not return all page ranges remaining within the current page. - * The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of get - * items. The marker value is opaque to the client. - * @param options - Options to List Page Ranges operation. - */ - async *listPageRangeItemSegments(offset = 0, count, marker, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker || marker === void 0) { - do { - getPageRangeItemSegmentsResponse = await this.listPageRangesSegment(offset, count, marker, options); - marker = getPageRangeItemSegmentsResponse.continuationToken; - yield await getPageRangeItemSegmentsResponse; - } while (marker); - } - } - /** - * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to List Page Ranges operation. - */ - async *listPageRangeItems(offset = 0, count, options = {}) { - let marker; - for await (const getPageRangesSegment of this.listPageRangeItemSegments(offset, count, marker, options)) { - yield* (0, utils_common_js_1.ExtractPageRangeInfoItems)(getPageRangesSegment); - } - } - /** - * Returns an async iterable iterator to list of page ranges for a page blob. - * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges - * - * .byPage() returns an async iterable iterator to list of page ranges for a page blob. - * - * ```ts snippet:ClientsListPageBlobs - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const pageBlobClient = containerClient.getPageBlobClient(blobName); - * - * // Example using `for await` syntax - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRanges()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * - * // Example using `iter.next()` syntax - * i = 1; - * const iter = pageBlobClient.listPageRanges(); - * let { value, done } = await iter.next(); - * while (!done) { - * console.log(`Page range ${i++}: ${value.start} - ${value.end}`); - * ({ value, done } = await iter.next()); - * } - * - * // Example using `byPage()` syntax - * i = 1; - * for await (const page of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of page.pageRange || []) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * - * // Example using paging with a marker - * i = 1; - * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * // Prints 2 page ranges - * if (response.pageRange) { - * for (const pageRange of response.pageRange) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * // Prints 10 page ranges - * if (response.pageRange) { - * for (const pageRange of response.pageRange) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * ``` - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to the Page Blob Get Ranges operation. - * @returns An asyncIterableIterator that supports paging. - */ - listPageRanges(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - const iter = this.listPageRangeItems(offset, count, options); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, { - maxPageSize: settings.maxPageSize, - ...options - }); - } - }; - } - /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob. - * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page blob - * @param count - Number of bytes to get ranges diff. - * @param prevSnapshot - Timestamp of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - * @returns Response data for the Page Blob Get Page Range Diff operation. - */ - async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - const result = (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - prevsnapshot: prevSnapshot, - range: (0, Range_js_1.rangeToString)({ offset, count }), - tracingOptions: updatedOptions.tracingOptions - })); - return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); - }); - } - /** - * getPageRangesDiffSegment returns a single segment of page ranges starting from the - * specified Marker for difference between previous snapshot and the target page blob. - * Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call getPageRangesDiffSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. - * @param marker - A string value that identifies the portion of the get to be returned with the next get operation. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - */ - async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options = {}) { - return tracing_js_1.tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options?.abortSignal, - leaseAccessConditions: options?.conditions, - modifiedAccessConditions: { - ...options?.conditions, - ifTags: options?.conditions?.tagConditions - }, - prevsnapshot: prevSnapshotOrUrl, - range: (0, Range_js_1.rangeToString)({ - offset, - count - }), - marker, - maxPageSize: options?.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} - * - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. - * @param marker - A string value that identifies the portion of - * the get of page ranges to be returned with the next getting operation. The - * operation returns the ContinuationToken value within the response body if the - * getting operation did not return all page ranges remaining within the current page. - * The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of get - * items. The marker value is opaque to the client. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - */ - async *listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) { - let getPageRangeItemSegmentsResponse; - if (!!marker || marker === void 0) { - do { - getPageRangeItemSegmentsResponse = await this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options); - marker = getPageRangeItemSegmentsResponse.continuationToken; - yield await getPageRangeItemSegmentsResponse; - } while (marker); - } - } - /** - * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - */ - async *listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - let marker; - for await (const getPageRangesSegment of this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)) { - yield* (0, utils_common_js_1.ExtractPageRangeInfoItems)(getPageRangesSegment); - } - } - /** - * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. - * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges - * - * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. - * - * ```ts snippet:ClientsListPageBlobsDiff - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const pageBlobClient = containerClient.getPageBlobClient(blobName); - * - * const offset = 0; - * const count = 1024; - * const previousSnapshot = ""; - * // Example using `for await` syntax - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * - * // Example using `iter.next()` syntax - * i = 1; - * const iter = pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot); - * let { value, done } = await iter.next(); - * while (!done) { - * console.log(`Page range ${i++}: ${value.start} - ${value.end}`); - * ({ value, done } = await iter.next()); - * } - * - * // Example using `byPage()` syntax - * i = 1; - * for await (const page of pageBlobClient - * .listPageRangesDiff(offset, count, previousSnapshot) - * .byPage({ maxPageSize: 20 })) { - * for (const pageRange of page.pageRange || []) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * - * // Example using paging with a marker - * i = 1; - * let iterator = pageBlobClient - * .listPageRangesDiff(offset, count, previousSnapshot) - * .byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * // Prints 2 page ranges - * if (response.pageRange) { - * for (const pageRange of response.pageRange) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = pageBlobClient - * .listPageRangesDiff(offset, count, previousSnapshot) - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * // Prints 10 page ranges - * if (response.pageRange) { - * for (const pageRange of response.pageRange) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * ``` - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshot - Timestamp of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Ranges operation. - * @returns An asyncIterableIterator that supports paging. - */ - listPageRangesDiff(offset, count, prevSnapshot, options = {}) { - options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { - ...options - }); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, { - maxPageSize: settings.maxPageSize, - ...options - }); - } - }; - } - /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks. - * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page blob - * @param count - Number of bytes to get ranges diff. - * @param prevSnapshotUrl - URL of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - * @returns Response data for the Page Blob Get Page Range Diff operation. - */ - async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - prevSnapshotUrl, - range: (0, Range_js_1.rangeToString)({ offset, count }), - tracingOptions: updatedOptions.tracingOptions - })); - return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); - }); - } - /** - * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties - * - * @param size - Target size - * @param options - Options to the Page Blob Resize operation. - * @returns Response data for the Page Blob Resize operation. - */ - async resize(size, options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.resize(size, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Sets a page blob's sequence number. - * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties - * - * @param sequenceNumberAction - Indicates how the service should modify the blob's sequence number. - * @param sequenceNumber - Required if sequenceNumberAction is max or update - * @param options - Options to the Page Blob Update Sequence Number operation. - * @returns Response data for the Page Blob Update Sequence Number operation. - */ - async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, { - abortSignal: options.abortSignal, - blobSequenceNumber: sequenceNumber, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Begins an operation to start an incremental copy from one page blob's snapshot to this page blob. - * The snapshot is copied such that only the differential changes between the previously - * copied snapshot are transferred to the destination. - * The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. - * @see https://learn.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://learn.microsoft.com/azure/virtual-machines/windows/incremental-snapshots - * - * @param copySource - Specifies the name of the source page blob snapshot. For example, - * https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param options - Options to the Page Blob Copy Incremental operation. - * @returns Response data for the Page Blob Copy Incremental operation. - */ - async startCopyIncremental(copySource, options = {}) { - return tracing_js_1.tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.copyIncremental(copySource, { - abortSignal: options.abortSignal, - modifiedAccessConditions: { - ...options.conditions, - ifTags: options.conditions?.tagConditions - }, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - }; - exports2.PageBlobClient = PageBlobClient; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BatchUtils.js -var require_BatchUtils = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BatchUtils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getBodyAsText = getBodyAsText; - exports2.utf8ByteLength = utf8ByteLength; - var utils_js_1 = require_utils6(); - var constants_js_1 = require_constants10(); - async function getBodyAsText(batchResponse) { - let buffer = Buffer.alloc(constants_js_1.BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await (0, utils_js_1.streamToBuffer2)(batchResponse.readableStreamBody, buffer); - buffer = buffer.slice(0, responseLength); - return buffer.toString(); - } - function utf8ByteLength(str) { - return Buffer.byteLength(str); - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BatchResponseParser.js -var require_BatchResponseParser = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BatchResponseParser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BatchResponseParser = void 0; - var core_rest_pipeline_1 = require_commonjs6(); - var core_http_compat_1 = require_commonjs9(); - var constants_js_1 = require_constants10(); - var BatchUtils_js_1 = require_BatchUtils(); - var log_js_1 = require_log5(); - var HTTP_HEADER_DELIMITER = ": "; - var SPACE_DELIMITER = " "; - var NOT_FOUND = -1; - var BatchResponseParser = class { - batchResponse; - responseBatchBoundary; - perResponsePrefix; - batchResponseEnding; - subRequests; - constructor(batchResponse, subRequests) { - if (!batchResponse || !batchResponse.contentType) { - throw new RangeError("batchResponse is malformed or doesn't contain valid content-type."); - } - if (!subRequests || subRequests.size === 0) { - throw new RangeError("Invalid state: subRequests is not provided or size is 0."); - } - this.batchResponse = batchResponse; - this.subRequests = subRequests; - this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; - this.batchResponseEnding = `--${this.responseBatchBoundary}--`; - } - // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response - async parseBatchResponse() { - if (this.batchResponse._response.status !== constants_js_1.HTTPURLConnection.HTTP_ACCEPTED) { - throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`); - } - const responseBodyAsText = await (0, BatchUtils_js_1.getBodyAsText)(this.batchResponse); - const subResponses = responseBodyAsText.split(this.batchResponseEnding)[0].split(this.perResponsePrefix).slice(1); - const subResponseCount = subResponses.length; - if (subResponseCount !== this.subRequests.size && subResponseCount !== 1) { - throw new Error("Invalid state: sub responses' count is not equal to sub requests' count."); - } - const deserializedSubResponses = new Array(subResponseCount); - let subResponsesSucceededCount = 0; - let subResponsesFailedCount = 0; - for (let index2 = 0; index2 < subResponseCount; index2++) { - const subResponse = subResponses[index2]; - const deserializedSubResponse = {}; - deserializedSubResponse.headers = (0, core_http_compat_1.toHttpHeadersLike)((0, core_rest_pipeline_1.createHttpHeaders)()); - const responseLines = subResponse.split(`${constants_js_1.HTTP_LINE_ENDING}`); - let subRespHeaderStartFound = false; - let subRespHeaderEndFound = false; - let subRespFailed = false; - let contentId = NOT_FOUND; - for (const responseLine of responseLines) { - if (!subRespHeaderStartFound) { - if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { - contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); - } - if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { - subRespHeaderStartFound = true; - const tokens = responseLine.split(SPACE_DELIMITER); - deserializedSubResponse.status = parseInt(tokens[1]); - deserializedSubResponse.statusMessage = tokens.slice(2).join(SPACE_DELIMITER); - } - continue; - } - if (responseLine.trim() === "") { - if (!subRespHeaderEndFound) { - subRespHeaderEndFound = true; - } - continue; - } - if (!subRespHeaderEndFound) { - if (responseLine.indexOf(HTTP_HEADER_DELIMITER) === -1) { - throw new Error(`Invalid state: find non-empty line '${responseLine}' without HTTP header delimiter '${HTTP_HEADER_DELIMITER}'.`); - } - const tokens = responseLine.split(HTTP_HEADER_DELIMITER); - deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { - deserializedSubResponse.errorCode = tokens[1]; - subRespFailed = true; - } - } else { - if (!deserializedSubResponse.bodyAsText) { - deserializedSubResponse.bodyAsText = ""; - } - deserializedSubResponse.bodyAsText += responseLine; - } - } - if (contentId !== NOT_FOUND && Number.isInteger(contentId) && contentId >= 0 && contentId < this.subRequests.size && deserializedSubResponses[contentId] === void 0) { - deserializedSubResponse._request = this.subRequests.get(contentId); - deserializedSubResponses[contentId] = deserializedSubResponse; - } else { - log_js_1.logger.error(`subResponses[${index2}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); - } - if (subRespFailed) { - subResponsesFailedCount++; - } else { - subResponsesSucceededCount++; - } - } - return { - subResponses: deserializedSubResponses, - subResponsesSucceededCount, - subResponsesFailedCount - }; - } - }; - exports2.BatchResponseParser = BatchResponseParser; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/utils/Mutex.js -var require_Mutex = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/utils/Mutex.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Mutex = void 0; - var MutexLockStatus; - (function(MutexLockStatus2) { - MutexLockStatus2[MutexLockStatus2["LOCKED"] = 0] = "LOCKED"; - MutexLockStatus2[MutexLockStatus2["UNLOCKED"] = 1] = "UNLOCKED"; - })(MutexLockStatus || (MutexLockStatus = {})); - var Mutex = class { - /** - * Lock for a specific key. If the lock has been acquired by another customer, then - * will wait until getting the lock. - * - * @param key - lock key - */ - static async lock(key) { - return new Promise((resolve14) => { - if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { - this.keys[key] = MutexLockStatus.LOCKED; - resolve14(); - } else { - this.onUnlockEvent(key, () => { - this.keys[key] = MutexLockStatus.LOCKED; - resolve14(); - }); - } - }); - } - /** - * Unlock a key. - * - * @param key - - */ - static async unlock(key) { - return new Promise((resolve14) => { - if (this.keys[key] === MutexLockStatus.LOCKED) { - this.emitUnlockEvent(key); - } - delete this.keys[key]; - resolve14(); - }); - } - static keys = {}; - static listeners = {}; - static onUnlockEvent(key, handler2) { - if (this.listeners[key] === void 0) { - this.listeners[key] = [handler2]; - } else { - this.listeners[key].push(handler2); - } - } - static emitUnlockEvent(key) { - if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { - const handler2 = this.listeners[key].shift(); - setImmediate(() => { - handler2.call(this); - }); - } - } - }; - exports2.Mutex = Mutex; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BlobBatch.js -var require_BlobBatch = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BlobBatch.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobBatch = void 0; - var core_util_1 = require_commonjs4(); - var core_auth_1 = require_commonjs7(); - var core_rest_pipeline_1 = require_commonjs6(); - var core_util_2 = require_commonjs4(); - var AnonymousCredential_js_1 = require_AnonymousCredential(); - var Clients_js_1 = require_Clients(); - var Mutex_js_1 = require_Mutex(); - var Pipeline_js_1 = require_Pipeline(); - var utils_common_js_1 = require_utils_common(); - var core_xml_1 = require_commonjs10(); - var constants_js_1 = require_constants10(); - var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); - var tracing_js_1 = require_tracing(); - var core_client_1 = require_commonjs8(); - var StorageSharedKeyCredentialPolicyV2_js_1 = require_StorageSharedKeyCredentialPolicyV22(); - var BlobBatch = class { - batchRequest; - batch = "batch"; - batchType; - constructor() { - this.batchRequest = new InnerBatchRequest(); - } - /** - * Get the value of Content-Type for a batch request. - * The value must be multipart/mixed with a batch boundary. - * Example: multipart/mixed; boundary=batch_a81786c8-e301-4e42-a729-a32ca24ae252 - */ - getMultiPartContentType() { - return this.batchRequest.getMultipartContentType(); - } - /** - * Get assembled HTTP request body for sub requests. - */ - getHttpRequestBody() { - return this.batchRequest.getHttpRequestBody(); - } - /** - * Get sub requests that are added into the batch request. - */ - getSubRequests() { - return this.batchRequest.getSubRequests(); - } - async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex_js_1.Mutex.lock(this.batch); - try { - this.batchRequest.preAddSubRequest(subRequest); - await assembleSubRequestFunc(); - this.batchRequest.postAddSubRequest(subRequest); - } finally { - await Mutex_js_1.Mutex.unlock(this.batch); - } - } - setBatchType(batchType) { - if (!this.batchType) { - this.batchType = batchType; - } - if (this.batchType !== batchType) { - throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`); - } - } - async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; - let credential; - if (typeof urlOrBlobClient === "string" && (core_util_2.isNodeLike && credentialOrOptions instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrOptions))) { - url2 = urlOrBlobClient; - credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { - url2 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - options = credentialOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); - } - if (!options) { - options = {}; - } - return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { - this.setBatchType("delete"); - await this.addSubRequestInternal({ - url: url2, - credential - }, async () => { - await new Clients_js_1.BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); - }); - }); - } - async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; - let credential; - let tier; - if (typeof urlOrBlobClient === "string" && (core_util_2.isNodeLike && credentialOrTier instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrTier))) { - url2 = urlOrBlobClient; - credential = credentialOrTier; - tier = tierOrOptions; - } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { - url2 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - tier = credentialOrTier; - options = tierOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); - } - if (!options) { - options = {}; - } - return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { - this.setBatchType("setAccessTier"); - await this.addSubRequestInternal({ - url: url2, - credential - }, async () => { - await new Clients_js_1.BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier, updatedOptions); - }); - }); - } - }; - exports2.BlobBatch = BlobBatch; - var InnerBatchRequest = class { - operationCount; - body; - subRequests; - boundary; - subRequestPrefix; - multipartContentType; - batchRequestEnding; - constructor() { - this.operationCount = 0; - this.body = ""; - const tempGuid = (0, core_util_1.randomUUID)(); - this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${constants_js_1.HTTP_LINE_ENDING}${constants_js_1.HeaderConstants.CONTENT_TYPE}: application/http${constants_js_1.HTTP_LINE_ENDING}${constants_js_1.HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; - this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`; - this.batchRequestEnding = `--${this.boundary}--`; - this.subRequests = /* @__PURE__ */ new Map(); - } - /** - * Create pipeline to assemble sub requests. The idea here is to use existing - * credential and serialization/deserialization components, with additional policies to - * filter unnecessary headers, assemble sub requests into request's body - * and intercept request from going to wire. - * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used. - */ - createPipeline(credential) { - const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); - corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ - stringifyXML: core_xml_1.stringifyXML, - serializerOptions: { - xml: { - xmlCharKey: "#" - } - } - }), { phase: "Serialize" }); - corePipeline.addPolicy(batchHeaderFilterPolicy()); - corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if ((0, core_auth_1.isTokenCredential)(credential)) { - corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential, - scopes: constants_js_1.StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { - corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); - } - const pipeline2 = new Pipeline_js_1.Pipeline([]); - pipeline2._credential = credential; - pipeline2._corePipeline = corePipeline; - return pipeline2; - } - appendSubRequestToBody(request3) { - this.body += [ - this.subRequestPrefix, - // sub request constant prefix - `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, - // sub request's content ID - "", - // empty line after sub request's content ID - `${request3.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request3.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` - // sub request start line with method - ].join(constants_js_1.HTTP_LINE_ENDING); - for (const [name, value] of request3.headers) { - this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; - } - this.body += constants_js_1.HTTP_LINE_ENDING; - } - preAddSubRequest(subRequest) { - if (this.operationCount >= constants_js_1.BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${constants_js_1.BATCH_MAX_REQUEST} sub requests in a single batch`); - } - const path30 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path30 || path30 === "") { - throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); - } - } - postAddSubRequest(subRequest) { - this.subRequests.set(this.operationCount, subRequest); - this.operationCount++; - } - // Return the http request body with assembling the ending line to the sub request body. - getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; - } - getMultipartContentType() { - return this.multipartContentType; - } - getSubRequests() { - return this.subRequests; - } - }; - function batchRequestAssemblePolicy(batchRequest) { - return { - name: "batchRequestAssemblePolicy", - async sendRequest(request3) { - batchRequest.appendSubRequestToBody(request3); - return { - request: request3, - status: 200, - headers: (0, core_rest_pipeline_1.createHttpHeaders)() - }; - } - }; - } - function batchHeaderFilterPolicy() { - return { - name: "batchHeaderFilterPolicy", - async sendRequest(request3, next) { - let xMsHeaderName = ""; - for (const [name] of request3.headers) { - if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { - xMsHeaderName = name; - } - } - if (xMsHeaderName !== "") { - request3.headers.delete(xMsHeaderName); - } - return next(request3); - } - }; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BlobBatchClient.js -var require_BlobBatchClient = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BlobBatchClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobBatchClient = void 0; - var BatchResponseParser_js_1 = require_BatchResponseParser(); - var BatchUtils_js_1 = require_BatchUtils(); - var BlobBatch_js_1 = require_BlobBatch(); - var tracing_js_1 = require_tracing(); - var AnonymousCredential_js_1 = require_AnonymousCredential(); - var StorageContextClient_js_1 = require_StorageContextClient(); - var Pipeline_js_1 = require_Pipeline(); - var utils_common_js_1 = require_utils_common(); - var BlobBatchClient = class { - serviceOrContainerContext; - constructor(url2, credentialOrPipeline, options) { - let pipeline2; - if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { - pipeline2 = credentialOrPipeline; - } else if (!credentialOrPipeline) { - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else { - pipeline2 = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); - } - const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline2)); - const path30 = (0, utils_common_js_1.getURLPath)(url2); - if (path30 && path30 !== "/") { - this.serviceOrContainerContext = storageClientContext.container; - } else { - this.serviceOrContainerContext = storageClientContext.service; - } - } - /** - * Creates a {@link BlobBatch}. - * A BlobBatch represents an aggregated set of operations on blobs. - */ - createBatch() { - return new BlobBatch_js_1.BlobBatch(); - } - async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch_js_1.BlobBatch(); - for (const urlOrBlobClient of urlsOrBlobClients) { - if (typeof urlOrBlobClient === "string") { - await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); - } else { - await batch.deleteBlob(urlOrBlobClient, credentialOrOptions); - } - } - return this.submitBatch(batch); - } - async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch_js_1.BlobBatch(); - for (const urlOrBlobClient of urlsOrBlobClients) { - if (typeof urlOrBlobClient === "string") { - await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); - } else { - await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions); - } - } - return this.submitBatch(batch); - } - /** - * Submit batch request which consists of multiple subrequests. - * - * Get `blobBatchClient` and other details before running the snippets. - * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` - * - * Example usage: - * - * ```ts snippet:BlobBatchClientSubmitBatch - * import { DefaultAzureCredential } from "@azure/identity"; - * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; - * - * const account = ""; - * const credential = new DefaultAzureCredential(); - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * credential, - * ); - * - * const containerName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const blobBatchClient = containerClient.getBlobBatchClient(); - * - * const batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob("", credential); - * await batchRequest.deleteBlob("", credential, { - * deleteSnapshots: "include", - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` - * - * Example using a lease: - * - * ```ts snippet:BlobBatchClientSubmitBatchWithLease - * import { DefaultAzureCredential } from "@azure/identity"; - * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; - * - * const account = ""; - * const credential = new DefaultAzureCredential(); - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * credential, - * ); - * - * const containerName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const blobBatchClient = containerClient.getBlobBatchClient(); - * const blobClient = containerClient.getBlobClient(""); - * - * const batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blobClient, "Cool"); - * await batchRequest.setBlobAccessTier(blobClient, "Cool", { - * conditions: { leaseId: "" }, - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` - * - * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch - * - * @param batchRequest - A set of Delete or SetTier operations. - * @param options - - */ - async submitBatch(batchRequest, options = {}) { - if (!batchRequest || batchRequest.getSubRequests().size === 0) { - throw new RangeError("Batch request should contain one or more sub requests."); - } - return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { - const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = (0, utils_common_js_1.assertResponse)(await this.serviceOrContainerContext.submitBatch((0, BatchUtils_js_1.utf8ByteLength)(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, { - ...updatedOptions - })); - const batchResponseParser = new BatchResponseParser_js_1.BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); - const responseSummary = await batchResponseParser.parseBatchResponse(); - const res = { - _response: rawBatchResponse._response, - contentType: rawBatchResponse.contentType, - errorCode: rawBatchResponse.errorCode, - requestId: rawBatchResponse.requestId, - clientRequestId: rawBatchResponse.clientRequestId, - version: rawBatchResponse.version, - subResponses: responseSummary.subResponses, - subResponsesSucceededCount: responseSummary.subResponsesSucceededCount, - subResponsesFailedCount: responseSummary.subResponsesFailedCount - }; - return res; - }); - } - }; - exports2.BlobBatchClient = BlobBatchClient; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/ContainerClient.js -var require_ContainerClient = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/ContainerClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContainerClient = void 0; - var core_rest_pipeline_1 = require_commonjs6(); - var core_util_1 = require_commonjs4(); - var core_auth_1 = require_commonjs7(); - var AnonymousCredential_js_1 = require_AnonymousCredential(); - var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); - var Pipeline_js_1 = require_Pipeline(); - var StorageClient_js_1 = require_StorageClient(); - var tracing_js_1 = require_tracing(); - var utils_common_js_1 = require_utils_common(); - var BlobSASSignatureValues_js_1 = require_BlobSASSignatureValues(); - var BlobLeaseClient_js_1 = require_BlobLeaseClient(); - var Clients_js_1 = require_Clients(); - var BlobBatchClient_js_1 = require_BlobBatchClient(); - var ContainerClient = class extends StorageClient_js_1.StorageClient { - /** - * containerContext provided by protocol layer. - */ - containerContext; - _containerName; - /** - * The name of the container. - */ - get containerName() { - return this._containerName; - } - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { - let pipeline2; - let url2; - options = options || {}; - if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline2 = credentialOrPipelineOrContainerName; - } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline2 = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { - const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (core_util_1.isNodeLike) { - const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); - if (!options.proxyOptions) { - options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); - } - pipeline2 = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } else { - throw new Error("Expecting non-empty strings for containerName parameter"); - } - super(url2, pipeline2); - this._containerName = this.getContainerNameFromUrl(); - this.containerContext = this.storageClientContext.container; - } - /** - * Creates a new container under the specified account. If the container with - * the same name already exists, the operation fails. - * @see https://learn.microsoft.com/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata - * - * @param options - Options to Container Create operation. - * - * - * Example usage: - * - * ```ts snippet:ContainerClientCreate - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const createContainerResponse = await containerClient.create(); - * console.log("Container was created successfully", createContainerResponse.requestId); - * ``` - */ - async create(options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.containerContext.create(updatedOptions)); - }); - } - /** - * Creates a new container under the specified account. If the container with - * the same name already exists, it is not changed. - * @see https://learn.microsoft.com/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata - * - * @param options - - */ - async createIfNotExists(options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - try { - const res = await this.create(updatedOptions); - return { - succeeded: true, - ...res, - _response: res._response - // _response is made non-enumerable - }; - } catch (e) { - if (e.details?.errorCode === "ContainerAlreadyExists") { - return { - succeeded: false, - ...e.response?.parsedHeaders, - _response: e.response - }; - } else { - throw e; - } - } - }); - } - /** - * Returns true if the Azure container resource represented by this client exists; false otherwise. - * - * NOTE: use this function with care since an existing container might be deleted by other clients or - * applications. Vice versa new containers with the same name might be added by other clients or - * applications after this function completes. - * - * @param options - - */ - async exists(options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { - try { - await this.getProperties({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - }); - return true; - } catch (e) { - if (e.statusCode === 404) { - return false; - } - throw e; - } - }); - } - /** - * Creates a {@link BlobClient} - * - * @param blobName - A blob name - * @returns A new BlobClient object for the given blob name. - */ - getBlobClient(blobName) { - return new Clients_js_1.BlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline); - } - /** - * Creates an {@link AppendBlobClient} - * - * @param blobName - An append blob name - */ - getAppendBlobClient(blobName) { - return new Clients_js_1.AppendBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline); - } - /** - * Creates a {@link BlockBlobClient} - * - * @param blobName - A block blob name - * - * - * Example usage: - * - * ```ts snippet:ClientsUpload - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const blobName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * const blockBlobClient = containerClient.getBlockBlobClient(blobName); - * - * const content = "Hello world!"; - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` - */ - getBlockBlobClient(blobName) { - return new Clients_js_1.BlockBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline); - } - /** - * Creates a {@link PageBlobClient} - * - * @param blobName - A page blob name - */ - getPageBlobClient(blobName) { - return new Clients_js_1.PageBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline); - } - /** - * Returns all user-defined metadata and system properties for the specified - * container. The data returned does not include the container's list of blobs. - * @see https://learn.microsoft.com/rest/api/storageservices/get-container-properties - * - * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if - * they originally contained uppercase characters. This differs from the metadata keys returned by - * the `listContainers` method of {@link BlobServiceClient} using the `includeMetadata` option, which - * will retain their original casing. - * - * @param options - Options to Container Get Properties operation. - */ - async getProperties(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - return tracing_js_1.tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.containerContext.getProperties({ - abortSignal: options.abortSignal, - ...options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Marks the specified container for deletion. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://learn.microsoft.com/rest/api/storageservices/delete-container - * - * @param options - Options to Container Delete operation. - */ - async delete(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - return tracing_js_1.tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.containerContext.delete({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Marks the specified container for deletion if it exists. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://learn.microsoft.com/rest/api/storageservices/delete-container - * - * @param options - Options to Container Delete operation. - */ - async deleteIfExists(options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - try { - const res = await this.delete(updatedOptions); - return { - succeeded: true, - ...res, - _response: res._response - }; - } catch (e) { - if (e.details?.errorCode === "ContainerNotFound") { - return { - succeeded: false, - ...e.response?.parsedHeaders, - _response: e.response - }; - } - throw e; - } - }); - } - /** - * Sets one or more user-defined name-value pairs for the specified container. - * - * If no option provided, or no metadata defined in the parameter, the container - * metadata will be removed. - * - * @see https://learn.microsoft.com/rest/api/storageservices/set-container-metadata - * - * @param metadata - Replace existing metadata with this value. - * If no value provided the existing metadata will be removed. - * @param options - Options to Container Set Metadata operation. - */ - async setMetadata(metadata, options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - if (options.conditions.ifUnmodifiedSince) { - throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service"); - } - return tracing_js_1.tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.containerContext.setMetadata({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Gets the permissions for the specified container. The permissions indicate - * whether container data may be accessed publicly. - * - * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings. - * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z". - * - * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl - * - * @param options - Options to Container Get Access Policy operation. - */ - async getAccessPolicy(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - return tracing_js_1.tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.getAccessPolicy({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - const res = { - _response: response._response, - blobPublicAccess: response.blobPublicAccess, - date: response.date, - etag: response.etag, - errorCode: response.errorCode, - lastModified: response.lastModified, - requestId: response.requestId, - clientRequestId: response.clientRequestId, - signedIdentifiers: [], - version: response.version - }; - for (const identifier of response) { - let accessPolicy = void 0; - if (identifier.accessPolicy) { - accessPolicy = { - permissions: identifier.accessPolicy.permissions - }; - if (identifier.accessPolicy.expiresOn) { - accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn); - } - if (identifier.accessPolicy.startsOn) { - accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn); - } - } - res.signedIdentifiers.push({ - accessPolicy, - id: identifier.id - }); - } - return res; - }); - } - /** - * Sets the permissions for the specified container. The permissions indicate - * whether blobs in a container may be accessed publicly. - * - * When you set permissions for a container, the existing permissions are replaced. - * If no access or containerAcl provided, the existing container ACL will be - * removed. - * - * When you establish a stored access policy on a container, it may take up to 30 seconds to take effect. - * During this interval, a shared access signature that is associated with the stored access policy will - * fail with status code 403 (Forbidden), until the access policy becomes active. - * @see https://learn.microsoft.com/rest/api/storageservices/set-container-acl - * - * @param access - The level of public access to data in the container. - * @param containerAcl - Array of elements each having a unique Id and details of the access policy. - * @param options - Options to Container Set Access Policy operation. - */ - async setAccessPolicy(access, containerAcl, options = {}) { - options.conditions = options.conditions || {}; - return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { - const acl = []; - for (const identifier of containerAcl || []) { - acl.push({ - accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", - permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" - }, - id: identifier.id - }); - } - return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ - abortSignal: options.abortSignal, - access, - containerAcl: acl, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Get a {@link BlobLeaseClient} that manages leases on the container. - * - * @param proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the container. - */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); - } - /** - * Creates a new block blob, or updates the content of an existing block blob. - * - * Updating an existing block blob overwrites any existing metadata on the blob. - * Partial updates are not supported; the content of the existing blob is - * overwritten with the new content. To perform a partial update of a block blob's, - * use {@link BlockBlobClient.stageBlock} and {@link BlockBlobClient.commitBlockList}. - * - * This is a non-parallel uploading method, please use {@link BlockBlobClient.uploadFile}, - * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better - * performance with concurrency uploading. - * - * @see https://learn.microsoft.com/rest/api/storageservices/put-blob - * - * @param blobName - Name of the block blob to create or update. - * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function - * which returns a new Readable stream whose offset is from data source beginning. - * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a - * string including non non-Base64/Hex-encoded characters. - * @param options - Options to configure the Block Blob Upload operation. - * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. - */ - async uploadBlockBlob(blobName, body, contentLength, options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { - const blockBlobClient = this.getBlockBlobClient(blobName); - const response = await blockBlobClient.upload(body, contentLength, updatedOptions); - return { - blockBlobClient, - response - }; - }); - } - /** - * Marks the specified blob or snapshot for deletion. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob - * - * @param blobName - - * @param options - Options to Blob Delete operation. - * @returns Block blob deletion response data. - */ - async deleteBlob(blobName, options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { - let blobClient = this.getBlobClient(blobName); - if (options.versionId) { - blobClient = blobClient.withVersion(options.versionId); - } - return blobClient.delete(updatedOptions); - }); - } - /** - * listBlobFlatSegment returns a single segment of blobs starting from the - * specified Marker. Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call listBlobsFlatSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs - * - * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to Container List Blob Flat Segment operation. - */ - async listBlobFlatSegment(marker, options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.listBlobFlatSegment({ - marker, - ...options, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = { - ...response, - _response: { - ...response._response, - parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListBlobFlat)(response._response.parsedBody) - }, - // _response is made non-enumerable - segment: { - ...response.segment, - blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = { - ...blobItemInternal, - name: (0, utils_common_js_1.BlobNameToString)(blobItemInternal.name), - tags: (0, utils_common_js_1.toTags)(blobItemInternal.blobTags), - objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(blobItemInternal.objectReplicationMetadata) - }; - return blobItem; - }) - } - }; - return wrappedResponse; - }); - } - /** - * listBlobHierarchySegment returns a single segment of blobs starting from - * the specified Marker. Use an empty Marker to start enumeration from the - * beginning. After getting a segment, process it, and then call listBlobsHierarchicalSegment - * again (passing the the previously-returned Marker) to get the next segment. - * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to Container List Blob Hierarchy Segment operation. - */ - async listBlobHierarchySegment(delimiter, marker, options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.listBlobHierarchySegment(delimiter, { - marker, - ...options, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = { - ...response, - _response: { - ...response._response, - parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListBlobHierarchy)(response._response.parsedBody) - }, - // _response is made non-enumerable - segment: { - ...response.segment, - blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = { - ...blobItemInternal, - name: (0, utils_common_js_1.BlobNameToString)(blobItemInternal.name), - tags: (0, utils_common_js_1.toTags)(blobItemInternal.blobTags), - objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(blobItemInternal.objectReplicationMetadata) - }; - return blobItem; - }), - blobPrefixes: response.segment.blobPrefixes?.map((blobPrefixInternal) => { - const blobPrefix = { - ...blobPrefixInternal, - name: (0, utils_common_js_1.BlobNameToString)(blobPrefixInternal.name) - }; - return blobPrefix; - }) - } - }; - return wrappedResponse; - }); - } - /** - * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse - * - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the ContinuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list blobs operation. - */ - async *listSegments(marker, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker || marker === void 0) { - do { - listBlobsFlatSegmentResponse = await this.listBlobFlatSegment(marker, options); - marker = listBlobsFlatSegmentResponse.continuationToken; - yield await listBlobsFlatSegmentResponse; - } while (marker); - } - } - /** - * Returns an AsyncIterableIterator of {@link BlobItem} objects - * - * @param options - Options to list blobs operation. - */ - async *listItems(options = {}) { - let marker; - for await (const listBlobsFlatSegmentResponse of this.listSegments(marker, options)) { - yield* listBlobsFlatSegmentResponse.segment.blobItems; - } - } - /** - * Returns an async iterable iterator to list all the blobs - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs in pages. - * - * ```ts snippet:ReadmeSampleListBlobs_Multiple - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * - * // Example using `for await` syntax - * let i = 1; - * const blobs = containerClient.listBlobsFlat(); - * for await (const blob of blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * - * // Example using `iter.next()` syntax - * i = 1; - * const iter = containerClient.listBlobsFlat(); - * let { value, done } = await iter.next(); - * while (!done) { - * console.log(`Blob ${i++}: ${value.name}`); - * ({ value, done } = await iter.next()); - * } - * - * // Example using `byPage()` syntax - * i = 1; - * for await (const page of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of page.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * - * // Example using paging with a marker - * i = 1; - * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * // Prints 2 blob names - * if (response.segment.blobItems) { - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * // Prints 10 blob names - * if (response.segment.blobItems) { - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * @param options - Options to list blobs. - * @returns An asyncIterableIterator that supports paging. - */ - listBlobsFlat(options = {}) { - const include = []; - if (options.includeCopy) { - include.push("copy"); - } - if (options.includeDeleted) { - include.push("deleted"); - } - if (options.includeMetadata) { - include.push("metadata"); - } - if (options.includeSnapshots) { - include.push("snapshots"); - } - if (options.includeVersions) { - include.push("versions"); - } - if (options.includeUncommitedBlobs) { - include.push("uncommittedblobs"); - } - if (options.includeTags) { - include.push("tags"); - } - if (options.includeDeletedWithVersions) { - include.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; - } - const updatedOptions = { - ...options, - ...include.length > 0 ? { include } : {} - }; - const iter = this.listItems(updatedOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, { - maxPageSize: settings.maxPageSize, - ...updatedOptions - }); - } - }; - } - /** - * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the ContinuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list blobs operation. - */ - async *listHierarchySegments(delimiter, marker, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker || marker === void 0) { - do { - listBlobsHierarchySegmentResponse = await this.listBlobHierarchySegment(delimiter, marker, options); - marker = listBlobsHierarchySegmentResponse.continuationToken; - yield await listBlobsHierarchySegmentResponse; - } while (marker); - } - } - /** - * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects. - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. - */ - async *listItemsByHierarchy(delimiter, options = {}) { - let marker; - for await (const listBlobsHierarchySegmentResponse of this.listHierarchySegments(delimiter, marker, options)) { - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix of segment.blobPrefixes) { - yield { - kind: "prefix", - ...prefix - }; - } - } - for (const blob of segment.blobItems) { - yield { kind: "blob", ...blob }; - } - } - } - /** - * Returns an async iterable iterator to list all the blobs by hierarchy. - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. - * - * ```ts snippet:ReadmeSampleListBlobsByHierarchy - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * - * // Example using `for await` syntax - * let i = 1; - * const blobs = containerClient.listBlobsByHierarchy("/"); - * for await (const blob of blobs) { - * if (blob.kind === "prefix") { - * console.log(`\tBlobPrefix: ${blob.name}`); - * } else { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * - * // Example using `iter.next()` syntax - * i = 1; - * const iter = containerClient.listBlobsByHierarchy("/"); - * let { value, done } = await iter.next(); - * while (!done) { - * if (value.kind === "prefix") { - * console.log(`\tBlobPrefix: ${value.name}`); - * } else { - * console.log(`\tBlobItem: name - ${value.name}`); - * } - * ({ value, done } = await iter.next()); - * } - * - * // Example using `byPage()` syntax - * i = 1; - * for await (const page of containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 20 })) { - * const segment = page.segment; - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * for (const blob of page.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * - * // Example using paging with a marker - * i = 1; - * let iterator = containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * // Prints 2 blob names - * if (response.blobPrefixes) { - * for (const prefix of response.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * if (response.segment.blobItems) { - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = containerClient - * .listBlobsByHierarchy("/") - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * // Prints 10 blob names - * if (response.blobPrefixes) { - * for (const prefix of response.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * if (response.segment.blobItems) { - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. - */ - listBlobsByHierarchy(delimiter, options = {}) { - if (delimiter === "") { - throw new RangeError("delimiter should contain one or more characters"); - } - const include = []; - if (options.includeCopy) { - include.push("copy"); - } - if (options.includeDeleted) { - include.push("deleted"); - } - if (options.includeMetadata) { - include.push("metadata"); - } - if (options.includeSnapshots) { - include.push("snapshots"); - } - if (options.includeVersions) { - include.push("versions"); - } - if (options.includeUncommitedBlobs) { - include.push("uncommittedblobs"); - } - if (options.includeTags) { - include.push("tags"); - } - if (options.includeDeletedWithVersions) { - include.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; - } - const updatedOptions = { - ...options, - ...include.length > 0 ? { include } : {} - }; - const iter = this.listItemsByHierarchy(delimiter, updatedOptions); - return { - /** - * The next method, part of the iteration protocol - */ - async next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter, settings.continuationToken, { - maxPageSize: settings.maxPageSize, - ...updatedOptions - }); - } - }; - } - /** - * The Filter Blobs operation enables callers to list blobs in the container whose tags - * match a given search expression. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.filterBlobs({ - abortSignal: options.abortSignal, - where: tagFilterSqlExpression, - marker, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = { - ...response, - _response: response._response, - // _response is made non-enumerable - blobs: response.blobs.map((blob) => { - let tagValue = ""; - if (blob.tags?.blobTagSet.length === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return { ...blob, tags: (0, utils_common_js_1.toTags)(blob.tags), tagValue }; - }) - }; - return wrappedResponse; - }); - } - /** - * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) { - let response; - if (!!marker || marker === void 0) { - do { - response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options); - response.blobs = response.blobs || []; - marker = response.continuationToken; - yield response; - } while (marker); - } - } - /** - * Returns an AsyncIterableIterator for blobs. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to findBlobsByTagsItems. - */ - async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { - let marker; - for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) { - yield* segment.blobs; - } - } - /** - * Returns an async iterable iterator to find all blobs with specified tag - * under the specified container. - * - * .byPage() returns an async iterable iterator to list the blobs in pages. - * - * Example using `for await` syntax: - * - * ```ts snippet:ReadmeSampleFindBlobsByTags - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerName = ""; - * const containerClient = blobServiceClient.getContainerClient(containerName); - * - * // Example using `for await` syntax - * let i = 1; - * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * - * // Example using `iter.next()` syntax - * i = 1; - * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let { value, done } = await iter.next(); - * while (!done) { - * console.log(`Blob ${i++}: ${value.name}`); - * ({ value, done } = await iter.next()); - * } - * - * // Example using `byPage()` syntax - * i = 1; - * for await (const page of containerClient - * .findBlobsByTags("tagkey='tagvalue'") - * .byPage({ maxPageSize: 20 })) { - * for (const blob of page.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * - * // Example using paging with a marker - * i = 1; - * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * // Prints 2 blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = containerClient - * .findBlobsByTags("tagkey='tagvalue'") - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * // Prints 10 blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to find blobs by tags. - */ - findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = { - ...options - }; - const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { - maxPageSize: settings.maxPageSize, - ...listSegmentOptions - }); - } - }; - } - /** - * The Get Account Information operation returns the sku name and account kind - * for the specified account. - * The Get Account Information operation is available on service versions beginning - * with version 2018-03-28. - * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information - * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. - */ - async getAccountInfo(options = {}) { - return tracing_js_1.tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return (0, utils_common_js_1.assertResponse)(await this.containerContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - getContainerNameFromUrl() { - let containerName; - try { - const parsedUrl = new URL(this.url); - if (parsedUrl.hostname.split(".")[1] === "blob") { - containerName = parsedUrl.pathname.split("/")[1]; - } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { - containerName = parsedUrl.pathname.split("/")[2]; - } else { - containerName = parsedUrl.pathname.split("/")[1]; - } - containerName = decodeURIComponent(containerName); - if (!containerName) { - throw new Error("Provided containerName is invalid."); - } - return containerName; - } catch (error3) { - throw new Error("Unable to extract containerName with provided information."); - } - } - /** - * Only available for ContainerClient constructed with a shared key credential. - * - * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateSasUrl(options) { - return new Promise((resolve14) => { - if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ - containerName: this._containerName, - ...options - }, this.credential).toString(); - resolve14((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); - }); - } - /** - * Only available for ContainerClient constructed with a shared key credential. - * - * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI - * based on the client properties and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - generateSasStringToSign(options) { - if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ - containerName: this._containerName, - ...options - }, this.credential).stringToSign; - } - /** - * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the input user delegation key. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateUserDelegationSasUrl(options, userDelegationKey) { - return new Promise((resolve14) => { - const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ - containerName: this._containerName, - ...options - }, userDelegationKey, this.accountName).toString(); - resolve14((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); - }); - } - /** - * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI - * based on the client properties and parameters passed in. The SAS is signed by the input user delegation key. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateUserDelegationSasStringToSign(options, userDelegationKey) { - return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ - containerName: this._containerName, - ...options - }, userDelegationKey, this.accountName).stringToSign; - } - /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this container. - */ - getBlobBatchClient() { - return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); - } - }; - exports2.ContainerClient = ContainerClient; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASPermissions.js -var require_AccountSASPermissions = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASPermissions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AccountSASPermissions = void 0; - var AccountSASPermissions = class _AccountSASPermissions { - /** - * Parse initializes the AccountSASPermissions fields from a string. - * - * @param permissions - - */ - static parse(permissions) { - const accountSASPermissions = new _AccountSASPermissions(); - for (const c of permissions) { - switch (c) { - case "r": - accountSASPermissions.read = true; - break; - case "w": - accountSASPermissions.write = true; - break; - case "d": - accountSASPermissions.delete = true; - break; - case "x": - accountSASPermissions.deleteVersion = true; - break; - case "l": - accountSASPermissions.list = true; - break; - case "a": - accountSASPermissions.add = true; - break; - case "c": - accountSASPermissions.create = true; - break; - case "u": - accountSASPermissions.update = true; - break; - case "p": - accountSASPermissions.process = true; - break; - case "t": - accountSASPermissions.tag = true; - break; - case "f": - accountSASPermissions.filter = true; - break; - case "i": - accountSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - accountSASPermissions.permanentDelete = true; - break; - default: - throw new RangeError(`Invalid permission character: ${c}`); - } - } - return accountSASPermissions; - } - /** - * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. - * - * @param permissionLike - - */ - static from(permissionLike) { - const accountSASPermissions = new _AccountSASPermissions(); - if (permissionLike.read) { - accountSASPermissions.read = true; - } - if (permissionLike.write) { - accountSASPermissions.write = true; - } - if (permissionLike.delete) { - accountSASPermissions.delete = true; - } - if (permissionLike.deleteVersion) { - accountSASPermissions.deleteVersion = true; - } - if (permissionLike.filter) { - accountSASPermissions.filter = true; - } - if (permissionLike.tag) { - accountSASPermissions.tag = true; - } - if (permissionLike.list) { - accountSASPermissions.list = true; - } - if (permissionLike.add) { - accountSASPermissions.add = true; - } - if (permissionLike.create) { - accountSASPermissions.create = true; - } - if (permissionLike.update) { - accountSASPermissions.update = true; - } - if (permissionLike.process) { - accountSASPermissions.process = true; - } - if (permissionLike.setImmutabilityPolicy) { - accountSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - accountSASPermissions.permanentDelete = true; - } - return accountSASPermissions; - } - /** - * Permission to read resources and list queues and tables granted. - */ - read = false; - /** - * Permission to write resources granted. - */ - write = false; - /** - * Permission to delete blobs and files granted. - */ - delete = false; - /** - * Permission to delete versions granted. - */ - deleteVersion = false; - /** - * Permission to list blob containers, blobs, shares, directories, and files granted. - */ - list = false; - /** - * Permission to add messages, table entities, and append to blobs granted. - */ - add = false; - /** - * Permission to create blobs and files granted. - */ - create = false; - /** - * Permissions to update messages and table entities granted. - */ - update = false; - /** - * Permission to get and delete messages granted. - */ - process = false; - /** - * Specfies Tag access granted. - */ - tag = false; - /** - * Permission to filter blobs. - */ - filter = false; - /** - * Permission to set immutability policy. - */ - setImmutabilityPolicy = false; - /** - * Specifies that Permanent Delete is permitted. - */ - permanentDelete = false; - /** - * Produces the SAS permissions string for an Azure Storage account. - * Call this method to set AccountSASSignatureValues Permissions field. - * - * Using this method will guarantee the resource types are in - * an order accepted by the service. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas - * - */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.filter) { - permissions.push("f"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.list) { - permissions.push("l"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.update) { - permissions.push("u"); - } - if (this.process) { - permissions.push("p"); - } - if (this.setImmutabilityPolicy) { - permissions.push("i"); - } - if (this.permanentDelete) { - permissions.push("y"); - } - return permissions.join(""); - } - }; - exports2.AccountSASPermissions = AccountSASPermissions; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASResourceTypes.js -var require_AccountSASResourceTypes = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASResourceTypes.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AccountSASResourceTypes = void 0; - var AccountSASResourceTypes = class _AccountSASResourceTypes { - /** - * Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an - * Error if it encounters a character that does not correspond to a valid resource type. - * - * @param resourceTypes - - */ - static parse(resourceTypes) { - const accountSASResourceTypes = new _AccountSASResourceTypes(); - for (const c of resourceTypes) { - switch (c) { - case "s": - accountSASResourceTypes.service = true; - break; - case "c": - accountSASResourceTypes.container = true; - break; - case "o": - accountSASResourceTypes.object = true; - break; - default: - throw new RangeError(`Invalid resource type: ${c}`); - } - } - return accountSASResourceTypes; - } - /** - * Permission to access service level APIs granted. - */ - service = false; - /** - * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted. - */ - container = false; - /** - * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted. - */ - object = false; - /** - * Converts the given resource types to a string. - * - * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas - * - */ - toString() { - const resourceTypes = []; - if (this.service) { - resourceTypes.push("s"); - } - if (this.container) { - resourceTypes.push("c"); - } - if (this.object) { - resourceTypes.push("o"); - } - return resourceTypes.join(""); - } - }; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASServices.js -var require_AccountSASServices = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASServices.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AccountSASServices = void 0; - var AccountSASServices = class _AccountSASServices { - /** - * Creates an {@link AccountSASServices} from the specified services string. This method will throw an - * Error if it encounters a character that does not correspond to a valid service. - * - * @param services - - */ - static parse(services) { - const accountSASServices = new _AccountSASServices(); - for (const c of services) { - switch (c) { - case "b": - accountSASServices.blob = true; - break; - case "f": - accountSASServices.file = true; - break; - case "q": - accountSASServices.queue = true; - break; - case "t": - accountSASServices.table = true; - break; - default: - throw new RangeError(`Invalid service character: ${c}`); - } - } - return accountSASServices; - } - /** - * Permission to access blob resources granted. - */ - blob = false; - /** - * Permission to access file resources granted. - */ - file = false; - /** - * Permission to access queue resources granted. - */ - queue = false; - /** - * Permission to access table resources granted. - */ - table = false; - /** - * Converts the given services to a string. - * - */ - toString() { - const services = []; - if (this.blob) { - services.push("b"); - } - if (this.table) { - services.push("t"); - } - if (this.queue) { - services.push("q"); - } - if (this.file) { - services.push("f"); - } - return services.join(""); - } - }; - exports2.AccountSASServices = AccountSASServices; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASSignatureValues.js -var require_AccountSASSignatureValues = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASSignatureValues.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateAccountSASQueryParametersInternal = generateAccountSASQueryParametersInternal; - var AccountSASPermissions_js_1 = require_AccountSASPermissions(); - var AccountSASResourceTypes_js_1 = require_AccountSASResourceTypes(); - var AccountSASServices_js_1 = require_AccountSASServices(); - var SasIPRange_js_1 = require_SasIPRange(); - var SASQueryParameters_js_1 = require_SASQueryParameters(); - var constants_js_1 = require_constants10(); - var utils_common_js_1 = require_utils_common(); - function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { - return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential).sasQueryParameters; - } - function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) { - const version = accountSASSignatureValues.version ? accountSASSignatureValues.version : constants_js_1.SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); - } - if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); - } - const parsedPermissions = AccountSASPermissions_js_1.AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices_js_1.AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes_js_1.AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); - let stringToSign; - if (version >= "2020-12-06") { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(accountSASSignatureValues.startsOn, false) : "", - (0, utils_common_js_1.truncatedISO8061Date)(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version, - accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", - "" - // Account SAS requires an additional newline character - ].join("\n"); - } else { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(accountSASSignatureValues.startsOn, false) : "", - (0, utils_common_js_1.truncatedISO8061Date)(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version, - "" - // Account SAS requires an additional newline character - ].join("\n"); - } - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, accountSASSignatureValues.encryptionScope), - stringToSign - }; - } - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BlobServiceClient.js -var require_BlobServiceClient = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BlobServiceClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BlobServiceClient = void 0; - var core_auth_1 = require_commonjs7(); - var core_rest_pipeline_1 = require_commonjs6(); - var core_util_1 = require_commonjs4(); - var Pipeline_js_1 = require_Pipeline(); - var ContainerClient_js_1 = require_ContainerClient(); - var utils_common_js_1 = require_utils_common(); - var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); - var AnonymousCredential_js_1 = require_AnonymousCredential(); - var utils_common_js_2 = require_utils_common(); - var tracing_js_1 = require_tracing(); - var BlobBatchClient_js_1 = require_BlobBatchClient(); - var StorageClient_js_1 = require_StorageClient(); - var AccountSASPermissions_js_1 = require_AccountSASPermissions(); - var AccountSASSignatureValues_js_1 = require_AccountSASSignatureValues(); - var AccountSASServices_js_1 = require_AccountSASServices(); - var BlobServiceClient = class _BlobServiceClient extends StorageClient_js_1.StorageClient { - /** - * serviceContext provided by protocol layer. - */ - serviceContext; - /** - * - * Creates an instance of BlobServiceClient from connection string. - * - * @param connectionString - Account connection string or a SAS connection string of an Azure storage account. - * [ Note - Account connection string can only be used in NODE.JS runtime. ] - * Account connection string example - - * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` - * SAS connection string example - - * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - * @param options - Optional. Options to configure the HTTP pipeline. - */ - static fromConnectionString(connectionString, options) { - options = options || {}; - const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); - if (extractedCreds.kind === "AccountConnString") { - if (core_util_1.isNodeLike) { - const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - if (!options.proxyOptions) { - options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); - } - const pipeline2 = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); - return new _BlobServiceClient(extractedCreds.url, pipeline2); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - const pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline2); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } - constructor(url2, credentialOrPipeline, options) { - let pipeline2; - if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { - pipeline2 = credentialOrPipeline; - } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { - pipeline2 = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); - } else { - pipeline2 = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); - } - super(url2, pipeline2); - this.serviceContext = this.storageClientContext.service; - } - /** - * Creates a {@link ContainerClient} object - * - * @param containerName - A container name - * @returns A new ContainerClient object for the given container name. - * - * Example usage: - * - * ```ts snippet:BlobServiceClientGetContainerClient - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * const containerClient = blobServiceClient.getContainerClient(""); - * ``` - */ - getContainerClient(containerName) { - return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); - } - /** - * Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container - * - * @param containerName - Name of the container to create. - * @param options - Options to configure Container Create operation. - * @returns Container creation response and the corresponding container client. - */ - async createContainer(containerName, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(containerName); - const containerCreateResponse = await containerClient.create(updatedOptions); - return { - containerClient, - containerCreateResponse - }; - }); - } - /** - * Deletes a Blob container. - * - * @param containerName - Name of the container to delete. - * @param options - Options to configure Container Delete operation. - * @returns Container deletion response. - */ - async deleteContainer(containerName, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(containerName); - return containerClient.delete(updatedOptions); - }); - } - /** - * Restore a previously deleted Blob container. - * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container. - * - * @param deletedContainerName - Name of the previously deleted container. - * @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container. - * @param options - Options to configure Container Restore operation. - * @returns Container deletion response. - */ - async undeleteContainer(deletedContainerName, deletedContainerVersion, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ - deletedContainerName, - deletedContainerVersion, - tracingOptions: updatedOptions.tracingOptions - })); - return { containerClient, containerUndeleteResponse }; - }); - } - /** - * Gets the properties of a storage account’s Blob service, including properties - * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties - * - * @param options - Options to the Service Get Properties operation. - * @returns Response data for the Service Get Properties operation. - */ - async getProperties(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getProperties({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Sets properties for a storage account’s Blob service endpoint, including properties - * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. - * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-service-properties - * - * @param properties - - * @param options - Options to the Service Set Properties operation. - * @returns Response data for the Service Set Properties operation. - */ - async setProperties(properties, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return (0, utils_common_js_2.assertResponse)(await this.serviceContext.setProperties(properties, { - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Retrieves statistics related to replication for the Blob service. It is only - * available on the secondary location endpoint when read-access geo-redundant - * replication is enabled for the storage account. - * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-stats - * - * @param options - Options to the Service Get Statistics operation. - * @returns Response data for the Service Get Statistics operation. - */ - async getStatistics(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getStatistics({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * The Get Account Information operation returns the sku name and account kind - * for the specified account. - * The Get Account Information operation is available on service versions beginning - * with version 2018-03-28. - * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information - * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. - */ - async getAccountInfo(options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Returns a list of the containers under the specified account. - * @see https://learn.microsoft.com/rest/api/storageservices/list-containers2 - * - * @param marker - A string value that identifies the portion of - * the list of containers to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all containers remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to the Service List Container Segment operation. - * @returns Response data for the Service List Container Segment operation. - */ - async listContainersSegment(marker, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return (0, utils_common_js_2.assertResponse)(await this.serviceContext.listContainersSegment({ - abortSignal: options.abortSignal, - marker, - ...options, - include: typeof options.include === "string" ? [options.include] : options.include, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags - * match a given search expression. Filter blobs searches across all containers within a - * storage account but can be scoped within the expression to a single container. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = (0, utils_common_js_2.assertResponse)(await this.serviceContext.filterBlobs({ - abortSignal: options.abortSignal, - where: tagFilterSqlExpression, - marker, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = { - ...response, - _response: response._response, - // _response is made non-enumerable - blobs: response.blobs.map((blob) => { - let tagValue = ""; - if (blob.tags?.blobTagSet.length === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return { ...blob, tags: (0, utils_common_js_1.toTags)(blob.tags), tagValue }; - }) - }; - return wrappedResponse; - }); - } - /** - * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) { - let response; - if (!!marker || marker === void 0) { - do { - response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options); - response.blobs = response.blobs || []; - marker = response.continuationToken; - yield response; - } while (marker); - } - } - /** - * Returns an AsyncIterableIterator for blobs. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to findBlobsByTagsItems. - */ - async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { - let marker; - for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) { - yield* segment.blobs; - } - } - /** - * Returns an async iterable iterator to find all blobs with specified tag - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs in pages. - * - * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties - * - * ```ts snippet:BlobServiceClientFindBlobsByTags - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * // Use for await to iterate the blobs - * let i = 1; - * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * - * // Use iter.next() to iterate the blobs - * i = 1; - * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let { value, done } = await iter.next(); - * while (!done) { - * console.log(`Blob ${i++}: ${value.name}`); - * ({ value, done } = await iter.next()); - * } - * - * // Use byPage() to iterate the blobs - * i = 1; - * for await (const page of blobServiceClient - * .findBlobsByTags("tagkey='tagvalue'") - * .byPage({ maxPageSize: 20 })) { - * for (const blob of page.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * - * // Use paging with a marker - * i = 1; - * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * // Prints 2 blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = blobServiceClient - * .findBlobsByTags("tagkey='tagvalue'") - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to find blobs by tags. - */ - findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = { - ...options - }; - const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { - maxPageSize: settings.maxPageSize, - ...listSegmentOptions - }); - } - }; - } - /** - * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses - * - * @param marker - A string value that identifies the portion of - * the list of containers to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all containers remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list containers operation. - */ - async *listSegments(marker, options = {}) { - let listContainersSegmentResponse; - if (!!marker || marker === void 0) { - do { - listContainersSegmentResponse = await this.listContainersSegment(marker, options); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker = listContainersSegmentResponse.continuationToken; - yield await listContainersSegmentResponse; - } while (marker); - } - } - /** - * Returns an AsyncIterableIterator for Container Items - * - * @param options - Options to list containers operation. - */ - async *listItems(options = {}) { - let marker; - for await (const segment of this.listSegments(marker, options)) { - yield* segment.containerItems; - } - } - /** - * Returns an async iterable iterator to list all the containers - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the containers in pages. - * - * ```ts snippet:BlobServiceClientListContainers - * import { BlobServiceClient } from "@azure/storage-blob"; - * import { DefaultAzureCredential } from "@azure/identity"; - * - * const account = ""; - * const blobServiceClient = new BlobServiceClient( - * `https://${account}.blob.core.windows.net`, - * new DefaultAzureCredential(), - * ); - * - * // Use for await to iterate the containers - * let i = 1; - * for await (const container of blobServiceClient.listContainers()) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * - * // Use iter.next() to iterate the containers - * i = 1; - * const iter = blobServiceClient.listContainers(); - * let { value, done } = await iter.next(); - * while (!done) { - * console.log(`Container ${i++}: ${value.name}`); - * ({ value, done } = await iter.next()); - * } - * - * // Use byPage() to iterate the containers - * i = 1; - * for await (const page of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * for (const container of page.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * - * // Use paging with a marker - * i = 1; - * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 container names - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = blobServiceClient - * .listContainers() - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints 10 container names - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * ``` - * - * @param options - Options to list containers. - * @returns An asyncIterableIterator that supports paging. - */ - listContainers(options = {}) { - if (options.prefix === "") { - options.prefix = void 0; - } - const include = []; - if (options.includeDeleted) { - include.push("deleted"); - } - if (options.includeMetadata) { - include.push("metadata"); - } - if (options.includeSystem) { - include.push("system"); - } - const listSegmentOptions = { - ...options, - ...include.length > 0 ? { include } : {} - }; - const iter = this.listItems(listSegmentOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, { - maxPageSize: settings.maxPageSize, - ...listSegmentOptions - }); - } - }; - } - /** - * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential). - * - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * - * @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key - * - * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time - * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time - */ - async getUserDelegationKey(startsOn, expiresOn, options = {}) { - return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = (0, utils_common_js_2.assertResponse)(await this.serviceContext.getUserDelegationKey({ - startsOn: (0, utils_common_js_2.truncatedISO8061Date)(startsOn, false), - expiresOn: (0, utils_common_js_2.truncatedISO8061Date)(expiresOn, false) - }, { - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - const userDelegationKey = { - signedObjectId: response.signedObjectId, - signedTenantId: response.signedTenantId, - signedStartsOn: new Date(response.signedStartsOn), - signedExpiresOn: new Date(response.signedExpiresOn), - signedService: response.signedService, - signedVersion: response.signedVersion, - value: response.value - }; - const res = { - _response: response._response, - requestId: response.requestId, - clientRequestId: response.clientRequestId, - version: response.version, - date: response.date, - errorCode: response.errorCode, - ...userDelegationKey - }; - return res; - }); - } - /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this service. - */ - getBlobBatchClient() { - return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); - } - /** - * Only available for BlobServiceClient constructed with a shared key credential. - * - * Generates a Blob account Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas - * - * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided. - * @param permissions - Specifies the list of permissions to be associated with the SAS. - * @param resourceTypes - Specifies the resource types associated with the shared access signature. - * @param options - Optional parameters. - * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateAccountSasUrl(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); - } - if (expiresOn === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn = new Date(now.getTime() + 3600 * 1e3); - } - const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ - permissions, - expiresOn, - resourceTypes, - services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), - ...options - }, this.credential).toString(); - return (0, utils_common_js_1.appendToURLQuery)(this.url, sas); - } - /** - * Only available for BlobServiceClient constructed with a shared key credential. - * - * Generates string to sign for a Blob account Shared Access Signature (SAS) URI based on - * the client properties and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas - * - * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided. - * @param permissions - Specifies the list of permissions to be associated with the SAS. - * @param resourceTypes - Specifies the resource types associated with the shared access signature. - * @param options - Optional parameters. - * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateSasStringToSign(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); - } - if (expiresOn === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn = new Date(now.getTime() + 3600 * 1e3); - } - return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ - permissions, - expiresOn, - resourceTypes, - services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), - ...options - }, this.credential).stringToSign; - } - }; - exports2.BlobServiceClient = BlobServiceClient; - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/BatchResponse.js -var require_BatchResponse = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/BatchResponse.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/generatedModels.js -var require_generatedModels = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/generatedModels.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.KnownEncryptionAlgorithmType = void 0; - var KnownEncryptionAlgorithmType; - (function(KnownEncryptionAlgorithmType2) { - KnownEncryptionAlgorithmType2["AES256"] = "AES256"; - })(KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = KnownEncryptionAlgorithmType = {})); - } -}); - -// node_modules/@azure/storage-blob/dist/commonjs/index.js -var require_commonjs15 = __commonJS({ - "node_modules/@azure/storage-blob/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = exports2.RestError = exports2.BaseRequestPolicy = exports2.StorageOAuthScopes = exports2.newPipeline = exports2.isPipelineLike = exports2.Pipeline = exports2.getBlobServiceAccountAudience = exports2.StorageBlobAudience = exports2.PremiumPageBlobTier = exports2.BlockBlobTier = exports2.generateBlobSASQueryParameters = exports2.generateAccountSASQueryParameters = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var core_rest_pipeline_1 = require_commonjs6(); - Object.defineProperty(exports2, "RestError", { enumerable: true, get: function() { - return core_rest_pipeline_1.RestError; - } }); - tslib_1.__exportStar(require_BlobServiceClient(), exports2); - tslib_1.__exportStar(require_Clients(), exports2); - tslib_1.__exportStar(require_ContainerClient(), exports2); - tslib_1.__exportStar(require_BlobLeaseClient(), exports2); - tslib_1.__exportStar(require_AccountSASPermissions(), exports2); - tslib_1.__exportStar(require_AccountSASResourceTypes(), exports2); - tslib_1.__exportStar(require_AccountSASServices(), exports2); - var AccountSASSignatureValues_js_1 = require_AccountSASSignatureValues(); - Object.defineProperty(exports2, "generateAccountSASQueryParameters", { enumerable: true, get: function() { - return AccountSASSignatureValues_js_1.generateAccountSASQueryParameters; - } }); - tslib_1.__exportStar(require_BlobBatch(), exports2); - tslib_1.__exportStar(require_BlobBatchClient(), exports2); - tslib_1.__exportStar(require_BatchResponse(), exports2); - tslib_1.__exportStar(require_BlobSASPermissions(), exports2); - var BlobSASSignatureValues_js_1 = require_BlobSASSignatureValues(); - Object.defineProperty(exports2, "generateBlobSASQueryParameters", { enumerable: true, get: function() { - return BlobSASSignatureValues_js_1.generateBlobSASQueryParameters; - } }); - tslib_1.__exportStar(require_StorageBrowserPolicyFactory2(), exports2); - tslib_1.__exportStar(require_ContainerSASPermissions(), exports2); - tslib_1.__exportStar(require_AnonymousCredential(), exports2); - tslib_1.__exportStar(require_Credential(), exports2); - tslib_1.__exportStar(require_StorageSharedKeyCredential(), exports2); - var models_js_1 = require_models2(); - Object.defineProperty(exports2, "BlockBlobTier", { enumerable: true, get: function() { - return models_js_1.BlockBlobTier; - } }); - Object.defineProperty(exports2, "PremiumPageBlobTier", { enumerable: true, get: function() { - return models_js_1.PremiumPageBlobTier; - } }); - Object.defineProperty(exports2, "StorageBlobAudience", { enumerable: true, get: function() { - return models_js_1.StorageBlobAudience; - } }); - Object.defineProperty(exports2, "getBlobServiceAccountAudience", { enumerable: true, get: function() { - return models_js_1.getBlobServiceAccountAudience; - } }); - var Pipeline_js_1 = require_Pipeline(); - Object.defineProperty(exports2, "Pipeline", { enumerable: true, get: function() { - return Pipeline_js_1.Pipeline; - } }); - Object.defineProperty(exports2, "isPipelineLike", { enumerable: true, get: function() { - return Pipeline_js_1.isPipelineLike; - } }); - Object.defineProperty(exports2, "newPipeline", { enumerable: true, get: function() { - return Pipeline_js_1.newPipeline; - } }); - Object.defineProperty(exports2, "StorageOAuthScopes", { enumerable: true, get: function() { - return Pipeline_js_1.StorageOAuthScopes; - } }); - tslib_1.__exportStar(require_StorageRetryPolicyFactory(), exports2); - var RequestPolicy_js_1 = require_RequestPolicy(); - Object.defineProperty(exports2, "BaseRequestPolicy", { enumerable: true, get: function() { - return RequestPolicy_js_1.BaseRequestPolicy; - } }); - tslib_1.__exportStar(require_AnonymousCredentialPolicy(), exports2); - tslib_1.__exportStar(require_CredentialPolicy(), exports2); - tslib_1.__exportStar(require_StorageRetryPolicyFactory(), exports2); - tslib_1.__exportStar(require_StorageSharedKeyCredentialPolicy(), exports2); - tslib_1.__exportStar(require_SASQueryParameters(), exports2); - tslib_1.__exportStar(require_generatedModels(), exports2); - var log_js_1 = require_log5(); - Object.defineProperty(exports2, "logger", { enumerable: true, get: function() { - return log_js_1.logger; - } }); - } -}); - -// node_modules/@actions/cache/lib/internal/shared/errors.js -var require_errors2 = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/errors.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RateLimitError = exports2.UsageError = exports2.NetworkError = exports2.GHESNotSupportedError = exports2.CacheNotFoundError = exports2.InvalidResponseError = exports2.FilesNotFoundError = void 0; - var FilesNotFoundError = class extends Error { - constructor(files = []) { - let message = "No files were found to upload"; - if (files.length > 0) { - message += `: ${files.join(", ")}`; - } - super(message); - this.files = files; - this.name = "FilesNotFoundError"; - } - }; - exports2.FilesNotFoundError = FilesNotFoundError; - var InvalidResponseError = class extends Error { - constructor(message) { - super(message); - this.name = "InvalidResponseError"; - } - }; - exports2.InvalidResponseError = InvalidResponseError; - var CacheNotFoundError = class extends Error { - constructor(message = "Cache not found") { - super(message); - this.name = "CacheNotFoundError"; - } - }; - exports2.CacheNotFoundError = CacheNotFoundError; - var GHESNotSupportedError = class extends Error { - constructor(message = "@actions/cache v4.1.4+, actions/cache/save@v4+ and actions/cache/restore@v4+ are not currently supported on GHES.") { - super(message); - this.name = "GHESNotSupportedError"; - } - }; - exports2.GHESNotSupportedError = GHESNotSupportedError; - var NetworkError = class extends Error { - constructor(code) { - const message = `Unable to make request: ${code} -If you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`; - super(message); - this.code = code; - this.name = "NetworkError"; - } - }; - exports2.NetworkError = NetworkError; - NetworkError.isNetworkErrorCode = (code) => { - if (!code) - return false; - return [ - "ECONNRESET", - "ENOTFOUND", - "ETIMEDOUT", - "ECONNREFUSED", - "EHOSTUNREACH" - ].includes(code); - }; - var UsageError = class extends Error { - constructor() { - const message = `Cache storage quota has been hit. Unable to upload any new cache entries. Usage is recalculated every 6-12 hours. -More info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`; - super(message); - this.name = "UsageError"; - } - }; - exports2.UsageError = UsageError; - UsageError.isUsageErrorMessage = (msg) => { - if (!msg) - return false; - return msg.includes("insufficient usage"); - }; - var RateLimitError = class extends Error { - constructor(message) { - super(message); - this.name = "RateLimitError"; - } - }; - exports2.RateLimitError = RateLimitError; - } -}); - -// node_modules/@actions/cache/lib/internal/uploadUtils.js -var require_uploadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UploadProgress = void 0; - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - var core31 = __importStar2(require_core()); - var storage_blob_1 = require_commonjs15(); - var errors_1 = require_errors2(); - var UploadProgress = class { - constructor(contentLength) { - this.contentLength = contentLength; - this.sentBytes = 0; - this.displayedComplete = false; - this.startTime = Date.now(); - } - /** - * Sets the number of bytes sent - * - * @param sentBytes the number of bytes sent - */ - setSentBytes(sentBytes) { - this.sentBytes = sentBytes; - } - /** - * Returns the total number of bytes transferred. - */ - getTransferredBytes() { - return this.sentBytes; - } - /** - * Returns true if the upload is complete. - */ - isDone() { - return this.getTransferredBytes() === this.contentLength; - } - /** - * Prints the current upload stats. Once the upload completes, this will print one - * last line and then stop. - */ - display() { - if (this.displayedComplete) { - return; - } - const transferredBytes = this.sentBytes; - const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); - const elapsedTime = Date.now() - this.startTime; - const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core31.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); - if (this.isDone()) { - this.displayedComplete = true; - } - } - /** - * Returns a function used to handle TransferProgressEvents. - */ - onProgress() { - return (progress) => { - this.setSentBytes(progress.loadedBytes); - }; - } - /** - * Starts the timer that displays the stats. - * - * @param delayInMs the delay between each write - */ - startDisplayTimer(delayInMs = 1e3) { - const displayCallback = () => { - this.display(); - if (!this.isDone()) { - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - }; - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - /** - * Stops the timer that displays the stats. As this typically indicates the upload - * is complete, this will display one last line, unless the last line has already - * been written. - */ - stopDisplayTimer() { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - this.timeoutHandle = void 0; - } - this.display(); - } - }; - exports2.UploadProgress = UploadProgress; - function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const blobClient = new storage_blob_1.BlobClient(signedUploadURL); - const blockBlobClient = blobClient.getBlockBlobClient(); - const uploadProgress = new UploadProgress((_a2 = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a2 !== void 0 ? _a2 : 0); - const uploadOptions = { - blockSize: options === null || options === void 0 ? void 0 : options.uploadChunkSize, - concurrency: options === null || options === void 0 ? void 0 : options.uploadConcurrency, - // maximum number of parallel transfer workers - maxSingleShotSize: 128 * 1024 * 1024, - // 128 MiB initial transfer size - onProgress: uploadProgress.onProgress() - }; - try { - uploadProgress.startDisplayTimer(); - core31.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); - const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); - if (response._response.status >= 400) { - throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); - } - return response; - } catch (error3) { - core31.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); - throw error3; - } finally { - uploadProgress.stopDisplayTimer(); - } - }); - } - } -}); - -// node_modules/@actions/cache/lib/internal/requestUtils.js -var require_requestUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isSuccessStatusCode = isSuccessStatusCode; - exports2.isServerErrorStatusCode = isServerErrorStatusCode; - exports2.isRetryableStatusCode = isRetryableStatusCode; - exports2.retry = retry2; - exports2.retryTypedResponse = retryTypedResponse; - exports2.retryHttpClientResponse = retryHttpClientResponse; - var core31 = __importStar2(require_core()); - var http_client_1 = require_lib(); - var constants_1 = require_constants7(); - function isSuccessStatusCode(statusCode) { - if (!statusCode) { - return false; - } - return statusCode >= 200 && statusCode < 300; - } - function isServerErrorStatusCode(statusCode) { - if (!statusCode) { - return true; - } - return statusCode >= 500; - } - function isRetryableStatusCode(statusCode) { - if (!statusCode) { - return false; - } - const retryableStatusCodes = [ - http_client_1.HttpCodes.BadGateway, - http_client_1.HttpCodes.ServiceUnavailable, - http_client_1.HttpCodes.GatewayTimeout - ]; - return retryableStatusCodes.includes(statusCode); - } - function sleep(milliseconds) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => setTimeout(resolve14, milliseconds)); - }); - } - function retry2(name_1, method_1, getStatusCode_1) { - return __awaiter2(this, arguments, void 0, function* (name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - let errorMessage = ""; - let attempt = 1; - while (attempt <= maxAttempts) { - let response = void 0; - let statusCode = void 0; - let isRetryable = false; - try { - response = yield method(); - } catch (error3) { - if (onError) { - response = onError(error3); - } - isRetryable = true; - errorMessage = error3.message; - } - if (response) { - statusCode = getStatusCode(response); - if (!isServerErrorStatusCode(statusCode)) { - return response; - } - } - if (statusCode) { - isRetryable = isRetryableStatusCode(statusCode); - errorMessage = `Cache service responded with ${statusCode}`; - } - core31.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); - if (!isRetryable) { - core31.debug(`${name} - Error is not retryable`); - break; - } - yield sleep(delay2); - attempt++; - } - throw Error(`${name} failed: ${errorMessage}`); - }); - } - function retryTypedResponse(name_1, method_1) { - return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return yield retry2( - name, - method, - (response) => response.statusCode, - maxAttempts, - delay2, - // If the error object contains the statusCode property, extract it and return - // an TypedResponse so it can be processed by the retry logic. - (error3) => { - if (error3 instanceof http_client_1.HttpClientError) { - return { - statusCode: error3.statusCode, - result: null, - headers: {}, - error: error3 - }; - } else { - return void 0; - } - } - ); - }); - } - function retryHttpClientResponse(name_1, method_1) { - return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return yield retry2(name, method, (response) => response.message.statusCode, maxAttempts, delay2); - }); - } - } -}); - -// node_modules/@azure/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var listenersMap = /* @__PURE__ */ new WeakMap(); - var abortedMap = /* @__PURE__ */ new WeakMap(); - var AbortSignal2 = class _AbortSignal { - constructor() { - this.onabort = null; - listenersMap.set(this, []); - abortedMap.set(this, false); - } - /** - * Status of whether aborted or not. - * - * @readonly - */ - get aborted() { - if (!abortedMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); - } - return abortedMap.get(this); - } - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - static get none() { - return new _AbortSignal(); - } - /** - * Added new "abort" event listener, only support "abort" event. - * - * @param _type - Only support "abort" event - * @param listener - The listener to be added - */ - addEventListener(_type, listener) { - if (!listenersMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); - } - const listeners = listenersMap.get(this); - listeners.push(listener); - } - /** - * Remove "abort" event listener, only support "abort" event. - * - * @param _type - Only support "abort" event - * @param listener - The listener to be removed - */ - removeEventListener(_type, listener) { - if (!listenersMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); - } - const listeners = listenersMap.get(this); - const index2 = listeners.indexOf(listener); - if (index2 > -1) { - listeners.splice(index2, 1); - } - } - /** - * Dispatches a synthetic event to the AbortSignal. - */ - dispatchEvent(_event) { - throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); - } - }; - function abortSignal(signal) { - if (signal.aborted) { - return; - } - if (signal.onabort) { - signal.onabort.call(signal); - } - const listeners = listenersMap.get(signal); - if (listeners) { - listeners.slice().forEach((listener) => { - listener.call(signal, { type: "abort" }); - }); - } - abortedMap.set(signal, true); - } - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - var AbortController2 = class { - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - constructor(parentSignals) { - this._signal = new AbortSignal2(); - if (!parentSignals) { - return; - } - if (!Array.isArray(parentSignals)) { - parentSignals = arguments; - } - for (const parentSignal of parentSignals) { - if (parentSignal.aborted) { - this.abort(); - } else { - parentSignal.addEventListener("abort", () => { - this.abort(); - }); - } - } - } - /** - * The AbortSignal associated with this controller that will signal aborted - * when the abort method is called on this controller. - * - * @readonly - */ - get signal() { - return this._signal; - } - /** - * Signal that any operations passed this controller's associated abort signal - * to cancel any remaining work and throw an `AbortError`. - */ - abort() { - abortSignal(this._signal); - } - /** - * Creates a new AbortSignal instance that will abort after the provided ms. - * @param ms - Elapsed time in milliseconds to trigger an abort. - */ - static timeout(ms) { - const signal = new AbortSignal2(); - const timer = setTimeout(abortSignal, ms, signal); - if (typeof timer.unref === "function") { - timer.unref(); - } - return signal; - } - }; - exports2.AbortController = AbortController2; - exports2.AbortError = AbortError; - exports2.AbortSignal = AbortSignal2; - } -}); - -// node_modules/@actions/cache/lib/internal/downloadUtils.js -var require_downloadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DownloadProgress = void 0; - exports2.downloadCacheHttpClient = downloadCacheHttpClient; - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var core31 = __importStar2(require_core()); - var http_client_1 = require_lib(); - var storage_blob_1 = require_commonjs15(); - var buffer = __importStar2(require("buffer")); - var fs32 = __importStar2(require("fs")); - var stream2 = __importStar2(require("stream")); - var util3 = __importStar2(require("util")); - var utils = __importStar2(require_cacheUtils()); - var constants_1 = require_constants7(); - var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); - function pipeResponseToStream(response, output) { - return __awaiter2(this, void 0, void 0, function* () { - const pipeline2 = util3.promisify(stream2.pipeline); - yield pipeline2(response.message, output); - }); - } - var DownloadProgress = class { - constructor(contentLength) { - this.contentLength = contentLength; - this.segmentIndex = 0; - this.segmentSize = 0; - this.segmentOffset = 0; - this.receivedBytes = 0; - this.displayedComplete = false; - this.startTime = Date.now(); - } - /** - * Progress to the next segment. Only call this method when the previous segment - * is complete. - * - * @param segmentSize the length of the next segment - */ - nextSegment(segmentSize) { - this.segmentOffset = this.segmentOffset + this.segmentSize; - this.segmentIndex = this.segmentIndex + 1; - this.segmentSize = segmentSize; - this.receivedBytes = 0; - core31.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); - } - /** - * Sets the number of bytes received for the current segment. - * - * @param receivedBytes the number of bytes received - */ - setReceivedBytes(receivedBytes) { - this.receivedBytes = receivedBytes; - } - /** - * Returns the total number of bytes transferred. - */ - getTransferredBytes() { - return this.segmentOffset + this.receivedBytes; - } - /** - * Returns true if the download is complete. - */ - isDone() { - return this.getTransferredBytes() === this.contentLength; - } - /** - * Prints the current download stats. Once the download completes, this will print one - * last line and then stop. - */ - display() { - if (this.displayedComplete) { - return; - } - const transferredBytes = this.segmentOffset + this.receivedBytes; - const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); - const elapsedTime = Date.now() - this.startTime; - const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core31.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); - if (this.isDone()) { - this.displayedComplete = true; - } - } - /** - * Returns a function used to handle TransferProgressEvents. - */ - onProgress() { - return (progress) => { - this.setReceivedBytes(progress.loadedBytes); - }; - } - /** - * Starts the timer that displays the stats. - * - * @param delayInMs the delay between each write - */ - startDisplayTimer(delayInMs = 1e3) { - const displayCallback = () => { - this.display(); - if (!this.isDone()) { - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - }; - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - /** - * Stops the timer that displays the stats. As this typically indicates the download - * is complete, this will display one last line, unless the last line has already - * been written. - */ - stopDisplayTimer() { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - this.timeoutHandle = void 0; - } - this.display(); - } - }; - exports2.DownloadProgress = DownloadProgress; - function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs32.createWriteStream(archivePath); - const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter2(this, void 0, void 0, function* () { - return httpClient.get(archiveLocation); - })); - downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { - downloadResponse.message.destroy(); - core31.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); - }); - yield pipeResponseToStream(downloadResponse, writeStream); - const contentLengthHeader = downloadResponse.message.headers["content-length"]; - if (contentLengthHeader) { - const expectedLength = parseInt(contentLengthHeader); - const actualLength = utils.getArchiveFileSizeInBytes(archivePath); - if (actualLength !== expectedLength) { - throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); - } - } else { - core31.debug("Unable to validate download, no Content-Length header"); - } - }); - } - function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const archiveDescriptor = yield fs32.promises.open(archivePath, "w"); - const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { - socketTimeout: options.timeoutInMs, - keepAlive: true - }); - try { - const res = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCacheMetadata", () => __awaiter2(this, void 0, void 0, function* () { - return yield httpClient.request("HEAD", archiveLocation, null, {}); - })); - const lengthHeader = res.message.headers["content-length"]; - if (lengthHeader === void 0 || lengthHeader === null) { - throw new Error("Content-Length not found on blob response"); - } - const length = parseInt(lengthHeader); - if (Number.isNaN(length)) { - throw new Error(`Could not interpret Content-Length: ${length}`); - } - const downloads = []; - const blockSize = 4 * 1024 * 1024; - for (let offset = 0; offset < length; offset += blockSize) { - const count = Math.min(blockSize, length - offset); - downloads.push({ - offset, - promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { - return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); - }) - }); - } - downloads.reverse(); - let actives = 0; - let bytesDownloaded = 0; - const progress = new DownloadProgress(length); - progress.startDisplayTimer(); - const progressFn = progress.onProgress(); - const activeDownloads = []; - let nextDownload; - const waitAndWrite = () => __awaiter2(this, void 0, void 0, function* () { - const segment = yield Promise.race(Object.values(activeDownloads)); - yield archiveDescriptor.write(segment.buffer, 0, segment.count, segment.offset); - actives--; - delete activeDownloads[segment.offset]; - bytesDownloaded += segment.count; - progressFn({ loadedBytes: bytesDownloaded }); - }); - while (nextDownload = downloads.pop()) { - activeDownloads[nextDownload.offset] = nextDownload.promiseGetter(); - actives++; - if (actives >= ((_a2 = options.downloadConcurrency) !== null && _a2 !== void 0 ? _a2 : 10)) { - yield waitAndWrite(); - } - } - while (actives > 0) { - yield waitAndWrite(); - } - } finally { - httpClient.dispose(); - yield archiveDescriptor.close(); - } - }); - } - function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter2(this, void 0, void 0, function* () { - const retries = 5; - let failures = 0; - while (true) { - try { - const timeout = 3e4; - const result = yield promiseWithTimeout(timeout, downloadSegment(httpClient, archiveLocation, offset, count)); - if (typeof result === "string") { - throw new Error("downloadSegmentRetry failed due to timeout"); - } - return result; - } catch (err) { - if (failures >= retries) { - throw err; - } - failures++; - } - } - }); - } - function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter2(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter2(this, void 0, void 0, function* () { - return yield httpClient.get(archiveLocation, { - Range: `bytes=${offset}-${offset + count - 1}` - }); - })); - if (!partRes.readBodyBuffer) { - throw new Error("Expected HttpClientResponse to implement readBodyBuffer"); - } - return { - offset, - count, - buffer: yield partRes.readBodyBuffer() - }; - }); - } - function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { - retryOptions: { - // Override the timeout used when downloading each 4 MB chunk - // The default is 2 min / MB, which is way too slow - tryTimeoutInMs: options.timeoutInMs - } - }); - const properties = yield client.getProperties(); - const contentLength = (_a2 = properties.contentLength) !== null && _a2 !== void 0 ? _a2 : -1; - if (contentLength < 0) { - core31.debug("Unable to determine content length, downloading file with http-client..."); - yield downloadCacheHttpClient(archiveLocation, archivePath); - } else { - const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); - const downloadProgress = new DownloadProgress(contentLength); - const fd = fs32.openSync(archivePath, "w"); - try { - downloadProgress.startDisplayTimer(); - const controller = new abort_controller_1.AbortController(); - const abortSignal = controller.signal; - while (!downloadProgress.isDone()) { - const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize; - const segmentSize = Math.min(maxSegmentSize, contentLength - segmentStart); - downloadProgress.nextSegment(segmentSize); - const result = yield promiseWithTimeout(options.segmentTimeoutInMs || 36e5, client.downloadToBuffer(segmentStart, segmentSize, { - abortSignal, - concurrency: options.downloadConcurrency, - onProgress: downloadProgress.onProgress() - })); - if (result === "timeout") { - controller.abort(); - throw new Error("Aborting cache download as the download time exceeded the timeout."); - } else if (Buffer.isBuffer(result)) { - fs32.writeFileSync(fd, result); - } - } - } finally { - downloadProgress.stopDisplayTimer(); - fs32.closeSync(fd); - } - } - }); - } - var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { - let timeoutHandle; - const timeoutPromise = new Promise((resolve14) => { - timeoutHandle = setTimeout(() => resolve14("timeout"), timeoutMs); - }); - return Promise.race([promise, timeoutPromise]).then((result) => { - clearTimeout(timeoutHandle); - return result; - }); - }); - } -}); - -// node_modules/@actions/cache/lib/options.js -var require_options = __commonJS({ - "node_modules/@actions/cache/lib/options.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUploadOptions = getUploadOptions; - exports2.getDownloadOptions = getDownloadOptions; - var core31 = __importStar2(require_core()); - function getUploadOptions(copy) { - const result = { - useAzureSdk: false, - uploadConcurrency: 4, - uploadChunkSize: 32 * 1024 * 1024 - }; - if (copy) { - if (typeof copy.useAzureSdk === "boolean") { - result.useAzureSdk = copy.useAzureSdk; - } - if (typeof copy.uploadConcurrency === "number") { - result.uploadConcurrency = copy.uploadConcurrency; - } - if (typeof copy.uploadChunkSize === "number") { - result.uploadChunkSize = copy.uploadChunkSize; - } - } - result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency; - result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize; - core31.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core31.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core31.debug(`Upload chunk size: ${result.uploadChunkSize}`); - return result; - } - function getDownloadOptions(copy) { - const result = { - useAzureSdk: false, - concurrentBlobDownloads: true, - downloadConcurrency: 8, - timeoutInMs: 3e4, - segmentTimeoutInMs: 6e5, - lookupOnly: false - }; - if (copy) { - if (typeof copy.useAzureSdk === "boolean") { - result.useAzureSdk = copy.useAzureSdk; - } - if (typeof copy.concurrentBlobDownloads === "boolean") { - result.concurrentBlobDownloads = copy.concurrentBlobDownloads; - } - if (typeof copy.downloadConcurrency === "number") { - result.downloadConcurrency = copy.downloadConcurrency; - } - if (typeof copy.timeoutInMs === "number") { - result.timeoutInMs = copy.timeoutInMs; - } - if (typeof copy.segmentTimeoutInMs === "number") { - result.segmentTimeoutInMs = copy.segmentTimeoutInMs; - } - if (typeof copy.lookupOnly === "boolean") { - result.lookupOnly = copy.lookupOnly; - } - } - const segmentDownloadTimeoutMins = process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]; - if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { - result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; - } - core31.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core31.debug(`Download concurrency: ${result.downloadConcurrency}`); - core31.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core31.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core31.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core31.debug(`Lookup only: ${result.lookupOnly}`); - return result; - } - } -}); - -// node_modules/@actions/cache/lib/internal/config.js -var require_config = __commonJS({ - "node_modules/@actions/cache/lib/internal/config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isGhes = isGhes; - exports2.getCacheServiceVersion = getCacheServiceVersion; - exports2.getCacheMode = getCacheMode; - exports2.isCacheReadable = isCacheReadable; - exports2.isCacheWritable = isCacheWritable; - exports2.getCacheServiceURL = getCacheServiceURL; - function isGhes() { - const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); - const hostname = ghUrl.hostname.trimEnd().toUpperCase(); - const isGitHubHost = hostname === "GITHUB.COM"; - const isGheHost = hostname.endsWith(".GHE.COM"); - const isLocalHost = hostname.endsWith(".LOCALHOST"); - return !isGitHubHost && !isGheHost && !isLocalHost; - } - function getCacheServiceVersion() { - if (isGhes()) - return "v1"; - return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; - } - var KNOWN_CACHE_MODES = ["none", "read", "write", "write-only"]; - function getCacheMode() { - return (process.env["ACTIONS_CACHE_MODE"] || "").trim().toLowerCase(); - } - function isCacheReadable(mode) { - if (!KNOWN_CACHE_MODES.includes(mode)) - return true; - return mode === "read" || mode === "write"; - } - function isCacheWritable(mode) { - if (!KNOWN_CACHE_MODES.includes(mode)) - return true; - return mode === "write" || mode === "write-only"; - } - function getCacheServiceURL() { - const version = getCacheServiceVersion(); - switch (version) { - case "v1": - return process.env["ACTIONS_CACHE_URL"] || process.env["ACTIONS_RESULTS_URL"] || ""; - case "v2": - return process.env["ACTIONS_RESULTS_URL"] || ""; - default: - throw new Error(`Unsupported cache service version: ${version}`); - } - } - } -}); - -// node_modules/@actions/cache/package.json -var require_package = __commonJS({ - "node_modules/@actions/cache/package.json"(exports2, module2) { - module2.exports = { - name: "@actions/cache", - version: "5.2.0", - preview: true, - description: "Actions cache lib", - keywords: [ - "github", - "actions", - "cache" - ], - homepage: "https://github.com/actions/toolkit/tree/main/packages/cache", - license: "MIT", - main: "lib/cache.js", - types: "lib/cache.d.ts", - directories: { - lib: "lib", - test: "__tests__" - }, - files: [ - "lib", - "!.DS_Store" - ], - publishConfig: { - access: "public" - }, - repository: { - type: "git", - url: "git+https://github.com/actions/toolkit.git", - directory: "packages/cache" - }, - scripts: { - "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", - test: 'echo "Error: run tests from root" && exit 1', - tsc: "tsc" - }, - bugs: { - url: "https://github.com/actions/toolkit/issues" - }, - dependencies: { - "@actions/core": "^2.0.0", - "@actions/exec": "^2.0.0", - "@actions/glob": "^0.5.1", - "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^3.0.2", - "@actions/io": "^2.0.0", - "@azure/abort-controller": "^1.1.0", - "@azure/core-rest-pipeline": "^1.22.0", - "@azure/storage-blob": "^12.29.1", - semver: "^6.3.1" - }, - devDependencies: { - "@types/node": "^24.1.0", - "@types/semver": "^6.0.0", - "@protobuf-ts/plugin": "^2.9.4", - typescript: "^5.2.2" - }, - overrides: { - "uri-js": "npm:uri-js-replace@^1.0.1", - "node-fetch": "^3.3.2" - } - }; - } -}); - -// node_modules/@actions/cache/lib/internal/shared/user-agent.js -var require_user_agent = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/user-agent.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package(); - function getUserAgentString() { - return `@actions/cache-${packageJson.version}`; - } - } -}); - -// node_modules/@actions/cache/lib/internal/cacheHttpClient.js -var require_cacheHttpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheEntry = getCacheEntry; - exports2.downloadCache = downloadCache; - exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache5; - var core31 = __importStar2(require_core()); - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var fs32 = __importStar2(require("fs")); - var url_1 = require("url"); - var utils = __importStar2(require_cacheUtils()); - var uploadUtils_1 = require_uploadUtils(); - var downloadUtils_1 = require_downloadUtils(); - var options_1 = require_options(); - var requestUtils_1 = require_requestUtils(); - var config_1 = require_config(); - var constants_1 = require_constants7(); - var user_agent_1 = require_user_agent(); - function getCacheApiUrl(resource) { - const baseUrl = (0, config_1.getCacheServiceURL)(); - if (!baseUrl) { - throw new Error("Cache Service Url not found, unable to restore cache."); - } - const url2 = `${baseUrl}_apis/artifactcache/${resource}`; - core31.debug(`Resource Url: ${url2}`); - return url2; - } - function createAcceptHeader(type, apiVersion) { - return `${type};api-version=${apiVersion}`; - } - function getRequestOptions() { - const requestOptions = { - headers: { - Accept: createAcceptHeader("application/json", "6.0-preview.1") - } - }; - return requestOptions; - } - function createHttpClient() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"] || ""; - const bearerCredentialHandler = new auth_1.BearerCredentialHandler(token); - return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); - } - function getCacheEntry(keys, paths, options) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const httpClient = createHttpClient(); - const version = utils.getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); - const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { - return httpClient.getJson(getCacheApiUrl(resource)); - })); - if (response.statusCode === 204) { - if (core31.isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version); - } - return null; - } - if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { - const errorMessage = (_a2 = response.error) === null || _a2 === void 0 ? void 0 : _a2.message; - if (errorMessage === null || errorMessage === void 0 ? void 0 : errorMessage.includes(constants_1.CacheReadDeniedMessagePrefix)) { - throw new Error(errorMessage); - } - throw new Error(`Cache service responded with ${response.statusCode}`); - } - const cacheResult = response.result; - const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation; - if (!cacheDownloadUrl) { - throw new Error("Cache not found."); - } - core31.setSecret(cacheDownloadUrl); - core31.debug(`Cache Result:`); - core31.debug(JSON.stringify(cacheResult)); - return cacheResult; - }); - } - function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter2(this, void 0, void 0, function* () { - const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { - return httpClient.getJson(getCacheApiUrl(resource)); - })); - if (response.statusCode === 200) { - const cacheListResult = response.result; - const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; - if (totalCount && totalCount > 0) { - core31.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key -Other caches with similar key:`); - for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core31.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); - } - } - } - }); - } - function downloadCache(archiveLocation, archivePath, options) { - return __awaiter2(this, void 0, void 0, function* () { - const archiveUrl = new url_1.URL(archiveLocation); - const downloadOptions = (0, options_1.getDownloadOptions)(options); - if (archiveUrl.hostname.endsWith(".blob.core.windows.net")) { - if (downloadOptions.useAzureSdk) { - yield (0, downloadUtils_1.downloadCacheStorageSDK)(archiveLocation, archivePath, downloadOptions); - } else if (downloadOptions.concurrentBlobDownloads) { - yield (0, downloadUtils_1.downloadCacheHttpClientConcurrent)(archiveLocation, archivePath, downloadOptions); - } else { - yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); - } - } else { - yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); - } - }); - } - function reserveCache(key, paths, options) { - return __awaiter2(this, void 0, void 0, function* () { - const httpClient = createHttpClient(); - const version = utils.getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); - const reserveCacheRequest = { - key, - version, - cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize - }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); - })); - return response; - }); - } - function getContentRange(start, end) { - return `bytes ${start}-${end}/*`; - } - function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter2(this, void 0, void 0, function* () { - core31.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); - const additionalHeaders = { - "Content-Type": "application/octet-stream", - "Content-Range": getContentRange(start, end) - }; - const uploadChunkResponse = yield (0, requestUtils_1.retryHttpClientResponse)(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter2(this, void 0, void 0, function* () { - return httpClient.sendStream("PATCH", resourceUrl, openStream(), additionalHeaders); - })); - if (!(0, requestUtils_1.isSuccessStatusCode)(uploadChunkResponse.message.statusCode)) { - throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`); - } - }); - } - function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter2(this, void 0, void 0, function* () { - const fileSize = utils.getArchiveFileSizeInBytes(archivePath); - const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs32.openSync(archivePath, "r"); - const uploadOptions = (0, options_1.getUploadOptions)(options); - const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); - const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); - const parallelUploads = [...new Array(concurrency).keys()]; - core31.debug("Awaiting all uploads"); - let offset = 0; - try { - yield Promise.all(parallelUploads.map(() => __awaiter2(this, void 0, void 0, function* () { - while (offset < fileSize) { - const chunkSize = Math.min(fileSize - offset, maxChunkSize); - const start = offset; - const end = offset + chunkSize - 1; - offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs32.createReadStream(archivePath, { - fd, - start, - end, - autoClose: false - }).on("error", (error3) => { - throw new Error(`Cache upload failed because file read failed with ${error3.message}`); - }), start, end); - } - }))); - } finally { - fs32.closeSync(fd); - } - return; - }); - } - function commitCache(httpClient, cacheId, filesize) { - return __awaiter2(this, void 0, void 0, function* () { - const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); - })); - }); - } - function saveCache5(cacheId, archivePath, signedUploadURL, options) { - return __awaiter2(this, void 0, void 0, function* () { - const uploadOptions = (0, options_1.getUploadOptions)(options); - if (uploadOptions.useAzureSdk) { - if (!signedUploadURL) { - throw new Error("Azure Storage SDK can only be used when a signed URL is provided."); - } - yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); - } else { - const httpClient = createHttpClient(); - core31.debug("Upload cache"); - yield uploadFile(httpClient, cacheId, archivePath, options); - core31.debug("Commiting cache"); - const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); - const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); - if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { - throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); - } - core31.info("Cache saved successfully"); - } - }); - } - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/json-typings.js -var require_json_typings = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/json-typings.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isJsonObject = exports2.typeofJsonValue = void 0; - function typeofJsonValue(value) { - let t = typeof value; - if (t == "object") { - if (Array.isArray(value)) - return "array"; - if (value === null) - return "null"; - } - return t; - } - exports2.typeofJsonValue = typeofJsonValue; - function isJsonObject(value) { - return value !== null && typeof value == "object" && !Array.isArray(value); - } - exports2.isJsonObject = isJsonObject; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/base64.js -var require_base642 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/base64.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.base64encode = exports2.base64decode = void 0; - var encTable = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); - var decTable = []; - for (let i = 0; i < encTable.length; i++) - decTable[encTable[i].charCodeAt(0)] = i; - decTable["-".charCodeAt(0)] = encTable.indexOf("+"); - decTable["_".charCodeAt(0)] = encTable.indexOf("/"); - function base64decode(base64Str) { - let es = base64Str.length * 3 / 4; - if (base64Str[base64Str.length - 2] == "=") - es -= 2; - else if (base64Str[base64Str.length - 1] == "=") - es -= 1; - let bytes = new Uint8Array(es), bytePos = 0, groupPos = 0, b, p = 0; - for (let i = 0; i < base64Str.length; i++) { - b = decTable[base64Str.charCodeAt(i)]; - if (b === void 0) { - switch (base64Str[i]) { - case "=": - groupPos = 0; - // reset state when padding found - case "\n": - case "\r": - case " ": - case " ": - continue; - // skip white-space, and padding - default: - throw Error(`invalid base64 string.`); - } - } - switch (groupPos) { - case 0: - p = b; - groupPos = 1; - break; - case 1: - bytes[bytePos++] = p << 2 | (b & 48) >> 4; - p = b; - groupPos = 2; - break; - case 2: - bytes[bytePos++] = (p & 15) << 4 | (b & 60) >> 2; - p = b; - groupPos = 3; - break; - case 3: - bytes[bytePos++] = (p & 3) << 6 | b; - groupPos = 0; - break; - } - } - if (groupPos == 1) - throw Error(`invalid base64 string.`); - return bytes.subarray(0, bytePos); - } - exports2.base64decode = base64decode; - function base64encode(bytes) { - let base64 = "", groupPos = 0, b, p = 0; - for (let i = 0; i < bytes.length; i++) { - b = bytes[i]; - switch (groupPos) { - case 0: - base64 += encTable[b >> 2]; - p = (b & 3) << 4; - groupPos = 1; - break; - case 1: - base64 += encTable[p | b >> 4]; - p = (b & 15) << 2; - groupPos = 2; - break; - case 2: - base64 += encTable[p | b >> 6]; - base64 += encTable[b & 63]; - groupPos = 0; - break; - } - } - if (groupPos) { - base64 += encTable[p]; - base64 += "="; - if (groupPos == 1) - base64 += "="; - } - return base64; - } - exports2.base64encode = base64encode; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/protobufjs-utf8.js -var require_protobufjs_utf8 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/protobufjs-utf8.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.utf8read = void 0; - var fromCharCodes = (chunk) => String.fromCharCode.apply(String, chunk); - function utf8read(bytes) { - if (bytes.length < 1) - return ""; - let pos = 0, parts = [], chunk = [], i = 0, t; - let len = bytes.length; - while (pos < len) { - t = bytes[pos++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | bytes[pos++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (bytes[pos++] & 63) << 12 | (bytes[pos++] & 63) << 6 | bytes[pos++] & 63) - 65536; - chunk[i++] = 55296 + (t >> 10); - chunk[i++] = 56320 + (t & 1023); - } else - chunk[i++] = (t & 15) << 12 | (bytes[pos++] & 63) << 6 | bytes[pos++] & 63; - if (i > 8191) { - parts.push(fromCharCodes(chunk)); - i = 0; - } - } - if (parts.length) { - if (i) - parts.push(fromCharCodes(chunk.slice(0, i))); - return parts.join(""); - } - return fromCharCodes(chunk.slice(0, i)); - } - exports2.utf8read = utf8read; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/binary-format-contract.js -var require_binary_format_contract = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/binary-format-contract.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; - var UnknownFieldHandler; - (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = /* @__PURE__ */ Symbol.for("protobuf-ts/unknown"); - UnknownFieldHandler2.onRead = (typeName, message, fieldNo, wireType, data) => { - let container = is(message) ? message[UnknownFieldHandler2.symbol] : message[UnknownFieldHandler2.symbol] = []; - container.push({ no: fieldNo, wireType, data }); - }; - UnknownFieldHandler2.onWrite = (typeName, message, writer) => { - for (let { no, wireType, data } of UnknownFieldHandler2.list(message)) - writer.tag(no, wireType).raw(data); - }; - UnknownFieldHandler2.list = (message, fieldNo) => { - if (is(message)) { - let all = message[UnknownFieldHandler2.symbol]; - return fieldNo ? all.filter((uf) => uf.no == fieldNo) : all; - } - return []; - }; - UnknownFieldHandler2.last = (message, fieldNo) => UnknownFieldHandler2.list(message, fieldNo).slice(-1)[0]; - const is = (message) => message && Array.isArray(message[UnknownFieldHandler2.symbol]); - })(UnknownFieldHandler = exports2.UnknownFieldHandler || (exports2.UnknownFieldHandler = {})); - function mergeBinaryOptions(a, b) { - return Object.assign(Object.assign({}, a), b); - } - exports2.mergeBinaryOptions = mergeBinaryOptions; - var WireType; - (function(WireType2) { - WireType2[WireType2["Varint"] = 0] = "Varint"; - WireType2[WireType2["Bit64"] = 1] = "Bit64"; - WireType2[WireType2["LengthDelimited"] = 2] = "LengthDelimited"; - WireType2[WireType2["StartGroup"] = 3] = "StartGroup"; - WireType2[WireType2["EndGroup"] = 4] = "EndGroup"; - WireType2[WireType2["Bit32"] = 5] = "Bit32"; - })(WireType = exports2.WireType || (exports2.WireType = {})); - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/goog-varint.js -var require_goog_varint = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/goog-varint.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.varint32read = exports2.varint32write = exports2.int64toString = exports2.int64fromString = exports2.varint64write = exports2.varint64read = void 0; - function varint64read() { - let lowBits = 0; - let highBits = 0; - for (let shift = 0; shift < 28; shift += 7) { - let b = this.buf[this.pos++]; - lowBits |= (b & 127) << shift; - if ((b & 128) == 0) { - this.assertBounds(); - return [lowBits, highBits]; - } - } - let middleByte = this.buf[this.pos++]; - lowBits |= (middleByte & 15) << 28; - highBits = (middleByte & 112) >> 4; - if ((middleByte & 128) == 0) { - this.assertBounds(); - return [lowBits, highBits]; - } - for (let shift = 3; shift <= 31; shift += 7) { - let b = this.buf[this.pos++]; - highBits |= (b & 127) << shift; - if ((b & 128) == 0) { - this.assertBounds(); - return [lowBits, highBits]; - } - } - throw new Error("invalid varint"); - } - exports2.varint64read = varint64read; - function varint64write(lo, hi, bytes) { - for (let i = 0; i < 28; i = i + 7) { - const shift = lo >>> i; - const hasNext = !(shift >>> 7 == 0 && hi == 0); - const byte = (hasNext ? shift | 128 : shift) & 255; - bytes.push(byte); - if (!hasNext) { - return; - } - } - const splitBits = lo >>> 28 & 15 | (hi & 7) << 4; - const hasMoreBits = !(hi >> 3 == 0); - bytes.push((hasMoreBits ? splitBits | 128 : splitBits) & 255); - if (!hasMoreBits) { - return; - } - for (let i = 3; i < 31; i = i + 7) { - const shift = hi >>> i; - const hasNext = !(shift >>> 7 == 0); - const byte = (hasNext ? shift | 128 : shift) & 255; - bytes.push(byte); - if (!hasNext) { - return; - } - } - bytes.push(hi >>> 31 & 1); - } - exports2.varint64write = varint64write; - var TWO_PWR_32_DBL2 = (1 << 16) * (1 << 16); - function int64fromString(dec) { - let minus = dec[0] == "-"; - if (minus) - dec = dec.slice(1); - const base = 1e6; - let lowBits = 0; - let highBits = 0; - function add1e6digit(begin, end) { - const digit1e6 = Number(dec.slice(begin, end)); - highBits *= base; - lowBits = lowBits * base + digit1e6; - if (lowBits >= TWO_PWR_32_DBL2) { - highBits = highBits + (lowBits / TWO_PWR_32_DBL2 | 0); - lowBits = lowBits % TWO_PWR_32_DBL2; - } - } - add1e6digit(-24, -18); - add1e6digit(-18, -12); - add1e6digit(-12, -6); - add1e6digit(-6); - return [minus, lowBits, highBits]; - } - exports2.int64fromString = int64fromString; - function int64toString(bitsLow, bitsHigh) { - if (bitsHigh >>> 0 <= 2097151) { - return "" + (TWO_PWR_32_DBL2 * bitsHigh + (bitsLow >>> 0)); - } - let low = bitsLow & 16777215; - let mid = (bitsLow >>> 24 | bitsHigh << 8) >>> 0 & 16777215; - let high = bitsHigh >> 16 & 65535; - let digitA = low + mid * 6777216 + high * 6710656; - let digitB = mid + high * 8147497; - let digitC = high * 2; - let base = 1e7; - if (digitA >= base) { - digitB += Math.floor(digitA / base); - digitA %= base; - } - if (digitB >= base) { - digitC += Math.floor(digitB / base); - digitB %= base; - } - function decimalFrom1e7(digit1e7, needLeadingZeros) { - let partial = digit1e7 ? String(digit1e7) : ""; - if (needLeadingZeros) { - return "0000000".slice(partial.length) + partial; - } - return partial; - } - return decimalFrom1e7( - digitC, - /*needLeadingZeros=*/ - 0 - ) + decimalFrom1e7( - digitB, - /*needLeadingZeros=*/ - digitC - ) + // If the final 1e7 digit didn't need leading zeros, we would have - // returned via the trivial code path at the top. - decimalFrom1e7( - digitA, - /*needLeadingZeros=*/ - 1 - ); - } - exports2.int64toString = int64toString; - function varint32write(value, bytes) { - if (value >= 0) { - while (value > 127) { - bytes.push(value & 127 | 128); - value = value >>> 7; - } - bytes.push(value); - } else { - for (let i = 0; i < 9; i++) { - bytes.push(value & 127 | 128); - value = value >> 7; - } - bytes.push(1); - } - } - exports2.varint32write = varint32write; - function varint32read() { - let b = this.buf[this.pos++]; - let result = b & 127; - if ((b & 128) == 0) { - this.assertBounds(); - return result; - } - b = this.buf[this.pos++]; - result |= (b & 127) << 7; - if ((b & 128) == 0) { - this.assertBounds(); - return result; - } - b = this.buf[this.pos++]; - result |= (b & 127) << 14; - if ((b & 128) == 0) { - this.assertBounds(); - return result; - } - b = this.buf[this.pos++]; - result |= (b & 127) << 21; - if ((b & 128) == 0) { - this.assertBounds(); - return result; - } - b = this.buf[this.pos++]; - result |= (b & 15) << 28; - for (let readBytes = 5; (b & 128) !== 0 && readBytes < 10; readBytes++) - b = this.buf[this.pos++]; - if ((b & 128) != 0) - throw new Error("invalid varint"); - this.assertBounds(); - return result >>> 0; - } - exports2.varint32read = varint32read; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/pb-long.js -var require_pb_long = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/pb-long.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PbLong = exports2.PbULong = exports2.detectBi = void 0; - var goog_varint_1 = require_goog_varint(); - var BI; - function detectBi() { - const dv = new DataView(new ArrayBuffer(8)); - const ok = globalThis.BigInt !== void 0 && typeof dv.getBigInt64 === "function" && typeof dv.getBigUint64 === "function" && typeof dv.setBigInt64 === "function" && typeof dv.setBigUint64 === "function"; - BI = ok ? { - MIN: BigInt("-9223372036854775808"), - MAX: BigInt("9223372036854775807"), - UMIN: BigInt("0"), - UMAX: BigInt("18446744073709551615"), - C: BigInt, - V: dv - } : void 0; - } - exports2.detectBi = detectBi; - detectBi(); - function assertBi(bi) { - if (!bi) - throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support"); - } - var RE_DECIMAL_STR = /^-?[0-9]+$/; - var TWO_PWR_32_DBL2 = 4294967296; - var HALF_2_PWR_32 = 2147483648; - var SharedPbLong = class { - /** - * Create a new instance with the given bits. - */ - constructor(lo, hi) { - this.lo = lo | 0; - this.hi = hi | 0; - } - /** - * Is this instance equal to 0? - */ - isZero() { - return this.lo == 0 && this.hi == 0; - } - /** - * Convert to a native number. - */ - toNumber() { - let result = this.hi * TWO_PWR_32_DBL2 + (this.lo >>> 0); - if (!Number.isSafeInteger(result)) - throw new Error("cannot convert to safe number"); - return result; - } - }; - var PbULong = class _PbULong extends SharedPbLong { - /** - * Create instance from a `string`, `number` or `bigint`. - */ - static from(value) { - if (BI) - switch (typeof value) { - case "string": - if (value == "0") - return this.ZERO; - if (value == "") - throw new Error("string is no integer"); - value = BI.C(value); - case "number": - if (value === 0) - return this.ZERO; - value = BI.C(value); - case "bigint": - if (!value) - return this.ZERO; - if (value < BI.UMIN) - throw new Error("signed value for ulong"); - if (value > BI.UMAX) - throw new Error("ulong too large"); - BI.V.setBigUint64(0, value, true); - return new _PbULong(BI.V.getInt32(0, true), BI.V.getInt32(4, true)); - } - else - switch (typeof value) { - case "string": - if (value == "0") - return this.ZERO; - value = value.trim(); - if (!RE_DECIMAL_STR.test(value)) - throw new Error("string is no integer"); - let [minus, lo, hi] = goog_varint_1.int64fromString(value); - if (minus) - throw new Error("signed value for ulong"); - return new _PbULong(lo, hi); - case "number": - if (value == 0) - return this.ZERO; - if (!Number.isSafeInteger(value)) - throw new Error("number is no integer"); - if (value < 0) - throw new Error("signed value for ulong"); - return new _PbULong(value, value / TWO_PWR_32_DBL2); - } - throw new Error("unknown value " + typeof value); - } - /** - * Convert to decimal string. - */ - toString() { - return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); - } - /** - * Convert to native bigint. - */ - toBigInt() { - assertBi(BI); - BI.V.setInt32(0, this.lo, true); - BI.V.setInt32(4, this.hi, true); - return BI.V.getBigUint64(0, true); - } - }; - exports2.PbULong = PbULong; - PbULong.ZERO = new PbULong(0, 0); - var PbLong = class _PbLong extends SharedPbLong { - /** - * Create instance from a `string`, `number` or `bigint`. - */ - static from(value) { - if (BI) - switch (typeof value) { - case "string": - if (value == "0") - return this.ZERO; - if (value == "") - throw new Error("string is no integer"); - value = BI.C(value); - case "number": - if (value === 0) - return this.ZERO; - value = BI.C(value); - case "bigint": - if (!value) - return this.ZERO; - if (value < BI.MIN) - throw new Error("signed long too small"); - if (value > BI.MAX) - throw new Error("signed long too large"); - BI.V.setBigInt64(0, value, true); - return new _PbLong(BI.V.getInt32(0, true), BI.V.getInt32(4, true)); - } - else - switch (typeof value) { - case "string": - if (value == "0") - return this.ZERO; - value = value.trim(); - if (!RE_DECIMAL_STR.test(value)) - throw new Error("string is no integer"); - let [minus, lo, hi] = goog_varint_1.int64fromString(value); - if (minus) { - if (hi > HALF_2_PWR_32 || hi == HALF_2_PWR_32 && lo != 0) - throw new Error("signed long too small"); - } else if (hi >= HALF_2_PWR_32) - throw new Error("signed long too large"); - let pbl = new _PbLong(lo, hi); - return minus ? pbl.negate() : pbl; - case "number": - if (value == 0) - return this.ZERO; - if (!Number.isSafeInteger(value)) - throw new Error("number is no integer"); - return value > 0 ? new _PbLong(value, value / TWO_PWR_32_DBL2) : new _PbLong(-value, -value / TWO_PWR_32_DBL2).negate(); - } - throw new Error("unknown value " + typeof value); - } - /** - * Do we have a minus sign? - */ - isNegative() { - return (this.hi & HALF_2_PWR_32) !== 0; - } - /** - * Negate two's complement. - * Invert all the bits and add one to the result. - */ - negate() { - let hi = ~this.hi, lo = this.lo; - if (lo) - lo = ~lo + 1; - else - hi += 1; - return new _PbLong(lo, hi); - } - /** - * Convert to decimal string. - */ - toString() { - if (BI) - return this.toBigInt().toString(); - if (this.isNegative()) { - let n = this.negate(); - return "-" + goog_varint_1.int64toString(n.lo, n.hi); - } - return goog_varint_1.int64toString(this.lo, this.hi); - } - /** - * Convert to native bigint. - */ - toBigInt() { - assertBi(BI); - BI.V.setInt32(0, this.lo, true); - BI.V.setInt32(4, this.hi, true); - return BI.V.getBigInt64(0, true); - } - }; - exports2.PbLong = PbLong; - PbLong.ZERO = new PbLong(0, 0); - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/binary-reader.js -var require_binary_reader = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/binary-reader.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BinaryReader = exports2.binaryReadOptions = void 0; - var binary_format_contract_1 = require_binary_format_contract(); - var pb_long_1 = require_pb_long(); - var goog_varint_1 = require_goog_varint(); - var defaultsRead = { - readUnknownField: true, - readerFactory: (bytes) => new BinaryReader(bytes) - }; - function binaryReadOptions(options) { - return options ? Object.assign(Object.assign({}, defaultsRead), options) : defaultsRead; - } - exports2.binaryReadOptions = binaryReadOptions; - var BinaryReader = class { - constructor(buf, textDecoder) { - this.varint64 = goog_varint_1.varint64read; - this.uint32 = goog_varint_1.varint32read; - this.buf = buf; - this.len = buf.length; - this.pos = 0; - this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - this.textDecoder = textDecoder !== null && textDecoder !== void 0 ? textDecoder : new TextDecoder("utf-8", { - fatal: true, - ignoreBOM: true - }); - } - /** - * Reads a tag - field number and wire type. - */ - tag() { - let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7; - if (fieldNo <= 0 || wireType < 0 || wireType > 5) - throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType); - return [fieldNo, wireType]; - } - /** - * Skip one element on the wire and return the skipped data. - * Supports WireType.StartGroup since v2.0.0-alpha.23. - */ - skip(wireType) { - let start = this.pos; - switch (wireType) { - case binary_format_contract_1.WireType.Varint: - while (this.buf[this.pos++] & 128) { - } - break; - case binary_format_contract_1.WireType.Bit64: - this.pos += 4; - case binary_format_contract_1.WireType.Bit32: - this.pos += 4; - break; - case binary_format_contract_1.WireType.LengthDelimited: - let len = this.uint32(); - this.pos += len; - break; - case binary_format_contract_1.WireType.StartGroup: - let t; - while ((t = this.tag()[1]) !== binary_format_contract_1.WireType.EndGroup) { - this.skip(t); - } - break; - default: - throw new Error("cant skip wire type " + wireType); - } - this.assertBounds(); - return this.buf.subarray(start, this.pos); - } - /** - * Throws error if position in byte array is out of range. - */ - assertBounds() { - if (this.pos > this.len) - throw new RangeError("premature EOF"); - } - /** - * Read a `int32` field, a signed 32 bit varint. - */ - int32() { - return this.uint32() | 0; - } - /** - * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. - */ - sint32() { - let zze = this.uint32(); - return zze >>> 1 ^ -(zze & 1); - } - /** - * Read a `int64` field, a signed 64-bit varint. - */ - int64() { - return new pb_long_1.PbLong(...this.varint64()); - } - /** - * Read a `uint64` field, an unsigned 64-bit varint. - */ - uint64() { - return new pb_long_1.PbULong(...this.varint64()); - } - /** - * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. - */ - sint64() { - let [lo, hi] = this.varint64(); - let s = -(lo & 1); - lo = (lo >>> 1 | (hi & 1) << 31) ^ s; - hi = hi >>> 1 ^ s; - return new pb_long_1.PbLong(lo, hi); - } - /** - * Read a `bool` field, a variant. - */ - bool() { - let [lo, hi] = this.varint64(); - return lo !== 0 || hi !== 0; - } - /** - * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. - */ - fixed32() { - return this.view.getUint32((this.pos += 4) - 4, true); - } - /** - * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. - */ - sfixed32() { - return this.view.getInt32((this.pos += 4) - 4, true); - } - /** - * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. - */ - fixed64() { - return new pb_long_1.PbULong(this.sfixed32(), this.sfixed32()); - } - /** - * Read a `fixed64` field, a signed, fixed-length 64-bit integer. - */ - sfixed64() { - return new pb_long_1.PbLong(this.sfixed32(), this.sfixed32()); - } - /** - * Read a `float` field, 32-bit floating point number. - */ - float() { - return this.view.getFloat32((this.pos += 4) - 4, true); - } - /** - * Read a `double` field, a 64-bit floating point number. - */ - double() { - return this.view.getFloat64((this.pos += 8) - 8, true); - } - /** - * Read a `bytes` field, length-delimited arbitrary data. - */ - bytes() { - let len = this.uint32(); - let start = this.pos; - this.pos += len; - this.assertBounds(); - return this.buf.subarray(start, start + len); - } - /** - * Read a `string` field, length-delimited data converted to UTF-8 text. - */ - string() { - return this.textDecoder.decode(this.bytes()); - } - }; - exports2.BinaryReader = BinaryReader; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/assert.js -var require_assert = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/assert.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.assertFloat32 = exports2.assertUInt32 = exports2.assertInt32 = exports2.assertNever = exports2.assert = void 0; - function assert(condition, msg) { - if (!condition) { - throw new Error(msg); - } - } - exports2.assert = assert; - function assertNever2(value, msg) { - throw new Error(msg !== null && msg !== void 0 ? msg : "Unexpected object: " + value); - } - exports2.assertNever = assertNever2; - var FLOAT32_MAX = 34028234663852886e22; - var FLOAT32_MIN = -34028234663852886e22; - var UINT32_MAX = 4294967295; - var INT32_MAX = 2147483647; - var INT32_MIN = -2147483648; - function assertInt32(arg) { - if (typeof arg !== "number") - throw new Error("invalid int 32: " + typeof arg); - if (!Number.isInteger(arg) || arg > INT32_MAX || arg < INT32_MIN) - throw new Error("invalid int 32: " + arg); - } - exports2.assertInt32 = assertInt32; - function assertUInt32(arg) { - if (typeof arg !== "number") - throw new Error("invalid uint 32: " + typeof arg); - if (!Number.isInteger(arg) || arg > UINT32_MAX || arg < 0) - throw new Error("invalid uint 32: " + arg); - } - exports2.assertUInt32 = assertUInt32; - function assertFloat32(arg) { - if (typeof arg !== "number") - throw new Error("invalid float 32: " + typeof arg); - if (!Number.isFinite(arg)) - return; - if (arg > FLOAT32_MAX || arg < FLOAT32_MIN) - throw new Error("invalid float 32: " + arg); - } - exports2.assertFloat32 = assertFloat32; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/binary-writer.js -var require_binary_writer = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/binary-writer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BinaryWriter = exports2.binaryWriteOptions = void 0; - var pb_long_1 = require_pb_long(); - var goog_varint_1 = require_goog_varint(); - var assert_1 = require_assert(); - var defaultsWrite = { - writeUnknownFields: true, - writerFactory: () => new BinaryWriter() - }; - function binaryWriteOptions(options) { - return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; - } - exports2.binaryWriteOptions = binaryWriteOptions; - var BinaryWriter = class { - constructor(textEncoder) { - this.stack = []; - this.textEncoder = textEncoder !== null && textEncoder !== void 0 ? textEncoder : new TextEncoder(); - this.chunks = []; - this.buf = []; - } - /** - * Return all bytes written and reset this writer. - */ - finish() { - this.chunks.push(new Uint8Array(this.buf)); - let len = 0; - for (let i = 0; i < this.chunks.length; i++) - len += this.chunks[i].length; - let bytes = new Uint8Array(len); - let offset = 0; - for (let i = 0; i < this.chunks.length; i++) { - bytes.set(this.chunks[i], offset); - offset += this.chunks[i].length; - } - this.chunks = []; - return bytes; - } - /** - * Start a new fork for length-delimited data like a message - * or a packed repeated field. - * - * Must be joined later with `join()`. - */ - fork() { - this.stack.push({ chunks: this.chunks, buf: this.buf }); - this.chunks = []; - this.buf = []; - return this; - } - /** - * Join the last fork. Write its length and bytes, then - * return to the previous state. - */ - join() { - let chunk = this.finish(); - let prev = this.stack.pop(); - if (!prev) - throw new Error("invalid state, fork stack empty"); - this.chunks = prev.chunks; - this.buf = prev.buf; - this.uint32(chunk.byteLength); - return this.raw(chunk); - } - /** - * Writes a tag (field number and wire type). - * - * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. - * - * Generated code should compute the tag ahead of time and call `uint32()`. - */ - tag(fieldNo, type) { - return this.uint32((fieldNo << 3 | type) >>> 0); - } - /** - * Write a chunk of raw bytes. - */ - raw(chunk) { - if (this.buf.length) { - this.chunks.push(new Uint8Array(this.buf)); - this.buf = []; - } - this.chunks.push(chunk); - return this; - } - /** - * Write a `uint32` value, an unsigned 32 bit varint. - */ - uint32(value) { - assert_1.assertUInt32(value); - while (value > 127) { - this.buf.push(value & 127 | 128); - value = value >>> 7; - } - this.buf.push(value); - return this; - } - /** - * Write a `int32` value, a signed 32 bit varint. - */ - int32(value) { - assert_1.assertInt32(value); - goog_varint_1.varint32write(value, this.buf); - return this; - } - /** - * Write a `bool` value, a variant. - */ - bool(value) { - this.buf.push(value ? 1 : 0); - return this; - } - /** - * Write a `bytes` value, length-delimited arbitrary data. - */ - bytes(value) { - this.uint32(value.byteLength); - return this.raw(value); - } - /** - * Write a `string` value, length-delimited data converted to UTF-8 text. - */ - string(value) { - let chunk = this.textEncoder.encode(value); - this.uint32(chunk.byteLength); - return this.raw(chunk); - } - /** - * Write a `float` value, 32-bit floating point number. - */ - float(value) { - assert_1.assertFloat32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setFloat32(0, value, true); - return this.raw(chunk); - } - /** - * Write a `double` value, a 64-bit floating point number. - */ - double(value) { - let chunk = new Uint8Array(8); - new DataView(chunk.buffer).setFloat64(0, value, true); - return this.raw(chunk); - } - /** - * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. - */ - fixed32(value) { - assert_1.assertUInt32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setUint32(0, value, true); - return this.raw(chunk); - } - /** - * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. - */ - sfixed32(value) { - assert_1.assertInt32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setInt32(0, value, true); - return this.raw(chunk); - } - /** - * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. - */ - sint32(value) { - assert_1.assertInt32(value); - value = (value << 1 ^ value >> 31) >>> 0; - goog_varint_1.varint32write(value, this.buf); - return this; - } - /** - * Write a `fixed64` value, a signed, fixed-length 64-bit integer. - */ - sfixed64(value) { - let chunk = new Uint8Array(8); - let view = new DataView(chunk.buffer); - let long = pb_long_1.PbLong.from(value); - view.setInt32(0, long.lo, true); - view.setInt32(4, long.hi, true); - return this.raw(chunk); - } - /** - * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. - */ - fixed64(value) { - let chunk = new Uint8Array(8); - let view = new DataView(chunk.buffer); - let long = pb_long_1.PbULong.from(value); - view.setInt32(0, long.lo, true); - view.setInt32(4, long.hi, true); - return this.raw(chunk); - } - /** - * Write a `int64` value, a signed 64-bit varint. - */ - int64(value) { - let long = pb_long_1.PbLong.from(value); - goog_varint_1.varint64write(long.lo, long.hi, this.buf); - return this; - } - /** - * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. - */ - sint64(value) { - let long = pb_long_1.PbLong.from(value), sign = long.hi >> 31, lo = long.lo << 1 ^ sign, hi = (long.hi << 1 | long.lo >>> 31) ^ sign; - goog_varint_1.varint64write(lo, hi, this.buf); - return this; - } - /** - * Write a `uint64` value, an unsigned 64-bit varint. - */ - uint64(value) { - let long = pb_long_1.PbULong.from(value); - goog_varint_1.varint64write(long.lo, long.hi, this.buf); - return this; - } - }; - exports2.BinaryWriter = BinaryWriter; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/json-format-contract.js -var require_json_format_contract = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/json-format-contract.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.mergeJsonOptions = exports2.jsonWriteOptions = exports2.jsonReadOptions = void 0; - var defaultsWrite = { - emitDefaultValues: false, - enumAsInteger: false, - useProtoFieldName: false, - prettySpaces: 0 - }; - var defaultsRead = { - ignoreUnknownFields: false - }; - function jsonReadOptions(options) { - return options ? Object.assign(Object.assign({}, defaultsRead), options) : defaultsRead; - } - exports2.jsonReadOptions = jsonReadOptions; - function jsonWriteOptions(options) { - return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; - } - exports2.jsonWriteOptions = jsonWriteOptions; - function mergeJsonOptions(a, b) { - var _a2, _b; - let c = Object.assign(Object.assign({}, a), b); - c.typeRegistry = [...(_a2 = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a2 !== void 0 ? _a2 : [], ...(_b = b === null || b === void 0 ? void 0 : b.typeRegistry) !== null && _b !== void 0 ? _b : []]; - return c; - } - exports2.mergeJsonOptions = mergeJsonOptions; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/message-type-contract.js -var require_message_type_contract = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/message-type-contract.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/lower-camel-case.js -var require_lower_camel_case = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/lower-camel-case.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.lowerCamelCase = void 0; - function lowerCamelCase(snakeCase) { - let capNext = false; - const sb = []; - for (let i = 0; i < snakeCase.length; i++) { - let next = snakeCase.charAt(i); - if (next == "_") { - capNext = true; - } else if (/\d/.test(next)) { - sb.push(next); - capNext = true; - } else if (capNext) { - sb.push(next.toUpperCase()); - capNext = false; - } else if (i == 0) { - sb.push(next.toLowerCase()); - } else { - sb.push(next); - } - } - return sb.join(""); - } - exports2.lowerCamelCase = lowerCamelCase; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-info.js -var require_reflection_info = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-info.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.readMessageOption = exports2.readFieldOption = exports2.readFieldOptions = exports2.normalizeFieldInfo = exports2.RepeatType = exports2.LongType = exports2.ScalarType = void 0; - var lower_camel_case_1 = require_lower_camel_case(); - var ScalarType; - (function(ScalarType2) { - ScalarType2[ScalarType2["DOUBLE"] = 1] = "DOUBLE"; - ScalarType2[ScalarType2["FLOAT"] = 2] = "FLOAT"; - ScalarType2[ScalarType2["INT64"] = 3] = "INT64"; - ScalarType2[ScalarType2["UINT64"] = 4] = "UINT64"; - ScalarType2[ScalarType2["INT32"] = 5] = "INT32"; - ScalarType2[ScalarType2["FIXED64"] = 6] = "FIXED64"; - ScalarType2[ScalarType2["FIXED32"] = 7] = "FIXED32"; - ScalarType2[ScalarType2["BOOL"] = 8] = "BOOL"; - ScalarType2[ScalarType2["STRING"] = 9] = "STRING"; - ScalarType2[ScalarType2["BYTES"] = 12] = "BYTES"; - ScalarType2[ScalarType2["UINT32"] = 13] = "UINT32"; - ScalarType2[ScalarType2["SFIXED32"] = 15] = "SFIXED32"; - ScalarType2[ScalarType2["SFIXED64"] = 16] = "SFIXED64"; - ScalarType2[ScalarType2["SINT32"] = 17] = "SINT32"; - ScalarType2[ScalarType2["SINT64"] = 18] = "SINT64"; - })(ScalarType = exports2.ScalarType || (exports2.ScalarType = {})); - var LongType; - (function(LongType2) { - LongType2[LongType2["BIGINT"] = 0] = "BIGINT"; - LongType2[LongType2["STRING"] = 1] = "STRING"; - LongType2[LongType2["NUMBER"] = 2] = "NUMBER"; - })(LongType = exports2.LongType || (exports2.LongType = {})); - var RepeatType; - (function(RepeatType2) { - RepeatType2[RepeatType2["NO"] = 0] = "NO"; - RepeatType2[RepeatType2["PACKED"] = 1] = "PACKED"; - RepeatType2[RepeatType2["UNPACKED"] = 2] = "UNPACKED"; - })(RepeatType = exports2.RepeatType || (exports2.RepeatType = {})); - function normalizeFieldInfo(field) { - var _a2, _b, _c, _d; - field.localName = (_a2 = field.localName) !== null && _a2 !== void 0 ? _a2 : lower_camel_case_1.lowerCamelCase(field.name); - field.jsonName = (_b = field.jsonName) !== null && _b !== void 0 ? _b : lower_camel_case_1.lowerCamelCase(field.name); - field.repeat = (_c = field.repeat) !== null && _c !== void 0 ? _c : RepeatType.NO; - field.opt = (_d = field.opt) !== null && _d !== void 0 ? _d : field.repeat ? false : field.oneof ? false : field.kind == "message"; - return field; - } - exports2.normalizeFieldInfo = normalizeFieldInfo; - function readFieldOptions(messageType, fieldName, extensionName, extensionType) { - var _a2; - const options = (_a2 = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a2 === void 0 ? void 0 : _a2.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readFieldOptions = readFieldOptions; - function readFieldOption(messageType, fieldName, extensionName, extensionType) { - var _a2; - const options = (_a2 = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a2 === void 0 ? void 0 : _a2.options; - if (!options) { - return void 0; - } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; - } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; - } - exports2.readFieldOption = readFieldOption; - function readMessageOption(messageType, extensionName, extensionType) { - const options = messageType.options; - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; - } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; - } - exports2.readMessageOption = readMessageOption; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js -var require_oneof = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSelectedOneofValue = exports2.clearOneofValue = exports2.setUnknownOneofValue = exports2.setOneofValue = exports2.getOneofValue = exports2.isOneofGroup = void 0; - function isOneofGroup(any) { - if (typeof any != "object" || any === null || !any.hasOwnProperty("oneofKind")) { - return false; - } - switch (typeof any.oneofKind) { - case "string": - if (any[any.oneofKind] === void 0) - return false; - return Object.keys(any).length == 2; - case "undefined": - return Object.keys(any).length == 1; - default: - return false; - } - } - exports2.isOneofGroup = isOneofGroup; - function getOneofValue(oneof, kind) { - return oneof[kind]; - } - exports2.getOneofValue = getOneofValue; - function setOneofValue(oneof, kind, value) { - if (oneof.oneofKind !== void 0) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = kind; - if (value !== void 0) { - oneof[kind] = value; - } - } - exports2.setOneofValue = setOneofValue; - function setUnknownOneofValue(oneof, kind, value) { - if (oneof.oneofKind !== void 0) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = kind; - if (value !== void 0 && kind !== void 0) { - oneof[kind] = value; - } - } - exports2.setUnknownOneofValue = setUnknownOneofValue; - function clearOneofValue(oneof) { - if (oneof.oneofKind !== void 0) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = void 0; - } - exports2.clearOneofValue = clearOneofValue; - function getSelectedOneofValue(oneof) { - if (oneof.oneofKind === void 0) { - return void 0; - } - return oneof[oneof.oneofKind]; - } - exports2.getSelectedOneofValue = getSelectedOneofValue; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-type-check.js -var require_reflection_type_check = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-type-check.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ReflectionTypeCheck = void 0; - var reflection_info_1 = require_reflection_info(); - var oneof_1 = require_oneof(); - var ReflectionTypeCheck = class { - constructor(info8) { - var _a2; - this.fields = (_a2 = info8.fields) !== null && _a2 !== void 0 ? _a2 : []; - } - prepare() { - if (this.data) - return; - const req = [], known = [], oneofs = []; - for (let field of this.fields) { - if (field.oneof) { - if (!oneofs.includes(field.oneof)) { - oneofs.push(field.oneof); - req.push(field.oneof); - known.push(field.oneof); - } - } else { - known.push(field.localName); - switch (field.kind) { - case "scalar": - case "enum": - if (!field.opt || field.repeat) - req.push(field.localName); - break; - case "message": - if (field.repeat) - req.push(field.localName); - break; - case "map": - req.push(field.localName); - break; - } - } - } - this.data = { req, known, oneofs: Object.values(oneofs) }; - } - /** - * Is the argument a valid message as specified by the - * reflection information? - * - * Checks all field types recursively. The `depth` - * specifies how deep into the structure the check will be. - * - * With a depth of 0, only the presence of fields - * is checked. - * - * With a depth of 1 or more, the field types are checked. - * - * With a depth of 2 or more, the members of map, repeated - * and message fields are checked. - * - * Message fields will be checked recursively with depth - 1. - * - * The number of map entries / repeated values being checked - * is < depth. - */ - is(message, depth, allowExcessProperties = false) { - if (depth < 0) - return true; - if (message === null || message === void 0 || typeof message != "object") - return false; - this.prepare(); - let keys = Object.keys(message), data = this.data; - if (keys.length < data.req.length || data.req.some((n) => !keys.includes(n))) - return false; - if (!allowExcessProperties) { - if (keys.some((k) => !data.known.includes(k))) - return false; - } - if (depth < 1) { - return true; - } - for (const name of data.oneofs) { - const group = message[name]; - if (!oneof_1.isOneofGroup(group)) - return false; - if (group.oneofKind === void 0) - continue; - const field = this.fields.find((f) => f.localName === group.oneofKind); - if (!field) - return false; - if (!this.field(group[group.oneofKind], field, allowExcessProperties, depth)) - return false; - } - for (const field of this.fields) { - if (field.oneof !== void 0) - continue; - if (!this.field(message[field.localName], field, allowExcessProperties, depth)) - return false; - } - return true; - } - field(arg, field, allowExcessProperties, depth) { - let repeated = field.repeat; - switch (field.kind) { - case "scalar": - if (arg === void 0) - return field.opt; - if (repeated) - return this.scalars(arg, field.T, depth, field.L); - return this.scalar(arg, field.T, field.L); - case "enum": - if (arg === void 0) - return field.opt; - if (repeated) - return this.scalars(arg, reflection_info_1.ScalarType.INT32, depth); - return this.scalar(arg, reflection_info_1.ScalarType.INT32); - case "message": - if (arg === void 0) - return true; - if (repeated) - return this.messages(arg, field.T(), allowExcessProperties, depth); - return this.message(arg, field.T(), allowExcessProperties, depth); - case "map": - if (typeof arg != "object" || arg === null) - return false; - if (depth < 2) - return true; - if (!this.mapKeys(arg, field.K, depth)) - return false; - switch (field.V.kind) { - case "scalar": - return this.scalars(Object.values(arg), field.V.T, depth, field.V.L); - case "enum": - return this.scalars(Object.values(arg), reflection_info_1.ScalarType.INT32, depth); - case "message": - return this.messages(Object.values(arg), field.V.T(), allowExcessProperties, depth); - } - break; - } - return true; - } - message(arg, type, allowExcessProperties, depth) { - if (allowExcessProperties) { - return type.isAssignable(arg, depth); - } - return type.is(arg, depth); - } - messages(arg, type, allowExcessProperties, depth) { - if (!Array.isArray(arg)) - return false; - if (depth < 2) - return true; - if (allowExcessProperties) { - for (let i = 0; i < arg.length && i < depth; i++) - if (!type.isAssignable(arg[i], depth - 1)) - return false; - } else { - for (let i = 0; i < arg.length && i < depth; i++) - if (!type.is(arg[i], depth - 1)) - return false; - } - return true; - } - scalar(arg, type, longType) { - let argType = typeof arg; - switch (type) { - case reflection_info_1.ScalarType.UINT64: - case reflection_info_1.ScalarType.FIXED64: - case reflection_info_1.ScalarType.INT64: - case reflection_info_1.ScalarType.SFIXED64: - case reflection_info_1.ScalarType.SINT64: - switch (longType) { - case reflection_info_1.LongType.BIGINT: - return argType == "bigint"; - case reflection_info_1.LongType.NUMBER: - return argType == "number" && !isNaN(arg); - default: - return argType == "string"; - } - case reflection_info_1.ScalarType.BOOL: - return argType == "boolean"; - case reflection_info_1.ScalarType.STRING: - return argType == "string"; - case reflection_info_1.ScalarType.BYTES: - return arg instanceof Uint8Array; - case reflection_info_1.ScalarType.DOUBLE: - case reflection_info_1.ScalarType.FLOAT: - return argType == "number" && !isNaN(arg); - default: - return argType == "number" && Number.isInteger(arg); - } - } - scalars(arg, type, depth, longType) { - if (!Array.isArray(arg)) - return false; - if (depth < 2) - return true; - if (Array.isArray(arg)) { - for (let i = 0; i < arg.length && i < depth; i++) - if (!this.scalar(arg[i], type, longType)) - return false; - } - return true; - } - mapKeys(map, type, depth) { - let keys = Object.keys(map); - switch (type) { - case reflection_info_1.ScalarType.INT32: - case reflection_info_1.ScalarType.FIXED32: - case reflection_info_1.ScalarType.SFIXED32: - case reflection_info_1.ScalarType.SINT32: - case reflection_info_1.ScalarType.UINT32: - return this.scalars(keys.slice(0, depth).map((k) => parseInt(k)), type, depth); - case reflection_info_1.ScalarType.BOOL: - return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type, depth); - default: - return this.scalars(keys, type, depth, reflection_info_1.LongType.STRING); - } - } - }; - exports2.ReflectionTypeCheck = ReflectionTypeCheck; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-long-convert.js -var require_reflection_long_convert = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-long-convert.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionLongConvert = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionLongConvert(long, type) { - switch (type) { - case reflection_info_1.LongType.BIGINT: - return long.toBigInt(); - case reflection_info_1.LongType.NUMBER: - return long.toNumber(); - default: - return long.toString(); - } - } - exports2.reflectionLongConvert = reflectionLongConvert; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-reader.js -var require_reflection_json_reader = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-reader.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ReflectionJsonReader = void 0; - var json_typings_1 = require_json_typings(); - var base64_1 = require_base642(); - var reflection_info_1 = require_reflection_info(); - var pb_long_1 = require_pb_long(); - var assert_1 = require_assert(); - var reflection_long_convert_1 = require_reflection_long_convert(); - var ReflectionJsonReader = class { - constructor(info8) { - this.info = info8; - } - prepare() { - var _a2; - if (this.fMap === void 0) { - this.fMap = {}; - const fieldsInput = (_a2 = this.info.fields) !== null && _a2 !== void 0 ? _a2 : []; - for (const field of fieldsInput) { - this.fMap[field.name] = field; - this.fMap[field.jsonName] = field; - this.fMap[field.localName] = field; - } - } - } - // Cannot parse JSON for #. - assert(condition, fieldName, jsonValue) { - if (!condition) { - let what = json_typings_1.typeofJsonValue(jsonValue); - if (what == "number" || what == "boolean") - what = jsonValue.toString(); - throw new Error(`Cannot parse JSON ${what} for ${this.info.typeName}#${fieldName}`); - } - } - /** - * Reads a message from canonical JSON format into the target message. - * - * Repeated fields are appended. Map entries are added, overwriting - * existing keys. - * - * If a message field is already present, it will be merged with the - * new data. - */ - read(input, message, options) { - this.prepare(); - const oneofsHandled = []; - for (const [jsonKey, jsonValue] of Object.entries(input)) { - const field = this.fMap[jsonKey]; - if (!field) { - if (!options.ignoreUnknownFields) - throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${jsonKey}`); - continue; - } - const localName = field.localName; - let target; - if (field.oneof) { - if (jsonValue === null && (field.kind !== "enum" || field.T()[0] !== "google.protobuf.NullValue")) { - continue; - } - if (oneofsHandled.includes(field.oneof)) - throw new Error(`Multiple members of the oneof group "${field.oneof}" of ${this.info.typeName} are present in JSON.`); - oneofsHandled.push(field.oneof); - target = message[field.oneof] = { - oneofKind: localName - }; - } else { - target = message; - } - if (field.kind == "map") { - if (jsonValue === null) { - continue; - } - this.assert(json_typings_1.isJsonObject(jsonValue), field.name, jsonValue); - const fieldObj = target[localName]; - for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { - this.assert(jsonObjValue !== null, field.name + " map value", null); - let val; - switch (field.V.kind) { - case "message": - val = field.V.T().internalJsonRead(jsonObjValue, options); - break; - case "enum": - val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val === false) - continue; - break; - case "scalar": - val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); - break; - } - this.assert(val !== void 0, field.name + " map value", jsonObjValue); - let key = jsonObjKey; - if (field.K == reflection_info_1.ScalarType.BOOL) - key = key == "true" ? true : key == "false" ? false : key; - key = this.scalar(key, field.K, reflection_info_1.LongType.STRING, field.name).toString(); - fieldObj[key] = val; - } - } else if (field.repeat) { - if (jsonValue === null) - continue; - this.assert(Array.isArray(jsonValue), field.name, jsonValue); - const fieldArr = target[localName]; - for (const jsonItem of jsonValue) { - this.assert(jsonItem !== null, field.name, null); - let val; - switch (field.kind) { - case "message": - val = field.T().internalJsonRead(jsonItem, options); - break; - case "enum": - val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val === false) - continue; - break; - case "scalar": - val = this.scalar(jsonItem, field.T, field.L, field.name); - break; - } - this.assert(val !== void 0, field.name, jsonValue); - fieldArr.push(val); - } - } else { - switch (field.kind) { - case "message": - if (jsonValue === null && field.T().typeName != "google.protobuf.Value") { - this.assert(field.oneof === void 0, field.name + " (oneof member)", null); - continue; - } - target[localName] = field.T().internalJsonRead(jsonValue, options, target[localName]); - break; - case "enum": - if (jsonValue === null) - continue; - let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val === false) - continue; - target[localName] = val; - break; - case "scalar": - if (jsonValue === null) - continue; - target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); - break; - } - } - } - } - /** - * Returns `false` for unrecognized string representations. - * - * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). - */ - enum(type, json, fieldName, ignoreUnknownFields) { - if (type[0] == "google.protobuf.NullValue") - assert_1.assert(json === null || json === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} only accepts null.`); - if (json === null) - return 0; - switch (typeof json) { - case "number": - assert_1.assert(Number.isInteger(json), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json}.`); - return json; - case "string": - let localEnumName = json; - if (type[2] && json.substring(0, type[2].length) === type[2]) - localEnumName = json.substring(type[2].length); - let enumNumber = type[1][localEnumName]; - if (typeof enumNumber === "undefined" && ignoreUnknownFields) { - return false; - } - assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} has no value for "${json}".`); - return enumNumber; - } - assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json}".`); - } - scalar(json, type, longType, fieldName) { - let e; - try { - switch (type) { - // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". - // Either numbers or strings are accepted. Exponent notation is also accepted. - case reflection_info_1.ScalarType.DOUBLE: - case reflection_info_1.ScalarType.FLOAT: - if (json === null) - return 0; - if (json === "NaN") - return Number.NaN; - if (json === "Infinity") - return Number.POSITIVE_INFINITY; - if (json === "-Infinity") - return Number.NEGATIVE_INFINITY; - if (json === "") { - e = "empty string"; - break; - } - if (typeof json == "string" && json.trim().length !== json.length) { - e = "extra whitespace"; - break; - } - if (typeof json != "string" && typeof json != "number") { - break; - } - let float = Number(json); - if (Number.isNaN(float)) { - e = "not a number"; - break; - } - if (!Number.isFinite(float)) { - e = "too large or small"; - break; - } - if (type == reflection_info_1.ScalarType.FLOAT) - assert_1.assertFloat32(float); - return float; - // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.INT32: - case reflection_info_1.ScalarType.FIXED32: - case reflection_info_1.ScalarType.SFIXED32: - case reflection_info_1.ScalarType.SINT32: - case reflection_info_1.ScalarType.UINT32: - if (json === null) - return 0; - let int32; - if (typeof json == "number") - int32 = json; - else if (json === "") - e = "empty string"; - else if (typeof json == "string") { - if (json.trim().length !== json.length) - e = "extra whitespace"; - else - int32 = Number(json); - } - if (int32 === void 0) - break; - if (type == reflection_info_1.ScalarType.UINT32) - assert_1.assertUInt32(int32); - else - assert_1.assertInt32(int32); - return int32; - // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.INT64: - case reflection_info_1.ScalarType.SFIXED64: - case reflection_info_1.ScalarType.SINT64: - if (json === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); - if (typeof json != "number" && typeof json != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json), longType); - case reflection_info_1.ScalarType.FIXED64: - case reflection_info_1.ScalarType.UINT64: - if (json === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); - if (typeof json != "number" && typeof json != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json), longType); - // bool: - case reflection_info_1.ScalarType.BOOL: - if (json === null) - return false; - if (typeof json !== "boolean") - break; - return json; - // string: - case reflection_info_1.ScalarType.STRING: - if (json === null) - return ""; - if (typeof json !== "string") { - e = "extra whitespace"; - break; - } - try { - encodeURIComponent(json); - } catch (e2) { - e2 = "invalid UTF8"; - break; - } - return json; - // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. - // Either standard or URL-safe base64 encoding with/without paddings are accepted. - case reflection_info_1.ScalarType.BYTES: - if (json === null || json === "") - return new Uint8Array(0); - if (typeof json !== "string") - break; - return base64_1.base64decode(json); - } - } catch (error3) { - e = error3.message; - } - this.assert(false, fieldName + (e ? " - " + e : ""), json); - } - }; - exports2.ReflectionJsonReader = ReflectionJsonReader; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-writer.js -var require_reflection_json_writer = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-writer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ReflectionJsonWriter = void 0; - var base64_1 = require_base642(); - var pb_long_1 = require_pb_long(); - var reflection_info_1 = require_reflection_info(); - var assert_1 = require_assert(); - var ReflectionJsonWriter = class { - constructor(info8) { - var _a2; - this.fields = (_a2 = info8.fields) !== null && _a2 !== void 0 ? _a2 : []; - } - /** - * Converts the message to a JSON object, based on the field descriptors. - */ - write(message, options) { - const json = {}, source = message; - for (const field of this.fields) { - if (!field.oneof) { - let jsonValue2 = this.field(field, source[field.localName], options); - if (jsonValue2 !== void 0) - json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue2; - continue; - } - const group = source[field.oneof]; - if (group.oneofKind !== field.localName) - continue; - const opt = field.kind == "scalar" || field.kind == "enum" ? Object.assign(Object.assign({}, options), { emitDefaultValues: true }) : options; - let jsonValue = this.field(field, group[field.localName], opt); - assert_1.assert(jsonValue !== void 0); - json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; - } - return json; - } - field(field, value, options) { - let jsonValue = void 0; - if (field.kind == "map") { - assert_1.assert(typeof value == "object" && value !== null); - const jsonObj = {}; - switch (field.V.kind) { - case "scalar": - for (const [entryKey, entryValue] of Object.entries(value)) { - const val = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val !== void 0); - jsonObj[entryKey.toString()] = val; - } - break; - case "message": - const messageType = field.V.T(); - for (const [entryKey, entryValue] of Object.entries(value)) { - const val = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val !== void 0); - jsonObj[entryKey.toString()] = val; - } - break; - case "enum": - const enumInfo = field.V.T(); - for (const [entryKey, entryValue] of Object.entries(value)) { - assert_1.assert(entryValue === void 0 || typeof entryValue == "number"); - const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val !== void 0); - jsonObj[entryKey.toString()] = val; - } - break; - } - if (options.emitDefaultValues || Object.keys(jsonObj).length > 0) - jsonValue = jsonObj; - } else if (field.repeat) { - assert_1.assert(Array.isArray(value)); - const jsonArr = []; - switch (field.kind) { - case "scalar": - for (let i = 0; i < value.length; i++) { - const val = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val !== void 0); - jsonArr.push(val); - } - break; - case "enum": - const enumInfo = field.T(); - for (let i = 0; i < value.length; i++) { - assert_1.assert(value[i] === void 0 || typeof value[i] == "number"); - const val = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val !== void 0); - jsonArr.push(val); - } - break; - case "message": - const messageType = field.T(); - for (let i = 0; i < value.length; i++) { - const val = this.message(messageType, value[i], field.name, options); - assert_1.assert(val !== void 0); - jsonArr.push(val); - } - break; - } - if (options.emitDefaultValues || jsonArr.length > 0 || options.emitDefaultValues) - jsonValue = jsonArr; - } else { - switch (field.kind) { - case "scalar": - jsonValue = this.scalar(field.T, value, field.name, field.opt, options.emitDefaultValues); - break; - case "enum": - jsonValue = this.enum(field.T(), value, field.name, field.opt, options.emitDefaultValues, options.enumAsInteger); - break; - case "message": - jsonValue = this.message(field.T(), value, field.name, options); - break; - } - } - return jsonValue; - } - /** - * Returns `null` as the default for google.protobuf.NullValue. - */ - enum(type, value, fieldName, optional2, emitDefaultValues, enumAsInteger) { - if (type[0] == "google.protobuf.NullValue") - return !emitDefaultValues && !optional2 ? void 0 : null; - if (value === void 0) { - assert_1.assert(optional2); - return void 0; - } - if (value === 0 && !emitDefaultValues && !optional2) - return void 0; - assert_1.assert(typeof value == "number"); - assert_1.assert(Number.isInteger(value)); - if (enumAsInteger || !type[1].hasOwnProperty(value)) - return value; - if (type[2]) - return type[2] + type[1][value]; - return type[1][value]; - } - message(type, value, fieldName, options) { - if (value === void 0) - return options.emitDefaultValues ? null : void 0; - return type.internalJsonWrite(value, options); - } - scalar(type, value, fieldName, optional2, emitDefaultValues) { - if (value === void 0) { - assert_1.assert(optional2); - return void 0; - } - const ed = emitDefaultValues || optional2; - switch (type) { - // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.INT32: - case reflection_info_1.ScalarType.SFIXED32: - case reflection_info_1.ScalarType.SINT32: - if (value === 0) - return ed ? 0 : void 0; - assert_1.assertInt32(value); - return value; - case reflection_info_1.ScalarType.FIXED32: - case reflection_info_1.ScalarType.UINT32: - if (value === 0) - return ed ? 0 : void 0; - assert_1.assertUInt32(value); - return value; - // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". - // Either numbers or strings are accepted. Exponent notation is also accepted. - case reflection_info_1.ScalarType.FLOAT: - assert_1.assertFloat32(value); - case reflection_info_1.ScalarType.DOUBLE: - if (value === 0) - return ed ? 0 : void 0; - assert_1.assert(typeof value == "number"); - if (Number.isNaN(value)) - return "NaN"; - if (value === Number.POSITIVE_INFINITY) - return "Infinity"; - if (value === Number.NEGATIVE_INFINITY) - return "-Infinity"; - return value; - // string: - case reflection_info_1.ScalarType.STRING: - if (value === "") - return ed ? "" : void 0; - assert_1.assert(typeof value == "string"); - return value; - // bool: - case reflection_info_1.ScalarType.BOOL: - if (value === false) - return ed ? false : void 0; - assert_1.assert(typeof value == "boolean"); - return value; - // JSON value will be a decimal string. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.UINT64: - case reflection_info_1.ScalarType.FIXED64: - assert_1.assert(typeof value == "number" || typeof value == "string" || typeof value == "bigint"); - let ulong = pb_long_1.PbULong.from(value); - if (ulong.isZero() && !ed) - return void 0; - return ulong.toString(); - // JSON value will be a decimal string. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.INT64: - case reflection_info_1.ScalarType.SFIXED64: - case reflection_info_1.ScalarType.SINT64: - assert_1.assert(typeof value == "number" || typeof value == "string" || typeof value == "bigint"); - let long = pb_long_1.PbLong.from(value); - if (long.isZero() && !ed) - return void 0; - return long.toString(); - // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. - // Either standard or URL-safe base64 encoding with/without paddings are accepted. - case reflection_info_1.ScalarType.BYTES: - assert_1.assert(value instanceof Uint8Array); - if (!value.byteLength) - return ed ? "" : void 0; - return base64_1.base64encode(value); - } - } - }; - exports2.ReflectionJsonWriter = ReflectionJsonWriter; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-scalar-default.js -var require_reflection_scalar_default = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-scalar-default.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionScalarDefault = void 0; - var reflection_info_1 = require_reflection_info(); - var reflection_long_convert_1 = require_reflection_long_convert(); - var pb_long_1 = require_pb_long(); - function reflectionScalarDefault(type, longType = reflection_info_1.LongType.STRING) { - switch (type) { - case reflection_info_1.ScalarType.BOOL: - return false; - case reflection_info_1.ScalarType.UINT64: - case reflection_info_1.ScalarType.FIXED64: - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); - case reflection_info_1.ScalarType.INT64: - case reflection_info_1.ScalarType.SFIXED64: - case reflection_info_1.ScalarType.SINT64: - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); - case reflection_info_1.ScalarType.DOUBLE: - case reflection_info_1.ScalarType.FLOAT: - return 0; - case reflection_info_1.ScalarType.BYTES: - return new Uint8Array(0); - case reflection_info_1.ScalarType.STRING: - return ""; - default: - return 0; - } - } - exports2.reflectionScalarDefault = reflectionScalarDefault; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-binary-reader.js -var require_reflection_binary_reader = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-binary-reader.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ReflectionBinaryReader = void 0; - var binary_format_contract_1 = require_binary_format_contract(); - var reflection_info_1 = require_reflection_info(); - var reflection_long_convert_1 = require_reflection_long_convert(); - var reflection_scalar_default_1 = require_reflection_scalar_default(); - var ReflectionBinaryReader = class { - constructor(info8) { - this.info = info8; - } - prepare() { - var _a2; - if (!this.fieldNoToField) { - const fieldsInput = (_a2 = this.info.fields) !== null && _a2 !== void 0 ? _a2 : []; - this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); - } - } - /** - * Reads a message from binary format into the target message. - * - * Repeated fields are appended. Map entries are added, overwriting - * existing keys. - * - * If a message field is already present, it will be merged with the - * new data. - */ - read(reader, message, options, length) { - this.prepare(); - const end = length === void 0 ? reader.len : reader.pos + length; - while (reader.pos < end) { - const [fieldNo, wireType] = reader.tag(), field = this.fieldNoToField.get(fieldNo); - if (!field) { - let u = options.readUnknownField; - if (u == "throw") - throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.info.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? binary_format_contract_1.UnknownFieldHandler.onRead : u)(this.info.typeName, message, fieldNo, wireType, d); - continue; - } - let target = message, repeated = field.repeat, localName = field.localName; - if (field.oneof) { - target = target[field.oneof]; - if (target.oneofKind !== localName) - target = message[field.oneof] = { - oneofKind: localName - }; - } - switch (field.kind) { - case "scalar": - case "enum": - let T = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; - let L = field.kind == "scalar" ? field.L : void 0; - if (repeated) { - let arr = target[localName]; - if (wireType == binary_format_contract_1.WireType.LengthDelimited && T != reflection_info_1.ScalarType.STRING && T != reflection_info_1.ScalarType.BYTES) { - let e = reader.uint32() + reader.pos; - while (reader.pos < e) - arr.push(this.scalar(reader, T, L)); - } else - arr.push(this.scalar(reader, T, L)); - } else - target[localName] = this.scalar(reader, T, L); - break; - case "message": - if (repeated) { - let arr = target[localName]; - let msg = field.T().internalBinaryRead(reader, reader.uint32(), options); - arr.push(msg); - } else - target[localName] = field.T().internalBinaryRead(reader, reader.uint32(), options, target[localName]); - break; - case "map": - let [mapKey, mapVal] = this.mapEntry(field, reader, options); - target[localName][mapKey] = mapVal; - break; - } - } - } - /** - * Read a map field, expecting key field = 1, value field = 2 - */ - mapEntry(field, reader, options) { - let length = reader.uint32(); - let end = reader.pos + length; - let key = void 0; - let val = void 0; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - if (field.K == reflection_info_1.ScalarType.BOOL) - key = reader.bool().toString(); - else - key = this.scalar(reader, field.K, reflection_info_1.LongType.STRING); - break; - case 2: - switch (field.V.kind) { - case "scalar": - val = this.scalar(reader, field.V.T, field.V.L); - break; - case "enum": - val = reader.int32(); - break; - case "message": - val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); - break; - } - break; - default: - throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) in map entry for ${this.info.typeName}#${field.name}`); - } - } - if (key === void 0) { - let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); - key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; - } - if (val === void 0) - switch (field.V.kind) { - case "scalar": - val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); - break; - case "enum": - val = 0; - break; - case "message": - val = field.V.T().create(); - break; - } - return [key, val]; - } - scalar(reader, type, longType) { - switch (type) { - case reflection_info_1.ScalarType.INT32: - return reader.int32(); - case reflection_info_1.ScalarType.STRING: - return reader.string(); - case reflection_info_1.ScalarType.BOOL: - return reader.bool(); - case reflection_info_1.ScalarType.DOUBLE: - return reader.double(); - case reflection_info_1.ScalarType.FLOAT: - return reader.float(); - case reflection_info_1.ScalarType.INT64: - return reflection_long_convert_1.reflectionLongConvert(reader.int64(), longType); - case reflection_info_1.ScalarType.UINT64: - return reflection_long_convert_1.reflectionLongConvert(reader.uint64(), longType); - case reflection_info_1.ScalarType.FIXED64: - return reflection_long_convert_1.reflectionLongConvert(reader.fixed64(), longType); - case reflection_info_1.ScalarType.FIXED32: - return reader.fixed32(); - case reflection_info_1.ScalarType.BYTES: - return reader.bytes(); - case reflection_info_1.ScalarType.UINT32: - return reader.uint32(); - case reflection_info_1.ScalarType.SFIXED32: - return reader.sfixed32(); - case reflection_info_1.ScalarType.SFIXED64: - return reflection_long_convert_1.reflectionLongConvert(reader.sfixed64(), longType); - case reflection_info_1.ScalarType.SINT32: - return reader.sint32(); - case reflection_info_1.ScalarType.SINT64: - return reflection_long_convert_1.reflectionLongConvert(reader.sint64(), longType); - } - } - }; - exports2.ReflectionBinaryReader = ReflectionBinaryReader; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-binary-writer.js -var require_reflection_binary_writer = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-binary-writer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ReflectionBinaryWriter = void 0; - var binary_format_contract_1 = require_binary_format_contract(); - var reflection_info_1 = require_reflection_info(); - var assert_1 = require_assert(); - var pb_long_1 = require_pb_long(); - var ReflectionBinaryWriter = class { - constructor(info8) { - this.info = info8; - } - prepare() { - if (!this.fields) { - const fieldsInput = this.info.fields ? this.info.fields.concat() : []; - this.fields = fieldsInput.sort((a, b) => a.no - b.no); - } - } - /** - * Writes the message to binary format. - */ - write(message, writer, options) { - this.prepare(); - for (const field of this.fields) { - let value, emitDefault, repeated = field.repeat, localName = field.localName; - if (field.oneof) { - const group = message[field.oneof]; - if (group.oneofKind !== localName) - continue; - value = group[localName]; - emitDefault = true; - } else { - value = message[localName]; - emitDefault = false; - } - switch (field.kind) { - case "scalar": - case "enum": - let T = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; - if (repeated) { - assert_1.assert(Array.isArray(value)); - if (repeated == reflection_info_1.RepeatType.PACKED) - this.packed(writer, T, field.no, value); - else - for (const item of value) - this.scalar(writer, T, field.no, item, true); - } else if (value === void 0) - assert_1.assert(field.opt); - else - this.scalar(writer, T, field.no, value, emitDefault || field.opt); - break; - case "message": - if (repeated) { - assert_1.assert(Array.isArray(value)); - for (const item of value) - this.message(writer, options, field.T(), field.no, item); - } else { - this.message(writer, options, field.T(), field.no, value); - } - break; - case "map": - assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val); - break; - } - } - let u = options.writeUnknownFields; - if (u !== false) - (u === true ? binary_format_contract_1.UnknownFieldHandler.onWrite : u)(this.info.typeName, message, writer); - } - mapEntry(writer, options, field, key, value) { - writer.tag(field.no, binary_format_contract_1.WireType.LengthDelimited); - writer.fork(); - let keyValue = key; - switch (field.K) { - case reflection_info_1.ScalarType.INT32: - case reflection_info_1.ScalarType.FIXED32: - case reflection_info_1.ScalarType.UINT32: - case reflection_info_1.ScalarType.SFIXED32: - case reflection_info_1.ScalarType.SINT32: - keyValue = Number.parseInt(key); - break; - case reflection_info_1.ScalarType.BOOL: - assert_1.assert(key == "true" || key == "false"); - keyValue = key == "true"; - break; - } - this.scalar(writer, field.K, 1, keyValue, true); - switch (field.V.kind) { - case "scalar": - this.scalar(writer, field.V.T, 2, value, true); - break; - case "enum": - this.scalar(writer, reflection_info_1.ScalarType.INT32, 2, value, true); - break; - case "message": - this.message(writer, options, field.V.T(), 2, value); - break; - } - writer.join(); - } - message(writer, options, handler2, fieldNo, value) { - if (value === void 0) - return; - handler2.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); - writer.join(); - } - /** - * Write a single scalar value. - */ - scalar(writer, type, fieldNo, value, emitDefault) { - let [wireType, method, isDefault] = this.scalarInfo(type, value); - if (!isDefault || emitDefault) { - writer.tag(fieldNo, wireType); - writer[method](value); - } - } - /** - * Write an array of scalar values in packed format. - */ - packed(writer, type, fieldNo, value) { - if (!value.length) - return; - assert_1.assert(type !== reflection_info_1.ScalarType.BYTES && type !== reflection_info_1.ScalarType.STRING); - writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); - writer.fork(); - let [, method] = this.scalarInfo(type); - for (let i = 0; i < value.length; i++) - writer[method](value[i]); - writer.join(); - } - /** - * Get information for writing a scalar value. - * - * Returns tuple: - * [0]: appropriate WireType - * [1]: name of the appropriate method of IBinaryWriter - * [2]: whether the given value is a default value - * - * If argument `value` is omitted, [2] is always false. - */ - scalarInfo(type, value) { - let t = binary_format_contract_1.WireType.Varint; - let m; - let i = value === void 0; - let d = value === 0; - switch (type) { - case reflection_info_1.ScalarType.INT32: - m = "int32"; - break; - case reflection_info_1.ScalarType.STRING: - d = i || !value.length; - t = binary_format_contract_1.WireType.LengthDelimited; - m = "string"; - break; - case reflection_info_1.ScalarType.BOOL: - d = value === false; - m = "bool"; - break; - case reflection_info_1.ScalarType.UINT32: - m = "uint32"; - break; - case reflection_info_1.ScalarType.DOUBLE: - t = binary_format_contract_1.WireType.Bit64; - m = "double"; - break; - case reflection_info_1.ScalarType.FLOAT: - t = binary_format_contract_1.WireType.Bit32; - m = "float"; - break; - case reflection_info_1.ScalarType.INT64: - d = i || pb_long_1.PbLong.from(value).isZero(); - m = "int64"; - break; - case reflection_info_1.ScalarType.UINT64: - d = i || pb_long_1.PbULong.from(value).isZero(); - m = "uint64"; - break; - case reflection_info_1.ScalarType.FIXED64: - d = i || pb_long_1.PbULong.from(value).isZero(); - t = binary_format_contract_1.WireType.Bit64; - m = "fixed64"; - break; - case reflection_info_1.ScalarType.BYTES: - d = i || !value.byteLength; - t = binary_format_contract_1.WireType.LengthDelimited; - m = "bytes"; - break; - case reflection_info_1.ScalarType.FIXED32: - t = binary_format_contract_1.WireType.Bit32; - m = "fixed32"; - break; - case reflection_info_1.ScalarType.SFIXED32: - t = binary_format_contract_1.WireType.Bit32; - m = "sfixed32"; - break; - case reflection_info_1.ScalarType.SFIXED64: - d = i || pb_long_1.PbLong.from(value).isZero(); - t = binary_format_contract_1.WireType.Bit64; - m = "sfixed64"; - break; - case reflection_info_1.ScalarType.SINT32: - m = "sint32"; - break; - case reflection_info_1.ScalarType.SINT64: - d = i || pb_long_1.PbLong.from(value).isZero(); - m = "sint64"; - break; - } - return [t, m, i || d]; - } - }; - exports2.ReflectionBinaryWriter = ReflectionBinaryWriter; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-create.js -var require_reflection_create = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-create.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionCreate = void 0; - var reflection_scalar_default_1 = require_reflection_scalar_default(); - var message_type_contract_1 = require_message_type_contract(); - function reflectionCreate(type) { - const msg = type.messagePrototype ? Object.create(type.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type }); - for (let field of type.fields) { - let name = field.localName; - if (field.opt) - continue; - if (field.oneof) - msg[field.oneof] = { oneofKind: void 0 }; - else if (field.repeat) - msg[name] = []; - else - switch (field.kind) { - case "scalar": - msg[name] = reflection_scalar_default_1.reflectionScalarDefault(field.T, field.L); - break; - case "enum": - msg[name] = 0; - break; - case "map": - msg[name] = {}; - break; - } - } - return msg; - } - exports2.reflectionCreate = reflectionCreate; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-merge-partial.js -var require_reflection_merge_partial = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-merge-partial.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionMergePartial = void 0; - function reflectionMergePartial(info8, target, source) { - let fieldValue, input = source, output; - for (let field of info8.fields) { - let name = field.localName; - if (field.oneof) { - const group = input[field.oneof]; - if ((group === null || group === void 0 ? void 0 : group.oneofKind) == void 0) { - continue; - } - fieldValue = group[name]; - output = target[field.oneof]; - output.oneofKind = group.oneofKind; - if (fieldValue == void 0) { - delete output[name]; - continue; - } - } else { - fieldValue = input[name]; - output = target; - if (fieldValue == void 0) { - continue; - } - } - if (field.repeat) - output[name].length = fieldValue.length; - switch (field.kind) { - case "scalar": - case "enum": - if (field.repeat) - for (let i = 0; i < fieldValue.length; i++) - output[name][i] = fieldValue[i]; - else - output[name] = fieldValue; - break; - case "message": - let T = field.T(); - if (field.repeat) - for (let i = 0; i < fieldValue.length; i++) - output[name][i] = T.create(fieldValue[i]); - else if (output[name] === void 0) - output[name] = T.create(fieldValue); - else - T.mergePartial(output[name], fieldValue); - break; - case "map": - switch (field.V.kind) { - case "scalar": - case "enum": - Object.assign(output[name], fieldValue); - break; - case "message": - let T2 = field.V.T(); - for (let k of Object.keys(fieldValue)) - output[name][k] = T2.create(fieldValue[k]); - break; - } - break; - } - } - } - exports2.reflectionMergePartial = reflectionMergePartial; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-equals.js -var require_reflection_equals = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-equals.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionEquals = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionEquals(info8, a, b) { - if (a === b) - return true; - if (!a || !b) - return false; - for (let field of info8.fields) { - let localName = field.localName; - let val_a = field.oneof ? a[field.oneof][localName] : a[localName]; - let val_b = field.oneof ? b[field.oneof][localName] : b[localName]; - switch (field.kind) { - case "enum": - case "scalar": - let t = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; - if (!(field.repeat ? repeatedPrimitiveEq(t, val_a, val_b) : primitiveEq(t, val_a, val_b))) - return false; - break; - case "map": - if (!(field.V.kind == "message" ? repeatedMsgEq(field.V.T(), objectValues(val_a), objectValues(val_b)) : repeatedPrimitiveEq(field.V.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.V.T, objectValues(val_a), objectValues(val_b)))) - return false; - break; - case "message": - let T = field.T(); - if (!(field.repeat ? repeatedMsgEq(T, val_a, val_b) : T.equals(val_a, val_b))) - return false; - break; - } - } - return true; - } - exports2.reflectionEquals = reflectionEquals; - var objectValues = Object.values; - function primitiveEq(type, a, b) { - if (a === b) - return true; - if (type !== reflection_info_1.ScalarType.BYTES) - return false; - let ba = a; - let bb = b; - if (ba.length !== bb.length) - return false; - for (let i = 0; i < ba.length; i++) - if (ba[i] != bb[i]) - return false; - return true; - } - function repeatedPrimitiveEq(type, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!primitiveEq(type, a[i], b[i])) - return false; - return true; - } - function repeatedMsgEq(type, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!type.equals(a[i], b[i])) - return false; - return true; - } - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js -var require_message_type = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MessageType = void 0; - var message_type_contract_1 = require_message_type_contract(); - var reflection_info_1 = require_reflection_info(); - var reflection_type_check_1 = require_reflection_type_check(); - var reflection_json_reader_1 = require_reflection_json_reader(); - var reflection_json_writer_1 = require_reflection_json_writer(); - var reflection_binary_reader_1 = require_reflection_binary_reader(); - var reflection_binary_writer_1 = require_reflection_binary_writer(); - var reflection_create_1 = require_reflection_create(); - var reflection_merge_partial_1 = require_reflection_merge_partial(); - var json_typings_1 = require_json_typings(); - var json_format_contract_1 = require_json_format_contract(); - var reflection_equals_1 = require_reflection_equals(); - var binary_writer_1 = require_binary_writer(); - var binary_reader_1 = require_binary_reader(); - var baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})); - var messageTypeDescriptor = baseDescriptors[message_type_contract_1.MESSAGE_TYPE] = {}; - var MessageType = class { - constructor(name, fields, options) { - this.defaultCheckDepth = 16; - this.typeName = name; - this.fields = fields.map(reflection_info_1.normalizeFieldInfo); - this.options = options !== null && options !== void 0 ? options : {}; - messageTypeDescriptor.value = this; - this.messagePrototype = Object.create(null, baseDescriptors); - this.refTypeCheck = new reflection_type_check_1.ReflectionTypeCheck(this); - this.refJsonReader = new reflection_json_reader_1.ReflectionJsonReader(this); - this.refJsonWriter = new reflection_json_writer_1.ReflectionJsonWriter(this); - this.refBinReader = new reflection_binary_reader_1.ReflectionBinaryReader(this); - this.refBinWriter = new reflection_binary_writer_1.ReflectionBinaryWriter(this); - } - create(value) { - let message = reflection_create_1.reflectionCreate(this); - if (value !== void 0) { - reflection_merge_partial_1.reflectionMergePartial(this, message, value); - } - return message; - } - /** - * Clone the message. - * - * Unknown fields are discarded. - */ - clone(message) { - let copy = this.create(); - reflection_merge_partial_1.reflectionMergePartial(this, copy, message); - return copy; - } - /** - * Determines whether two message of the same type have the same field values. - * Checks for deep equality, traversing repeated fields, oneof groups, maps - * and messages recursively. - * Will also return true if both messages are `undefined`. - */ - equals(a, b) { - return reflection_equals_1.reflectionEquals(this, a, b); - } - /** - * Is the given value assignable to our message type - * and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? - */ - is(arg, depth = this.defaultCheckDepth) { - return this.refTypeCheck.is(arg, depth, false); - } - /** - * Is the given value assignable to our message type, - * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? - */ - isAssignable(arg, depth = this.defaultCheckDepth) { - return this.refTypeCheck.is(arg, depth, true); - } - /** - * Copy partial data into the target message. - */ - mergePartial(target, source) { - reflection_merge_partial_1.reflectionMergePartial(this, target, source); - } - /** - * Create a new message from binary format. - */ - fromBinary(data, options) { - let opt = binary_reader_1.binaryReadOptions(options); - return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt); - } - /** - * Read a new message from a JSON value. - */ - fromJson(json, options) { - return this.internalJsonRead(json, json_format_contract_1.jsonReadOptions(options)); - } - /** - * Read a new message from a JSON string. - * This is equivalent to `T.fromJson(JSON.parse(json))`. - */ - fromJsonString(json, options) { - let value = JSON.parse(json); - return this.fromJson(value, options); - } - /** - * Write the message to canonical JSON value. - */ - toJson(message, options) { - return this.internalJsonWrite(message, json_format_contract_1.jsonWriteOptions(options)); - } - /** - * Convert the message to canonical JSON string. - * This is equivalent to `JSON.stringify(T.toJson(t))` - */ - toJsonString(message, options) { - var _a2; - let value = this.toJson(message, options); - return JSON.stringify(value, null, (_a2 = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a2 !== void 0 ? _a2 : 0); - } - /** - * Write the message to binary format. - */ - toBinary(message, options) { - let opt = binary_writer_1.binaryWriteOptions(options); - return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish(); - } - /** - * This is an internal method. If you just want to read a message from - * JSON, use `fromJson()` or `fromJsonString()`. - * - * Reads JSON value and merges the fields into the target - * according to protobuf rules. If the target is omitted, - * a new instance is created first. - */ - internalJsonRead(json, options, target) { - if (json !== null && typeof json == "object" && !Array.isArray(json)) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refJsonReader.read(json, message, options); - return message; - } - throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json)}.`); - } - /** - * This is an internal method. If you just want to write a message - * to JSON, use `toJson()` or `toJsonString(). - * - * Writes JSON value and returns it. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.write(message, options); - } - /** - * This is an internal method. If you just want to write a message - * in binary format, use `toBinary()`. - * - * Serializes the message in binary format and appends it to the given - * writer. Returns passed writer. - */ - internalBinaryWrite(message, writer, options) { - this.refBinWriter.write(message, writer, options); - return writer; - } - /** - * This is an internal method. If you just want to read a message from - * binary data, use `fromBinary()`. - * - * Reads data from binary format and merges the fields into - * the target according to protobuf rules. If the target is - * omitted, a new instance is created first. - */ - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refBinReader.read(reader, message, options, length); - return message; - } - }; - exports2.MessageType = MessageType; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/reflection-contains-message-type.js -var require_reflection_contains_message_type = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-contains-message-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.containsMessageType = void 0; - var message_type_contract_1 = require_message_type_contract(); - function containsMessageType(msg) { - return msg[message_type_contract_1.MESSAGE_TYPE] != null; - } - exports2.containsMessageType = containsMessageType; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/enum-object.js -var require_enum_object = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/enum-object.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.listEnumNumbers = exports2.listEnumNames = exports2.listEnumValues = exports2.isEnumObject = void 0; - function isEnumObject(arg) { - if (typeof arg != "object" || arg === null) { - return false; - } - if (!arg.hasOwnProperty(0)) { - return false; - } - for (let k of Object.keys(arg)) { - let num = parseInt(k); - if (!Number.isNaN(num)) { - let nam = arg[num]; - if (nam === void 0) - return false; - if (arg[nam] !== num) - return false; - } else { - let num2 = arg[k]; - if (num2 === void 0) - return false; - if (typeof num2 !== "number") - return false; - if (arg[num2] === void 0) - return false; - } - } - return true; - } - exports2.isEnumObject = isEnumObject; - function listEnumValues(enumObject) { - if (!isEnumObject(enumObject)) - throw new Error("not a typescript enum object"); - let values = []; - for (let [name, number2] of Object.entries(enumObject)) - if (typeof number2 == "number") - values.push({ name, number: number2 }); - return values; - } - exports2.listEnumValues = listEnumValues; - function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val) => val.name); - } - exports2.listEnumNames = listEnumNames; - function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val) => val.number).filter((num, index2, arr) => arr.indexOf(num) == index2); - } - exports2.listEnumNumbers = listEnumNumbers; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs16 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var json_typings_1 = require_json_typings(); - Object.defineProperty(exports2, "typeofJsonValue", { enumerable: true, get: function() { - return json_typings_1.typeofJsonValue; - } }); - Object.defineProperty(exports2, "isJsonObject", { enumerable: true, get: function() { - return json_typings_1.isJsonObject; - } }); - var base64_1 = require_base642(); - Object.defineProperty(exports2, "base64decode", { enumerable: true, get: function() { - return base64_1.base64decode; - } }); - Object.defineProperty(exports2, "base64encode", { enumerable: true, get: function() { - return base64_1.base64encode; - } }); - var protobufjs_utf8_1 = require_protobufjs_utf8(); - Object.defineProperty(exports2, "utf8read", { enumerable: true, get: function() { - return protobufjs_utf8_1.utf8read; - } }); - var binary_format_contract_1 = require_binary_format_contract(); - Object.defineProperty(exports2, "WireType", { enumerable: true, get: function() { - return binary_format_contract_1.WireType; - } }); - Object.defineProperty(exports2, "mergeBinaryOptions", { enumerable: true, get: function() { - return binary_format_contract_1.mergeBinaryOptions; - } }); - Object.defineProperty(exports2, "UnknownFieldHandler", { enumerable: true, get: function() { - return binary_format_contract_1.UnknownFieldHandler; - } }); - var binary_reader_1 = require_binary_reader(); - Object.defineProperty(exports2, "BinaryReader", { enumerable: true, get: function() { - return binary_reader_1.BinaryReader; - } }); - Object.defineProperty(exports2, "binaryReadOptions", { enumerable: true, get: function() { - return binary_reader_1.binaryReadOptions; - } }); - var binary_writer_1 = require_binary_writer(); - Object.defineProperty(exports2, "BinaryWriter", { enumerable: true, get: function() { - return binary_writer_1.BinaryWriter; - } }); - Object.defineProperty(exports2, "binaryWriteOptions", { enumerable: true, get: function() { - return binary_writer_1.binaryWriteOptions; - } }); - var pb_long_1 = require_pb_long(); - Object.defineProperty(exports2, "PbLong", { enumerable: true, get: function() { - return pb_long_1.PbLong; - } }); - Object.defineProperty(exports2, "PbULong", { enumerable: true, get: function() { - return pb_long_1.PbULong; - } }); - var json_format_contract_1 = require_json_format_contract(); - Object.defineProperty(exports2, "jsonReadOptions", { enumerable: true, get: function() { - return json_format_contract_1.jsonReadOptions; - } }); - Object.defineProperty(exports2, "jsonWriteOptions", { enumerable: true, get: function() { - return json_format_contract_1.jsonWriteOptions; - } }); - Object.defineProperty(exports2, "mergeJsonOptions", { enumerable: true, get: function() { - return json_format_contract_1.mergeJsonOptions; - } }); - var message_type_contract_1 = require_message_type_contract(); - Object.defineProperty(exports2, "MESSAGE_TYPE", { enumerable: true, get: function() { - return message_type_contract_1.MESSAGE_TYPE; - } }); - var message_type_1 = require_message_type(); - Object.defineProperty(exports2, "MessageType", { enumerable: true, get: function() { - return message_type_1.MessageType; - } }); - var reflection_info_1 = require_reflection_info(); - Object.defineProperty(exports2, "ScalarType", { enumerable: true, get: function() { - return reflection_info_1.ScalarType; - } }); - Object.defineProperty(exports2, "LongType", { enumerable: true, get: function() { - return reflection_info_1.LongType; - } }); - Object.defineProperty(exports2, "RepeatType", { enumerable: true, get: function() { - return reflection_info_1.RepeatType; - } }); - Object.defineProperty(exports2, "normalizeFieldInfo", { enumerable: true, get: function() { - return reflection_info_1.normalizeFieldInfo; - } }); - Object.defineProperty(exports2, "readFieldOptions", { enumerable: true, get: function() { - return reflection_info_1.readFieldOptions; - } }); - Object.defineProperty(exports2, "readFieldOption", { enumerable: true, get: function() { - return reflection_info_1.readFieldOption; - } }); - Object.defineProperty(exports2, "readMessageOption", { enumerable: true, get: function() { - return reflection_info_1.readMessageOption; - } }); - var reflection_type_check_1 = require_reflection_type_check(); - Object.defineProperty(exports2, "ReflectionTypeCheck", { enumerable: true, get: function() { - return reflection_type_check_1.ReflectionTypeCheck; - } }); - var reflection_create_1 = require_reflection_create(); - Object.defineProperty(exports2, "reflectionCreate", { enumerable: true, get: function() { - return reflection_create_1.reflectionCreate; - } }); - var reflection_scalar_default_1 = require_reflection_scalar_default(); - Object.defineProperty(exports2, "reflectionScalarDefault", { enumerable: true, get: function() { - return reflection_scalar_default_1.reflectionScalarDefault; - } }); - var reflection_merge_partial_1 = require_reflection_merge_partial(); - Object.defineProperty(exports2, "reflectionMergePartial", { enumerable: true, get: function() { - return reflection_merge_partial_1.reflectionMergePartial; - } }); - var reflection_equals_1 = require_reflection_equals(); - Object.defineProperty(exports2, "reflectionEquals", { enumerable: true, get: function() { - return reflection_equals_1.reflectionEquals; - } }); - var reflection_binary_reader_1 = require_reflection_binary_reader(); - Object.defineProperty(exports2, "ReflectionBinaryReader", { enumerable: true, get: function() { - return reflection_binary_reader_1.ReflectionBinaryReader; - } }); - var reflection_binary_writer_1 = require_reflection_binary_writer(); - Object.defineProperty(exports2, "ReflectionBinaryWriter", { enumerable: true, get: function() { - return reflection_binary_writer_1.ReflectionBinaryWriter; - } }); - var reflection_json_reader_1 = require_reflection_json_reader(); - Object.defineProperty(exports2, "ReflectionJsonReader", { enumerable: true, get: function() { - return reflection_json_reader_1.ReflectionJsonReader; - } }); - var reflection_json_writer_1 = require_reflection_json_writer(); - Object.defineProperty(exports2, "ReflectionJsonWriter", { enumerable: true, get: function() { - return reflection_json_writer_1.ReflectionJsonWriter; - } }); - var reflection_contains_message_type_1 = require_reflection_contains_message_type(); - Object.defineProperty(exports2, "containsMessageType", { enumerable: true, get: function() { - return reflection_contains_message_type_1.containsMessageType; - } }); - var oneof_1 = require_oneof(); - Object.defineProperty(exports2, "isOneofGroup", { enumerable: true, get: function() { - return oneof_1.isOneofGroup; - } }); - Object.defineProperty(exports2, "setOneofValue", { enumerable: true, get: function() { - return oneof_1.setOneofValue; - } }); - Object.defineProperty(exports2, "getOneofValue", { enumerable: true, get: function() { - return oneof_1.getOneofValue; - } }); - Object.defineProperty(exports2, "clearOneofValue", { enumerable: true, get: function() { - return oneof_1.clearOneofValue; - } }); - Object.defineProperty(exports2, "getSelectedOneofValue", { enumerable: true, get: function() { - return oneof_1.getSelectedOneofValue; - } }); - var enum_object_1 = require_enum_object(); - Object.defineProperty(exports2, "listEnumValues", { enumerable: true, get: function() { - return enum_object_1.listEnumValues; - } }); - Object.defineProperty(exports2, "listEnumNames", { enumerable: true, get: function() { - return enum_object_1.listEnumNames; - } }); - Object.defineProperty(exports2, "listEnumNumbers", { enumerable: true, get: function() { - return enum_object_1.listEnumNumbers; - } }); - Object.defineProperty(exports2, "isEnumObject", { enumerable: true, get: function() { - return enum_object_1.isEnumObject; - } }); - var lower_camel_case_1 = require_lower_camel_case(); - Object.defineProperty(exports2, "lowerCamelCase", { enumerable: true, get: function() { - return lower_camel_case_1.lowerCamelCase; - } }); - var assert_1 = require_assert(); - Object.defineProperty(exports2, "assert", { enumerable: true, get: function() { - return assert_1.assert; - } }); - Object.defineProperty(exports2, "assertNever", { enumerable: true, get: function() { - return assert_1.assertNever; - } }); - Object.defineProperty(exports2, "assertInt32", { enumerable: true, get: function() { - return assert_1.assertInt32; - } }); - Object.defineProperty(exports2, "assertUInt32", { enumerable: true, get: function() { - return assert_1.assertUInt32; - } }); - Object.defineProperty(exports2, "assertFloat32", { enumerable: true, get: function() { - return assert_1.assertFloat32; - } }); - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/reflection-info.js -var require_reflection_info2 = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/reflection-info.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs16(); - function normalizeMethodInfo(method, service) { - var _a2, _b, _c; - let m = method; - m.service = service; - m.localName = (_a2 = m.localName) !== null && _a2 !== void 0 ? _a2 : runtime_1.lowerCamelCase(m.name); - m.serverStreaming = !!m.serverStreaming; - m.clientStreaming = !!m.clientStreaming; - m.options = (_b = m.options) !== null && _b !== void 0 ? _b : {}; - m.idempotency = (_c = m.idempotency) !== null && _c !== void 0 ? _c : void 0; - return m; - } - exports2.normalizeMethodInfo = normalizeMethodInfo; - function readMethodOptions(service, methodName, extensionName, extensionType) { - var _a2; - const options = (_a2 = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a2 === void 0 ? void 0 : _a2.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readMethodOptions = readMethodOptions; - function readMethodOption(service, methodName, extensionName, extensionType) { - var _a2; - const options = (_a2 = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a2 === void 0 ? void 0 : _a2.options; - if (!options) { - return void 0; - } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; - } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; - } - exports2.readMethodOption = readMethodOption; - function readServiceOption(service, extensionName, extensionType) { - const options = service.options; - if (!options) { - return void 0; - } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; - } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; - } - exports2.readServiceOption = readServiceOption; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/service-type.js -var require_service_type = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/service-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ServiceType = void 0; - var reflection_info_1 = require_reflection_info2(); - var ServiceType = class { - constructor(typeName, methods, options) { - this.typeName = typeName; - this.methods = methods.map((i) => reflection_info_1.normalizeMethodInfo(i, this)); - this.options = options !== null && options !== void 0 ? options : {}; - } - }; - exports2.ServiceType = ServiceType; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/rpc-error.js -var require_rpc_error = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/rpc-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RpcError = void 0; - var RpcError = class extends Error { - constructor(message, code = "UNKNOWN", meta) { - super(message); - this.name = "RpcError"; - Object.setPrototypeOf(this, new.target.prototype); - this.code = code; - this.meta = meta !== null && meta !== void 0 ? meta : {}; - } - toString() { - const l = [this.name + ": " + this.message]; - if (this.code) { - l.push(""); - l.push("Code: " + this.code); - } - if (this.serviceName && this.methodName) { - l.push("Method: " + this.serviceName + "/" + this.methodName); - } - let m = Object.entries(this.meta); - if (m.length) { - l.push(""); - l.push("Meta:"); - for (let [k, v] of m) { - l.push(` ${k}: ${v}`); - } - } - return l.join("\n"); - } - }; - exports2.RpcError = RpcError; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/rpc-options.js -var require_rpc_options = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/rpc-options.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs16(); - function mergeRpcOptions(defaults3, options) { - if (!options) - return defaults3; - let o = {}; - copy(defaults3, o); - copy(options, o); - for (let key of Object.keys(options)) { - let val = options[key]; - switch (key) { - case "jsonOptions": - o.jsonOptions = runtime_1.mergeJsonOptions(defaults3.jsonOptions, o.jsonOptions); - break; - case "binaryOptions": - o.binaryOptions = runtime_1.mergeBinaryOptions(defaults3.binaryOptions, o.binaryOptions); - break; - case "meta": - o.meta = {}; - copy(defaults3.meta, o.meta); - copy(options.meta, o.meta); - break; - case "interceptors": - o.interceptors = defaults3.interceptors ? defaults3.interceptors.concat(val) : val.concat(); - break; - } - } - return o; - } - exports2.mergeRpcOptions = mergeRpcOptions; - function copy(a, into) { - if (!a) - return; - let c = into; - for (let [k, v] of Object.entries(a)) { - if (v instanceof Date) - c[k] = new Date(v.getTime()); - else if (Array.isArray(v)) - c[k] = v.concat(); - else - c[k] = v; - } - } - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/deferred.js -var require_deferred = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/deferred.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Deferred = exports2.DeferredState = void 0; - var DeferredState; - (function(DeferredState2) { - DeferredState2[DeferredState2["PENDING"] = 0] = "PENDING"; - DeferredState2[DeferredState2["REJECTED"] = 1] = "REJECTED"; - DeferredState2[DeferredState2["RESOLVED"] = 2] = "RESOLVED"; - })(DeferredState = exports2.DeferredState || (exports2.DeferredState = {})); - var Deferred = class { - /** - * @param preventUnhandledRejectionWarning - prevents the warning - * "Unhandled Promise rejection" by adding a noop rejection handler. - * Working with calls returned from the runtime-rpc package in an - * async function usually means awaiting one call property after - * the other. This means that the "status" is not being awaited when - * an earlier await for the "headers" is rejected. This causes the - * "unhandled promise reject" warning. A more correct behaviour for - * calls might be to become aware whether at least one of the - * promises is handled and swallow the rejection warning for the - * others. - */ - constructor(preventUnhandledRejectionWarning = true) { - this._state = DeferredState.PENDING; - this._promise = new Promise((resolve14, reject) => { - this._resolve = resolve14; - this._reject = reject; - }); - if (preventUnhandledRejectionWarning) { - this._promise.catch((_2) => { - }); - } - } - /** - * Get the current state of the promise. - */ - get state() { - return this._state; - } - /** - * Get the deferred promise. - */ - get promise() { - return this._promise; - } - /** - * Resolve the promise. Throws if the promise is already resolved or rejected. - */ - resolve(value) { - if (this.state !== DeferredState.PENDING) - throw new Error(`cannot resolve ${DeferredState[this.state].toLowerCase()}`); - this._resolve(value); - this._state = DeferredState.RESOLVED; - } - /** - * Reject the promise. Throws if the promise is already resolved or rejected. - */ - reject(reason) { - if (this.state !== DeferredState.PENDING) - throw new Error(`cannot reject ${DeferredState[this.state].toLowerCase()}`); - this._reject(reason); - this._state = DeferredState.REJECTED; - } - /** - * Resolve the promise. Ignore if not pending. - */ - resolvePending(val) { - if (this._state === DeferredState.PENDING) - this.resolve(val); - } - /** - * Reject the promise. Ignore if not pending. - */ - rejectPending(reason) { - if (this._state === DeferredState.PENDING) - this.reject(reason); - } - }; - exports2.Deferred = Deferred; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/rpc-output-stream.js -var require_rpc_output_stream = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/rpc-output-stream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RpcOutputStreamController = void 0; - var deferred_1 = require_deferred(); - var runtime_1 = require_commonjs16(); - var RpcOutputStreamController = class { - constructor() { - this._lis = { - nxt: [], - msg: [], - err: [], - cmp: [] - }; - this._closed = false; - this._itState = { q: [] }; - } - // --- RpcOutputStream callback API - onNext(callback) { - return this.addLis(callback, this._lis.nxt); - } - onMessage(callback) { - return this.addLis(callback, this._lis.msg); - } - onError(callback) { - return this.addLis(callback, this._lis.err); - } - onComplete(callback) { - return this.addLis(callback, this._lis.cmp); - } - addLis(callback, list) { - list.push(callback); - return () => { - let i = list.indexOf(callback); - if (i >= 0) - list.splice(i, 1); - }; - } - // remove all listeners - clearLis() { - for (let l of Object.values(this._lis)) - l.splice(0, l.length); - } - // --- Controller API - /** - * Is this stream already closed by a completion or error? - */ - get closed() { - return this._closed !== false; - } - /** - * Emit message, close with error, or close successfully, but only one - * at a time. - * Can be used to wrap a stream by using the other stream's `onNext`. - */ - notifyNext(message, error3, complete) { - runtime_1.assert((message ? 1 : 0) + (error3 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); - if (message) - this.notifyMessage(message); - if (error3) - this.notifyError(error3); - if (complete) - this.notifyComplete(); - } - /** - * Emits a new message. Throws if stream is closed. - * - * Triggers onNext and onMessage callbacks. - */ - notifyMessage(message) { - runtime_1.assert(!this.closed, "stream is closed"); - this.pushIt({ value: message, done: false }); - this._lis.msg.forEach((l) => l(message)); - this._lis.nxt.forEach((l) => l(message, void 0, false)); - } - /** - * Closes the stream with an error. Throws if stream is closed. - * - * Triggers onNext and onError callbacks. - */ - notifyError(error3) { - runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error3; - this.pushIt(error3); - this._lis.err.forEach((l) => l(error3)); - this._lis.nxt.forEach((l) => l(void 0, error3, false)); - this.clearLis(); - } - /** - * Closes the stream successfully. Throws if stream is closed. - * - * Triggers onNext and onComplete callbacks. - */ - notifyComplete() { - runtime_1.assert(!this.closed, "stream is closed"); - this._closed = true; - this.pushIt({ value: null, done: true }); - this._lis.cmp.forEach((l) => l()); - this._lis.nxt.forEach((l) => l(void 0, void 0, true)); - this.clearLis(); - } - /** - * Creates an async iterator (that can be used with `for await {...}`) - * to consume the stream. - * - * Some things to note: - * - If an error occurs, the `for await` will throw it. - * - If an error occurred before the `for await` was started, `for await` - * will re-throw it. - * - If the stream is already complete, the `for await` will be empty. - * - If your `for await` consumes slower than the stream produces, - * for example because you are relaying messages in a slow operation, - * messages are queued. - */ - [Symbol.asyncIterator]() { - if (this._closed === true) - this.pushIt({ value: null, done: true }); - else if (this._closed !== false) - this.pushIt(this._closed); - return { - next: () => { - let state = this._itState; - runtime_1.assert(state, "bad state"); - runtime_1.assert(!state.p, "iterator contract broken"); - let first = state.q.shift(); - if (first) - return "value" in first ? Promise.resolve(first) : Promise.reject(first); - state.p = new deferred_1.Deferred(); - return state.p.promise; - } - }; - } - // "push" a new iterator result. - // this either resolves a pending promise, or enqueues the result. - pushIt(result) { - let state = this._itState; - if (state.p) { - const p = state.p; - runtime_1.assert(p.state == deferred_1.DeferredState.PENDING, "iterator contract broken"); - "value" in result ? p.resolve(result) : p.reject(result); - delete state.p; - } else { - state.q.push(result); - } - } - }; - exports2.RpcOutputStreamController = RpcOutputStreamController; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/unary-call.js -var require_unary_call = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/unary-call.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UnaryCall = void 0; - var UnaryCall = class { - constructor(method, requestHeaders, request3, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request3; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; - } - /** - * If you are only interested in the final outcome of this call, - * you can await it to receive a `FinishedUnaryCall`. - */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); - } - promiseFinished() { - return __awaiter2(this, void 0, void 0, function* () { - let [headers, response, status, trailers] = yield Promise.all([this.headers, this.response, this.status, this.trailers]); - return { - method: this.method, - requestHeaders: this.requestHeaders, - request: this.request, - headers, - response, - status, - trailers - }; - }); - } - }; - exports2.UnaryCall = UnaryCall; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js -var require_server_streaming_call = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ServerStreamingCall = void 0; - var ServerStreamingCall = class { - constructor(method, requestHeaders, request3, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request3; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; - } - /** - * Instead of awaiting the response status and trailers, you can - * just as well await this call itself to receive the server outcome. - * You should first setup some listeners to the `request` to - * see the actual messages the server replied with. - */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); - } - promiseFinished() { - return __awaiter2(this, void 0, void 0, function* () { - let [headers, status, trailers] = yield Promise.all([this.headers, this.status, this.trailers]); - return { - method: this.method, - requestHeaders: this.requestHeaders, - request: this.request, - headers, - status, - trailers - }; - }); - } - }; - exports2.ServerStreamingCall = ServerStreamingCall; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/client-streaming-call.js -var require_client_streaming_call = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/client-streaming-call.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ClientStreamingCall = void 0; - var ClientStreamingCall = class { - constructor(method, requestHeaders, request3, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request3; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; - } - /** - * Instead of awaiting the response status and trailers, you can - * just as well await this call itself to receive the server outcome. - * Note that it may still be valid to send more request messages. - */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); - } - promiseFinished() { - return __awaiter2(this, void 0, void 0, function* () { - let [headers, response, status, trailers] = yield Promise.all([this.headers, this.response, this.status, this.trailers]); - return { - method: this.method, - requestHeaders: this.requestHeaders, - headers, - response, - status, - trailers - }; - }); - } - }; - exports2.ClientStreamingCall = ClientStreamingCall; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/duplex-streaming-call.js -var require_duplex_streaming_call = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/duplex-streaming-call.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DuplexStreamingCall = void 0; - var DuplexStreamingCall = class { - constructor(method, requestHeaders, request3, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request3; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; - } - /** - * Instead of awaiting the response status and trailers, you can - * just as well await this call itself to receive the server outcome. - * Note that it may still be valid to send more request messages. - */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); - } - promiseFinished() { - return __awaiter2(this, void 0, void 0, function* () { - let [headers, status, trailers] = yield Promise.all([this.headers, this.status, this.trailers]); - return { - method: this.method, - requestHeaders: this.requestHeaders, - headers, - status, - trailers - }; - }); - } - }; - exports2.DuplexStreamingCall = DuplexStreamingCall; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/test-transport.js -var require_test_transport = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/test-transport.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TestTransport = void 0; - var rpc_error_1 = require_rpc_error(); - var runtime_1 = require_commonjs16(); - var rpc_output_stream_1 = require_rpc_output_stream(); - var rpc_options_1 = require_rpc_options(); - var unary_call_1 = require_unary_call(); - var server_streaming_call_1 = require_server_streaming_call(); - var client_streaming_call_1 = require_client_streaming_call(); - var duplex_streaming_call_1 = require_duplex_streaming_call(); - var TestTransport = class _TestTransport { - /** - * Initialize with mock data. Omitted fields have default value. - */ - constructor(data) { - this.suppressUncaughtRejections = true; - this.headerDelay = 10; - this.responseDelay = 50; - this.betweenResponseDelay = 10; - this.afterResponseDelay = 10; - this.data = data !== null && data !== void 0 ? data : {}; - } - /** - * Sent message(s) during the last operation. - */ - get sentMessages() { - if (this.lastInput instanceof TestInputStream) { - return this.lastInput.sent; - } else if (typeof this.lastInput == "object") { - return [this.lastInput.single]; - } - return []; - } - /** - * Sending message(s) completed? - */ - get sendComplete() { - if (this.lastInput instanceof TestInputStream) { - return this.lastInput.completed; - } else if (typeof this.lastInput == "object") { - return true; - } - return false; - } - // Creates a promise for response headers from the mock data. - promiseHeaders() { - var _a2; - const headers = (_a2 = this.data.headers) !== null && _a2 !== void 0 ? _a2 : _TestTransport.defaultHeaders; - return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); - } - // Creates a promise for a single, valid, message from the mock data. - promiseSingleResponse(method) { - if (this.data.response instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.response); - } - let r; - if (Array.isArray(this.data.response)) { - runtime_1.assert(this.data.response.length > 0); - r = this.data.response[0]; - } else if (this.data.response !== void 0) { - r = this.data.response; - } else { - r = method.O.create(); - } - runtime_1.assert(method.O.is(r)); - return Promise.resolve(r); - } - /** - * Pushes response messages from the mock data to the output stream. - * If an error response, status or trailers are mocked, the stream is - * closed with the respective error. - * Otherwise, stream is completed successfully. - * - * The returned promise resolves when the stream is closed. It should - * not reject. If it does, code is broken. - */ - streamResponses(method, stream2, abort) { - return __awaiter2(this, void 0, void 0, function* () { - const messages = []; - if (this.data.response === void 0) { - messages.push(method.O.create()); - } else if (Array.isArray(this.data.response)) { - for (let msg of this.data.response) { - runtime_1.assert(method.O.is(msg)); - messages.push(msg); - } - } else if (!(this.data.response instanceof rpc_error_1.RpcError)) { - runtime_1.assert(method.O.is(this.data.response)); - messages.push(this.data.response); - } - try { - yield delay2(this.responseDelay, abort)(void 0); - } catch (error3) { - stream2.notifyError(error3); - return; - } - if (this.data.response instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.response); - return; - } - for (let msg of messages) { - stream2.notifyMessage(msg); - try { - yield delay2(this.betweenResponseDelay, abort)(void 0); - } catch (error3) { - stream2.notifyError(error3); - return; - } - } - if (this.data.status instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.status); - return; - } - if (this.data.trailers instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.trailers); - return; - } - stream2.notifyComplete(); - }); - } - // Creates a promise for response status from the mock data. - promiseStatus() { - var _a2; - const status = (_a2 = this.data.status) !== null && _a2 !== void 0 ? _a2 : _TestTransport.defaultStatus; - return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); - } - // Creates a promise for response trailers from the mock data. - promiseTrailers() { - var _a2; - const trailers = (_a2 = this.data.trailers) !== null && _a2 !== void 0 ? _a2 : _TestTransport.defaultTrailers; - return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); - } - maybeSuppressUncaught(...promise) { - if (this.suppressUncaughtRejections) { - for (let p of promise) { - p.catch(() => { - }); - } - } - } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); - } - unary(method, input, options) { - var _a2; - const requestHeaders = (_a2 = options.meta) !== null && _a2 !== void 0 ? _a2 : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_2) => { - }).then(delay2(this.responseDelay, options.abort)).then((_2) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_2) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_2) => this.promiseStatus()), trailersPromise = responsePromise.catch((_2) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_2) => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = { single: input }; - return new unary_call_1.UnaryCall(method, requestHeaders, input, headersPromise, responsePromise, statusPromise, trailersPromise); - } - serverStreaming(method, input, options) { - var _a2; - const requestHeaders = (_a2 = options.meta) !== null && _a2 !== void 0 ? _a2 : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay2(this.responseDelay, options.abort)).catch(() => { - }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay2(this.afterResponseDelay, options.abort)), statusPromise = responseStreamClosedPromise.then(() => this.promiseStatus()), trailersPromise = responseStreamClosedPromise.then(() => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = { single: input }; - return new server_streaming_call_1.ServerStreamingCall(method, requestHeaders, input, headersPromise, outputStream, statusPromise, trailersPromise); - } - clientStreaming(method, options) { - var _a2; - const requestHeaders = (_a2 = options.meta) !== null && _a2 !== void 0 ? _a2 : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_2) => { - }).then(delay2(this.responseDelay, options.abort)).then((_2) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_2) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_2) => this.promiseStatus()), trailersPromise = responsePromise.catch((_2) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_2) => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = new TestInputStream(this.data, options.abort); - return new client_streaming_call_1.ClientStreamingCall(method, requestHeaders, this.lastInput, headersPromise, responsePromise, statusPromise, trailersPromise); - } - duplex(method, options) { - var _a2; - const requestHeaders = (_a2 = options.meta) !== null && _a2 !== void 0 ? _a2 : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay2(this.responseDelay, options.abort)).catch(() => { - }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay2(this.afterResponseDelay, options.abort)), statusPromise = responseStreamClosedPromise.then(() => this.promiseStatus()), trailersPromise = responseStreamClosedPromise.then(() => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = new TestInputStream(this.data, options.abort); - return new duplex_streaming_call_1.DuplexStreamingCall(method, requestHeaders, this.lastInput, headersPromise, outputStream, statusPromise, trailersPromise); - } - }; - exports2.TestTransport = TestTransport; - TestTransport.defaultHeaders = { - responseHeader: "test" - }; - TestTransport.defaultStatus = { - code: "OK", - detail: "all good" - }; - TestTransport.defaultTrailers = { - responseTrailer: "test" - }; - function delay2(ms, abort) { - return (v) => new Promise((resolve14, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - } else { - const id = setTimeout(() => resolve14(v), ms); - if (abort) { - abort.addEventListener("abort", (ev) => { - clearTimeout(id); - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - }); - } - } - }); - } - var TestInputStream = class { - constructor(data, abort) { - this._completed = false; - this._sent = []; - this.data = data; - this.abort = abort; - } - get sent() { - return this._sent; - } - get completed() { - return this._completed; - } - send(message) { - if (this.data.inputMessage instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.inputMessage); - } - const delayMs = this.data.inputMessage === void 0 ? 10 : this.data.inputMessage; - return Promise.resolve(void 0).then(() => { - this._sent.push(message); - }).then(delay2(delayMs, this.abort)); - } - complete() { - if (this.data.inputComplete instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.inputComplete); - } - const delayMs = this.data.inputComplete === void 0 ? 10 : this.data.inputComplete; - return Promise.resolve(void 0).then(() => { - this._completed = true; - }).then(delay2(delayMs, this.abort)); - } - }; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/rpc-interceptor.js -var require_rpc_interceptor = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/rpc-interceptor.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stackDuplexStreamingInterceptors = exports2.stackClientStreamingInterceptors = exports2.stackServerStreamingInterceptors = exports2.stackUnaryInterceptors = exports2.stackIntercept = void 0; - var runtime_1 = require_commonjs16(); - function stackIntercept(kind, transport, method, options, input) { - var _a2, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a2 = options.interceptors) !== null && _a2 !== void 0 ? _a2 : []).filter((i) => i.interceptUnary).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); - } - return tail(method, input, options); - } - if (kind == "serverStreaming") { - let tail = (mtd, inp, opt) => transport.serverStreaming(mtd, inp, opt); - for (const curr of ((_b = options.interceptors) !== null && _b !== void 0 ? _b : []).filter((i) => i.interceptServerStreaming).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptServerStreaming(next, mtd, inp, opt); - } - return tail(method, input, options); - } - if (kind == "clientStreaming") { - let tail = (mtd, opt) => transport.clientStreaming(mtd, opt); - for (const curr of ((_c = options.interceptors) !== null && _c !== void 0 ? _c : []).filter((i) => i.interceptClientStreaming).reverse()) { - const next = tail; - tail = (mtd, opt) => curr.interceptClientStreaming(next, mtd, opt); - } - return tail(method, options); - } - if (kind == "duplex") { - let tail = (mtd, opt) => transport.duplex(mtd, opt); - for (const curr of ((_d = options.interceptors) !== null && _d !== void 0 ? _d : []).filter((i) => i.interceptDuplex).reverse()) { - const next = tail; - tail = (mtd, opt) => curr.interceptDuplex(next, mtd, opt); - } - return tail(method, options); - } - runtime_1.assertNever(kind); - } - exports2.stackIntercept = stackIntercept; - function stackUnaryInterceptors(transport, method, input, options) { - return stackIntercept("unary", transport, method, options, input); - } - exports2.stackUnaryInterceptors = stackUnaryInterceptors; - function stackServerStreamingInterceptors(transport, method, input, options) { - return stackIntercept("serverStreaming", transport, method, options, input); - } - exports2.stackServerStreamingInterceptors = stackServerStreamingInterceptors; - function stackClientStreamingInterceptors(transport, method, options) { - return stackIntercept("clientStreaming", transport, method, options); - } - exports2.stackClientStreamingInterceptors = stackClientStreamingInterceptors; - function stackDuplexStreamingInterceptors(transport, method, options) { - return stackIntercept("duplex", transport, method, options); - } - exports2.stackDuplexStreamingInterceptors = stackDuplexStreamingInterceptors; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-call-context.js -var require_server_call_context = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-call-context.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ServerCallContextController = void 0; - var ServerCallContextController = class { - constructor(method, headers, deadline, sendResponseHeadersFn, defaultStatus = { code: "OK", detail: "" }) { - this._cancelled = false; - this._listeners = []; - this.method = method; - this.headers = headers; - this.deadline = deadline; - this.trailers = {}; - this._sendRH = sendResponseHeadersFn; - this.status = defaultStatus; - } - /** - * Set the call cancelled. - * - * Invokes all callbacks registered with onCancel() and - * sets `cancelled = true`. - */ - notifyCancelled() { - if (!this._cancelled) { - this._cancelled = true; - for (let l of this._listeners) { - l(); - } - } - } - /** - * Send response headers. - */ - sendResponseHeaders(data) { - this._sendRH(data); - } - /** - * Is the call cancelled? - * - * When the client closes the connection before the server - * is done, the call is cancelled. - * - * If you want to cancel a request on the server, throw a - * RpcError with the CANCELLED status code. - */ - get cancelled() { - return this._cancelled; - } - /** - * Add a callback for cancellation. - */ - onCancel(callback) { - const l = this._listeners; - l.push(callback); - return () => { - let i = l.indexOf(callback); - if (i >= 0) - l.splice(i, 1); - }; - } - }; - exports2.ServerCallContextController = ServerCallContextController; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs17 = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var service_type_1 = require_service_type(); - Object.defineProperty(exports2, "ServiceType", { enumerable: true, get: function() { - return service_type_1.ServiceType; - } }); - var reflection_info_1 = require_reflection_info2(); - Object.defineProperty(exports2, "readMethodOptions", { enumerable: true, get: function() { - return reflection_info_1.readMethodOptions; - } }); - Object.defineProperty(exports2, "readMethodOption", { enumerable: true, get: function() { - return reflection_info_1.readMethodOption; - } }); - Object.defineProperty(exports2, "readServiceOption", { enumerable: true, get: function() { - return reflection_info_1.readServiceOption; - } }); - var rpc_error_1 = require_rpc_error(); - Object.defineProperty(exports2, "RpcError", { enumerable: true, get: function() { - return rpc_error_1.RpcError; - } }); - var rpc_options_1 = require_rpc_options(); - Object.defineProperty(exports2, "mergeRpcOptions", { enumerable: true, get: function() { - return rpc_options_1.mergeRpcOptions; - } }); - var rpc_output_stream_1 = require_rpc_output_stream(); - Object.defineProperty(exports2, "RpcOutputStreamController", { enumerable: true, get: function() { - return rpc_output_stream_1.RpcOutputStreamController; - } }); - var test_transport_1 = require_test_transport(); - Object.defineProperty(exports2, "TestTransport", { enumerable: true, get: function() { - return test_transport_1.TestTransport; - } }); - var deferred_1 = require_deferred(); - Object.defineProperty(exports2, "Deferred", { enumerable: true, get: function() { - return deferred_1.Deferred; - } }); - Object.defineProperty(exports2, "DeferredState", { enumerable: true, get: function() { - return deferred_1.DeferredState; - } }); - var duplex_streaming_call_1 = require_duplex_streaming_call(); - Object.defineProperty(exports2, "DuplexStreamingCall", { enumerable: true, get: function() { - return duplex_streaming_call_1.DuplexStreamingCall; - } }); - var client_streaming_call_1 = require_client_streaming_call(); - Object.defineProperty(exports2, "ClientStreamingCall", { enumerable: true, get: function() { - return client_streaming_call_1.ClientStreamingCall; - } }); - var server_streaming_call_1 = require_server_streaming_call(); - Object.defineProperty(exports2, "ServerStreamingCall", { enumerable: true, get: function() { - return server_streaming_call_1.ServerStreamingCall; - } }); - var unary_call_1 = require_unary_call(); - Object.defineProperty(exports2, "UnaryCall", { enumerable: true, get: function() { - return unary_call_1.UnaryCall; - } }); - var rpc_interceptor_1 = require_rpc_interceptor(); - Object.defineProperty(exports2, "stackIntercept", { enumerable: true, get: function() { - return rpc_interceptor_1.stackIntercept; - } }); - Object.defineProperty(exports2, "stackDuplexStreamingInterceptors", { enumerable: true, get: function() { - return rpc_interceptor_1.stackDuplexStreamingInterceptors; - } }); - Object.defineProperty(exports2, "stackClientStreamingInterceptors", { enumerable: true, get: function() { - return rpc_interceptor_1.stackClientStreamingInterceptors; - } }); - Object.defineProperty(exports2, "stackServerStreamingInterceptors", { enumerable: true, get: function() { - return rpc_interceptor_1.stackServerStreamingInterceptors; - } }); - Object.defineProperty(exports2, "stackUnaryInterceptors", { enumerable: true, get: function() { - return rpc_interceptor_1.stackUnaryInterceptors; - } }); - var server_call_context_1 = require_server_call_context(); - Object.defineProperty(exports2, "ServerCallContextController", { enumerable: true, get: function() { - return server_call_context_1.ServerCallContextController; - } }); - } -}); - -// node_modules/@actions/cache/lib/generated/results/entities/v1/cachescope.js -var require_cachescope = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/entities/v1/cachescope.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheScope = void 0; - var runtime_1 = require_commonjs16(); - var runtime_2 = require_commonjs16(); - var runtime_3 = require_commonjs16(); - var runtime_4 = require_commonjs16(); - var runtime_5 = require_commonjs16(); - var CacheScope$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.entities.v1.CacheScope", [ - { - no: 1, - name: "scope", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "permission", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - } - ]); - } - create(value) { - const message = { scope: "", permission: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string scope */ - 1: - message.scope = reader.string(); - break; - case /* int64 permission */ - 2: - message.permission = reader.int64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.scope !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.scope); - if (message.permission !== "0") - writer.tag(2, runtime_1.WireType.Varint).int64(message.permission); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.CacheScope = new CacheScope$Type(); - } -}); - -// node_modules/@actions/cache/lib/generated/results/entities/v1/cachemetadata.js -var require_cachemetadata = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/entities/v1/cachemetadata.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs16(); - var runtime_2 = require_commonjs16(); - var runtime_3 = require_commonjs16(); - var runtime_4 = require_commonjs16(); - var runtime_5 = require_commonjs16(); - var cachescope_1 = require_cachescope(); - var CacheMetadata$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.entities.v1.CacheMetadata", [ - { - no: 1, - name: "repository_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - }, - { no: 2, name: "scope", kind: "message", repeat: 1, T: () => cachescope_1.CacheScope } - ]); - } - create(value) { - const message = { repositoryId: "0", scope: [] }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 repository_id */ - 1: - message.repositoryId = reader.int64().toString(); - break; - case /* repeated github.actions.results.entities.v1.CacheScope scope */ - 2: - message.scope.push(cachescope_1.CacheScope.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.repositoryId !== "0") - writer.tag(1, runtime_1.WireType.Varint).int64(message.repositoryId); - for (let i = 0; i < message.scope.length; i++) - cachescope_1.CacheScope.internalBinaryWrite(message.scope[i], writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.CacheMetadata = new CacheMetadata$Type(); - } -}); - -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache3 = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/api/v1/cache.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheService = exports2.GetCacheEntryDownloadURLResponse = exports2.GetCacheEntryDownloadURLRequest = exports2.FinalizeCacheEntryUploadResponse = exports2.FinalizeCacheEntryUploadRequest = exports2.CreateCacheEntryResponse = exports2.CreateCacheEntryRequest = void 0; - var runtime_rpc_1 = require_commonjs17(); - var runtime_1 = require_commonjs16(); - var runtime_2 = require_commonjs16(); - var runtime_3 = require_commonjs16(); - var runtime_4 = require_commonjs16(); - var runtime_5 = require_commonjs16(); - var cachemetadata_1 = require_cachemetadata(); - var CreateCacheEntryRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.CreateCacheEntryRequest", [ - { no: 1, name: "metadata", kind: "message", T: () => cachemetadata_1.CacheMetadata }, - { - no: 2, - name: "key", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "version", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { key: "", version: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* github.actions.results.entities.v1.CacheMetadata metadata */ - 1: - message.metadata = cachemetadata_1.CacheMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); - break; - case /* string key */ - 2: - message.key = reader.string(); - break; - case /* string version */ - 3: - message.version = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.metadata) - cachemetadata_1.CacheMetadata.internalBinaryWrite(message.metadata, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - if (message.key !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.key); - if (message.version !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.version); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.CreateCacheEntryRequest = new CreateCacheEntryRequest$Type(); - var CreateCacheEntryResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.CreateCacheEntryResponse", [ - { - no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "signed_upload_url", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "message", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { ok: false, signedUploadUrl: "", message: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool ok */ - 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); - break; - case /* string message */ - 3: - message.message = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.ok !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); - if (message.signedUploadUrl !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.signedUploadUrl); - if (message.message !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.message); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.CreateCacheEntryResponse = new CreateCacheEntryResponse$Type(); - var FinalizeCacheEntryUploadRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.FinalizeCacheEntryUploadRequest", [ - { no: 1, name: "metadata", kind: "message", T: () => cachemetadata_1.CacheMetadata }, - { - no: 2, - name: "key", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "size_bytes", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - }, - { - no: 4, - name: "version", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { key: "", sizeBytes: "0", version: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* github.actions.results.entities.v1.CacheMetadata metadata */ - 1: - message.metadata = cachemetadata_1.CacheMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); - break; - case /* string key */ - 2: - message.key = reader.string(); - break; - case /* int64 size_bytes */ - 3: - message.sizeBytes = reader.int64().toString(); - break; - case /* string version */ - 4: - message.version = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.metadata) - cachemetadata_1.CacheMetadata.internalBinaryWrite(message.metadata, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - if (message.key !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.key); - if (message.sizeBytes !== "0") - writer.tag(3, runtime_1.WireType.Varint).int64(message.sizeBytes); - if (message.version !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.version); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.FinalizeCacheEntryUploadRequest = new FinalizeCacheEntryUploadRequest$Type(); - var FinalizeCacheEntryUploadResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.FinalizeCacheEntryUploadResponse", [ - { - no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "entry_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - }, - { - no: 3, - name: "message", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { ok: false, entryId: "0", message: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool ok */ - 1: - message.ok = reader.bool(); - break; - case /* int64 entry_id */ - 2: - message.entryId = reader.int64().toString(); - break; - case /* string message */ - 3: - message.message = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.ok !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); - if (message.entryId !== "0") - writer.tag(2, runtime_1.WireType.Varint).int64(message.entryId); - if (message.message !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.message); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.FinalizeCacheEntryUploadResponse = new FinalizeCacheEntryUploadResponse$Type(); - var GetCacheEntryDownloadURLRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.GetCacheEntryDownloadURLRequest", [ - { no: 1, name: "metadata", kind: "message", T: () => cachemetadata_1.CacheMetadata }, - { - no: 2, - name: "key", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "restore_keys", - kind: "scalar", - repeat: 2, - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 4, - name: "version", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { key: "", restoreKeys: [], version: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* github.actions.results.entities.v1.CacheMetadata metadata */ - 1: - message.metadata = cachemetadata_1.CacheMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); - break; - case /* string key */ - 2: - message.key = reader.string(); - break; - case /* repeated string restore_keys */ - 3: - message.restoreKeys.push(reader.string()); - break; - case /* string version */ - 4: - message.version = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.metadata) - cachemetadata_1.CacheMetadata.internalBinaryWrite(message.metadata, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - if (message.key !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.key); - for (let i = 0; i < message.restoreKeys.length; i++) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.restoreKeys[i]); - if (message.version !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.version); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.GetCacheEntryDownloadURLRequest = new GetCacheEntryDownloadURLRequest$Type(); - var GetCacheEntryDownloadURLResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.GetCacheEntryDownloadURLResponse", [ - { - no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "signed_download_url", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "matched_key", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { ok: false, signedDownloadUrl: "", matchedKey: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool ok */ - 1: - message.ok = reader.bool(); - break; - case /* string signed_download_url */ - 2: - message.signedDownloadUrl = reader.string(); - break; - case /* string matched_key */ - 3: - message.matchedKey = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.ok !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); - if (message.signedDownloadUrl !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.signedDownloadUrl); - if (message.matchedKey !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.matchedKey); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.GetCacheEntryDownloadURLResponse = new GetCacheEntryDownloadURLResponse$Type(); - exports2.CacheService = new runtime_rpc_1.ServiceType("github.actions.results.api.v1.CacheService", [ - { name: "CreateCacheEntry", options: {}, I: exports2.CreateCacheEntryRequest, O: exports2.CreateCacheEntryResponse }, - { name: "FinalizeCacheEntryUpload", options: {}, I: exports2.FinalizeCacheEntryUploadRequest, O: exports2.FinalizeCacheEntryUploadResponse }, - { name: "GetCacheEntryDownloadURL", options: {}, I: exports2.GetCacheEntryDownloadURLRequest, O: exports2.GetCacheEntryDownloadURLResponse } - ]); - } -}); - -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.twirp-client.js -var require_cache_twirp_client = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/api/v1/cache.twirp-client.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache3(); - var CacheServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); - } - CreateCacheEntry(request3) { - const data = cache_1.CreateCacheEntryRequest.toJson(request3, { - useProtoFieldName: true, - emitDefaultValues: false - }); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/json", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromJson(data2, { - ignoreUnknownFields: true - })); - } - FinalizeCacheEntryUpload(request3) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request3, { - useProtoFieldName: true, - emitDefaultValues: false - }); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/json", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromJson(data2, { - ignoreUnknownFields: true - })); - } - GetCacheEntryDownloadURL(request3) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request3, { - useProtoFieldName: true, - emitDefaultValues: false - }); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/json", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromJson(data2, { - ignoreUnknownFields: true - })); - } - }; - exports2.CacheServiceClientJSON = CacheServiceClientJSON; - var CacheServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); - } - CreateCacheEntry(request3) { - const data = cache_1.CreateCacheEntryRequest.toBinary(request3); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); - } - FinalizeCacheEntryUpload(request3) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request3); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); - } - GetCacheEntryDownloadURL(request3) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request3); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/protobuf", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromBinary(data2)); - } - }; - exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; - } -}); - -// node_modules/@actions/cache/lib/internal/shared/util.js -var require_util10 = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSigUrl = maskSigUrl; - exports2.maskSecretUrls = maskSecretUrls; - var core_1 = require_core(); - function maskSigUrl(url2) { - if (!url2) - return; - try { - const parsedUrl = new URL(url2); - const signature = parsedUrl.searchParams.get("sig"); - if (signature) { - (0, core_1.setSecret)(signature); - (0, core_1.setSecret)(encodeURIComponent(signature)); - } - } catch (error3) { - (0, core_1.debug)(`Failed to parse URL: ${url2} ${error3 instanceof Error ? error3.message : String(error3)}`); - } - } - function maskSecretUrls(body) { - if (typeof body !== "object" || body === null) { - (0, core_1.debug)("body is not an object or is null"); - return; - } - if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { - maskSigUrl(body.signed_upload_url); - } - if ("signed_download_url" in body && typeof body.signed_download_url === "string") { - maskSigUrl(body.signed_download_url); - } - } - } -}); - -// node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js -var require_cacheTwirpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = internalCacheTwirpClient; - var core_1 = require_core(); - var user_agent_1 = require_user_agent(); - var errors_1 = require_errors2(); - var config_1 = require_config(); - var cacheUtils_1 = require_cacheUtils(); - var auth_1 = require_auth(); - var http_client_1 = require_lib(); - var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util10(); - var CacheServiceClient = class { - constructor(userAgent2, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { - this.maxAttempts = 5; - this.baseRetryIntervalMilliseconds = 3e3; - this.retryMultiplier = 1.5; - const token = (0, cacheUtils_1.getRuntimeToken)(); - this.baseUrl = (0, config_1.getCacheServiceURL)(); - if (maxAttempts) { - this.maxAttempts = maxAttempts; - } - if (baseRetryIntervalMilliseconds) { - this.baseRetryIntervalMilliseconds = baseRetryIntervalMilliseconds; - } - if (retryMultiplier) { - this.retryMultiplier = retryMultiplier; - } - this.httpClient = new http_client_1.HttpClient(userAgent2, [ - new auth_1.BearerCredentialHandler(token) - ]); - } - // This function satisfies the Rpc interface. It is compatible with the JSON - // JSON generated client. - request(service, method, contentType, data) { - return __awaiter2(this, void 0, void 0, function* () { - const url2 = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; - (0, core_1.debug)(`[Request] ${method} ${url2}`); - const headers = { - "Content-Type": contentType - }; - try { - const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { - return this.httpClient.post(url2, JSON.stringify(data), headers); - })); - return body; - } catch (error3) { - throw new Error(`Failed to ${method}: ${error3.message}`); - } - }); - } - retryableRequest(operation) { - return __awaiter2(this, void 0, void 0, function* () { - let attempt = 0; - let errorMessage = ""; - let rawBody = ""; - while (attempt < this.maxAttempts) { - let isRetryable = false; - try { - const response = yield operation(); - const statusCode = response.message.statusCode; - rawBody = yield response.readBody(); - (0, core_1.debug)(`[Response] - ${response.message.statusCode}`); - (0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); - const body = JSON.parse(rawBody); - (0, util_1.maskSecretUrls)(body); - (0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`); - if (this.isSuccessStatusCode(statusCode)) { - return { response, body }; - } - isRetryable = this.isRetryableHttpStatusCode(statusCode); - errorMessage = `Failed request: (${statusCode}) ${response.message.statusMessage}`; - if (body.msg) { - if (errors_1.UsageError.isUsageErrorMessage(body.msg)) { - throw new errors_1.UsageError(); - } - errorMessage = `${errorMessage}: ${body.msg}`; - } - if (statusCode === http_client_1.HttpCodes.TooManyRequests) { - const retryAfterHeader = response.message.headers["retry-after"]; - if (retryAfterHeader) { - const parsedSeconds = parseInt(retryAfterHeader, 10); - if (!isNaN(parsedSeconds) && parsedSeconds > 0) { - (0, core_1.warning)(`You've hit a rate limit, your rate limit will reset in ${parsedSeconds} seconds`); - } - } - throw new errors_1.RateLimitError(`Rate limited: ${errorMessage}`); - } - } catch (error3) { - if (error3 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); - } - if (error3 instanceof errors_1.UsageError) { - throw error3; - } - if (error3 instanceof errors_1.RateLimitError) { - throw error3; - } - if (errors_1.NetworkError.isNetworkErrorCode(error3 === null || error3 === void 0 ? void 0 : error3.code)) { - throw new errors_1.NetworkError(error3 === null || error3 === void 0 ? void 0 : error3.code); - } - isRetryable = true; - errorMessage = error3.message; - } - if (!isRetryable) { - throw new Error(`Received non-retryable error: ${errorMessage}`); - } - if (attempt + 1 === this.maxAttempts) { - throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); - } - const retryTimeMilliseconds = this.getExponentialRetryTimeMilliseconds(attempt); - (0, core_1.info)(`Attempt ${attempt + 1} of ${this.maxAttempts} failed with error: ${errorMessage}. Retrying request in ${retryTimeMilliseconds} ms...`); - yield this.sleep(retryTimeMilliseconds); - attempt++; - } - throw new Error(`Request failed`); - }); - } - isSuccessStatusCode(statusCode) { - if (!statusCode) - return false; - return statusCode >= 200 && statusCode < 300; - } - isRetryableHttpStatusCode(statusCode) { - if (!statusCode) - return false; - const retryableStatusCodes = [ - http_client_1.HttpCodes.BadGateway, - http_client_1.HttpCodes.GatewayTimeout, - http_client_1.HttpCodes.InternalServerError, - http_client_1.HttpCodes.ServiceUnavailable - ]; - return retryableStatusCodes.includes(statusCode); - } - sleep(milliseconds) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => setTimeout(resolve14, milliseconds)); - }); - } - getExponentialRetryTimeMilliseconds(attempt) { - if (attempt < 0) { - throw new Error("attempt should be a positive integer"); - } - if (attempt === 0) { - return this.baseRetryIntervalMilliseconds; - } - const minTime = this.baseRetryIntervalMilliseconds * Math.pow(this.retryMultiplier, attempt); - const maxTime = minTime * this.retryMultiplier; - return Math.trunc(Math.random() * (maxTime - minTime) + minTime); - } - }; - function internalCacheTwirpClient(options) { - const client = new CacheServiceClient((0, user_agent_1.getUserAgentString)(), options === null || options === void 0 ? void 0 : options.maxAttempts, options === null || options === void 0 ? void 0 : options.retryIntervalMs, options === null || options === void 0 ? void 0 : options.retryMultiplier); - return new cache_twirp_client_1.CacheServiceClientJSON(client); - } - } -}); - -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.listTar = listTar; - exports2.extractTar = extractTar3; - exports2.createTar = createTar; - var exec_1 = require_exec(); - var io9 = __importStar2(require_io()); - var fs_1 = require("fs"); - var path30 = __importStar2(require("path")); - var utils = __importStar2(require_cacheUtils()); - var constants_1 = require_constants7(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { - return __awaiter2(this, void 0, void 0, function* () { - switch (process.platform) { - case "win32": { - const gnuTar = yield utils.getGnuTarPathOnWindows(); - const systemTar = constants_1.SystemTarPathOnWindows; - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else if ((0, fs_1.existsSync)(systemTar)) { - return { path: systemTar, type: constants_1.ArchiveToolType.BSD }; - } - break; - } - case "darwin": { - const gnuTar = yield io9.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io9.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; - } - } - default: - break; - } - return { - path: yield io9.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); - } - function getTarArgs(tarPath_1, compressionMethod_1, type_1) { - return __awaiter2(this, arguments, void 0, function* (tarPath, compressionMethod, type, archivePath = "") { - const args = [`"${tarPath.path}"`]; - const cacheFileName = utils.getCacheFileName(compressionMethod); - const tarFile = "cache.tar"; - const workingDirectory = getWorkingDirectory(); - const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; - switch (type) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path30.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "-P"); - break; - } - if (tarPath.type === constants_1.ArchiveToolType.GNU) { - switch (process.platform) { - case "win32": - args.push("--force-local"); - break; - case "darwin": - args.push("--delay-directory-restore"); - break; - } - } - return args; - }); - } - function getCommands(compressionMethod_1, type_1) { - return __awaiter2(this, arguments, void 0, function* (compressionMethod, type, archivePath = "") { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath); - const compressionArgs = type !== "create" ? yield getDecompressionProgram(tarPath, compressionMethod, archivePath) : yield getCompressionProgram(tarPath, compressionMethod); - const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; - if (BSD_TAR_ZSTD && type !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; - } else { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; - } - if (BSD_TAR_ZSTD) { - return args; - } - return [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a2; - return (_a2 = process.env["GITHUB_WORKSPACE"]) !== null && _a2 !== void 0 ? _a2 : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter2(this, void 0, void 0, function* () { - const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; - switch (compressionMethod) { - case constants_1.CompressionMethod.Zstd: - return BSD_TAR_ZSTD ? [ - "zstd -d --long=30 --force -o", - constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path30.sep}`, "g"), "/") - ] : [ - "--use-compress-program", - IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" - ]; - case constants_1.CompressionMethod.ZstdWithoutLong: - return BSD_TAR_ZSTD ? [ - "zstd -d --force -o", - constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path30.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; - } - }); - } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter2(this, void 0, void 0, function* () { - const cacheFileName = utils.getCacheFileName(compressionMethod); - const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; - switch (compressionMethod) { - case constants_1.CompressionMethod.Zstd: - return BSD_TAR_ZSTD ? [ - "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), - constants_1.TarFilename - ] : [ - "--use-compress-program", - IS_WINDOWS ? '"zstd -T0 --long=30"' : "zstdmt --long=30" - ]; - case constants_1.CompressionMethod.ZstdWithoutLong: - return BSD_TAR_ZSTD ? [ - "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; - } - }); - } - function execCommands(commands, cwd) { - return __awaiter2(this, void 0, void 0, function* () { - for (const command of commands) { - try { - yield (0, exec_1.exec)(command, void 0, { - cwd, - env: Object.assign(Object.assign({}, process.env), { MSYS: "winsymlinks:nativestrict" }) - }); - } catch (error3) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error3 === null || error3 === void 0 ? void 0 : error3.message}`); - } - } - }); - } - function listTar(archivePath, compressionMethod) { - return __awaiter2(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - function extractTar3(archivePath, compressionMethod) { - return __awaiter2(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io9.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path30.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - } -}); - -// node_modules/@actions/cache/lib/cache.js -var require_cache4 = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FinalizeCacheError = exports2.CacheReadDeniedError = exports2.CACHE_READ_DENIED_PREFIX = exports2.CacheWriteDeniedError = exports2.CACHE_WRITE_DENIED_PREFIX = exports2.ReserveCacheError = exports2.ValidationError = void 0; - exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache5; - exports2.saveCache = saveCache5; - var core31 = __importStar2(require_core()); - var path30 = __importStar2(require("path")); - var utils = __importStar2(require_cacheUtils()); - var cacheHttpClient = __importStar2(require_cacheHttpClient()); - var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); - var config_1 = require_config(); - var tar_1 = require_tar(); - var http_client_1 = require_lib(); - var constants_1 = require_constants7(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); - } - }; - exports2.ValidationError = ValidationError; - var ReserveCacheError2 = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); - } - }; - exports2.ReserveCacheError = ReserveCacheError2; - exports2.CACHE_WRITE_DENIED_PREFIX = "cache write denied:"; - var CacheWriteDeniedError = class _CacheWriteDeniedError extends ReserveCacheError2 { - constructor(message) { - super(message); - this.name = "CacheWriteDeniedError"; - Object.setPrototypeOf(this, _CacheWriteDeniedError.prototype); - } - }; - exports2.CacheWriteDeniedError = CacheWriteDeniedError; - exports2.CACHE_READ_DENIED_PREFIX = constants_1.CacheReadDeniedMessagePrefix; - var CacheReadDeniedError = class _CacheReadDeniedError extends Error { - constructor(message) { - super(message); - this.name = "CacheReadDeniedError"; - Object.setPrototypeOf(this, _CacheReadDeniedError.prototype); - } - }; - exports2.CacheReadDeniedError = CacheReadDeniedError; - var FinalizeCacheError = class _FinalizeCacheError extends Error { - constructor(message) { - super(message); - this.name = "FinalizeCacheError"; - Object.setPrototypeOf(this, _FinalizeCacheError.prototype); - } - }; - exports2.FinalizeCacheError = FinalizeCacheError; - function checkPaths(paths) { - if (!paths || paths.length === 0) { - throw new ValidationError(`Path Validation Error: At least one directory or file path is required`); - } - } - function checkKey(key) { - if (key.length > 512) { - throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); - } - const regex = /^[^,]*$/; - if (!regex.test(key)) { - throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); - } - } - function isFeatureAvailable() { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - switch (cacheServiceVersion) { - case "v2": - return !!process.env["ACTIONS_RESULTS_URL"]; - case "v1": - default: - return !!process.env["ACTIONS_CACHE_URL"]; - } - } - function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { - return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core31.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - const cacheMode = (0, config_1.getCacheMode)(); - if (!(0, config_1.isCacheReadable)(cacheMode)) { - core31.info(`Cache restore skipped: the effective cache-mode '${cacheMode}' does not permit reads.`); - core31.debug(`Skipped restore for paths [${paths.join(", ")}] with primary key '${primaryKey}'.`); - return void 0; - } - switch (cacheServiceVersion) { - case "v2": - return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - case "v1": - default: - return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - } - }); - } - function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { - return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - var _a2; - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core31.debug("Resolved Keys:"); - core31.debug(JSON.stringify(keys)); - if (keys.length > 10) { - throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); - } - for (const key of keys) { - checkKey(key); - } - const compressionMethod = yield utils.getCompressionMethod(); - let archivePath = ""; - try { - let cacheEntry; - try { - cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - } catch (error3) { - const errorMessage = (_a2 = error3 === null || error3 === void 0 ? void 0 : error3.message) !== null && _a2 !== void 0 ? _a2 : ""; - if (errorMessage.includes(exports2.CACHE_READ_DENIED_PREFIX)) { - throw new CacheReadDeniedError(errorMessage); - } - throw error3; - } - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core31.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path30.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core31.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core31.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core31.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error3) { - const typedError = error3; - if (typedError.name === ValidationError.name) { - throw error3; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core31.error(`Failed to restore: ${error3.message}`); - } else { - core31.warning(`Failed to restore: ${error3.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error3) { - core31.debug(`Failed to delete archive: ${error3}`); - } - } - return void 0; - }); - } - function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { - return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - var _a2; - options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core31.debug("Resolved Keys:"); - core31.debug(JSON.stringify(keys)); - if (keys.length > 10) { - throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); - } - for (const key of keys) { - checkKey(key); - } - let archivePath = ""; - try { - const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); - const compressionMethod = yield utils.getCompressionMethod(); - const request3 = { - key: primaryKey, - restoreKeys, - version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) - }; - let response; - try { - response = yield twirpClient.GetCacheEntryDownloadURL(request3); - } catch (error3) { - const errorMessage = (_a2 = error3 === null || error3 === void 0 ? void 0 : error3.message) !== null && _a2 !== void 0 ? _a2 : ""; - if (errorMessage.includes(exports2.CACHE_READ_DENIED_PREFIX)) { - throw new CacheReadDeniedError(errorMessage); - } - throw error3; - } - if (!response.ok) { - core31.debug(`Cache not found for version ${request3.version} of keys: ${keys.join(", ")}`); - return void 0; - } - const isRestoreKeyMatch = request3.key !== response.matchedKey; - if (isRestoreKeyMatch) { - core31.info(`Cache hit for restore-key: ${response.matchedKey}`); - } else { - core31.info(`Cache hit for: ${response.matchedKey}`); - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core31.info("Lookup only - skipping download"); - return response.matchedKey; - } - archivePath = path30.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core31.debug(`Archive path: ${archivePath}`); - core31.debug(`Starting download of archive to: ${archivePath}`); - yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core31.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core31.info("Cache restored successfully"); - return response.matchedKey; - } catch (error3) { - const typedError = error3; - if (typedError.name === ValidationError.name) { - throw error3; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core31.error(`Failed to restore: ${error3.message}`); - } else { - core31.warning(`Failed to restore: ${error3.message}`); - } - } - } finally { - try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error3) { - core31.debug(`Failed to delete archive: ${error3}`); - } - } - return void 0; - }); - } - function saveCache5(paths_1, key_1, options_1) { - return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core31.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - const cacheMode = (0, config_1.getCacheMode)(); - if (!(0, config_1.isCacheWritable)(cacheMode)) { - core31.info(`Cache save skipped: the effective cache-mode '${cacheMode}' does not permit writes.`); - core31.debug(`Skipped save for paths [${paths.join(", ")}] with key '${key}'.`); - return -1; - } - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); - } - }); - } - function saveCacheV1(paths_1, key_1, options_1) { - return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { - var _a2, _b, _c, _d, _e; - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core31.debug("Cache Paths:"); - core31.debug(`${JSON.stringify(cachePaths)}`); - if (cachePaths.length === 0) { - throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); - } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path30.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core31.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core31.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.debug(`File Size: ${archiveFileSize}`); - if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) { - throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); - } - core31.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize - }); - if ((_a2 = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a2 === void 0 ? void 0 : _a2.cacheId) { - cacheId = (_b = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _b === void 0 ? void 0 : _b.cacheId; - } else if ((reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.statusCode) === 400) { - throw new Error((_d = (_c = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`); - } else { - const detailMessage = (_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message; - if (detailMessage === null || detailMessage === void 0 ? void 0 : detailMessage.startsWith(exports2.CACHE_WRITE_DENIED_PREFIX)) { - throw new CacheWriteDeniedError(`Unable to reserve cache with key ${key}. More details: ${detailMessage}`); - } - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${detailMessage}`); - } - core31.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error3) { - const typedError = error3; - if (typedError.name === ValidationError.name) { - throw error3; - } else if (typedError.name === CacheWriteDeniedError.name) { - core31.warning(`Failed to save: ${typedError.message}`); - } else if (typedError.name === ReserveCacheError2.name) { - core31.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core31.error(`Failed to save: ${typedError.message}`); - } else { - core31.warning(`Failed to save: ${typedError.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error3) { - core31.debug(`Failed to delete archive: ${error3}`); - } - } - return cacheId; - }); - } - function saveCacheV2(paths_1, key_1, options_1) { - return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { - var _a2; - options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: true }); - const compressionMethod = yield utils.getCompressionMethod(); - const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core31.debug("Cache Paths:"); - core31.debug(`${JSON.stringify(cachePaths)}`); - if (cachePaths.length === 0) { - throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); - } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path30.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core31.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core31.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core31.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request3 = { - key, - version - }; - let signedUploadUrl; - try { - const response = yield twirpClient.CreateCacheEntry(request3); - if (!response.ok) { - if (response.message && !response.message.startsWith(exports2.CACHE_WRITE_DENIED_PREFIX)) { - core31.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error3) { - core31.debug(`Failed to reserve cache: ${error3}`); - const errorMessage = (_a2 = error3 === null || error3 === void 0 ? void 0 : error3.message) !== null && _a2 !== void 0 ? _a2 : ""; - if (errorMessage.startsWith(exports2.CACHE_WRITE_DENIED_PREFIX)) { - throw new CacheWriteDeniedError(`Unable to reserve cache with key ${key}. More details: ${errorMessage}`); - } - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); - } - core31.debug(`Attempting to upload cache located at: ${archivePath}`); - yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options); - const finalizeRequest = { - key, - version, - sizeBytes: `${archiveFileSize}` - }; - const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); - core31.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); - if (!finalizeResponse.ok) { - if (finalizeResponse.message) { - throw new FinalizeCacheError(finalizeResponse.message); - } - throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`); - } - cacheId = parseInt(finalizeResponse.entryId); - } catch (error3) { - const typedError = error3; - if (typedError.name === ValidationError.name) { - throw error3; - } else if (typedError.name === CacheWriteDeniedError.name) { - core31.warning(`Failed to save: ${typedError.message}`); - } else if (typedError.name === ReserveCacheError2.name) { - core31.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core31.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core31.error(`Failed to save: ${typedError.message}`); - } else { - core31.warning(`Failed to save: ${typedError.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error3) { - core31.debug(`Failed to delete archive: ${error3}`); - } - } - return cacheId; - }); - } - } -}); - -// node_modules/@actions/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._findMatch = _findMatch; - exports2._getOsVersion = _getOsVersion; - exports2._readLinuxVersionFile = _readLinuxVersionFile; - var semver11 = __importStar2(require_semver2()); - var core_1 = require_core(); - var os7 = require("os"); - var cp = require("child_process"); - var fs32 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter2(this, void 0, void 0, function* () { - const platFilter = os7.platform(); - let result; - let match2; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver11.satisfies(version, versionSpec) && (!stable || candidate.stable === stable)) { - file = candidate.files.find((item) => { - (0, core_1.debug)(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`); - let chk = item.arch === archFilter && item.platform === platFilter; - if (chk && item.platform_version) { - const osVersion = module2.exports._getOsVersion(); - if (osVersion === item.platform_version) { - chk = true; - } else { - chk = semver11.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match2 = candidate; - break; - } - } - } - if (match2 && file) { - result = Object.assign({}, match2); - result.files = [file]; - } - return result; - }); - } - function _getOsVersion() { - const plat = os7.platform(); - let version = ""; - if (plat === "darwin") { - version = cp.execSync("sw_vers -productVersion").toString(); - } else if (plat === "linux") { - const lsbContents = module2.exports._readLinuxVersionFile(); - if (lsbContents) { - const lines = lsbContents.split("\n"); - for (const line of lines) { - const parts = line.split("="); - if (parts.length === 2 && (parts[0].trim() === "VERSION_ID" || parts[0].trim() === "DISTRIB_RELEASE")) { - version = parts[1].trim().replace(/^"/, "").replace(/"$/, ""); - break; - } - } - } - } - return version; - } - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs32.existsSync(lsbReleaseFile)) { - contents = fs32.readFileSync(lsbReleaseFile).toString(); - } else if (fs32.existsSync(osReleaseFile)) { - contents = fs32.readFileSync(osReleaseFile).toString(); - } - return contents; - } - } -}); - -// node_modules/@actions/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core31 = __importStar2(require_core()); - var RetryHelper = class { - constructor(maxAttempts, minSeconds, maxSeconds) { - if (maxAttempts < 1) { - throw new Error("max attempts should be greater than or equal to 1"); - } - this.maxAttempts = maxAttempts; - this.minSeconds = Math.floor(minSeconds); - this.maxSeconds = Math.floor(maxSeconds); - if (this.minSeconds > this.maxSeconds) { - throw new Error("min seconds should be less than or equal to max seconds"); - } - } - execute(action, isRetryable) { - return __awaiter2(this, void 0, void 0, function* () { - let attempt = 1; - while (attempt < this.maxAttempts) { - try { - return yield action(); - } catch (err) { - if (isRetryable && !isRetryable(err)) { - throw err; - } - core31.info(err.message); - } - const seconds = this.getSleepAmount(); - core31.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; - } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => setTimeout(resolve14, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; - } -}); - -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o) { - ownKeys2 = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys2(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HTTPError = void 0; - exports2.downloadTool = downloadTool3; - exports2.extract7z = extract7z; - exports2.extractTar = extractTar3; - exports2.extractXar = extractXar; - exports2.extractZip = extractZip; - exports2.cacheDir = cacheDir2; - exports2.cacheFile = cacheFile; - exports2.find = find3; - exports2.findAllVersions = findAllVersions2; - exports2.getManifestFromRepo = getManifestFromRepo; - exports2.findFromManifest = findFromManifest; - exports2.isExplicitVersion = isExplicitVersion; - exports2.evaluateVersions = evaluateVersions; - var core31 = __importStar2(require_core()); - var io9 = __importStar2(require_io()); - var crypto3 = __importStar2(require("crypto")); - var fs32 = __importStar2(require("fs")); - var mm = __importStar2(require_manifest()); - var os7 = __importStar2(require("os")); - var path30 = __importStar2(require("path")); - var httpm = __importStar2(require_lib()); - var semver11 = __importStar2(require_semver2()); - var stream2 = __importStar2(require("stream")); - var util3 = __importStar2(require("util")); - var assert_1 = require("assert"); - var exec_1 = require_exec(); - var retry_helper_1 = require_retry_helper(); - var HTTPError2 = class extends Error { - constructor(httpStatusCode) { - super(`Unexpected HTTP response: ${httpStatusCode}`); - this.httpStatusCode = httpStatusCode; - Object.setPrototypeOf(this, new.target.prototype); - } - }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent2 = "actions/tool-cache"; - function downloadTool3(url2, dest, auth2, headers) { - return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path30.join(_getTempDirectory(), crypto3.randomUUID()); - yield io9.mkdirP(path30.dirname(dest)); - core31.debug(`Downloading ${url2}`); - core31.debug(`Destination ${dest}`); - const maxAttempts = 3; - const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); - const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); - const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds); - return yield retryHelper.execute(() => __awaiter2(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url2, dest || "", auth2, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - function downloadToolAttempt(url2, dest, auth2, headers) { - return __awaiter2(this, void 0, void 0, function* () { - if (fs32.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent2, [], { - allowRetries: false - }); - if (auth2) { - core31.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth2; - } - const response = yield http.get(url2, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core31.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline2 = util3.promisify(stream2.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline2(readStream, fs32.createWriteStream(dest)); - core31.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core31.debug("download failed"); - try { - yield io9.rmRF(dest); - } catch (err) { - core31.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter2(this, void 0, void 0, function* () { - (0, assert_1.ok)(IS_WINDOWS, "extract7z() not supported on current OS"); - (0, assert_1.ok)(file, 'parameter "file" is required'); - dest = yield _createExtractFolder(dest); - const originalCwd = process.cwd(); - process.chdir(dest); - if (_7zPath) { - try { - const logLevel = core31.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - // eXtract files with full paths - logLevel, - // -bb[0-3] : set output log level - "-bd", - // disable progress indicator - "-sccUTF-8", - // set charset for for console input/output - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path30.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); - const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ""); - const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ""); - const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`; - const args = [ - "-NoLogo", - "-Sta", - "-NoProfile", - "-NonInteractive", - "-ExecutionPolicy", - "Unrestricted", - "-Command", - command - ]; - const options = { - silent: true - }; - try { - const powershellPath = yield io9.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - function extractTar3(file_1, dest_1) { - return __awaiter2(this, arguments, void 0, function* (file, dest, flags = "xz") { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core31.debug("Checking tar --version"); - let versionOutput = ""; - yield (0, exec_1.exec)("tar --version", [], { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() - } - }); - core31.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core31.isDebug() && !flags.includes("v")) { - args.push("-v"); - } - let destArg = dest; - let fileArg = file; - if (IS_WINDOWS && isGnuTar) { - args.push("--force-local"); - destArg = dest.replace(/\\/g, "/"); - fileArg = file.replace(/\\/g, "/"); - } - if (isGnuTar) { - args.push("--warning=no-unknown-keyword"); - args.push("--overwrite"); - } - args.push("-C", destArg, "-f", fileArg); - yield (0, exec_1.exec)(`tar`, args); - return dest; - }); - } - function extractXar(file_1, dest_1) { - return __awaiter2(this, arguments, void 0, function* (file, dest, flags = []) { - (0, assert_1.ok)(IS_MAC, "extractXar() not supported on current OS"); - (0, assert_1.ok)(file, 'parameter "file" is required'); - dest = yield _createExtractFolder(dest); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - args.push("-x", "-C", dest, "-f", file); - if (core31.isDebug()) { - args.push("-v"); - } - const xarPath = yield io9.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - function extractZip(file, dest) { - return __awaiter2(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - if (IS_WINDOWS) { - yield extractZipWin(file, dest); - } else { - yield extractZipNix(file, dest); - } - return dest; - }); - } - function extractZipWin(file, dest) { - return __awaiter2(this, void 0, void 0, function* () { - const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ""); - const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ""); - const pwshPath = yield io9.which("pwsh", false); - if (pwshPath) { - const pwshCommand = [ - `$ErrorActionPreference = 'Stop' ;`, - `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`, - `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`, - `catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force } else { throw $_ } } ;` - ].join(" "); - const args = [ - "-NoLogo", - "-NoProfile", - "-NonInteractive", - "-ExecutionPolicy", - "Unrestricted", - "-Command", - pwshCommand - ]; - core31.debug(`Using pwsh at path: ${pwshPath}`); - yield (0, exec_1.exec)(`"${pwshPath}"`, args); - } else { - const powershellCommand = [ - `$ErrorActionPreference = 'Stop' ;`, - `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`, - `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`, - `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }` - ].join(" "); - const args = [ - "-NoLogo", - "-Sta", - "-NoProfile", - "-NonInteractive", - "-ExecutionPolicy", - "Unrestricted", - "-Command", - powershellCommand - ]; - const powershellPath = yield io9.which("powershell", true); - core31.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter2(this, void 0, void 0, function* () { - const unzipPath = yield io9.which("unzip", true); - const args = [file]; - if (!core31.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir2(sourceDir, tool, version, arch2) { - return __awaiter2(this, void 0, void 0, function* () { - version = semver11.clean(version) || version; - arch2 = arch2 || os7.arch(); - core31.debug(`Caching tool ${tool} ${version} ${arch2}`); - core31.debug(`source dir: ${sourceDir}`); - if (!fs32.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs32.readdirSync(sourceDir)) { - const s = path30.join(sourceDir, itemName); - yield io9.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch2); - return destPath; - }); - } - function cacheFile(sourceFile, targetFile, tool, version, arch2) { - return __awaiter2(this, void 0, void 0, function* () { - version = semver11.clean(version) || version; - arch2 = arch2 || os7.arch(); - core31.debug(`Caching tool ${tool} ${version} ${arch2}`); - core31.debug(`source file: ${sourceFile}`); - if (!fs32.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path30.join(destFolder, targetFile); - core31.debug(`destination file ${destPath}`); - yield io9.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); - return destFolder; - }); - } - function find3(toolName, versionSpec, arch2) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch2 = arch2 || os7.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); - const match2 = evaluateVersions(localVersions, versionSpec); - versionSpec = match2; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver11.clean(versionSpec) || ""; - const cachePath = path30.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core31.debug(`checking cache: ${cachePath}`); - if (fs32.existsSync(cachePath) && fs32.existsSync(`${cachePath}.complete`)) { - core31.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); - toolPath = cachePath; - } else { - core31.debug("not found"); - } - } - return toolPath; - } - function findAllVersions2(toolName, arch2) { - const versions = []; - arch2 = arch2 || os7.arch(); - const toolPath = path30.join(_getCacheDirectory(), toolName); - if (fs32.existsSync(toolPath)) { - const children = fs32.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path30.join(toolPath, child, arch2 || ""); - if (fs32.existsSync(fullPath) && fs32.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } - } - return versions; - } - function getManifestFromRepo(owner_1, repo_1, auth_1) { - return __awaiter2(this, arguments, void 0, function* (owner, repo, auth2, branch = "master") { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth2) { - core31.debug("set auth"); - headers.authorization = auth2; - } - const response = yield http.getJson(treeUrl, headers); - if (!response.result) { - return releases; - } - let manifestUrl = ""; - for (const item of response.result.tree) { - if (item.path === "versions-manifest.json") { - manifestUrl = item.url; - break; - } - } - headers["accept"] = "application/vnd.github.VERSION.raw"; - let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody(); - if (versionsRaw) { - versionsRaw = versionsRaw.replace(/^\uFEFF/, ""); - try { - releases = JSON.parse(versionsRaw); - } catch (_a2) { - core31.debug("Invalid json"); - } - } - return releases; - }); - } - function findFromManifest(versionSpec_1, stable_1, manifest_1) { - return __awaiter2(this, arguments, void 0, function* (versionSpec, stable, manifest, archFilter = os7.arch()) { - const match2 = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match2; - }); - } - function _createExtractFolder(dest) { - return __awaiter2(this, void 0, void 0, function* () { - if (!dest) { - dest = path30.join(_getTempDirectory(), crypto3.randomUUID()); - } - yield io9.mkdirP(dest); - return dest; - }); - } - function _createToolPath(tool, version, arch2) { - return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path30.join(_getCacheDirectory(), tool, semver11.clean(version) || version, arch2 || ""); - core31.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io9.rmRF(folderPath); - yield io9.rmRF(markerPath); - yield io9.mkdirP(folderPath); - return folderPath; - }); - } - function _completeToolPath(tool, version, arch2) { - const folderPath = path30.join(_getCacheDirectory(), tool, semver11.clean(version) || version, arch2 || ""); - const markerPath = `${folderPath}.complete`; - fs32.writeFileSync(markerPath, ""); - core31.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver11.clean(versionSpec) || ""; - core31.debug(`isExplicit: ${c}`); - const valid4 = semver11.valid(c) != null; - core31.debug(`explicit? ${valid4}`); - return valid4; - } - function evaluateVersions(versions, versionSpec) { - let version = ""; - core31.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver11.gt(a, b)) { - return 1; - } - return -1; - }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver11.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core31.debug(`matched: ${version}`); - } else { - core31.debug("match not found"); - } - return version; - } - function _getCacheDirectory() { - const cacheDirectory = process.env["RUNNER_TOOL_CACHE"] || ""; - (0, assert_1.ok)(cacheDirectory, "Expected RUNNER_TOOL_CACHE to be defined"); - return cacheDirectory; - } - function _getTempDirectory() { - const tempDirectory = process.env["RUNNER_TEMP"] || ""; - (0, assert_1.ok)(tempDirectory, "Expected RUNNER_TEMP to be defined"); - return tempDirectory; - } - function _getGlobal(key, defaultValue) { - const value = global[key]; - return value !== void 0 ? value : defaultValue; - } - function _unique(values) { - return Array.from(new Set(values)); - } - } -}); - -// node_modules/fast-deep-equal/index.js -var require_fast_deep_equal = __commonJS({ - "node_modules/fast-deep-equal/index.js"(exports2, module2) { - "use strict"; - module2.exports = function equal(a, b) { - if (a === b) return true; - if (a && b && typeof a == "object" && typeof b == "object") { - if (a.constructor !== b.constructor) return false; - var length, i, keys; - if (Array.isArray(a)) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0; ) - if (!equal(a[i], b[i])) return false; - return true; - } - if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; - if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); - if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); - keys = Object.keys(a); - length = keys.length; - if (length !== Object.keys(b).length) return false; - for (i = length; i-- !== 0; ) - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; - for (i = length; i-- !== 0; ) { - var key = keys[i]; - if (!equal(a[key], b[key])) return false; - } - return true; - } - return a !== a && b !== b; - }; - } -}); - -// node_modules/follow-redirects/debug.js -var require_debug3 = __commonJS({ - "node_modules/follow-redirects/debug.js"(exports2, module2) { - var debug6; - module2.exports = function() { - if (!debug6) { - try { - debug6 = require_src()("follow-redirects"); - } catch (error3) { - } - if (typeof debug6 !== "function") { - debug6 = function() { - }; - } - } - debug6.apply(null, arguments); - }; - } -}); - -// node_modules/follow-redirects/index.js -var require_follow_redirects = __commonJS({ - "node_modules/follow-redirects/index.js"(exports2, module2) { - var url2 = require("url"); - var URL2 = url2.URL; - var http = require("http"); - var https3 = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug6 = require_debug3(); - (function detectUnsupportedEnvironment() { - var looksLikeNode = typeof process !== "undefined"; - var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; - var looksLikeV8 = isFunction(Error.captureStackTrace); - if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { - console.warn("The follow-redirects package should be excluded from browser builds."); - } - })(); - var useNativeURL = false; - try { - assert(new URL2("")); - } catch (error3) { - useNativeURL = error3.code === "ERR_INVALID_URL"; - } - var sensitiveHeaders = [ - "Authorization", - "Proxy-Authorization", - "Cookie" - ]; - var preservedUrlFields = [ - "auth", - "host", - "hostname", - "href", - "path", - "pathname", - "port", - "protocol", - "query", - "search", - "hash" - ]; - var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; - var eventHandlers = /* @__PURE__ */ Object.create(null); - events.forEach(function(event) { - eventHandlers[event] = function(arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; - }); - var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError - ); - var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" - ); - var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded", - RedirectionError - ); - var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" - ); - var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" - ); - var destroy = Writable.prototype.destroy || noop3; - function RedirectableRequest(options, responseCallback) { - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - if (responseCallback) { - this.on("response", responseCallback); - } - var self2 = this; - this._onNativeResponse = function(response) { - try { - self2._processResponse(response); - } catch (cause) { - self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); - } - }; - this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + ")$", "i"); - this._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); - }; - RedirectableRequest.prototype.destroy = function(error3) { - destroyRequest(this._currentRequest, error3); - destroy.call(this, error3); - return this; - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString3(data) && !isBuffer(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data, encoding }); - this._currentRequest.write(data, encoding, callback); - } else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } - }; - RedirectableRequest.prototype.end = function(data, encoding, callback) { - if (isFunction(data)) { - callback = data; - data = encoding = null; - } else if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } else { - var self2 = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function() { - self2._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } - }; - RedirectableRequest.prototype.setHeader = function(name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); - }; - RedirectableRequest.prototype.removeHeader = function(name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); - }; - RedirectableRequest.prototype.setTimeout = function(msecs, callback) { - var self2 = this; - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - function startTimer(socket) { - if (self2._timeout) { - clearTimeout(self2._timeout); - } - self2._timeout = setTimeout(function() { - self2.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - function clearTimer() { - if (self2._timeout) { - clearTimeout(self2._timeout); - self2._timeout = null; - } - self2.removeListener("abort", clearTimer); - self2.removeListener("error", clearTimer); - self2.removeListener("response", clearTimer); - self2.removeListener("close", clearTimer); - if (callback) { - self2.removeListener("timeout", callback); - } - if (!self2.socket) { - self2._currentRequest.removeListener("socket", startTimer); - } - } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); - } - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - this.on("close", clearTimer); - return this; - }; - [ - "flushHeaders", - "getHeader", - "setNoDelay", - "setSocketKeepAlive" - ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a, b) { - return this._currentRequest[method](a, b); - }; - }); - ["aborted", "connection", "socket"].forEach(function(property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function() { - return this._currentRequest[property]; - } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (!isArray2(options.sensitiveHeaders)) { - options.sensitiveHeaders = []; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } - }; - RedirectableRequest.prototype._performRequest = function() { - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - throw new TypeError("Unsupported protocol " + protocol); - } - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - var request3 = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request3._redirectable = this; - for (var event of events) { - request3.on(event, eventHandlers[event]); - } - this._currentUrl = /^\//.test(this._options.path) ? url2.format(this._options) : ( - // When making a request to a proxy, […] - // a client MUST send the target URI in absolute-form […]. - this._options.path - ); - if (this._isRedirect) { - var i = 0; - var self2 = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error3) { - if (request3 === self2._currentRequest) { - if (error3) { - self2.emit("error", error3); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request3.finished) { - request3.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self2._ended) { - request3.end(); - } - } - })(); - } - }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode - }); - } - var location = response.headers.location; - if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - this._requestBodyBuffers = []; - return; - } - destroyRequest(this._currentRequest); - response.destroy(); - if (++this._redirectCount > this._options.maxRedirects) { - throw new TooManyRedirectsError(); - } - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host") - }, this._options.headers); - } - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - var currentUrlParts = parseUrl2(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl = resolveUrl(location, currentUrl); - debug6("redirecting to", redirectUrl.href); - this._isRedirect = true; - spreadUrlObject(redirectUrl, this._options); - if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { - removeMatchingHeaders(this._headerFilter, this._options.headers); - } - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode - }; - var requestDetails = { - url: currentUrl, - method, - headers: requestHeaders - }; - beforeRedirect(this._options, responseDetails, requestDetails); - this._sanitizeOptions(this._options); - } - this._performRequest(); - }; - function wrap(protocols) { - var exports3 = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024 - }; - var nativeProtocols = {}; - Object.keys(protocols).forEach(function(scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol); - function request3(input, options, callback) { - if (isURL(input)) { - input = spreadUrlObject(input); - } else if (isString3(input)) { - input = spreadUrlObject(parseUrl2(input)); - } else { - callback = options; - options = validateUrl(input); - input = { protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; - } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString3(options.host) && !isString3(options.hostname)) { - options.hostname = "::1"; - } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug6("options", options); - return new RedirectableRequest(options, callback); - } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - Object.defineProperties(wrappedProtocol, { - request: { value: request3, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); - }); - return exports3; - } - function noop3() { - } - function parseUrl2(input) { - var parsed; - if (useNativeURL) { - parsed = new URL2(input); - } else { - parsed = validateUrl(url2.parse(input)); - if (!isString3(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - } - return parsed; - } - function resolveUrl(relative3, base) { - return useNativeURL ? new URL2(relative3, base) : parseUrl2(url2.resolve(base, relative3)); - } - function validateUrl(input) { - if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { - throw new InvalidUrlError({ input: input.href || input }); - } - if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { - throw new InvalidUrlError({ input: input.href || input }); - } - return input; - } - function spreadUrlObject(urlObject, target) { - var spread = target || {}; - for (var key of preservedUrlFields) { - spread[key] = urlObject[key]; - } - if (spread.hostname.startsWith("[")) { - spread.hostname = spread.hostname.slice(1, -1); - } - if (spread.port !== "") { - spread.port = Number(spread.port); - } - spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; - return spread; - } - function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); - } - function createErrorType(code, message, baseClass) { - function CustomError(properties) { - if (isFunction(Error.captureStackTrace)) { - Error.captureStackTrace(this, this.constructor); - } - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } - CustomError.prototype = new (baseClass || Error)(); - Object.defineProperties(CustomError.prototype, { - constructor: { - value: CustomError, - enumerable: false - }, - name: { - value: "Error [" + code + "]", - enumerable: false - } - }); - return CustomError; - } - function destroyRequest(request3, error3) { - for (var event of events) { - request3.removeListener(event, eventHandlers[event]); - } - request3.on("error", noop3); - request3.destroy(error3); - } - function isSubdomain(subdomain, domain) { - assert(isString3(subdomain) && isString3(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - function isArray2(value) { - return value instanceof Array; - } - function isString3(value) { - return typeof value === "string" || value instanceof String; - } - function isFunction(value) { - return typeof value === "function"; - } - function isBuffer(value) { - return typeof value === "object" && "length" in value; - } - function isURL(value) { - return URL2 && value instanceof URL2; - } - function escapeRegex(regex) { - return regex.replace(/[\]\\/()*+?.$]/g, "\\$&"); - } - module2.exports = wrap({ http, https: https3 }); - module2.exports.wrap = wrap; - } -}); - -// src/sarif-schema-2.1.0.json -var require_sarif_schema_2_1_0 = __commonJS({ - "src/sarif-schema-2.1.0.json"(exports2, module2) { - module2.exports = { - $schema: "https://json-schema.org/draft/2020-12/schema", - title: "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema", - $id: "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", - description: "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.", - additionalProperties: false, - type: "object", - properties: { - $schema: { - description: "The URI of the JSON schema corresponding to the version.", - type: "string", - format: "uri" - }, - version: { - description: "The SARIF format version of this log file.", - enum: ["2.1.0"], - type: "string" - }, - runs: { - description: "The set of runs contained in this log file.", - type: ["array", "null"], - minItems: 0, - uniqueItems: false, - items: { - $ref: "#/definitions/run" - } - }, - inlineExternalProperties: { - description: "References to external property files that share data between runs.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/externalProperties" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the log file.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["version", "runs"], - definitions: { - address: { - description: "A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).", - additionalProperties: false, - type: "object", - properties: { - absoluteAddress: { - description: "The address expressed as a byte offset from the start of the addressable region.", - type: "integer", - minimum: -1, - default: -1 - }, - relativeAddress: { - description: "The address expressed as a byte offset from the absolute address of the top-most parent object.", - type: "integer" - }, - length: { - description: "The number of bytes in this range of addresses.", - type: "integer" - }, - kind: { - description: "An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values.", - type: "string" - }, - name: { - description: "A name that is associated with the address, e.g., '.text'.", - type: "string" - }, - fullyQualifiedName: { - description: "A human-readable fully qualified name that is associated with the address.", - type: "string" - }, - offsetFromParent: { - description: "The byte offset of this address from the absolute or relative address of the parent object.", - type: "integer" - }, - index: { - description: "The index within run.addresses of the cached object for this address.", - type: "integer", - default: -1, - minimum: -1 - }, - parentIndex: { - description: "The index within run.addresses of the parent object.", - type: "integer", - default: -1, - minimum: -1 - }, - properties: { - description: "Key/value pairs that provide additional information about the address.", - $ref: "#/definitions/propertyBag" - } - } - }, - artifact: { - description: "A single artifact. In some cases, this artifact might be nested within another artifact.", - additionalProperties: false, - type: "object", - properties: { - description: { - description: "A short description of the artifact.", - $ref: "#/definitions/message" - }, - location: { - description: "The location of the artifact.", - $ref: "#/definitions/artifactLocation" - }, - parentIndex: { - description: "Identifies the index of the immediate parent of the artifact, if this artifact is nested.", - type: "integer", - default: -1, - minimum: -1 - }, - offset: { - description: "The offset in bytes of the artifact within its containing artifact.", - type: "integer", - minimum: 0 - }, - length: { - description: "The length of the artifact in bytes.", - type: "integer", - default: -1, - minimum: -1 - }, - roles: { - description: "The role or roles played by the artifact in the analysis.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - enum: [ - "analysisTarget", - "attachment", - "responseFile", - "resultFile", - "standardStream", - "tracedFile", - "unmodified", - "modified", - "added", - "deleted", - "renamed", - "uncontrolled", - "driver", - "extension", - "translation", - "taxonomy", - "policy", - "referencedOnCommandLine", - "memoryContents", - "directory", - "userSpecifiedConfiguration", - "toolSpecifiedConfiguration", - "debugOutputFile" - ], - type: "string" - } - }, - mimeType: { - description: "The MIME type (RFC 2045) of the artifact.", - type: "string", - pattern: "[^/]+/.+" - }, - contents: { - description: "The contents of the artifact.", - $ref: "#/definitions/artifactContent" - }, - encoding: { - description: "Specifies the encoding for an artifact object that refers to a text file.", - type: "string" - }, - sourceLanguage: { - description: "Specifies the source language for any artifact object that refers to a text file that contains source code.", - type: "string" - }, - hashes: { - description: "A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function.", - type: "object", - additionalProperties: { - type: "string" - } - }, - lastModifiedTimeUtc: { - description: 'The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the SARIF spec for the required format.', - type: "string", - format: "date-time" - }, - properties: { - description: "Key/value pairs that provide additional information about the artifact.", - $ref: "#/definitions/propertyBag" - } - } - }, - artifactChange: { - description: "A change to a single artifact.", - additionalProperties: false, - type: "object", - properties: { - artifactLocation: { - description: "The location of the artifact to change.", - $ref: "#/definitions/artifactLocation" - }, - replacements: { - description: "An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.", - type: "array", - minItems: 1, - uniqueItems: false, - items: { - $ref: "#/definitions/replacement" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the change.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["artifactLocation", "replacements"] - }, - artifactContent: { - description: "Represents the contents of an artifact.", - type: "object", - additionalProperties: false, - properties: { - text: { - description: "UTF-8-encoded content from a text artifact.", - type: "string" - }, - binary: { - description: "MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.", - type: "string" - }, - rendered: { - description: "An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region).", - $ref: "#/definitions/multiformatMessageString" - }, - properties: { - description: "Key/value pairs that provide additional information about the artifact content.", - $ref: "#/definitions/propertyBag" - } - } - }, - artifactLocation: { - description: "Specifies the location of an artifact.", - additionalProperties: false, - type: "object", - properties: { - uri: { - description: "A string containing a valid relative or absolute URI.", - type: "string", - format: "uri-reference" - }, - uriBaseId: { - description: 'A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted.', - type: "string" - }, - index: { - description: "The index within the run artifacts array of the artifact object associated with the artifact location.", - type: "integer", - default: -1, - minimum: -1 - }, - description: { - description: "A short description of the artifact location.", - $ref: "#/definitions/message" - }, - properties: { - description: "Key/value pairs that provide additional information about the artifact location.", - $ref: "#/definitions/propertyBag" - } - } - }, - attachment: { - description: "An artifact relevant to a result.", - type: "object", - additionalProperties: false, - properties: { - description: { - description: "A message describing the role played by the attachment.", - $ref: "#/definitions/message" - }, - artifactLocation: { - description: "The location of the attachment.", - $ref: "#/definitions/artifactLocation" - }, - regions: { - description: "An array of regions of interest within the attachment.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/region" - } - }, - rectangles: { - description: "An array of rectangles specifying areas of interest within the image.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/rectangle" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the attachment.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["artifactLocation"] - }, - codeFlow: { - description: "A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.", - additionalProperties: false, - type: "object", - properties: { - message: { - description: "A message relevant to the code flow.", - $ref: "#/definitions/message" - }, - threadFlows: { - description: "An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.", - type: "array", - minItems: 1, - uniqueItems: false, - items: { - $ref: "#/definitions/threadFlow" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the code flow.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["threadFlows"] - }, - configurationOverride: { - description: "Information about how a specific rule or notification was reconfigured at runtime.", - type: "object", - additionalProperties: false, - properties: { - configuration: { - description: "Specifies how the rule or notification was configured during the scan.", - $ref: "#/definitions/reportingConfiguration" - }, - descriptor: { - description: "A reference used to locate the descriptor whose configuration was overridden.", - $ref: "#/definitions/reportingDescriptorReference" - }, - properties: { - description: "Key/value pairs that provide additional information about the configuration override.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["configuration", "descriptor"] - }, - conversion: { - description: "Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format.", - additionalProperties: false, - type: "object", - properties: { - tool: { - description: "A tool object that describes the converter.", - $ref: "#/definitions/tool" - }, - invocation: { - description: "An invocation object that describes the invocation of the converter.", - $ref: "#/definitions/invocation" - }, - analysisToolLogFiles: { - description: "The locations of the analysis tool's per-run log files.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/artifactLocation" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the conversion.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["tool"] - }, - edge: { - description: "Represents a directed edge in a graph.", - type: "object", - additionalProperties: false, - properties: { - id: { - description: "A string that uniquely identifies the edge within its graph.", - type: "string" - }, - label: { - description: "A short description of the edge.", - $ref: "#/definitions/message" - }, - sourceNodeId: { - description: "Identifies the source node (the node at which the edge starts).", - type: "string" - }, - targetNodeId: { - description: "Identifies the target node (the node at which the edge ends).", - type: "string" - }, - properties: { - description: "Key/value pairs that provide additional information about the edge.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["id", "sourceNodeId", "targetNodeId"] - }, - edgeTraversal: { - description: "Represents the traversal of a single edge during a graph traversal.", - type: "object", - additionalProperties: false, - properties: { - edgeId: { - description: "Identifies the edge being traversed.", - type: "string" - }, - message: { - description: "A message to display to the user as the edge is traversed.", - $ref: "#/definitions/message" - }, - finalState: { - description: "The values of relevant expressions after the edge has been traversed.", - type: "object", - additionalProperties: { - $ref: "#/definitions/multiformatMessageString" - } - }, - stepOverEdgeCount: { - description: "The number of edge traversals necessary to return from a nested graph.", - type: "integer", - minimum: 0 - }, - properties: { - description: "Key/value pairs that provide additional information about the edge traversal.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["edgeId"] - }, - exception: { - description: "Describes a runtime exception encountered during the execution of an analysis tool.", - type: "object", - additionalProperties: false, - properties: { - kind: { - type: "string", - description: "A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal." - }, - message: { - description: "A message that describes the exception.", - type: "string" - }, - stack: { - description: "The sequence of function calls leading to the exception.", - $ref: "#/definitions/stack" - }, - innerExceptions: { - description: "An array of exception objects each of which is considered a cause of this exception.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/exception" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the exception.", - $ref: "#/definitions/propertyBag" - } - } - }, - externalProperties: { - description: "The top-level element of an external property file.", - type: "object", - additionalProperties: false, - properties: { - schema: { - description: "The URI of the JSON schema corresponding to the version of the external property file format.", - type: "string", - format: "uri" - }, - version: { - description: "The SARIF format version of this external properties object.", - enum: ["2.1.0"], - type: "string" - }, - guid: { - description: "A stable, unique identifier for this external properties object, in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - runGuid: { - description: "A stable, unique identifier for the run associated with this external properties object, in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - conversion: { - description: "A conversion object that will be merged with a separate run.", - $ref: "#/definitions/conversion" - }, - graphs: { - description: "An array of graph objects that will be merged with a separate run.", - type: "array", - minItems: 0, - default: [], - uniqueItems: true, - items: { - $ref: "#/definitions/graph" - } - }, - externalizedProperties: { - description: "Key/value pairs that provide additional information that will be merged with a separate run.", - $ref: "#/definitions/propertyBag" - }, - artifacts: { - description: "An array of artifact objects that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/artifact" - } - }, - invocations: { - description: "Describes the invocation of the analysis tool that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/invocation" - } - }, - logicalLocations: { - description: "An array of logical locations such as namespaces, types or functions that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/logicalLocation" - } - }, - threadFlowLocations: { - description: "An array of threadFlowLocation objects that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/threadFlowLocation" - } - }, - results: { - description: "An array of result objects that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/result" - } - }, - taxonomies: { - description: "Tool taxonomies that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponent" - } - }, - driver: { - description: "The analysis tool object that will be merged with a separate run.", - $ref: "#/definitions/toolComponent" - }, - extensions: { - description: "Tool extensions that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponent" - } - }, - policies: { - description: "Tool policies that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponent" - } - }, - translations: { - description: "Tool translations that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponent" - } - }, - addresses: { - description: "Addresses that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/address" - } - }, - webRequests: { - description: "Requests that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/webRequest" - } - }, - webResponses: { - description: "Responses that will be merged with a separate run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/webResponse" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the external properties.", - $ref: "#/definitions/propertyBag" - } - } - }, - externalPropertyFileReference: { - description: "Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run.", - type: "object", - additionalProperties: false, - properties: { - location: { - description: "The location of the external property file.", - $ref: "#/definitions/artifactLocation" - }, - guid: { - description: "A stable, unique identifier for the external property file in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - itemCount: { - description: "A non-negative integer specifying the number of items contained in the external property file.", - type: "integer", - default: -1, - minimum: -1 - }, - properties: { - description: "Key/value pairs that provide additional information about the external property file.", - $ref: "#/definitions/propertyBag" - } - }, - anyOf: [ - { required: ["location"] }, - { required: ["guid"] } - ] - }, - externalPropertyFileReferences: { - description: "References to external property files that should be inlined with the content of a root log file.", - additionalProperties: false, - type: "object", - properties: { - conversion: { - description: "An external property file containing a run.conversion object to be merged with the root log file.", - $ref: "#/definitions/externalPropertyFileReference" - }, - graphs: { - description: "An array of external property files containing a run.graphs object to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - externalizedProperties: { - description: "An external property file containing a run.properties object to be merged with the root log file.", - $ref: "#/definitions/externalPropertyFileReference" - }, - artifacts: { - description: "An array of external property files containing run.artifacts arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - invocations: { - description: "An array of external property files containing run.invocations arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - logicalLocations: { - description: "An array of external property files containing run.logicalLocations arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - threadFlowLocations: { - description: "An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - results: { - description: "An array of external property files containing run.results arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - taxonomies: { - description: "An array of external property files containing run.taxonomies arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - addresses: { - description: "An array of external property files containing run.addresses arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - driver: { - description: "An external property file containing a run.driver object to be merged with the root log file.", - $ref: "#/definitions/externalPropertyFileReference" - }, - extensions: { - description: "An array of external property files containing run.extensions arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - policies: { - description: "An array of external property files containing run.policies arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - translations: { - description: "An array of external property files containing run.translations arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - webRequests: { - description: "An array of external property files containing run.requests arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - webResponses: { - description: "An array of external property files containing run.responses arrays to be merged with the root log file.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/externalPropertyFileReference" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the external property files.", - $ref: "#/definitions/propertyBag" - } - } - }, - fix: { - description: "A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.", - additionalProperties: false, - type: "object", - properties: { - description: { - description: "A message that describes the proposed fix, enabling viewers to present the proposed change to an end user.", - $ref: "#/definitions/message" - }, - artifactChanges: { - description: "One or more artifact changes that comprise a fix for a result.", - type: "array", - minItems: 1, - uniqueItems: true, - items: { - $ref: "#/definitions/artifactChange" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the fix.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["artifactChanges"] - }, - graph: { - description: "A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph).", - type: "object", - additionalProperties: false, - properties: { - description: { - description: "A description of the graph.", - $ref: "#/definitions/message" - }, - nodes: { - description: "An array of node objects representing the nodes of the graph.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/node" - } - }, - edges: { - description: "An array of edge objects representing the edges of the graph.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/edge" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the graph.", - $ref: "#/definitions/propertyBag" - } - } - }, - graphTraversal: { - description: "Represents a path through a graph.", - type: "object", - additionalProperties: false, - properties: { - runGraphIndex: { - description: "The index within the run.graphs to be associated with the result.", - type: "integer", - default: -1, - minimum: -1 - }, - resultGraphIndex: { - description: "The index within the result.graphs to be associated with the result.", - type: "integer", - default: -1, - minimum: -1 - }, - description: { - description: "A description of this graph traversal.", - $ref: "#/definitions/message" - }, - initialState: { - description: "Values of relevant expressions at the start of the graph traversal that may change during graph traversal.", - type: "object", - additionalProperties: { - $ref: "#/definitions/multiformatMessageString" - } - }, - immutableState: { - description: "Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.", - type: "object", - additionalProperties: { - $ref: "#/definitions/multiformatMessageString" - } - }, - edgeTraversals: { - description: "The sequences of edges traversed by this graph traversal.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/edgeTraversal" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the graph traversal.", - $ref: "#/definitions/propertyBag" - } - }, - oneOf: [ - { required: ["runGraphIndex"] }, - { required: ["resultGraphIndex"] } - ] - }, - invocation: { - description: "The runtime environment of the analysis tool run.", - additionalProperties: false, - type: "object", - properties: { - commandLine: { - description: "The command line used to invoke the tool.", - type: "string" - }, - arguments: { - description: "An array of strings, containing in order the command line arguments passed to the tool from the operating system.", - type: "array", - minItems: 0, - uniqueItems: false, - items: { - type: "string" - } - }, - responseFiles: { - description: "The locations of any response files specified on the tool's command line.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/artifactLocation" - } - }, - startTimeUtc: { - description: 'The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for the required format.', - type: "string", - format: "date-time" - }, - endTimeUtc: { - description: 'The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the required format.', - type: "string", - format: "date-time" - }, - exitCode: { - description: "The process exit code.", - type: "integer" - }, - ruleConfigurationOverrides: { - description: "An array of configurationOverride objects that describe rules related runtime overrides.", - type: "array", - minItems: 0, - default: [], - uniqueItems: true, - items: { - $ref: "#/definitions/configurationOverride" - } - }, - notificationConfigurationOverrides: { - description: "An array of configurationOverride objects that describe notifications related runtime overrides.", - type: "array", - minItems: 0, - default: [], - uniqueItems: true, - items: { - $ref: "#/definitions/configurationOverride" - } - }, - toolExecutionNotifications: { - description: "A list of runtime conditions detected by the tool during the analysis.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/notification" - } - }, - toolConfigurationNotifications: { - description: "A list of conditions detected by the tool that are relevant to the tool's configuration.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/notification" - } - }, - exitCodeDescription: { - description: "The reason for the process exit.", - type: "string" - }, - exitSignalName: { - description: "The name of the signal that caused the process to exit.", - type: "string" - }, - exitSignalNumber: { - description: "The numeric value of the signal that caused the process to exit.", - type: "integer" - }, - processStartFailureMessage: { - description: "The reason given by the operating system that the process failed to start.", - type: "string" - }, - executionSuccessful: { - description: "Specifies whether the tool's execution completed successfully.", - type: "boolean" - }, - machine: { - description: "The machine on which the invocation occurred.", - type: "string" - }, - account: { - description: "The account under which the invocation occurred.", - type: "string" - }, - processId: { - description: "The id of the process in which the invocation occurred.", - type: "integer" - }, - executableLocation: { - description: "An absolute URI specifying the location of the executable that was invoked.", - $ref: "#/definitions/artifactLocation" - }, - workingDirectory: { - description: "The working directory for the invocation.", - $ref: "#/definitions/artifactLocation" - }, - environmentVariables: { - description: "The environment variables associated with the analysis tool process, expressed as key/value pairs.", - type: "object", - additionalProperties: { - type: "string" - } - }, - stdin: { - description: "A file containing the standard input stream to the process that was invoked.", - $ref: "#/definitions/artifactLocation" - }, - stdout: { - description: "A file containing the standard output stream from the process that was invoked.", - $ref: "#/definitions/artifactLocation" - }, - stderr: { - description: "A file containing the standard error stream from the process that was invoked.", - $ref: "#/definitions/artifactLocation" - }, - stdoutStderr: { - description: "A file containing the interleaved standard output and standard error stream from the process that was invoked.", - $ref: "#/definitions/artifactLocation" - }, - properties: { - description: "Key/value pairs that provide additional information about the invocation.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["executionSuccessful"] - }, - location: { - description: "A location within a programming artifact.", - additionalProperties: false, - type: "object", - properties: { - id: { - description: "Value that distinguishes this location from all other locations within a single result object.", - type: "integer", - minimum: -1, - default: -1 - }, - physicalLocation: { - description: "Identifies the artifact and region.", - $ref: "#/definitions/physicalLocation" - }, - logicalLocations: { - description: "The logical locations associated with the result.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/logicalLocation" - } - }, - message: { - description: "A message relevant to the location.", - $ref: "#/definitions/message" - }, - annotations: { - description: "A set of regions relevant to the location.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/region" - } - }, - relationships: { - description: "An array of objects that describe relationships between this location and others.", - type: "array", - default: [], - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/locationRelationship" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the location.", - $ref: "#/definitions/propertyBag" - } - } - }, - locationRelationship: { - description: "Information about the relation of one location to another.", - type: "object", - additionalProperties: false, - properties: { - target: { - description: "A reference to the related location.", - type: "integer", - minimum: 0 - }, - kinds: { - description: "A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.", - type: "array", - default: ["relevant"], - uniqueItems: true, - items: { - type: "string" - } - }, - description: { - description: "A description of the location relationship.", - $ref: "#/definitions/message" - }, - properties: { - description: "Key/value pairs that provide additional information about the location relationship.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["target"] - }, - logicalLocation: { - description: "A logical location of a construct that produced a result.", - additionalProperties: false, - type: "object", - properties: { - name: { - description: "Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.", - type: "string" - }, - index: { - description: "The index within the logical locations array.", - type: "integer", - default: -1, - minimum: -1 - }, - fullyQualifiedName: { - description: "The human-readable fully qualified name of the logical location.", - type: "string" - }, - decoratedName: { - description: "The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.", - type: "string" - }, - parentIndex: { - description: "Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.", - type: "integer", - default: -1, - minimum: -1 - }, - kind: { - description: "The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.", - type: "string" - }, - properties: { - description: "Key/value pairs that provide additional information about the logical location.", - $ref: "#/definitions/propertyBag" - } - } - }, - message: { - description: "Encapsulates a message intended to be read by the end user.", - type: "object", - additionalProperties: false, - properties: { - text: { - description: "A plain text message string.", - type: "string" - }, - markdown: { - description: "A Markdown message string.", - type: "string" - }, - id: { - description: "The identifier for this message.", - type: "string" - }, - arguments: { - description: "An array of strings to substitute into the message string.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - type: "string" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the message.", - $ref: "#/definitions/propertyBag" - } - }, - anyOf: [ - { required: ["text"] }, - { required: ["id"] } - ] - }, - multiformatMessageString: { - description: "A message string or message format string rendered in multiple formats.", - type: "object", - additionalProperties: false, - properties: { - text: { - description: "A plain text message string or format string.", - type: "string" - }, - markdown: { - description: "A Markdown message string or format string.", - type: "string" - }, - properties: { - description: "Key/value pairs that provide additional information about the message.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["text"] - }, - node: { - description: "Represents a node in a graph.", - type: "object", - additionalProperties: false, - properties: { - id: { - description: "A string that uniquely identifies the node within its graph.", - type: "string" - }, - label: { - description: "A short description of the node.", - $ref: "#/definitions/message" - }, - location: { - description: "A code location associated with the node.", - $ref: "#/definitions/location" - }, - children: { - description: "Array of child nodes.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/node" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the node.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["id"] - }, - notification: { - description: "Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.", - type: "object", - additionalProperties: false, - properties: { - locations: { - description: "The locations relevant to this notification.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/location" - } - }, - message: { - description: "A message that describes the condition that was encountered.", - $ref: "#/definitions/message" - }, - level: { - description: "A value specifying the severity level of the notification.", - default: "warning", - enum: ["none", "note", "warning", "error"], - type: "string" - }, - threadId: { - description: "The thread identifier of the code that generated the notification.", - type: "integer" - }, - timeUtc: { - description: "The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification.", - type: "string", - format: "date-time" - }, - exception: { - description: "The runtime exception, if any, relevant to this notification.", - $ref: "#/definitions/exception" - }, - descriptor: { - description: "A reference used to locate the descriptor relevant to this notification.", - $ref: "#/definitions/reportingDescriptorReference" - }, - associatedRule: { - description: "A reference used to locate the rule descriptor associated with this notification.", - $ref: "#/definitions/reportingDescriptorReference" - }, - properties: { - description: "Key/value pairs that provide additional information about the notification.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["message"] - }, - physicalLocation: { - description: "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.", - additionalProperties: false, - type: "object", - properties: { - address: { - description: "The address of the location.", - $ref: "#/definitions/address" - }, - artifactLocation: { - description: "The location of the artifact.", - $ref: "#/definitions/artifactLocation" - }, - region: { - description: "Specifies a portion of the artifact.", - $ref: "#/definitions/region" - }, - contextRegion: { - description: "Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.", - $ref: "#/definitions/region" - }, - properties: { - description: "Key/value pairs that provide additional information about the physical location.", - $ref: "#/definitions/propertyBag" - } - }, - anyOf: [ - { - required: ["address"] - }, - { - required: ["artifactLocation"] - } - ] - }, - propertyBag: { - description: "Key/value pairs that provide additional information about the object.", - type: "object", - additionalProperties: true, - properties: { - tags: { - description: "A set of distinct strings that provide additional information.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - type: "string" - } - } - } - }, - rectangle: { - description: "An area within an image.", - additionalProperties: false, - type: "object", - properties: { - top: { - description: "The Y coordinate of the top edge of the rectangle, measured in the image's natural units.", - type: "number" - }, - left: { - description: "The X coordinate of the left edge of the rectangle, measured in the image's natural units.", - type: "number" - }, - bottom: { - description: "The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units.", - type: "number" - }, - right: { - description: "The X coordinate of the right edge of the rectangle, measured in the image's natural units.", - type: "number" - }, - message: { - description: "A message relevant to the rectangle.", - $ref: "#/definitions/message" - }, - properties: { - description: "Key/value pairs that provide additional information about the rectangle.", - $ref: "#/definitions/propertyBag" - } - } - }, - region: { - description: "A region within an artifact where a result was detected.", - additionalProperties: false, - type: "object", - properties: { - startLine: { - description: "The line number of the first character in the region.", - type: "integer", - minimum: 1 - }, - startColumn: { - description: "The column number of the first character in the region.", - type: "integer", - minimum: 1 - }, - endLine: { - description: "The line number of the last character in the region.", - type: "integer", - minimum: 1 - }, - endColumn: { - description: "The column number of the character following the end of the region.", - type: "integer", - minimum: 1 - }, - charOffset: { - description: "The zero-based offset from the beginning of the artifact of the first character in the region.", - type: "integer", - default: -1, - minimum: -1 - }, - charLength: { - description: "The length of the region in characters.", - type: "integer", - minimum: 0 - }, - byteOffset: { - description: "The zero-based offset from the beginning of the artifact of the first byte in the region.", - type: "integer", - default: -1, - minimum: -1 - }, - byteLength: { - description: "The length of the region in bytes.", - type: "integer", - minimum: 0 - }, - snippet: { - description: "The portion of the artifact contents within the specified region.", - $ref: "#/definitions/artifactContent" - }, - message: { - description: "A message relevant to the region.", - $ref: "#/definitions/message" - }, - sourceLanguage: { - description: "Specifies the source language, if any, of the portion of the artifact specified by the region object.", - type: "string" - }, - properties: { - description: "Key/value pairs that provide additional information about the region.", - $ref: "#/definitions/propertyBag" - }, - anyOf: [ - { required: ["startLine"] }, - { required: ["charOffset"] }, - { required: ["byteOffset"] } - ] - } - }, - replacement: { - description: "The replacement of a single region of an artifact.", - additionalProperties: false, - type: "object", - properties: { - deletedRegion: { - description: "The region of the artifact to delete.", - $ref: "#/definitions/region" - }, - insertedContent: { - description: "The content to insert at the location specified by the 'deletedRegion' property.", - $ref: "#/definitions/artifactContent" - }, - properties: { - description: "Key/value pairs that provide additional information about the replacement.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["deletedRegion"] - }, - reportingDescriptor: { - description: "Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting.", - additionalProperties: false, - type: "object", - properties: { - id: { - description: "A stable, opaque identifier for the report.", - type: "string" - }, - deprecatedIds: { - description: "An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - type: "string" - } - }, - guid: { - description: "A unique identifier for the reporting descriptor in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - deprecatedGuids: { - description: "An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - } - }, - name: { - description: "A report identifier that is understandable to an end user.", - type: "string" - }, - deprecatedNames: { - description: "An array of readable identifiers by which this report was known in some previous version of the analysis tool.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - type: "string" - } - }, - shortDescription: { - description: "A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text.", - $ref: "#/definitions/multiformatMessageString" - }, - fullDescription: { - description: "A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.", - $ref: "#/definitions/multiformatMessageString" - }, - messageStrings: { - description: "A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", - type: "object", - additionalProperties: { - $ref: "#/definitions/multiformatMessageString" - } - }, - defaultConfiguration: { - description: "Default reporting configuration information.", - $ref: "#/definitions/reportingConfiguration" - }, - helpUri: { - description: "A URI where the primary documentation for the report can be found.", - type: "string", - format: "uri" - }, - help: { - description: "Provides the primary documentation for the report, useful when there is no online documentation.", - $ref: "#/definitions/multiformatMessageString" - }, - relationships: { - description: "An array of objects that describe relationships between this reporting descriptor and others.", - type: "array", - default: [], - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/reportingDescriptorRelationship" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the report.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["id"] - }, - reportingConfiguration: { - description: "Information about a rule or notification that can be configured at runtime.", - type: "object", - additionalProperties: false, - properties: { - enabled: { - description: "Specifies whether the report may be produced during the scan.", - type: "boolean", - default: true - }, - level: { - description: "Specifies the failure level for the report.", - default: "warning", - enum: ["none", "note", "warning", "error"], - type: "string" - }, - rank: { - description: "Specifies the relative priority of the report. Used for analysis output only.", - type: "number", - default: -1, - minimum: -1, - maximum: 100 - }, - parameters: { - description: "Contains configuration information specific to a report.", - $ref: "#/definitions/propertyBag" - }, - properties: { - description: "Key/value pairs that provide additional information about the reporting configuration.", - $ref: "#/definitions/propertyBag" - } - } - }, - reportingDescriptorReference: { - description: "Information about how to locate a relevant reporting descriptor.", - type: "object", - additionalProperties: false, - properties: { - id: { - description: "The id of the descriptor.", - type: "string" - }, - index: { - description: "The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.", - type: "integer", - default: -1, - minimum: -1 - }, - guid: { - description: "A guid that uniquely identifies the descriptor.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - toolComponent: { - description: "A reference used to locate the toolComponent associated with the descriptor.", - $ref: "#/definitions/toolComponentReference" - }, - properties: { - description: "Key/value pairs that provide additional information about the reporting descriptor reference.", - $ref: "#/definitions/propertyBag" - } - }, - anyOf: [ - { required: ["index"] }, - { required: ["guid"] }, - { required: ["id"] } - ] - }, - reportingDescriptorRelationship: { - description: "Information about the relation of one reporting descriptor to another.", - type: "object", - additionalProperties: false, - properties: { - target: { - description: "A reference to the related reporting descriptor.", - $ref: "#/definitions/reportingDescriptorReference" - }, - kinds: { - description: "A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.", - type: "array", - default: ["relevant"], - uniqueItems: true, - items: { - type: "string" - } - }, - description: { - description: "A description of the reporting descriptor relationship.", - $ref: "#/definitions/message" - }, - properties: { - description: "Key/value pairs that provide additional information about the reporting descriptor reference.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["target"] - }, - result: { - description: "A result produced by an analysis tool.", - additionalProperties: false, - type: "object", - properties: { - ruleId: { - description: "The stable, unique identifier of the rule, if any, to which this result is relevant.", - type: "string" - }, - ruleIndex: { - description: "The index within the tool component rules array of the rule object associated with this result.", - type: "integer", - default: -1, - minimum: -1 - }, - rule: { - description: "A reference used to locate the rule descriptor relevant to this result.", - $ref: "#/definitions/reportingDescriptorReference" - }, - kind: { - description: "A value that categorizes results by evaluation state.", - default: "fail", - enum: ["notApplicable", "pass", "fail", "review", "open", "informational"], - type: "string" - }, - level: { - description: "A value specifying the severity level of the result.", - default: "warning", - enum: ["none", "note", "warning", "error"], - type: "string" - }, - message: { - description: "A message that describes the result. The first sentence of the message only will be displayed when visible space is limited.", - $ref: "#/definitions/message" - }, - analysisTarget: { - description: "Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred.", - $ref: "#/definitions/artifactLocation" - }, - locations: { - description: "The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/location" - } - }, - guid: { - description: "A stable, unique identifier for the result in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - correlationGuid: { - description: "A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - occurrenceCount: { - description: "A positive integer specifying the number of times this logically unique result was observed in this run.", - type: "integer", - minimum: 1 - }, - partialFingerprints: { - description: "A set of strings that contribute to the stable, unique identity of the result.", - type: "object", - additionalProperties: { - type: "string" - } - }, - fingerprints: { - description: "A set of strings each of which individually defines a stable, unique identity for the result.", - type: "object", - additionalProperties: { - type: "string" - } - }, - stacks: { - description: "An array of 'stack' objects relevant to the result.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/stack" - } - }, - codeFlows: { - description: "An array of 'codeFlow' objects relevant to the result.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/codeFlow" - } - }, - graphs: { - description: "An array of zero or more unique graph objects associated with the result.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/graph" - } - }, - graphTraversals: { - description: "An array of one or more unique 'graphTraversal' objects.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/graphTraversal" - } - }, - relatedLocations: { - description: "A set of locations relevant to this result.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/location" - } - }, - suppressions: { - description: "A set of suppressions relevant to this result.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/suppression" - } - }, - baselineState: { - description: "The state of a result relative to a baseline of a previous run.", - enum: [ - "new", - "unchanged", - "updated", - "absent" - ], - type: "string" - }, - rank: { - description: "A number representing the priority or importance of the result.", - type: "number", - default: -1, - minimum: -1, - maximum: 100 - }, - attachments: { - description: "A set of artifacts relevant to the result.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/attachment" - } - }, - hostedViewerUri: { - description: "An absolute URI at which the result can be viewed.", - type: "string", - format: "uri" - }, - workItemUris: { - description: "The URIs of the work items associated with this result.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - type: "string", - format: "uri" - } - }, - provenance: { - description: "Information about how and when the result was detected.", - $ref: "#/definitions/resultProvenance" - }, - fixes: { - description: "An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/fix" - } - }, - taxa: { - description: "An array of references to taxonomy reporting descriptors that are applicable to the result.", - type: "array", - default: [], - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/reportingDescriptorReference" - } - }, - webRequest: { - description: "A web request associated with this result.", - $ref: "#/definitions/webRequest" - }, - webResponse: { - description: "A web response associated with this result.", - $ref: "#/definitions/webResponse" - }, - properties: { - description: "Key/value pairs that provide additional information about the result.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["message"] - }, - resultProvenance: { - description: "Contains information about how and when a result was detected.", - additionalProperties: false, - type: "object", - properties: { - firstDetectionTimeUtc: { - description: 'The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for the required format.', - type: "string", - format: "date-time" - }, - lastDetectionTimeUtc: { - description: 'The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF spec for the required format.', - type: "string", - format: "date-time" - }, - firstDetectionRunGuid: { - description: "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - lastDetectionRunGuid: { - description: "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - invocationIndex: { - description: "The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.", - type: "integer", - default: -1, - minimum: -1 - }, - conversionSources: { - description: "An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/physicalLocation" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the result.", - $ref: "#/definitions/propertyBag" - } - } - }, - run: { - description: "Describes a single run of an analysis tool, and contains the reported output of that run.", - additionalProperties: false, - type: "object", - properties: { - tool: { - description: "Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.", - $ref: "#/definitions/tool" - }, - invocations: { - description: "Describes the invocation of the analysis tool.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/invocation" - } - }, - conversion: { - description: "A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format.", - $ref: "#/definitions/conversion" - }, - language: { - description: "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", - type: "string", - default: "en-US", - pattern: "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" - }, - versionControlProvenance: { - description: "Specifies the revision in version control of the artifacts that were scanned.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/versionControlDetails" - } - }, - originalUriBaseIds: { - description: "The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.", - type: "object", - additionalProperties: { - $ref: "#/definitions/artifactLocation" - } - }, - artifacts: { - description: "An array of artifact objects relevant to the run.", - type: "array", - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/artifact" - } - }, - logicalLocations: { - description: "An array of logical locations such as namespaces, types or functions.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/logicalLocation" - } - }, - graphs: { - description: "An array of zero or more unique graph objects associated with the run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/graph" - } - }, - results: { - description: "The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.", - type: "array", - minItems: 0, - uniqueItems: false, - items: { - $ref: "#/definitions/result" - } - }, - automationDetails: { - description: "Automation details that describe this run.", - $ref: "#/definitions/runAutomationDetails" - }, - runAggregates: { - description: "Automation details that describe the aggregate of runs to which this run belongs.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/runAutomationDetails" - } - }, - baselineGuid: { - description: "The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - redactionTokens: { - description: "An array of strings used to replace sensitive information in a redaction-aware property.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - type: "string" - } - }, - defaultEncoding: { - description: "Specifies the default encoding for any artifact object that refers to a text file.", - type: "string" - }, - defaultSourceLanguage: { - description: "Specifies the default source language for any artifact object that refers to a text file that contains source code.", - type: "string" - }, - newlineSequences: { - description: "An ordered list of character sequences that were treated as line breaks when computing region information for the run.", - type: "array", - minItems: 1, - uniqueItems: true, - default: ["\r\n", "\n"], - items: { - type: "string" - } - }, - columnKind: { - description: "Specifies the unit in which the tool measures columns.", - enum: ["utf16CodeUnits", "unicodeCodePoints"], - type: "string" - }, - externalPropertyFileReferences: { - description: "References to external property files that should be inlined with the content of a root log file.", - $ref: "#/definitions/externalPropertyFileReferences" - }, - threadFlowLocations: { - description: "An array of threadFlowLocation objects cached at run level.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/threadFlowLocation" - } - }, - taxonomies: { - description: "An array of toolComponent objects relevant to a taxonomy in which results are categorized.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponent" - } - }, - addresses: { - description: "Addresses associated with this run instance, if any.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - $ref: "#/definitions/address" - } - }, - translations: { - description: "The set of available translations of the localized data provided by the tool.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponent" - } - }, - policies: { - description: "Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponent" - } - }, - webRequests: { - description: "An array of request objects cached at run level.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/webRequest" - } - }, - webResponses: { - description: "An array of response objects cached at run level.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/webResponse" - } - }, - specialLocations: { - description: "A specialLocations object that defines locations of special significance to SARIF consumers.", - $ref: "#/definitions/specialLocations" - }, - properties: { - description: "Key/value pairs that provide additional information about the run.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["tool"] - }, - runAutomationDetails: { - description: "Information that describes a run's identity and role within an engineering system process.", - additionalProperties: false, - type: "object", - properties: { - description: { - description: "A description of the identity and role played within the engineering system by this object's containing run object.", - $ref: "#/definitions/message" - }, - id: { - description: "A hierarchical string that uniquely identifies this object's containing run object.", - type: "string" - }, - guid: { - description: "A stable, unique identifier for this object's containing run object in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - correlationGuid: { - description: "A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - properties: { - description: "Key/value pairs that provide additional information about the run automation details.", - $ref: "#/definitions/propertyBag" - } - } - }, - specialLocations: { - description: "Defines locations of special significance to SARIF consumers.", - type: "object", - additionalProperties: false, - properties: { - displayBase: { - description: "Provides a suggestion to SARIF consumers to display file paths relative to the specified location.", - $ref: "#/definitions/artifactLocation" - }, - properties: { - description: "Key/value pairs that provide additional information about the special locations.", - $ref: "#/definitions/propertyBag" - } - } - }, - stack: { - description: "A call stack that is relevant to a result.", - additionalProperties: false, - type: "object", - properties: { - message: { - description: "A message relevant to this call stack.", - $ref: "#/definitions/message" - }, - frames: { - description: "An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.", - type: "array", - minItems: 0, - uniqueItems: false, - items: { - $ref: "#/definitions/stackFrame" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the stack.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["frames"] - }, - stackFrame: { - description: "A function call within a stack trace.", - additionalProperties: false, - type: "object", - properties: { - location: { - description: "The location to which this stack frame refers.", - $ref: "#/definitions/location" - }, - module: { - description: "The name of the module that contains the code of this stack frame.", - type: "string" - }, - threadId: { - description: "The thread identifier of the stack frame.", - type: "integer" - }, - parameters: { - description: "The parameters of the call that is executing.", - type: "array", - minItems: 0, - uniqueItems: false, - default: [], - items: { - type: "string", - default: [] - } - }, - properties: { - description: "Key/value pairs that provide additional information about the stack frame.", - $ref: "#/definitions/propertyBag" - } - } - }, - suppression: { - description: "A suppression that is relevant to a result.", - additionalProperties: false, - type: "object", - properties: { - guid: { - description: "A stable, unique identifier for the suprression in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - kind: { - description: "A string that indicates where the suppression is persisted.", - enum: [ - "inSource", - "external" - ], - type: "string" - }, - status: { - description: "A string that indicates the review status of the suppression.", - enum: [ - "accepted", - "underReview", - "rejected" - ], - type: "string" - }, - justification: { - description: "A string representing the justification for the suppression.", - type: "string" - }, - location: { - description: "Identifies the location associated with the suppression.", - $ref: "#/definitions/location" - }, - properties: { - description: "Key/value pairs that provide additional information about the suppression.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["kind"] - }, - threadFlow: { - description: "Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber.", - type: "object", - additionalProperties: false, - properties: { - id: { - description: "An string that uniquely identifies the threadFlow within the codeFlow in which it occurs.", - type: "string" - }, - message: { - description: "A message relevant to the thread flow.", - $ref: "#/definitions/message" - }, - initialState: { - description: "Values of relevant expressions at the start of the thread flow that may change during thread flow execution.", - type: "object", - additionalProperties: { - $ref: "#/definitions/multiformatMessageString" - } - }, - immutableState: { - description: "Values of relevant expressions at the start of the thread flow that remain constant.", - type: "object", - additionalProperties: { - $ref: "#/definitions/multiformatMessageString" - } - }, - locations: { - description: "A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.", - type: "array", - minItems: 1, - uniqueItems: false, - items: { - $ref: "#/definitions/threadFlowLocation" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the thread flow.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["locations"] - }, - threadFlowLocation: { - description: "A location visited by an analysis tool while simulating or monitoring the execution of a program.", - additionalProperties: false, - type: "object", - properties: { - index: { - description: "The index within the run threadFlowLocations array.", - type: "integer", - default: -1, - minimum: -1 - }, - location: { - description: "The code location.", - $ref: "#/definitions/location" - }, - stack: { - description: "The call stack leading to this location.", - $ref: "#/definitions/stack" - }, - kinds: { - description: "A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - type: "string" - } - }, - taxa: { - description: "An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location.", - type: "array", - default: [], - minItems: 0, - uniqueItems: true, - items: { - $ref: "#/definitions/reportingDescriptorReference" - } - }, - module: { - description: "The name of the module that contains the code that is executing.", - type: "string" - }, - state: { - description: "A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.", - type: "object", - additionalProperties: { - $ref: "#/definitions/multiformatMessageString" - } - }, - nestingLevel: { - description: "An integer representing a containment hierarchy within the thread flow.", - type: "integer", - minimum: 0 - }, - executionOrder: { - description: "An integer representing the temporal order in which execution reached this location.", - type: "integer", - default: -1, - minimum: -1 - }, - executionTimeUtc: { - description: "The Coordinated Universal Time (UTC) date and time at which this location was executed.", - type: "string", - format: "date-time" - }, - importance: { - description: 'Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important".', - enum: ["important", "essential", "unimportant"], - default: "important", - type: "string" - }, - webRequest: { - description: "A web request associated with this thread flow location.", - $ref: "#/definitions/webRequest" - }, - webResponse: { - description: "A web response associated with this thread flow location.", - $ref: "#/definitions/webResponse" - }, - properties: { - description: "Key/value pairs that provide additional information about the threadflow location.", - $ref: "#/definitions/propertyBag" - } - } - }, - tool: { - description: "The analysis tool that was run.", - additionalProperties: false, - type: "object", - properties: { - driver: { - description: "The analysis tool that was run.", - $ref: "#/definitions/toolComponent" - }, - extensions: { - description: "Tool extensions that contributed to or reconfigured the analysis tool that was run.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponent" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the tool.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["driver"] - }, - toolComponent: { - description: "A component, such as a plug-in or the driver, of the analysis tool that was run.", - additionalProperties: false, - type: "object", - properties: { - guid: { - description: "A unique identifier for the tool component in the form of a GUID.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - name: { - description: "The name of the tool component.", - type: "string" - }, - organization: { - description: "The organization or company that produced the tool component.", - type: "string" - }, - product: { - description: "A product suite to which the tool component belongs.", - type: "string" - }, - productSuite: { - description: "A localizable string containing the name of the suite of products to which the tool component belongs.", - type: "string" - }, - shortDescription: { - description: "A brief description of the tool component.", - $ref: "#/definitions/multiformatMessageString" - }, - fullDescription: { - description: "A comprehensive description of the tool component.", - $ref: "#/definitions/multiformatMessageString" - }, - fullName: { - description: "The name of the tool component along with its version and any other useful identifying information, such as its locale.", - type: "string" - }, - version: { - description: "The tool component version, in whatever format the component natively provides.", - type: "string" - }, - semanticVersion: { - description: "The tool component version in the format specified by Semantic Versioning 2.0.", - type: "string" - }, - dottedQuadFileVersion: { - description: "The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).", - type: "string", - pattern: "[0-9]+(\\.[0-9]+){3}" - }, - releaseDateUtc: { - description: "A string specifying the UTC date (and optionally, the time) of the component's release.", - type: "string" - }, - downloadUri: { - description: "The absolute URI from which the tool component can be downloaded.", - type: "string", - format: "uri" - }, - informationUri: { - description: "The absolute URI at which information about this version of the tool component can be found.", - type: "string", - format: "uri" - }, - globalMessageStrings: { - description: "A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", - type: "object", - additionalProperties: { - $ref: "#/definitions/multiformatMessageString" - } - }, - notifications: { - description: "An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/reportingDescriptor" - } - }, - rules: { - description: "An array of reportingDescriptor objects relevant to the analysis performed by the tool component.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/reportingDescriptor" - } - }, - taxa: { - description: "An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/reportingDescriptor" - } - }, - locations: { - description: "An array of the artifactLocation objects associated with the tool component.", - type: "array", - minItems: 0, - default: [], - items: { - $ref: "#/definitions/artifactLocation" - } - }, - language: { - description: "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", - type: "string", - default: "en-US", - pattern: "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" - }, - contents: { - description: "The kinds of data contained in this object.", - type: "array", - uniqueItems: true, - default: ["localizedData", "nonLocalizedData"], - items: { - enum: [ - "localizedData", - "nonLocalizedData" - ], - type: "string" - } - }, - isComprehensive: { - description: "Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.", - type: "boolean", - default: false - }, - localizedDataSemanticVersion: { - description: "The semantic version of the localized strings defined in this component; maintained by components that provide translations.", - type: "string" - }, - minimumRequiredLocalizedDataSemanticVersion: { - description: "The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.", - type: "string" - }, - associatedComponent: { - description: "The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model.", - $ref: "#/definitions/toolComponentReference" - }, - translationMetadata: { - description: "Translation metadata, required for a translation, not populated by other component types.", - $ref: "#/definitions/translationMetadata" - }, - supportedTaxonomies: { - description: "An array of toolComponentReference objects to declare the taxonomies supported by the tool component.", - type: "array", - minItems: 0, - uniqueItems: true, - default: [], - items: { - $ref: "#/definitions/toolComponentReference" - } - }, - properties: { - description: "Key/value pairs that provide additional information about the tool component.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["name"] - }, - toolComponentReference: { - description: "Identifies a particular toolComponent object, either the driver or an extension.", - type: "object", - additionalProperties: false, - properties: { - name: { - description: "The 'name' property of the referenced toolComponent.", - type: "string" - }, - index: { - description: "An index into the referenced toolComponent in tool.extensions.", - type: "integer", - default: -1, - minimum: -1 - }, - guid: { - description: "The 'guid' property of the referenced toolComponent.", - type: "string", - pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" - }, - properties: { - description: "Key/value pairs that provide additional information about the toolComponentReference.", - $ref: "#/definitions/propertyBag" - } - } - }, - translationMetadata: { - description: "Provides additional metadata related to translation.", - type: "object", - additionalProperties: false, - properties: { - name: { - description: "The name associated with the translation metadata.", - type: "string" - }, - fullName: { - description: "The full name associated with the translation metadata.", - type: "string" - }, - shortDescription: { - description: "A brief description of the translation metadata.", - $ref: "#/definitions/multiformatMessageString" - }, - fullDescription: { - description: "A comprehensive description of the translation metadata.", - $ref: "#/definitions/multiformatMessageString" - }, - downloadUri: { - description: "The absolute URI from which the translation metadata can be downloaded.", - type: "string", - format: "uri" - }, - informationUri: { - description: "The absolute URI from which information related to the translation metadata can be downloaded.", - type: "string", - format: "uri" - }, - properties: { - description: "Key/value pairs that provide additional information about the translation metadata.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["name"] - }, - versionControlDetails: { - description: "Specifies the information necessary to retrieve a desired revision from a version control system.", - type: "object", - additionalProperties: false, - properties: { - repositoryUri: { - description: "The absolute URI of the repository.", - type: "string", - format: "uri" - }, - revisionId: { - description: "A string that uniquely and permanently identifies the revision within the repository.", - type: "string" - }, - branch: { - description: "The name of a branch containing the revision.", - type: "string" - }, - revisionTag: { - description: "A tag that has been applied to the revision.", - type: "string" - }, - asOfTimeUtc: { - description: "A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.", - type: "string", - format: "date-time" - }, - mappedTo: { - description: "The location in the local file system to which the root of the repository was mapped at the time of the analysis.", - $ref: "#/definitions/artifactLocation" - }, - properties: { - description: "Key/value pairs that provide additional information about the version control details.", - $ref: "#/definitions/propertyBag" - } - }, - required: ["repositoryUri"] - }, - webRequest: { - description: "Describes an HTTP request.", - type: "object", - additionalProperties: false, - properties: { - index: { - description: "The index within the run.webRequests array of the request object associated with this result.", - type: "integer", - default: -1, - minimum: -1 - }, - protocol: { - description: "The request protocol. Example: 'http'.", - type: "string" - }, - version: { - description: "The request version. Example: '1.1'.", - type: "string" - }, - target: { - description: "The target of the request.", - type: "string" - }, - method: { - description: "The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.", - type: "string" - }, - headers: { - description: "The request headers.", - type: "object", - additionalProperties: { - type: "string" - } - }, - parameters: { - description: "The request parameters.", - type: "object", - additionalProperties: { - type: "string" - } - }, - body: { - description: "The body of the request.", - $ref: "#/definitions/artifactContent" - }, - properties: { - description: "Key/value pairs that provide additional information about the request.", - $ref: "#/definitions/propertyBag" - } - } - }, - webResponse: { - description: "Describes the response to an HTTP request.", - type: "object", - additionalProperties: false, - properties: { - index: { - description: "The index within the run.webResponses array of the response object associated with this result.", - type: "integer", - default: -1, - minimum: -1 - }, - protocol: { - description: "The response protocol. Example: 'http'.", - type: "string" - }, - version: { - description: "The response version. Example: '1.1'.", - type: "string" - }, - statusCode: { - description: "The response status code. Example: 451.", - type: "integer" - }, - reasonPhrase: { - description: "The response reason. Example: 'Not found'.", - type: "string" - }, - headers: { - description: "The response headers.", - type: "object", - additionalProperties: { - type: "string" - } - }, - body: { - description: "The body of the response.", - $ref: "#/definitions/artifactContent" - }, - noResponseReceived: { - description: "Specifies whether a response was received from the server.", - type: "boolean", - default: false - }, - properties: { - description: "Key/value pairs that provide additional information about the response.", - $ref: "#/definitions/propertyBag" - } - } - } - } - }; - } -}); - -// node_modules/@actions/artifact/lib/internal/shared/config.js -var require_config2 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/shared/config.js"(exports2) { - "use strict"; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getMaxArtifactListCount = exports2.getUploadChunkTimeout = exports2.getConcurrency = exports2.getGitHubWorkspaceDir = exports2.isGhes = exports2.getResultsServiceUrl = exports2.getRuntimeToken = exports2.getUploadChunkSize = void 0; - var os_1 = __importDefault2(require("os")); - var core_1 = require_core(); - function getUploadChunkSize() { - return 8 * 1024 * 1024; - } - exports2.getUploadChunkSize = getUploadChunkSize; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); - } - return token; - } - exports2.getRuntimeToken = getRuntimeToken; - function getResultsServiceUrl() { - const resultsUrl = process.env["ACTIONS_RESULTS_URL"]; - if (!resultsUrl) { - throw new Error("Unable to get the ACTIONS_RESULTS_URL env variable"); - } - return new URL(resultsUrl).origin; - } - exports2.getResultsServiceUrl = getResultsServiceUrl; - function isGhes() { - const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); - const hostname = ghUrl.hostname.trimEnd().toUpperCase(); - const isGitHubHost = hostname === "GITHUB.COM"; - const isGheHost = hostname.endsWith(".GHE.COM"); - const isLocalHost = hostname.endsWith(".LOCALHOST"); - return !isGitHubHost && !isGheHost && !isLocalHost; - } - exports2.isGhes = isGhes; - function getGitHubWorkspaceDir() { - const ghWorkspaceDir = process.env["GITHUB_WORKSPACE"]; - if (!ghWorkspaceDir) { - throw new Error("Unable to get the GITHUB_WORKSPACE env variable"); - } - return ghWorkspaceDir; - } - exports2.getGitHubWorkspaceDir = getGitHubWorkspaceDir; - function getConcurrency() { - const numCPUs = os_1.default.cpus().length; - let concurrencyCap = 32; - if (numCPUs > 4) { - const concurrency = 16 * numCPUs; - concurrencyCap = concurrency > 300 ? 300 : concurrency; - } - const concurrencyOverride = process.env["ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY"]; - if (concurrencyOverride) { - const concurrency = parseInt(concurrencyOverride); - if (isNaN(concurrency) || concurrency < 1) { - throw new Error("Invalid value set for ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY env variable"); - } - if (concurrency < concurrencyCap) { - (0, core_1.info)(`Set concurrency based on the value set in ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY.`); - return concurrency; - } - (0, core_1.info)(`ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY is higher than the cap of ${concurrencyCap} based on the number of cpus. Set it to the maximum value allowed.`); - return concurrencyCap; - } - return 5; - } - exports2.getConcurrency = getConcurrency; - function getUploadChunkTimeout() { - const timeoutVar = process.env["ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS"]; - if (!timeoutVar) { - return 3e5; - } - const timeout = parseInt(timeoutVar); - if (isNaN(timeout)) { - throw new Error("Invalid value set for ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS env variable"); - } - return timeout; - } - exports2.getUploadChunkTimeout = getUploadChunkTimeout; - function getMaxArtifactListCount() { - const maxCountVar = process.env["ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT"] || "1000"; - const maxCount = parseInt(maxCountVar); - if (isNaN(maxCount) || maxCount < 1) { - throw new Error("Invalid value set for ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT env variable"); - } - return maxCount; - } - exports2.getMaxArtifactListCount = getMaxArtifactListCount; - } -}); - -// node_modules/@actions/artifact/lib/generated/google/protobuf/timestamp.js -var require_timestamp = __commonJS({ - "node_modules/@actions/artifact/lib/generated/google/protobuf/timestamp.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Timestamp = void 0; - var runtime_1 = require_commonjs16(); - var runtime_2 = require_commonjs16(); - var runtime_3 = require_commonjs16(); - var runtime_4 = require_commonjs16(); - var runtime_5 = require_commonjs16(); - var runtime_6 = require_commonjs16(); - var runtime_7 = require_commonjs16(); - var Timestamp$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.Timestamp", [ - { - no: 1, - name: "seconds", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - }, - { - no: 2, - name: "nanos", - kind: "scalar", - T: 5 - /*ScalarType.INT32*/ - } - ]); - } - /** - * Creates a new `Timestamp` for the current time. - */ - now() { - const msg = this.create(); - const ms = Date.now(); - msg.seconds = runtime_6.PbLong.from(Math.floor(ms / 1e3)).toString(); - msg.nanos = ms % 1e3 * 1e6; - return msg; - } - /** - * Converts a `Timestamp` to a JavaScript Date. - */ - toDate(message) { - return new Date(runtime_6.PbLong.from(message.seconds).toNumber() * 1e3 + Math.ceil(message.nanos / 1e6)); - } - /** - * Converts a JavaScript Date to a `Timestamp`. - */ - fromDate(date) { - const msg = this.create(); - const ms = date.getTime(); - msg.seconds = runtime_6.PbLong.from(Math.floor(ms / 1e3)).toString(); - msg.nanos = ms % 1e3 * 1e6; - return msg; - } - /** - * In JSON format, the `Timestamp` type is encoded as a string - * in the RFC 3339 format. - */ - internalJsonWrite(message, options) { - let ms = runtime_6.PbLong.from(message.seconds).toNumber() * 1e3; - if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) - throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive."); - if (message.nanos < 0) - throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative."); - let z = "Z"; - if (message.nanos > 0) { - let nanosStr = (message.nanos + 1e9).toString().substring(1); - if (nanosStr.substring(3) === "000000") - z = "." + nanosStr.substring(0, 3) + "Z"; - else if (nanosStr.substring(6) === "000") - z = "." + nanosStr.substring(0, 6) + "Z"; - else - z = "." + nanosStr + "Z"; - } - return new Date(ms).toISOString().replace(".000Z", z); - } - /** - * In JSON format, the `Timestamp` type is encoded as a string - * in the RFC 3339 format. - */ - internalJsonRead(json, options, target) { - if (typeof json !== "string") - throw new Error("Unable to parse Timestamp from JSON " + (0, runtime_5.typeofJsonValue)(json) + "."); - let matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/); - if (!matches) - throw new Error("Unable to parse Timestamp from JSON. Invalid format."); - let ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z")); - if (Number.isNaN(ms)) - throw new Error("Unable to parse Timestamp from JSON. Invalid value."); - if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) - throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive."); - if (!target) - target = this.create(); - target.seconds = runtime_6.PbLong.from(ms / 1e3).toString(); - target.nanos = 0; - if (matches[7]) - target.nanos = parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1e9; - return target; - } - create(value) { - const message = { seconds: "0", nanos: 0 }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 seconds */ - 1: - message.seconds = reader.int64().toString(); - break; - case /* int32 nanos */ - 2: - message.nanos = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.seconds !== "0") - writer.tag(1, runtime_1.WireType.Varint).int64(message.seconds); - if (message.nanos !== 0) - writer.tag(2, runtime_1.WireType.Varint).int32(message.nanos); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.Timestamp = new Timestamp$Type(); - } -}); - -// node_modules/@actions/artifact/lib/generated/google/protobuf/wrappers.js -var require_wrappers = __commonJS({ - "node_modules/@actions/artifact/lib/generated/google/protobuf/wrappers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BytesValue = exports2.StringValue = exports2.BoolValue = exports2.UInt32Value = exports2.Int32Value = exports2.UInt64Value = exports2.Int64Value = exports2.FloatValue = exports2.DoubleValue = void 0; - var runtime_1 = require_commonjs16(); - var runtime_2 = require_commonjs16(); - var runtime_3 = require_commonjs16(); - var runtime_4 = require_commonjs16(); - var runtime_5 = require_commonjs16(); - var runtime_6 = require_commonjs16(); - var runtime_7 = require_commonjs16(); - var DoubleValue$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.DoubleValue", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 1 - /*ScalarType.DOUBLE*/ - } - ]); - } - /** - * Encode `DoubleValue` to JSON number. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.scalar(2, message.value, "value", false, true); - } - /** - * Decode `DoubleValue` from JSON number. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, 1, void 0, "value"); - return target; - } - create(value) { - const message = { value: 0 }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* double value */ - 1: - message.value = reader.double(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value !== 0) - writer.tag(1, runtime_3.WireType.Bit64).double(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.DoubleValue = new DoubleValue$Type(); - var FloatValue$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.FloatValue", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 2 - /*ScalarType.FLOAT*/ - } - ]); - } - /** - * Encode `FloatValue` to JSON number. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.scalar(1, message.value, "value", false, true); - } - /** - * Decode `FloatValue` from JSON number. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, 1, void 0, "value"); - return target; - } - create(value) { - const message = { value: 0 }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* float value */ - 1: - message.value = reader.float(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value !== 0) - writer.tag(1, runtime_3.WireType.Bit32).float(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.FloatValue = new FloatValue$Type(); - var Int64Value$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.Int64Value", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - } - ]); - } - /** - * Encode `Int64Value` to JSON string. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.scalar(runtime_1.ScalarType.INT64, message.value, "value", false, true); - } - /** - * Decode `Int64Value` from JSON string. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, runtime_1.ScalarType.INT64, runtime_2.LongType.STRING, "value"); - return target; - } - create(value) { - const message = { value: "0" }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 value */ - 1: - message.value = reader.int64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value !== "0") - writer.tag(1, runtime_3.WireType.Varint).int64(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.Int64Value = new Int64Value$Type(); - var UInt64Value$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.UInt64Value", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 4 - /*ScalarType.UINT64*/ - } - ]); - } - /** - * Encode `UInt64Value` to JSON string. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.scalar(runtime_1.ScalarType.UINT64, message.value, "value", false, true); - } - /** - * Decode `UInt64Value` from JSON string. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, runtime_1.ScalarType.UINT64, runtime_2.LongType.STRING, "value"); - return target; - } - create(value) { - const message = { value: "0" }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 value */ - 1: - message.value = reader.uint64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value !== "0") - writer.tag(1, runtime_3.WireType.Varint).uint64(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.UInt64Value = new UInt64Value$Type(); - var Int32Value$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.Int32Value", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 5 - /*ScalarType.INT32*/ - } - ]); - } - /** - * Encode `Int32Value` to JSON string. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.scalar(5, message.value, "value", false, true); - } - /** - * Decode `Int32Value` from JSON string. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, 5, void 0, "value"); - return target; - } - create(value) { - const message = { value: 0 }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 value */ - 1: - message.value = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value !== 0) - writer.tag(1, runtime_3.WireType.Varint).int32(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.Int32Value = new Int32Value$Type(); - var UInt32Value$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.UInt32Value", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 13 - /*ScalarType.UINT32*/ - } - ]); - } - /** - * Encode `UInt32Value` to JSON string. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.scalar(13, message.value, "value", false, true); - } - /** - * Decode `UInt32Value` from JSON string. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, 13, void 0, "value"); - return target; - } - create(value) { - const message = { value: 0 }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 value */ - 1: - message.value = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value !== 0) - writer.tag(1, runtime_3.WireType.Varint).uint32(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.UInt32Value = new UInt32Value$Type(); - var BoolValue$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.BoolValue", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - } - ]); - } - /** - * Encode `BoolValue` to JSON bool. - */ - internalJsonWrite(message, options) { - return message.value; - } - /** - * Decode `BoolValue` from JSON bool. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, 8, void 0, "value"); - return target; - } - create(value) { - const message = { value: false }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool value */ - 1: - message.value = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value !== false) - writer.tag(1, runtime_3.WireType.Varint).bool(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.BoolValue = new BoolValue$Type(); - var StringValue$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.StringValue", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - /** - * Encode `StringValue` to JSON string. - */ - internalJsonWrite(message, options) { - return message.value; - } - /** - * Decode `StringValue` from JSON string. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, 9, void 0, "value"); - return target; - } - create(value) { - const message = { value: "" }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string value */ - 1: - message.value = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value !== "") - writer.tag(1, runtime_3.WireType.LengthDelimited).string(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.StringValue = new StringValue$Type(); - var BytesValue$Type = class extends runtime_7.MessageType { - constructor() { - super("google.protobuf.BytesValue", [ - { - no: 1, - name: "value", - kind: "scalar", - T: 12 - /*ScalarType.BYTES*/ - } - ]); - } - /** - * Encode `BytesValue` to JSON string. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.scalar(12, message.value, "value", false, true); - } - /** - * Decode `BytesValue` from JSON string. - */ - internalJsonRead(json, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json, 12, void 0, "value"); - return target; - } - create(value) { - const message = { value: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_5.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes value */ - 1: - message.value = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.value.length) - writer.tag(1, runtime_3.WireType.LengthDelimited).bytes(message.value); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.BytesValue = new BytesValue$Type(); - } -}); - -// node_modules/@actions/artifact/lib/generated/results/api/v1/artifact.js -var require_artifact = __commonJS({ - "node_modules/@actions/artifact/lib/generated/results/api/v1/artifact.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ArtifactService = exports2.DeleteArtifactResponse = exports2.DeleteArtifactRequest = exports2.GetSignedArtifactURLResponse = exports2.GetSignedArtifactURLRequest = exports2.ListArtifactsResponse_MonolithArtifact = exports2.ListArtifactsResponse = exports2.ListArtifactsRequest = exports2.FinalizeArtifactResponse = exports2.FinalizeArtifactRequest = exports2.CreateArtifactResponse = exports2.CreateArtifactRequest = exports2.FinalizeMigratedArtifactResponse = exports2.FinalizeMigratedArtifactRequest = exports2.MigrateArtifactResponse = exports2.MigrateArtifactRequest = void 0; - var runtime_rpc_1 = require_commonjs17(); - var runtime_1 = require_commonjs16(); - var runtime_2 = require_commonjs16(); - var runtime_3 = require_commonjs16(); - var runtime_4 = require_commonjs16(); - var runtime_5 = require_commonjs16(); - var wrappers_1 = require_wrappers(); - var wrappers_2 = require_wrappers(); - var timestamp_1 = require_timestamp(); - var MigrateArtifactRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.MigrateArtifactRequest", [ - { - no: 1, - name: "workflow_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 3, name: "expires_at", kind: "message", T: () => timestamp_1.Timestamp } - ]); - } - create(value) { - const message = { workflowRunBackendId: "", name: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string workflow_run_backend_id */ - 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string name */ - 2: - message.name = reader.string(); - break; - case /* google.protobuf.Timestamp expires_at */ - 3: - message.expiresAt = timestamp_1.Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.workflowRunBackendId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); - if (message.name !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.name); - if (message.expiresAt) - timestamp_1.Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(3, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.MigrateArtifactRequest = new MigrateArtifactRequest$Type(); - var MigrateArtifactResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.MigrateArtifactResponse", [ - { - no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "signed_upload_url", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { ok: false, signedUploadUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool ok */ - 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.ok !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); - if (message.signedUploadUrl !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.signedUploadUrl); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.MigrateArtifactResponse = new MigrateArtifactResponse$Type(); - var FinalizeMigratedArtifactRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [ - { - no: 1, - name: "workflow_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "size", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - } - ]); - } - create(value) { - const message = { workflowRunBackendId: "", name: "", size: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string workflow_run_backend_id */ - 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string name */ - 2: - message.name = reader.string(); - break; - case /* int64 size */ - 3: - message.size = reader.int64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.workflowRunBackendId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); - if (message.name !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.name); - if (message.size !== "0") - writer.tag(3, runtime_1.WireType.Varint).int64(message.size); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type(); - var FinalizeMigratedArtifactResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [ - { - no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "artifact_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - } - ]); - } - create(value) { - const message = { ok: false, artifactId: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool ok */ - 1: - message.ok = reader.bool(); - break; - case /* int64 artifact_id */ - 2: - message.artifactId = reader.int64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.ok !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); - if (message.artifactId !== "0") - writer.tag(2, runtime_1.WireType.Varint).int64(message.artifactId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type(); - var CreateArtifactRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.CreateArtifactRequest", [ - { - no: 1, - name: "workflow_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "workflow_job_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 4, name: "expires_at", kind: "message", T: () => timestamp_1.Timestamp }, - { - no: 5, - name: "version", - kind: "scalar", - T: 5 - /*ScalarType.INT32*/ - } - ]); - } - create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", version: 0 }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string workflow_run_backend_id */ - 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; - case /* string name */ - 3: - message.name = reader.string(); - break; - case /* google.protobuf.Timestamp expires_at */ - 4: - message.expiresAt = timestamp_1.Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt); - break; - case /* int32 version */ - 5: - message.version = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.workflowRunBackendId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); - if (message.workflowJobRunBackendId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.workflowJobRunBackendId); - if (message.name !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.name); - if (message.expiresAt) - timestamp_1.Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(4, runtime_1.WireType.LengthDelimited).fork(), options).join(); - if (message.version !== 0) - writer.tag(5, runtime_1.WireType.Varint).int32(message.version); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.CreateArtifactRequest = new CreateArtifactRequest$Type(); - var CreateArtifactResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.CreateArtifactResponse", [ - { - no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "signed_upload_url", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { ok: false, signedUploadUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool ok */ - 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.ok !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); - if (message.signedUploadUrl !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.signedUploadUrl); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.CreateArtifactResponse = new CreateArtifactResponse$Type(); - var FinalizeArtifactRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.FinalizeArtifactRequest", [ - { - no: 1, - name: "workflow_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "workflow_job_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 4, - name: "size", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - }, - { no: 5, name: "hash", kind: "message", T: () => wrappers_2.StringValue } - ]); - } - create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", size: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string workflow_run_backend_id */ - 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; - case /* string name */ - 3: - message.name = reader.string(); - break; - case /* int64 size */ - 4: - message.size = reader.int64().toString(); - break; - case /* google.protobuf.StringValue hash */ - 5: - message.hash = wrappers_2.StringValue.internalBinaryRead(reader, reader.uint32(), options, message.hash); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.workflowRunBackendId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); - if (message.workflowJobRunBackendId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.workflowJobRunBackendId); - if (message.name !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.name); - if (message.size !== "0") - writer.tag(4, runtime_1.WireType.Varint).int64(message.size); - if (message.hash) - wrappers_2.StringValue.internalBinaryWrite(message.hash, writer.tag(5, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.FinalizeArtifactRequest = new FinalizeArtifactRequest$Type(); - var FinalizeArtifactResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.FinalizeArtifactResponse", [ - { - no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "artifact_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - } - ]); - } - create(value) { - const message = { ok: false, artifactId: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool ok */ - 1: - message.ok = reader.bool(); - break; - case /* int64 artifact_id */ - 2: - message.artifactId = reader.int64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.ok !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); - if (message.artifactId !== "0") - writer.tag(2, runtime_1.WireType.Varint).int64(message.artifactId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.FinalizeArtifactResponse = new FinalizeArtifactResponse$Type(); - var ListArtifactsRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.ListArtifactsRequest", [ - { - no: 1, - name: "workflow_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "workflow_job_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 3, name: "name_filter", kind: "message", T: () => wrappers_2.StringValue }, - { no: 4, name: "id_filter", kind: "message", T: () => wrappers_1.Int64Value } - ]); - } - create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string workflow_run_backend_id */ - 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; - case /* google.protobuf.StringValue name_filter */ - 3: - message.nameFilter = wrappers_2.StringValue.internalBinaryRead(reader, reader.uint32(), options, message.nameFilter); - break; - case /* google.protobuf.Int64Value id_filter */ - 4: - message.idFilter = wrappers_1.Int64Value.internalBinaryRead(reader, reader.uint32(), options, message.idFilter); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.workflowRunBackendId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); - if (message.workflowJobRunBackendId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.workflowJobRunBackendId); - if (message.nameFilter) - wrappers_2.StringValue.internalBinaryWrite(message.nameFilter, writer.tag(3, runtime_1.WireType.LengthDelimited).fork(), options).join(); - if (message.idFilter) - wrappers_1.Int64Value.internalBinaryWrite(message.idFilter, writer.tag(4, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.ListArtifactsRequest = new ListArtifactsRequest$Type(); - var ListArtifactsResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.ListArtifactsResponse", [ - { no: 1, name: "artifacts", kind: "message", repeat: 1, T: () => exports2.ListArtifactsResponse_MonolithArtifact } - ]); - } - create(value) { - const message = { artifacts: [] }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact artifacts */ - 1: - message.artifacts.push(exports2.ListArtifactsResponse_MonolithArtifact.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - for (let i = 0; i < message.artifacts.length; i++) - exports2.ListArtifactsResponse_MonolithArtifact.internalBinaryWrite(message.artifacts[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.ListArtifactsResponse = new ListArtifactsResponse$Type(); - var ListArtifactsResponse_MonolithArtifact$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact", [ - { - no: 1, - name: "workflow_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "workflow_job_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "database_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - }, - { - no: 4, - name: "name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 5, - name: "size", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - }, - { no: 6, name: "created_at", kind: "message", T: () => timestamp_1.Timestamp }, - { no: 7, name: "digest", kind: "message", T: () => wrappers_2.StringValue } - ]); - } - create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", databaseId: "0", name: "", size: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string workflow_run_backend_id */ - 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; - case /* int64 database_id */ - 3: - message.databaseId = reader.int64().toString(); - break; - case /* string name */ - 4: - message.name = reader.string(); - break; - case /* int64 size */ - 5: - message.size = reader.int64().toString(); - break; - case /* google.protobuf.Timestamp created_at */ - 6: - message.createdAt = timestamp_1.Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt); - break; - case /* google.protobuf.StringValue digest */ - 7: - message.digest = wrappers_2.StringValue.internalBinaryRead(reader, reader.uint32(), options, message.digest); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.workflowRunBackendId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); - if (message.workflowJobRunBackendId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.workflowJobRunBackendId); - if (message.databaseId !== "0") - writer.tag(3, runtime_1.WireType.Varint).int64(message.databaseId); - if (message.name !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.name); - if (message.size !== "0") - writer.tag(5, runtime_1.WireType.Varint).int64(message.size); - if (message.createdAt) - timestamp_1.Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, runtime_1.WireType.LengthDelimited).fork(), options).join(); - if (message.digest) - wrappers_2.StringValue.internalBinaryWrite(message.digest, writer.tag(7, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.ListArtifactsResponse_MonolithArtifact = new ListArtifactsResponse_MonolithArtifact$Type(); - var GetSignedArtifactURLRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.GetSignedArtifactURLRequest", [ - { - no: 1, - name: "workflow_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "workflow_job_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string workflow_run_backend_id */ - 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; - case /* string name */ - 3: - message.name = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.workflowRunBackendId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); - if (message.workflowJobRunBackendId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.workflowJobRunBackendId); - if (message.name !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.name); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.GetSignedArtifactURLRequest = new GetSignedArtifactURLRequest$Type(); - var GetSignedArtifactURLResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.GetSignedArtifactURLResponse", [ - { - no: 1, - name: "signed_url", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { signedUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string signed_url */ - 1: - message.signedUrl = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.signedUrl !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.signedUrl); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.GetSignedArtifactURLResponse = new GetSignedArtifactURLResponse$Type(); - var DeleteArtifactRequest$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.DeleteArtifactRequest", [ - { - no: 1, - name: "workflow_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "workflow_job_run_backend_id", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 3, - name: "name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string workflow_run_backend_id */ - 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; - case /* string name */ - 3: - message.name = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.workflowRunBackendId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); - if (message.workflowJobRunBackendId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.workflowJobRunBackendId); - if (message.name !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.name); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.DeleteArtifactRequest = new DeleteArtifactRequest$Type(); - var DeleteArtifactResponse$Type = class extends runtime_5.MessageType { - constructor() { - super("github.actions.results.api.v1.DeleteArtifactResponse", [ - { - no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "artifact_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ - } - ]); - } - create(value) { - const message = { ok: false, artifactId: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool ok */ - 1: - message.ok = reader.bool(); - break; - case /* int64 artifact_id */ - 2: - message.artifactId = reader.int64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message, writer, options) { - if (message.ok !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); - if (message.artifactId !== "0") - writer.tag(2, runtime_1.WireType.Varint).int64(message.artifactId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } - }; - exports2.DeleteArtifactResponse = new DeleteArtifactResponse$Type(); - exports2.ArtifactService = new runtime_rpc_1.ServiceType("github.actions.results.api.v1.ArtifactService", [ - { name: "CreateArtifact", options: {}, I: exports2.CreateArtifactRequest, O: exports2.CreateArtifactResponse }, - { name: "FinalizeArtifact", options: {}, I: exports2.FinalizeArtifactRequest, O: exports2.FinalizeArtifactResponse }, - { name: "ListArtifacts", options: {}, I: exports2.ListArtifactsRequest, O: exports2.ListArtifactsResponse }, - { name: "GetSignedArtifactURL", options: {}, I: exports2.GetSignedArtifactURLRequest, O: exports2.GetSignedArtifactURLResponse }, - { name: "DeleteArtifact", options: {}, I: exports2.DeleteArtifactRequest, O: exports2.DeleteArtifactResponse }, - { name: "MigrateArtifact", options: {}, I: exports2.MigrateArtifactRequest, O: exports2.MigrateArtifactResponse }, - { name: "FinalizeMigratedArtifact", options: {}, I: exports2.FinalizeMigratedArtifactRequest, O: exports2.FinalizeMigratedArtifactResponse } - ]); - } -}); - -// node_modules/@actions/artifact/lib/generated/results/api/v1/artifact.twirp-client.js -var require_artifact_twirp_client = __commonJS({ - "node_modules/@actions/artifact/lib/generated/results/api/v1/artifact.twirp-client.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ArtifactServiceClientProtobuf = exports2.ArtifactServiceClientJSON = void 0; - var artifact_1 = require_artifact(); - var ArtifactServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateArtifact.bind(this); - this.FinalizeArtifact.bind(this); - this.ListArtifacts.bind(this); - this.GetSignedArtifactURL.bind(this); - this.DeleteArtifact.bind(this); - } - CreateArtifact(request3) { - const data = artifact_1.CreateArtifactRequest.toJson(request3, { - useProtoFieldName: true, - emitDefaultValues: false - }); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "CreateArtifact", "application/json", data); - return promise.then((data2) => artifact_1.CreateArtifactResponse.fromJson(data2, { - ignoreUnknownFields: true - })); - } - FinalizeArtifact(request3) { - const data = artifact_1.FinalizeArtifactRequest.toJson(request3, { - useProtoFieldName: true, - emitDefaultValues: false - }); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "FinalizeArtifact", "application/json", data); - return promise.then((data2) => artifact_1.FinalizeArtifactResponse.fromJson(data2, { - ignoreUnknownFields: true - })); - } - ListArtifacts(request3) { - const data = artifact_1.ListArtifactsRequest.toJson(request3, { - useProtoFieldName: true, - emitDefaultValues: false - }); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "ListArtifacts", "application/json", data); - return promise.then((data2) => artifact_1.ListArtifactsResponse.fromJson(data2, { ignoreUnknownFields: true })); - } - GetSignedArtifactURL(request3) { - const data = artifact_1.GetSignedArtifactURLRequest.toJson(request3, { - useProtoFieldName: true, - emitDefaultValues: false - }); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "GetSignedArtifactURL", "application/json", data); - return promise.then((data2) => artifact_1.GetSignedArtifactURLResponse.fromJson(data2, { - ignoreUnknownFields: true - })); - } - DeleteArtifact(request3) { - const data = artifact_1.DeleteArtifactRequest.toJson(request3, { - useProtoFieldName: true, - emitDefaultValues: false - }); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "DeleteArtifact", "application/json", data); - return promise.then((data2) => artifact_1.DeleteArtifactResponse.fromJson(data2, { - ignoreUnknownFields: true - })); - } - }; - exports2.ArtifactServiceClientJSON = ArtifactServiceClientJSON; - var ArtifactServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateArtifact.bind(this); - this.FinalizeArtifact.bind(this); - this.ListArtifacts.bind(this); - this.GetSignedArtifactURL.bind(this); - this.DeleteArtifact.bind(this); - } - CreateArtifact(request3) { - const data = artifact_1.CreateArtifactRequest.toBinary(request3); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "CreateArtifact", "application/protobuf", data); - return promise.then((data2) => artifact_1.CreateArtifactResponse.fromBinary(data2)); - } - FinalizeArtifact(request3) { - const data = artifact_1.FinalizeArtifactRequest.toBinary(request3); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "FinalizeArtifact", "application/protobuf", data); - return promise.then((data2) => artifact_1.FinalizeArtifactResponse.fromBinary(data2)); - } - ListArtifacts(request3) { - const data = artifact_1.ListArtifactsRequest.toBinary(request3); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "ListArtifacts", "application/protobuf", data); - return promise.then((data2) => artifact_1.ListArtifactsResponse.fromBinary(data2)); - } - GetSignedArtifactURL(request3) { - const data = artifact_1.GetSignedArtifactURLRequest.toBinary(request3); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "GetSignedArtifactURL", "application/protobuf", data); - return promise.then((data2) => artifact_1.GetSignedArtifactURLResponse.fromBinary(data2)); - } - DeleteArtifact(request3) { - const data = artifact_1.DeleteArtifactRequest.toBinary(request3); - const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "DeleteArtifact", "application/protobuf", data); - return promise.then((data2) => artifact_1.DeleteArtifactResponse.fromBinary(data2)); - } - }; - exports2.ArtifactServiceClientProtobuf = ArtifactServiceClientProtobuf; - } -}); - -// node_modules/@actions/artifact/lib/generated/index.js -var require_generated = __commonJS({ - "node_modules/@actions/artifact/lib/generated/index.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar2(require_timestamp(), exports2); - __exportStar2(require_wrappers(), exports2); - __exportStar2(require_artifact(), exports2); - __exportStar2(require_artifact_twirp_client(), exports2); - } -}); - -// node_modules/@actions/artifact/lib/internal/upload/retention.js -var require_retention = __commonJS({ - "node_modules/@actions/artifact/lib/internal/upload/retention.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getExpiration = void 0; - var generated_1 = require_generated(); - var core31 = __importStar2(require_core()); - function getExpiration(retentionDays) { - if (!retentionDays) { - return void 0; - } - const maxRetentionDays = getRetentionDays(); - if (maxRetentionDays && maxRetentionDays < retentionDays) { - core31.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`); - retentionDays = maxRetentionDays; - } - const expirationDate = /* @__PURE__ */ new Date(); - expirationDate.setDate(expirationDate.getDate() + retentionDays); - return generated_1.Timestamp.fromDate(expirationDate); - } - exports2.getExpiration = getExpiration; - function getRetentionDays() { - const retentionDays = process.env["GITHUB_RETENTION_DAYS"]; - if (!retentionDays) { - return void 0; - } - const days = parseInt(retentionDays); - if (isNaN(days)) { - return void 0; - } - return days; - } - } -}); - -// node_modules/@actions/artifact/lib/internal/upload/path-and-artifact-name-validation.js -var require_path_and_artifact_name_validation = __commonJS({ - "node_modules/@actions/artifact/lib/internal/upload/path-and-artifact-name-validation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.validateFilePath = exports2.validateArtifactName = void 0; - var core_1 = require_core(); - var invalidArtifactFilePathCharacters = /* @__PURE__ */ new Map([ - ['"', ' Double quote "'], - [":", " Colon :"], - ["<", " Less than <"], - [">", " Greater than >"], - ["|", " Vertical bar |"], - ["*", " Asterisk *"], - ["?", " Question mark ?"], - ["\r", " Carriage return \\r"], - ["\n", " Line feed \\n"] - ]); - var invalidArtifactNameCharacters = new Map([ - ...invalidArtifactFilePathCharacters, - ["\\", " Backslash \\"], - ["/", " Forward slash /"] - ]); - function validateArtifactName(name) { - if (!name) { - throw new Error(`Provided artifact name input during validation is empty`); - } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactNameCharacters) { - if (name.includes(invalidCharacterKey)) { - throw new Error(`The artifact name is not valid: ${name}. Contains the following character: ${errorMessageForCharacter} - -Invalid characters include: ${Array.from(invalidArtifactNameCharacters.values()).toString()} - -These characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.`); - } - } - (0, core_1.info)(`Artifact name is valid!`); - } - exports2.validateArtifactName = validateArtifactName; - function validateFilePath(path30) { - if (!path30) { - throw new Error(`Provided file path input during validation is empty`); - } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path30.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path30}. Contains the following character: ${errorMessageForCharacter} - -Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} - -The following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems. - `); - } - } - } - exports2.validateFilePath = validateFilePath; - } -}); - -// node_modules/@actions/artifact/package.json -var require_package2 = __commonJS({ - "node_modules/@actions/artifact/package.json"(exports2, module2) { - module2.exports = { - name: "@actions/artifact", - version: "5.0.3", - preview: true, - description: "Actions artifact lib", - keywords: [ - "github", - "actions", - "artifact" - ], - homepage: "https://github.com/actions/toolkit/tree/main/packages/artifact", - license: "MIT", - main: "lib/artifact.js", - types: "lib/artifact.d.ts", - directories: { - lib: "lib", - test: "__tests__" - }, - files: [ - "lib", - "!.DS_Store" - ], - publishConfig: { - access: "public" - }, - repository: { - type: "git", - url: "git+https://github.com/actions/toolkit.git", - directory: "packages/artifact" - }, - scripts: { - "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", - test: "cd ../../ && npm run test ./packages/artifact", - bootstrap: "cd ../../ && npm run bootstrap", - "tsc-run": "tsc", - tsc: "npm run bootstrap && npm run tsc-run", - "gen:docs": "typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none" - }, - bugs: { - url: "https://github.com/actions/toolkit/issues" - }, - dependencies: { - "@actions/core": "^2.0.0", - "@actions/github": "^6.0.1", - "@actions/http-client": "^3.0.2", - "@azure/storage-blob": "^12.29.1", - "@octokit/core": "^5.2.1", - "@octokit/plugin-request-log": "^1.0.4", - "@octokit/plugin-retry": "^3.0.9", - "@octokit/request": "^8.4.1", - "@octokit/request-error": "^5.1.1", - "@protobuf-ts/plugin": "^2.2.3-alpha.1", - archiver: "^7.0.1", - "jwt-decode": "^3.1.2", - "unzip-stream": "^0.3.1" - }, - devDependencies: { - "@types/archiver": "^5.3.2", - "@types/unzip-stream": "^0.3.4", - typedoc: "^0.28.13", - "typedoc-plugin-markdown": "^3.17.1", - typescript: "^5.2.2" - }, - overrides: { - "uri-js": "npm:uri-js-replace@^1.0.1", - "node-fetch": "^3.3.2" - } - }; - } -}); - -// node_modules/@actions/artifact/lib/internal/shared/user-agent.js -var require_user_agent2 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/shared/user-agent.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUserAgentString = void 0; - var packageJson = require_package2(); - function getUserAgentString() { - return `@actions/artifact-${packageJson.version}`; - } - exports2.getUserAgentString = getUserAgentString; - } -}); - -// node_modules/@actions/artifact/lib/internal/shared/errors.js -var require_errors3 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/shared/errors.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UsageError = exports2.NetworkError = exports2.GHESNotSupportedError = exports2.ArtifactNotFoundError = exports2.InvalidResponseError = exports2.FilesNotFoundError = void 0; - var FilesNotFoundError = class extends Error { - constructor(files = []) { - let message = "No files were found to upload"; - if (files.length > 0) { - message += `: ${files.join(", ")}`; - } - super(message); - this.files = files; - this.name = "FilesNotFoundError"; - } - }; - exports2.FilesNotFoundError = FilesNotFoundError; - var InvalidResponseError = class extends Error { - constructor(message) { - super(message); - this.name = "InvalidResponseError"; - } - }; - exports2.InvalidResponseError = InvalidResponseError; - var ArtifactNotFoundError = class extends Error { - constructor(message = "Artifact not found") { - super(message); - this.name = "ArtifactNotFoundError"; - } - }; - exports2.ArtifactNotFoundError = ArtifactNotFoundError; - var GHESNotSupportedError = class extends Error { - constructor(message = "@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.") { - super(message); - this.name = "GHESNotSupportedError"; - } - }; - exports2.GHESNotSupportedError = GHESNotSupportedError; - var NetworkError = class extends Error { - constructor(code) { - const message = `Unable to make request: ${code} -If you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`; - super(message); - this.code = code; - this.name = "NetworkError"; - } - }; - exports2.NetworkError = NetworkError; - NetworkError.isNetworkErrorCode = (code) => { - if (!code) - return false; - return [ - "ECONNRESET", - "ENOTFOUND", - "ETIMEDOUT", - "ECONNREFUSED", - "EHOSTUNREACH" - ].includes(code); - }; - var UsageError = class extends Error { - constructor() { - const message = `Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours. -More info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`; - super(message); - this.name = "UsageError"; - } - }; - exports2.UsageError = UsageError; - UsageError.isUsageErrorMessage = (msg) => { - if (!msg) - return false; - return msg.includes("insufficient usage"); - }; - } -}); - -// node_modules/jwt-decode/build/jwt-decode.cjs.js -var require_jwt_decode_cjs = __commonJS({ - "node_modules/jwt-decode/build/jwt-decode.cjs.js"(exports2, module2) { - "use strict"; - function e(e2) { - this.message = e2; - } - e.prototype = new Error(), e.prototype.name = "InvalidCharacterError"; - var r = "undefined" != typeof window && window.atob && window.atob.bind(window) || function(r2) { - var t2 = String(r2).replace(/=+$/, ""); - if (t2.length % 4 == 1) throw new e("'atob' failed: The string to be decoded is not correctly encoded."); - for (var n2, o2, a2 = 0, i = 0, c = ""; o2 = t2.charAt(i++); ~o2 && (n2 = a2 % 4 ? 64 * n2 + o2 : o2, a2++ % 4) ? c += String.fromCharCode(255 & n2 >> (-2 * a2 & 6)) : 0) o2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o2); - return c; - }; - function t(e2) { - var t2 = e2.replace(/-/g, "+").replace(/_/g, "/"); - switch (t2.length % 4) { - case 0: - break; - case 2: - t2 += "=="; - break; - case 3: - t2 += "="; - break; - default: - throw "Illegal base64url string!"; - } - try { - return (function(e3) { - return decodeURIComponent(r(e3).replace(/(.)/g, (function(e4, r2) { - var t3 = r2.charCodeAt(0).toString(16).toUpperCase(); - return t3.length < 2 && (t3 = "0" + t3), "%" + t3; - }))); - })(t2); - } catch (e3) { - return r(t2); - } - } - function n(e2) { - this.message = e2; - } - function o(e2, r2) { - if ("string" != typeof e2) throw new n("Invalid token specified"); - var o2 = true === (r2 = r2 || {}).header ? 0 : 1; - try { - return JSON.parse(t(e2.split(".")[o2])); - } catch (e3) { - throw new n("Invalid token specified: " + e3.message); - } - } - n.prototype = new Error(), n.prototype.name = "InvalidTokenError"; - var a = o; - a.default = o, a.InvalidTokenError = n, module2.exports = a; - } -}); - -// node_modules/@actions/artifact/lib/internal/shared/util.js -var require_util11 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/shared/util.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = exports2.getBackendIdsFromToken = void 0; - var core31 = __importStar2(require_core()); - var config_1 = require_config2(); - var jwt_decode_1 = __importDefault2(require_jwt_decode_cjs()); - var core_1 = require_core(); - var InvalidJwtError = new Error("Failed to get backend IDs: The provided JWT token is invalid and/or missing claims"); - function getBackendIdsFromToken() { - const token = (0, config_1.getRuntimeToken)(); - const decoded = (0, jwt_decode_1.default)(token); - if (!decoded.scp) { - throw InvalidJwtError; - } - const scpParts = decoded.scp.split(" "); - if (scpParts.length === 0) { - throw InvalidJwtError; - } - for (const scopes of scpParts) { - const scopeParts = scopes.split(":"); - if ((scopeParts === null || scopeParts === void 0 ? void 0 : scopeParts[0]) !== "Actions.Results") { - continue; - } - if (scopeParts.length !== 3) { - throw InvalidJwtError; - } - const ids = { - workflowRunBackendId: scopeParts[1], - workflowJobRunBackendId: scopeParts[2] - }; - core31.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`); - core31.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`); - return ids; - } - throw InvalidJwtError; - } - exports2.getBackendIdsFromToken = getBackendIdsFromToken; - function maskSigUrl(url2) { - if (!url2) - return; - try { - const parsedUrl = new URL(url2); - const signature = parsedUrl.searchParams.get("sig"); - if (signature) { - (0, core_1.setSecret)(signature); - (0, core_1.setSecret)(encodeURIComponent(signature)); - } - } catch (error3) { - (0, core_1.debug)(`Failed to parse URL: ${url2} ${error3 instanceof Error ? error3.message : String(error3)}`); - } - } - exports2.maskSigUrl = maskSigUrl; - function maskSecretUrls(body) { - if (typeof body !== "object" || body === null) { - (0, core_1.debug)("body is not an object or is null"); - return; - } - if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { - maskSigUrl(body.signed_upload_url); - } - if ("signed_url" in body && typeof body.signed_url === "string") { - maskSigUrl(body.signed_url); - } - } - exports2.maskSecretUrls = maskSecretUrls; - } -}); - -// node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js -var require_artifact_twirp_client2 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalArtifactTwirpClient = void 0; - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var core_1 = require_core(); - var generated_1 = require_generated(); - var config_1 = require_config2(); - var user_agent_1 = require_user_agent2(); - var errors_1 = require_errors3(); - var util_1 = require_util11(); - var ArtifactHttpClient = class { - constructor(userAgent2, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { - this.maxAttempts = 5; - this.baseRetryIntervalMilliseconds = 3e3; - this.retryMultiplier = 1.5; - const token = (0, config_1.getRuntimeToken)(); - this.baseUrl = (0, config_1.getResultsServiceUrl)(); - if (maxAttempts) { - this.maxAttempts = maxAttempts; - } - if (baseRetryIntervalMilliseconds) { - this.baseRetryIntervalMilliseconds = baseRetryIntervalMilliseconds; - } - if (retryMultiplier) { - this.retryMultiplier = retryMultiplier; - } - this.httpClient = new http_client_1.HttpClient(userAgent2, [ - new auth_1.BearerCredentialHandler(token) - ]); - } - // This function satisfies the Rpc interface. It is compatible with the JSON - // JSON generated client. - request(service, method, contentType, data) { - return __awaiter2(this, void 0, void 0, function* () { - const url2 = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; - (0, core_1.debug)(`[Request] ${method} ${url2}`); - const headers = { - "Content-Type": contentType - }; - try { - const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { - return this.httpClient.post(url2, JSON.stringify(data), headers); - })); - return body; - } catch (error3) { - throw new Error(`Failed to ${method}: ${error3.message}`); - } - }); - } - retryableRequest(operation) { - return __awaiter2(this, void 0, void 0, function* () { - let attempt = 0; - let errorMessage = ""; - let rawBody = ""; - while (attempt < this.maxAttempts) { - let isRetryable = false; - try { - const response = yield operation(); - const statusCode = response.message.statusCode; - rawBody = yield response.readBody(); - (0, core_1.debug)(`[Response] - ${response.message.statusCode}`); - (0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); - const body = JSON.parse(rawBody); - (0, util_1.maskSecretUrls)(body); - (0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`); - if (this.isSuccessStatusCode(statusCode)) { - return { response, body }; - } - isRetryable = this.isRetryableHttpStatusCode(statusCode); - errorMessage = `Failed request: (${statusCode}) ${response.message.statusMessage}`; - if (body.msg) { - if (errors_1.UsageError.isUsageErrorMessage(body.msg)) { - throw new errors_1.UsageError(); - } - errorMessage = `${errorMessage}: ${body.msg}`; - } - } catch (error3) { - if (error3 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); - } - if (error3 instanceof errors_1.UsageError) { - throw error3; - } - if (errors_1.NetworkError.isNetworkErrorCode(error3 === null || error3 === void 0 ? void 0 : error3.code)) { - throw new errors_1.NetworkError(error3 === null || error3 === void 0 ? void 0 : error3.code); - } - isRetryable = true; - errorMessage = error3.message; - } - if (!isRetryable) { - throw new Error(`Received non-retryable error: ${errorMessage}`); - } - if (attempt + 1 === this.maxAttempts) { - throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); - } - const retryTimeMilliseconds = this.getExponentialRetryTimeMilliseconds(attempt); - (0, core_1.info)(`Attempt ${attempt + 1} of ${this.maxAttempts} failed with error: ${errorMessage}. Retrying request in ${retryTimeMilliseconds} ms...`); - yield this.sleep(retryTimeMilliseconds); - attempt++; - } - throw new Error(`Request failed`); - }); - } - isSuccessStatusCode(statusCode) { - if (!statusCode) - return false; - return statusCode >= 200 && statusCode < 300; - } - isRetryableHttpStatusCode(statusCode) { - if (!statusCode) - return false; - const retryableStatusCodes = [ - http_client_1.HttpCodes.BadGateway, - http_client_1.HttpCodes.GatewayTimeout, - http_client_1.HttpCodes.InternalServerError, - http_client_1.HttpCodes.ServiceUnavailable, - http_client_1.HttpCodes.TooManyRequests - ]; - return retryableStatusCodes.includes(statusCode); - } - sleep(milliseconds) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => setTimeout(resolve14, milliseconds)); - }); - } - getExponentialRetryTimeMilliseconds(attempt) { - if (attempt < 0) { - throw new Error("attempt should be a positive integer"); - } - if (attempt === 0) { - return this.baseRetryIntervalMilliseconds; - } - const minTime = this.baseRetryIntervalMilliseconds * Math.pow(this.retryMultiplier, attempt); - const maxTime = minTime * this.retryMultiplier; - return Math.trunc(Math.random() * (maxTime - minTime) + minTime); - } - }; - function internalArtifactTwirpClient(options) { - const client = new ArtifactHttpClient((0, user_agent_1.getUserAgentString)(), options === null || options === void 0 ? void 0 : options.maxAttempts, options === null || options === void 0 ? void 0 : options.retryIntervalMs, options === null || options === void 0 ? void 0 : options.retryMultiplier); - return new generated_1.ArtifactServiceClientJSON(client); - } - exports2.internalArtifactTwirpClient = internalArtifactTwirpClient; - } -}); - -// node_modules/@actions/artifact/lib/internal/upload/upload-zip-specification.js -var require_upload_zip_specification = __commonJS({ - "node_modules/@actions/artifact/lib/internal/upload/upload-zip-specification.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUploadZipSpecification = exports2.validateRootDirectory = void 0; - var fs32 = __importStar2(require("fs")); - var core_1 = require_core(); - var path_1 = require("path"); - var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation(); - function validateRootDirectory(rootDirectory) { - if (!fs32.existsSync(rootDirectory)) { - throw new Error(`The provided rootDirectory ${rootDirectory} does not exist`); - } - if (!fs32.statSync(rootDirectory).isDirectory()) { - throw new Error(`The provided rootDirectory ${rootDirectory} is not a valid directory`); - } - (0, core_1.info)(`Root directory input is valid!`); - } - exports2.validateRootDirectory = validateRootDirectory; - function getUploadZipSpecification(filesToZip, rootDirectory) { - const specification = []; - rootDirectory = (0, path_1.normalize)(rootDirectory); - rootDirectory = (0, path_1.resolve)(rootDirectory); - for (let file of filesToZip) { - const stats = fs32.lstatSync(file, { throwIfNoEntry: false }); - if (!stats) { - throw new Error(`File ${file} does not exist`); - } - if (!stats.isDirectory()) { - file = (0, path_1.normalize)(file); - file = (0, path_1.resolve)(file); - if (!file.startsWith(rootDirectory)) { - throw new Error(`The rootDirectory: ${rootDirectory} is not a parent directory of the file: ${file}`); - } - const uploadPath = file.replace(rootDirectory, ""); - (0, path_and_artifact_name_validation_1.validateFilePath)(uploadPath); - specification.push({ - sourcePath: file, - destinationPath: uploadPath, - stats - }); - } else { - const directoryPath = file.replace(rootDirectory, ""); - (0, path_and_artifact_name_validation_1.validateFilePath)(directoryPath); - specification.push({ - sourcePath: null, - destinationPath: directoryPath, - stats - }); - } - } - return specification; - } - exports2.getUploadZipSpecification = getUploadZipSpecification; - } -}); - -// node_modules/@actions/artifact/lib/internal/upload/blob-upload.js -var require_blob_upload = __commonJS({ - "node_modules/@actions/artifact/lib/internal/upload/blob-upload.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadZipToBlobStorage = void 0; - var storage_blob_1 = require_commonjs15(); - var config_1 = require_config2(); - var core31 = __importStar2(require_core()); - var crypto3 = __importStar2(require("crypto")); - var stream2 = __importStar2(require("stream")); - var errors_1 = require_errors3(); - function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { - return __awaiter2(this, void 0, void 0, function* () { - let uploadByteCount = 0; - let lastProgressTime = Date.now(); - const abortController = new AbortController(); - const chunkTimer = (interval) => __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14, reject) => { - const timer = setInterval(() => { - if (Date.now() - lastProgressTime > interval) { - reject(new Error("Upload progress stalled.")); - } - }, interval); - abortController.signal.addEventListener("abort", () => { - clearInterval(timer); - resolve14(); - }); - }); - }); - const maxConcurrency = (0, config_1.getConcurrency)(); - const bufferSize = (0, config_1.getUploadChunkSize)(); - const blobClient = new storage_blob_1.BlobClient(authenticatedUploadURL); - const blockBlobClient = blobClient.getBlockBlobClient(); - core31.debug(`Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}`); - const uploadCallback = (progress) => { - core31.info(`Uploaded bytes ${progress.loadedBytes}`); - uploadByteCount = progress.loadedBytes; - lastProgressTime = Date.now(); - }; - const options = { - blobHTTPHeaders: { blobContentType: "zip" }, - onProgress: uploadCallback, - abortSignal: abortController.signal - }; - let sha256Hash = void 0; - const uploadStream = new stream2.PassThrough(); - const hashStream = crypto3.createHash("sha256"); - zipUploadStream.pipe(uploadStream); - zipUploadStream.pipe(hashStream).setEncoding("hex"); - core31.info("Beginning upload of artifact content to blob storage"); - try { - yield Promise.race([ - blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options), - chunkTimer((0, config_1.getUploadChunkTimeout)()) - ]); - } catch (error3) { - if (errors_1.NetworkError.isNetworkErrorCode(error3 === null || error3 === void 0 ? void 0 : error3.code)) { - throw new errors_1.NetworkError(error3 === null || error3 === void 0 ? void 0 : error3.code); - } - throw error3; - } finally { - abortController.abort(); - } - core31.info("Finished uploading artifact content to blob storage!"); - hashStream.end(); - sha256Hash = hashStream.read(); - core31.info(`SHA256 digest of uploaded artifact zip is ${sha256Hash}`); - if (uploadByteCount === 0) { - core31.warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`); - } - return { - uploadSize: uploadByteCount, - sha256Hash - }; - }); - } - exports2.uploadZipToBlobStorage = uploadZipToBlobStorage; - } -}); - -// node_modules/@actions/artifact/node_modules/minimatch/lib/path.js -var require_path = __commonJS({ - "node_modules/@actions/artifact/node_modules/minimatch/lib/path.js"(exports2, module2) { - var isWindows = typeof process === "object" && process && process.platform === "win32"; - module2.exports = isWindows ? { sep: "\\" } : { sep: "/" }; - } -}); - -// node_modules/@actions/artifact/node_modules/brace-expansion/index.js -var require_brace_expansion2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/brace-expansion/index.js"(exports2, module2) { - var balanced2 = require_balanced_match(); - module2.exports = expandTop; - var escSlash2 = "\0SLASH" + Math.random() + "\0"; - var escOpen2 = "\0OPEN" + Math.random() + "\0"; - var escClose2 = "\0CLOSE" + Math.random() + "\0"; - var escComma2 = "\0COMMA" + Math.random() + "\0"; - var escPeriod2 = "\0PERIOD" + Math.random() + "\0"; - var EXPANSION_MAX2 = 1e5; - var EXPANSION_MAX_LENGTH2 = 4e6; - function numeric2(str) { - return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); - } - function escapeBraces2(str) { - return str.split("\\\\").join(escSlash2).split("\\{").join(escOpen2).split("\\}").join(escClose2).split("\\,").join(escComma2).split("\\.").join(escPeriod2); - } - function unescapeBraces2(str) { - return str.split(escSlash2).join("\\").split(escOpen2).join("{").split(escClose2).join("}").split(escComma2).join(",").split(escPeriod2).join("."); - } - function parseCommaParts2(str) { - if (!str) - return [""]; - var parts = []; - var m = balanced2("{", "}", str); - if (!m) - return str.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts2(post); - if (post.length) { - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); - } - parts.push.apply(parts, p); - return parts; - } - function expandTop(str, options) { - if (!str) - return []; - options = options || {}; - var max = options.max == null ? EXPANSION_MAX2 : options.max; - var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH2 : options.maxLength; - if (str.substr(0, 2) === "{}") { - str = "\\{\\}" + str.substr(2); - } - return expand3(escapeBraces2(str), max, maxLength, true).map(unescapeBraces2); - } - function embrace2(str) { - return "{" + str + "}"; - } - function isPadded2(el) { - return /^-?0\d/.test(el); - } - function lte2(i, y) { - return i <= y; - } - function gte7(i, y) { - return i >= y; - } - function combine2(acc, pre, values, max, maxLength, dropEmpties) { - var out = []; - var length = 0; - for (var a = 0; a < acc.length; a++) { - for (var v = 0; v < values.length; v++) { - if (out.length >= max) return out; - var expansion = acc[a] + pre + values[v]; - if (dropEmpties && !expansion) continue; - if (length + expansion.length > maxLength) return out; - out.push(expansion); - length += expansion.length; - } - } - return out; - } - function expandSequence2(body, isAlphaSequence, max, maxLength) { - var n = body.split(/\.\./); - var N = []; - if (n[0] === void 0 || n[1] === void 0) { - return N; - } - var x = numeric2(n[0]); - var y = numeric2(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric2(n[2])), 1) : 1; - var test = lte2; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte7; - } - var pad = n.some(isPadded2); - var length = 0; - for (var i = x; test(i, y) && N.length < max; i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === "\\") { - c = ""; - } - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join("0"); - if (i < 0) { - c = "-" + z + c.slice(1); - } else { - c = z + c; - } - } - } - } - if (length + c.length > maxLength) break; - N.push(c); - length += c.length; - } - return N; - } - function expand3(str, max, maxLength, isTop) { - var acc = [""]; - var dropEmpties = false; - var firstGroup = true; - for (; ; ) { - const m = balanced2("{", "}", str); - if (!m) { - return combine2(acc, str, [""], max, maxLength, dropEmpties); - } - const pre = m.pre; - if (/\$$/.test(pre)) { - acc = combine2( - acc, - pre + "{" + m.body + "}", - [""], - max, - maxLength, - dropEmpties && !m.post.length - ); - firstGroup = false; - if (!m.post.length) break; - str = m.post; - continue; - } - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(",") >= 0; - if (!isSequence && !isOptions) { - if (m.post.match(/,(?!,).*\}/)) { - str = m.pre + "{" + m.body + escClose2 + m.post; - isTop = true; - continue; - } - return combine2( - acc, - pre + "{" + m.body + "}" + m.post, - [""], - max, - maxLength, - dropEmpties - ); - } - if (firstGroup) { - dropEmpties = isTop && !isSequence; - firstGroup = false; - } - var values; - if (isSequence) { - values = expandSequence2(m.body, isAlphaSequence, max, maxLength); - } else { - var n = parseCommaParts2(m.body); - if (n.length === 1 && n[0] !== void 0) { - n = expand3(n[0], max, maxLength, false).map(embrace2); - if (n.length === 1) { - acc = combine2( - acc, - pre + n[0], - [""], - max, - maxLength, - dropEmpties && !m.post.length - ); - if (!m.post.length) break; - str = m.post; - continue; - } - } - var dropsEmpties = dropEmpties && !m.post.length && !pre; - for (var d = 0; dropsEmpties && d < acc.length; d++) { - if (acc[d]) { - dropsEmpties = false; - } - } - values = []; - var valuesLength = 0; - outer: for (var j = 0; j < n.length; j++) { - var expanded = expand3(n[j], max, maxLength, false); - for (var k = 0; k < expanded.length; k++) { - var v = expanded[k]; - if (dropsEmpties && !v) continue; - if (values.length >= max || valuesLength + v.length > maxLength) { - break outer; - } - values.push(v); - valuesLength += v.length; - } - } - } - acc = combine2(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); - if (!m.post.length) break; - str = m.post; - } - return acc; - } - } -}); - -// node_modules/@actions/artifact/node_modules/minimatch/minimatch.js -var require_minimatch2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/minimatch/minimatch.js"(exports2, module2) { - var minimatch2 = module2.exports = (p, pattern, options = {}) => { - assertValidPattern2(pattern); - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; - } - return new Minimatch2(pattern, options).match(p); - }; - module2.exports = minimatch2; - var path30 = require_path(); - minimatch2.sep = path30.sep; - var GLOBSTAR2 = /* @__PURE__ */ Symbol("globstar **"); - minimatch2.GLOBSTAR = GLOBSTAR2; - var expand3 = require_brace_expansion2(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark3 = "[^/]"; - var star3 = qmark3 + "*?"; - var twoStarDot2 = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot2 = "(?:(?!(?:\\/|^)\\.).)*?"; - var charSet = (s) => s.split("").reduce((set, c) => { - set[c] = true; - return set; - }, {}); - var reSpecials2 = charSet("().*{}+?[]^$\\!"); - var addPatternStartSet = charSet("[.("); - var slashSplit = /\/+/; - minimatch2.filter = (pattern, options = {}) => (p, i, list) => minimatch2(p, pattern, options); - var ext2 = (a, b = {}) => { - const t = {}; - Object.keys(a).forEach((k) => t[k] = a[k]); - Object.keys(b).forEach((k) => t[k] = b[k]); - return t; - }; - minimatch2.defaults = (def) => { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch2; - } - const orig = minimatch2; - const m = (p, pattern, options) => orig(p, pattern, ext2(def, options)); - m.Minimatch = class Minimatch extends orig.Minimatch { - constructor(pattern, options) { - super(pattern, ext2(def, options)); - } - }; - m.Minimatch.defaults = (options) => orig.defaults(ext2(def, options)).Minimatch; - m.filter = (pattern, options) => orig.filter(pattern, ext2(def, options)); - m.defaults = (options) => orig.defaults(ext2(def, options)); - m.makeRe = (pattern, options) => orig.makeRe(pattern, ext2(def, options)); - m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext2(def, options)); - m.match = (list, pattern, options) => orig.match(list, pattern, ext2(def, options)); - return m; - }; - minimatch2.braceExpand = (pattern, options) => braceExpand2(pattern, options); - var braceExpand2 = (pattern, options = {}) => { - assertValidPattern2(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; - } - return expand3(pattern); - }; - var MAX_PATTERN_LENGTH2 = 1024 * 64; - var assertValidPattern2 = (pattern) => { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); - } - if (pattern.length > MAX_PATTERN_LENGTH2) { - throw new TypeError("pattern is too long"); - } - }; - var SUBPARSE = /* @__PURE__ */ Symbol("subparse"); - minimatch2.makeRe = (pattern, options) => new Minimatch2(pattern, options || {}).makeRe(); - minimatch2.match = (list, pattern, options = {}) => { - const mm = new Minimatch2(pattern, options); - list = list.filter((f) => mm.match(f)); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - var globUnescape = (s) => s.replace(/\\(.)/g, "$1"); - var charUnescape = (s) => s.replace(/\\([^-\]])/g, "$1"); - var regExpEscape3 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - var braExpEscape = (s) => s.replace(/[[\]\\]/g, "\\$&"); - var Minimatch2 = class { - constructor(pattern, options) { - assertValidPattern2(pattern); - if (!options) options = {}; - this.options = options; - this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; - this.set = []; - this.pattern = pattern; - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; - if (this.windowsPathsNoEscape) { - this.pattern = this.pattern.replace(/\\/g, "/"); - } - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - debug() { - } - make() { - const pattern = this.pattern; - const options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; - } - if (!pattern) { - this.empty = true; - return; - } - this.parseNegate(); - let set = this.globSet = this.braceExpand(); - if (options.debug) this.debug = (...args) => console.error(...args); - this.debug(this.pattern, set); - set = this.globParts = set.map((s) => s.split(slashSplit)); - this.debug(this.pattern, set); - set = set.map((s, si, set2) => s.map(this.parse, this)); - this.debug(this.pattern, set); - set = set.filter((s) => s.indexOf(false) === -1); - this.debug(this.pattern, set); - this.set = set; - } - parseNegate() { - if (this.options.nonegate) return; - const pattern = this.pattern; - let negate2 = false; - let negateOffset = 0; - for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) { - negate2 = !negate2; - negateOffset++; - } - if (negateOffset) this.pattern = pattern.slice(negateOffset); - this.negate = negate2; - } - // set partial to true to test if, for example, - // "/a/b" matches the start of "/*/b/*/d" - // Partial means, if you run out of file before you run - // out of pattern, then that's fine, as long as all - // the parts match. - matchOne(file, pattern, partial) { - if (pattern.indexOf(GLOBSTAR2) !== -1) { - return this._matchGlobstar(file, pattern, partial, 0, 0); - } - return this._matchOne(file, pattern, partial, 0, 0); - } - _matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { - let firstgs = -1; - for (let i = patternIndex; i < pattern.length; i++) { - if (pattern[i] === GLOBSTAR2) { - firstgs = i; - break; - } - } - let lastgs = -1; - for (let i = pattern.length - 1; i >= 0; i--) { - if (pattern[i] === GLOBSTAR2) { - lastgs = i; - break; - } - } - const head = pattern.slice(patternIndex, firstgs); - const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); - const tail = partial ? [] : pattern.slice(lastgs + 1); - if (head.length) { - const fileHead = file.slice(fileIndex, fileIndex + head.length); - if (!this._matchOne(fileHead, head, partial, 0, 0)) { - return false; - } - fileIndex += head.length; - } - let fileTailMatch = 0; - if (tail.length) { - if (tail.length + fileIndex > file.length) return false; - const tailStart = file.length - tail.length; - if (this._matchOne(file, tail, partial, tailStart, 0)) { - fileTailMatch = tail.length; - } else { - if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { - return false; - } - if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) { - return false; - } - fileTailMatch = tail.length + 1; - } - } - if (!body.length) { - let sawSome = !!fileTailMatch; - for (let i = fileIndex; i < file.length - fileTailMatch; i++) { - const f = String(file[i]); - sawSome = true; - if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { - return false; - } - } - return partial || sawSome; - } - const bodySegments = [[[], 0]]; - let currentBody = bodySegments[0]; - let nonGsParts = 0; - const nonGsPartsSums = [0]; - for (const b of body) { - if (b === GLOBSTAR2) { - nonGsPartsSums.push(nonGsParts); - currentBody = [[], 0]; - bodySegments.push(currentBody); - } else { - currentBody[0].push(b); - nonGsParts++; - } - } - let idx = bodySegments.length - 1; - const fileLength = file.length - fileTailMatch; - for (const b of bodySegments) { - b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length); - } - return !!this._matchGlobStarBodySections( - file, - bodySegments, - fileIndex, - 0, - partial, - 0, - !!fileTailMatch - ); - } - // return false for "nope, not matching" - // return null for "not matching, cannot keep trying" - _matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { - const bs = bodySegments[bodyIndex]; - if (!bs) { - for (let i = fileIndex; i < file.length; i++) { - sawTail = true; - const f = file[i]; - if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { - return false; - } - } - return sawTail; - } - const [body, after] = bs; - while (fileIndex <= after) { - const m = this._matchOne( - file.slice(0, fileIndex + body.length), - body, - partial, - fileIndex, - 0 - ); - if (m && globStarDepth < this.maxGlobstarRecursion) { - const sub = this._matchGlobStarBodySections( - file, - bodySegments, - fileIndex + body.length, - bodyIndex + 1, - partial, - globStarDepth + 1, - sawTail - ); - if (sub !== false) { - return sub; - } - } - const f = file[fileIndex]; - if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { - return false; - } - fileIndex++; - } - return partial || null; - } - _matchOne(file, pattern, partial, fileIndex, patternIndex) { - let fi, pi, fl, pl; - for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { - this.debug("matchOne loop"); - const p = pattern[pi]; - const f = file[fi]; - this.debug(pattern, p, f); - if (p === false || p === GLOBSTAR2) return false; - let hit; - if (typeof p === "string") { - hit = f === p; - this.debug("string match", p, f, hit); - } else { - hit = f.match(p); - this.debug("pattern match", p, f, hit); - } - if (!hit) return false; - } - if (fi === fl && pi === pl) { - return true; - } else if (fi === fl) { - return partial; - } else if (pi === pl) { - return fi === fl - 1 && file[fi] === ""; - } - throw new Error("wtf?"); - } - braceExpand() { - return braceExpand2(this.pattern, this.options); - } - parse(pattern, isSub) { - assertValidPattern2(pattern); - const options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR2; - else - pattern = "*"; - } - if (pattern === "") return ""; - let re = ""; - let hasMagic = false; - let escaping = false; - const patternListStack = []; - const negativeLists = []; - let stateChar; - let inClass = false; - let reClassStart = -1; - let classStart = -1; - let cs; - let pl; - let sp; - let dotTravAllowed = pattern.charAt(0) === "."; - let dotFileAllowed = options.dot || dotTravAllowed; - const patternStart = () => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; - const subPatternStart = (p) => p.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; - const clearStateChar = () => { - if (stateChar) { - switch (stateChar) { - case "*": - re += star3; - hasMagic = true; - break; - case "?": - re += qmark3; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; - } - this.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; - } - }; - for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) { - this.debug("%s %s %s %j", pattern, i, re, c); - if (escaping) { - if (c === "/") { - return false; - } - if (reSpecials2[c]) { - re += "\\"; - } - re += c; - escaping = false; - continue; - } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; - } - case "\\": - if (inClass && pattern.charAt(i + 1) === "-") { - re += c; - continue; - } - clearStateChar(); - escaping = true; - continue; - // the various stateChar values - // for the "extglob" stuff. - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); - if (inClass) { - this.debug(" in class"); - if (c === "!" && i === classStart + 1) c = "^"; - re += c; - continue; - } - if (c === "*" && stateChar === "*") continue; - this.debug("call clearStateChar %j", stateChar); - clearStateChar(); - stateChar = c; - if (options.noext) clearStateChar(); - continue; - case "(": { - if (inClass) { - re += "("; - continue; - } - if (!stateChar) { - re += "\\("; - continue; - } - const plEntry = { - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }; - this.debug(this.pattern, " ", plEntry); - patternListStack.push(plEntry); - re += plEntry.open; - if (plEntry.start === 0 && plEntry.type !== "!") { - dotTravAllowed = true; - re += subPatternStart(pattern.slice(i + 1)); - } - this.debug("plType %j %j", stateChar, re); - stateChar = false; - continue; - } - case ")": { - const plEntry = patternListStack[patternListStack.length - 1]; - if (inClass || !plEntry) { - re += "\\)"; - continue; - } - patternListStack.pop(); - clearStateChar(); - hasMagic = true; - pl = plEntry; - re += pl.close; - if (pl.type === "!") { - negativeLists.push(Object.assign(pl, { reEnd: re.length })); - } - continue; - } - case "|": { - const plEntry = patternListStack[patternListStack.length - 1]; - if (inClass || !plEntry) { - re += "\\|"; - continue; - } - clearStateChar(); - re += "|"; - if (plEntry.start === 0 && plEntry.type !== "!") { - dotTravAllowed = true; - re += subPatternStart(pattern.slice(i + 1)); - } - continue; - } - // these are mostly the same in regexp and glob - case "[": - clearStateChar(); - if (inClass) { - re += "\\" + c; - continue; - } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - continue; - } - cs = pattern.substring(classStart + 1, i); - try { - RegExp("[" + braExpEscape(charUnescape(cs)) + "]"); - re += c; - } catch (er) { - re = re.substring(0, reClassStart) + "(?:$.)"; - } - hasMagic = true; - inClass = false; - continue; - default: - clearStateChar(); - if (reSpecials2[c] && !(c === "^" && inClass)) { - re += "\\"; - } - re += c; - break; - } - } - if (inClass) { - cs = pattern.slice(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re = re.substring(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; - } - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - let tail; - tail = re.slice(pl.reStart + pl.open.length); - this.debug("setting tail", re, pl); - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_2, $1, $2) => { - if (!$2) { - $2 = "\\"; - } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - const t = pl.type === "*" ? star3 : pl.type === "?" ? qmark3 : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; - } - clearStateChar(); - if (escaping) { - re += "\\\\"; - } - const addPatternStart2 = addPatternStartSet[re.charAt(0)]; - for (let n = negativeLists.length - 1; n > -1; n--) { - const nl = negativeLists[n]; - const nlBefore = re.slice(0, nl.reStart); - const nlFirst = re.slice(nl.reStart, nl.reEnd - 8); - let nlAfter = re.slice(nl.reEnd); - const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter; - const closeParensBefore = nlBefore.split(")").length; - const openParensBefore = nlBefore.split("(").length - closeParensBefore; - let cleanAfter = nlAfter; - for (let i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); - } - nlAfter = cleanAfter; - const dollar = nlAfter === "" && isSub !== SUBPARSE ? "(?:$|\\/)" : ""; - re = nlBefore + nlFirst + nlAfter + dollar + nlLast; - } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; - } - if (addPatternStart2) { - re = patternStart() + re; - } - if (isSub === SUBPARSE) { - return [re, hasMagic]; - } - if (options.nocase && !hasMagic) { - hasMagic = pattern.toUpperCase() !== pattern.toLowerCase(); - } - if (!hasMagic) { - return globUnescape(pattern); - } - const flags = options.nocase ? "i" : ""; - try { - return Object.assign(new RegExp("^" + re + "$", flags), { - _glob: pattern, - _src: re - }); - } catch (er) { - return new RegExp("$."); - } - } - makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - const set = this.set; - if (!set.length) { - this.regexp = false; - return this.regexp; - } - const options = this.options; - const twoStar = options.noglobstar ? star3 : options.dot ? twoStarDot2 : twoStarNoDot2; - const flags = options.nocase ? "i" : ""; - let re = set.map((pattern) => { - pattern = pattern.map( - (p) => typeof p === "string" ? regExpEscape3(p) : p === GLOBSTAR2 ? GLOBSTAR2 : p._src - ).reduce((set2, p) => { - if (!(set2[set2.length - 1] === GLOBSTAR2 && p === GLOBSTAR2)) { - set2.push(p); - } - return set2; - }, []); - pattern.forEach((p, i) => { - if (p !== GLOBSTAR2 || pattern[i - 1] === GLOBSTAR2) { - return; - } - if (i === 0) { - if (pattern.length > 1) { - pattern[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i + 1]; - } else { - pattern[i] = twoStar; - } - } else if (i === pattern.length - 1) { - pattern[i - 1] += "(?:\\/|" + twoStar + ")?"; - } else { - pattern[i - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i + 1]; - pattern[i + 1] = GLOBSTAR2; - } - }); - return pattern.filter((p) => p !== GLOBSTAR2).join("/"); - }).join("|"); - re = "^(?:" + re + ")$"; - if (this.negate) re = "^(?!" + re + ").*$"; - try { - this.regexp = new RegExp(re, flags); - } catch (ex) { - this.regexp = false; - } - return this.regexp; - } - match(f, partial = this.partial) { - this.debug("match", f, this.pattern); - if (this.comment) return false; - if (this.empty) return f === ""; - if (f === "/" && partial) return true; - const options = this.options; - if (path30.sep !== "/") { - f = f.split(path30.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - const set = this.set; - this.debug(this.pattern, "set", set); - let filename; - for (let i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (let i = 0; i < set.length; i++) { - const pattern = set[i]; - let file = f; - if (options.matchBase && pattern.length === 1) { - file = [filename]; - } - const hit = this.matchOne(file, pattern, partial); - if (hit) { - if (options.flipNegate) return true; - return !this.negate; - } - } - if (options.flipNegate) return false; - return this.negate; - } - static defaults(def) { - return minimatch2.defaults(def).Minimatch; - } - }; - minimatch2.Minimatch = Minimatch2; - } -}); - -// node_modules/@actions/artifact/node_modules/readdir-glob/index.js -var require_readdir_glob = __commonJS({ - "node_modules/@actions/artifact/node_modules/readdir-glob/index.js"(exports2, module2) { - module2.exports = readdirGlob2; - var fs32 = require("fs"); - var { EventEmitter: EventEmitter2 } = require("events"); - var { Minimatch: Minimatch2 } = require_minimatch2(); - var { resolve: resolve14 } = require("path"); - function readdir3(dir, strict) { - return new Promise((resolve15, reject) => { - fs32.readdir(dir, { withFileTypes: true }, (err, files) => { - if (err) { - switch (err.code) { - case "ENOTDIR": - if (strict) { - reject(err); - } else { - resolve15([]); - } - break; - case "ENOTSUP": - // Operation not supported - case "ENOENT": - // No such file or directory - case "ENAMETOOLONG": - // Filename too long - case "UNKNOWN": - resolve15([]); - break; - case "ELOOP": - // Too many levels of symbolic links - default: - reject(err); - break; - } - } else { - resolve15(files); - } - }); - }); - } - function stat2(file, followSymlinks) { - return new Promise((resolve15, reject) => { - const statFunc = followSymlinks ? fs32.stat : fs32.lstat; - statFunc(file, (err, stats) => { - if (err) { - switch (err.code) { - case "ENOENT": - if (followSymlinks) { - resolve15(stat2(file, false)); - } else { - resolve15(null); - } - break; - default: - resolve15(null); - break; - } - } else { - resolve15(stats); - } - }); - }); - } - async function* exploreWalkAsync2(dir, path30, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir3(path30 + dir, strict); - for (const file of files) { - let name = file.name; - if (name === void 0) { - name = file; - useStat = true; - } - const filename = dir + "/" + name; - const relative3 = filename.slice(1); - const absolute = path30 + "/" + relative3; - let stats = null; - if (useStat || followSymlinks) { - stats = await stat2(absolute, followSymlinks); - } - if (!stats && file.name !== void 0) { - stats = file; - } - if (stats === null) { - stats = { isDirectory: () => false }; - } - if (stats.isDirectory()) { - if (!shouldSkip(relative3)) { - yield { relative: relative3, absolute, stats }; - yield* exploreWalkAsync2(filename, path30, followSymlinks, useStat, shouldSkip, false); - } - } else { - yield { relative: relative3, absolute, stats }; - } - } - } - async function* explore2(path30, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync2("", path30, followSymlinks, useStat, shouldSkip, true); - } - function readOptions2(options) { - return { - pattern: options.pattern, - dot: !!options.dot, - noglobstar: !!options.noglobstar, - matchBase: !!options.matchBase, - nocase: !!options.nocase, - ignore: options.ignore, - skip: options.skip, - follow: !!options.follow, - stat: !!options.stat, - nodir: !!options.nodir, - mark: !!options.mark, - silent: !!options.silent, - absolute: !!options.absolute - }; - } - var ReaddirGlob3 = class extends EventEmitter2 { - constructor(cwd, options, cb) { - super(); - if (typeof options === "function") { - cb = options; - options = null; - } - this.options = readOptions2(options || {}); - this.matchers = []; - if (this.options.pattern) { - const matchers = Array.isArray(this.options.pattern) ? this.options.pattern : [this.options.pattern]; - this.matchers = matchers.map( - (m) => new Minimatch2(m, { - dot: this.options.dot, - noglobstar: this.options.noglobstar, - matchBase: this.options.matchBase, - nocase: this.options.nocase - }) - ); - } - this.ignoreMatchers = []; - if (this.options.ignore) { - const ignorePatterns = Array.isArray(this.options.ignore) ? this.options.ignore : [this.options.ignore]; - this.ignoreMatchers = ignorePatterns.map( - (ignore) => new Minimatch2(ignore, { dot: true }) - ); - } - this.skipMatchers = []; - if (this.options.skip) { - const skipPatterns = Array.isArray(this.options.skip) ? this.options.skip : [this.options.skip]; - this.skipMatchers = skipPatterns.map( - (skip) => new Minimatch2(skip, { dot: true }) - ); - } - this.iterator = explore2(resolve14(cwd || "."), this.options.follow, this.options.stat, this._shouldSkipDirectory.bind(this)); - this.paused = false; - this.inactive = false; - this.aborted = false; - if (cb) { - this._matches = []; - this.on("match", (match2) => this._matches.push(this.options.absolute ? match2.absolute : match2.relative)); - this.on("error", (err) => cb(err)); - this.on("end", () => cb(null, this._matches)); - } - setTimeout(() => this._next(), 0); - } - _shouldSkipDirectory(relative3) { - return this.skipMatchers.some((m) => m.match(relative3)); - } - _fileMatches(relative3, isDirectory) { - const file = relative3 + (isDirectory ? "/" : ""); - return (this.matchers.length === 0 || this.matchers.some((m) => m.match(file))) && !this.ignoreMatchers.some((m) => m.match(file)) && (!this.options.nodir || !isDirectory); - } - _next() { - if (!this.paused && !this.aborted) { - this.iterator.next().then((obj) => { - if (!obj.done) { - const isDirectory = obj.value.stats.isDirectory(); - if (this._fileMatches(obj.value.relative, isDirectory)) { - let relative3 = obj.value.relative; - let absolute = obj.value.absolute; - if (this.options.mark && isDirectory) { - relative3 += "/"; - absolute += "/"; - } - if (this.options.stat) { - this.emit("match", { relative: relative3, absolute, stat: obj.value.stats }); - } else { - this.emit("match", { relative: relative3, absolute }); - } - } - this._next(this.iterator); - } else { - this.emit("end"); - } - }).catch((err) => { - this.abort(); - this.emit("error", err); - if (!err.code && !this.options.silent) { - console.error(err); - } - }); - } else { - this.inactive = true; - } - } - abort() { - this.aborted = true; - } - pause() { - this.paused = true; - } - resume() { - this.paused = false; - if (this.inactive) { - this.inactive = false; - this._next(); - } - } - }; - function readdirGlob2(pattern, options, cb) { - return new ReaddirGlob3(pattern, options, cb); - } - readdirGlob2.ReaddirGlob = ReaddirGlob3; - } -}); - -// node_modules/async/dist/async.js -var require_async = __commonJS({ - "node_modules/async/dist/async.js"(exports2, module2) { - (function(global2, factory) { - typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.async = {})); - })(exports2, (function(exports3) { - "use strict"; - function apply(fn, ...args) { - return (...callArgs) => fn(...args, ...callArgs); - } - function initialParams(fn) { - return function(...args) { - var callback = args.pop(); - return fn.call(this, args, callback); - }; - } - var hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask; - var hasSetImmediate = typeof setImmediate === "function" && setImmediate; - var hasNextTick = typeof process === "object" && typeof process.nextTick === "function"; - function fallback(fn) { - setTimeout(fn, 0); - } - function wrap(defer) { - return (fn, ...args) => defer(() => fn(...args)); - } - var _defer$1; - if (hasQueueMicrotask) { - _defer$1 = queueMicrotask; - } else if (hasSetImmediate) { - _defer$1 = setImmediate; - } else if (hasNextTick) { - _defer$1 = process.nextTick; - } else { - _defer$1 = fallback; - } - var setImmediate$1 = wrap(_defer$1); - function asyncify(func) { - if (isAsync(func)) { - return function(...args) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback); - }; - } - return initialParams(function(args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - if (result && typeof result.then === "function") { - return handlePromise(result, callback); - } else { - callback(null, result); - } - }); - } - function handlePromise(promise, callback) { - return promise.then((value) => { - invokeCallback(callback, null, value); - }, (err) => { - invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); - }); - } - function invokeCallback(callback, error3, value) { - try { - callback(error3, value); - } catch (err) { - setImmediate$1((e) => { - throw e; - }, err); - } - } - function isAsync(fn) { - return fn[Symbol.toStringTag] === "AsyncFunction"; - } - function isAsyncGenerator(fn) { - return fn[Symbol.toStringTag] === "AsyncGenerator"; - } - function isAsyncIterable(obj) { - return typeof obj[Symbol.asyncIterator] === "function"; - } - function wrapAsync(asyncFn) { - if (typeof asyncFn !== "function") throw new Error("expected a function"); - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; - } - function awaitify(asyncFn, arity) { - if (!arity) arity = asyncFn.length; - if (!arity) throw new Error("arity is undefined"); - function awaitable(...args) { - if (typeof args[arity - 1] === "function") { - return asyncFn.apply(this, args); - } - return new Promise((resolve14, reject2) => { - args[arity - 1] = (err, ...cbArgs) => { - if (err) return reject2(err); - resolve14(cbArgs.length > 1 ? cbArgs : cbArgs[0]); - }; - asyncFn.apply(this, args); - }); - } - return awaitable; - } - function applyEach$1(eachfn) { - return function applyEach2(fns, ...callArgs) { - const go = awaitify(function(callback) { - var that = this; - return eachfn(fns, (fn, cb) => { - wrapAsync(fn).apply(that, callArgs.concat(cb)); - }, callback); - }); - return go; - }; - } - function _asyncMap(eachfn, arr, iteratee, callback) { - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); - return eachfn(arr, (value, _2, iterCb) => { - var index3 = counter++; - _iteratee(value, (err, v) => { - results[index3] = v; - iterCb(err); - }); - }, (err) => { - callback(err, results); - }); - } - function isArrayLike(value) { - return value && typeof value.length === "number" && value.length >= 0 && value.length % 1 === 0; - } - const breakLoop = {}; - function once(fn) { - function wrapper(...args) { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, args); - } - Object.assign(wrapper, fn); - return wrapper; - } - function getIterator(coll) { - return coll[Symbol.iterator] && coll[Symbol.iterator](); - } - function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? { value: coll[i], key: i } : null; - }; - } - function createES2015Iterator(iterator2) { - var i = -1; - return function next() { - var item = iterator2.next(); - if (item.done) - return null; - i++; - return { value: item.value, key: i }; - }; - } - function createObjectIterator(obj) { - var okeys = obj ? Object.keys(obj) : []; - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - if (key === "__proto__") { - return next(); - } - return i < len ? { value: obj[key], key } : null; - }; - } - function createIterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); - } - var iterator2 = getIterator(coll); - return iterator2 ? createES2015Iterator(iterator2) : createObjectIterator(coll); - } - function onlyOnce(fn) { - return function(...args) { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, args); - }; - } - function asyncEachOfLimit(generator, limit, iteratee, callback) { - let done = false; - let canceled = false; - let awaiting = false; - let running = 0; - let idx = 0; - function replenish() { - if (running >= limit || awaiting || done) return; - awaiting = true; - generator.next().then(({ value, done: iterDone }) => { - if (canceled || done) return; - awaiting = false; - if (iterDone) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running++; - iteratee(value, idx, iterateeCallback); - idx++; - replenish(); - }).catch(handleError); - } - function iterateeCallback(err, result) { - running -= 1; - if (canceled) return; - if (err) return handleError(err); - if (err === false) { - done = true; - canceled = true; - return; - } - if (result === breakLoop || done && running <= 0) { - done = true; - return callback(null); - } - replenish(); - } - function handleError(err) { - if (canceled) return; - awaiting = false; - done = true; - callback(err); - } - replenish(); - } - var eachOfLimit$2 = (limit) => { - return (obj, iteratee, callback) => { - callback = once(callback); - if (limit <= 0) { - throw new RangeError("concurrency limit cannot be less than 1"); - } - if (!obj) { - return callback(null); - } - if (isAsyncGenerator(obj)) { - return asyncEachOfLimit(obj, limit, iteratee, callback); - } - if (isAsyncIterable(obj)) { - return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback); - } - var nextElem = createIterator(obj); - var done = false; - var canceled = false; - var running = 0; - var looping = false; - function iterateeCallback(err, value) { - if (canceled) return; - running -= 1; - if (err) { - done = true; - callback(err); - } else if (err === false) { - done = true; - canceled = true; - } else if (value === breakLoop || done && running <= 0) { - done = true; - return callback(null); - } else if (!looping) { - replenish(); - } - } - function replenish() { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - looping = false; - } - replenish(); - }; - }; - function eachOfLimit(coll, limit, iteratee, callback) { - return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback); - } - var eachOfLimit$1 = awaitify(eachOfLimit, 4); - function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback); - var index3 = 0, completed = 0, { length } = coll, canceled = false; - if (length === 0) { - callback(null); - } - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return; - if (err) { - callback(err); - } else if (++completed === length || value === breakLoop) { - callback(null); - } - } - for (; index3 < length; index3++) { - iteratee(coll[index3], index3, onlyOnce(iteratorCallback)); - } - } - function eachOfGeneric(coll, iteratee, callback) { - return eachOfLimit$1(coll, Infinity, iteratee, callback); - } - function eachOf(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, wrapAsync(iteratee), callback); - } - var eachOf$1 = awaitify(eachOf, 3); - function map(coll, iteratee, callback) { - return _asyncMap(eachOf$1, coll, iteratee, callback); - } - var map$1 = awaitify(map, 3); - var applyEach = applyEach$1(map$1); - function eachOfSeries(coll, iteratee, callback) { - return eachOfLimit$1(coll, 1, iteratee, callback); - } - var eachOfSeries$1 = awaitify(eachOfSeries, 3); - function mapSeries(coll, iteratee, callback) { - return _asyncMap(eachOfSeries$1, coll, iteratee, callback); - } - var mapSeries$1 = awaitify(mapSeries, 3); - var applyEachSeries = applyEach$1(mapSeries$1); - const PROMISE_SYMBOL = /* @__PURE__ */ Symbol("promiseCallback"); - function promiseCallback() { - let resolve14, reject2; - function callback(err, ...args) { - if (err) return reject2(err); - resolve14(args.length > 1 ? args : args[0]); - } - callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve14 = res, reject2 = rej; - }); - return callback; - } - function auto(tasks, concurrency, callback) { - if (typeof concurrency !== "number") { - callback = concurrency; - concurrency = null; - } - callback = once(callback || promiseCallback()); - var numTasks = Object.keys(tasks).length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - var results = {}; - var runningTasks = 0; - var canceled = false; - var hasError = false; - var listeners = /* @__PURE__ */ Object.create(null); - var readyTasks = []; - var readyToCheck = []; - var uncheckedDependencies = {}; - Object.keys(tasks).forEach((key) => { - var task = tasks[key]; - if (!Array.isArray(task)) { - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - dependencies.forEach((dependencyName) => { - if (!tasks[dependencyName]) { - throw new Error("async.auto task `" + key + "` has a non-existent dependency `" + dependencyName + "` in " + dependencies.join(", ")); - } - addListener(dependencyName, () => { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - checkForDeadlocks(); - processQueue(); - function enqueueTask(key, task) { - readyTasks.push(() => runTask(key, task)); - } - function processQueue() { - if (canceled) return; - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while (readyTasks.length && runningTasks < concurrency) { - var run9 = readyTasks.shift(); - run9(); - } - } - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - taskListeners.push(fn); - } - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - taskListeners.forEach((fn) => fn()); - processQueue(); - } - function runTask(key, task) { - if (hasError) return; - var taskCallback = onlyOnce((err, ...result) => { - runningTasks--; - if (err === false) { - canceled = true; - return; - } - if (result.length < 2) { - [result] = result; - } - if (err) { - var safeResults = {}; - Object.keys(results).forEach((rkey) => { - safeResults[rkey] = results[rkey]; - }); - safeResults[key] = result; - hasError = true; - listeners = /* @__PURE__ */ Object.create(null); - if (canceled) return; - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } - function checkForDeadlocks() { - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - getDependents(currentTask).forEach((dependent) => { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - if (counter !== numTasks) { - throw new Error( - "async.auto cannot execute tasks due to a recursive dependency" - ); - } - } - function getDependents(taskName) { - var result = []; - Object.keys(tasks).forEach((key) => { - const task = tasks[key]; - if (Array.isArray(task) && task.indexOf(taskName) >= 0) { - result.push(key); - } - }); - return result; - } - return callback[PROMISE_SYMBOL]; - } - var FN_ARGS = /^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/; - var ARROW_FN_ARGS = /^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/; - var FN_ARG_SPLIT = /,/; - var FN_ARG = /(=.+)?(\s*)$/; - function stripComments(string2) { - let stripped = ""; - let index3 = 0; - let endBlockComment = string2.indexOf("*/"); - while (index3 < string2.length) { - if (string2[index3] === "/" && string2[index3 + 1] === "/") { - let endIndex = string2.indexOf("\n", index3); - index3 = endIndex === -1 ? string2.length : endIndex; - } else if (endBlockComment !== -1 && string2[index3] === "/" && string2[index3 + 1] === "*") { - let endIndex = string2.indexOf("*/", index3); - if (endIndex !== -1) { - index3 = endIndex + 2; - endBlockComment = string2.indexOf("*/", index3); - } else { - stripped += string2[index3]; - index3++; - } - } else { - stripped += string2[index3]; - index3++; - } - } - return stripped; - } - function parseParams(func) { - const src = stripComments(func.toString()); - let match2 = src.match(FN_ARGS); - if (!match2) { - match2 = src.match(ARROW_FN_ARGS); - } - if (!match2) throw new Error("could not parse args in autoInject\nSource:\n" + src); - let [, args] = match2; - return args.replace(/\s/g, "").split(FN_ARG_SPLIT).map((arg) => arg.replace(FN_ARG, "").trim()); - } - function autoInject(tasks, callback) { - var newTasks = {}; - Object.keys(tasks).forEach((key) => { - var taskFn = tasks[key]; - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; - if (Array.isArray(taskFn)) { - params = [...taskFn]; - taskFn = params.pop(); - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - if (!fnIsAsync) params.pop(); - newTasks[key] = params.concat(newTask); - } - function newTask(results, taskCb) { - var newArgs = params.map((name) => results[name]); - newArgs.push(taskCb); - wrapAsync(taskFn)(...newArgs); - } - }); - return auto(newTasks, callback); - } - class DLL { - constructor() { - this.head = this.tail = null; - this.length = 0; - } - removeLink(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; - node.prev = node.next = null; - this.length -= 1; - return node; - } - empty() { - while (this.head) this.shift(); - return this; - } - insertAfter(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; - } - insertBefore(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; - } - unshift(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); - } - push(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); - } - shift() { - return this.head && this.removeLink(this.head); - } - pop() { - return this.tail && this.removeLink(this.tail); - } - toArray() { - return [...this]; - } - *[Symbol.iterator]() { - var cur = this.head; - while (cur) { - yield cur.data; - cur = cur.next; - } - } - remove(testFn) { - var curr = this.head; - while (curr) { - var { next } = curr; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; - } - } - function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; - } - function queue$1(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } else if (concurrency === 0) { - throw new RangeError("Concurrency must not be zero"); - } - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; - const events = { - error: [], - drain: [], - saturated: [], - unsaturated: [], - empty: [] - }; - function on(event, handler2) { - events[event].push(handler2); - } - function once2(event, handler2) { - const handleAndRemove = (...args) => { - off(event, handleAndRemove); - handler2(...args); - }; - events[event].push(handleAndRemove); - } - function off(event, handler2) { - if (!event) return Object.keys(events).forEach((ev) => events[ev] = []); - if (!handler2) return events[event] = []; - events[event] = events[event].filter((ev) => ev !== handler2); - } - function trigger(event, ...args) { - events[event].forEach((handler2) => handler2(...args)); - } - var processingScheduled = false; - function _insert(data, insertAtFront, rejectOnError, callback) { - if (callback != null && typeof callback !== "function") { - throw new Error("task callback must be a function"); - } - q.started = true; - var res, rej; - function promiseCallback2(err, ...args) { - if (err) return rejectOnError ? rej(err) : res(); - if (args.length <= 1) return res(args[0]); - res(args); - } - var item = q._createTaskItem( - data, - rejectOnError ? promiseCallback2 : callback || promiseCallback2 - ); - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(() => { - processingScheduled = false; - q.process(); - }); - } - if (rejectOnError || !callback) { - return new Promise((resolve14, reject2) => { - res = resolve14; - rej = reject2; - }); - } - } - function _createCB(tasks) { - return function(err, ...args) { - numRunning -= 1; - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - var index3 = workersList.indexOf(task); - if (index3 === 0) { - workersList.shift(); - } else if (index3 > 0) { - workersList.splice(index3, 1); - } - task.callback(err, ...args); - if (err != null) { - trigger("error", err, task.data); - } - } - if (numRunning <= q.concurrency - q.buffer) { - trigger("unsaturated"); - } - if (q.idle()) { - trigger("drain"); - } - q.process(); - }; - } - function _maybeDrain(data) { - if (data.length === 0 && q.idle()) { - setImmediate$1(() => trigger("drain")); - return true; - } - return false; - } - const eventMethod = (name) => (handler2) => { - if (!handler2) { - return new Promise((resolve14, reject2) => { - once2(name, (err, data) => { - if (err) return reject2(err); - resolve14(data); - }); - }); - } - off(name); - on(name, handler2); - }; - var isProcessing = false; - var q = { - _tasks: new DLL(), - _createTaskItem(data, callback) { - return { - data, - callback - }; - }, - *[Symbol.iterator]() { - yield* q._tasks[Symbol.iterator](); - }, - concurrency, - payload, - buffer: concurrency / 4, - started: false, - paused: false, - push(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map((datum) => _insert(datum, false, false, callback)); - } - return _insert(data, false, false, callback); - }, - pushAsync(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map((datum) => _insert(datum, false, true, callback)); - } - return _insert(data, false, true, callback); - }, - kill() { - off(); - q._tasks.empty(); - }, - unshift(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map((datum) => _insert(datum, true, false, callback)); - } - return _insert(data, true, false, callback); - }, - unshiftAsync(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map((datum) => _insert(datum, true, true, callback)); - } - return _insert(data, true, true, callback); - }, - remove(testFn) { - q._tasks.remove(testFn); - }, - process() { - if (isProcessing) { - return; - } - isProcessing = true; - while (!q.paused && numRunning < q.concurrency && q._tasks.length) { - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - numRunning += 1; - if (q._tasks.length === 0) { - trigger("empty"); - } - if (numRunning === q.concurrency) { - trigger("saturated"); - } - var cb = onlyOnce(_createCB(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length() { - return q._tasks.length; - }, - running() { - return numRunning; - }, - workersList() { - return workersList; - }, - idle() { - return q._tasks.length + numRunning === 0; - }, - pause() { - q.paused = true; - }, - resume() { - if (q.paused === false) { - return; - } - q.paused = false; - setImmediate$1(q.process); - } - }; - Object.defineProperties(q, { - saturated: { - writable: false, - value: eventMethod("saturated") - }, - unsaturated: { - writable: false, - value: eventMethod("unsaturated") - }, - empty: { - writable: false, - value: eventMethod("empty") - }, - drain: { - writable: false, - value: eventMethod("drain") - }, - error: { - writable: false, - value: eventMethod("error") - } - }); - return q; - } - function cargo$1(worker, payload) { - return queue$1(worker, 1, payload); - } - function cargo(worker, concurrency, payload) { - return queue$1(worker, concurrency, payload); - } - function reduce(coll, memo, iteratee, callback) { - callback = once(callback); - var _iteratee = wrapAsync(iteratee); - return eachOfSeries$1(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, (err) => callback(err, memo)); - } - var reduce$1 = awaitify(reduce, 4); - function seq(...functions) { - var _functions = functions.map(wrapAsync); - return function(...args) { - var that = this; - var cb = args[args.length - 1]; - if (typeof cb == "function") { - args.pop(); - } else { - cb = promiseCallback(); - } - reduce$1( - _functions, - args, - (newargs, fn, iterCb) => { - fn.apply(that, newargs.concat((err, ...nextargs) => { - iterCb(err, nextargs); - })); - }, - (err, results) => cb(err, ...results) - ); - return cb[PROMISE_SYMBOL]; - }; - } - function compose(...args) { - return seq(...args.reverse()); - } - function mapLimit(coll, limit, iteratee, callback) { - return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback); - } - var mapLimit$1 = awaitify(mapLimit, 4); - function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - return callback(err, result); - }); - } - var concatLimit$1 = awaitify(concatLimit, 4); - function concat(coll, iteratee, callback) { - return concatLimit$1(coll, Infinity, iteratee, callback); - } - var concat$1 = awaitify(concat, 3); - function concatSeries(coll, iteratee, callback) { - return concatLimit$1(coll, 1, iteratee, callback); - } - var concatSeries$1 = awaitify(concatSeries, 3); - function constant$1(...args) { - return function(...ignoredArgs) { - var callback = ignoredArgs.pop(); - return callback(null, ...args); - }; - } - function _createTester(check, getResult) { - return (eachfn, arr, _iteratee, cb) => { - var testPassed = false; - var testResult; - const iteratee = wrapAsync(_iteratee); - eachfn(arr, (value, _2, callback) => { - iteratee(value, (err, result) => { - if (err || err === false) return callback(err); - if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - return callback(null, breakLoop); - } - callback(); - }); - }, (err) => { - if (err) return cb(err); - cb(null, testPassed ? testResult : getResult(false)); - }); - }; - } - function detect(coll, iteratee, callback) { - return _createTester((bool) => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback); - } - var detect$1 = awaitify(detect, 3); - function detectLimit(coll, limit, iteratee, callback) { - return _createTester((bool) => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback); - } - var detectLimit$1 = awaitify(detectLimit, 4); - function detectSeries(coll, iteratee, callback) { - return _createTester((bool) => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback); - } - var detectSeries$1 = awaitify(detectSeries, 3); - function consoleFunc(name) { - return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { - if (typeof console === "object") { - if (err) { - if (console.error) { - console.error(err); - } - } else if (console[name]) { - resultArgs.forEach((x) => console[name](x)); - } - } - }); - } - var dir = consoleFunc("dir"); - function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results; - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - return check(null, true); - } - var doWhilst$1 = awaitify(doWhilst, 3); - function doUntil(iteratee, test, callback) { - const _test = wrapAsync(test); - return doWhilst$1(iteratee, (...args) => { - const cb = args.pop(); - _test(...args, (err, truth) => cb(err, !truth)); - }, callback); - } - function _withoutIndex(iteratee) { - return (value, index3, callback) => iteratee(value, callback); - } - function eachLimit$2(coll, iteratee, callback) { - return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); - } - var each = awaitify(eachLimit$2, 3); - function eachLimit(coll, limit, iteratee, callback) { - return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); - } - var eachLimit$1 = awaitify(eachLimit, 4); - function eachSeries(coll, iteratee, callback) { - return eachLimit$1(coll, 1, iteratee, callback); - } - var eachSeries$1 = awaitify(eachSeries, 3); - function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return function(...args) { - var callback = args.pop(); - var sync = true; - args.push((...innerArgs) => { - if (sync) { - setImmediate$1(() => callback(...innerArgs)); - } else { - callback(...innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }; - } - function every(coll, iteratee, callback) { - return _createTester((bool) => !bool, (res) => !res)(eachOf$1, coll, iteratee, callback); - } - var every$1 = awaitify(every, 3); - function everyLimit(coll, limit, iteratee, callback) { - return _createTester((bool) => !bool, (res) => !res)(eachOfLimit$2(limit), coll, iteratee, callback); - } - var everyLimit$1 = awaitify(everyLimit, 4); - function everySeries(coll, iteratee, callback) { - return _createTester((bool) => !bool, (res) => !res)(eachOfSeries$1, coll, iteratee, callback); - } - var everySeries$1 = awaitify(everySeries, 3); - function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, (x, index3, iterCb) => { - iteratee(x, (err, v) => { - truthValues[index3] = !!v; - iterCb(err); - }); - }, (err) => { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); - } - function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, (x, index3, iterCb) => { - iteratee(x, (err, v) => { - if (err) return iterCb(err); - if (v) { - results.push({ index: index3, value: x }); - } - iterCb(err); - }); - }, (err) => { - if (err) return callback(err); - callback(null, results.sort((a, b) => a.index - b.index).map((v) => v.value)); - }); - } - function _filter(eachfn, coll, iteratee, callback) { - var filter3 = isArrayLike(coll) ? filterArray : filterGeneric; - return filter3(eachfn, coll, wrapAsync(iteratee), callback); - } - function filter2(coll, iteratee, callback) { - return _filter(eachOf$1, coll, iteratee, callback); - } - var filter$1 = awaitify(filter2, 3); - function filterLimit(coll, limit, iteratee, callback) { - return _filter(eachOfLimit$2(limit), coll, iteratee, callback); - } - var filterLimit$1 = awaitify(filterLimit, 4); - function filterSeries(coll, iteratee, callback) { - return _filter(eachOfSeries$1, coll, iteratee, callback); - } - var filterSeries$1 = awaitify(filterSeries, 3); - function forever(fn, errback) { - var done = onlyOnce(errback); - var task = wrapAsync(ensureAsync(fn)); - function next(err) { - if (err) return done(err); - if (err === false) return; - task(next); - } - return next(); - } - var forever$1 = awaitify(forever, 2); - function groupByLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, key) => { - if (err) return iterCb(err); - return iterCb(err, { key, val }); - }); - }, (err, mapResults) => { - var result = {}; - var { hasOwnProperty } = Object.prototype; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var { key } = mapResults[i]; - var { val } = mapResults[i]; - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } - return callback(err, result); - }); - } - var groupByLimit$1 = awaitify(groupByLimit, 4); - function groupBy(coll, iteratee, callback) { - return groupByLimit$1(coll, Infinity, iteratee, callback); - } - function groupBySeries(coll, iteratee, callback) { - return groupByLimit$1(coll, 1, iteratee, callback); - } - var log = consoleFunc("log"); - function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - return eachOfLimit$2(limit)(obj, (val, key, next) => { - _iteratee(val, key, (err, result) => { - if (err) return next(err); - newObj[key] = result; - next(err); - }); - }, (err) => callback(err, newObj)); - } - var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); - function mapValues(obj, iteratee, callback) { - return mapValuesLimit$1(obj, Infinity, iteratee, callback); - } - function mapValuesSeries(obj, iteratee, callback) { - return mapValuesLimit$1(obj, 1, iteratee, callback); - } - function memoize(fn, hasher = (v) => v) { - var memo = /* @__PURE__ */ Object.create(null); - var queues = /* @__PURE__ */ Object.create(null); - var _fn = wrapAsync(fn); - var memoized = initialParams((args, callback) => { - var key = hasher(...args); - if (key in memo) { - setImmediate$1(() => callback(null, ...memo[key])); - } else if (key in queues) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn(...args, (err, ...resultArgs) => { - if (!err) { - memo[key] = resultArgs; - } - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i](err, ...resultArgs); - } - }); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - } - var _defer; - if (hasNextTick) { - _defer = process.nextTick; - } else if (hasSetImmediate) { - _defer = setImmediate; - } else { - _defer = fallback; - } - var nextTick = wrap(_defer); - var _parallel = awaitify((eachfn, tasks, callback) => { - var results = isArrayLike(tasks) ? [] : {}; - eachfn(tasks, (task, key, taskCb) => { - wrapAsync(task)((err, ...result) => { - if (result.length < 2) { - [result] = result; - } - results[key] = result; - taskCb(err); - }); - }, (err) => callback(err, results)); - }, 3); - function parallel(tasks, callback) { - return _parallel(eachOf$1, tasks, callback); - } - function parallelLimit(tasks, limit, callback) { - return _parallel(eachOfLimit$2(limit), tasks, callback); - } - function queue2(worker, concurrency) { - var _worker = wrapAsync(worker); - return queue$1((items, cb) => { - _worker(items[0], cb); - }, concurrency, 1); - } - class Heap { - constructor() { - this.heap = []; - this.pushCount = Number.MIN_SAFE_INTEGER; - } - get length() { - return this.heap.length; - } - empty() { - this.heap = []; - return this; - } - percUp(index3) { - let p; - while (index3 > 0 && smaller(this.heap[index3], this.heap[p = parent(index3)])) { - let t = this.heap[index3]; - this.heap[index3] = this.heap[p]; - this.heap[p] = t; - index3 = p; - } - } - percDown(index3) { - let l; - while ((l = leftChi(index3)) < this.heap.length) { - if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) { - l = l + 1; - } - if (smaller(this.heap[index3], this.heap[l])) { - break; - } - let t = this.heap[index3]; - this.heap[index3] = this.heap[l]; - this.heap[l] = t; - index3 = l; - } - } - push(node) { - node.pushCount = ++this.pushCount; - this.heap.push(node); - this.percUp(this.heap.length - 1); - } - unshift(node) { - return this.heap.push(node); - } - shift() { - let [top] = this.heap; - this.heap[0] = this.heap[this.heap.length - 1]; - this.heap.pop(); - this.percDown(0); - return top; - } - toArray() { - return [...this]; - } - *[Symbol.iterator]() { - for (let i = 0; i < this.heap.length; i++) { - yield this.heap[i].data; - } - } - remove(testFn) { - let j = 0; - for (let i = 0; i < this.heap.length; i++) { - if (!testFn(this.heap[i])) { - this.heap[j] = this.heap[i]; - j++; - } - } - this.heap.splice(j); - for (let i = parent(this.heap.length - 1); i >= 0; i--) { - this.percDown(i); - } - return this; - } - } - function leftChi(i) { - return (i << 1) + 1; - } - function parent(i) { - return (i + 1 >> 1) - 1; - } - function smaller(x, y) { - if (x.priority !== y.priority) { - return x.priority < y.priority; - } else { - return x.pushCount < y.pushCount; - } - } - function priorityQueue(worker, concurrency) { - var q = queue2(worker, concurrency); - var { - push, - pushAsync - } = q; - q._tasks = new Heap(); - q._createTaskItem = ({ data, priority }, callback) => { - return { - data, - priority, - callback - }; - }; - function createDataItems(tasks, priority) { - if (!Array.isArray(tasks)) { - return { data: tasks, priority }; - } - return tasks.map((data) => { - return { data, priority }; - }); - } - q.push = function(data, priority = 0, callback) { - return push(createDataItems(data, priority), callback); - }; - q.pushAsync = function(data, priority = 0, callback) { - return pushAsync(createDataItems(data, priority), callback); - }; - delete q.unshift; - delete q.unshiftAsync; - return q; - } - function race(tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new TypeError("First argument to race must be an array of functions")); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); - } - } - var race$1 = awaitify(race, 2); - function reduceRight(array2, memo, iteratee, callback) { - var reversed = [...array2].reverse(); - return reduce$1(reversed, memo, iteratee, callback); - } - function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push((error3, ...cbArgs) => { - let retVal = {}; - if (error3) { - retVal.error = error3; - } - if (cbArgs.length > 0) { - var value = cbArgs; - if (cbArgs.length <= 1) { - [value] = cbArgs; - } - retVal.value = value; - } - reflectCallback(null, retVal); - }); - return _fn.apply(this, args); - }); - } - function reflectAll(tasks) { - var results; - if (Array.isArray(tasks)) { - results = tasks.map(reflect); - } else { - results = {}; - Object.keys(tasks).forEach((key) => { - results[key] = reflect.call(this, tasks[key]); - }); - } - return results; - } - function reject$2(eachfn, arr, _iteratee, callback) { - const iteratee = wrapAsync(_iteratee); - return _filter(eachfn, arr, (value, cb) => { - iteratee(value, (err, v) => { - cb(err, !v); - }); - }, callback); - } - function reject(coll, iteratee, callback) { - return reject$2(eachOf$1, coll, iteratee, callback); - } - var reject$1 = awaitify(reject, 3); - function rejectLimit(coll, limit, iteratee, callback) { - return reject$2(eachOfLimit$2(limit), coll, iteratee, callback); - } - var rejectLimit$1 = awaitify(rejectLimit, 4); - function rejectSeries(coll, iteratee, callback) { - return reject$2(eachOfSeries$1, coll, iteratee, callback); - } - var rejectSeries$1 = awaitify(rejectSeries, 3); - function constant(value) { - return function() { - return value; - }; - } - const DEFAULT_TIMES = 5; - const DEFAULT_INTERVAL = 0; - function retry2(opts, task, callback) { - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant(DEFAULT_INTERVAL) - }; - if (arguments.length < 3 && typeof opts === "function") { - callback = task || promiseCallback(); - task = opts; - } else { - parseTimes(options, opts); - callback = callback || promiseCallback(); - } - if (typeof task !== "function") { - throw new Error("Invalid arguments for async.retry"); - } - var _task = wrapAsync(task); - var attempt = 1; - function retryAttempt() { - _task((err, ...args) => { - if (err === false) return; - if (err && attempt++ < options.times && (typeof options.errorFilter != "function" || options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); - } else { - callback(err, ...args); - } - }); - } - retryAttempt(); - return callback[PROMISE_SYMBOL]; - } - function parseTimes(acc, t) { - if (typeof t === "object") { - acc.times = +t.times || DEFAULT_TIMES; - acc.intervalFunc = typeof t.interval === "function" ? t.interval : constant(+t.interval || DEFAULT_INTERVAL); - acc.errorFilter = t.errorFilter; - } else if (typeof t === "number" || typeof t === "string") { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } - } - function retryable(opts, task) { - if (!task) { - task = opts; - opts = null; - } - let arity = opts && opts.arity || task.length; - if (isAsync(task)) { - arity += 1; - } - var _task = wrapAsync(task); - return initialParams((args, callback) => { - if (args.length < arity - 1 || callback == null) { - args.push(callback); - callback = promiseCallback(); - } - function taskFn(cb) { - _task(...args, cb); - } - if (opts) retry2(opts, taskFn, callback); - else retry2(taskFn, callback); - return callback[PROMISE_SYMBOL]; - }); - } - function series(tasks, callback) { - return _parallel(eachOfSeries$1, tasks, callback); - } - function some(coll, iteratee, callback) { - return _createTester(Boolean, (res) => res)(eachOf$1, coll, iteratee, callback); - } - var some$1 = awaitify(some, 3); - function someLimit(coll, limit, iteratee, callback) { - return _createTester(Boolean, (res) => res)(eachOfLimit$2(limit), coll, iteratee, callback); - } - var someLimit$1 = awaitify(someLimit, 4); - function someSeries(coll, iteratee, callback) { - return _createTester(Boolean, (res) => res)(eachOfSeries$1, coll, iteratee, callback); - } - var someSeries$1 = awaitify(someSeries, 3); - function sortBy(coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return map$1(coll, (x, iterCb) => { - _iteratee(x, (err, criteria) => { - if (err) return iterCb(err); - iterCb(err, { value: x, criteria }); - }); - }, (err, results) => { - if (err) return callback(err); - callback(null, results.sort(comparator).map((v) => v.value)); - }); - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } - } - var sortBy$1 = awaitify(sortBy, 3); - function timeout(asyncFn, milliseconds, info8) { - var fn = wrapAsync(asyncFn); - return initialParams((args, callback) => { - var timedOut = false; - var timer; - function timeoutCallback() { - var name = asyncFn.name || "anonymous"; - var error3 = new Error('Callback function "' + name + '" timed out.'); - error3.code = "ETIMEDOUT"; - if (info8) { - error3.info = info8; - } - timedOut = true; - callback(error3); - } - args.push((...cbArgs) => { - if (!timedOut) { - callback(...cbArgs); - clearTimeout(timer); - } - }); - timer = setTimeout(timeoutCallback, milliseconds); - fn(...args); - }); - } - function range2(size) { - var result = Array(size); - while (size--) { - result[size] = size; - } - return result; - } - function timesLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(range2(count), limit, _iteratee, callback); - } - function times(n, iteratee, callback) { - return timesLimit(n, Infinity, iteratee, callback); - } - function timesSeries(n, iteratee, callback) { - return timesLimit(n, 1, iteratee, callback); - } - function transform(coll, accumulator, iteratee, callback) { - if (arguments.length <= 3 && typeof accumulator === "function") { - callback = iteratee; - iteratee = accumulator; - accumulator = Array.isArray(coll) ? [] : {}; - } - callback = once(callback || promiseCallback()); - var _iteratee = wrapAsync(iteratee); - eachOf$1(coll, (v, k, cb) => { - _iteratee(accumulator, v, k, cb); - }, (err) => callback(err, accumulator)); - return callback[PROMISE_SYMBOL]; - } - function tryEach(tasks, callback) { - var error3 = null; - var result; - return eachSeries$1(tasks, (task, taskCb) => { - wrapAsync(task)((err, ...args) => { - if (err === false) return taskCb(err); - if (args.length < 2) { - [result] = args; - } else { - result = args; - } - error3 = err; - taskCb(err ? null : {}); - }); - }, () => callback(error3, result)); - } - var tryEach$1 = awaitify(tryEach); - function unmemoize(fn) { - return (...args) => { - return (fn.unmemoized || fn)(...args); - }; - } - function whilst(test, iteratee, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results = []; - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - return _test(check); - } - var whilst$1 = awaitify(whilst, 3); - function until(test, iteratee, callback) { - const _test = wrapAsync(test); - return whilst$1((cb) => _test((err, truth) => cb(err, !truth)), iteratee, callback); - } - function waterfall(tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new Error("First argument to waterfall must be an array of functions")); - if (!tasks.length) return callback(); - var taskIndex = 0; - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - task(...args, onlyOnce(next)); - } - function next(err, ...args) { - if (err === false) return; - if (err || taskIndex === tasks.length) { - return callback(err, ...args); - } - nextTask(args); - } - nextTask([]); - } - var waterfall$1 = awaitify(waterfall); - var index2 = { - apply, - applyEach, - applyEachSeries, - asyncify, - auto, - autoInject, - cargo: cargo$1, - cargoQueue: cargo, - compose, - concat: concat$1, - concatLimit: concatLimit$1, - concatSeries: concatSeries$1, - constant: constant$1, - detect: detect$1, - detectLimit: detectLimit$1, - detectSeries: detectSeries$1, - dir, - doUntil, - doWhilst: doWhilst$1, - each, - eachLimit: eachLimit$1, - eachOf: eachOf$1, - eachOfLimit: eachOfLimit$1, - eachOfSeries: eachOfSeries$1, - eachSeries: eachSeries$1, - ensureAsync, - every: every$1, - everyLimit: everyLimit$1, - everySeries: everySeries$1, - filter: filter$1, - filterLimit: filterLimit$1, - filterSeries: filterSeries$1, - forever: forever$1, - groupBy, - groupByLimit: groupByLimit$1, - groupBySeries, - log, - map: map$1, - mapLimit: mapLimit$1, - mapSeries: mapSeries$1, - mapValues, - mapValuesLimit: mapValuesLimit$1, - mapValuesSeries, - memoize, - nextTick, - parallel, - parallelLimit, - priorityQueue, - queue: queue2, - race: race$1, - reduce: reduce$1, - reduceRight, - reflect, - reflectAll, - reject: reject$1, - rejectLimit: rejectLimit$1, - rejectSeries: rejectSeries$1, - retry: retry2, - retryable, - seq, - series, - setImmediate: setImmediate$1, - some: some$1, - someLimit: someLimit$1, - someSeries: someSeries$1, - sortBy: sortBy$1, - timeout, - times, - timesLimit, - timesSeries, - transform, - tryEach: tryEach$1, - unmemoize, - until, - waterfall: waterfall$1, - whilst: whilst$1, - // aliases - all: every$1, - allLimit: everyLimit$1, - allSeries: everySeries$1, - any: some$1, - anyLimit: someLimit$1, - anySeries: someSeries$1, - find: detect$1, - findLimit: detectLimit$1, - findSeries: detectSeries$1, - flatMap: concat$1, - flatMapLimit: concatLimit$1, - flatMapSeries: concatSeries$1, - forEach: each, - forEachSeries: eachSeries$1, - forEachLimit: eachLimit$1, - forEachOf: eachOf$1, - forEachOfSeries: eachOfSeries$1, - forEachOfLimit: eachOfLimit$1, - inject: reduce$1, - foldl: reduce$1, - foldr: reduceRight, - select: filter$1, - selectLimit: filterLimit$1, - selectSeries: filterSeries$1, - wrapSync: asyncify, - during: whilst$1, - doDuring: doWhilst$1 - }; - exports3.all = every$1; - exports3.allLimit = everyLimit$1; - exports3.allSeries = everySeries$1; - exports3.any = some$1; - exports3.anyLimit = someLimit$1; - exports3.anySeries = someSeries$1; - exports3.apply = apply; - exports3.applyEach = applyEach; - exports3.applyEachSeries = applyEachSeries; - exports3.asyncify = asyncify; - exports3.auto = auto; - exports3.autoInject = autoInject; - exports3.cargo = cargo$1; - exports3.cargoQueue = cargo; - exports3.compose = compose; - exports3.concat = concat$1; - exports3.concatLimit = concatLimit$1; - exports3.concatSeries = concatSeries$1; - exports3.constant = constant$1; - exports3.default = index2; - exports3.detect = detect$1; - exports3.detectLimit = detectLimit$1; - exports3.detectSeries = detectSeries$1; - exports3.dir = dir; - exports3.doDuring = doWhilst$1; - exports3.doUntil = doUntil; - exports3.doWhilst = doWhilst$1; - exports3.during = whilst$1; - exports3.each = each; - exports3.eachLimit = eachLimit$1; - exports3.eachOf = eachOf$1; - exports3.eachOfLimit = eachOfLimit$1; - exports3.eachOfSeries = eachOfSeries$1; - exports3.eachSeries = eachSeries$1; - exports3.ensureAsync = ensureAsync; - exports3.every = every$1; - exports3.everyLimit = everyLimit$1; - exports3.everySeries = everySeries$1; - exports3.filter = filter$1; - exports3.filterLimit = filterLimit$1; - exports3.filterSeries = filterSeries$1; - exports3.find = detect$1; - exports3.findLimit = detectLimit$1; - exports3.findSeries = detectSeries$1; - exports3.flatMap = concat$1; - exports3.flatMapLimit = concatLimit$1; - exports3.flatMapSeries = concatSeries$1; - exports3.foldl = reduce$1; - exports3.foldr = reduceRight; - exports3.forEach = each; - exports3.forEachLimit = eachLimit$1; - exports3.forEachOf = eachOf$1; - exports3.forEachOfLimit = eachOfLimit$1; - exports3.forEachOfSeries = eachOfSeries$1; - exports3.forEachSeries = eachSeries$1; - exports3.forever = forever$1; - exports3.groupBy = groupBy; - exports3.groupByLimit = groupByLimit$1; - exports3.groupBySeries = groupBySeries; - exports3.inject = reduce$1; - exports3.log = log; - exports3.map = map$1; - exports3.mapLimit = mapLimit$1; - exports3.mapSeries = mapSeries$1; - exports3.mapValues = mapValues; - exports3.mapValuesLimit = mapValuesLimit$1; - exports3.mapValuesSeries = mapValuesSeries; - exports3.memoize = memoize; - exports3.nextTick = nextTick; - exports3.parallel = parallel; - exports3.parallelLimit = parallelLimit; - exports3.priorityQueue = priorityQueue; - exports3.queue = queue2; - exports3.race = race$1; - exports3.reduce = reduce$1; - exports3.reduceRight = reduceRight; - exports3.reflect = reflect; - exports3.reflectAll = reflectAll; - exports3.reject = reject$1; - exports3.rejectLimit = rejectLimit$1; - exports3.rejectSeries = rejectSeries$1; - exports3.retry = retry2; - exports3.retryable = retryable; - exports3.select = filter$1; - exports3.selectLimit = filterLimit$1; - exports3.selectSeries = filterSeries$1; - exports3.seq = seq; - exports3.series = series; - exports3.setImmediate = setImmediate$1; - exports3.some = some$1; - exports3.someLimit = someLimit$1; - exports3.someSeries = someSeries$1; - exports3.sortBy = sortBy$1; - exports3.timeout = timeout; - exports3.times = times; - exports3.timesLimit = timesLimit; - exports3.timesSeries = timesSeries; - exports3.transform = transform; - exports3.tryEach = tryEach$1; - exports3.unmemoize = unmemoize; - exports3.until = until; - exports3.waterfall = waterfall$1; - exports3.whilst = whilst$1; - exports3.wrapSync = asyncify; - Object.defineProperty(exports3, "__esModule", { value: true }); - })); - } -}); - -// node_modules/graceful-fs/polyfills.js -var require_polyfills = __commonJS({ - "node_modules/graceful-fs/polyfills.js"(exports2, module2) { - var constants = require("constants"); - var origCwd = process.cwd; - var cwd = null; - var platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform; - process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process); - return cwd; - }; - try { - process.cwd(); - } catch (er) { - } - if (typeof process.chdir === "function") { - chdir = process.chdir; - process.chdir = function(d) { - cwd = null; - chdir.call(process, d); - }; - if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir); - } - var chdir; - module2.exports = patch; - function patch(fs32) { - if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs32); - } - if (!fs32.lutimes) { - patchLutimes(fs32); - } - fs32.chown = chownFix(fs32.chown); - fs32.fchown = chownFix(fs32.fchown); - fs32.lchown = chownFix(fs32.lchown); - fs32.chmod = chmodFix(fs32.chmod); - fs32.fchmod = chmodFix(fs32.fchmod); - fs32.lchmod = chmodFix(fs32.lchmod); - fs32.chownSync = chownFixSync(fs32.chownSync); - fs32.fchownSync = chownFixSync(fs32.fchownSync); - fs32.lchownSync = chownFixSync(fs32.lchownSync); - fs32.chmodSync = chmodFixSync(fs32.chmodSync); - fs32.fchmodSync = chmodFixSync(fs32.fchmodSync); - fs32.lchmodSync = chmodFixSync(fs32.lchmodSync); - fs32.stat = statFix(fs32.stat); - fs32.fstat = statFix(fs32.fstat); - fs32.lstat = statFix(fs32.lstat); - fs32.statSync = statFixSync(fs32.statSync); - fs32.fstatSync = statFixSync(fs32.fstatSync); - fs32.lstatSync = statFixSync(fs32.lstatSync); - if (fs32.chmod && !fs32.lchmod) { - fs32.lchmod = function(path30, mode, cb) { - if (cb) process.nextTick(cb); - }; - fs32.lchmodSync = function() { - }; - } - if (fs32.chown && !fs32.lchown) { - fs32.lchown = function(path30, uid, gid, cb) { - if (cb) process.nextTick(cb); - }; - fs32.lchownSync = function() { - }; - } - if (platform2 === "win32") { - fs32.rename = typeof fs32.rename !== "function" ? fs32.rename : (function(fs$rename) { - function rename(from, to, cb) { - var start = Date.now(); - var backoff = 0; - fs$rename(from, to, function CB(er) { - if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) { - setTimeout(function() { - fs32.stat(to, function(stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er); - }); - }, backoff); - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er); - }); - } - if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); - return rename; - })(fs32.rename); - } - fs32.read = typeof fs32.read !== "function" ? fs32.read : (function(fs$read) { - function read(fd, buffer, offset, length, position, callback_) { - var callback; - if (callback_ && typeof callback_ === "function") { - var eagCounter = 0; - callback = function(er, _2, __) { - if (er && er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - return fs$read.call(fs32, fd, buffer, offset, length, position, callback); - } - callback_.apply(this, arguments); - }; - } - return fs$read.call(fs32, fd, buffer, offset, length, position, callback); - } - if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); - return read; - })(fs32.read); - fs32.readSync = typeof fs32.readSync !== "function" ? fs32.readSync : /* @__PURE__ */ (function(fs$readSync) { - return function(fd, buffer, offset, length, position) { - var eagCounter = 0; - while (true) { - try { - return fs$readSync.call(fs32, fd, buffer, offset, length, position); - } catch (er) { - if (er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - continue; - } - throw er; - } - } - }; - })(fs32.readSync); - function patchLchmod(fs33) { - fs33.lchmod = function(path30, mode, callback) { - fs33.open( - path30, - constants.O_WRONLY | constants.O_SYMLINK, - mode, - function(err, fd) { - if (err) { - if (callback) callback(err); - return; - } - fs33.fchmod(fd, mode, function(err2) { - fs33.close(fd, function(err22) { - if (callback) callback(err2 || err22); - }); - }); - } - ); - }; - fs33.lchmodSync = function(path30, mode) { - var fd = fs33.openSync(path30, constants.O_WRONLY | constants.O_SYMLINK, mode); - var threw = true; - var ret; - try { - ret = fs33.fchmodSync(fd, mode); - threw = false; - } finally { - if (threw) { - try { - fs33.closeSync(fd); - } catch (er) { - } - } else { - fs33.closeSync(fd); - } - } - return ret; - }; - } - function patchLutimes(fs33) { - if (constants.hasOwnProperty("O_SYMLINK") && fs33.futimes) { - fs33.lutimes = function(path30, at, mt, cb) { - fs33.open(path30, constants.O_SYMLINK, function(er, fd) { - if (er) { - if (cb) cb(er); - return; - } - fs33.futimes(fd, at, mt, function(er2) { - fs33.close(fd, function(er22) { - if (cb) cb(er2 || er22); - }); - }); - }); - }; - fs33.lutimesSync = function(path30, at, mt) { - var fd = fs33.openSync(path30, constants.O_SYMLINK); - var ret; - var threw = true; - try { - ret = fs33.futimesSync(fd, at, mt); - threw = false; - } finally { - if (threw) { - try { - fs33.closeSync(fd); - } catch (er) { - } - } else { - fs33.closeSync(fd); - } - } - return ret; - }; - } else if (fs33.futimes) { - fs33.lutimes = function(_a2, _b, _c, cb) { - if (cb) process.nextTick(cb); - }; - fs33.lutimesSync = function() { - }; - } - } - function chmodFix(orig) { - if (!orig) return orig; - return function(target, mode, cb) { - return orig.call(fs32, target, mode, function(er) { - if (chownErOk(er)) er = null; - if (cb) cb.apply(this, arguments); - }); - }; - } - function chmodFixSync(orig) { - if (!orig) return orig; - return function(target, mode) { - try { - return orig.call(fs32, target, mode); - } catch (er) { - if (!chownErOk(er)) throw er; - } - }; - } - function chownFix(orig) { - if (!orig) return orig; - return function(target, uid, gid, cb) { - return orig.call(fs32, target, uid, gid, function(er) { - if (chownErOk(er)) er = null; - if (cb) cb.apply(this, arguments); - }); - }; - } - function chownFixSync(orig) { - if (!orig) return orig; - return function(target, uid, gid) { - try { - return orig.call(fs32, target, uid, gid); - } catch (er) { - if (!chownErOk(er)) throw er; - } - }; - } - function statFix(orig) { - if (!orig) return orig; - return function(target, options, cb) { - if (typeof options === "function") { - cb = options; - options = null; - } - function callback(er, stats) { - if (stats) { - if (stats.uid < 0) stats.uid += 4294967296; - if (stats.gid < 0) stats.gid += 4294967296; - } - if (cb) cb.apply(this, arguments); - } - return options ? orig.call(fs32, target, options, callback) : orig.call(fs32, target, callback); - }; - } - function statFixSync(orig) { - if (!orig) return orig; - return function(target, options) { - var stats = options ? orig.call(fs32, target, options) : orig.call(fs32, target); - if (stats) { - if (stats.uid < 0) stats.uid += 4294967296; - if (stats.gid < 0) stats.gid += 4294967296; - } - return stats; - }; - } - function chownErOk(er) { - if (!er) - return true; - if (er.code === "ENOSYS") - return true; - var nonroot = !process.getuid || process.getuid() !== 0; - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true; - } - return false; - } - } - } -}); - -// node_modules/graceful-fs/legacy-streams.js -var require_legacy_streams = __commonJS({ - "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { - var Stream = require("stream").Stream; - module2.exports = legacy; - function legacy(fs32) { - return { - ReadStream, - WriteStream - }; - function ReadStream(path30, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path30, options); - Stream.call(this); - var self2 = this; - this.path = path30; - this.fd = null; - this.readable = true; - this.paused = false; - this.flags = "r"; - this.mode = 438; - this.bufferSize = 64 * 1024; - options = options || {}; - var keys = Object.keys(options); - for (var index2 = 0, length = keys.length; index2 < length; index2++) { - var key = keys[index2]; - this[key] = options[key]; - } - if (this.encoding) this.setEncoding(this.encoding); - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.end === void 0) { - this.end = Infinity; - } else if ("number" !== typeof this.end) { - throw TypeError("end must be a Number"); - } - if (this.start > this.end) { - throw new Error("start must be <= end"); - } - this.pos = this.start; - } - if (this.fd !== null) { - process.nextTick(function() { - self2._read(); - }); - return; - } - fs32.open(this.path, this.flags, this.mode, function(err, fd) { - if (err) { - self2.emit("error", err); - self2.readable = false; - return; - } - self2.fd = fd; - self2.emit("open", fd); - self2._read(); - }); - } - function WriteStream(path30, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path30, options); - Stream.call(this); - this.path = path30; - this.fd = null; - this.writable = true; - this.flags = "w"; - this.encoding = "binary"; - this.mode = 438; - this.bytesWritten = 0; - options = options || {}; - var keys = Object.keys(options); - for (var index2 = 0, length = keys.length; index2 < length; index2++) { - var key = keys[index2]; - this[key] = options[key]; - } - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.start < 0) { - throw new Error("start must be >= zero"); - } - this.pos = this.start; - } - this.busy = false; - this._queue = []; - if (this.fd === null) { - this._open = fs32.open; - this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); - this.flush(); - } - } - } - } -}); - -// node_modules/graceful-fs/clone.js -var require_clone = __commonJS({ - "node_modules/graceful-fs/clone.js"(exports2, module2) { - "use strict"; - module2.exports = clone; - var getPrototypeOf = Object.getPrototypeOf || function(obj) { - return obj.__proto__; - }; - function clone(obj) { - if (obj === null || typeof obj !== "object") - return obj; - if (obj instanceof Object) - var copy = { __proto__: getPrototypeOf(obj) }; - else - var copy = /* @__PURE__ */ Object.create(null); - Object.getOwnPropertyNames(obj).forEach(function(key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); - }); - return copy; - } - } -}); - -// node_modules/graceful-fs/graceful-fs.js -var require_graceful_fs = __commonJS({ - "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - var fs32 = require("fs"); - var polyfills = require_polyfills(); - var legacy = require_legacy_streams(); - var clone = require_clone(); - var util3 = require("util"); - var gracefulQueue; - var previousSymbol; - if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"); - previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous"); - } else { - gracefulQueue = "___graceful-fs.queue"; - previousSymbol = "___graceful-fs.previous"; - } - function noop3() { - } - function publishQueue(context5, queue3) { - Object.defineProperty(context5, gracefulQueue, { - get: function() { - return queue3; - } - }); - } - var debug6 = noop3; - if (util3.debuglog) - debug6 = util3.debuglog("gfs4"); - else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) - debug6 = function() { - var m = util3.format.apply(util3, arguments); - m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); - console.error(m); - }; - if (!fs32[gracefulQueue]) { - queue2 = global[gracefulQueue] || []; - publishQueue(fs32, queue2); - fs32.close = (function(fs$close) { - function close(fd, cb) { - return fs$close.call(fs32, fd, function(err) { - if (!err) { - resetQueue(); - } - if (typeof cb === "function") - cb.apply(this, arguments); - }); - } - Object.defineProperty(close, previousSymbol, { - value: fs$close - }); - return close; - })(fs32.close); - fs32.closeSync = (function(fs$closeSync) { - function closeSync(fd) { - fs$closeSync.apply(fs32, arguments); - resetQueue(); - } - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }); - return closeSync; - })(fs32.closeSync); - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { - process.on("exit", function() { - debug6(fs32[gracefulQueue]); - require("assert").equal(fs32[gracefulQueue].length, 0); - }); - } - } - var queue2; - if (!global[gracefulQueue]) { - publishQueue(global, fs32[gracefulQueue]); - } - module2.exports = patch(clone(fs32)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs32.__patched) { - module2.exports = patch(fs32); - fs32.__patched = true; - } - function patch(fs33) { - polyfills(fs33); - fs33.gracefulify = patch; - fs33.createReadStream = createReadStream4; - fs33.createWriteStream = createWriteStream3; - var fs$readFile = fs33.readFile; - fs33.readFile = readFile; - function readFile(path30, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$readFile(path30, options, cb); - function go$readFile(path31, options2, cb2, startTime) { - return fs$readFile(path31, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path31, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$writeFile = fs33.writeFile; - fs33.writeFile = writeFile; - function writeFile(path30, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$writeFile(path30, data, options, cb); - function go$writeFile(path31, data2, options2, cb2, startTime) { - return fs$writeFile(path31, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path31, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$appendFile = fs33.appendFile; - if (fs$appendFile) - fs33.appendFile = appendFile; - function appendFile(path30, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$appendFile(path30, data, options, cb); - function go$appendFile(path31, data2, options2, cb2, startTime) { - return fs$appendFile(path31, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path31, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$copyFile = fs33.copyFile; - if (fs$copyFile) - fs33.copyFile = copyFile2; - function copyFile2(src, dest, flags, cb) { - if (typeof flags === "function") { - cb = flags; - flags = 0; - } - return go$copyFile(src, dest, flags, cb); - function go$copyFile(src2, dest2, flags2, cb2, startTime) { - return fs$copyFile(src2, dest2, flags2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$readdir = fs33.readdir; - fs33.readdir = readdir3; - var noReaddirOptionVersions = /^v[0-5]\./; - function readdir3(path30, options, cb) { - if (typeof options === "function") - cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path31, options2, cb2, startTime) { - return fs$readdir(path31, fs$readdirCallback( - path31, - options2, - cb2, - startTime - )); - } : function go$readdir2(path31, options2, cb2, startTime) { - return fs$readdir(path31, options2, fs$readdirCallback( - path31, - options2, - cb2, - startTime - )); - }; - return go$readdir(path30, options, cb); - function fs$readdirCallback(path31, options2, cb2, startTime) { - return function(err, files) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([ - go$readdir, - [path31, options2, cb2], - err, - startTime || Date.now(), - Date.now() - ]); - else { - if (files && files.sort) - files.sort(); - if (typeof cb2 === "function") - cb2.call(this, err, files); - } - }; - } - } - if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs33); - ReadStream = legStreams.ReadStream; - WriteStream = legStreams.WriteStream; - } - var fs$ReadStream = fs33.ReadStream; - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype); - ReadStream.prototype.open = ReadStream$open; - } - var fs$WriteStream = fs33.WriteStream; - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype); - WriteStream.prototype.open = WriteStream$open; - } - Object.defineProperty(fs33, "ReadStream", { - get: function() { - return ReadStream; - }, - set: function(val) { - ReadStream = val; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(fs33, "WriteStream", { - get: function() { - return WriteStream; - }, - set: function(val) { - WriteStream = val; - }, - enumerable: true, - configurable: true - }); - var FileReadStream = ReadStream; - Object.defineProperty(fs33, "FileReadStream", { - get: function() { - return FileReadStream; - }, - set: function(val) { - FileReadStream = val; - }, - enumerable: true, - configurable: true - }); - var FileWriteStream = WriteStream; - Object.defineProperty(fs33, "FileWriteStream", { - get: function() { - return FileWriteStream; - }, - set: function(val) { - FileWriteStream = val; - }, - enumerable: true, - configurable: true - }); - function ReadStream(path30, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this; - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments); - } - function ReadStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - if (that.autoClose) - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - that.read(); - } - }); - } - function WriteStream(path30, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this; - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments); - } - function WriteStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - } - }); - } - function createReadStream4(path30, options) { - return new fs33.ReadStream(path30, options); - } - function createWriteStream3(path30, options) { - return new fs33.WriteStream(path30, options); - } - var fs$open = fs33.open; - fs33.open = open; - function open(path30, flags, mode, cb) { - if (typeof mode === "function") - cb = mode, mode = null; - return go$open(path30, flags, mode, cb); - function go$open(path31, flags2, mode2, cb2, startTime) { - return fs$open(path31, flags2, mode2, function(err, fd) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path31, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - return fs33; - } - function enqueue(elem) { - debug6("ENQUEUE", elem[0].name, elem[1]); - fs32[gracefulQueue].push(elem); - retry2(); - } - var retryTimer; - function resetQueue() { - var now = Date.now(); - for (var i = 0; i < fs32[gracefulQueue].length; ++i) { - if (fs32[gracefulQueue][i].length > 2) { - fs32[gracefulQueue][i][3] = now; - fs32[gracefulQueue][i][4] = now; - } - } - retry2(); - } - function retry2() { - clearTimeout(retryTimer); - retryTimer = void 0; - if (fs32[gracefulQueue].length === 0) - return; - var elem = fs32[gracefulQueue].shift(); - var fn = elem[0]; - var args = elem[1]; - var err = elem[2]; - var startTime = elem[3]; - var lastTime = elem[4]; - if (startTime === void 0) { - debug6("RETRY", fn.name, args); - fn.apply(null, args); - } else if (Date.now() - startTime >= 6e4) { - debug6("TIMEOUT", fn.name, args); - var cb = args.pop(); - if (typeof cb === "function") - cb.call(null, err); - } else { - var sinceAttempt = Date.now() - lastTime; - var sinceStart = Math.max(lastTime - startTime, 1); - var desiredDelay = Math.min(sinceStart * 1.2, 100); - if (sinceAttempt >= desiredDelay) { - debug6("RETRY", fn.name, args); - fn.apply(null, args.concat([startTime])); - } else { - fs32[gracefulQueue].push(elem); - } - } - if (retryTimer === void 0) { - retryTimer = setTimeout(retry2, 0); - } - } - } -}); - -// node_modules/archiver-utils/node_modules/is-stream/index.js -var require_is_stream = __commonJS({ - "node_modules/archiver-utils/node_modules/is-stream/index.js"(exports2, module2) { - "use strict"; - var isStream2 = (stream2) => stream2 !== null && typeof stream2 === "object" && typeof stream2.pipe === "function"; - isStream2.writable = (stream2) => isStream2(stream2) && stream2.writable !== false && typeof stream2._write === "function" && typeof stream2._writableState === "object"; - isStream2.readable = (stream2) => isStream2(stream2) && stream2.readable !== false && typeof stream2._read === "function" && typeof stream2._readableState === "object"; - isStream2.duplex = (stream2) => isStream2.writable(stream2) && isStream2.readable(stream2); - isStream2.transform = (stream2) => isStream2.duplex(stream2) && typeof stream2._transform === "function"; - module2.exports = isStream2; - } -}); - -// node_modules/process-nextick-args/index.js -var require_process_nextick_args = __commonJS({ - "node_modules/process-nextick-args/index.js"(exports2, module2) { - "use strict"; - if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) { - module2.exports = { nextTick }; - } else { - module2.exports = process; - } - function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== "function") { - throw new TypeError('"callback" argument must be a function'); - } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); - } - } - } -}); - -// node_modules/lazystream/node_modules/isarray/index.js -var require_isarray = __commonJS({ - "node_modules/lazystream/node_modules/isarray/index.js"(exports2, module2) { - var toString2 = {}.toString; - module2.exports = Array.isArray || function(arr) { - return toString2.call(arr) == "[object Array]"; - }; - } -}); - -// node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/stream.js -var require_stream = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) { - module2.exports = require("stream"); - } -}); - -// node_modules/lazystream/node_modules/safe-buffer/index.js -var require_safe_buffer = __commonJS({ - "node_modules/lazystream/node_modules/safe-buffer/index.js"(exports2, module2) { - var buffer = require("buffer"); - var Buffer2 = buffer.Buffer; - function copyProps(src, dst) { - for (var key in src) { - dst[key] = src[key]; - } - } - if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { - module2.exports = buffer; - } else { - copyProps(buffer, exports2); - exports2.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer2(arg, encodingOrOffset, length); - } - copyProps(Buffer2, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); - } - return Buffer2(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function(size, fill, encoding) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - var buf = Buffer2(size); - if (fill !== void 0) { - if (typeof encoding === "string") { - buf.fill(fill, encoding); - } else { - buf.fill(fill); - } - } else { - buf.fill(0); - } - return buf; - }; - SafeBuffer.allocUnsafe = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return Buffer2(size); - }; - SafeBuffer.allocUnsafeSlow = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return buffer.SlowBuffer(size); - }; - } -}); - -// node_modules/core-util-is/lib/util.js -var require_util12 = __commonJS({ - "node_modules/core-util-is/lib/util.js"(exports2) { - function isArray2(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === "[object Array]"; - } - exports2.isArray = isArray2; - function isBoolean2(arg) { - return typeof arg === "boolean"; - } - exports2.isBoolean = isBoolean2; - function isNull(arg) { - return arg === null; - } - exports2.isNull = isNull; - function isNullOrUndefined(arg) { - return arg == null; - } - exports2.isNullOrUndefined = isNullOrUndefined; - function isNumber2(arg) { - return typeof arg === "number"; - } - exports2.isNumber = isNumber2; - function isString3(arg) { - return typeof arg === "string"; - } - exports2.isString = isString3; - function isSymbol(arg) { - return typeof arg === "symbol"; - } - exports2.isSymbol = isSymbol; - function isUndefined(arg) { - return arg === void 0; - } - exports2.isUndefined = isUndefined; - function isRegExp(re) { - return objectToString(re) === "[object RegExp]"; - } - exports2.isRegExp = isRegExp; - function isObject2(arg) { - return typeof arg === "object" && arg !== null; - } - exports2.isObject = isObject2; - function isDate(d) { - return objectToString(d) === "[object Date]"; - } - exports2.isDate = isDate; - function isError(e) { - return objectToString(e) === "[object Error]" || e instanceof Error; - } - exports2.isError = isError; - function isFunction(arg) { - return typeof arg === "function"; - } - exports2.isFunction = isFunction; - function isPrimitive(arg) { - return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol - typeof arg === "undefined"; - } - exports2.isPrimitive = isPrimitive; - exports2.isBuffer = require("buffer").Buffer.isBuffer; - function objectToString(o) { - return Object.prototype.toString.call(o); - } - } -}); - -// node_modules/inherits/inherits_browser.js -var require_inherits_browser = __commonJS({ - "node_modules/inherits/inherits_browser.js"(exports2, module2) { - if (typeof Object.create === "function") { - module2.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - } - }; - } else { - module2.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - var TempCtor = function() { - }; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - }; - } - } -}); - -// node_modules/inherits/inherits.js -var require_inherits = __commonJS({ - "node_modules/inherits/inherits.js"(exports2, module2) { - try { - util3 = require("util"); - if (typeof util3.inherits !== "function") throw ""; - module2.exports = util3.inherits; - } catch (e) { - module2.exports = require_inherits_browser(); - } - var util3; - } -}); - -// node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/BufferList.js -var require_BufferList = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) { - "use strict"; - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - var Buffer2 = require_safe_buffer().Buffer; - var util3 = require("util"); - function copyBuffer(src, target, offset) { - src.copy(target, offset); - } - module2.exports = (function() { - function BufferList() { - _classCallCheck(this, BufferList); - this.head = null; - this.tail = null; - this.length = 0; - } - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry; - else this.head = entry; - this.tail = entry; - ++this.length; - }; - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null; - else this.head = this.head.next; - --this.length; - return ret; - }; - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - BufferList.prototype.join = function join21(s) { - if (this.length === 0) return ""; - var p = this.head; - var ret = "" + p.data; - while (p = p.next) { - ret += s + p.data; - } - return ret; - }; - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer2.alloc(0); - var ret = Buffer2.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - return BufferList; - })(); - if (util3 && util3.inspect && util3.inspect.custom) { - module2.exports.prototype[util3.inspect.custom] = function() { - var obj = util3.inspect({ length: this.length }); - return this.constructor.name + " " + obj; - }; - } - } -}); - -// node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/destroy.js -var require_destroy = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) { - "use strict"; - var pna = require_process_nextick_args(); - function destroy(err, cb) { - var _this = this; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - pna.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - pna.nextTick(emitErrorNT, this, err); - } - } - return this; - } - if (this._readableState) { - this._readableState.destroyed = true; - } - if (this._writableState) { - this._writableState.destroyed = true; - } - this._destroy(err || null, function(err2) { - if (!cb && err2) { - if (!_this._writableState) { - pna.nextTick(emitErrorNT, _this, err2); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - pna.nextTick(emitErrorNT, _this, err2); - } - } else if (cb) { - cb(err2); - } - }); - return this; - } - function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } - } - function emitErrorNT(self2, err) { - self2.emit("error", err); - } - module2.exports = { - destroy, - undestroy - }; - } -}); - -// node_modules/util-deprecate/node.js -var require_node2 = __commonJS({ - "node_modules/util-deprecate/node.js"(exports2, module2) { - module2.exports = require("util").deprecate; - } -}); - -// node_modules/lazystream/node_modules/readable-stream/lib/_stream_writable.js -var require_stream_writable = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) { - "use strict"; - var pna = require_process_nextick_args(); - module2.exports = Writable; - function CorkedRequest(state) { - var _this = this; - this.next = null; - this.entry = null; - this.finish = function() { - onCorkedFinish(_this, state); - }; - } - var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; - var Duplex; - Writable.WritableState = WritableState; - var util3 = Object.create(require_util12()); - util3.inherits = require_inherits(); - var internalUtil = { - deprecate: require_node2() - }; - var Stream = require_stream(); - var Buffer2 = require_safe_buffer().Buffer; - var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { - }; - function _uint8ArrayToBuffer(chunk) { - return Buffer2.from(chunk); - } - function _isUint8Array(obj) { - return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; - } - var destroyImpl = require_destroy(); - util3.inherits(Writable, Stream); - function nop() { - } - function WritableState(options, stream2) { - Duplex = Duplex || require_stream_duplex(); - options = options || {}; - var isDuplex = stream2 instanceof Duplex; - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - if (hwm || hwm === 0) this.highWaterMark = hwm; - else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm; - else this.highWaterMark = defaultHwm; - this.highWaterMark = Math.floor(this.highWaterMark); - this.finalCalled = false; - this.needDrain = false; - this.ending = false; - this.ended = false; - this.finished = false; - this.destroyed = false; - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - this.defaultEncoding = options.defaultEncoding || "utf8"; - this.length = 0; - this.writing = false; - this.corked = 0; - this.sync = true; - this.bufferProcessing = false; - this.onwrite = function(er) { - onwrite(stream2, er); - }; - this.writecb = null; - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; - this.pendingcb = 0; - this.prefinished = false; - this.errorEmitted = false; - this.bufferedRequestCount = 0; - this.corkedRequestsFree = new CorkedRequest(this); - } - WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; - }; - (function() { - try { - Object.defineProperty(WritableState.prototype, "buffer", { - get: internalUtil.deprecate(function() { - return this.getBuffer(); - }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") - }); - } catch (_2) { - } - })(); - var realHasInstance; - if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function(object2) { - if (realHasInstance.call(this, object2)) return true; - if (this !== Writable) return false; - return object2 && object2._writableState instanceof WritableState; - } - }); - } else { - realHasInstance = function(object2) { - return object2 instanceof this; - }; - } - function Writable(options) { - Duplex = Duplex || require_stream_duplex(); - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - this._writableState = new WritableState(options, this); - this.writable = true; - if (options) { - if (typeof options.write === "function") this._write = options.write; - if (typeof options.writev === "function") this._writev = options.writev; - if (typeof options.destroy === "function") this._destroy = options.destroy; - if (typeof options.final === "function") this._final = options.final; - } - Stream.call(this); - } - Writable.prototype.pipe = function() { - this.emit("error", new Error("Cannot pipe, not readable")); - }; - function writeAfterEnd(stream2, cb) { - var er = new Error("write after end"); - stream2.emit("error", er); - pna.nextTick(cb, er); - } - function validChunk(stream2, state, chunk, cb) { - var valid4 = true; - var er = false; - if (chunk === null) { - er = new TypeError("May not write null values to stream"); - } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { - er = new TypeError("Invalid non-string/buffer chunk"); - } - if (er) { - stream2.emit("error", er); - pna.nextTick(cb, er); - valid4 = false; - } - return valid4; - } - Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - if (isBuf && !Buffer2.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (typeof encoding === "function") { - cb = encoding; - encoding = null; - } - if (isBuf) encoding = "buffer"; - else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== "function") cb = nop; - if (state.ended) writeAfterEnd(this, cb); - else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; - }; - Writable.prototype.cork = function() { - var state = this._writableState; - state.corked++; - }; - Writable.prototype.uncork = function() { - var state = this._writableState; - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } - }; - Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - if (typeof encoding === "string") encoding = encoding.toLowerCase(); - if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding); - this._writableState.defaultEncoding = encoding; - return this; - }; - function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { - chunk = Buffer2.from(chunk, encoding); - } - return chunk; - } - Object.defineProperty(Writable.prototype, "writableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function() { - return this._writableState.highWaterMark; - } - }); - function writeOrBuffer(stream2, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = "buffer"; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; - if (!ret) state.needDrain = true; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk, - encoding, - isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream2, state, false, len, chunk, encoding, cb); - } - return ret; - } - function doWrite(stream2, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream2._writev(chunk, state.onwrite); - else stream2._write(chunk, encoding, state.onwrite); - state.sync = false; - } - function onwriteError(stream2, state, sync, er, cb) { - --state.pendingcb; - if (sync) { - pna.nextTick(cb, er); - pna.nextTick(finishMaybe, stream2, state); - stream2._writableState.errorEmitted = true; - stream2.emit("error", er); - } else { - cb(er); - stream2._writableState.errorEmitted = true; - stream2.emit("error", er); - finishMaybe(stream2, state); - } - } - function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; - } - function onwrite(stream2, er) { - var state = stream2._writableState; - var sync = state.sync; - var cb = state.writecb; - onwriteStateUpdate(state); - if (er) onwriteError(stream2, state, sync, er, cb); - else { - var finished = needFinish(state); - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream2, state); - } - if (sync) { - asyncWrite(afterWrite, stream2, state, finished, cb); - } else { - afterWrite(stream2, state, finished, cb); - } - } - } - function afterWrite(stream2, state, finished, cb) { - if (!finished) onwriteDrain(stream2, state); - state.pendingcb--; - cb(); - finishMaybe(stream2, state); - } - function onwriteDrain(stream2, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream2.emit("drain"); - } - } - function clearBuffer(stream2, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - if (stream2._writev && entry && entry.next) { - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - doWrite(stream2, state, true, state.length, buffer, "", holder.finish); - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream2, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - if (state.writing) { - break; - } - } - if (entry === null) state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; - } - Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error("_write() is not implemented")); - }; - Writable.prototype._writev = null; - Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - if (typeof chunk === "function") { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === "function") { - cb = encoding; - encoding = null; - } - if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); - if (state.corked) { - state.corked = 1; - this.uncork(); - } - if (!state.ending) endWritable(this, state, cb); - }; - function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; - } - function callFinal(stream2, state) { - stream2._final(function(err) { - state.pendingcb--; - if (err) { - stream2.emit("error", err); - } - state.prefinished = true; - stream2.emit("prefinish"); - finishMaybe(stream2, state); - }); - } - function prefinish(stream2, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream2._final === "function") { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream2, state); - } else { - state.prefinished = true; - stream2.emit("prefinish"); - } - } - } - function finishMaybe(stream2, state) { - var need = needFinish(state); - if (need) { - prefinish(stream2, state); - if (state.pendingcb === 0) { - state.finished = true; - stream2.emit("finish"); - } - } - return need; - } - function endWritable(stream2, state, cb) { - state.ending = true; - finishMaybe(stream2, state); - if (cb) { - if (state.finished) pna.nextTick(cb); - else stream2.once("finish", cb); - } - state.ended = true; - stream2.writable = false; - } - function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - state.corkedRequestsFree.next = corkReq; - } - Object.defineProperty(Writable.prototype, "destroyed", { - get: function() { - if (this._writableState === void 0) { - return false; - } - return this._writableState.destroyed; - }, - set: function(value) { - if (!this._writableState) { - return; - } - this._writableState.destroyed = value; - } - }); - Writable.prototype.destroy = destroyImpl.destroy; - Writable.prototype._undestroy = destroyImpl.undestroy; - Writable.prototype._destroy = function(err, cb) { - this.end(); - cb(err); - }; - } -}); - -// node_modules/lazystream/node_modules/readable-stream/lib/_stream_duplex.js -var require_stream_duplex = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) { - "use strict"; - var pna = require_process_nextick_args(); - var objectKeys = Object.keys || function(obj) { - var keys2 = []; - for (var key in obj) { - keys2.push(key); - } - return keys2; - }; - module2.exports = Duplex; - var util3 = Object.create(require_util12()); - util3.inherits = require_inherits(); - var Readable3 = require_stream_readable(); - var Writable = require_stream_writable(); - util3.inherits(Duplex, Readable3); - { - keys = objectKeys(Writable.prototype); - for (v = 0; v < keys.length; v++) { - method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } - } - var keys; - var method; - var v; - function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable3.call(this, options); - Writable.call(this, options); - if (options && options.readable === false) this.readable = false; - if (options && options.writable === false) this.writable = false; - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - this.once("end", onend); - } - Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function() { - return this._writableState.highWaterMark; - } - }); - function onend() { - if (this.allowHalfOpen || this._writableState.ended) return; - pna.nextTick(onEndNT, this); - } - function onEndNT(self2) { - self2.end(); - } - Object.defineProperty(Duplex.prototype, "destroyed", { - get: function() { - if (this._readableState === void 0 || this._writableState === void 0) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function(value) { - if (this._readableState === void 0 || this._writableState === void 0) { - return; - } - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } - }); - Duplex.prototype._destroy = function(err, cb) { - this.push(null); - this.end(); - pna.nextTick(cb, err); - }; - } -}); - -// node_modules/lazystream/node_modules/string_decoder/lib/string_decoder.js -var require_string_decoder = __commonJS({ - "node_modules/lazystream/node_modules/string_decoder/lib/string_decoder.js"(exports2) { - "use strict"; - var Buffer2 = require_safe_buffer().Buffer; - var isEncoding = Buffer2.isEncoding || function(encoding) { - encoding = "" + encoding; - switch (encoding && encoding.toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - case "raw": - return true; - default: - return false; - } - }; - function _normalizeEncoding(enc) { - if (!enc) return "utf8"; - var retried; - while (true) { - switch (enc) { - case "utf8": - case "utf-8": - return "utf8"; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return "utf16le"; - case "latin1": - case "binary": - return "latin1"; - case "base64": - case "ascii": - case "hex": - return enc; - default: - if (retried) return; - enc = ("" + enc).toLowerCase(); - retried = true; - } - } - } - function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); - return nenc || enc; - } - exports2.StringDecoder = StringDecoder; - function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case "utf16le": - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case "utf8": - this.fillLast = utf8FillLast; - nb = 4; - break; - case "base64": - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer2.allocUnsafe(nb); - } - StringDecoder.prototype.write = function(buf) { - if (buf.length === 0) return ""; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === void 0) return ""; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ""; - }; - StringDecoder.prototype.end = utf8End; - StringDecoder.prototype.text = utf8Text; - StringDecoder.prototype.fillLast = function(buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; - }; - function utf8CheckByte(byte) { - if (byte <= 127) return 0; - else if (byte >> 5 === 6) return 2; - else if (byte >> 4 === 14) return 3; - else if (byte >> 3 === 30) return 4; - return byte >> 6 === 2 ? -1 : -2; - } - function utf8CheckIncomplete(self2, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self2.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self2.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0; - else self2.lastNeed = nb - 3; - } - return nb; - } - return 0; - } - function utf8CheckExtraBytes(self2, buf, p) { - if ((buf[0] & 192) !== 128) { - self2.lastNeed = 0; - return "\uFFFD"; - } - if (self2.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 192) !== 128) { - self2.lastNeed = 1; - return "\uFFFD"; - } - if (self2.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 192) !== 128) { - self2.lastNeed = 2; - return "\uFFFD"; - } - } - } - } - function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== void 0) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; - } - function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString("utf8", i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString("utf8", i, end); - } - function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) return r + "\uFFFD"; - return r; - } - function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString("utf16le", i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 55296 && c <= 56319) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString("utf16le", i, buf.length - 1); - } - function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString("utf16le", 0, end); - } - return r; - } - function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString("base64", i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString("base64", i, buf.length - n); - } - function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed); - return r; - } - function simpleWrite(buf) { - return buf.toString(this.encoding); - } - function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ""; - } - } -}); - -// node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js -var require_stream_readable = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) { - "use strict"; - var pna = require_process_nextick_args(); - module2.exports = Readable3; - var isArray2 = require_isarray(); - var Duplex; - Readable3.ReadableState = ReadableState; - var EE = require("events").EventEmitter; - var EElistenerCount = function(emitter, type) { - return emitter.listeners(type).length; - }; - var Stream = require_stream(); - var Buffer2 = require_safe_buffer().Buffer; - var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { - }; - function _uint8ArrayToBuffer(chunk) { - return Buffer2.from(chunk); - } - function _isUint8Array(obj) { - return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; - } - var util3 = Object.create(require_util12()); - util3.inherits = require_inherits(); - var debugUtil = require("util"); - var debug6 = void 0; - if (debugUtil && debugUtil.debuglog) { - debug6 = debugUtil.debuglog("stream"); - } else { - debug6 = function() { - }; - } - var BufferList = require_BufferList(); - var destroyImpl = require_destroy(); - var StringDecoder; - util3.inherits(Readable3, Stream); - var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; - function prependListener(emitter, event, fn) { - if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); - else if (isArray2(emitter._events[event])) emitter._events[event].unshift(fn); - else emitter._events[event] = [fn, emitter._events[event]]; - } - function ReadableState(options, stream2) { - Duplex = Duplex || require_stream_duplex(); - options = options || {}; - var isDuplex = stream2 instanceof Duplex; - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - if (hwm || hwm === 0) this.highWaterMark = hwm; - else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm; - else this.highWaterMark = defaultHwm; - this.highWaterMark = Math.floor(this.highWaterMark); - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - this.sync = true; - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.destroyed = false; - this.defaultEncoding = options.defaultEncoding || "utf8"; - this.awaitDrain = 0; - this.readingMore = false; - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } - } - function Readable3(options) { - Duplex = Duplex || require_stream_duplex(); - if (!(this instanceof Readable3)) return new Readable3(options); - this._readableState = new ReadableState(options, this); - this.readable = true; - if (options) { - if (typeof options.read === "function") this._read = options.read; - if (typeof options.destroy === "function") this._destroy = options.destroy; - } - Stream.call(this); - } - Object.defineProperty(Readable3.prototype, "destroyed", { - get: function() { - if (this._readableState === void 0) { - return false; - } - return this._readableState.destroyed; - }, - set: function(value) { - if (!this._readableState) { - return; - } - this._readableState.destroyed = value; - } - }); - Readable3.prototype.destroy = destroyImpl.destroy; - Readable3.prototype._undestroy = destroyImpl.undestroy; - Readable3.prototype._destroy = function(err, cb) { - this.push(null); - cb(err); - }; - Readable3.prototype.push = function(chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - if (!state.objectMode) { - if (typeof chunk === "string") { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer2.from(chunk, encoding); - encoding = ""; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); - }; - Readable3.prototype.unshift = function(chunk) { - return readableAddChunk(this, chunk, null, true, false); - }; - function readableAddChunk(stream2, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream2._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream2, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream2.emit("error", er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (addToFront) { - if (state.endEmitted) stream2.emit("error", new Error("stream.unshift() after end event")); - else addChunk(stream2, state, chunk, true); - } else if (state.ended) { - stream2.emit("error", new Error("stream.push() after EOF")); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream2, state, chunk, false); - else maybeReadMore(stream2, state); - } else { - addChunk(stream2, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - return needMoreData(state); - } - function addChunk(stream2, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream2.emit("data", chunk); - stream2.read(0); - } else { - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk); - else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream2); - } - maybeReadMore(stream2, state); - } - function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { - er = new TypeError("Invalid non-string/buffer chunk"); - } - return er; - } - function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); - } - Readable3.prototype.isPaused = function() { - return this._readableState.flowing === false; - }; - Readable3.prototype.setEncoding = function(enc) { - if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; - }; - var MAX_HWM = 8388608; - function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; - } - function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - if (state.flowing && state.length) return state.buffer.head.data.length; - else return state.length; - } - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; - } - Readable3.prototype.read = function(n) { - debug6("read", n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug6("read: emitReadable", state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this); - else emitReadable(this); - return null; - } - n = howMuchToRead(n, state); - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - var doRead = state.needReadable; - debug6("need readable", doRead); - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug6("length less than watermark", doRead); - } - if (state.ended || state.reading) { - doRead = false; - debug6("reading or ended", doRead); - } else if (doRead) { - debug6("do read"); - state.reading = true; - state.sync = true; - if (state.length === 0) state.needReadable = true; - this._read(state.highWaterMark); - state.sync = false; - if (!state.reading) n = howMuchToRead(nOrig, state); - } - var ret; - if (n > 0) ret = fromList(n, state); - else ret = null; - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - if (state.length === 0) { - if (!state.ended) state.needReadable = true; - if (nOrig !== n && state.ended) endReadable(this); - } - if (ret !== null) this.emit("data", ret); - return ret; - }; - function onEofChunk(stream2, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - emitReadable(stream2); - } - function emitReadable(stream2) { - var state = stream2._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug6("emitReadable", state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream2); - else emitReadable_(stream2); - } - } - function emitReadable_(stream2) { - debug6("emit readable"); - stream2.emit("readable"); - flow(stream2); - } - function maybeReadMore(stream2, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream2, state); - } - } - function maybeReadMore_(stream2, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug6("maybeReadMore read 0"); - stream2.read(0); - if (len === state.length) - break; - else len = state.length; - } - state.readingMore = false; - } - Readable3.prototype._read = function(n) { - this.emit("error", new Error("_read() is not implemented")); - }; - Readable3.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug6("pipe count=%d opts=%j", state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn); - else src.once("end", endFn); - dest.on("unpipe", onunpipe); - function onunpipe(readable, unpipeInfo) { - debug6("onunpipe"); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - function onend() { - debug6("onend"); - dest.end(); - } - var ondrain = pipeOnDrain(src); - dest.on("drain", ondrain); - var cleanedUp = false; - function cleanup() { - debug6("cleanup"); - dest.removeListener("close", onclose); - dest.removeListener("finish", onfinish); - dest.removeListener("drain", ondrain); - dest.removeListener("error", onerror); - dest.removeListener("unpipe", onunpipe); - src.removeListener("end", onend); - src.removeListener("end", unpipe); - src.removeListener("data", ondata); - cleanedUp = true; - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - var increasedAwaitDrain = false; - src.on("data", ondata); - function ondata(chunk) { - debug6("ondata"); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug6("false write response, pause", state.awaitDrain); - state.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - function onerror(er) { - debug6("onerror", er); - unpipe(); - dest.removeListener("error", onerror); - if (EElistenerCount(dest, "error") === 0) dest.emit("error", er); - } - prependListener(dest, "error", onerror); - function onclose() { - dest.removeListener("finish", onfinish); - unpipe(); - } - dest.once("close", onclose); - function onfinish() { - debug6("onfinish"); - dest.removeListener("close", onclose); - unpipe(); - } - dest.once("finish", onfinish); - function unpipe() { - debug6("unpipe"); - src.unpipe(dest); - } - dest.emit("pipe", src); - if (!state.flowing) { - debug6("pipe resume"); - src.resume(); - } - return dest; - }; - function pipeOnDrain(src) { - return function() { - var state = src._readableState; - debug6("pipeOnDrain", state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { - state.flowing = true; - flow(src); - } - }; - } - Readable3.prototype.unpipe = function(dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - if (state.pipesCount === 0) return this; - if (state.pipesCount === 1) { - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit("unpipe", this, unpipeInfo); - return this; - } - if (!dest) { - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - for (var i = 0; i < len; i++) { - dests[i].emit("unpipe", this, { hasUnpiped: false }); - } - return this; - } - var index2 = indexOf(state.pipes, dest); - if (index2 === -1) return this; - state.pipes.splice(index2, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit("unpipe", this, unpipeInfo); - return this; - }; - Readable3.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - if (ev === "data") { - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === "readable") { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - return res; - }; - Readable3.prototype.addListener = Readable3.prototype.on; - function nReadingNextTick(self2) { - debug6("readable nexttick read 0"); - self2.read(0); - } - Readable3.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug6("resume"); - state.flowing = true; - resume(this, state); - } - return this; - }; - function resume(stream2, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream2, state); - } - } - function resume_(stream2, state) { - if (!state.reading) { - debug6("resume read 0"); - stream2.read(0); - } - state.resumeScheduled = false; - state.awaitDrain = 0; - stream2.emit("resume"); - flow(stream2); - if (state.flowing && !state.reading) stream2.read(0); - } - Readable3.prototype.pause = function() { - debug6("call pause flowing=%j", this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug6("pause"); - this._readableState.flowing = false; - this.emit("pause"); - } - return this; - }; - function flow(stream2) { - var state = stream2._readableState; - debug6("flow", state.flowing); - while (state.flowing && stream2.read() !== null) { - } - } - Readable3.prototype.wrap = function(stream2) { - var _this = this; - var state = this._readableState; - var paused = false; - stream2.on("end", function() { - debug6("wrapped end"); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - _this.push(null); - }); - stream2.on("data", function(chunk) { - debug6("wrapped data"); - if (state.decoder) chunk = state.decoder.write(chunk); - if (state.objectMode && (chunk === null || chunk === void 0)) return; - else if (!state.objectMode && (!chunk || !chunk.length)) return; - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream2.pause(); - } - }); - for (var i in stream2) { - if (this[i] === void 0 && typeof stream2[i] === "function") { - this[i] = /* @__PURE__ */ (function(method) { - return function() { - return stream2[method].apply(stream2, arguments); - }; - })(i); - } - } - for (var n = 0; n < kProxyEvents.length; n++) { - stream2.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - this._read = function(n2) { - debug6("wrapped _read", n2); - if (paused) { - paused = false; - stream2.resume(); - } - }; - return this; - }; - Object.defineProperty(Readable3.prototype, "readableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function() { - return this._readableState.highWaterMark; - } - }); - Readable3._fromList = fromList; - function fromList(n, state) { - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift(); - else if (!n || n >= state.length) { - if (state.decoder) ret = state.buffer.join(""); - else if (state.buffer.length === 1) ret = state.buffer.head.data; - else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - ret = fromListPartial(n, state.buffer, state.decoder); - } - return ret; - } - function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - ret = list.shift(); - } else { - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; - } - function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str; - else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next; - else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; - } - function copyFromBuffer(n, list) { - var ret = Buffer2.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next; - else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; - } - function endReadable(stream2) { - var state = stream2._readableState; - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream2); - } - } - function endReadableNT(state, stream2) { - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream2.readable = false; - stream2.emit("end"); - } - } - function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; - } - } -}); - -// node_modules/lazystream/node_modules/readable-stream/lib/_stream_transform.js -var require_stream_transform = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) { - "use strict"; - module2.exports = Transform5; - var Duplex = require_stream_duplex(); - var util3 = Object.create(require_util12()); - util3.inherits = require_inherits(); - util3.inherits(Transform5, Duplex); - function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - if (!cb) { - return this.emit("error", new Error("write callback called multiple times")); - } - ts.writechunk = null; - ts.writecb = null; - if (data != null) - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } - } - function Transform5(options) { - if (!(this instanceof Transform5)) return new Transform5(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - this._readableState.needReadable = true; - this._readableState.sync = false; - if (options) { - if (typeof options.transform === "function") this._transform = options.transform; - if (typeof options.flush === "function") this._flush = options.flush; - } - this.on("prefinish", prefinish); - } - function prefinish() { - var _this = this; - if (typeof this._flush === "function") { - this._flush(function(er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } - } - Transform5.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); - }; - Transform5.prototype._transform = function(chunk, encoding, cb) { - throw new Error("_transform() is not implemented"); - }; - Transform5.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } - }; - Transform5.prototype._read = function(n) { - var ts = this._transformState; - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - ts.needTransform = true; - } - }; - Transform5.prototype._destroy = function(err, cb) { - var _this2 = this; - Duplex.prototype._destroy.call(this, err, function(err2) { - cb(err2); - _this2.emit("close"); - }); - }; - function done(stream2, er, data) { - if (er) return stream2.emit("error", er); - if (data != null) - stream2.push(data); - if (stream2._writableState.length) throw new Error("Calling transform done when ws.length != 0"); - if (stream2._transformState.transforming) throw new Error("Calling transform done when still transforming"); - return stream2.push(null); - } - } -}); - -// node_modules/lazystream/node_modules/readable-stream/lib/_stream_passthrough.js -var require_stream_passthrough = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) { - "use strict"; - module2.exports = PassThrough3; - var Transform5 = require_stream_transform(); - var util3 = Object.create(require_util12()); - util3.inherits = require_inherits(); - util3.inherits(PassThrough3, Transform5); - function PassThrough3(options) { - if (!(this instanceof PassThrough3)) return new PassThrough3(options); - Transform5.call(this, options); - } - PassThrough3.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); - }; - } -}); - -// node_modules/lazystream/node_modules/readable-stream/readable.js -var require_readable2 = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/readable.js"(exports2, module2) { - var Stream = require("stream"); - if (process.env.READABLE_STREAM === "disable" && Stream) { - module2.exports = Stream; - exports2 = module2.exports = Stream.Readable; - exports2.Readable = Stream.Readable; - exports2.Writable = Stream.Writable; - exports2.Duplex = Stream.Duplex; - exports2.Transform = Stream.Transform; - exports2.PassThrough = Stream.PassThrough; - exports2.Stream = Stream; - } else { - exports2 = module2.exports = require_stream_readable(); - exports2.Stream = Stream || exports2; - exports2.Readable = exports2; - exports2.Writable = require_stream_writable(); - exports2.Duplex = require_stream_duplex(); - exports2.Transform = require_stream_transform(); - exports2.PassThrough = require_stream_passthrough(); - } - } -}); - -// node_modules/lazystream/node_modules/readable-stream/passthrough.js -var require_passthrough = __commonJS({ - "node_modules/lazystream/node_modules/readable-stream/passthrough.js"(exports2, module2) { - module2.exports = require_readable2().PassThrough; - } -}); - -// node_modules/lazystream/lib/lazystream.js -var require_lazystream = __commonJS({ - "node_modules/lazystream/lib/lazystream.js"(exports2, module2) { - var util3 = require("util"); - var PassThrough3 = require_passthrough(); - module2.exports = { - Readable: Readable3, - Writable - }; - util3.inherits(Readable3, PassThrough3); - util3.inherits(Writable, PassThrough3); - function beforeFirstCall(instance, method, callback) { - instance[method] = function() { - delete instance[method]; - callback.apply(this, arguments); - return this[method].apply(this, arguments); - }; - } - function Readable3(fn, options) { - if (!(this instanceof Readable3)) - return new Readable3(fn, options); - PassThrough3.call(this, options); - beforeFirstCall(this, "_read", function() { - var source = fn.call(this, options); - var emit = this.emit.bind(this, "error"); - source.on("error", emit); - source.pipe(this); - }); - this.emit("readable"); - } - function Writable(fn, options) { - if (!(this instanceof Writable)) - return new Writable(fn, options); - PassThrough3.call(this, options); - beforeFirstCall(this, "_write", function() { - var destination = fn.call(this, options); - var emit = this.emit.bind(this, "error"); - destination.on("error", emit); - this.pipe(destination); - }); - this.emit("writable"); - } - } -}); - -// node_modules/normalize-path/index.js -var require_normalize_path = __commonJS({ - "node_modules/normalize-path/index.js"(exports2, module2) { - module2.exports = function(path30, stripTrailing) { - if (typeof path30 !== "string") { - throw new TypeError("expected path to be a string"); - } - if (path30 === "\\" || path30 === "/") return "/"; - var len = path30.length; - if (len <= 1) return path30; - var prefix = ""; - if (len > 4 && path30[3] === "\\") { - var ch = path30[2]; - if ((ch === "?" || ch === ".") && path30.slice(0, 2) === "\\\\") { - path30 = path30.slice(2); - prefix = "//"; - } - } - var segs = path30.split(/[/\\]+/); - if (stripTrailing !== false && segs[segs.length - 1] === "") { - segs.pop(); - } - return prefix + segs.join("/"); - }; - } -}); - -// node_modules/lodash/identity.js -var require_identity = __commonJS({ - "node_modules/lodash/identity.js"(exports2, module2) { - function identity(value) { - return value; - } - module2.exports = identity; - } -}); - -// node_modules/lodash/_apply.js -var require_apply = __commonJS({ - "node_modules/lodash/_apply.js"(exports2, module2) { - function apply(func, thisArg, args) { - switch (args.length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - module2.exports = apply; - } -}); - -// node_modules/lodash/_overRest.js -var require_overRest = __commonJS({ - "node_modules/lodash/_overRest.js"(exports2, module2) { - var apply = require_apply(); - var nativeMax = Math.max; - function overRest(func, start, transform) { - start = nativeMax(start === void 0 ? func.length - 1 : start, 0); - return function() { - var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array2 = Array(length); - while (++index2 < length) { - array2[index2] = args[start + index2]; - } - index2 = -1; - var otherArgs = Array(start + 1); - while (++index2 < start) { - otherArgs[index2] = args[index2]; - } - otherArgs[start] = transform(array2); - return apply(func, this, otherArgs); - }; - } - module2.exports = overRest; - } -}); - -// node_modules/lodash/constant.js -var require_constant = __commonJS({ - "node_modules/lodash/constant.js"(exports2, module2) { - function constant(value) { - return function() { - return value; - }; - } - module2.exports = constant; - } -}); - -// node_modules/lodash/_freeGlobal.js -var require_freeGlobal = __commonJS({ - "node_modules/lodash/_freeGlobal.js"(exports2, module2) { - var freeGlobal = typeof global == "object" && global && global.Object === Object && global; - module2.exports = freeGlobal; - } -}); - -// node_modules/lodash/_root.js -var require_root = __commonJS({ - "node_modules/lodash/_root.js"(exports2, module2) { - var freeGlobal = require_freeGlobal(); - var freeSelf = typeof self == "object" && self && self.Object === Object && self; - var root = freeGlobal || freeSelf || Function("return this")(); - module2.exports = root; - } -}); - -// node_modules/lodash/_Symbol.js -var require_Symbol = __commonJS({ - "node_modules/lodash/_Symbol.js"(exports2, module2) { - var root = require_root(); - var Symbol2 = root.Symbol; - module2.exports = Symbol2; - } -}); - -// node_modules/lodash/_getRawTag.js -var require_getRawTag = __commonJS({ - "node_modules/lodash/_getRawTag.js"(exports2, module2) { - var Symbol2 = require_Symbol(); - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var nativeObjectToString = objectProto.toString; - var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0; - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; - try { - value[symToStringTag] = void 0; - var unmasked = true; - } catch (e) { - } - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } - module2.exports = getRawTag; - } -}); - -// node_modules/lodash/_objectToString.js -var require_objectToString = __commonJS({ - "node_modules/lodash/_objectToString.js"(exports2, module2) { - var objectProto = Object.prototype; - var nativeObjectToString = objectProto.toString; - function objectToString(value) { - return nativeObjectToString.call(value); - } - module2.exports = objectToString; - } -}); - -// node_modules/lodash/_baseGetTag.js -var require_baseGetTag = __commonJS({ - "node_modules/lodash/_baseGetTag.js"(exports2, module2) { - var Symbol2 = require_Symbol(); - var getRawTag = require_getRawTag(); - var objectToString = require_objectToString(); - var nullTag = "[object Null]"; - var undefinedTag = "[object Undefined]"; - var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0; - function baseGetTag(value) { - if (value == null) { - return value === void 0 ? undefinedTag : nullTag; - } - return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); - } - module2.exports = baseGetTag; - } -}); - -// node_modules/lodash/isObject.js -var require_isObject = __commonJS({ - "node_modules/lodash/isObject.js"(exports2, module2) { - function isObject2(value) { - var type = typeof value; - return value != null && (type == "object" || type == "function"); - } - module2.exports = isObject2; - } -}); - -// node_modules/lodash/isFunction.js -var require_isFunction = __commonJS({ - "node_modules/lodash/isFunction.js"(exports2, module2) { - var baseGetTag = require_baseGetTag(); - var isObject2 = require_isObject(); - var asyncTag = "[object AsyncFunction]"; - var funcTag = "[object Function]"; - var genTag = "[object GeneratorFunction]"; - var proxyTag = "[object Proxy]"; - function isFunction(value) { - if (!isObject2(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - module2.exports = isFunction; - } -}); - -// node_modules/lodash/_coreJsData.js -var require_coreJsData = __commonJS({ - "node_modules/lodash/_coreJsData.js"(exports2, module2) { - var root = require_root(); - var coreJsData = root["__core-js_shared__"]; - module2.exports = coreJsData; - } -}); - -// node_modules/lodash/_isMasked.js -var require_isMasked = __commonJS({ - "node_modules/lodash/_isMasked.js"(exports2, module2) { - var coreJsData = require_coreJsData(); - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); - return uid ? "Symbol(src)_1." + uid : ""; - })(); - function isMasked(func) { - return !!maskSrcKey && maskSrcKey in func; - } - module2.exports = isMasked; - } -}); - -// node_modules/lodash/_toSource.js -var require_toSource = __commonJS({ - "node_modules/lodash/_toSource.js"(exports2, module2) { - var funcProto = Function.prototype; - var funcToString = funcProto.toString; - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) { - } - try { - return func + ""; - } catch (e) { - } - } - return ""; - } - module2.exports = toSource; - } -}); - -// node_modules/lodash/_baseIsNative.js -var require_baseIsNative = __commonJS({ - "node_modules/lodash/_baseIsNative.js"(exports2, module2) { - var isFunction = require_isFunction(); - var isMasked = require_isMasked(); - var isObject2 = require_isObject(); - var toSource = require_toSource(); - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - var reIsHostCtor = /^\[object .+?Constructor\]$/; - var funcProto = Function.prototype; - var objectProto = Object.prototype; - var funcToString = funcProto.toString; - var hasOwnProperty = objectProto.hasOwnProperty; - var reIsNative = RegExp( - "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" - ); - function baseIsNative(value) { - if (!isObject2(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - module2.exports = baseIsNative; - } -}); - -// node_modules/lodash/_getValue.js -var require_getValue = __commonJS({ - "node_modules/lodash/_getValue.js"(exports2, module2) { - function getValue(object2, key) { - return object2 == null ? void 0 : object2[key]; - } - module2.exports = getValue; - } -}); - -// node_modules/lodash/_getNative.js -var require_getNative = __commonJS({ - "node_modules/lodash/_getNative.js"(exports2, module2) { - var baseIsNative = require_baseIsNative(); - var getValue = require_getValue(); - function getNative(object2, key) { - var value = getValue(object2, key); - return baseIsNative(value) ? value : void 0; - } - module2.exports = getNative; - } -}); - -// node_modules/lodash/_defineProperty.js -var require_defineProperty = __commonJS({ - "node_modules/lodash/_defineProperty.js"(exports2, module2) { - var getNative = require_getNative(); - var defineProperty = (function() { - try { - var func = getNative(Object, "defineProperty"); - func({}, "", {}); - return func; - } catch (e) { - } - })(); - module2.exports = defineProperty; - } -}); - -// node_modules/lodash/_baseSetToString.js -var require_baseSetToString = __commonJS({ - "node_modules/lodash/_baseSetToString.js"(exports2, module2) { - var constant = require_constant(); - var defineProperty = require_defineProperty(); - var identity = require_identity(); - var baseSetToString = !defineProperty ? identity : function(func, string2) { - return defineProperty(func, "toString", { - "configurable": true, - "enumerable": false, - "value": constant(string2), - "writable": true - }); - }; - module2.exports = baseSetToString; - } -}); - -// node_modules/lodash/_shortOut.js -var require_shortOut = __commonJS({ - "node_modules/lodash/_shortOut.js"(exports2, module2) { - var HOT_COUNT = 800; - var HOT_SPAN = 16; - var nativeNow = Date.now; - function shortOut(func) { - var count = 0, lastCalled = 0; - return function() { - var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(void 0, arguments); - }; - } - module2.exports = shortOut; - } -}); - -// node_modules/lodash/_setToString.js -var require_setToString = __commonJS({ - "node_modules/lodash/_setToString.js"(exports2, module2) { - var baseSetToString = require_baseSetToString(); - var shortOut = require_shortOut(); - var setToString = shortOut(baseSetToString); - module2.exports = setToString; - } -}); - -// node_modules/lodash/_baseRest.js -var require_baseRest = __commonJS({ - "node_modules/lodash/_baseRest.js"(exports2, module2) { - var identity = require_identity(); - var overRest = require_overRest(); - var setToString = require_setToString(); - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ""); - } - module2.exports = baseRest; - } -}); - -// node_modules/lodash/eq.js -var require_eq2 = __commonJS({ - "node_modules/lodash/eq.js"(exports2, module2) { - function eq(value, other) { - return value === other || value !== value && other !== other; - } - module2.exports = eq; - } -}); - -// node_modules/lodash/isLength.js -var require_isLength = __commonJS({ - "node_modules/lodash/isLength.js"(exports2, module2) { - var MAX_SAFE_INTEGER = 9007199254740991; - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - module2.exports = isLength; - } -}); - -// node_modules/lodash/isArrayLike.js -var require_isArrayLike = __commonJS({ - "node_modules/lodash/isArrayLike.js"(exports2, module2) { - var isFunction = require_isFunction(); - var isLength = require_isLength(); - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - module2.exports = isArrayLike; - } -}); - -// node_modules/lodash/_isIndex.js -var require_isIndex = __commonJS({ - "node_modules/lodash/_isIndex.js"(exports2, module2) { - var MAX_SAFE_INTEGER = 9007199254740991; - var reIsUint = /^(?:0|[1-9]\d*)$/; - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); - } - module2.exports = isIndex; - } -}); - -// node_modules/lodash/_isIterateeCall.js -var require_isIterateeCall = __commonJS({ - "node_modules/lodash/_isIterateeCall.js"(exports2, module2) { - var eq = require_eq2(); - var isArrayLike = require_isArrayLike(); - var isIndex = require_isIndex(); - var isObject2 = require_isObject(); - function isIterateeCall(value, index2, object2) { - if (!isObject2(object2)) { - return false; - } - var type = typeof index2; - if (type == "number" ? isArrayLike(object2) && isIndex(index2, object2.length) : type == "string" && index2 in object2) { - return eq(object2[index2], value); - } - return false; - } - module2.exports = isIterateeCall; - } -}); - -// node_modules/lodash/_baseTimes.js -var require_baseTimes = __commonJS({ - "node_modules/lodash/_baseTimes.js"(exports2, module2) { - function baseTimes(n, iteratee) { - var index2 = -1, result = Array(n); - while (++index2 < n) { - result[index2] = iteratee(index2); - } - return result; - } - module2.exports = baseTimes; - } -}); - -// node_modules/lodash/isObjectLike.js -var require_isObjectLike = __commonJS({ - "node_modules/lodash/isObjectLike.js"(exports2, module2) { - function isObjectLike(value) { - return value != null && typeof value == "object"; - } - module2.exports = isObjectLike; - } -}); - -// node_modules/lodash/_baseIsArguments.js -var require_baseIsArguments = __commonJS({ - "node_modules/lodash/_baseIsArguments.js"(exports2, module2) { - var baseGetTag = require_baseGetTag(); - var isObjectLike = require_isObjectLike(); - var argsTag = "[object Arguments]"; - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } - module2.exports = baseIsArguments; - } -}); - -// node_modules/lodash/isArguments.js -var require_isArguments = __commonJS({ - "node_modules/lodash/isArguments.js"(exports2, module2) { - var baseIsArguments = require_baseIsArguments(); - var isObjectLike = require_isObjectLike(); - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - var isArguments = baseIsArguments(/* @__PURE__ */ (function() { - return arguments; - })()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); - }; - module2.exports = isArguments; - } -}); - -// node_modules/lodash/isArray.js -var require_isArray = __commonJS({ - "node_modules/lodash/isArray.js"(exports2, module2) { - var isArray2 = Array.isArray; - module2.exports = isArray2; - } -}); - -// node_modules/lodash/stubFalse.js -var require_stubFalse = __commonJS({ - "node_modules/lodash/stubFalse.js"(exports2, module2) { - function stubFalse() { - return false; - } - module2.exports = stubFalse; - } -}); - -// node_modules/lodash/isBuffer.js -var require_isBuffer = __commonJS({ - "node_modules/lodash/isBuffer.js"(exports2, module2) { - var root = require_root(); - var stubFalse = require_stubFalse(); - var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2; - var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2; - var moduleExports = freeModule && freeModule.exports === freeExports; - var Buffer2 = moduleExports ? root.Buffer : void 0; - var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0; - var isBuffer = nativeIsBuffer || stubFalse; - module2.exports = isBuffer; - } -}); - -// node_modules/lodash/_baseIsTypedArray.js -var require_baseIsTypedArray = __commonJS({ - "node_modules/lodash/_baseIsTypedArray.js"(exports2, module2) { - var baseGetTag = require_baseGetTag(); - var isLength = require_isLength(); - var isObjectLike = require_isObjectLike(); - var argsTag = "[object Arguments]"; - var arrayTag = "[object Array]"; - var boolTag = "[object Boolean]"; - var dateTag = "[object Date]"; - var errorTag = "[object Error]"; - var funcTag = "[object Function]"; - var mapTag2 = "[object Map]"; - var numberTag = "[object Number]"; - var objectTag = "[object Object]"; - var regexpTag = "[object RegExp]"; - var setTag2 = "[object Set]"; - var stringTag = "[object String]"; - var weakMapTag = "[object WeakMap]"; - var arrayBufferTag = "[object ArrayBuffer]"; - var dataViewTag = "[object DataView]"; - var float32Tag = "[object Float32Array]"; - var float64Tag = "[object Float64Array]"; - var int8Tag = "[object Int8Array]"; - var int16Tag = "[object Int16Array]"; - var int32Tag = "[object Int32Array]"; - var uint8Tag = "[object Uint8Array]"; - var uint8ClampedTag = "[object Uint8ClampedArray]"; - var uint16Tag = "[object Uint16Array]"; - var uint32Tag = "[object Uint32Array]"; - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag2] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag2] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - function baseIsTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } - module2.exports = baseIsTypedArray; - } -}); - -// node_modules/lodash/_baseUnary.js -var require_baseUnary = __commonJS({ - "node_modules/lodash/_baseUnary.js"(exports2, module2) { - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - module2.exports = baseUnary; - } -}); - -// node_modules/lodash/_nodeUtil.js -var require_nodeUtil = __commonJS({ - "node_modules/lodash/_nodeUtil.js"(exports2, module2) { - var freeGlobal = require_freeGlobal(); - var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2; - var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2; - var moduleExports = freeModule && freeModule.exports === freeExports; - var freeProcess = moduleExports && freeGlobal.process; - var nodeUtil = (function() { - try { - var types2 = freeModule && freeModule.require && freeModule.require("util").types; - if (types2) { - return types2; - } - return freeProcess && freeProcess.binding && freeProcess.binding("util"); - } catch (e) { - } - })(); - module2.exports = nodeUtil; - } -}); - -// node_modules/lodash/isTypedArray.js -var require_isTypedArray = __commonJS({ - "node_modules/lodash/isTypedArray.js"(exports2, module2) { - var baseIsTypedArray = require_baseIsTypedArray(); - var baseUnary = require_baseUnary(); - var nodeUtil = require_nodeUtil(); - var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - module2.exports = isTypedArray; - } -}); - -// node_modules/lodash/_arrayLikeKeys.js -var require_arrayLikeKeys = __commonJS({ - "node_modules/lodash/_arrayLikeKeys.js"(exports2, module2) { - var baseTimes = require_baseTimes(); - var isArguments = require_isArguments(); - var isArray2 = require_isArray(); - var isBuffer = require_isBuffer(); - var isIndex = require_isIndex(); - var isTypedArray = require_isTypedArray(); - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - function arrayLikeKeys(value, inherited) { - var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. - (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. - isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. - isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. - isIndex(key, length)))) { - result.push(key); - } - } - return result; - } - module2.exports = arrayLikeKeys; - } -}); - -// node_modules/lodash/_isPrototype.js -var require_isPrototype = __commonJS({ - "node_modules/lodash/_isPrototype.js"(exports2, module2) { - var objectProto = Object.prototype; - function isPrototype(value) { - var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; - return value === proto; - } - module2.exports = isPrototype; - } -}); - -// node_modules/lodash/_nativeKeysIn.js -var require_nativeKeysIn = __commonJS({ - "node_modules/lodash/_nativeKeysIn.js"(exports2, module2) { - function nativeKeysIn(object2) { - var result = []; - if (object2 != null) { - for (var key in Object(object2)) { - result.push(key); - } - } - return result; - } - module2.exports = nativeKeysIn; - } -}); - -// node_modules/lodash/_baseKeysIn.js -var require_baseKeysIn = __commonJS({ - "node_modules/lodash/_baseKeysIn.js"(exports2, module2) { - var isObject2 = require_isObject(); - var isPrototype = require_isPrototype(); - var nativeKeysIn = require_nativeKeysIn(); - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - function baseKeysIn(object2) { - if (!isObject2(object2)) { - return nativeKeysIn(object2); - } - var isProto = isPrototype(object2), result = []; - for (var key in object2) { - if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object2, key)))) { - result.push(key); - } - } - return result; - } - module2.exports = baseKeysIn; - } -}); - -// node_modules/lodash/keysIn.js -var require_keysIn = __commonJS({ - "node_modules/lodash/keysIn.js"(exports2, module2) { - var arrayLikeKeys = require_arrayLikeKeys(); - var baseKeysIn = require_baseKeysIn(); - var isArrayLike = require_isArrayLike(); - function keysIn(object2) { - return isArrayLike(object2) ? arrayLikeKeys(object2, true) : baseKeysIn(object2); - } - module2.exports = keysIn; - } -}); - -// node_modules/lodash/defaults.js -var require_defaults = __commonJS({ - "node_modules/lodash/defaults.js"(exports2, module2) { - var baseRest = require_baseRest(); - var eq = require_eq2(); - var isIterateeCall = require_isIterateeCall(); - var keysIn = require_keysIn(); - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var defaults3 = baseRest(function(object2, sources) { - object2 = Object(object2); - var index2 = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : void 0; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - while (++index2 < length) { - var source = sources[index2]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object2[key]; - if (value === void 0 || eq(value, objectProto[key]) && !hasOwnProperty.call(object2, key)) { - object2[key] = source[key]; - } - } - } - return object2; - }); - module2.exports = defaults3; - } -}); - -// node_modules/readable-stream/lib/ours/primordials.js -var require_primordials = __commonJS({ - "node_modules/readable-stream/lib/ours/primordials.js"(exports2, module2) { - "use strict"; - var AggregateError = class extends Error { - constructor(errors) { - if (!Array.isArray(errors)) { - throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); - } - let message = ""; - for (let i = 0; i < errors.length; i++) { - message += ` ${errors[i].stack} -`; - } - super(message); - this.name = "AggregateError"; - this.errors = errors; - } - }; - module2.exports = { - AggregateError, - ArrayIsArray(self2) { - return Array.isArray(self2); - }, - ArrayPrototypeIncludes(self2, el) { - return self2.includes(el); - }, - ArrayPrototypeIndexOf(self2, el) { - return self2.indexOf(el); - }, - ArrayPrototypeJoin(self2, sep7) { - return self2.join(sep7); - }, - ArrayPrototypeMap(self2, fn) { - return self2.map(fn); - }, - ArrayPrototypePop(self2, el) { - return self2.pop(el); - }, - ArrayPrototypePush(self2, el) { - return self2.push(el); - }, - ArrayPrototypeSlice(self2, start, end) { - return self2.slice(start, end); - }, - Error, - FunctionPrototypeCall(fn, thisArgs, ...args) { - return fn.call(thisArgs, ...args); - }, - FunctionPrototypeSymbolHasInstance(self2, instance) { - return Function.prototype[Symbol.hasInstance].call(self2, instance); - }, - MathFloor: Math.floor, - Number, - NumberIsInteger: Number.isInteger, - NumberIsNaN: Number.isNaN, - NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER, - NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER, - NumberParseInt: Number.parseInt, - ObjectDefineProperties(self2, props) { - return Object.defineProperties(self2, props); - }, - ObjectDefineProperty(self2, name, prop) { - return Object.defineProperty(self2, name, prop); - }, - ObjectGetOwnPropertyDescriptor(self2, name) { - return Object.getOwnPropertyDescriptor(self2, name); - }, - ObjectKeys(obj) { - return Object.keys(obj); - }, - ObjectSetPrototypeOf(target, proto) { - return Object.setPrototypeOf(target, proto); - }, - Promise, - PromisePrototypeCatch(self2, fn) { - return self2.catch(fn); - }, - PromisePrototypeThen(self2, thenFn, catchFn) { - return self2.then(thenFn, catchFn); - }, - PromiseReject(err) { - return Promise.reject(err); - }, - PromiseResolve(val) { - return Promise.resolve(val); - }, - ReflectApply: Reflect.apply, - RegExpPrototypeTest(self2, value) { - return self2.test(value); - }, - SafeSet: Set, - String, - StringPrototypeSlice(self2, start, end) { - return self2.slice(start, end); - }, - StringPrototypeToLowerCase(self2) { - return self2.toLowerCase(); - }, - StringPrototypeToUpperCase(self2) { - return self2.toUpperCase(); - }, - StringPrototypeTrim(self2) { - return self2.trim(); - }, - Symbol, - SymbolFor: Symbol.for, - SymbolAsyncIterator: Symbol.asyncIterator, - SymbolHasInstance: Symbol.hasInstance, - SymbolIterator: Symbol.iterator, - SymbolDispose: Symbol.dispose || /* @__PURE__ */ Symbol("Symbol.dispose"), - SymbolAsyncDispose: Symbol.asyncDispose || /* @__PURE__ */ Symbol("Symbol.asyncDispose"), - TypedArrayPrototypeSet(self2, buf, len) { - return self2.set(buf, len); - }, - Boolean, - Uint8Array - }; - } -}); - -// node_modules/readable-stream/lib/ours/util/inspect.js -var require_inspect2 = __commonJS({ - "node_modules/readable-stream/lib/ours/util/inspect.js"(exports2, module2) { - "use strict"; - module2.exports = { - format(format, ...args) { - return format.replace(/%([sdifj])/g, function(...[_unused, type]) { - const replacement = args.shift(); - if (type === "f") { - return replacement.toFixed(6); - } else if (type === "j") { - return JSON.stringify(replacement); - } else if (type === "s" && typeof replacement === "object") { - const ctor = replacement.constructor !== Object ? replacement.constructor.name : ""; - return `${ctor} {}`.trim(); - } else { - return replacement.toString(); - } - }); - }, - inspect(value) { - switch (typeof value) { - case "string": - if (value.includes("'")) { - if (!value.includes('"')) { - return `"${value}"`; - } else if (!value.includes("`") && !value.includes("${")) { - return `\`${value}\``; - } - } - return `'${value}'`; - case "number": - if (isNaN(value)) { - return "NaN"; - } else if (Object.is(value, -0)) { - return String(value); - } - return value; - case "bigint": - return `${String(value)}n`; - case "boolean": - case "undefined": - return String(value); - case "object": - return "{}"; - } - } - }; - } -}); - -// node_modules/readable-stream/lib/ours/errors.js -var require_errors4 = __commonJS({ - "node_modules/readable-stream/lib/ours/errors.js"(exports2, module2) { - "use strict"; - var { format, inspect } = require_inspect2(); - var { AggregateError: CustomAggregateError } = require_primordials(); - var AggregateError = globalThis.AggregateError || CustomAggregateError; - var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); - var kTypes = [ - "string", - "function", - "number", - "object", - // Accept 'Function' and 'Object' as alternative to the lower cased version. - "Function", - "Object", - "boolean", - "bigint", - "symbol" - ]; - var classRegExp = /^([A-Z][a-z0-9]*)+$/; - var nodeInternalPrefix = "__node_internal_"; - var codes = {}; - function assert(value, message) { - if (!value) { - throw new codes.ERR_INTERNAL_ASSERTION(message); - } - } - function addNumericalSeparator(val) { - let res = ""; - let i = val.length; - const start = val[0] === "-" ? 1 : 0; - for (; i >= start + 4; i -= 3) { - res = `_${val.slice(i - 3, i)}${res}`; - } - return `${val.slice(0, i)}${res}`; - } - function getMessage(key, msg, args) { - if (typeof msg === "function") { - assert( - msg.length <= args.length, - // Default options do not count. - `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).` - ); - return msg(...args); - } - const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length; - assert( - expectedLength === args.length, - `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).` - ); - if (args.length === 0) { - return msg; - } - return format(msg, ...args); - } - function E(code, message, Base) { - if (!Base) { - Base = Error; - } - class NodeError extends Base { - constructor(...args) { - super(getMessage(code, message, args)); - } - toString() { - return `${this.name} [${code}]: ${this.message}`; - } - } - Object.defineProperties(NodeError.prototype, { - name: { - value: Base.name, - writable: true, - enumerable: false, - configurable: true - }, - toString: { - value() { - return `${this.name} [${code}]: ${this.message}`; - }, - writable: true, - enumerable: false, - configurable: true - } - }); - NodeError.prototype.code = code; - NodeError.prototype[kIsNodeError] = true; - codes[code] = NodeError; - } - function hideStackFrames(fn) { - const hidden = nodeInternalPrefix + fn.name; - Object.defineProperty(fn, "name", { - value: hidden - }); - return fn; - } - function aggregateTwoErrors(innerError, outerError) { - if (innerError && outerError && innerError !== outerError) { - if (Array.isArray(outerError.errors)) { - outerError.errors.push(innerError); - return outerError; - } - const err = new AggregateError([outerError, innerError], outerError.message); - err.code = outerError.code; - return err; - } - return innerError || outerError; - } - var AbortError = class extends Error { - constructor(message = "The operation was aborted", options = void 0) { - if (options !== void 0 && typeof options !== "object") { - throw new codes.ERR_INVALID_ARG_TYPE("options", "Object", options); - } - super(message, options); - this.code = "ABORT_ERR"; - this.name = "AbortError"; - } - }; - E("ERR_ASSERTION", "%s", Error); - E( - "ERR_INVALID_ARG_TYPE", - (name, expected, actual) => { - assert(typeof name === "string", "'name' must be a string"); - if (!Array.isArray(expected)) { - expected = [expected]; - } - let msg = "The "; - if (name.endsWith(" argument")) { - msg += `${name} `; - } else { - msg += `"${name}" ${name.includes(".") ? "property" : "argument"} `; - } - msg += "must be "; - const types2 = []; - const instances = []; - const other = []; - for (const value of expected) { - assert(typeof value === "string", "All expected entries have to be of type string"); - if (kTypes.includes(value)) { - types2.push(value.toLowerCase()); - } else if (classRegExp.test(value)) { - instances.push(value); - } else { - assert(value !== "object", 'The value "object" should be written as "Object"'); - other.push(value); - } - } - if (instances.length > 0) { - const pos = types2.indexOf("object"); - if (pos !== -1) { - types2.splice(types2, pos, 1); - instances.push("Object"); - } - } - if (types2.length > 0) { - switch (types2.length) { - case 1: - msg += `of type ${types2[0]}`; - break; - case 2: - msg += `one of type ${types2[0]} or ${types2[1]}`; - break; - default: { - const last = types2.pop(); - msg += `one of type ${types2.join(", ")}, or ${last}`; - } - } - if (instances.length > 0 || other.length > 0) { - msg += " or "; - } - } - if (instances.length > 0) { - switch (instances.length) { - case 1: - msg += `an instance of ${instances[0]}`; - break; - case 2: - msg += `an instance of ${instances[0]} or ${instances[1]}`; - break; - default: { - const last = instances.pop(); - msg += `an instance of ${instances.join(", ")}, or ${last}`; - } - } - if (other.length > 0) { - msg += " or "; - } - } - switch (other.length) { - case 0: - break; - case 1: - if (other[0].toLowerCase() !== other[0]) { - msg += "an "; - } - msg += `${other[0]}`; - break; - case 2: - msg += `one of ${other[0]} or ${other[1]}`; - break; - default: { - const last = other.pop(); - msg += `one of ${other.join(", ")}, or ${last}`; - } - } - if (actual == null) { - msg += `. Received ${actual}`; - } else if (typeof actual === "function" && actual.name) { - msg += `. Received function ${actual.name}`; - } else if (typeof actual === "object") { - var _actual$constructor; - if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name) { - msg += `. Received an instance of ${actual.constructor.name}`; - } else { - const inspected = inspect(actual, { - depth: -1 - }); - msg += `. Received ${inspected}`; - } - } else { - let inspected = inspect(actual, { - colors: false - }); - if (inspected.length > 25) { - inspected = `${inspected.slice(0, 25)}...`; - } - msg += `. Received type ${typeof actual} (${inspected})`; - } - return msg; - }, - TypeError - ); - E( - "ERR_INVALID_ARG_VALUE", - (name, value, reason = "is invalid") => { - let inspected = inspect(value); - if (inspected.length > 128) { - inspected = inspected.slice(0, 128) + "..."; - } - const type = name.includes(".") ? "property" : "argument"; - return `The ${type} '${name}' ${reason}. Received ${inspected}`; - }, - TypeError - ); - E( - "ERR_INVALID_RETURN_VALUE", - (input, name, value) => { - var _value$constructor; - const type = value !== null && value !== void 0 && (_value$constructor = value.constructor) !== null && _value$constructor !== void 0 && _value$constructor.name ? `instance of ${value.constructor.name}` : `type ${typeof value}`; - return `Expected ${input} to be returned from the "${name}" function but got ${type}.`; - }, - TypeError - ); - E( - "ERR_MISSING_ARGS", - (...args) => { - assert(args.length > 0, "At least one arg needs to be specified"); - let msg; - const len = args.length; - args = (Array.isArray(args) ? args : [args]).map((a) => `"${a}"`).join(" or "); - switch (len) { - case 1: - msg += `The ${args[0]} argument`; - break; - case 2: - msg += `The ${args[0]} and ${args[1]} arguments`; - break; - default: - { - const last = args.pop(); - msg += `The ${args.join(", ")}, and ${last} arguments`; - } - break; - } - return `${msg} must be specified`; - }, - TypeError - ); - E( - "ERR_OUT_OF_RANGE", - (str, range2, input) => { - assert(range2, 'Missing "range" argument'); - let received; - if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { - received = addNumericalSeparator(String(input)); - } else if (typeof input === "bigint") { - received = String(input); - const limit = BigInt(2) ** BigInt(32); - if (input > limit || input < -limit) { - received = addNumericalSeparator(received); - } - received += "n"; - } else { - received = inspect(input); - } - return `The value of "${str}" is out of range. It must be ${range2}. Received ${received}`; - }, - RangeError - ); - E("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); - E("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); - E("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); - E("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); - E("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); - E("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); - E("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); - E("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); - E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); - E("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); - E("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); - module2.exports = { - AbortError, - aggregateTwoErrors: hideStackFrames(aggregateTwoErrors), - hideStackFrames, - codes - }; - } -}); - -// node_modules/event-target-shim/dist/event-target-shim.js -var require_event_target_shim = __commonJS({ - "node_modules/event-target-shim/dist/event-target-shim.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var privateData = /* @__PURE__ */ new WeakMap(); - var wrappers = /* @__PURE__ */ new WeakMap(); - function pd(event) { - const retv = privateData.get(event); - console.assert( - retv != null, - "'this' is expected an Event object, but got", - event - ); - return retv; - } - function setCancelFlag(data) { - if (data.passiveListener != null) { - if (typeof console !== "undefined" && typeof console.error === "function") { - console.error( - "Unable to preventDefault inside passive event listener invocation.", - data.passiveListener - ); - } - return; - } - if (!data.event.cancelable) { - return; - } - data.canceled = true; - if (typeof data.event.preventDefault === "function") { - data.event.preventDefault(); - } - } - function Event2(eventTarget, event) { - privateData.set(this, { - eventTarget, - event, - eventPhase: 2, - currentTarget: eventTarget, - canceled: false, - stopped: false, - immediateStopped: false, - passiveListener: null, - timeStamp: event.timeStamp || Date.now() - }); - Object.defineProperty(this, "isTrusted", { value: false, enumerable: true }); - const keys = Object.keys(event); - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - if (!(key in this)) { - Object.defineProperty(this, key, defineRedirectDescriptor(key)); - } - } - } - Event2.prototype = { - /** - * The type of this event. - * @type {string} - */ - get type() { - return pd(this).event.type; - }, - /** - * The target of this event. - * @type {EventTarget} - */ - get target() { - return pd(this).eventTarget; - }, - /** - * The target of this event. - * @type {EventTarget} - */ - get currentTarget() { - return pd(this).currentTarget; - }, - /** - * @returns {EventTarget[]} The composed path of this event. - */ - composedPath() { - const currentTarget = pd(this).currentTarget; - if (currentTarget == null) { - return []; - } - return [currentTarget]; - }, - /** - * Constant of NONE. - * @type {number} - */ - get NONE() { - return 0; - }, - /** - * Constant of CAPTURING_PHASE. - * @type {number} - */ - get CAPTURING_PHASE() { - return 1; - }, - /** - * Constant of AT_TARGET. - * @type {number} - */ - get AT_TARGET() { - return 2; - }, - /** - * Constant of BUBBLING_PHASE. - * @type {number} - */ - get BUBBLING_PHASE() { - return 3; - }, - /** - * The target of this event. - * @type {number} - */ - get eventPhase() { - return pd(this).eventPhase; - }, - /** - * Stop event bubbling. - * @returns {void} - */ - stopPropagation() { - const data = pd(this); - data.stopped = true; - if (typeof data.event.stopPropagation === "function") { - data.event.stopPropagation(); - } - }, - /** - * Stop event bubbling. - * @returns {void} - */ - stopImmediatePropagation() { - const data = pd(this); - data.stopped = true; - data.immediateStopped = true; - if (typeof data.event.stopImmediatePropagation === "function") { - data.event.stopImmediatePropagation(); - } - }, - /** - * The flag to be bubbling. - * @type {boolean} - */ - get bubbles() { - return Boolean(pd(this).event.bubbles); - }, - /** - * The flag to be cancelable. - * @type {boolean} - */ - get cancelable() { - return Boolean(pd(this).event.cancelable); - }, - /** - * Cancel this event. - * @returns {void} - */ - preventDefault() { - setCancelFlag(pd(this)); - }, - /** - * The flag to indicate cancellation state. - * @type {boolean} - */ - get defaultPrevented() { - return pd(this).canceled; - }, - /** - * The flag to be composed. - * @type {boolean} - */ - get composed() { - return Boolean(pd(this).event.composed); - }, - /** - * The unix time of this event. - * @type {number} - */ - get timeStamp() { - return pd(this).timeStamp; - }, - /** - * The target of this event. - * @type {EventTarget} - * @deprecated - */ - get srcElement() { - return pd(this).eventTarget; - }, - /** - * The flag to stop event bubbling. - * @type {boolean} - * @deprecated - */ - get cancelBubble() { - return pd(this).stopped; - }, - set cancelBubble(value) { - if (!value) { - return; - } - const data = pd(this); - data.stopped = true; - if (typeof data.event.cancelBubble === "boolean") { - data.event.cancelBubble = true; - } - }, - /** - * The flag to indicate cancellation state. - * @type {boolean} - * @deprecated - */ - get returnValue() { - return !pd(this).canceled; - }, - set returnValue(value) { - if (!value) { - setCancelFlag(pd(this)); - } - }, - /** - * Initialize this event object. But do nothing under event dispatching. - * @param {string} type The event type. - * @param {boolean} [bubbles=false] The flag to be possible to bubble up. - * @param {boolean} [cancelable=false] The flag to be possible to cancel. - * @deprecated - */ - initEvent() { - } - }; - Object.defineProperty(Event2.prototype, "constructor", { - value: Event2, - configurable: true, - writable: true - }); - if (typeof window !== "undefined" && typeof window.Event !== "undefined") { - Object.setPrototypeOf(Event2.prototype, window.Event.prototype); - wrappers.set(window.Event.prototype, Event2); - } - function defineRedirectDescriptor(key) { - return { - get() { - return pd(this).event[key]; - }, - set(value) { - pd(this).event[key] = value; - }, - configurable: true, - enumerable: true - }; - } - function defineCallDescriptor(key) { - return { - value() { - const event = pd(this).event; - return event[key].apply(event, arguments); - }, - configurable: true, - enumerable: true - }; - } - function defineWrapper(BaseEvent, proto) { - const keys = Object.keys(proto); - if (keys.length === 0) { - return BaseEvent; - } - function CustomEvent(eventTarget, event) { - BaseEvent.call(this, eventTarget, event); - } - CustomEvent.prototype = Object.create(BaseEvent.prototype, { - constructor: { value: CustomEvent, configurable: true, writable: true } - }); - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - if (!(key in BaseEvent.prototype)) { - const descriptor = Object.getOwnPropertyDescriptor(proto, key); - const isFunc = typeof descriptor.value === "function"; - Object.defineProperty( - CustomEvent.prototype, - key, - isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key) - ); - } - } - return CustomEvent; - } - function getWrapper(proto) { - if (proto == null || proto === Object.prototype) { - return Event2; - } - let wrapper = wrappers.get(proto); - if (wrapper == null) { - wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto); - wrappers.set(proto, wrapper); - } - return wrapper; - } - function wrapEvent(eventTarget, event) { - const Wrapper = getWrapper(Object.getPrototypeOf(event)); - return new Wrapper(eventTarget, event); - } - function isStopped(event) { - return pd(event).immediateStopped; - } - function setEventPhase(event, eventPhase) { - pd(event).eventPhase = eventPhase; - } - function setCurrentTarget(event, currentTarget) { - pd(event).currentTarget = currentTarget; - } - function setPassiveListener(event, passiveListener) { - pd(event).passiveListener = passiveListener; - } - var listenersMap = /* @__PURE__ */ new WeakMap(); - var CAPTURE = 1; - var BUBBLE = 2; - var ATTRIBUTE = 3; - function isObject2(x) { - return x !== null && typeof x === "object"; - } - function getListeners(eventTarget) { - const listeners = listenersMap.get(eventTarget); - if (listeners == null) { - throw new TypeError( - "'this' is expected an EventTarget object, but got another value." - ); - } - return listeners; - } - function defineEventAttributeDescriptor(eventName) { - return { - get() { - const listeners = getListeners(this); - let node = listeners.get(eventName); - while (node != null) { - if (node.listenerType === ATTRIBUTE) { - return node.listener; - } - node = node.next; - } - return null; - }, - set(listener) { - if (typeof listener !== "function" && !isObject2(listener)) { - listener = null; - } - const listeners = getListeners(this); - let prev = null; - let node = listeners.get(eventName); - while (node != null) { - if (node.listenerType === ATTRIBUTE) { - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - } else { - prev = node; - } - node = node.next; - } - if (listener !== null) { - const newNode = { - listener, - listenerType: ATTRIBUTE, - passive: false, - once: false, - next: null - }; - if (prev === null) { - listeners.set(eventName, newNode); - } else { - prev.next = newNode; - } - } - }, - configurable: true, - enumerable: true - }; - } - function defineEventAttribute(eventTargetPrototype, eventName) { - Object.defineProperty( - eventTargetPrototype, - `on${eventName}`, - defineEventAttributeDescriptor(eventName) - ); - } - function defineCustomEventTarget(eventNames) { - function CustomEventTarget() { - EventTarget2.call(this); - } - CustomEventTarget.prototype = Object.create(EventTarget2.prototype, { - constructor: { - value: CustomEventTarget, - configurable: true, - writable: true - } - }); - for (let i = 0; i < eventNames.length; ++i) { - defineEventAttribute(CustomEventTarget.prototype, eventNames[i]); - } - return CustomEventTarget; - } - function EventTarget2() { - if (this instanceof EventTarget2) { - listenersMap.set(this, /* @__PURE__ */ new Map()); - return; - } - if (arguments.length === 1 && Array.isArray(arguments[0])) { - return defineCustomEventTarget(arguments[0]); - } - if (arguments.length > 0) { - const types2 = new Array(arguments.length); - for (let i = 0; i < arguments.length; ++i) { - types2[i] = arguments[i]; - } - return defineCustomEventTarget(types2); - } - throw new TypeError("Cannot call a class as a function"); - } - EventTarget2.prototype = { - /** - * Add a given listener to this event target. - * @param {string} eventName The event name to add. - * @param {Function} listener The listener to add. - * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. - * @returns {void} - */ - addEventListener(eventName, listener, options) { - if (listener == null) { - return; - } - if (typeof listener !== "function" && !isObject2(listener)) { - throw new TypeError("'listener' should be a function or an object."); - } - const listeners = getListeners(this); - const optionsIsObj = isObject2(options); - const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); - const listenerType = capture ? CAPTURE : BUBBLE; - const newNode = { - listener, - listenerType, - passive: optionsIsObj && Boolean(options.passive), - once: optionsIsObj && Boolean(options.once), - next: null - }; - let node = listeners.get(eventName); - if (node === void 0) { - listeners.set(eventName, newNode); - return; - } - let prev = null; - while (node != null) { - if (node.listener === listener && node.listenerType === listenerType) { - return; - } - prev = node; - node = node.next; - } - prev.next = newNode; - }, - /** - * Remove a given listener from this event target. - * @param {string} eventName The event name to remove. - * @param {Function} listener The listener to remove. - * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. - * @returns {void} - */ - removeEventListener(eventName, listener, options) { - if (listener == null) { - return; - } - const listeners = getListeners(this); - const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options); - const listenerType = capture ? CAPTURE : BUBBLE; - let prev = null; - let node = listeners.get(eventName); - while (node != null) { - if (node.listener === listener && node.listenerType === listenerType) { - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - return; - } - prev = node; - node = node.next; - } - }, - /** - * Dispatch a given event. - * @param {Event|{type:string}} event The event to dispatch. - * @returns {boolean} `false` if canceled. - */ - dispatchEvent(event) { - if (event == null || typeof event.type !== "string") { - throw new TypeError('"event.type" should be a string.'); - } - const listeners = getListeners(this); - const eventName = event.type; - let node = listeners.get(eventName); - if (node == null) { - return true; - } - const wrappedEvent = wrapEvent(this, event); - let prev = null; - while (node != null) { - if (node.once) { - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - } else { - prev = node; - } - setPassiveListener( - wrappedEvent, - node.passive ? node.listener : null - ); - if (typeof node.listener === "function") { - try { - node.listener.call(this, wrappedEvent); - } catch (err) { - if (typeof console !== "undefined" && typeof console.error === "function") { - console.error(err); - } - } - } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") { - node.listener.handleEvent(wrappedEvent); - } - if (isStopped(wrappedEvent)) { - break; - } - node = node.next; - } - setPassiveListener(wrappedEvent, null); - setEventPhase(wrappedEvent, 0); - setCurrentTarget(wrappedEvent, null); - return !wrappedEvent.defaultPrevented; - } - }; - Object.defineProperty(EventTarget2.prototype, "constructor", { - value: EventTarget2, - configurable: true, - writable: true - }); - if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") { - Object.setPrototypeOf(EventTarget2.prototype, window.EventTarget.prototype); - } - exports2.defineEventAttribute = defineEventAttribute; - exports2.EventTarget = EventTarget2; - exports2.default = EventTarget2; - module2.exports = EventTarget2; - module2.exports.EventTarget = module2.exports["default"] = EventTarget2; - module2.exports.defineEventAttribute = defineEventAttribute; - } -}); - -// node_modules/abort-controller/dist/abort-controller.js -var require_abort_controller = __commonJS({ - "node_modules/abort-controller/dist/abort-controller.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var eventTargetShim = require_event_target_shim(); - var AbortSignal2 = class extends eventTargetShim.EventTarget { - /** - * AbortSignal cannot be constructed directly. - */ - constructor() { - super(); - throw new TypeError("AbortSignal cannot be constructed directly"); - } - /** - * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise. - */ - get aborted() { - const aborted = abortedFlags.get(this); - if (typeof aborted !== "boolean") { - throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); - } - return aborted; - } - }; - eventTargetShim.defineEventAttribute(AbortSignal2.prototype, "abort"); - function createAbortSignal() { - const signal = Object.create(AbortSignal2.prototype); - eventTargetShim.EventTarget.call(signal); - abortedFlags.set(signal, false); - return signal; - } - function abortSignal(signal) { - if (abortedFlags.get(signal) !== false) { - return; - } - abortedFlags.set(signal, true); - signal.dispatchEvent({ type: "abort" }); - } - var abortedFlags = /* @__PURE__ */ new WeakMap(); - Object.defineProperties(AbortSignal2.prototype, { - aborted: { enumerable: true } - }); - if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(AbortSignal2.prototype, Symbol.toStringTag, { - configurable: true, - value: "AbortSignal" - }); - } - var AbortController2 = class { - /** - * Initialize this controller. - */ - constructor() { - signals.set(this, createAbortSignal()); - } - /** - * Returns the `AbortSignal` object associated with this object. - */ - get signal() { - return getSignal(this); - } - /** - * Abort and signal to any observers that the associated activity is to be aborted. - */ - abort() { - abortSignal(getSignal(this)); - } - }; - var signals = /* @__PURE__ */ new WeakMap(); - function getSignal(controller) { - const signal = signals.get(controller); - if (signal == null) { - throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); - } - return signal; - } - Object.defineProperties(AbortController2.prototype, { - signal: { enumerable: true }, - abort: { enumerable: true } - }); - if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(AbortController2.prototype, Symbol.toStringTag, { - configurable: true, - value: "AbortController" - }); - } - exports2.AbortController = AbortController2; - exports2.AbortSignal = AbortSignal2; - exports2.default = AbortController2; - module2.exports = AbortController2; - module2.exports.AbortController = module2.exports["default"] = AbortController2; - module2.exports.AbortSignal = AbortSignal2; - } -}); - -// node_modules/readable-stream/lib/ours/util.js -var require_util13 = __commonJS({ - "node_modules/readable-stream/lib/ours/util.js"(exports2, module2) { - "use strict"; - var bufferModule = require("buffer"); - var { format, inspect } = require_inspect2(); - var { - codes: { ERR_INVALID_ARG_TYPE } - } = require_errors4(); - var { kResistStopPropagation, AggregateError, SymbolDispose } = require_primordials(); - var AbortSignal2 = globalThis.AbortSignal || require_abort_controller().AbortSignal; - var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; - var AsyncFunction = Object.getPrototypeOf(async function() { - }).constructor; - var Blob2 = globalThis.Blob || bufferModule.Blob; - var isBlob = typeof Blob2 !== "undefined" ? function isBlob2(b) { - return b instanceof Blob2; - } : function isBlob2(b) { - return false; - }; - var validateAbortSignal = (signal, name) => { - if (signal !== void 0 && (signal === null || typeof signal !== "object" || !("aborted" in signal))) { - throw new ERR_INVALID_ARG_TYPE(name, "AbortSignal", signal); - } - }; - var validateFunction = (value, name) => { - if (typeof value !== "function") { - throw new ERR_INVALID_ARG_TYPE(name, "Function", value); - } - }; - module2.exports = { - AggregateError, - kEmptyObject: Object.freeze({}), - once(callback) { - let called = false; - return function(...args) { - if (called) { - return; - } - called = true; - callback.apply(this, args); - }; - }, - createDeferredPromise: function() { - let resolve14; - let reject; - const promise = new Promise((res, rej) => { - resolve14 = res; - reject = rej; - }); - return { - promise, - resolve: resolve14, - reject - }; - }, - promisify(fn) { - return new Promise((resolve14, reject) => { - fn((err, ...args) => { - if (err) { - return reject(err); - } - return resolve14(...args); - }); - }); - }, - debuglog() { - return function() { - }; - }, - format, - inspect, - types: { - isAsyncFunction(fn) { - return fn instanceof AsyncFunction; - }, - isArrayBufferView(arr) { - return ArrayBuffer.isView(arr); - } - }, - isBlob, - deprecate(fn, message) { - return fn; - }, - addAbortListener: require("events").addAbortListener || function addAbortListener(signal, listener) { - if (signal === void 0) { - throw new ERR_INVALID_ARG_TYPE("signal", "AbortSignal", signal); - } - validateAbortSignal(signal, "signal"); - validateFunction(listener, "listener"); - let removeEventListener; - if (signal.aborted) { - queueMicrotask(() => listener()); - } else { - signal.addEventListener("abort", listener, { - __proto__: null, - once: true, - [kResistStopPropagation]: true - }); - removeEventListener = () => { - signal.removeEventListener("abort", listener); - }; - } - return { - __proto__: null, - [SymbolDispose]() { - var _removeEventListener; - (_removeEventListener = removeEventListener) === null || _removeEventListener === void 0 ? void 0 : _removeEventListener(); - } - }; - }, - AbortSignalAny: AbortSignal2.any || function AbortSignalAny(signals) { - if (signals.length === 1) { - return signals[0]; - } - const ac = new AbortController2(); - const abort = () => ac.abort(); - signals.forEach((signal) => { - validateAbortSignal(signal, "signals"); - signal.addEventListener("abort", abort, { - once: true - }); - }); - ac.signal.addEventListener( - "abort", - () => { - signals.forEach((signal) => signal.removeEventListener("abort", abort)); - }, - { - once: true - } - ); - return ac.signal; - } - }; - module2.exports.promisify.custom = /* @__PURE__ */ Symbol.for("nodejs.util.promisify.custom"); - } -}); - -// node_modules/readable-stream/lib/internal/validators.js -var require_validators = __commonJS({ - "node_modules/readable-stream/lib/internal/validators.js"(exports2, module2) { - "use strict"; - var { - ArrayIsArray, - ArrayPrototypeIncludes, - ArrayPrototypeJoin, - ArrayPrototypeMap, - NumberIsInteger, - NumberIsNaN, - NumberMAX_SAFE_INTEGER, - NumberMIN_SAFE_INTEGER, - NumberParseInt, - ObjectPrototypeHasOwnProperty, - RegExpPrototypeExec, - String: String2, - StringPrototypeToUpperCase, - StringPrototypeTrim - } = require_primordials(); - var { - hideStackFrames, - codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL } - } = require_errors4(); - var { normalizeEncoding } = require_util13(); - var { isAsyncFunction, isArrayBufferView } = require_util13().types; - var signals = {}; - function isInt32(value) { - return value === (value | 0); - } - function isUint32(value) { - return value === value >>> 0; - } - var octalReg = /^[0-7]+$/; - var modeDesc = "must be a 32-bit unsigned integer or an octal string"; - function parseFileMode(value, name, def) { - if (typeof value === "undefined") { - value = def; - } - if (typeof value === "string") { - if (RegExpPrototypeExec(octalReg, value) === null) { - throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc); - } - value = NumberParseInt(value, 8); - } - validateUint32(value, name); - return value; - } - var validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => { - if (typeof value !== "number") throw new ERR_INVALID_ARG_TYPE(name, "number", value); - if (!NumberIsInteger(value)) throw new ERR_OUT_OF_RANGE(name, "an integer", value); - if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value); - }); - var validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => { - if (typeof value !== "number") { - throw new ERR_INVALID_ARG_TYPE(name, "number", value); - } - if (!NumberIsInteger(value)) { - throw new ERR_OUT_OF_RANGE(name, "an integer", value); - } - if (value < min || value > max) { - throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value); - } - }); - var validateUint32 = hideStackFrames((value, name, positive = false) => { - if (typeof value !== "number") { - throw new ERR_INVALID_ARG_TYPE(name, "number", value); - } - if (!NumberIsInteger(value)) { - throw new ERR_OUT_OF_RANGE(name, "an integer", value); - } - const min = positive ? 1 : 0; - const max = 4294967295; - if (value < min || value > max) { - throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value); - } - }); - function validateString(value, name) { - if (typeof value !== "string") throw new ERR_INVALID_ARG_TYPE(name, "string", value); - } - function validateNumber(value, name, min = void 0, max) { - if (typeof value !== "number") throw new ERR_INVALID_ARG_TYPE(name, "number", value); - if (min != null && value < min || max != null && value > max || (min != null || max != null) && NumberIsNaN(value)) { - throw new ERR_OUT_OF_RANGE( - name, - `${min != null ? `>= ${min}` : ""}${min != null && max != null ? " && " : ""}${max != null ? `<= ${max}` : ""}`, - value - ); - } - } - var validateOneOf = hideStackFrames((value, name, oneOf) => { - if (!ArrayPrototypeIncludes(oneOf, value)) { - const allowed = ArrayPrototypeJoin( - ArrayPrototypeMap(oneOf, (v) => typeof v === "string" ? `'${v}'` : String2(v)), - ", " - ); - const reason = "must be one of: " + allowed; - throw new ERR_INVALID_ARG_VALUE(name, value, reason); - } - }); - function validateBoolean(value, name) { - if (typeof value !== "boolean") throw new ERR_INVALID_ARG_TYPE(name, "boolean", value); - } - function getOwnPropertyValueOrDefault(options, key, defaultValue) { - return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue : options[key]; - } - var validateObject = hideStackFrames((value, name, options = null) => { - const allowArray = getOwnPropertyValueOrDefault(options, "allowArray", false); - const allowFunction = getOwnPropertyValueOrDefault(options, "allowFunction", false); - const nullable = getOwnPropertyValueOrDefault(options, "nullable", false); - if (!nullable && value === null || !allowArray && ArrayIsArray(value) || typeof value !== "object" && (!allowFunction || typeof value !== "function")) { - throw new ERR_INVALID_ARG_TYPE(name, "Object", value); - } - }); - var validateDictionary = hideStackFrames((value, name) => { - if (value != null && typeof value !== "object" && typeof value !== "function") { - throw new ERR_INVALID_ARG_TYPE(name, "a dictionary", value); - } - }); - var validateArray2 = hideStackFrames((value, name, minLength = 0) => { - if (!ArrayIsArray(value)) { - throw new ERR_INVALID_ARG_TYPE(name, "Array", value); - } - if (value.length < minLength) { - const reason = `must be longer than ${minLength}`; - throw new ERR_INVALID_ARG_VALUE(name, value, reason); - } - }); - function validateStringArray(value, name) { - validateArray2(value, name); - for (let i = 0; i < value.length; i++) { - validateString(value[i], `${name}[${i}]`); - } - } - function validateBooleanArray(value, name) { - validateArray2(value, name); - for (let i = 0; i < value.length; i++) { - validateBoolean(value[i], `${name}[${i}]`); - } - } - function validateAbortSignalArray(value, name) { - validateArray2(value, name); - for (let i = 0; i < value.length; i++) { - const signal = value[i]; - const indexedName = `${name}[${i}]`; - if (signal == null) { - throw new ERR_INVALID_ARG_TYPE(indexedName, "AbortSignal", signal); - } - validateAbortSignal(signal, indexedName); - } - } - function validateSignalName(signal, name = "signal") { - validateString(signal, name); - if (signals[signal] === void 0) { - if (signals[StringPrototypeToUpperCase(signal)] !== void 0) { - throw new ERR_UNKNOWN_SIGNAL(signal + " (signals must use all capital letters)"); - } - throw new ERR_UNKNOWN_SIGNAL(signal); - } - } - var validateBuffer = hideStackFrames((buffer, name = "buffer") => { - if (!isArrayBufferView(buffer)) { - throw new ERR_INVALID_ARG_TYPE(name, ["Buffer", "TypedArray", "DataView"], buffer); - } - }); - function validateEncoding(data, encoding) { - const normalizedEncoding = normalizeEncoding(encoding); - const length = data.length; - if (normalizedEncoding === "hex" && length % 2 !== 0) { - throw new ERR_INVALID_ARG_VALUE("encoding", encoding, `is invalid for data of length ${length}`); - } - } - function validatePort(port, name = "Port", allowZero = true) { - if (typeof port !== "number" && typeof port !== "string" || typeof port === "string" && StringPrototypeTrim(port).length === 0 || +port !== +port >>> 0 || port > 65535 || port === 0 && !allowZero) { - throw new ERR_SOCKET_BAD_PORT(name, port, allowZero); - } - return port | 0; - } - var validateAbortSignal = hideStackFrames((signal, name) => { - if (signal !== void 0 && (signal === null || typeof signal !== "object" || !("aborted" in signal))) { - throw new ERR_INVALID_ARG_TYPE(name, "AbortSignal", signal); - } - }); - var validateFunction = hideStackFrames((value, name) => { - if (typeof value !== "function") throw new ERR_INVALID_ARG_TYPE(name, "Function", value); - }); - var validatePlainFunction = hideStackFrames((value, name) => { - if (typeof value !== "function" || isAsyncFunction(value)) throw new ERR_INVALID_ARG_TYPE(name, "Function", value); - }); - var validateUndefined = hideStackFrames((value, name) => { - if (value !== void 0) throw new ERR_INVALID_ARG_TYPE(name, "undefined", value); - }); - function validateUnion(value, name, union) { - if (!ArrayPrototypeIncludes(union, value)) { - throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, "|")}')`, value); - } - } - var linkValueRegExp = /^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/; - function validateLinkHeaderFormat(value, name) { - if (typeof value === "undefined" || !RegExpPrototypeExec(linkValueRegExp, value)) { - throw new ERR_INVALID_ARG_VALUE( - name, - value, - 'must be an array or string of format "; rel=preload; as=style"' - ); - } - } - function validateLinkHeaderValue(hints) { - if (typeof hints === "string") { - validateLinkHeaderFormat(hints, "hints"); - return hints; - } else if (ArrayIsArray(hints)) { - const hintsLength = hints.length; - let result = ""; - if (hintsLength === 0) { - return result; - } - for (let i = 0; i < hintsLength; i++) { - const link = hints[i]; - validateLinkHeaderFormat(link, "hints"); - result += link; - if (i !== hintsLength - 1) { - result += ", "; - } - } - return result; - } - throw new ERR_INVALID_ARG_VALUE( - "hints", - hints, - 'must be an array or string of format "; rel=preload; as=style"' - ); - } - module2.exports = { - isInt32, - isUint32, - parseFileMode, - validateArray: validateArray2, - validateStringArray, - validateBooleanArray, - validateAbortSignalArray, - validateBoolean, - validateBuffer, - validateDictionary, - validateEncoding, - validateFunction, - validateInt32, - validateInteger, - validateNumber, - validateObject, - validateOneOf, - validatePlainFunction, - validatePort, - validateSignalName, - validateString, - validateUint32, - validateUndefined, - validateUnion, - validateAbortSignal, - validateLinkHeaderValue - }; - } -}); - -// node_modules/process/index.js -var require_process = __commonJS({ - "node_modules/process/index.js"(exports2, module2) { - module2.exports = global.process; - } -}); - -// node_modules/readable-stream/lib/internal/streams/utils.js -var require_utils7 = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/utils.js"(exports2, module2) { - "use strict"; - var { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require_primordials(); - var kIsDestroyed = SymbolFor("nodejs.stream.destroyed"); - var kIsErrored = SymbolFor("nodejs.stream.errored"); - var kIsReadable = SymbolFor("nodejs.stream.readable"); - var kIsWritable = SymbolFor("nodejs.stream.writable"); - var kIsDisturbed = SymbolFor("nodejs.stream.disturbed"); - var kIsClosedPromise = SymbolFor("nodejs.webstream.isClosedPromise"); - var kControllerErrorFunction = SymbolFor("nodejs.webstream.controllerErrorFunction"); - function isReadableNodeStream(obj, strict = false) { - var _obj$_readableState; - return !!(obj && typeof obj.pipe === "function" && typeof obj.on === "function" && (!strict || typeof obj.pause === "function" && typeof obj.resume === "function") && (!obj._writableState || ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === void 0 ? void 0 : _obj$_readableState.readable) !== false) && // Duplex - (!obj._writableState || obj._readableState)); - } - function isWritableNodeStream(obj) { - var _obj$_writableState; - return !!(obj && typeof obj.write === "function" && typeof obj.on === "function" && (!obj._readableState || ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === void 0 ? void 0 : _obj$_writableState.writable) !== false)); - } - function isDuplexNodeStream(obj) { - return !!(obj && typeof obj.pipe === "function" && obj._readableState && typeof obj.on === "function" && typeof obj.write === "function"); - } - function isNodeStream(obj) { - return obj && (obj._readableState || obj._writableState || typeof obj.write === "function" && typeof obj.on === "function" || typeof obj.pipe === "function" && typeof obj.on === "function"); - } - function isReadableStream(obj) { - return !!(obj && !isNodeStream(obj) && typeof obj.pipeThrough === "function" && typeof obj.getReader === "function" && typeof obj.cancel === "function"); - } - function isWritableStream(obj) { - return !!(obj && !isNodeStream(obj) && typeof obj.getWriter === "function" && typeof obj.abort === "function"); - } - function isTransformStream(obj) { - return !!(obj && !isNodeStream(obj) && typeof obj.readable === "object" && typeof obj.writable === "object"); - } - function isWebStream(obj) { - return isReadableStream(obj) || isWritableStream(obj) || isTransformStream(obj); - } - function isIterable(obj, isAsync) { - if (obj == null) return false; - if (isAsync === true) return typeof obj[SymbolAsyncIterator] === "function"; - if (isAsync === false) return typeof obj[SymbolIterator] === "function"; - return typeof obj[SymbolAsyncIterator] === "function" || typeof obj[SymbolIterator] === "function"; - } - function isDestroyed(stream2) { - if (!isNodeStream(stream2)) return null; - const wState = stream2._writableState; - const rState = stream2._readableState; - const state = wState || rState; - return !!(stream2.destroyed || stream2[kIsDestroyed] || state !== null && state !== void 0 && state.destroyed); - } - function isWritableEnded(stream2) { - if (!isWritableNodeStream(stream2)) return null; - if (stream2.writableEnded === true) return true; - const wState = stream2._writableState; - if (wState !== null && wState !== void 0 && wState.errored) return false; - if (typeof (wState === null || wState === void 0 ? void 0 : wState.ended) !== "boolean") return null; - return wState.ended; - } - function isWritableFinished(stream2, strict) { - if (!isWritableNodeStream(stream2)) return null; - if (stream2.writableFinished === true) return true; - const wState = stream2._writableState; - if (wState !== null && wState !== void 0 && wState.errored) return false; - if (typeof (wState === null || wState === void 0 ? void 0 : wState.finished) !== "boolean") return null; - return !!(wState.finished || strict === false && wState.ended === true && wState.length === 0); - } - function isReadableEnded(stream2) { - if (!isReadableNodeStream(stream2)) return null; - if (stream2.readableEnded === true) return true; - const rState = stream2._readableState; - if (!rState || rState.errored) return false; - if (typeof (rState === null || rState === void 0 ? void 0 : rState.ended) !== "boolean") return null; - return rState.ended; - } - function isReadableFinished(stream2, strict) { - if (!isReadableNodeStream(stream2)) return null; - const rState = stream2._readableState; - if (rState !== null && rState !== void 0 && rState.errored) return false; - if (typeof (rState === null || rState === void 0 ? void 0 : rState.endEmitted) !== "boolean") return null; - return !!(rState.endEmitted || strict === false && rState.ended === true && rState.length === 0); - } - function isReadable(stream2) { - if (stream2 && stream2[kIsReadable] != null) return stream2[kIsReadable]; - if (typeof (stream2 === null || stream2 === void 0 ? void 0 : stream2.readable) !== "boolean") return null; - if (isDestroyed(stream2)) return false; - return isReadableNodeStream(stream2) && stream2.readable && !isReadableFinished(stream2); - } - function isWritable(stream2) { - if (stream2 && stream2[kIsWritable] != null) return stream2[kIsWritable]; - if (typeof (stream2 === null || stream2 === void 0 ? void 0 : stream2.writable) !== "boolean") return null; - if (isDestroyed(stream2)) return false; - return isWritableNodeStream(stream2) && stream2.writable && !isWritableEnded(stream2); - } - function isFinished(stream2, opts) { - if (!isNodeStream(stream2)) { - return null; - } - if (isDestroyed(stream2)) { - return true; - } - if ((opts === null || opts === void 0 ? void 0 : opts.readable) !== false && isReadable(stream2)) { - return false; - } - if ((opts === null || opts === void 0 ? void 0 : opts.writable) !== false && isWritable(stream2)) { - return false; - } - return true; - } - function isWritableErrored(stream2) { - var _stream$_writableStat, _stream$_writableStat2; - if (!isNodeStream(stream2)) { - return null; - } - if (stream2.writableErrored) { - return stream2.writableErrored; - } - return (_stream$_writableStat = (_stream$_writableStat2 = stream2._writableState) === null || _stream$_writableStat2 === void 0 ? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 ? _stream$_writableStat : null; - } - function isReadableErrored(stream2) { - var _stream$_readableStat, _stream$_readableStat2; - if (!isNodeStream(stream2)) { - return null; - } - if (stream2.readableErrored) { - return stream2.readableErrored; - } - return (_stream$_readableStat = (_stream$_readableStat2 = stream2._readableState) === null || _stream$_readableStat2 === void 0 ? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 ? _stream$_readableStat : null; - } - function isClosed(stream2) { - if (!isNodeStream(stream2)) { - return null; - } - if (typeof stream2.closed === "boolean") { - return stream2.closed; - } - const wState = stream2._writableState; - const rState = stream2._readableState; - if (typeof (wState === null || wState === void 0 ? void 0 : wState.closed) === "boolean" || typeof (rState === null || rState === void 0 ? void 0 : rState.closed) === "boolean") { - return (wState === null || wState === void 0 ? void 0 : wState.closed) || (rState === null || rState === void 0 ? void 0 : rState.closed); - } - if (typeof stream2._closed === "boolean" && isOutgoingMessage(stream2)) { - return stream2._closed; - } - return null; - } - function isOutgoingMessage(stream2) { - return typeof stream2._closed === "boolean" && typeof stream2._defaultKeepAlive === "boolean" && typeof stream2._removedConnection === "boolean" && typeof stream2._removedContLen === "boolean"; - } - function isServerResponse(stream2) { - return typeof stream2._sent100 === "boolean" && isOutgoingMessage(stream2); - } - function isServerRequest(stream2) { - var _stream$req; - return typeof stream2._consuming === "boolean" && typeof stream2._dumped === "boolean" && ((_stream$req = stream2.req) === null || _stream$req === void 0 ? void 0 : _stream$req.upgradeOrConnect) === void 0; - } - function willEmitClose(stream2) { - if (!isNodeStream(stream2)) return null; - const wState = stream2._writableState; - const rState = stream2._readableState; - const state = wState || rState; - return !state && isServerResponse(stream2) || !!(state && state.autoDestroy && state.emitClose && state.closed === false); - } - function isDisturbed(stream2) { - var _stream$kIsDisturbed; - return !!(stream2 && ((_stream$kIsDisturbed = stream2[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 ? _stream$kIsDisturbed : stream2.readableDidRead || stream2.readableAborted)); - } - function isErrored(stream2) { - var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4; - return !!(stream2 && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream2[kIsErrored]) !== null && _stream$kIsErrored !== void 0 ? _stream$kIsErrored : stream2.readableErrored) !== null && _ref5 !== void 0 ? _ref5 : stream2.writableErrored) !== null && _ref4 !== void 0 ? _ref4 : (_stream$_readableStat3 = stream2._readableState) === null || _stream$_readableStat3 === void 0 ? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 ? _ref3 : (_stream$_writableStat3 = stream2._writableState) === null || _stream$_writableStat3 === void 0 ? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 ? _ref2 : (_stream$_readableStat4 = stream2._readableState) === null || _stream$_readableStat4 === void 0 ? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 ? _ref : (_stream$_writableStat4 = stream2._writableState) === null || _stream$_writableStat4 === void 0 ? void 0 : _stream$_writableStat4.errored)); - } - module2.exports = { - isDestroyed, - kIsDestroyed, - isDisturbed, - kIsDisturbed, - isErrored, - kIsErrored, - isReadable, - kIsReadable, - kIsClosedPromise, - kControllerErrorFunction, - kIsWritable, - isClosed, - isDuplexNodeStream, - isFinished, - isIterable, - isReadableNodeStream, - isReadableStream, - isReadableEnded, - isReadableFinished, - isReadableErrored, - isNodeStream, - isWebStream, - isWritable, - isWritableNodeStream, - isWritableStream, - isWritableEnded, - isWritableFinished, - isWritableErrored, - isServerRequest, - isServerResponse, - willEmitClose, - isTransformStream - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/end-of-stream.js -var require_end_of_stream = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) { - "use strict"; - var process2 = require_process(); - var { AbortError, codes } = require_errors4(); - var { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes; - var { kEmptyObject, once } = require_util13(); - var { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require_validators(); - var { Promise: Promise2, PromisePrototypeThen, SymbolDispose } = require_primordials(); - var { - isClosed, - isReadable, - isReadableNodeStream, - isReadableStream, - isReadableFinished, - isReadableErrored, - isWritable, - isWritableNodeStream, - isWritableStream, - isWritableFinished, - isWritableErrored, - isNodeStream, - willEmitClose: _willEmitClose, - kIsClosedPromise - } = require_utils7(); - var addAbortListener; - function isRequest(stream2) { - return stream2.setHeader && typeof stream2.abort === "function"; - } - var nop = () => { - }; - function eos(stream2, options, callback) { - var _options$readable, _options$writable; - if (arguments.length === 2) { - callback = options; - options = kEmptyObject; - } else if (options == null) { - options = kEmptyObject; - } else { - validateObject(options, "options"); - } - validateFunction(callback, "callback"); - validateAbortSignal(options.signal, "options.signal"); - callback = once(callback); - if (isReadableStream(stream2) || isWritableStream(stream2)) { - return eosWeb(stream2, options, callback); - } - if (!isNodeStream(stream2)) { - throw new ERR_INVALID_ARG_TYPE("stream", ["ReadableStream", "WritableStream", "Stream"], stream2); - } - const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 ? _options$readable : isReadableNodeStream(stream2); - const writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 ? _options$writable : isWritableNodeStream(stream2); - const wState = stream2._writableState; - const rState = stream2._readableState; - const onlegacyfinish = () => { - if (!stream2.writable) { - onfinish(); - } - }; - let willEmitClose = _willEmitClose(stream2) && isReadableNodeStream(stream2) === readable && isWritableNodeStream(stream2) === writable; - let writableFinished = isWritableFinished(stream2, false); - const onfinish = () => { - writableFinished = true; - if (stream2.destroyed) { - willEmitClose = false; - } - if (willEmitClose && (!stream2.readable || readable)) { - return; - } - if (!readable || readableFinished) { - callback.call(stream2); - } - }; - let readableFinished = isReadableFinished(stream2, false); - const onend = () => { - readableFinished = true; - if (stream2.destroyed) { - willEmitClose = false; - } - if (willEmitClose && (!stream2.writable || writable)) { - return; - } - if (!writable || writableFinished) { - callback.call(stream2); - } - }; - const onerror = (err) => { - callback.call(stream2, err); - }; - let closed = isClosed(stream2); - const onclose = () => { - closed = true; - const errored = isWritableErrored(stream2) || isReadableErrored(stream2); - if (errored && typeof errored !== "boolean") { - return callback.call(stream2, errored); - } - if (readable && !readableFinished && isReadableNodeStream(stream2, true)) { - if (!isReadableFinished(stream2, false)) return callback.call(stream2, new ERR_STREAM_PREMATURE_CLOSE()); - } - if (writable && !writableFinished) { - if (!isWritableFinished(stream2, false)) return callback.call(stream2, new ERR_STREAM_PREMATURE_CLOSE()); - } - callback.call(stream2); - }; - const onclosed = () => { - closed = true; - const errored = isWritableErrored(stream2) || isReadableErrored(stream2); - if (errored && typeof errored !== "boolean") { - return callback.call(stream2, errored); - } - callback.call(stream2); - }; - const onrequest = () => { - stream2.req.on("finish", onfinish); - }; - if (isRequest(stream2)) { - stream2.on("complete", onfinish); - if (!willEmitClose) { - stream2.on("abort", onclose); - } - if (stream2.req) { - onrequest(); - } else { - stream2.on("request", onrequest); - } - } else if (writable && !wState) { - stream2.on("end", onlegacyfinish); - stream2.on("close", onlegacyfinish); - } - if (!willEmitClose && typeof stream2.aborted === "boolean") { - stream2.on("aborted", onclose); - } - stream2.on("end", onend); - stream2.on("finish", onfinish); - if (options.error !== false) { - stream2.on("error", onerror); - } - stream2.on("close", onclose); - if (closed) { - process2.nextTick(onclose); - } else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) { - if (!willEmitClose) { - process2.nextTick(onclosed); - } - } else if (!readable && (!willEmitClose || isReadable(stream2)) && (writableFinished || isWritable(stream2) === false)) { - process2.nextTick(onclosed); - } else if (!writable && (!willEmitClose || isWritable(stream2)) && (readableFinished || isReadable(stream2) === false)) { - process2.nextTick(onclosed); - } else if (rState && stream2.req && stream2.aborted) { - process2.nextTick(onclosed); - } - const cleanup = () => { - callback = nop; - stream2.removeListener("aborted", onclose); - stream2.removeListener("complete", onfinish); - stream2.removeListener("abort", onclose); - stream2.removeListener("request", onrequest); - if (stream2.req) stream2.req.removeListener("finish", onfinish); - stream2.removeListener("end", onlegacyfinish); - stream2.removeListener("close", onlegacyfinish); - stream2.removeListener("finish", onfinish); - stream2.removeListener("end", onend); - stream2.removeListener("error", onerror); - stream2.removeListener("close", onclose); - }; - if (options.signal && !closed) { - const abort = () => { - const endCallback = callback; - cleanup(); - endCallback.call( - stream2, - new AbortError(void 0, { - cause: options.signal.reason - }) - ); - }; - if (options.signal.aborted) { - process2.nextTick(abort); - } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; - const disposable = addAbortListener(options.signal, abort); - const originalCallback = callback; - callback = once((...args) => { - disposable[SymbolDispose](); - originalCallback.apply(stream2, args); - }); - } - } - return cleanup; - } - function eosWeb(stream2, options, callback) { - let isAborted = false; - let abort = nop; - if (options.signal) { - abort = () => { - isAborted = true; - callback.call( - stream2, - new AbortError(void 0, { - cause: options.signal.reason - }) - ); - }; - if (options.signal.aborted) { - process2.nextTick(abort); - } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; - const disposable = addAbortListener(options.signal, abort); - const originalCallback = callback; - callback = once((...args) => { - disposable[SymbolDispose](); - originalCallback.apply(stream2, args); - }); - } - } - const resolverFn = (...args) => { - if (!isAborted) { - process2.nextTick(() => callback.apply(stream2, args)); - } - }; - PromisePrototypeThen(stream2[kIsClosedPromise].promise, resolverFn, resolverFn); - return nop; - } - function finished(stream2, opts) { - var _opts; - let autoCleanup = false; - if (opts === null) { - opts = kEmptyObject; - } - if ((_opts = opts) !== null && _opts !== void 0 && _opts.cleanup) { - validateBoolean(opts.cleanup, "cleanup"); - autoCleanup = opts.cleanup; - } - return new Promise2((resolve14, reject) => { - const cleanup = eos(stream2, opts, (err) => { - if (autoCleanup) { - cleanup(); - } - if (err) { - reject(err); - } else { - resolve14(); - } - }); - }); - } - module2.exports = eos; - module2.exports.finished = finished; - } -}); - -// node_modules/readable-stream/lib/internal/streams/destroy.js -var require_destroy2 = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) { - "use strict"; - var process2 = require_process(); - var { - aggregateTwoErrors, - codes: { ERR_MULTIPLE_CALLBACK }, - AbortError - } = require_errors4(); - var { Symbol: Symbol2 } = require_primordials(); - var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils7(); - var kDestroy = Symbol2("kDestroy"); - var kConstruct = Symbol2("kConstruct"); - function checkError(err, w, r) { - if (err) { - err.stack; - if (w && !w.errored) { - w.errored = err; - } - if (r && !r.errored) { - r.errored = err; - } - } - } - function destroy(err, cb) { - const r = this._readableState; - const w = this._writableState; - const s = w || r; - if (w !== null && w !== void 0 && w.destroyed || r !== null && r !== void 0 && r.destroyed) { - if (typeof cb === "function") { - cb(); - } - return this; - } - checkError(err, w, r); - if (w) { - w.destroyed = true; - } - if (r) { - r.destroyed = true; - } - if (!s.constructed) { - this.once(kDestroy, function(er) { - _destroy(this, aggregateTwoErrors(er, err), cb); - }); - } else { - _destroy(this, err, cb); - } - return this; - } - function _destroy(self2, err, cb) { - let called = false; - function onDestroy(err2) { - if (called) { - return; - } - called = true; - const r = self2._readableState; - const w = self2._writableState; - checkError(err2, w, r); - if (w) { - w.closed = true; - } - if (r) { - r.closed = true; - } - if (typeof cb === "function") { - cb(err2); - } - if (err2) { - process2.nextTick(emitErrorCloseNT, self2, err2); - } else { - process2.nextTick(emitCloseNT, self2); - } - } - try { - self2._destroy(err || null, onDestroy); - } catch (err2) { - onDestroy(err2); - } - } - function emitErrorCloseNT(self2, err) { - emitErrorNT(self2, err); - emitCloseNT(self2); - } - function emitCloseNT(self2) { - const r = self2._readableState; - const w = self2._writableState; - if (w) { - w.closeEmitted = true; - } - if (r) { - r.closeEmitted = true; - } - if (w !== null && w !== void 0 && w.emitClose || r !== null && r !== void 0 && r.emitClose) { - self2.emit("close"); - } - } - function emitErrorNT(self2, err) { - const r = self2._readableState; - const w = self2._writableState; - if (w !== null && w !== void 0 && w.errorEmitted || r !== null && r !== void 0 && r.errorEmitted) { - return; - } - if (w) { - w.errorEmitted = true; - } - if (r) { - r.errorEmitted = true; - } - self2.emit("error", err); - } - function undestroy() { - const r = this._readableState; - const w = this._writableState; - if (r) { - r.constructed = true; - r.closed = false; - r.closeEmitted = false; - r.destroyed = false; - r.errored = null; - r.errorEmitted = false; - r.reading = false; - r.ended = r.readable === false; - r.endEmitted = r.readable === false; - } - if (w) { - w.constructed = true; - w.destroyed = false; - w.closed = false; - w.closeEmitted = false; - w.errored = null; - w.errorEmitted = false; - w.finalCalled = false; - w.prefinished = false; - w.ended = w.writable === false; - w.ending = w.writable === false; - w.finished = w.writable === false; - } - } - function errorOrDestroy(stream2, err, sync) { - const r = stream2._readableState; - const w = stream2._writableState; - if (w !== null && w !== void 0 && w.destroyed || r !== null && r !== void 0 && r.destroyed) { - return this; - } - if (r !== null && r !== void 0 && r.autoDestroy || w !== null && w !== void 0 && w.autoDestroy) - stream2.destroy(err); - else if (err) { - err.stack; - if (w && !w.errored) { - w.errored = err; - } - if (r && !r.errored) { - r.errored = err; - } - if (sync) { - process2.nextTick(emitErrorNT, stream2, err); - } else { - emitErrorNT(stream2, err); - } - } - } - function construct(stream2, cb) { - if (typeof stream2._construct !== "function") { - return; - } - const r = stream2._readableState; - const w = stream2._writableState; - if (r) { - r.constructed = false; - } - if (w) { - w.constructed = false; - } - stream2.once(kConstruct, cb); - if (stream2.listenerCount(kConstruct) > 1) { - return; - } - process2.nextTick(constructNT, stream2); - } - function constructNT(stream2) { - let called = false; - function onConstruct(err) { - if (called) { - errorOrDestroy(stream2, err !== null && err !== void 0 ? err : new ERR_MULTIPLE_CALLBACK()); - return; - } - called = true; - const r = stream2._readableState; - const w = stream2._writableState; - const s = w || r; - if (r) { - r.constructed = true; - } - if (w) { - w.constructed = true; - } - if (s.destroyed) { - stream2.emit(kDestroy, err); - } else if (err) { - errorOrDestroy(stream2, err, true); - } else { - process2.nextTick(emitConstructNT, stream2); - } - } - try { - stream2._construct((err) => { - process2.nextTick(onConstruct, err); - }); - } catch (err) { - process2.nextTick(onConstruct, err); - } - } - function emitConstructNT(stream2) { - stream2.emit(kConstruct); - } - function isRequest(stream2) { - return (stream2 === null || stream2 === void 0 ? void 0 : stream2.setHeader) && typeof stream2.abort === "function"; - } - function emitCloseLegacy(stream2) { - stream2.emit("close"); - } - function emitErrorCloseLegacy(stream2, err) { - stream2.emit("error", err); - process2.nextTick(emitCloseLegacy, stream2); - } - function destroyer(stream2, err) { - if (!stream2 || isDestroyed(stream2)) { - return; - } - if (!err && !isFinished(stream2)) { - err = new AbortError(); - } - if (isServerRequest(stream2)) { - stream2.socket = null; - stream2.destroy(err); - } else if (isRequest(stream2)) { - stream2.abort(); - } else if (isRequest(stream2.req)) { - stream2.req.abort(); - } else if (typeof stream2.destroy === "function") { - stream2.destroy(err); - } else if (typeof stream2.close === "function") { - stream2.close(); - } else if (err) { - process2.nextTick(emitErrorCloseLegacy, stream2, err); - } else { - process2.nextTick(emitCloseLegacy, stream2); - } - if (!stream2.destroyed) { - stream2[kIsDestroyed] = true; - } - } - module2.exports = { - construct, - destroyer, - destroy, - undestroy, - errorOrDestroy - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/legacy.js -var require_legacy = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/legacy.js"(exports2, module2) { - "use strict"; - var { ArrayIsArray, ObjectSetPrototypeOf } = require_primordials(); - var { EventEmitter: EE } = require("events"); - function Stream(opts) { - EE.call(this, opts); - } - ObjectSetPrototypeOf(Stream.prototype, EE.prototype); - ObjectSetPrototypeOf(Stream, EE); - Stream.prototype.pipe = function(dest, options) { - const source = this; - function ondata(chunk) { - if (dest.writable && dest.write(chunk) === false && source.pause) { - source.pause(); - } - } - source.on("data", ondata); - function ondrain() { - if (source.readable && source.resume) { - source.resume(); - } - } - dest.on("drain", ondrain); - if (!dest._isStdio && (!options || options.end !== false)) { - source.on("end", onend); - source.on("close", onclose); - } - let didOnEnd = false; - function onend() { - if (didOnEnd) return; - didOnEnd = true; - dest.end(); - } - function onclose() { - if (didOnEnd) return; - didOnEnd = true; - if (typeof dest.destroy === "function") dest.destroy(); - } - function onerror(er) { - cleanup(); - if (EE.listenerCount(this, "error") === 0) { - this.emit("error", er); - } - } - prependListener(source, "error", onerror); - prependListener(dest, "error", onerror); - function cleanup() { - source.removeListener("data", ondata); - dest.removeListener("drain", ondrain); - source.removeListener("end", onend); - source.removeListener("close", onclose); - source.removeListener("error", onerror); - dest.removeListener("error", onerror); - source.removeListener("end", cleanup); - source.removeListener("close", cleanup); - dest.removeListener("close", cleanup); - } - source.on("end", cleanup); - source.on("close", cleanup); - dest.on("close", cleanup); - dest.emit("pipe", source); - return dest; - }; - function prependListener(emitter, event, fn) { - if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); - else if (ArrayIsArray(emitter._events[event])) emitter._events[event].unshift(fn); - else emitter._events[event] = [fn, emitter._events[event]]; - } - module2.exports = { - Stream, - prependListener - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/add-abort-signal.js -var require_add_abort_signal = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/add-abort-signal.js"(exports2, module2) { - "use strict"; - var { SymbolDispose } = require_primordials(); - var { AbortError, codes } = require_errors4(); - var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils7(); - var eos = require_end_of_stream(); - var { ERR_INVALID_ARG_TYPE } = codes; - var addAbortListener; - var validateAbortSignal = (signal, name) => { - if (typeof signal !== "object" || !("aborted" in signal)) { - throw new ERR_INVALID_ARG_TYPE(name, "AbortSignal", signal); - } - }; - module2.exports.addAbortSignal = function addAbortSignal(signal, stream2) { - validateAbortSignal(signal, "signal"); - if (!isNodeStream(stream2) && !isWebStream(stream2)) { - throw new ERR_INVALID_ARG_TYPE("stream", ["ReadableStream", "WritableStream", "Stream"], stream2); - } - return module2.exports.addAbortSignalNoValidate(signal, stream2); - }; - module2.exports.addAbortSignalNoValidate = function(signal, stream2) { - if (typeof signal !== "object" || !("aborted" in signal)) { - return stream2; - } - const onAbort = isNodeStream(stream2) ? () => { - stream2.destroy( - new AbortError(void 0, { - cause: signal.reason - }) - ); - } : () => { - stream2[kControllerErrorFunction]( - new AbortError(void 0, { - cause: signal.reason - }) - ); - }; - if (signal.aborted) { - onAbort(); - } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; - const disposable = addAbortListener(signal, onAbort); - eos(stream2, disposable[SymbolDispose]); - } - return stream2; - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/buffer_list.js -var require_buffer_list = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module2) { - "use strict"; - var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials(); - var { Buffer: Buffer2 } = require("buffer"); - var { inspect } = require_util13(); - module2.exports = class BufferList { - constructor() { - this.head = null; - this.tail = null; - this.length = 0; - } - push(v) { - const entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry; - else this.head = entry; - this.tail = entry; - ++this.length; - } - unshift(v) { - const entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - shift() { - if (this.length === 0) return; - const ret = this.head.data; - if (this.length === 1) this.head = this.tail = null; - else this.head = this.head.next; - --this.length; - return ret; - } - clear() { - this.head = this.tail = null; - this.length = 0; - } - join(s) { - if (this.length === 0) return ""; - let p = this.head; - let ret = "" + p.data; - while ((p = p.next) !== null) ret += s + p.data; - return ret; - } - concat(n) { - if (this.length === 0) return Buffer2.alloc(0); - const ret = Buffer2.allocUnsafe(n >>> 0); - let p = this.head; - let i = 0; - while (p) { - TypedArrayPrototypeSet(ret, p.data, i); - i += p.data.length; - p = p.next; - } - return ret; - } - // Consumes a specified amount of bytes or characters from the buffered data. - consume(n, hasStrings) { - const data = this.head.data; - if (n < data.length) { - const slice = data.slice(0, n); - this.head.data = data.slice(n); - return slice; - } - if (n === data.length) { - return this.shift(); - } - return hasStrings ? this._getString(n) : this._getBuffer(n); - } - first() { - return this.head.data; - } - *[SymbolIterator]() { - for (let p = this.head; p; p = p.next) { - yield p.data; - } - } - // Consumes a specified amount of characters from the buffered data. - _getString(n) { - let ret = ""; - let p = this.head; - let c = 0; - do { - const str = p.data; - if (n > str.length) { - ret += str; - n -= str.length; - } else { - if (n === str.length) { - ret += str; - ++c; - if (p.next) this.head = p.next; - else this.head = this.tail = null; - } else { - ret += StringPrototypeSlice(str, 0, n); - this.head = p; - p.data = StringPrototypeSlice(str, n); - } - break; - } - ++c; - } while ((p = p.next) !== null); - this.length -= c; - return ret; - } - // Consumes a specified amount of bytes from the buffered data. - _getBuffer(n) { - const ret = Buffer2.allocUnsafe(n); - const retLen = n; - let p = this.head; - let c = 0; - do { - const buf = p.data; - if (n > buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n); - n -= buf.length; - } else { - if (n === buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n); - ++c; - if (p.next) this.head = p.next; - else this.head = this.tail = null; - } else { - TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n), retLen - n); - this.head = p; - p.data = buf.slice(n); - } - break; - } - ++c; - } while ((p = p.next) !== null); - this.length -= c; - return ret; - } - // Make sure the linked list only shows the minimal necessary information. - [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_2, options) { - return inspect(this, { - ...options, - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - }); - } - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/state.js -var require_state3 = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/state.js"(exports2, module2) { - "use strict"; - var { MathFloor, NumberIsInteger } = require_primordials(); - var { validateInteger } = require_validators(); - var { ERR_INVALID_ARG_VALUE } = require_errors4().codes; - var defaultHighWaterMarkBytes = 16 * 1024; - var defaultHighWaterMarkObjectMode = 16; - function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; - } - function getDefaultHighWaterMark(objectMode) { - return objectMode ? defaultHighWaterMarkObjectMode : defaultHighWaterMarkBytes; - } - function setDefaultHighWaterMark(objectMode, value) { - validateInteger(value, "value", 0); - if (objectMode) { - defaultHighWaterMarkObjectMode = value; - } else { - defaultHighWaterMarkBytes = value; - } - } - function getHighWaterMark(state, options, duplexKey, isDuplex) { - const hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - if (hwm != null) { - if (!NumberIsInteger(hwm) || hwm < 0) { - const name = isDuplex ? `options.${duplexKey}` : "options.highWaterMark"; - throw new ERR_INVALID_ARG_VALUE(name, hwm); - } - return MathFloor(hwm); - } - return getDefaultHighWaterMark(state.objectMode); - } - module2.exports = { - getHighWaterMark, - getDefaultHighWaterMark, - setDefaultHighWaterMark - }; - } -}); - -// node_modules/safe-buffer/index.js -var require_safe_buffer2 = __commonJS({ - "node_modules/safe-buffer/index.js"(exports2, module2) { - var buffer = require("buffer"); - var Buffer2 = buffer.Buffer; - function copyProps(src, dst) { - for (var key in src) { - dst[key] = src[key]; - } - } - if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { - module2.exports = buffer; - } else { - copyProps(buffer, exports2); - exports2.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer2(arg, encodingOrOffset, length); - } - SafeBuffer.prototype = Object.create(Buffer2.prototype); - copyProps(Buffer2, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); - } - return Buffer2(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function(size, fill, encoding) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - var buf = Buffer2(size); - if (fill !== void 0) { - if (typeof encoding === "string") { - buf.fill(fill, encoding); - } else { - buf.fill(fill); - } - } else { - buf.fill(0); - } - return buf; - }; - SafeBuffer.allocUnsafe = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return Buffer2(size); - }; - SafeBuffer.allocUnsafeSlow = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return buffer.SlowBuffer(size); - }; - } -}); - -// node_modules/string_decoder/lib/string_decoder.js -var require_string_decoder2 = __commonJS({ - "node_modules/string_decoder/lib/string_decoder.js"(exports2) { - "use strict"; - var Buffer2 = require_safe_buffer2().Buffer; - var isEncoding = Buffer2.isEncoding || function(encoding) { - encoding = "" + encoding; - switch (encoding && encoding.toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - case "raw": - return true; - default: - return false; - } - }; - function _normalizeEncoding(enc) { - if (!enc) return "utf8"; - var retried; - while (true) { - switch (enc) { - case "utf8": - case "utf-8": - return "utf8"; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return "utf16le"; - case "latin1": - case "binary": - return "latin1"; - case "base64": - case "ascii": - case "hex": - return enc; - default: - if (retried) return; - enc = ("" + enc).toLowerCase(); - retried = true; - } - } - } - function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); - return nenc || enc; - } - exports2.StringDecoder = StringDecoder; - function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case "utf16le": - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case "utf8": - this.fillLast = utf8FillLast; - nb = 4; - break; - case "base64": - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer2.allocUnsafe(nb); - } - StringDecoder.prototype.write = function(buf) { - if (buf.length === 0) return ""; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === void 0) return ""; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ""; - }; - StringDecoder.prototype.end = utf8End; - StringDecoder.prototype.text = utf8Text; - StringDecoder.prototype.fillLast = function(buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; - }; - function utf8CheckByte(byte) { - if (byte <= 127) return 0; - else if (byte >> 5 === 6) return 2; - else if (byte >> 4 === 14) return 3; - else if (byte >> 3 === 30) return 4; - return byte >> 6 === 2 ? -1 : -2; - } - function utf8CheckIncomplete(self2, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self2.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self2.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0; - else self2.lastNeed = nb - 3; - } - return nb; - } - return 0; - } - function utf8CheckExtraBytes(self2, buf, p) { - if ((buf[0] & 192) !== 128) { - self2.lastNeed = 0; - return "\uFFFD"; - } - if (self2.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 192) !== 128) { - self2.lastNeed = 1; - return "\uFFFD"; - } - if (self2.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 192) !== 128) { - self2.lastNeed = 2; - return "\uFFFD"; - } - } - } - } - function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== void 0) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; - } - function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString("utf8", i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString("utf8", i, end); - } - function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) return r + "\uFFFD"; - return r; - } - function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString("utf16le", i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 55296 && c <= 56319) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString("utf16le", i, buf.length - 1); - } - function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString("utf16le", 0, end); - } - return r; - } - function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString("base64", i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString("base64", i, buf.length - n); - } - function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed); - return r; - } - function simpleWrite(buf) { - return buf.toString(this.encoding); - } - function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ""; - } - } -}); - -// node_modules/readable-stream/lib/internal/streams/from.js -var require_from = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) { - "use strict"; - var process2 = require_process(); - var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(); - var { Buffer: Buffer2 } = require("buffer"); - var { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require_errors4().codes; - function from(Readable3, iterable, opts) { - let iterator2; - if (typeof iterable === "string" || iterable instanceof Buffer2) { - return new Readable3({ - objectMode: true, - ...opts, - read() { - this.push(iterable); - this.push(null); - } - }); - } - let isAsync; - if (iterable && iterable[SymbolAsyncIterator]) { - isAsync = true; - iterator2 = iterable[SymbolAsyncIterator](); - } else if (iterable && iterable[SymbolIterator]) { - isAsync = false; - iterator2 = iterable[SymbolIterator](); - } else { - throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); - } - const readable = new Readable3({ - objectMode: true, - highWaterMark: 1, - // TODO(ronag): What options should be allowed? - ...opts - }); - let reading = false; - readable._read = function() { - if (!reading) { - reading = true; - next(); - } - }; - readable._destroy = function(error3, cb) { - PromisePrototypeThen( - close(error3), - () => process2.nextTick(cb, error3), - // nextTick is here in case cb throws - (e) => process2.nextTick(cb, e || error3) - ); - }; - async function close(error3) { - const hadError = error3 !== void 0 && error3 !== null; - const hasThrow = typeof iterator2.throw === "function"; - if (hadError && hasThrow) { - const { value, done } = await iterator2.throw(error3); - await value; - if (done) { - return; - } - } - if (typeof iterator2.return === "function") { - const { value } = await iterator2.return(); - await value; - } - } - async function next() { - for (; ; ) { - try { - const { value, done } = isAsync ? await iterator2.next() : iterator2.next(); - if (done) { - readable.push(null); - } else { - const res = value && typeof value.then === "function" ? await value : value; - if (res === null) { - reading = false; - throw new ERR_STREAM_NULL_VALUES(); - } else if (readable.push(res)) { - continue; - } else { - reading = false; - } - } - } catch (err) { - readable.destroy(err); - } - break; - } - } - return readable; - } - module2.exports = from; - } -}); - -// node_modules/readable-stream/lib/internal/streams/readable.js -var require_readable3 = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/readable.js"(exports2, module2) { - "use strict"; - var process2 = require_process(); - var { - ArrayPrototypeIndexOf, - NumberIsInteger, - NumberIsNaN, - NumberParseInt, - ObjectDefineProperties, - ObjectKeys, - ObjectSetPrototypeOf, - Promise: Promise2, - SafeSet, - SymbolAsyncDispose, - SymbolAsyncIterator, - Symbol: Symbol2 - } = require_primordials(); - module2.exports = Readable3; - Readable3.ReadableState = ReadableState; - var { EventEmitter: EE } = require("events"); - var { Stream, prependListener } = require_legacy(); - var { Buffer: Buffer2 } = require("buffer"); - var { addAbortSignal } = require_add_abort_signal(); - var eos = require_end_of_stream(); - var debug6 = require_util13().debuglog("stream", (fn) => { - debug6 = fn; - }); - var BufferList = require_buffer_list(); - var destroyImpl = require_destroy2(); - var { getHighWaterMark, getDefaultHighWaterMark } = require_state3(); - var { - aggregateTwoErrors, - codes: { - ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED, - ERR_OUT_OF_RANGE, - ERR_STREAM_PUSH_AFTER_EOF, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT - }, - AbortError - } = require_errors4(); - var { validateObject } = require_validators(); - var kPaused = Symbol2("kPaused"); - var { StringDecoder } = require_string_decoder2(); - var from = require_from(); - ObjectSetPrototypeOf(Readable3.prototype, Stream.prototype); - ObjectSetPrototypeOf(Readable3, Stream); - var nop = () => { - }; - var { errorOrDestroy } = destroyImpl; - var kObjectMode = 1 << 0; - var kEnded = 1 << 1; - var kEndEmitted = 1 << 2; - var kReading = 1 << 3; - var kConstructed = 1 << 4; - var kSync = 1 << 5; - var kNeedReadable = 1 << 6; - var kEmittedReadable = 1 << 7; - var kReadableListening = 1 << 8; - var kResumeScheduled = 1 << 9; - var kErrorEmitted = 1 << 10; - var kEmitClose = 1 << 11; - var kAutoDestroy = 1 << 12; - var kDestroyed = 1 << 13; - var kClosed = 1 << 14; - var kCloseEmitted = 1 << 15; - var kMultiAwaitDrain = 1 << 16; - var kReadingMore = 1 << 17; - var kDataEmitted = 1 << 18; - function makeBitMapDescriptor(bit) { - return { - enumerable: false, - get() { - return (this.state & bit) !== 0; - }, - set(value) { - if (value) this.state |= bit; - else this.state &= ~bit; - } - }; - } - ObjectDefineProperties(ReadableState.prototype, { - objectMode: makeBitMapDescriptor(kObjectMode), - ended: makeBitMapDescriptor(kEnded), - endEmitted: makeBitMapDescriptor(kEndEmitted), - reading: makeBitMapDescriptor(kReading), - // Stream is still being constructed and cannot be - // destroyed until construction finished or failed. - // Async construction is opt in, therefore we start as - // constructed. - constructed: makeBitMapDescriptor(kConstructed), - // A flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - sync: makeBitMapDescriptor(kSync), - // Whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - needReadable: makeBitMapDescriptor(kNeedReadable), - emittedReadable: makeBitMapDescriptor(kEmittedReadable), - readableListening: makeBitMapDescriptor(kReadableListening), - resumeScheduled: makeBitMapDescriptor(kResumeScheduled), - // True if the error was already emitted and should not be thrown again. - errorEmitted: makeBitMapDescriptor(kErrorEmitted), - emitClose: makeBitMapDescriptor(kEmitClose), - autoDestroy: makeBitMapDescriptor(kAutoDestroy), - // Has it been destroyed. - destroyed: makeBitMapDescriptor(kDestroyed), - // Indicates whether the stream has finished destroying. - closed: makeBitMapDescriptor(kClosed), - // True if close has been emitted or would have been emitted - // depending on emitClose. - closeEmitted: makeBitMapDescriptor(kCloseEmitted), - multiAwaitDrain: makeBitMapDescriptor(kMultiAwaitDrain), - // If true, a maybeReadMore has been scheduled. - readingMore: makeBitMapDescriptor(kReadingMore), - dataEmitted: makeBitMapDescriptor(kDataEmitted) - }); - function ReadableState(options, stream2, isDuplex) { - if (typeof isDuplex !== "boolean") isDuplex = stream2 instanceof require_duplex(); - this.state = kEmitClose | kAutoDestroy | kConstructed | kSync; - if (options && options.objectMode) this.state |= kObjectMode; - if (isDuplex && options && options.readableObjectMode) this.state |= kObjectMode; - this.highWaterMark = options ? getHighWaterMark(this, options, "readableHighWaterMark", isDuplex) : getDefaultHighWaterMark(false); - this.buffer = new BufferList(); - this.length = 0; - this.pipes = []; - this.flowing = null; - this[kPaused] = null; - if (options && options.emitClose === false) this.state &= ~kEmitClose; - if (options && options.autoDestroy === false) this.state &= ~kAutoDestroy; - this.errored = null; - this.defaultEncoding = options && options.defaultEncoding || "utf8"; - this.awaitDrainWriters = null; - this.decoder = null; - this.encoding = null; - if (options && options.encoding) { - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } - } - function Readable3(options) { - if (!(this instanceof Readable3)) return new Readable3(options); - const isDuplex = this instanceof require_duplex(); - this._readableState = new ReadableState(options, this, isDuplex); - if (options) { - if (typeof options.read === "function") this._read = options.read; - if (typeof options.destroy === "function") this._destroy = options.destroy; - if (typeof options.construct === "function") this._construct = options.construct; - if (options.signal && !isDuplex) addAbortSignal(options.signal, this); - } - Stream.call(this, options); - destroyImpl.construct(this, () => { - if (this._readableState.needReadable) { - maybeReadMore(this, this._readableState); - } - }); - } - Readable3.prototype.destroy = destroyImpl.destroy; - Readable3.prototype._undestroy = destroyImpl.undestroy; - Readable3.prototype._destroy = function(err, cb) { - cb(err); - }; - Readable3.prototype[EE.captureRejectionSymbol] = function(err) { - this.destroy(err); - }; - Readable3.prototype[SymbolAsyncDispose] = function() { - let error3; - if (!this.destroyed) { - error3 = this.readableEnded ? null : new AbortError(); - this.destroy(error3); - } - return new Promise2((resolve14, reject) => eos(this, (err) => err && err !== error3 ? reject(err) : resolve14(null))); - }; - Readable3.prototype.push = function(chunk, encoding) { - return readableAddChunk(this, chunk, encoding, false); - }; - Readable3.prototype.unshift = function(chunk, encoding) { - return readableAddChunk(this, chunk, encoding, true); - }; - function readableAddChunk(stream2, chunk, encoding, addToFront) { - debug6("readableAddChunk", chunk); - const state = stream2._readableState; - let err; - if ((state.state & kObjectMode) === 0) { - if (typeof chunk === "string") { - encoding = encoding || state.defaultEncoding; - if (state.encoding !== encoding) { - if (addToFront && state.encoding) { - chunk = Buffer2.from(chunk, encoding).toString(state.encoding); - } else { - chunk = Buffer2.from(chunk, encoding); - encoding = ""; - } - } - } else if (chunk instanceof Buffer2) { - encoding = ""; - } else if (Stream._isUint8Array(chunk)) { - chunk = Stream._uint8ArrayToBuffer(chunk); - encoding = ""; - } else if (chunk != null) { - err = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); - } - } - if (err) { - errorOrDestroy(stream2, err); - } else if (chunk === null) { - state.state &= ~kReading; - onEofChunk(stream2, state); - } else if ((state.state & kObjectMode) !== 0 || chunk && chunk.length > 0) { - if (addToFront) { - if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream2, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); - else if (state.destroyed || state.errored) return false; - else addChunk(stream2, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream2, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed || state.errored) { - return false; - } else { - state.state &= ~kReading; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream2, state, chunk, false); - else maybeReadMore(stream2, state); - } else { - addChunk(stream2, state, chunk, false); - } - } - } else if (!addToFront) { - state.state &= ~kReading; - maybeReadMore(stream2, state); - } - return !state.ended && (state.length < state.highWaterMark || state.length === 0); - } - function addChunk(stream2, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync && stream2.listenerCount("data") > 0) { - if ((state.state & kMultiAwaitDrain) !== 0) { - state.awaitDrainWriters.clear(); - } else { - state.awaitDrainWriters = null; - } - state.dataEmitted = true; - stream2.emit("data", chunk); - } else { - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk); - else state.buffer.push(chunk); - if ((state.state & kNeedReadable) !== 0) emitReadable(stream2); - } - maybeReadMore(stream2, state); - } - Readable3.prototype.isPaused = function() { - const state = this._readableState; - return state[kPaused] === true || state.flowing === false; - }; - Readable3.prototype.setEncoding = function(enc) { - const decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; - this._readableState.encoding = this._readableState.decoder.encoding; - const buffer = this._readableState.buffer; - let content = ""; - for (const data of buffer) { - content += decoder.write(data); - } - buffer.clear(); - if (content !== "") buffer.push(content); - this._readableState.length = content.length; - return this; - }; - var MAX_HWM = 1073741824; - function computeNewHighWaterMark(n) { - if (n > MAX_HWM) { - throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n); - } else { - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; - } - function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if ((state.state & kObjectMode) !== 0) return 1; - if (NumberIsNaN(n)) { - if (state.flowing && state.length) return state.buffer.first().length; - return state.length; - } - if (n <= state.length) return n; - return state.ended ? state.length : 0; - } - Readable3.prototype.read = function(n) { - debug6("read", n); - if (n === void 0) { - n = NaN; - } else if (!NumberIsInteger(n)) { - n = NumberParseInt(n, 10); - } - const state = this._readableState; - const nOrig = n; - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n !== 0) state.state &= ~kEmittedReadable; - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug6("read: emitReadable", state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this); - else emitReadable(this); - return null; - } - n = howMuchToRead(n, state); - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - let doRead = (state.state & kNeedReadable) !== 0; - debug6("need readable", doRead); - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug6("length less than watermark", doRead); - } - if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed) { - doRead = false; - debug6("reading, ended or constructing", doRead); - } else if (doRead) { - debug6("do read"); - state.state |= kReading | kSync; - if (state.length === 0) state.state |= kNeedReadable; - try { - this._read(state.highWaterMark); - } catch (err) { - errorOrDestroy(this, err); - } - state.state &= ~kSync; - if (!state.reading) n = howMuchToRead(nOrig, state); - } - let ret; - if (n > 0) ret = fromList(n, state); - else ret = null; - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - if (state.multiAwaitDrain) { - state.awaitDrainWriters.clear(); - } else { - state.awaitDrainWriters = null; - } - } - if (state.length === 0) { - if (!state.ended) state.needReadable = true; - if (nOrig !== n && state.ended) endReadable(this); - } - if (ret !== null && !state.errorEmitted && !state.closeEmitted) { - state.dataEmitted = true; - this.emit("data", ret); - } - return ret; - }; - function onEofChunk(stream2, state) { - debug6("onEofChunk"); - if (state.ended) return; - if (state.decoder) { - const chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - if (state.sync) { - emitReadable(stream2); - } else { - state.needReadable = false; - state.emittedReadable = true; - emitReadable_(stream2); - } - } - function emitReadable(stream2) { - const state = stream2._readableState; - debug6("emitReadable", state.needReadable, state.emittedReadable); - state.needReadable = false; - if (!state.emittedReadable) { - debug6("emitReadable", state.flowing); - state.emittedReadable = true; - process2.nextTick(emitReadable_, stream2); - } - } - function emitReadable_(stream2) { - const state = stream2._readableState; - debug6("emitReadable_", state.destroyed, state.length, state.ended); - if (!state.destroyed && !state.errored && (state.length || state.ended)) { - stream2.emit("readable"); - state.emittedReadable = false; - } - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream2); - } - function maybeReadMore(stream2, state) { - if (!state.readingMore && state.constructed) { - state.readingMore = true; - process2.nextTick(maybeReadMore_, stream2, state); - } - } - function maybeReadMore_(stream2, state) { - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - const len = state.length; - debug6("maybeReadMore read 0"); - stream2.read(0); - if (len === state.length) - break; - } - state.readingMore = false; - } - Readable3.prototype._read = function(n) { - throw new ERR_METHOD_NOT_IMPLEMENTED("_read()"); - }; - Readable3.prototype.pipe = function(dest, pipeOpts) { - const src = this; - const state = this._readableState; - if (state.pipes.length === 1) { - if (!state.multiAwaitDrain) { - state.multiAwaitDrain = true; - state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters ? [state.awaitDrainWriters] : []); - } - } - state.pipes.push(dest); - debug6("pipe count=%d opts=%j", state.pipes.length, pipeOpts); - const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process2.stdout && dest !== process2.stderr; - const endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process2.nextTick(endFn); - else src.once("end", endFn); - dest.on("unpipe", onunpipe); - function onunpipe(readable, unpipeInfo) { - debug6("onunpipe"); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - function onend() { - debug6("onend"); - dest.end(); - } - let ondrain; - let cleanedUp = false; - function cleanup() { - debug6("cleanup"); - dest.removeListener("close", onclose); - dest.removeListener("finish", onfinish); - if (ondrain) { - dest.removeListener("drain", ondrain); - } - dest.removeListener("error", onerror); - dest.removeListener("unpipe", onunpipe); - src.removeListener("end", onend); - src.removeListener("end", unpipe); - src.removeListener("data", ondata); - cleanedUp = true; - if (ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - function pause() { - if (!cleanedUp) { - if (state.pipes.length === 1 && state.pipes[0] === dest) { - debug6("false write response, pause", 0); - state.awaitDrainWriters = dest; - state.multiAwaitDrain = false; - } else if (state.pipes.length > 1 && state.pipes.includes(dest)) { - debug6("false write response, pause", state.awaitDrainWriters.size); - state.awaitDrainWriters.add(dest); - } - src.pause(); - } - if (!ondrain) { - ondrain = pipeOnDrain(src, dest); - dest.on("drain", ondrain); - } - } - src.on("data", ondata); - function ondata(chunk) { - debug6("ondata"); - const ret = dest.write(chunk); - debug6("dest.write", ret); - if (ret === false) { - pause(); - } - } - function onerror(er) { - debug6("onerror", er); - unpipe(); - dest.removeListener("error", onerror); - if (dest.listenerCount("error") === 0) { - const s = dest._writableState || dest._readableState; - if (s && !s.errorEmitted) { - errorOrDestroy(dest, er); - } else { - dest.emit("error", er); - } - } - } - prependListener(dest, "error", onerror); - function onclose() { - dest.removeListener("finish", onfinish); - unpipe(); - } - dest.once("close", onclose); - function onfinish() { - debug6("onfinish"); - dest.removeListener("close", onclose); - unpipe(); - } - dest.once("finish", onfinish); - function unpipe() { - debug6("unpipe"); - src.unpipe(dest); - } - dest.emit("pipe", src); - if (dest.writableNeedDrain === true) { - pause(); - } else if (!state.flowing) { - debug6("pipe resume"); - src.resume(); - } - return dest; - }; - function pipeOnDrain(src, dest) { - return function pipeOnDrainFunctionResult() { - const state = src._readableState; - if (state.awaitDrainWriters === dest) { - debug6("pipeOnDrain", 1); - state.awaitDrainWriters = null; - } else if (state.multiAwaitDrain) { - debug6("pipeOnDrain", state.awaitDrainWriters.size); - state.awaitDrainWriters.delete(dest); - } - if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount("data")) { - src.resume(); - } - }; - } - Readable3.prototype.unpipe = function(dest) { - const state = this._readableState; - const unpipeInfo = { - hasUnpiped: false - }; - if (state.pipes.length === 0) return this; - if (!dest) { - const dests = state.pipes; - state.pipes = []; - this.pause(); - for (let i = 0; i < dests.length; i++) - dests[i].emit("unpipe", this, { - hasUnpiped: false - }); - return this; - } - const index2 = ArrayPrototypeIndexOf(state.pipes, dest); - if (index2 === -1) return this; - state.pipes.splice(index2, 1); - if (state.pipes.length === 0) this.pause(); - dest.emit("unpipe", this, unpipeInfo); - return this; - }; - Readable3.prototype.on = function(ev, fn) { - const res = Stream.prototype.on.call(this, ev, fn); - const state = this._readableState; - if (ev === "data") { - state.readableListening = this.listenerCount("readable") > 0; - if (state.flowing !== false) this.resume(); - } else if (ev === "readable") { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug6("on readable", state.length, state.reading); - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process2.nextTick(nReadingNextTick, this); - } - } - } - return res; - }; - Readable3.prototype.addListener = Readable3.prototype.on; - Readable3.prototype.removeListener = function(ev, fn) { - const res = Stream.prototype.removeListener.call(this, ev, fn); - if (ev === "readable") { - process2.nextTick(updateReadableListening, this); - } - return res; - }; - Readable3.prototype.off = Readable3.prototype.removeListener; - Readable3.prototype.removeAllListeners = function(ev) { - const res = Stream.prototype.removeAllListeners.apply(this, arguments); - if (ev === "readable" || ev === void 0) { - process2.nextTick(updateReadableListening, this); - } - return res; - }; - function updateReadableListening(self2) { - const state = self2._readableState; - state.readableListening = self2.listenerCount("readable") > 0; - if (state.resumeScheduled && state[kPaused] === false) { - state.flowing = true; - } else if (self2.listenerCount("data") > 0) { - self2.resume(); - } else if (!state.readableListening) { - state.flowing = null; - } - } - function nReadingNextTick(self2) { - debug6("readable nexttick read 0"); - self2.read(0); - } - Readable3.prototype.resume = function() { - const state = this._readableState; - if (!state.flowing) { - debug6("resume"); - state.flowing = !state.readableListening; - resume(this, state); - } - state[kPaused] = false; - return this; - }; - function resume(stream2, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process2.nextTick(resume_, stream2, state); - } - } - function resume_(stream2, state) { - debug6("resume", state.reading); - if (!state.reading) { - stream2.read(0); - } - state.resumeScheduled = false; - stream2.emit("resume"); - flow(stream2); - if (state.flowing && !state.reading) stream2.read(0); - } - Readable3.prototype.pause = function() { - debug6("call pause flowing=%j", this._readableState.flowing); - if (this._readableState.flowing !== false) { - debug6("pause"); - this._readableState.flowing = false; - this.emit("pause"); - } - this._readableState[kPaused] = true; - return this; - }; - function flow(stream2) { - const state = stream2._readableState; - debug6("flow", state.flowing); - while (state.flowing && stream2.read() !== null) ; - } - Readable3.prototype.wrap = function(stream2) { - let paused = false; - stream2.on("data", (chunk) => { - if (!this.push(chunk) && stream2.pause) { - paused = true; - stream2.pause(); - } - }); - stream2.on("end", () => { - this.push(null); - }); - stream2.on("error", (err) => { - errorOrDestroy(this, err); - }); - stream2.on("close", () => { - this.destroy(); - }); - stream2.on("destroy", () => { - this.destroy(); - }); - this._read = () => { - if (paused && stream2.resume) { - paused = false; - stream2.resume(); - } - }; - const streamKeys = ObjectKeys(stream2); - for (let j = 1; j < streamKeys.length; j++) { - const i = streamKeys[j]; - if (this[i] === void 0 && typeof stream2[i] === "function") { - this[i] = stream2[i].bind(stream2); - } - } - return this; - }; - Readable3.prototype[SymbolAsyncIterator] = function() { - return streamToAsyncIterator(this); - }; - Readable3.prototype.iterator = function(options) { - if (options !== void 0) { - validateObject(options, "options"); - } - return streamToAsyncIterator(this, options); - }; - function streamToAsyncIterator(stream2, options) { - if (typeof stream2.read !== "function") { - stream2 = Readable3.wrap(stream2, { - objectMode: true - }); - } - const iter = createAsyncIterator(stream2, options); - iter.stream = stream2; - return iter; - } - async function* createAsyncIterator(stream2, options) { - let callback = nop; - function next(resolve14) { - if (this === stream2) { - callback(); - callback = nop; - } else { - callback = resolve14; - } - } - stream2.on("readable", next); - let error3; - const cleanup = eos( - stream2, - { - writable: false - }, - (err) => { - error3 = err ? aggregateTwoErrors(error3, err) : null; - callback(); - callback = nop; - } - ); - try { - while (true) { - const chunk = stream2.destroyed ? null : stream2.read(); - if (chunk !== null) { - yield chunk; - } else if (error3) { - throw error3; - } else if (error3 === null) { - return; - } else { - await new Promise2(next); - } - } - } catch (err) { - error3 = aggregateTwoErrors(error3, err); - throw error3; - } finally { - if ((error3 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error3 === void 0 || stream2._readableState.autoDestroy)) { - destroyImpl.destroyer(stream2, null); - } else { - stream2.off("readable", next); - cleanup(); - } - } - } - ObjectDefineProperties(Readable3.prototype, { - readable: { - __proto__: null, - get() { - const r = this._readableState; - return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted; - }, - set(val) { - if (this._readableState) { - this._readableState.readable = !!val; - } - } - }, - readableDidRead: { - __proto__: null, - enumerable: false, - get: function() { - return this._readableState.dataEmitted; - } - }, - readableAborted: { - __proto__: null, - enumerable: false, - get: function() { - return !!(this._readableState.readable !== false && (this._readableState.destroyed || this._readableState.errored) && !this._readableState.endEmitted); - } - }, - readableHighWaterMark: { - __proto__: null, - enumerable: false, - get: function() { - return this._readableState.highWaterMark; - } - }, - readableBuffer: { - __proto__: null, - enumerable: false, - get: function() { - return this._readableState && this._readableState.buffer; - } - }, - readableFlowing: { - __proto__: null, - enumerable: false, - get: function() { - return this._readableState.flowing; - }, - set: function(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } - }, - readableLength: { - __proto__: null, - enumerable: false, - get() { - return this._readableState.length; - } - }, - readableObjectMode: { - __proto__: null, - enumerable: false, - get() { - return this._readableState ? this._readableState.objectMode : false; - } - }, - readableEncoding: { - __proto__: null, - enumerable: false, - get() { - return this._readableState ? this._readableState.encoding : null; - } - }, - errored: { - __proto__: null, - enumerable: false, - get() { - return this._readableState ? this._readableState.errored : null; - } - }, - closed: { - __proto__: null, - get() { - return this._readableState ? this._readableState.closed : false; - } - }, - destroyed: { - __proto__: null, - enumerable: false, - get() { - return this._readableState ? this._readableState.destroyed : false; - }, - set(value) { - if (!this._readableState) { - return; - } - this._readableState.destroyed = value; - } - }, - readableEnded: { - __proto__: null, - enumerable: false, - get() { - return this._readableState ? this._readableState.endEmitted : false; - } - } - }); - ObjectDefineProperties(ReadableState.prototype, { - // Legacy getter for `pipesCount`. - pipesCount: { - __proto__: null, - get() { - return this.pipes.length; - } - }, - // Legacy property for `paused`. - paused: { - __proto__: null, - get() { - return this[kPaused] !== false; - }, - set(value) { - this[kPaused] = !!value; - } - } - }); - Readable3._fromList = fromList; - function fromList(n, state) { - if (state.length === 0) return null; - let ret; - if (state.objectMode) ret = state.buffer.shift(); - else if (!n || n >= state.length) { - if (state.decoder) ret = state.buffer.join(""); - else if (state.buffer.length === 1) ret = state.buffer.first(); - else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - ret = state.buffer.consume(n, state.decoder); - } - return ret; - } - function endReadable(stream2) { - const state = stream2._readableState; - debug6("endReadable", state.endEmitted); - if (!state.endEmitted) { - state.ended = true; - process2.nextTick(endReadableNT, state, stream2); - } - } - function endReadableNT(state, stream2) { - debug6("endReadableNT", state.endEmitted, state.length); - if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream2.emit("end"); - if (stream2.writable && stream2.allowHalfOpen === false) { - process2.nextTick(endWritableNT, stream2); - } else if (state.autoDestroy) { - const wState = stream2._writableState; - const autoDestroy = !wState || wState.autoDestroy && // We don't expect the writable to ever 'finish' - // if writable is explicitly set to false. - (wState.finished || wState.writable === false); - if (autoDestroy) { - stream2.destroy(); - } - } - } - } - function endWritableNT(stream2) { - const writable = stream2.writable && !stream2.writableEnded && !stream2.destroyed; - if (writable) { - stream2.end(); - } - } - Readable3.from = function(iterable, opts) { - return from(Readable3, iterable, opts); - }; - var webStreamsAdapters; - function lazyWebStreams() { - if (webStreamsAdapters === void 0) webStreamsAdapters = {}; - return webStreamsAdapters; - } - Readable3.fromWeb = function(readableStream, options) { - return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options); - }; - Readable3.toWeb = function(streamReadable, options) { - return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options); - }; - Readable3.wrap = function(src, options) { - var _ref, _src$readableObjectMo; - return new Readable3({ - objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 ? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 ? _ref : true, - ...options, - destroy(err, callback) { - destroyImpl.destroyer(src, err); - callback(err); - } - }).wrap(src); - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/writable.js -var require_writable = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/writable.js"(exports2, module2) { - "use strict"; - var process2 = require_process(); - var { - ArrayPrototypeSlice, - Error: Error2, - FunctionPrototypeSymbolHasInstance, - ObjectDefineProperty, - ObjectDefineProperties, - ObjectSetPrototypeOf, - StringPrototypeToLowerCase, - Symbol: Symbol2, - SymbolHasInstance - } = require_primordials(); - module2.exports = Writable; - Writable.WritableState = WritableState; - var { EventEmitter: EE } = require("events"); - var Stream = require_legacy().Stream; - var { Buffer: Buffer2 } = require("buffer"); - var destroyImpl = require_destroy2(); - var { addAbortSignal } = require_add_abort_signal(); - var { getHighWaterMark, getDefaultHighWaterMark } = require_state3(); - var { - ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED, - ERR_STREAM_ALREADY_FINISHED, - ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING - } = require_errors4().codes; - var { errorOrDestroy } = destroyImpl; - ObjectSetPrototypeOf(Writable.prototype, Stream.prototype); - ObjectSetPrototypeOf(Writable, Stream); - function nop() { - } - var kOnFinished = Symbol2("kOnFinished"); - function WritableState(options, stream2, isDuplex) { - if (typeof isDuplex !== "boolean") isDuplex = stream2 instanceof require_duplex(); - this.objectMode = !!(options && options.objectMode); - if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode); - this.highWaterMark = options ? getHighWaterMark(this, options, "writableHighWaterMark", isDuplex) : getDefaultHighWaterMark(false); - this.finalCalled = false; - this.needDrain = false; - this.ending = false; - this.ended = false; - this.finished = false; - this.destroyed = false; - const noDecode = !!(options && options.decodeStrings === false); - this.decodeStrings = !noDecode; - this.defaultEncoding = options && options.defaultEncoding || "utf8"; - this.length = 0; - this.writing = false; - this.corked = 0; - this.sync = true; - this.bufferProcessing = false; - this.onwrite = onwrite.bind(void 0, stream2); - this.writecb = null; - this.writelen = 0; - this.afterWriteTickInfo = null; - resetBuffer(this); - this.pendingcb = 0; - this.constructed = true; - this.prefinished = false; - this.errorEmitted = false; - this.emitClose = !options || options.emitClose !== false; - this.autoDestroy = !options || options.autoDestroy !== false; - this.errored = null; - this.closed = false; - this.closeEmitted = false; - this[kOnFinished] = []; - } - function resetBuffer(state) { - state.buffered = []; - state.bufferedIndex = 0; - state.allBuffers = true; - state.allNoop = true; - } - WritableState.prototype.getBuffer = function getBuffer() { - return ArrayPrototypeSlice(this.buffered, this.bufferedIndex); - }; - ObjectDefineProperty(WritableState.prototype, "bufferedRequestCount", { - __proto__: null, - get() { - return this.buffered.length - this.bufferedIndex; - } - }); - function Writable(options) { - const isDuplex = this instanceof require_duplex(); - if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); - if (options) { - if (typeof options.write === "function") this._write = options.write; - if (typeof options.writev === "function") this._writev = options.writev; - if (typeof options.destroy === "function") this._destroy = options.destroy; - if (typeof options.final === "function") this._final = options.final; - if (typeof options.construct === "function") this._construct = options.construct; - if (options.signal) addAbortSignal(options.signal, this); - } - Stream.call(this, options); - destroyImpl.construct(this, () => { - const state = this._writableState; - if (!state.writing) { - clearBuffer(this, state); - } - finishMaybe(this, state); - }); - } - ObjectDefineProperty(Writable, SymbolHasInstance, { - __proto__: null, - value: function(object2) { - if (FunctionPrototypeSymbolHasInstance(this, object2)) return true; - if (this !== Writable) return false; - return object2 && object2._writableState instanceof WritableState; - } - }); - Writable.prototype.pipe = function() { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); - }; - function _write(stream2, chunk, encoding, cb) { - const state = stream2._writableState; - if (typeof encoding === "function") { - cb = encoding; - encoding = state.defaultEncoding; - } else { - if (!encoding) encoding = state.defaultEncoding; - else if (encoding !== "buffer" && !Buffer2.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); - if (typeof cb !== "function") cb = nop; - } - if (chunk === null) { - throw new ERR_STREAM_NULL_VALUES(); - } else if (!state.objectMode) { - if (typeof chunk === "string") { - if (state.decodeStrings !== false) { - chunk = Buffer2.from(chunk, encoding); - encoding = "buffer"; - } - } else if (chunk instanceof Buffer2) { - encoding = "buffer"; - } else if (Stream._isUint8Array(chunk)) { - chunk = Stream._uint8ArrayToBuffer(chunk); - encoding = "buffer"; - } else { - throw new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); - } - } - let err; - if (state.ending) { - err = new ERR_STREAM_WRITE_AFTER_END(); - } else if (state.destroyed) { - err = new ERR_STREAM_DESTROYED("write"); - } - if (err) { - process2.nextTick(cb, err); - errorOrDestroy(stream2, err, true); - return err; - } - state.pendingcb++; - return writeOrBuffer(stream2, state, chunk, encoding, cb); - } - Writable.prototype.write = function(chunk, encoding, cb) { - return _write(this, chunk, encoding, cb) === true; - }; - Writable.prototype.cork = function() { - this._writableState.corked++; - }; - Writable.prototype.uncork = function() { - const state = this._writableState; - if (state.corked) { - state.corked--; - if (!state.writing) clearBuffer(this, state); - } - }; - Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - if (typeof encoding === "string") encoding = StringPrototypeToLowerCase(encoding); - if (!Buffer2.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; - }; - function writeOrBuffer(stream2, state, chunk, encoding, callback) { - const len = state.objectMode ? 1 : chunk.length; - state.length += len; - const ret = state.length < state.highWaterMark; - if (!ret) state.needDrain = true; - if (state.writing || state.corked || state.errored || !state.constructed) { - state.buffered.push({ - chunk, - encoding, - callback - }); - if (state.allBuffers && encoding !== "buffer") { - state.allBuffers = false; - } - if (state.allNoop && callback !== nop) { - state.allNoop = false; - } - } else { - state.writelen = len; - state.writecb = callback; - state.writing = true; - state.sync = true; - stream2._write(chunk, encoding, state.onwrite); - state.sync = false; - } - return ret && !state.errored && !state.destroyed; - } - function doWrite(stream2, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); - else if (writev) stream2._writev(chunk, state.onwrite); - else stream2._write(chunk, encoding, state.onwrite); - state.sync = false; - } - function onwriteError(stream2, state, er, cb) { - --state.pendingcb; - cb(er); - errorBuffer(state); - errorOrDestroy(stream2, er); - } - function onwrite(stream2, er) { - const state = stream2._writableState; - const sync = state.sync; - const cb = state.writecb; - if (typeof cb !== "function") { - errorOrDestroy(stream2, new ERR_MULTIPLE_CALLBACK()); - return; - } - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; - if (er) { - er.stack; - if (!state.errored) { - state.errored = er; - } - if (stream2._readableState && !stream2._readableState.errored) { - stream2._readableState.errored = er; - } - if (sync) { - process2.nextTick(onwriteError, stream2, state, er, cb); - } else { - onwriteError(stream2, state, er, cb); - } - } else { - if (state.buffered.length > state.bufferedIndex) { - clearBuffer(stream2, state); - } - if (sync) { - if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) { - state.afterWriteTickInfo.count++; - } else { - state.afterWriteTickInfo = { - count: 1, - cb, - stream: stream2, - state - }; - process2.nextTick(afterWriteTick, state.afterWriteTickInfo); - } - } else { - afterWrite(stream2, state, 1, cb); - } - } - } - function afterWriteTick({ stream: stream2, state, count, cb }) { - state.afterWriteTickInfo = null; - return afterWrite(stream2, state, count, cb); - } - function afterWrite(stream2, state, count, cb) { - const needDrain = !state.ending && !stream2.destroyed && state.length === 0 && state.needDrain; - if (needDrain) { - state.needDrain = false; - stream2.emit("drain"); - } - while (count-- > 0) { - state.pendingcb--; - cb(); - } - if (state.destroyed) { - errorBuffer(state); - } - finishMaybe(stream2, state); - } - function errorBuffer(state) { - if (state.writing) { - return; - } - for (let n = state.bufferedIndex; n < state.buffered.length; ++n) { - var _state$errored; - const { chunk, callback } = state.buffered[n]; - const len = state.objectMode ? 1 : chunk.length; - state.length -= len; - callback( - (_state$errored = state.errored) !== null && _state$errored !== void 0 ? _state$errored : new ERR_STREAM_DESTROYED("write") - ); - } - const onfinishCallbacks = state[kOnFinished].splice(0); - for (let i = 0; i < onfinishCallbacks.length; i++) { - var _state$errored2; - onfinishCallbacks[i]( - (_state$errored2 = state.errored) !== null && _state$errored2 !== void 0 ? _state$errored2 : new ERR_STREAM_DESTROYED("end") - ); - } - resetBuffer(state); - } - function clearBuffer(stream2, state) { - if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) { - return; - } - const { buffered, bufferedIndex, objectMode } = state; - const bufferedLength = buffered.length - bufferedIndex; - if (!bufferedLength) { - return; - } - let i = bufferedIndex; - state.bufferProcessing = true; - if (bufferedLength > 1 && stream2._writev) { - state.pendingcb -= bufferedLength - 1; - const callback = state.allNoop ? nop : (err) => { - for (let n = i; n < buffered.length; ++n) { - buffered[n].callback(err); - } - }; - const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i); - chunks.allBuffers = state.allBuffers; - doWrite(stream2, state, true, state.length, chunks, "", callback); - resetBuffer(state); - } else { - do { - const { chunk, encoding, callback } = buffered[i]; - buffered[i++] = null; - const len = objectMode ? 1 : chunk.length; - doWrite(stream2, state, false, len, chunk, encoding, callback); - } while (i < buffered.length && !state.writing); - if (i === buffered.length) { - resetBuffer(state); - } else if (i > 256) { - buffered.splice(0, i); - state.bufferedIndex = 0; - } else { - state.bufferedIndex = i; - } - } - state.bufferProcessing = false; - } - Writable.prototype._write = function(chunk, encoding, cb) { - if (this._writev) { - this._writev( - [ - { - chunk, - encoding - } - ], - cb - ); - } else { - throw new ERR_METHOD_NOT_IMPLEMENTED("_write()"); - } - }; - Writable.prototype._writev = null; - Writable.prototype.end = function(chunk, encoding, cb) { - const state = this._writableState; - if (typeof chunk === "function") { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === "function") { - cb = encoding; - encoding = null; - } - let err; - if (chunk !== null && chunk !== void 0) { - const ret = _write(this, chunk, encoding); - if (ret instanceof Error2) { - err = ret; - } - } - if (state.corked) { - state.corked = 1; - this.uncork(); - } - if (err) { - } else if (!state.errored && !state.ending) { - state.ending = true; - finishMaybe(this, state, true); - state.ended = true; - } else if (state.finished) { - err = new ERR_STREAM_ALREADY_FINISHED("end"); - } else if (state.destroyed) { - err = new ERR_STREAM_DESTROYED("end"); - } - if (typeof cb === "function") { - if (err || state.finished) { - process2.nextTick(cb, err); - } else { - state[kOnFinished].push(cb); - } - } - return this; - }; - function needFinish(state) { - return state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted; - } - function callFinal(stream2, state) { - let called = false; - function onFinish(err) { - if (called) { - errorOrDestroy(stream2, err !== null && err !== void 0 ? err : ERR_MULTIPLE_CALLBACK()); - return; - } - called = true; - state.pendingcb--; - if (err) { - const onfinishCallbacks = state[kOnFinished].splice(0); - for (let i = 0; i < onfinishCallbacks.length; i++) { - onfinishCallbacks[i](err); - } - errorOrDestroy(stream2, err, state.sync); - } else if (needFinish(state)) { - state.prefinished = true; - stream2.emit("prefinish"); - state.pendingcb++; - process2.nextTick(finish, stream2, state); - } - } - state.sync = true; - state.pendingcb++; - try { - stream2._final(onFinish); - } catch (err) { - onFinish(err); - } - state.sync = false; - } - function prefinish(stream2, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream2._final === "function" && !state.destroyed) { - state.finalCalled = true; - callFinal(stream2, state); - } else { - state.prefinished = true; - stream2.emit("prefinish"); - } - } - } - function finishMaybe(stream2, state, sync) { - if (needFinish(state)) { - prefinish(stream2, state); - if (state.pendingcb === 0) { - if (sync) { - state.pendingcb++; - process2.nextTick( - (stream3, state2) => { - if (needFinish(state2)) { - finish(stream3, state2); - } else { - state2.pendingcb--; - } - }, - stream2, - state - ); - } else if (needFinish(state)) { - state.pendingcb++; - finish(stream2, state); - } - } - } - } - function finish(stream2, state) { - state.pendingcb--; - state.finished = true; - const onfinishCallbacks = state[kOnFinished].splice(0); - for (let i = 0; i < onfinishCallbacks.length; i++) { - onfinishCallbacks[i](); - } - stream2.emit("finish"); - if (state.autoDestroy) { - const rState = stream2._readableState; - const autoDestroy = !rState || rState.autoDestroy && // We don't expect the readable to ever 'end' - // if readable is explicitly set to false. - (rState.endEmitted || rState.readable === false); - if (autoDestroy) { - stream2.destroy(); - } - } - } - ObjectDefineProperties(Writable.prototype, { - closed: { - __proto__: null, - get() { - return this._writableState ? this._writableState.closed : false; - } - }, - destroyed: { - __proto__: null, - get() { - return this._writableState ? this._writableState.destroyed : false; - }, - set(value) { - if (this._writableState) { - this._writableState.destroyed = value; - } - } - }, - writable: { - __proto__: null, - get() { - const w = this._writableState; - return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; - }, - set(val) { - if (this._writableState) { - this._writableState.writable = !!val; - } - } - }, - writableFinished: { - __proto__: null, - get() { - return this._writableState ? this._writableState.finished : false; - } - }, - writableObjectMode: { - __proto__: null, - get() { - return this._writableState ? this._writableState.objectMode : false; - } - }, - writableBuffer: { - __proto__: null, - get() { - return this._writableState && this._writableState.getBuffer(); - } - }, - writableEnded: { - __proto__: null, - get() { - return this._writableState ? this._writableState.ending : false; - } - }, - writableNeedDrain: { - __proto__: null, - get() { - const wState = this._writableState; - if (!wState) return false; - return !wState.destroyed && !wState.ending && wState.needDrain; - } - }, - writableHighWaterMark: { - __proto__: null, - get() { - return this._writableState && this._writableState.highWaterMark; - } - }, - writableCorked: { - __proto__: null, - get() { - return this._writableState ? this._writableState.corked : 0; - } - }, - writableLength: { - __proto__: null, - get() { - return this._writableState && this._writableState.length; - } - }, - errored: { - __proto__: null, - enumerable: false, - get() { - return this._writableState ? this._writableState.errored : null; - } - }, - writableAborted: { - __proto__: null, - enumerable: false, - get: function() { - return !!(this._writableState.writable !== false && (this._writableState.destroyed || this._writableState.errored) && !this._writableState.finished); - } - } - }); - var destroy = destroyImpl.destroy; - Writable.prototype.destroy = function(err, cb) { - const state = this._writableState; - if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) { - process2.nextTick(errorBuffer, state); - } - destroy.call(this, err, cb); - return this; - }; - Writable.prototype._undestroy = destroyImpl.undestroy; - Writable.prototype._destroy = function(err, cb) { - cb(err); - }; - Writable.prototype[EE.captureRejectionSymbol] = function(err) { - this.destroy(err); - }; - var webStreamsAdapters; - function lazyWebStreams() { - if (webStreamsAdapters === void 0) webStreamsAdapters = {}; - return webStreamsAdapters; - } - Writable.fromWeb = function(writableStream, options) { - return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options); - }; - Writable.toWeb = function(streamWritable) { - return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable); - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/duplexify.js -var require_duplexify = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/duplexify.js"(exports2, module2) { - var process2 = require_process(); - var bufferModule = require("buffer"); - var { - isReadable, - isWritable, - isIterable, - isNodeStream, - isReadableNodeStream, - isWritableNodeStream, - isDuplexNodeStream, - isReadableStream, - isWritableStream - } = require_utils7(); - var eos = require_end_of_stream(); - var { - AbortError, - codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE } - } = require_errors4(); - var { destroyer } = require_destroy2(); - var Duplex = require_duplex(); - var Readable3 = require_readable3(); - var Writable = require_writable(); - var { createDeferredPromise } = require_util13(); - var from = require_from(); - var Blob2 = globalThis.Blob || bufferModule.Blob; - var isBlob = typeof Blob2 !== "undefined" ? function isBlob2(b) { - return b instanceof Blob2; - } : function isBlob2(b) { - return false; - }; - var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; - var { FunctionPrototypeCall } = require_primordials(); - var Duplexify = class extends Duplex { - constructor(options) { - super(options); - if ((options === null || options === void 0 ? void 0 : options.readable) === false) { - this._readableState.readable = false; - this._readableState.ended = true; - this._readableState.endEmitted = true; - } - if ((options === null || options === void 0 ? void 0 : options.writable) === false) { - this._writableState.writable = false; - this._writableState.ending = true; - this._writableState.ended = true; - this._writableState.finished = true; - } - } - }; - module2.exports = function duplexify(body, name) { - if (isDuplexNodeStream(body)) { - return body; - } - if (isReadableNodeStream(body)) { - return _duplexify({ - readable: body - }); - } - if (isWritableNodeStream(body)) { - return _duplexify({ - writable: body - }); - } - if (isNodeStream(body)) { - return _duplexify({ - writable: false, - readable: false - }); - } - if (isReadableStream(body)) { - return _duplexify({ - readable: Readable3.fromWeb(body) - }); - } - if (isWritableStream(body)) { - return _duplexify({ - writable: Writable.fromWeb(body) - }); - } - if (typeof body === "function") { - const { value, write, final, destroy } = fromAsyncGen(body); - if (isIterable(value)) { - return from(Duplexify, value, { - // TODO (ronag): highWaterMark? - objectMode: true, - write, - final, - destroy - }); - } - const then2 = value === null || value === void 0 ? void 0 : value.then; - if (typeof then2 === "function") { - let d; - const promise = FunctionPrototypeCall( - then2, - value, - (val) => { - if (val != null) { - throw new ERR_INVALID_RETURN_VALUE("nully", "body", val); - } - }, - (err) => { - destroyer(d, err); - } - ); - return d = new Duplexify({ - // TODO (ronag): highWaterMark? - objectMode: true, - readable: false, - write, - final(cb) { - final(async () => { - try { - await promise; - process2.nextTick(cb, null); - } catch (err) { - process2.nextTick(cb, err); - } - }); - }, - destroy - }); - } - throw new ERR_INVALID_RETURN_VALUE("Iterable, AsyncIterable or AsyncFunction", name, value); - } - if (isBlob(body)) { - return duplexify(body.arrayBuffer()); - } - if (isIterable(body)) { - return from(Duplexify, body, { - // TODO (ronag): highWaterMark? - objectMode: true, - writable: false - }); - } - if (isReadableStream(body === null || body === void 0 ? void 0 : body.readable) && isWritableStream(body === null || body === void 0 ? void 0 : body.writable)) { - return Duplexify.fromWeb(body); - } - if (typeof (body === null || body === void 0 ? void 0 : body.writable) === "object" || typeof (body === null || body === void 0 ? void 0 : body.readable) === "object") { - const readable = body !== null && body !== void 0 && body.readable ? isReadableNodeStream(body === null || body === void 0 ? void 0 : body.readable) ? body === null || body === void 0 ? void 0 : body.readable : duplexify(body.readable) : void 0; - const writable = body !== null && body !== void 0 && body.writable ? isWritableNodeStream(body === null || body === void 0 ? void 0 : body.writable) ? body === null || body === void 0 ? void 0 : body.writable : duplexify(body.writable) : void 0; - return _duplexify({ - readable, - writable - }); - } - const then = body === null || body === void 0 ? void 0 : body.then; - if (typeof then === "function") { - let d; - FunctionPrototypeCall( - then, - body, - (val) => { - if (val != null) { - d.push(val); - } - d.push(null); - }, - (err) => { - destroyer(d, err); - } - ); - return d = new Duplexify({ - objectMode: true, - writable: false, - read() { - } - }); - } - throw new ERR_INVALID_ARG_TYPE( - name, - [ - "Blob", - "ReadableStream", - "WritableStream", - "Stream", - "Iterable", - "AsyncIterable", - "Function", - "{ readable, writable } pair", - "Promise" - ], - body - ); - }; - function fromAsyncGen(fn) { - let { promise, resolve: resolve14 } = createDeferredPromise(); - const ac = new AbortController2(); - const signal = ac.signal; - const value = fn( - (async function* () { - while (true) { - const _promise = promise; - promise = null; - const { chunk, done, cb } = await _promise; - process2.nextTick(cb); - if (done) return; - if (signal.aborted) - throw new AbortError(void 0, { - cause: signal.reason - }); - ({ promise, resolve: resolve14 } = createDeferredPromise()); - yield chunk; - } - })(), - { - signal - } - ); - return { - value, - write(chunk, encoding, cb) { - const _resolve = resolve14; - resolve14 = null; - _resolve({ - chunk, - done: false, - cb - }); - }, - final(cb) { - const _resolve = resolve14; - resolve14 = null; - _resolve({ - done: true, - cb - }); - }, - destroy(err, cb) { - ac.abort(); - cb(err); - } - }; - } - function _duplexify(pair) { - const r = pair.readable && typeof pair.readable.read !== "function" ? Readable3.wrap(pair.readable) : pair.readable; - const w = pair.writable; - let readable = !!isReadable(r); - let writable = !!isWritable(w); - let ondrain; - let onfinish; - let onreadable; - let onclose; - let d; - function onfinished(err) { - const cb = onclose; - onclose = null; - if (cb) { - cb(err); - } else if (err) { - d.destroy(err); - } - } - d = new Duplexify({ - // TODO (ronag): highWaterMark? - readableObjectMode: !!(r !== null && r !== void 0 && r.readableObjectMode), - writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode), - readable, - writable - }); - if (writable) { - eos(w, (err) => { - writable = false; - if (err) { - destroyer(r, err); - } - onfinished(err); - }); - d._write = function(chunk, encoding, callback) { - if (w.write(chunk, encoding)) { - callback(); - } else { - ondrain = callback; - } - }; - d._final = function(callback) { - w.end(); - onfinish = callback; - }; - w.on("drain", function() { - if (ondrain) { - const cb = ondrain; - ondrain = null; - cb(); - } - }); - w.on("finish", function() { - if (onfinish) { - const cb = onfinish; - onfinish = null; - cb(); - } - }); - } - if (readable) { - eos(r, (err) => { - readable = false; - if (err) { - destroyer(r, err); - } - onfinished(err); - }); - r.on("readable", function() { - if (onreadable) { - const cb = onreadable; - onreadable = null; - cb(); - } - }); - r.on("end", function() { - d.push(null); - }); - d._read = function() { - while (true) { - const buf = r.read(); - if (buf === null) { - onreadable = d._read; - return; - } - if (!d.push(buf)) { - return; - } - } - }; - } - d._destroy = function(err, callback) { - if (!err && onclose !== null) { - err = new AbortError(); - } - onreadable = null; - ondrain = null; - onfinish = null; - if (onclose === null) { - callback(err); - } else { - onclose = callback; - destroyer(w, err); - destroyer(r, err); - } - }; - return d; - } - } -}); - -// node_modules/readable-stream/lib/internal/streams/duplex.js -var require_duplex = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/duplex.js"(exports2, module2) { - "use strict"; - var { - ObjectDefineProperties, - ObjectGetOwnPropertyDescriptor, - ObjectKeys, - ObjectSetPrototypeOf - } = require_primordials(); - module2.exports = Duplex; - var Readable3 = require_readable3(); - var Writable = require_writable(); - ObjectSetPrototypeOf(Duplex.prototype, Readable3.prototype); - ObjectSetPrototypeOf(Duplex, Readable3); - { - const keys = ObjectKeys(Writable.prototype); - for (let i = 0; i < keys.length; i++) { - const method = keys[i]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } - } - function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable3.call(this, options); - Writable.call(this, options); - if (options) { - this.allowHalfOpen = options.allowHalfOpen !== false; - if (options.readable === false) { - this._readableState.readable = false; - this._readableState.ended = true; - this._readableState.endEmitted = true; - } - if (options.writable === false) { - this._writableState.writable = false; - this._writableState.ending = true; - this._writableState.ended = true; - this._writableState.finished = true; - } - } else { - this.allowHalfOpen = true; - } - } - ObjectDefineProperties(Duplex.prototype, { - writable: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writable") - }, - writableHighWaterMark: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writableHighWaterMark") - }, - writableObjectMode: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writableObjectMode") - }, - writableBuffer: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writableBuffer") - }, - writableLength: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writableLength") - }, - writableFinished: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writableFinished") - }, - writableCorked: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writableCorked") - }, - writableEnded: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writableEnded") - }, - writableNeedDrain: { - __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable.prototype, "writableNeedDrain") - }, - destroyed: { - __proto__: null, - get() { - if (this._readableState === void 0 || this._writableState === void 0) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set(value) { - if (this._readableState && this._writableState) { - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } - } - } - }); - var webStreamsAdapters; - function lazyWebStreams() { - if (webStreamsAdapters === void 0) webStreamsAdapters = {}; - return webStreamsAdapters; - } - Duplex.fromWeb = function(pair, options) { - return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options); - }; - Duplex.toWeb = function(duplex) { - return lazyWebStreams().newReadableWritablePairFromDuplex(duplex); - }; - var duplexify; - Duplex.from = function(body) { - if (!duplexify) { - duplexify = require_duplexify(); - } - return duplexify(body, "body"); - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/transform.js -var require_transform = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/transform.js"(exports2, module2) { - "use strict"; - var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials(); - module2.exports = Transform5; - var { ERR_METHOD_NOT_IMPLEMENTED } = require_errors4().codes; - var Duplex = require_duplex(); - var { getHighWaterMark } = require_state3(); - ObjectSetPrototypeOf(Transform5.prototype, Duplex.prototype); - ObjectSetPrototypeOf(Transform5, Duplex); - var kCallback = Symbol2("kCallback"); - function Transform5(options) { - if (!(this instanceof Transform5)) return new Transform5(options); - const readableHighWaterMark = options ? getHighWaterMark(this, options, "readableHighWaterMark", true) : null; - if (readableHighWaterMark === 0) { - options = { - ...options, - highWaterMark: null, - readableHighWaterMark, - // TODO (ronag): 0 is not optimal since we have - // a "bug" where we check needDrain before calling _write and not after. - // Refs: https://github.com/nodejs/node/pull/32887 - // Refs: https://github.com/nodejs/node/pull/35941 - writableHighWaterMark: options.writableHighWaterMark || 0 - }; - } - Duplex.call(this, options); - this._readableState.sync = false; - this[kCallback] = null; - if (options) { - if (typeof options.transform === "function") this._transform = options.transform; - if (typeof options.flush === "function") this._flush = options.flush; - } - this.on("prefinish", prefinish); - } - function final(cb) { - if (typeof this._flush === "function" && !this.destroyed) { - this._flush((er, data) => { - if (er) { - if (cb) { - cb(er); - } else { - this.destroy(er); - } - return; - } - if (data != null) { - this.push(data); - } - this.push(null); - if (cb) { - cb(); - } - }); - } else { - this.push(null); - if (cb) { - cb(); - } - } - } - function prefinish() { - if (this._final !== final) { - final.call(this); - } - } - Transform5.prototype._final = final; - Transform5.prototype._transform = function(chunk, encoding, callback) { - throw new ERR_METHOD_NOT_IMPLEMENTED("_transform()"); - }; - Transform5.prototype._write = function(chunk, encoding, callback) { - const rState = this._readableState; - const wState = this._writableState; - const length = rState.length; - this._transform(chunk, encoding, (err, val) => { - if (err) { - callback(err); - return; - } - if (val != null) { - this.push(val); - } - if (wState.ended || // Backwards compat. - length === rState.length || // Backwards compat. - rState.length < rState.highWaterMark) { - callback(); - } else { - this[kCallback] = callback; - } - }); - }; - Transform5.prototype._read = function() { - if (this[kCallback]) { - const callback = this[kCallback]; - this[kCallback] = null; - callback(); - } - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/passthrough.js -var require_passthrough2 = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/passthrough.js"(exports2, module2) { - "use strict"; - var { ObjectSetPrototypeOf } = require_primordials(); - module2.exports = PassThrough3; - var Transform5 = require_transform(); - ObjectSetPrototypeOf(PassThrough3.prototype, Transform5.prototype); - ObjectSetPrototypeOf(PassThrough3, Transform5); - function PassThrough3(options) { - if (!(this instanceof PassThrough3)) return new PassThrough3(options); - Transform5.call(this, options); - } - PassThrough3.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/pipeline.js -var require_pipeline4 = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports2, module2) { - var process2 = require_process(); - var { ArrayIsArray, Promise: Promise2, SymbolAsyncIterator, SymbolDispose } = require_primordials(); - var eos = require_end_of_stream(); - var { once } = require_util13(); - var destroyImpl = require_destroy2(); - var Duplex = require_duplex(); - var { - aggregateTwoErrors, - codes: { - ERR_INVALID_ARG_TYPE, - ERR_INVALID_RETURN_VALUE, - ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED, - ERR_STREAM_PREMATURE_CLOSE - }, - AbortError - } = require_errors4(); - var { validateFunction, validateAbortSignal } = require_validators(); - var { - isIterable, - isReadable, - isReadableNodeStream, - isNodeStream, - isTransformStream, - isWebStream, - isReadableStream, - isReadableFinished - } = require_utils7(); - var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; - var PassThrough3; - var Readable3; - var addAbortListener; - function destroyer(stream2, reading, writing) { - let finished = false; - stream2.on("close", () => { - finished = true; - }); - const cleanup = eos( - stream2, - { - readable: reading, - writable: writing - }, - (err) => { - finished = !err; - } - ); - return { - destroy: (err) => { - if (finished) return; - finished = true; - destroyImpl.destroyer(stream2, err || new ERR_STREAM_DESTROYED("pipe")); - }, - cleanup - }; - } - function popCallback(streams) { - validateFunction(streams[streams.length - 1], "streams[stream.length - 1]"); - return streams.pop(); - } - function makeAsyncIterable(val) { - if (isIterable(val)) { - return val; - } else if (isReadableNodeStream(val)) { - return fromReadable(val); - } - throw new ERR_INVALID_ARG_TYPE("val", ["Readable", "Iterable", "AsyncIterable"], val); - } - async function* fromReadable(val) { - if (!Readable3) { - Readable3 = require_readable3(); - } - yield* Readable3.prototype[SymbolAsyncIterator].call(val); - } - async function pumpToNode(iterable, writable, finish, { end }) { - let error3; - let onresolve = null; - const resume = (err) => { - if (err) { - error3 = err; - } - if (onresolve) { - const callback = onresolve; - onresolve = null; - callback(); - } - }; - const wait = () => new Promise2((resolve14, reject) => { - if (error3) { - reject(error3); - } else { - onresolve = () => { - if (error3) { - reject(error3); - } else { - resolve14(); - } - }; - } - }); - writable.on("drain", resume); - const cleanup = eos( - writable, - { - readable: false - }, - resume - ); - try { - if (writable.writableNeedDrain) { - await wait(); - } - for await (const chunk of iterable) { - if (!writable.write(chunk)) { - await wait(); - } - } - if (end) { - writable.end(); - await wait(); - } - finish(); - } catch (err) { - finish(error3 !== err ? aggregateTwoErrors(error3, err) : err); - } finally { - cleanup(); - writable.off("drain", resume); - } - } - async function pumpToWeb(readable, writable, finish, { end }) { - if (isTransformStream(writable)) { - writable = writable.writable; - } - const writer = writable.getWriter(); - try { - for await (const chunk of readable) { - await writer.ready; - writer.write(chunk).catch(() => { - }); - } - await writer.ready; - if (end) { - await writer.close(); - } - finish(); - } catch (err) { - try { - await writer.abort(err); - finish(err); - } catch (err2) { - finish(err2); - } - } - } - function pipeline2(...streams) { - return pipelineImpl(streams, once(popCallback(streams))); - } - function pipelineImpl(streams, callback, opts) { - if (streams.length === 1 && ArrayIsArray(streams[0])) { - streams = streams[0]; - } - if (streams.length < 2) { - throw new ERR_MISSING_ARGS("streams"); - } - const ac = new AbortController2(); - const signal = ac.signal; - const outerSignal = opts === null || opts === void 0 ? void 0 : opts.signal; - const lastStreamCleanup = []; - validateAbortSignal(outerSignal, "options.signal"); - function abort() { - finishImpl(new AbortError()); - } - addAbortListener = addAbortListener || require_util13().addAbortListener; - let disposable; - if (outerSignal) { - disposable = addAbortListener(outerSignal, abort); - } - let error3; - let value; - const destroys = []; - let finishCount = 0; - function finish(err) { - finishImpl(err, --finishCount === 0); - } - function finishImpl(err, final) { - var _disposable; - if (err && (!error3 || error3.code === "ERR_STREAM_PREMATURE_CLOSE")) { - error3 = err; - } - if (!error3 && !final) { - return; - } - while (destroys.length) { - destroys.shift()(error3); - } - ; - (_disposable = disposable) === null || _disposable === void 0 ? void 0 : _disposable[SymbolDispose](); - ac.abort(); - if (final) { - if (!error3) { - lastStreamCleanup.forEach((fn) => fn()); - } - process2.nextTick(callback, error3, value); - } - } - let ret; - for (let i = 0; i < streams.length; i++) { - const stream2 = streams[i]; - const reading = i < streams.length - 1; - const writing = i > 0; - const end = reading || (opts === null || opts === void 0 ? void 0 : opts.end) !== false; - const isLastStream = i === streams.length - 1; - if (isNodeStream(stream2)) { - let onError2 = function(err) { - if (err && err.name !== "AbortError" && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { - finish(err); - } - }; - var onError = onError2; - if (end) { - const { destroy, cleanup } = destroyer(stream2, reading, writing); - destroys.push(destroy); - if (isReadable(stream2) && isLastStream) { - lastStreamCleanup.push(cleanup); - } - } - stream2.on("error", onError2); - if (isReadable(stream2) && isLastStream) { - lastStreamCleanup.push(() => { - stream2.removeListener("error", onError2); - }); - } - } - if (i === 0) { - if (typeof stream2 === "function") { - ret = stream2({ - signal - }); - if (!isIterable(ret)) { - throw new ERR_INVALID_RETURN_VALUE("Iterable, AsyncIterable or Stream", "source", ret); - } - } else if (isIterable(stream2) || isReadableNodeStream(stream2) || isTransformStream(stream2)) { - ret = stream2; - } else { - ret = Duplex.from(stream2); - } - } else if (typeof stream2 === "function") { - if (isTransformStream(ret)) { - var _ret; - ret = makeAsyncIterable((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.readable); - } else { - ret = makeAsyncIterable(ret); - } - ret = stream2(ret, { - signal - }); - if (reading) { - if (!isIterable(ret, true)) { - throw new ERR_INVALID_RETURN_VALUE("AsyncIterable", `transform[${i - 1}]`, ret); - } - } else { - var _ret2; - if (!PassThrough3) { - PassThrough3 = require_passthrough2(); - } - const pt = new PassThrough3({ - objectMode: true - }); - const then = (_ret2 = ret) === null || _ret2 === void 0 ? void 0 : _ret2.then; - if (typeof then === "function") { - finishCount++; - then.call( - ret, - (val) => { - value = val; - if (val != null) { - pt.write(val); - } - if (end) { - pt.end(); - } - process2.nextTick(finish); - }, - (err) => { - pt.destroy(err); - process2.nextTick(finish, err); - } - ); - } else if (isIterable(ret, true)) { - finishCount++; - pumpToNode(ret, pt, finish, { - end - }); - } else if (isReadableStream(ret) || isTransformStream(ret)) { - const toRead = ret.readable || ret; - finishCount++; - pumpToNode(toRead, pt, finish, { - end - }); - } else { - throw new ERR_INVALID_RETURN_VALUE("AsyncIterable or Promise", "destination", ret); - } - ret = pt; - const { destroy, cleanup } = destroyer(ret, false, true); - destroys.push(destroy); - if (isLastStream) { - lastStreamCleanup.push(cleanup); - } - } - } else if (isNodeStream(stream2)) { - if (isReadableNodeStream(ret)) { - finishCount += 2; - const cleanup = pipe(ret, stream2, finish, { - end - }); - if (isReadable(stream2) && isLastStream) { - lastStreamCleanup.push(cleanup); - } - } else if (isTransformStream(ret) || isReadableStream(ret)) { - const toRead = ret.readable || ret; - finishCount++; - pumpToNode(toRead, stream2, finish, { - end - }); - } else if (isIterable(ret)) { - finishCount++; - pumpToNode(ret, stream2, finish, { - end - }); - } else { - throw new ERR_INVALID_ARG_TYPE( - "val", - ["Readable", "Iterable", "AsyncIterable", "ReadableStream", "TransformStream"], - ret - ); - } - ret = stream2; - } else if (isWebStream(stream2)) { - if (isReadableNodeStream(ret)) { - finishCount++; - pumpToWeb(makeAsyncIterable(ret), stream2, finish, { - end - }); - } else if (isReadableStream(ret) || isIterable(ret)) { - finishCount++; - pumpToWeb(ret, stream2, finish, { - end - }); - } else if (isTransformStream(ret)) { - finishCount++; - pumpToWeb(ret.readable, stream2, finish, { - end - }); - } else { - throw new ERR_INVALID_ARG_TYPE( - "val", - ["Readable", "Iterable", "AsyncIterable", "ReadableStream", "TransformStream"], - ret - ); - } - ret = stream2; - } else { - ret = Duplex.from(stream2); - } - } - if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted) { - process2.nextTick(abort); - } - return ret; - } - function pipe(src, dst, finish, { end }) { - let ended = false; - dst.on("close", () => { - if (!ended) { - finish(new ERR_STREAM_PREMATURE_CLOSE()); - } - }); - src.pipe(dst, { - end: false - }); - if (end) { - let endFn2 = function() { - ended = true; - dst.end(); - }; - var endFn = endFn2; - if (isReadableFinished(src)) { - process2.nextTick(endFn2); - } else { - src.once("end", endFn2); - } - } else { - finish(); - } - eos( - src, - { - readable: true, - writable: false - }, - (err) => { - const rState = src._readableState; - if (err && err.code === "ERR_STREAM_PREMATURE_CLOSE" && rState && rState.ended && !rState.errored && !rState.errorEmitted) { - src.once("end", finish).once("error", finish); - } else { - finish(err); - } - } - ); - return eos( - dst, - { - readable: false, - writable: true - }, - finish - ); - } - module2.exports = { - pipelineImpl, - pipeline: pipeline2 - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/compose.js -var require_compose = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) { - "use strict"; - var { pipeline: pipeline2 } = require_pipeline4(); - var Duplex = require_duplex(); - var { destroyer } = require_destroy2(); - var { - isNodeStream, - isReadable, - isWritable, - isWebStream, - isTransformStream, - isWritableStream, - isReadableStream - } = require_utils7(); - var { - AbortError, - codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS } - } = require_errors4(); - var eos = require_end_of_stream(); - module2.exports = function compose(...streams) { - if (streams.length === 0) { - throw new ERR_MISSING_ARGS("streams"); - } - if (streams.length === 1) { - return Duplex.from(streams[0]); - } - const orgStreams = [...streams]; - if (typeof streams[0] === "function") { - streams[0] = Duplex.from(streams[0]); - } - if (typeof streams[streams.length - 1] === "function") { - const idx = streams.length - 1; - streams[idx] = Duplex.from(streams[idx]); - } - for (let n = 0; n < streams.length; ++n) { - if (!isNodeStream(streams[n]) && !isWebStream(streams[n])) { - continue; - } - if (n < streams.length - 1 && !(isReadable(streams[n]) || isReadableStream(streams[n]) || isTransformStream(streams[n]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], "must be readable"); - } - if (n > 0 && !(isWritable(streams[n]) || isWritableStream(streams[n]) || isTransformStream(streams[n]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], "must be writable"); - } - } - let ondrain; - let onfinish; - let onreadable; - let onclose; - let d; - function onfinished(err) { - const cb = onclose; - onclose = null; - if (cb) { - cb(err); - } else if (err) { - d.destroy(err); - } else if (!readable && !writable) { - d.destroy(); - } - } - const head = streams[0]; - const tail = pipeline2(streams, onfinished); - const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head)); - const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail)); - d = new Duplex({ - // TODO (ronag): highWaterMark? - writableObjectMode: !!(head !== null && head !== void 0 && head.writableObjectMode), - readableObjectMode: !!(tail !== null && tail !== void 0 && tail.readableObjectMode), - writable, - readable - }); - if (writable) { - if (isNodeStream(head)) { - d._write = function(chunk, encoding, callback) { - if (head.write(chunk, encoding)) { - callback(); - } else { - ondrain = callback; - } - }; - d._final = function(callback) { - head.end(); - onfinish = callback; - }; - head.on("drain", function() { - if (ondrain) { - const cb = ondrain; - ondrain = null; - cb(); - } - }); - } else if (isWebStream(head)) { - const writable2 = isTransformStream(head) ? head.writable : head; - const writer = writable2.getWriter(); - d._write = async function(chunk, encoding, callback) { - try { - await writer.ready; - writer.write(chunk).catch(() => { - }); - callback(); - } catch (err) { - callback(err); - } - }; - d._final = async function(callback) { - try { - await writer.ready; - writer.close().catch(() => { - }); - onfinish = callback; - } catch (err) { - callback(err); - } - }; - } - const toRead = isTransformStream(tail) ? tail.readable : tail; - eos(toRead, () => { - if (onfinish) { - const cb = onfinish; - onfinish = null; - cb(); - } - }); - } - if (readable) { - if (isNodeStream(tail)) { - tail.on("readable", function() { - if (onreadable) { - const cb = onreadable; - onreadable = null; - cb(); - } - }); - tail.on("end", function() { - d.push(null); - }); - d._read = function() { - while (true) { - const buf = tail.read(); - if (buf === null) { - onreadable = d._read; - return; - } - if (!d.push(buf)) { - return; - } - } - }; - } else if (isWebStream(tail)) { - const readable2 = isTransformStream(tail) ? tail.readable : tail; - const reader = readable2.getReader(); - d._read = async function() { - while (true) { - try { - const { value, done } = await reader.read(); - if (!d.push(value)) { - return; - } - if (done) { - d.push(null); - return; - } - } catch { - return; - } - } - }; - } - } - d._destroy = function(err, callback) { - if (!err && onclose !== null) { - err = new AbortError(); - } - onreadable = null; - ondrain = null; - onfinish = null; - if (onclose === null) { - callback(err); - } else { - onclose = callback; - if (isNodeStream(tail)) { - destroyer(tail, err); - } - } - }; - return d; - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/operators.js -var require_operators = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/operators.js"(exports2, module2) { - "use strict"; - var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; - var { - codes: { ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE }, - AbortError - } = require_errors4(); - var { validateAbortSignal, validateInteger, validateObject } = require_validators(); - var kWeakHandler = require_primordials().Symbol("kWeak"); - var kResistStopPropagation = require_primordials().Symbol("kResistStopPropagation"); - var { finished } = require_end_of_stream(); - var staticCompose = require_compose(); - var { addAbortSignalNoValidate } = require_add_abort_signal(); - var { isWritable, isNodeStream } = require_utils7(); - var { deprecate } = require_util13(); - var { - ArrayPrototypePush, - Boolean: Boolean2, - MathFloor, - Number: Number2, - NumberIsNaN, - Promise: Promise2, - PromiseReject, - PromiseResolve, - PromisePrototypeThen, - Symbol: Symbol2 - } = require_primordials(); - var kEmpty = Symbol2("kEmpty"); - var kEof = Symbol2("kEof"); - function compose(stream2, options) { - if (options != null) { - validateObject(options, "options"); - } - if ((options === null || options === void 0 ? void 0 : options.signal) != null) { - validateAbortSignal(options.signal, "options.signal"); - } - if (isNodeStream(stream2) && !isWritable(stream2)) { - throw new ERR_INVALID_ARG_VALUE("stream", stream2, "must be writable"); - } - const composedStream = staticCompose(this, stream2); - if (options !== null && options !== void 0 && options.signal) { - addAbortSignalNoValidate(options.signal, composedStream); - } - return composedStream; - } - function map(fn, options) { - if (typeof fn !== "function") { - throw new ERR_INVALID_ARG_TYPE("fn", ["Function", "AsyncFunction"], fn); - } - if (options != null) { - validateObject(options, "options"); - } - if ((options === null || options === void 0 ? void 0 : options.signal) != null) { - validateAbortSignal(options.signal, "options.signal"); - } - let concurrency = 1; - if ((options === null || options === void 0 ? void 0 : options.concurrency) != null) { - concurrency = MathFloor(options.concurrency); - } - let highWaterMark = concurrency - 1; - if ((options === null || options === void 0 ? void 0 : options.highWaterMark) != null) { - highWaterMark = MathFloor(options.highWaterMark); - } - validateInteger(concurrency, "options.concurrency", 1); - validateInteger(highWaterMark, "options.highWaterMark", 0); - highWaterMark += concurrency; - return async function* map2() { - const signal = require_util13().AbortSignalAny( - [options === null || options === void 0 ? void 0 : options.signal].filter(Boolean2) - ); - const stream2 = this; - const queue2 = []; - const signalOpt = { - signal - }; - let next; - let resume; - let done = false; - let cnt = 0; - function onCatch() { - done = true; - afterItemProcessed(); - } - function afterItemProcessed() { - cnt -= 1; - maybeResume(); - } - function maybeResume() { - if (resume && !done && cnt < concurrency && queue2.length < highWaterMark) { - resume(); - resume = null; - } - } - async function pump() { - try { - for await (let val of stream2) { - if (done) { - return; - } - if (signal.aborted) { - throw new AbortError(); - } - try { - val = fn(val, signalOpt); - if (val === kEmpty) { - continue; - } - val = PromiseResolve(val); - } catch (err) { - val = PromiseReject(err); - } - cnt += 1; - PromisePrototypeThen(val, afterItemProcessed, onCatch); - queue2.push(val); - if (next) { - next(); - next = null; - } - if (!done && (queue2.length >= highWaterMark || cnt >= concurrency)) { - await new Promise2((resolve14) => { - resume = resolve14; - }); - } - } - queue2.push(kEof); - } catch (err) { - const val = PromiseReject(err); - PromisePrototypeThen(val, afterItemProcessed, onCatch); - queue2.push(val); - } finally { - done = true; - if (next) { - next(); - next = null; - } - } - } - pump(); - try { - while (true) { - while (queue2.length > 0) { - const val = await queue2[0]; - if (val === kEof) { - return; - } - if (signal.aborted) { - throw new AbortError(); - } - if (val !== kEmpty) { - yield val; - } - queue2.shift(); - maybeResume(); - } - await new Promise2((resolve14) => { - next = resolve14; - }); - } - } finally { - done = true; - if (resume) { - resume(); - resume = null; - } - } - }.call(this); - } - function asIndexedPairs(options = void 0) { - if (options != null) { - validateObject(options, "options"); - } - if ((options === null || options === void 0 ? void 0 : options.signal) != null) { - validateAbortSignal(options.signal, "options.signal"); - } - return async function* asIndexedPairs2() { - let index2 = 0; - for await (const val of this) { - var _options$signal; - if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted) { - throw new AbortError({ - cause: options.signal.reason - }); - } - yield [index2++, val]; - } - }.call(this); - } - async function some(fn, options = void 0) { - for await (const unused of filter2.call(this, fn, options)) { - return true; - } - return false; - } - async function every(fn, options = void 0) { - if (typeof fn !== "function") { - throw new ERR_INVALID_ARG_TYPE("fn", ["Function", "AsyncFunction"], fn); - } - return !await some.call( - this, - async (...args) => { - return !await fn(...args); - }, - options - ); - } - async function find3(fn, options) { - for await (const result of filter2.call(this, fn, options)) { - return result; - } - return void 0; - } - async function forEach(fn, options) { - if (typeof fn !== "function") { - throw new ERR_INVALID_ARG_TYPE("fn", ["Function", "AsyncFunction"], fn); - } - async function forEachFn(value, options2) { - await fn(value, options2); - return kEmpty; - } - for await (const unused of map.call(this, forEachFn, options)) ; - } - function filter2(fn, options) { - if (typeof fn !== "function") { - throw new ERR_INVALID_ARG_TYPE("fn", ["Function", "AsyncFunction"], fn); - } - async function filterFn(value, options2) { - if (await fn(value, options2)) { - return value; - } - return kEmpty; - } - return map.call(this, filterFn, options); - } - var ReduceAwareErrMissingArgs = class extends ERR_MISSING_ARGS { - constructor() { - super("reduce"); - this.message = "Reduce of an empty stream requires an initial value"; - } - }; - async function reduce(reducer, initialValue, options) { - var _options$signal2; - if (typeof reducer !== "function") { - throw new ERR_INVALID_ARG_TYPE("reducer", ["Function", "AsyncFunction"], reducer); - } - if (options != null) { - validateObject(options, "options"); - } - if ((options === null || options === void 0 ? void 0 : options.signal) != null) { - validateAbortSignal(options.signal, "options.signal"); - } - let hasInitialValue = arguments.length > 1; - if (options !== null && options !== void 0 && (_options$signal2 = options.signal) !== null && _options$signal2 !== void 0 && _options$signal2.aborted) { - const err = new AbortError(void 0, { - cause: options.signal.reason - }); - this.once("error", () => { - }); - await finished(this.destroy(err)); - throw err; - } - const ac = new AbortController2(); - const signal = ac.signal; - if (options !== null && options !== void 0 && options.signal) { - const opts = { - once: true, - [kWeakHandler]: this, - [kResistStopPropagation]: true - }; - options.signal.addEventListener("abort", () => ac.abort(), opts); - } - let gotAnyItemFromStream = false; - try { - for await (const value of this) { - var _options$signal3; - gotAnyItemFromStream = true; - if (options !== null && options !== void 0 && (_options$signal3 = options.signal) !== null && _options$signal3 !== void 0 && _options$signal3.aborted) { - throw new AbortError(); - } - if (!hasInitialValue) { - initialValue = value; - hasInitialValue = true; - } else { - initialValue = await reducer(initialValue, value, { - signal - }); - } - } - if (!gotAnyItemFromStream && !hasInitialValue) { - throw new ReduceAwareErrMissingArgs(); - } - } finally { - ac.abort(); - } - return initialValue; - } - async function toArray(options) { - if (options != null) { - validateObject(options, "options"); - } - if ((options === null || options === void 0 ? void 0 : options.signal) != null) { - validateAbortSignal(options.signal, "options.signal"); - } - const result = []; - for await (const val of this) { - var _options$signal4; - if (options !== null && options !== void 0 && (_options$signal4 = options.signal) !== null && _options$signal4 !== void 0 && _options$signal4.aborted) { - throw new AbortError(void 0, { - cause: options.signal.reason - }); - } - ArrayPrototypePush(result, val); - } - return result; - } - function flatMap(fn, options) { - const values = map.call(this, fn, options); - return async function* flatMap2() { - for await (const val of values) { - yield* val; - } - }.call(this); - } - function toIntegerOrInfinity(number2) { - number2 = Number2(number2); - if (NumberIsNaN(number2)) { - return 0; - } - if (number2 < 0) { - throw new ERR_OUT_OF_RANGE("number", ">= 0", number2); - } - return number2; - } - function drop(number2, options = void 0) { - if (options != null) { - validateObject(options, "options"); - } - if ((options === null || options === void 0 ? void 0 : options.signal) != null) { - validateAbortSignal(options.signal, "options.signal"); - } - number2 = toIntegerOrInfinity(number2); - return async function* drop2() { - var _options$signal5; - if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) { - throw new AbortError(); - } - for await (const val of this) { - var _options$signal6; - if (options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted) { - throw new AbortError(); - } - if (number2-- <= 0) { - yield val; - } - } - }.call(this); - } - function take(number2, options = void 0) { - if (options != null) { - validateObject(options, "options"); - } - if ((options === null || options === void 0 ? void 0 : options.signal) != null) { - validateAbortSignal(options.signal, "options.signal"); - } - number2 = toIntegerOrInfinity(number2); - return async function* take2() { - var _options$signal7; - if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted) { - throw new AbortError(); - } - for await (const val of this) { - var _options$signal8; - if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted) { - throw new AbortError(); - } - if (number2-- > 0) { - yield val; - } - if (number2 <= 0) { - return; - } - } - }.call(this); - } - module2.exports.streamReturningOperators = { - asIndexedPairs: deprecate(asIndexedPairs, "readable.asIndexedPairs will be removed in a future version."), - drop, - filter: filter2, - flatMap, - map, - take, - compose - }; - module2.exports.promiseReturningOperators = { - every, - forEach, - reduce, - toArray, - some, - find: find3 - }; - } -}); - -// node_modules/readable-stream/lib/stream/promises.js -var require_promises = __commonJS({ - "node_modules/readable-stream/lib/stream/promises.js"(exports2, module2) { - "use strict"; - var { ArrayPrototypePop, Promise: Promise2 } = require_primordials(); - var { isIterable, isNodeStream, isWebStream } = require_utils7(); - var { pipelineImpl: pl } = require_pipeline4(); - var { finished } = require_end_of_stream(); - require_stream2(); - function pipeline2(...streams) { - return new Promise2((resolve14, reject) => { - let signal; - let end; - const lastArg = streams[streams.length - 1]; - if (lastArg && typeof lastArg === "object" && !isNodeStream(lastArg) && !isIterable(lastArg) && !isWebStream(lastArg)) { - const options = ArrayPrototypePop(streams); - signal = options.signal; - end = options.end; - } - pl( - streams, - (err, value) => { - if (err) { - reject(err); - } else { - resolve14(value); - } - }, - { - signal, - end - } - ); - }); - } - module2.exports = { - finished, - pipeline: pipeline2 - }; - } -}); - -// node_modules/readable-stream/lib/stream.js -var require_stream2 = __commonJS({ - "node_modules/readable-stream/lib/stream.js"(exports2, module2) { - "use strict"; - var { Buffer: Buffer2 } = require("buffer"); - var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(); - var { - promisify: { custom: customPromisify } - } = require_util13(); - var { streamReturningOperators, promiseReturningOperators } = require_operators(); - var { - codes: { ERR_ILLEGAL_CONSTRUCTOR } - } = require_errors4(); - var compose = require_compose(); - var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state3(); - var { pipeline: pipeline2 } = require_pipeline4(); - var { destroyer } = require_destroy2(); - var eos = require_end_of_stream(); - var promises6 = require_promises(); - var utils = require_utils7(); - var Stream = module2.exports = require_legacy().Stream; - Stream.isDestroyed = utils.isDestroyed; - Stream.isDisturbed = utils.isDisturbed; - Stream.isErrored = utils.isErrored; - Stream.isReadable = utils.isReadable; - Stream.isWritable = utils.isWritable; - Stream.Readable = require_readable3(); - for (const key of ObjectKeys(streamReturningOperators)) { - let fn = function(...args) { - if (new.target) { - throw ERR_ILLEGAL_CONSTRUCTOR(); - } - return Stream.Readable.from(ReflectApply(op, this, args)); - }; - const op = streamReturningOperators[key]; - ObjectDefineProperty(fn, "name", { - __proto__: null, - value: op.name - }); - ObjectDefineProperty(fn, "length", { - __proto__: null, - value: op.length - }); - ObjectDefineProperty(Stream.Readable.prototype, key, { - __proto__: null, - value: fn, - enumerable: false, - configurable: true, - writable: true - }); - } - for (const key of ObjectKeys(promiseReturningOperators)) { - let fn = function(...args) { - if (new.target) { - throw ERR_ILLEGAL_CONSTRUCTOR(); - } - return ReflectApply(op, this, args); - }; - const op = promiseReturningOperators[key]; - ObjectDefineProperty(fn, "name", { - __proto__: null, - value: op.name - }); - ObjectDefineProperty(fn, "length", { - __proto__: null, - value: op.length - }); - ObjectDefineProperty(Stream.Readable.prototype, key, { - __proto__: null, - value: fn, - enumerable: false, - configurable: true, - writable: true - }); - } - Stream.Writable = require_writable(); - Stream.Duplex = require_duplex(); - Stream.Transform = require_transform(); - Stream.PassThrough = require_passthrough2(); - Stream.pipeline = pipeline2; - var { addAbortSignal } = require_add_abort_signal(); - Stream.addAbortSignal = addAbortSignal; - Stream.finished = eos; - Stream.destroy = destroyer; - Stream.compose = compose; - Stream.setDefaultHighWaterMark = setDefaultHighWaterMark; - Stream.getDefaultHighWaterMark = getDefaultHighWaterMark; - ObjectDefineProperty(Stream, "promises", { - __proto__: null, - configurable: true, - enumerable: true, - get() { - return promises6; - } - }); - ObjectDefineProperty(pipeline2, customPromisify, { - __proto__: null, - enumerable: true, - get() { - return promises6.pipeline; - } - }); - ObjectDefineProperty(eos, customPromisify, { - __proto__: null, - enumerable: true, - get() { - return promises6.finished; - } - }); - Stream.Stream = Stream; - Stream._isUint8Array = function isUint8Array(value) { - return value instanceof Uint8Array; - }; - Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) { - return Buffer2.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); - }; - } -}); - -// node_modules/readable-stream/lib/ours/index.js -var require_ours = __commonJS({ - "node_modules/readable-stream/lib/ours/index.js"(exports2, module2) { - "use strict"; - var Stream = require("stream"); - if (Stream && process.env.READABLE_STREAM === "disable") { - const promises6 = Stream.promises; - module2.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer; - module2.exports._isUint8Array = Stream._isUint8Array; - module2.exports.isDisturbed = Stream.isDisturbed; - module2.exports.isErrored = Stream.isErrored; - module2.exports.isReadable = Stream.isReadable; - module2.exports.Readable = Stream.Readable; - module2.exports.Writable = Stream.Writable; - module2.exports.Duplex = Stream.Duplex; - module2.exports.Transform = Stream.Transform; - module2.exports.PassThrough = Stream.PassThrough; - module2.exports.addAbortSignal = Stream.addAbortSignal; - module2.exports.finished = Stream.finished; - module2.exports.destroy = Stream.destroy; - module2.exports.pipeline = Stream.pipeline; - module2.exports.compose = Stream.compose; - Object.defineProperty(Stream, "promises", { - configurable: true, - enumerable: true, - get() { - return promises6; - } - }); - module2.exports.Stream = Stream.Stream; - } else { - const CustomStream = require_stream2(); - const promises6 = require_promises(); - const originalDestroy = CustomStream.Readable.destroy; - module2.exports = CustomStream.Readable; - module2.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer; - module2.exports._isUint8Array = CustomStream._isUint8Array; - module2.exports.isDisturbed = CustomStream.isDisturbed; - module2.exports.isErrored = CustomStream.isErrored; - module2.exports.isReadable = CustomStream.isReadable; - module2.exports.Readable = CustomStream.Readable; - module2.exports.Writable = CustomStream.Writable; - module2.exports.Duplex = CustomStream.Duplex; - module2.exports.Transform = CustomStream.Transform; - module2.exports.PassThrough = CustomStream.PassThrough; - module2.exports.addAbortSignal = CustomStream.addAbortSignal; - module2.exports.finished = CustomStream.finished; - module2.exports.destroy = CustomStream.destroy; - module2.exports.destroy = originalDestroy; - module2.exports.pipeline = CustomStream.pipeline; - module2.exports.compose = CustomStream.compose; - Object.defineProperty(CustomStream, "promises", { - configurable: true, - enumerable: true, - get() { - return promises6; - } - }); - module2.exports.Stream = CustomStream.Stream; - } - module2.exports.default = module2.exports; - } -}); - -// node_modules/lodash/_arrayPush.js -var require_arrayPush = __commonJS({ - "node_modules/lodash/_arrayPush.js"(exports2, module2) { - function arrayPush(array2, values) { - var index2 = -1, length = values.length, offset = array2.length; - while (++index2 < length) { - array2[offset + index2] = values[index2]; - } - return array2; - } - module2.exports = arrayPush; - } -}); - -// node_modules/lodash/_isFlattenable.js -var require_isFlattenable = __commonJS({ - "node_modules/lodash/_isFlattenable.js"(exports2, module2) { - var Symbol2 = require_Symbol(); - var isArguments = require_isArguments(); - var isArray2 = require_isArray(); - var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0; - function isFlattenable(value) { - return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); - } - module2.exports = isFlattenable; - } -}); - -// node_modules/lodash/_baseFlatten.js -var require_baseFlatten = __commonJS({ - "node_modules/lodash/_baseFlatten.js"(exports2, module2) { - var arrayPush = require_arrayPush(); - var isFlattenable = require_isFlattenable(); - function baseFlatten(array2, depth, predicate, isStrict, result) { - var index2 = -1, length = array2.length; - predicate || (predicate = isFlattenable); - result || (result = []); - while (++index2 < length) { - var value = array2[index2]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - module2.exports = baseFlatten; - } -}); - -// node_modules/lodash/flatten.js -var require_flatten = __commonJS({ - "node_modules/lodash/flatten.js"(exports2, module2) { - var baseFlatten = require_baseFlatten(); - function flatten(array2) { - var length = array2 == null ? 0 : array2.length; - return length ? baseFlatten(array2, 1) : []; - } - module2.exports = flatten; - } -}); - -// node_modules/lodash/_nativeCreate.js -var require_nativeCreate = __commonJS({ - "node_modules/lodash/_nativeCreate.js"(exports2, module2) { - var getNative = require_getNative(); - var nativeCreate = getNative(Object, "create"); - module2.exports = nativeCreate; - } -}); - -// node_modules/lodash/_hashClear.js -var require_hashClear = __commonJS({ - "node_modules/lodash/_hashClear.js"(exports2, module2) { - var nativeCreate = require_nativeCreate(); - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } - module2.exports = hashClear; - } -}); - -// node_modules/lodash/_hashDelete.js -var require_hashDelete = __commonJS({ - "node_modules/lodash/_hashDelete.js"(exports2, module2) { - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } - module2.exports = hashDelete; - } -}); - -// node_modules/lodash/_hashGet.js -var require_hashGet = __commonJS({ - "node_modules/lodash/_hashGet.js"(exports2, module2) { - var nativeCreate = require_nativeCreate(); - var HASH_UNDEFINED = "__lodash_hash_undefined__"; - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? void 0 : result; - } - return hasOwnProperty.call(data, key) ? data[key] : void 0; - } - module2.exports = hashGet; - } -}); - -// node_modules/lodash/_hashHas.js -var require_hashHas = __commonJS({ - "node_modules/lodash/_hashHas.js"(exports2, module2) { - var nativeCreate = require_nativeCreate(); - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key); - } - module2.exports = hashHas; - } -}); - -// node_modules/lodash/_hashSet.js -var require_hashSet = __commonJS({ - "node_modules/lodash/_hashSet.js"(exports2, module2) { - var nativeCreate = require_nativeCreate(); - var HASH_UNDEFINED = "__lodash_hash_undefined__"; - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; - return this; - } - module2.exports = hashSet; - } -}); - -// node_modules/lodash/_Hash.js -var require_Hash = __commonJS({ - "node_modules/lodash/_Hash.js"(exports2, module2) { - var hashClear = require_hashClear(); - var hashDelete = require_hashDelete(); - var hashGet = require_hashGet(); - var hashHas = require_hashHas(); - var hashSet = require_hashSet(); - function Hash(entries) { - var index2 = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index2 < length) { - var entry = entries[index2]; - this.set(entry[0], entry[1]); - } - } - Hash.prototype.clear = hashClear; - Hash.prototype["delete"] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - module2.exports = Hash; - } -}); - -// node_modules/lodash/_listCacheClear.js -var require_listCacheClear = __commonJS({ - "node_modules/lodash/_listCacheClear.js"(exports2, module2) { - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } - module2.exports = listCacheClear; - } -}); - -// node_modules/lodash/_assocIndexOf.js -var require_assocIndexOf = __commonJS({ - "node_modules/lodash/_assocIndexOf.js"(exports2, module2) { - var eq = require_eq2(); - function assocIndexOf(array2, key) { - var length = array2.length; - while (length--) { - if (eq(array2[length][0], key)) { - return length; - } - } - return -1; - } - module2.exports = assocIndexOf; - } -}); - -// node_modules/lodash/_listCacheDelete.js -var require_listCacheDelete = __commonJS({ - "node_modules/lodash/_listCacheDelete.js"(exports2, module2) { - var assocIndexOf = require_assocIndexOf(); - var arrayProto = Array.prototype; - var splice = arrayProto.splice; - function listCacheDelete(key) { - var data = this.__data__, index2 = assocIndexOf(data, key); - if (index2 < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index2 == lastIndex) { - data.pop(); - } else { - splice.call(data, index2, 1); - } - --this.size; - return true; - } - module2.exports = listCacheDelete; - } -}); - -// node_modules/lodash/_listCacheGet.js -var require_listCacheGet = __commonJS({ - "node_modules/lodash/_listCacheGet.js"(exports2, module2) { - var assocIndexOf = require_assocIndexOf(); - function listCacheGet(key) { - var data = this.__data__, index2 = assocIndexOf(data, key); - return index2 < 0 ? void 0 : data[index2][1]; - } - module2.exports = listCacheGet; - } -}); - -// node_modules/lodash/_listCacheHas.js -var require_listCacheHas = __commonJS({ - "node_modules/lodash/_listCacheHas.js"(exports2, module2) { - var assocIndexOf = require_assocIndexOf(); - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - module2.exports = listCacheHas; - } -}); - -// node_modules/lodash/_listCacheSet.js -var require_listCacheSet = __commonJS({ - "node_modules/lodash/_listCacheSet.js"(exports2, module2) { - var assocIndexOf = require_assocIndexOf(); - function listCacheSet(key, value) { - var data = this.__data__, index2 = assocIndexOf(data, key); - if (index2 < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index2][1] = value; - } - return this; - } - module2.exports = listCacheSet; - } -}); - -// node_modules/lodash/_ListCache.js -var require_ListCache = __commonJS({ - "node_modules/lodash/_ListCache.js"(exports2, module2) { - var listCacheClear = require_listCacheClear(); - var listCacheDelete = require_listCacheDelete(); - var listCacheGet = require_listCacheGet(); - var listCacheHas = require_listCacheHas(); - var listCacheSet = require_listCacheSet(); - function ListCache(entries) { - var index2 = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index2 < length) { - var entry = entries[index2]; - this.set(entry[0], entry[1]); - } - } - ListCache.prototype.clear = listCacheClear; - ListCache.prototype["delete"] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - module2.exports = ListCache; - } -}); - -// node_modules/lodash/_Map.js -var require_Map = __commonJS({ - "node_modules/lodash/_Map.js"(exports2, module2) { - var getNative = require_getNative(); - var root = require_root(); - var Map2 = getNative(root, "Map"); - module2.exports = Map2; - } -}); - -// node_modules/lodash/_mapCacheClear.js -var require_mapCacheClear = __commonJS({ - "node_modules/lodash/_mapCacheClear.js"(exports2, module2) { - var Hash = require_Hash(); - var ListCache = require_ListCache(); - var Map2 = require_Map(); - function mapCacheClear() { - this.size = 0; - this.__data__ = { - "hash": new Hash(), - "map": new (Map2 || ListCache)(), - "string": new Hash() - }; - } - module2.exports = mapCacheClear; - } -}); - -// node_modules/lodash/_isKeyable.js -var require_isKeyable = __commonJS({ - "node_modules/lodash/_isKeyable.js"(exports2, module2) { - function isKeyable(value) { - var type = typeof value; - return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; - } - module2.exports = isKeyable; - } -}); - -// node_modules/lodash/_getMapData.js -var require_getMapData = __commonJS({ - "node_modules/lodash/_getMapData.js"(exports2, module2) { - var isKeyable = require_isKeyable(); - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; - } - module2.exports = getMapData; - } -}); - -// node_modules/lodash/_mapCacheDelete.js -var require_mapCacheDelete = __commonJS({ - "node_modules/lodash/_mapCacheDelete.js"(exports2, module2) { - var getMapData = require_getMapData(); - function mapCacheDelete(key) { - var result = getMapData(this, key)["delete"](key); - this.size -= result ? 1 : 0; - return result; - } - module2.exports = mapCacheDelete; - } -}); - -// node_modules/lodash/_mapCacheGet.js -var require_mapCacheGet = __commonJS({ - "node_modules/lodash/_mapCacheGet.js"(exports2, module2) { - var getMapData = require_getMapData(); - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - module2.exports = mapCacheGet; - } -}); - -// node_modules/lodash/_mapCacheHas.js -var require_mapCacheHas = __commonJS({ - "node_modules/lodash/_mapCacheHas.js"(exports2, module2) { - var getMapData = require_getMapData(); - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - module2.exports = mapCacheHas; - } -}); - -// node_modules/lodash/_mapCacheSet.js -var require_mapCacheSet = __commonJS({ - "node_modules/lodash/_mapCacheSet.js"(exports2, module2) { - var getMapData = require_getMapData(); - function mapCacheSet(key, value) { - var data = getMapData(this, key), size = data.size; - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } - module2.exports = mapCacheSet; - } -}); - -// node_modules/lodash/_MapCache.js -var require_MapCache = __commonJS({ - "node_modules/lodash/_MapCache.js"(exports2, module2) { - var mapCacheClear = require_mapCacheClear(); - var mapCacheDelete = require_mapCacheDelete(); - var mapCacheGet = require_mapCacheGet(); - var mapCacheHas = require_mapCacheHas(); - var mapCacheSet = require_mapCacheSet(); - function MapCache(entries) { - var index2 = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index2 < length) { - var entry = entries[index2]; - this.set(entry[0], entry[1]); - } - } - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype["delete"] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - module2.exports = MapCache; - } -}); - -// node_modules/lodash/_setCacheAdd.js -var require_setCacheAdd = __commonJS({ - "node_modules/lodash/_setCacheAdd.js"(exports2, module2) { - var HASH_UNDEFINED = "__lodash_hash_undefined__"; - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - module2.exports = setCacheAdd; - } -}); - -// node_modules/lodash/_setCacheHas.js -var require_setCacheHas = __commonJS({ - "node_modules/lodash/_setCacheHas.js"(exports2, module2) { - function setCacheHas(value) { - return this.__data__.has(value); - } - module2.exports = setCacheHas; - } -}); - -// node_modules/lodash/_SetCache.js -var require_SetCache = __commonJS({ - "node_modules/lodash/_SetCache.js"(exports2, module2) { - var MapCache = require_MapCache(); - var setCacheAdd = require_setCacheAdd(); - var setCacheHas = require_setCacheHas(); - function SetCache(values) { - var index2 = -1, length = values == null ? 0 : values.length; - this.__data__ = new MapCache(); - while (++index2 < length) { - this.add(values[index2]); - } - } - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - module2.exports = SetCache; - } -}); - -// node_modules/lodash/_baseFindIndex.js -var require_baseFindIndex = __commonJS({ - "node_modules/lodash/_baseFindIndex.js"(exports2, module2) { - function baseFindIndex(array2, predicate, fromIndex, fromRight) { - var length = array2.length, index2 = fromIndex + (fromRight ? 1 : -1); - while (fromRight ? index2-- : ++index2 < length) { - if (predicate(array2[index2], index2, array2)) { - return index2; - } - } - return -1; - } - module2.exports = baseFindIndex; - } -}); - -// node_modules/lodash/_baseIsNaN.js -var require_baseIsNaN = __commonJS({ - "node_modules/lodash/_baseIsNaN.js"(exports2, module2) { - function baseIsNaN(value) { - return value !== value; - } - module2.exports = baseIsNaN; - } -}); - -// node_modules/lodash/_strictIndexOf.js -var require_strictIndexOf = __commonJS({ - "node_modules/lodash/_strictIndexOf.js"(exports2, module2) { - function strictIndexOf(array2, value, fromIndex) { - var index2 = fromIndex - 1, length = array2.length; - while (++index2 < length) { - if (array2[index2] === value) { - return index2; - } - } - return -1; - } - module2.exports = strictIndexOf; - } -}); - -// node_modules/lodash/_baseIndexOf.js -var require_baseIndexOf = __commonJS({ - "node_modules/lodash/_baseIndexOf.js"(exports2, module2) { - var baseFindIndex = require_baseFindIndex(); - var baseIsNaN = require_baseIsNaN(); - var strictIndexOf = require_strictIndexOf(); - function baseIndexOf(array2, value, fromIndex) { - return value === value ? strictIndexOf(array2, value, fromIndex) : baseFindIndex(array2, baseIsNaN, fromIndex); - } - module2.exports = baseIndexOf; - } -}); - -// node_modules/lodash/_arrayIncludes.js -var require_arrayIncludes = __commonJS({ - "node_modules/lodash/_arrayIncludes.js"(exports2, module2) { - var baseIndexOf = require_baseIndexOf(); - function arrayIncludes(array2, value) { - var length = array2 == null ? 0 : array2.length; - return !!length && baseIndexOf(array2, value, 0) > -1; - } - module2.exports = arrayIncludes; - } -}); - -// node_modules/lodash/_arrayIncludesWith.js -var require_arrayIncludesWith = __commonJS({ - "node_modules/lodash/_arrayIncludesWith.js"(exports2, module2) { - function arrayIncludesWith(array2, value, comparator) { - var index2 = -1, length = array2 == null ? 0 : array2.length; - while (++index2 < length) { - if (comparator(value, array2[index2])) { - return true; - } - } - return false; - } - module2.exports = arrayIncludesWith; - } -}); - -// node_modules/lodash/_arrayMap.js -var require_arrayMap = __commonJS({ - "node_modules/lodash/_arrayMap.js"(exports2, module2) { - function arrayMap(array2, iteratee) { - var index2 = -1, length = array2 == null ? 0 : array2.length, result = Array(length); - while (++index2 < length) { - result[index2] = iteratee(array2[index2], index2, array2); - } - return result; - } - module2.exports = arrayMap; - } -}); - -// node_modules/lodash/_cacheHas.js -var require_cacheHas = __commonJS({ - "node_modules/lodash/_cacheHas.js"(exports2, module2) { - function cacheHas(cache, key) { - return cache.has(key); - } - module2.exports = cacheHas; - } -}); - -// node_modules/lodash/_baseDifference.js -var require_baseDifference = __commonJS({ - "node_modules/lodash/_baseDifference.js"(exports2, module2) { - var SetCache = require_SetCache(); - var arrayIncludes = require_arrayIncludes(); - var arrayIncludesWith = require_arrayIncludesWith(); - var arrayMap = require_arrayMap(); - var baseUnary = require_baseUnary(); - var cacheHas = require_cacheHas(); - var LARGE_ARRAY_SIZE = 200; - function baseDifference(array2, values, iteratee, comparator) { - var index2 = -1, includes = arrayIncludes, isCommon = true, length = array2.length, result = [], valuesLength = values.length; - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index2 < length) { - var value = array2[index2], computed = iteratee == null ? value : iteratee(value); - value = comparator || value !== 0 ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } - module2.exports = baseDifference; - } -}); - -// node_modules/lodash/isArrayLikeObject.js -var require_isArrayLikeObject = __commonJS({ - "node_modules/lodash/isArrayLikeObject.js"(exports2, module2) { - var isArrayLike = require_isArrayLike(); - var isObjectLike = require_isObjectLike(); - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - module2.exports = isArrayLikeObject; - } -}); - -// node_modules/lodash/difference.js -var require_difference = __commonJS({ - "node_modules/lodash/difference.js"(exports2, module2) { - var baseDifference = require_baseDifference(); - var baseFlatten = require_baseFlatten(); - var baseRest = require_baseRest(); - var isArrayLikeObject = require_isArrayLikeObject(); - var difference = baseRest(function(array2, values) { - return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values, 1, isArrayLikeObject, true)) : []; - }); - module2.exports = difference; - } -}); - -// node_modules/lodash/_Set.js -var require_Set = __commonJS({ - "node_modules/lodash/_Set.js"(exports2, module2) { - var getNative = require_getNative(); - var root = require_root(); - var Set2 = getNative(root, "Set"); - module2.exports = Set2; - } -}); - -// node_modules/lodash/noop.js -var require_noop = __commonJS({ - "node_modules/lodash/noop.js"(exports2, module2) { - function noop3() { - } - module2.exports = noop3; - } -}); - -// node_modules/lodash/_setToArray.js -var require_setToArray = __commonJS({ - "node_modules/lodash/_setToArray.js"(exports2, module2) { - function setToArray(set) { - var index2 = -1, result = Array(set.size); - set.forEach(function(value) { - result[++index2] = value; - }); - return result; - } - module2.exports = setToArray; - } -}); - -// node_modules/lodash/_createSet.js -var require_createSet = __commonJS({ - "node_modules/lodash/_createSet.js"(exports2, module2) { - var Set2 = require_Set(); - var noop3 = require_noop(); - var setToArray = require_setToArray(); - var INFINITY = 1 / 0; - var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop3 : function(values) { - return new Set2(values); - }; - module2.exports = createSet; - } -}); - -// node_modules/lodash/_baseUniq.js -var require_baseUniq = __commonJS({ - "node_modules/lodash/_baseUniq.js"(exports2, module2) { - var SetCache = require_SetCache(); - var arrayIncludes = require_arrayIncludes(); - var arrayIncludesWith = require_arrayIncludesWith(); - var cacheHas = require_cacheHas(); - var createSet = require_createSet(); - var setToArray = require_setToArray(); - var LARGE_ARRAY_SIZE = 200; - function baseUniq(array2, iteratee, comparator) { - var index2 = -1, includes = arrayIncludes, length = array2.length, isCommon = true, result = [], seen = result; - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array2); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache(); - } else { - seen = iteratee ? [] : result; - } - outer: - while (++index2 < length) { - var value = array2[index2], computed = iteratee ? iteratee(value) : value; - value = comparator || value !== 0 ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - module2.exports = baseUniq; - } -}); - -// node_modules/lodash/union.js -var require_union = __commonJS({ - "node_modules/lodash/union.js"(exports2, module2) { - var baseFlatten = require_baseFlatten(); - var baseRest = require_baseRest(); - var baseUniq = require_baseUniq(); - var isArrayLikeObject = require_isArrayLikeObject(); - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); - module2.exports = union; - } -}); - -// node_modules/lodash/_overArg.js -var require_overArg = __commonJS({ - "node_modules/lodash/_overArg.js"(exports2, module2) { - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - module2.exports = overArg; - } -}); - -// node_modules/lodash/_getPrototype.js -var require_getPrototype = __commonJS({ - "node_modules/lodash/_getPrototype.js"(exports2, module2) { - var overArg = require_overArg(); - var getPrototype = overArg(Object.getPrototypeOf, Object); - module2.exports = getPrototype; - } -}); - -// node_modules/lodash/isPlainObject.js -var require_isPlainObject = __commonJS({ - "node_modules/lodash/isPlainObject.js"(exports2, module2) { - var baseGetTag = require_baseGetTag(); - var getPrototype = require_getPrototype(); - var isObjectLike = require_isObjectLike(); - var objectTag = "[object Object]"; - var funcProto = Function.prototype; - var objectProto = Object.prototype; - var funcToString = funcProto.toString; - var hasOwnProperty = objectProto.hasOwnProperty; - var objectCtorString = funcToString.call(Object); - function isPlainObject4(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; - } - module2.exports = isPlainObject4; - } -}); - -// node_modules/glob/dist/commonjs/index.min.js -var require_index_min = __commonJS({ - "node_modules/glob/dist/commonjs/index.min.js"(exports2) { - "use strict"; - var R = (n, t) => () => (t || n((t = { exports: {} }).exports, t), t.exports); - var Ge = R((Y) => { - "use strict"; - Object.defineProperty(Y, "__esModule", { value: true }); - Y.range = Y.balanced = void 0; - var Gs = (n, t, e) => { - let s = n instanceof RegExp ? Ie(n, e) : n, i = t instanceof RegExp ? Ie(t, e) : t, r = s !== null && i != null && (0, Y.range)(s, i, e); - return r && { start: r[0], end: r[1], pre: e.slice(0, r[0]), body: e.slice(r[0] + s.length, r[1]), post: e.slice(r[1] + i.length) }; - }; - Y.balanced = Gs; - var Ie = (n, t) => { - let e = t.match(n); - return e ? e[0] : null; - }, zs = (n, t, e) => { - let s, i, r, h, o, a = e.indexOf(n), l = e.indexOf(t, a + 1), f = a; - if (a >= 0 && l > 0) { - if (n === t) return [a, l]; - for (s = [], r = e.length; f >= 0 && !o; ) { - if (f === a) s.push(f), a = e.indexOf(n, f + 1); - else if (s.length === 1) { - let c = s.pop(); - c !== void 0 && (o = [c, l]); - } else i = s.pop(), i !== void 0 && i < r && (r = i, h = l), l = e.indexOf(t, f + 1); - f = a < l && a >= 0 ? a : l; - } - s.length && h !== void 0 && (o = [r, h]); - } - return o; - }; - Y.range = zs; - }); - var Ke = R((it) => { - "use strict"; - Object.defineProperty(it, "__esModule", { value: true }); - it.EXPANSION_MAX = void 0; - it.expand = ei; - var ze = Ge(), Ue = "\0SLASH" + Math.random() + "\0", $e = "\0OPEN" + Math.random() + "\0", ue = "\0CLOSE" + Math.random() + "\0", qe = "\0COMMA" + Math.random() + "\0", He = "\0PERIOD" + Math.random() + "\0", Us = new RegExp(Ue, "g"), $s = new RegExp($e, "g"), qs = new RegExp(ue, "g"), Hs = new RegExp(qe, "g"), Vs = new RegExp(He, "g"), Ks = /\\\\/g, Xs = /\\{/g, Ys = /\\}/g, Js = /\\,/g, Zs = /\\./g; - it.EXPANSION_MAX = 1e5; - function ce(n) { - return isNaN(n) ? n.charCodeAt(0) : parseInt(n, 10); - } - function Qs(n) { - return n.replace(Ks, Ue).replace(Xs, $e).replace(Ys, ue).replace(Js, qe).replace(Zs, He); - } - function ti(n) { - return n.replace(Us, "\\").replace($s, "{").replace(qs, "}").replace(Hs, ",").replace(Vs, "."); - } - function Ve(n) { - if (!n) return [""]; - let t = [], e = (0, ze.balanced)("{", "}", n); - if (!e) return n.split(","); - let { pre: s, body: i, post: r } = e, h = s.split(","); - h[h.length - 1] += "{" + i + "}"; - let o = Ve(r); - return r.length && (h[h.length - 1] += o.shift(), h.push.apply(h, o)), t.push.apply(t, h), t; - } - function ei(n, t = {}) { - if (!n) return []; - let { max: e = it.EXPANSION_MAX } = t; - return n.slice(0, 2) === "{}" && (n = "\\{\\}" + n.slice(2)), ht(Qs(n), e, true).map(ti); - } - function si(n) { - return "{" + n + "}"; - } - function ii(n) { - return /^-?0\d/.test(n); - } - function ri(n, t) { - return n <= t; - } - function ni(n, t) { - return n >= t; - } - function ht(n, t, e) { - let s = [], i = (0, ze.balanced)("{", "}", n); - if (!i) return [n]; - let r = i.pre, h = i.post.length ? ht(i.post, t, false) : [""]; - if (/\$$/.test(i.pre)) for (let o = 0; o < h.length && o < t; o++) { - let a = r + "{" + i.body + "}" + h[o]; - s.push(a); - } - else { - let o = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = o || a, f = i.body.indexOf(",") >= 0; - if (!l && !f) return i.post.match(/,(?!,).*\}/) ? (n = i.pre + "{" + i.body + ue + i.post, ht(n, t, true)) : [n]; - let c; - if (l) c = i.body.split(/\.\./); - else if (c = Ve(i.body), c.length === 1 && c[0] !== void 0 && (c = ht(c[0], t, false).map(si), c.length === 1)) return h.map((u) => i.pre + c[0] + u); - let d; - if (l && c[0] !== void 0 && c[1] !== void 0) { - let u = ce(c[0]), m = ce(c[1]), p = Math.max(c[0].length, c[1].length), b = c.length === 3 && c[2] !== void 0 ? Math.abs(ce(c[2])) : 1, w = ri; - m < u && (b *= -1, w = ni); - let E = c.some(ii); - d = []; - for (let y = u; w(y, m); y += b) { - let S; - if (a) S = String.fromCharCode(y), S === "\\" && (S = ""); - else if (S = String(y), E) { - let B = p - S.length; - if (B > 0) { - let U = new Array(B + 1).join("0"); - y < 0 ? S = "-" + U + S.slice(1) : S = U + S; - } - } - d.push(S); - } - } else { - d = []; - for (let u = 0; u < c.length; u++) d.push.apply(d, ht(c[u], t, false)); - } - for (let u = 0; u < d.length; u++) for (let m = 0; m < h.length && s.length < t; m++) { - let p = r + d[u] + h[m]; - (!e || l || p) && s.push(p); - } - } - return s; - } - }); - var Xe = R((Ct) => { - "use strict"; - Object.defineProperty(Ct, "__esModule", { value: true }); - Ct.assertValidPattern = void 0; - var hi = 1024 * 64, oi = (n) => { - if (typeof n != "string") throw new TypeError("invalid pattern"); - if (n.length > hi) throw new TypeError("pattern is too long"); - }; - Ct.assertValidPattern = oi; - }); - var Je = R((Rt) => { - "use strict"; - Object.defineProperty(Rt, "__esModule", { value: true }); - Rt.parseClass = void 0; - var ai = { "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true], "[:alpha:]": ["\\p{L}\\p{Nl}", true], "[:ascii:]": ["\\x00-\\x7f", false], "[:blank:]": ["\\p{Zs}\\t", true], "[:cntrl:]": ["\\p{Cc}", true], "[:digit:]": ["\\p{Nd}", true], "[:graph:]": ["\\p{Z}\\p{C}", true, true], "[:lower:]": ["\\p{Ll}", true], "[:print:]": ["\\p{C}", true], "[:punct:]": ["\\p{P}", true], "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true], "[:upper:]": ["\\p{Lu}", true], "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true], "[:xdigit:]": ["A-Fa-f0-9", false] }, ot = (n) => n.replace(/[[\]\\-]/g, "\\$&"), li = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Ye = (n) => n.join(""), ci = (n, t) => { - let e = t; - if (n.charAt(e) !== "[") throw new Error("not in a brace expression"); - let s = [], i = [], r = e + 1, h = false, o = false, a = false, l = false, f = e, c = ""; - t: for (; r < n.length; ) { - let p = n.charAt(r); - if ((p === "!" || p === "^") && r === e + 1) { - l = true, r++; - continue; - } - if (p === "]" && h && !a) { - f = r + 1; - break; - } - if (h = true, p === "\\" && !a) { - a = true, r++; - continue; - } - if (p === "[" && !a) { - for (let [b, [w, v, E]] of Object.entries(ai)) if (n.startsWith(b, r)) { - if (c) return ["$.", false, n.length - e, true]; - r += b.length, E ? i.push(w) : s.push(w), o = o || v; - continue t; - } - } - if (a = false, c) { - p > c ? s.push(ot(c) + "-" + ot(p)) : p === c && s.push(ot(p)), c = "", r++; - continue; - } - if (n.startsWith("-]", r + 1)) { - s.push(ot(p + "-")), r += 2; - continue; - } - if (n.startsWith("-", r + 1)) { - c = p, r += 2; - continue; - } - s.push(ot(p)), r++; - } - if (f < r) return ["", false, 0, false]; - if (!s.length && !i.length) return ["$.", false, n.length - e, true]; - if (i.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !l) { - let p = s[0].length === 2 ? s[0].slice(-1) : s[0]; - return [li(p), false, f - e, false]; - } - let d = "[" + (l ? "^" : "") + Ye(s) + "]", u = "[" + (l ? "" : "^") + Ye(i) + "]"; - return [s.length && i.length ? "(" + d + "|" + u + ")" : s.length ? d : u, o, f - e, true]; - }; - Rt.parseClass = ci; - }); - var kt = R((At) => { - "use strict"; - Object.defineProperty(At, "__esModule", { value: true }); - At.unescape = void 0; - var ui = (n, { windowsPathsNoEscape: t = false, magicalBraces: e = true } = {}) => e ? t ? n.replace(/\[([^\/\\])\]/g, "$1") : n.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1") : t ? n.replace(/\[([^\/\\{}])\]/g, "$1") : n.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1"); - At.unescape = ui; - }); - var pe = R((Dt) => { - "use strict"; - Object.defineProperty(Dt, "__esModule", { value: true }); - Dt.AST = void 0; - var fi = Je(), Mt = kt(), di = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), Ze = (n) => di.has(n), pi = "(?!(?:^|/)\\.\\.?(?:$|/))", Pt = "(?!\\.)", mi = /* @__PURE__ */ new Set(["[", "."]), gi = /* @__PURE__ */ new Set(["..", "."]), wi = new Set("().*{}+?[]^$\\!"), bi = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), de = "[^/]", Qe = de + "*?", ts = de + "+?", fe = class n { - type; - #t; - #s; - #n = false; - #r = []; - #h; - #S; - #w; - #c = false; - #o; - #f; - #u = false; - constructor(t, e, s = {}) { - this.type = t, t && (this.#s = true), this.#h = e, this.#t = this.#h ? this.#h.#t : this, this.#o = this.#t === this ? s : this.#t.#o, this.#w = this.#t === this ? [] : this.#t.#w, t === "!" && !this.#t.#c && this.#w.push(this), this.#S = this.#h ? this.#h.#r.length : 0; - } - get hasMagic() { - if (this.#s !== void 0) return this.#s; - for (let t of this.#r) if (typeof t != "string" && (t.type || t.hasMagic)) return this.#s = true; - return this.#s; - } - toString() { - return this.#f !== void 0 ? this.#f : this.type ? this.#f = this.type + "(" + this.#r.map((t) => String(t)).join("|") + ")" : this.#f = this.#r.map((t) => String(t)).join(""); - } - #a() { - if (this !== this.#t) throw new Error("should only call on root"); - if (this.#c) return this; - this.toString(), this.#c = true; - let t; - for (; t = this.#w.pop(); ) { - if (t.type !== "!") continue; - let e = t, s = e.#h; - for (; s; ) { - for (let i = e.#S + 1; !s.type && i < s.#r.length; i++) for (let r of t.#r) { - if (typeof r == "string") throw new Error("string part in extglob AST??"); - r.copyIn(s.#r[i]); - } - e = s, s = e.#h; - } - } - return this; - } - push(...t) { - for (let e of t) if (e !== "") { - if (typeof e != "string" && !(e instanceof n && e.#h === this)) throw new Error("invalid part: " + e); - this.#r.push(e); - } - } - toJSON() { - let t = this.type === null ? this.#r.slice().map((e) => typeof e == "string" ? e : e.toJSON()) : [this.type, ...this.#r.map((e) => e.toJSON())]; - return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === this.#t || this.#t.#c && this.#h?.type === "!") && t.push({}), t; - } - isStart() { - if (this.#t === this) return true; - if (!this.#h?.isStart()) return false; - if (this.#S === 0) return true; - let t = this.#h; - for (let e = 0; e < this.#S; e++) { - let s = t.#r[e]; - if (!(s instanceof n && s.type === "!")) return false; - } - return true; - } - isEnd() { - if (this.#t === this || this.#h?.type === "!") return true; - if (!this.#h?.isEnd()) return false; - if (!this.type) return this.#h?.isEnd(); - let t = this.#h ? this.#h.#r.length : 0; - return this.#S === t - 1; - } - copyIn(t) { - typeof t == "string" ? this.push(t) : this.push(t.clone(this)); - } - clone(t) { - let e = new n(this.type, t); - for (let s of this.#r) e.copyIn(s); - return e; - } - static #i(t, e, s, i) { - let r = false, h = false, o = -1, a = false; - if (e.type === null) { - let u = s, m = ""; - for (; u < t.length; ) { - let p = t.charAt(u++); - if (r || p === "\\") { - r = !r, m += p; - continue; - } - if (h) { - u === o + 1 ? (p === "^" || p === "!") && (a = true) : p === "]" && !(u === o + 2 && a) && (h = false), m += p; - continue; - } else if (p === "[") { - h = true, o = u, a = false, m += p; - continue; - } - if (!i.noext && Ze(p) && t.charAt(u) === "(") { - e.push(m), m = ""; - let b = new n(p, e); - u = n.#i(t, b, u, i), e.push(b); - continue; - } - m += p; - } - return e.push(m), u; - } - let l = s + 1, f = new n(null, e), c = [], d = ""; - for (; l < t.length; ) { - let u = t.charAt(l++); - if (r || u === "\\") { - r = !r, d += u; - continue; - } - if (h) { - l === o + 1 ? (u === "^" || u === "!") && (a = true) : u === "]" && !(l === o + 2 && a) && (h = false), d += u; - continue; - } else if (u === "[") { - h = true, o = l, a = false, d += u; - continue; - } - if (Ze(u) && t.charAt(l) === "(") { - f.push(d), d = ""; - let m = new n(u, f); - f.push(m), l = n.#i(t, m, l, i); - continue; - } - if (u === "|") { - f.push(d), d = "", c.push(f), f = new n(null, e); - continue; - } - if (u === ")") return d === "" && e.#r.length === 0 && (e.#u = true), f.push(d), d = "", e.push(...c, f), l; - d += u; - } - return e.type = null, e.#s = void 0, e.#r = [t.substring(s - 1)], l; - } - static fromGlob(t, e = {}) { - let s = new n(null, void 0, e); - return n.#i(t, s, 0, e), s; - } - toMMPattern() { - if (this !== this.#t) return this.#t.toMMPattern(); - let t = this.toString(), [e, s, i, r] = this.toRegExpSource(); - if (!(i || this.#s || this.#o.nocase && !this.#o.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase())) return s; - let o = (this.#o.nocase ? "i" : "") + (r ? "u" : ""); - return Object.assign(new RegExp(`^${e}$`, o), { _src: e, _glob: t }); - } - get options() { - return this.#o; - } - toRegExpSource(t) { - let e = t ?? !!this.#o.dot; - if (this.#t === this && this.#a(), !this.type) { - let a = this.isStart() && this.isEnd() && !this.#r.some((u) => typeof u != "string"), l = this.#r.map((u) => { - let [m, p, b, w] = typeof u == "string" ? n.#v(u, this.#s, a) : u.toRegExpSource(t); - return this.#s = this.#s || b, this.#n = this.#n || w, m; - }).join(""), f = ""; - if (this.isStart() && typeof this.#r[0] == "string" && !(this.#r.length === 1 && gi.has(this.#r[0]))) { - let m = mi, p = e && m.has(l.charAt(0)) || l.startsWith("\\.") && m.has(l.charAt(2)) || l.startsWith("\\.\\.") && m.has(l.charAt(4)), b = !e && !t && m.has(l.charAt(0)); - f = p ? pi : b ? Pt : ""; - } - let c = ""; - return this.isEnd() && this.#t.#c && this.#h?.type === "!" && (c = "(?:$|\\/)"), [f + l + c, (0, Mt.unescape)(l), this.#s = !!this.#s, this.#n]; - } - let s = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:", r = this.#d(e); - if (this.isStart() && this.isEnd() && !r && this.type !== "!") { - let a = this.toString(); - return this.#r = [a], this.type = null, this.#s = void 0, [a, (0, Mt.unescape)(this.toString()), false, false]; - } - let h = !s || t || e || !Pt ? "" : this.#d(true); - h === r && (h = ""), h && (r = `(?:${r})(?:${h})*?`); - let o = ""; - if (this.type === "!" && this.#u) o = (this.isStart() && !e ? Pt : "") + ts; - else { - let a = this.type === "!" ? "))" + (this.isStart() && !e && !t ? Pt : "") + Qe + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && h ? ")" : this.type === "*" && h ? ")?" : `)${this.type}`; - o = i + r + a; - } - return [o, (0, Mt.unescape)(r), this.#s = !!this.#s, this.#n]; - } - #d(t) { - return this.#r.map((e) => { - if (typeof e == "string") throw new Error("string type in extglob ast??"); - let [s, i, r, h] = e.toRegExpSource(t); - return this.#n = this.#n || h, s; - }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|"); - } - static #v(t, e, s = false) { - let i = false, r = "", h = false, o = false; - for (let a = 0; a < t.length; a++) { - let l = t.charAt(a); - if (i) { - i = false, r += (wi.has(l) ? "\\" : "") + l; - continue; - } - if (l === "*") { - if (o) continue; - o = true, r += s && /^[*]+$/.test(t) ? ts : Qe, e = true; - continue; - } else o = false; - if (l === "\\") { - a === t.length - 1 ? r += "\\\\" : i = true; - continue; - } - if (l === "[") { - let [f, c, d, u] = (0, fi.parseClass)(t, a); - if (d) { - r += f, h = h || c, a += d - 1, e = e || u; - continue; - } - } - if (l === "?") { - r += de, e = true; - continue; - } - r += bi(l); - } - return [r, (0, Mt.unescape)(t), !!e, h]; - } - }; - Dt.AST = fe; - }); - var me = R((Ft) => { - "use strict"; - Object.defineProperty(Ft, "__esModule", { value: true }); - Ft.escape = void 0; - var yi = (n, { windowsPathsNoEscape: t = false, magicalBraces: e = false } = {}) => e ? t ? n.replace(/[?*()[\]{}]/g, "[$&]") : n.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n.replace(/[?*()[\]]/g, "[$&]") : n.replace(/[?*()[\]\\]/g, "\\$&"); - Ft.escape = yi; - }); - var H = R((g) => { - "use strict"; - Object.defineProperty(g, "__esModule", { value: true }); - g.unescape = g.escape = g.AST = g.Minimatch = g.match = g.makeRe = g.braceExpand = g.defaults = g.filter = g.GLOBSTAR = g.sep = g.minimatch = void 0; - var Si = Ke(), jt = Xe(), is = pe(), vi = me(), Ei = kt(), _i = (n, t, e = {}) => ((0, jt.assertValidPattern)(t), !e.nocomment && t.charAt(0) === "#" ? false : new J(t, e).match(n)); - g.minimatch = _i; - var Oi = /^\*+([^+@!?\*\[\(]*)$/, xi = (n) => (t) => !t.startsWith(".") && t.endsWith(n), Ti = (n) => (t) => t.endsWith(n), Ci = (n) => (n = n.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(n)), Ri = (n) => (n = n.toLowerCase(), (t) => t.toLowerCase().endsWith(n)), Ai = /^\*+\.\*+$/, ki = (n) => !n.startsWith(".") && n.includes("."), Mi = (n) => n !== "." && n !== ".." && n.includes("."), Pi = /^\.\*+$/, Di = (n) => n !== "." && n !== ".." && n.startsWith("."), Fi = /^\*+$/, ji = (n) => n.length !== 0 && !n.startsWith("."), Ni = (n) => n.length !== 0 && n !== "." && n !== "..", Li = /^\?+([^+@!?\*\[\(]*)?$/, Wi = ([n, t = ""]) => { - let e = rs([n]); - return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e; - }, Bi = ([n, t = ""]) => { - let e = ns([n]); - return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e; - }, Ii = ([n, t = ""]) => { - let e = ns([n]); - return t ? (s) => e(s) && s.endsWith(t) : e; - }, Gi = ([n, t = ""]) => { - let e = rs([n]); - return t ? (s) => e(s) && s.endsWith(t) : e; - }, rs = ([n]) => { - let t = n.length; - return (e) => e.length === t && !e.startsWith("."); - }, ns = ([n]) => { - let t = n.length; - return (e) => e.length === t && e !== "." && e !== ".."; - }, hs = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", es = { win32: { sep: "\\" }, posix: { sep: "/" } }; - g.sep = hs === "win32" ? es.win32.sep : es.posix.sep; - g.minimatch.sep = g.sep; - g.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); - g.minimatch.GLOBSTAR = g.GLOBSTAR; - var zi = "[^/]", Ui = zi + "*?", $i = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", qi = "(?:(?!(?:\\/|^)\\.).)*?", Hi = (n, t = {}) => (e) => (0, g.minimatch)(e, n, t); - g.filter = Hi; - g.minimatch.filter = g.filter; - var F = (n, t = {}) => Object.assign({}, n, t), Vi = (n) => { - if (!n || typeof n != "object" || !Object.keys(n).length) return g.minimatch; - let t = g.minimatch; - return Object.assign((s, i, r = {}) => t(s, i, F(n, r)), { Minimatch: class extends t.Minimatch { - constructor(i, r = {}) { - super(i, F(n, r)); - } - static defaults(i) { - return t.defaults(F(n, i)).Minimatch; - } - }, AST: class extends t.AST { - constructor(i, r, h = {}) { - super(i, r, F(n, h)); - } - static fromGlob(i, r = {}) { - return t.AST.fromGlob(i, F(n, r)); - } - }, unescape: (s, i = {}) => t.unescape(s, F(n, i)), escape: (s, i = {}) => t.escape(s, F(n, i)), filter: (s, i = {}) => t.filter(s, F(n, i)), defaults: (s) => t.defaults(F(n, s)), makeRe: (s, i = {}) => t.makeRe(s, F(n, i)), braceExpand: (s, i = {}) => t.braceExpand(s, F(n, i)), match: (s, i, r = {}) => t.match(s, i, F(n, r)), sep: t.sep, GLOBSTAR: g.GLOBSTAR }); - }; - g.defaults = Vi; - g.minimatch.defaults = g.defaults; - var Ki = (n, t = {}) => ((0, jt.assertValidPattern)(n), t.nobrace || !/\{(?:(?!\{).)*\}/.test(n) ? [n] : (0, Si.expand)(n, { max: t.braceExpandMax })); - g.braceExpand = Ki; - g.minimatch.braceExpand = g.braceExpand; - var Xi = (n, t = {}) => new J(n, t).makeRe(); - g.makeRe = Xi; - g.minimatch.makeRe = g.makeRe; - var Yi = (n, t, e = {}) => { - let s = new J(t, e); - return n = n.filter((i) => s.match(i)), s.options.nonull && !n.length && n.push(t), n; - }; - g.match = Yi; - g.minimatch.match = g.match; - var ss = /[?*]|[+@!]\(.*?\)|\[|\]/, Ji = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), J = class { - options; - set; - pattern; - windowsPathsNoEscape; - nonegate; - negate; - comment; - empty; - preserveMultipleSlashes; - partial; - globSet; - globParts; - nocase; - isWindows; - platform; - windowsNoMagicRoot; - regexp; - constructor(t, e = {}) { - (0, jt.assertValidPattern)(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || hs, this.isWindows = this.platform === "win32"; - let s = "allowWindowsEscape"; - this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e[s] === false, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = false, this.nonegate = !!e.nonegate, this.comment = false, this.empty = false, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make(); - } - hasMagic() { - if (this.options.magicalBraces && this.set.length > 1) return true; - for (let t of this.set) for (let e of t) if (typeof e != "string") return true; - return false; - } - debug(...t) { - } - make() { - let t = this.pattern, e = this.options; - if (!e.nocomment && t.charAt(0) === "#") { - this.comment = true; - return; - } - if (!t) { - this.empty = true; - return; - } - this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...r) => console.error(...r)), this.debug(this.pattern, this.globSet); - let s = this.globSet.map((r) => this.slashSplit(r)); - this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts); - let i = this.globParts.map((r, h, o) => { - if (this.isWindows && this.windowsNoMagicRoot) { - let a = r[0] === "" && r[1] === "" && (r[2] === "?" || !ss.test(r[2])) && !ss.test(r[3]), l = /^[a-z]:/i.test(r[0]); - if (a) return [...r.slice(0, 4), ...r.slice(4).map((f) => this.parse(f))]; - if (l) return [r[0], ...r.slice(1).map((f) => this.parse(f))]; - } - return r.map((a) => this.parse(a)); - }); - if (this.debug(this.pattern, i), this.set = i.filter((r) => r.indexOf(false) === -1), this.isWindows) for (let r = 0; r < this.set.length; r++) { - let h = this.set[r]; - h[0] === "" && h[1] === "" && this.globParts[r][2] === "?" && typeof h[3] == "string" && /^[a-z]:$/i.test(h[3]) && (h[2] = "?"); - } - this.debug(this.pattern, this.set); - } - preprocess(t) { - if (this.options.noglobstar) for (let s = 0; s < t.length; s++) for (let i = 0; i < t[s].length; i++) t[s][i] === "**" && (t[s][i] = "*"); - let { optimizationLevel: e = 1 } = this.options; - return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t; - } - adjascentGlobstarOptimize(t) { - return t.map((e) => { - let s = -1; - for (; (s = e.indexOf("**", s + 1)) !== -1; ) { - let i = s; - for (; e[i + 1] === "**"; ) i++; - i !== s && e.splice(s, i - s); - } - return e; - }); - } - levelOneOptimize(t) { - return t.map((e) => (e = e.reduce((s, i) => { - let r = s[s.length - 1]; - return i === "**" && r === "**" ? s : i === ".." && r && r !== ".." && r !== "." && r !== "**" ? (s.pop(), s) : (s.push(i), s); - }, []), e.length === 0 ? [""] : e)); - } - levelTwoFileOptimize(t) { - Array.isArray(t) || (t = this.slashSplit(t)); - let e = false; - do { - if (e = false, !this.preserveMultipleSlashes) { - for (let i = 1; i < t.length - 1; i++) { - let r = t[i]; - i === 1 && r === "" && t[0] === "" || (r === "." || r === "") && (e = true, t.splice(i, 1), i--); - } - t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = true, t.pop()); - } - let s = 0; - for (; (s = t.indexOf("..", s + 1)) !== -1; ) { - let i = t[s - 1]; - i && i !== "." && i !== ".." && i !== "**" && (e = true, t.splice(s - 1, 2), s -= 2); - } - } while (e); - return t.length === 0 ? [""] : t; - } - firstPhasePreProcess(t) { - let e = false; - do { - e = false; - for (let s of t) { - let i = -1; - for (; (i = s.indexOf("**", i + 1)) !== -1; ) { - let h = i; - for (; s[h + 1] === "**"; ) h++; - h > i && s.splice(i + 1, h - i); - let o = s[i + 1], a = s[i + 2], l = s[i + 3]; - if (o !== ".." || !a || a === "." || a === ".." || !l || l === "." || l === "..") continue; - e = true, s.splice(i, 1); - let f = s.slice(0); - f[i] = "**", t.push(f), i--; - } - if (!this.preserveMultipleSlashes) { - for (let h = 1; h < s.length - 1; h++) { - let o = s[h]; - h === 1 && o === "" && s[0] === "" || (o === "." || o === "") && (e = true, s.splice(h, 1), h--); - } - s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e = true, s.pop()); - } - let r = 0; - for (; (r = s.indexOf("..", r + 1)) !== -1; ) { - let h = s[r - 1]; - if (h && h !== "." && h !== ".." && h !== "**") { - e = true; - let a = r === 1 && s[r + 1] === "**" ? ["."] : []; - s.splice(r - 1, 2, ...a), s.length === 0 && s.push(""), r -= 2; - } - } - } - } while (e); - return t; - } - secondPhasePreProcess(t) { - for (let e = 0; e < t.length - 1; e++) for (let s = e + 1; s < t.length; s++) { - let i = this.partsMatch(t[e], t[s], !this.preserveMultipleSlashes); - if (i) { - t[e] = [], t[s] = i; - break; - } - } - return t.filter((e) => e.length); - } - partsMatch(t, e, s = false) { - let i = 0, r = 0, h = [], o = ""; - for (; i < t.length && r < e.length; ) if (t[i] === e[r]) h.push(o === "b" ? e[r] : t[i]), i++, r++; - else if (s && t[i] === "**" && e[r] === t[i + 1]) h.push(t[i]), i++; - else if (s && e[r] === "**" && t[i] === e[r + 1]) h.push(e[r]), r++; - else if (t[i] === "*" && e[r] && (this.options.dot || !e[r].startsWith(".")) && e[r] !== "**") { - if (o === "b") return false; - o = "a", h.push(t[i]), i++, r++; - } else if (e[r] === "*" && t[i] && (this.options.dot || !t[i].startsWith(".")) && t[i] !== "**") { - if (o === "a") return false; - o = "b", h.push(e[r]), i++, r++; - } else return false; - return t.length === e.length && h; - } - parseNegate() { - if (this.nonegate) return; - let t = this.pattern, e = false, s = 0; - for (let i = 0; i < t.length && t.charAt(i) === "!"; i++) e = !e, s++; - s && (this.pattern = t.slice(s)), this.negate = e; - } - matchOne(t, e, s = false) { - let i = this.options; - if (this.isWindows) { - let p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), b = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), w = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), v = !w && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), E = b ? 3 : p ? 0 : void 0, y = v ? 3 : w ? 0 : void 0; - if (typeof E == "number" && typeof y == "number") { - let [S, B] = [t[E], e[y]]; - S.toLowerCase() === B.toLowerCase() && (e[y] = S, y > E ? e = e.slice(y) : E > y && (t = t.slice(E))); - } - } - let { optimizationLevel: r = 1 } = this.options; - r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length); - for (var h = 0, o = 0, a = t.length, l = e.length; h < a && o < l; h++, o++) { - this.debug("matchOne loop"); - var f = e[o], c = t[h]; - if (this.debug(e, f, c), f === false) return false; - if (f === g.GLOBSTAR) { - this.debug("GLOBSTAR", [e, f, c]); - var d = h, u = o + 1; - if (u === l) { - for (this.debug("** at the end"); h < a; h++) if (t[h] === "." || t[h] === ".." || !i.dot && t[h].charAt(0) === ".") return false; - return true; - } - for (; d < a; ) { - var m = t[d]; - if (this.debug(` -globstar while`, t, d, e, u, m), this.matchOne(t.slice(d), e.slice(u), s)) return this.debug("globstar found match!", d, a, m), true; - if (m === "." || m === ".." || !i.dot && m.charAt(0) === ".") { - this.debug("dot detected!", t, d, e, u); - break; - } - this.debug("globstar swallow a segment, and continue"), d++; - } - return !!(s && (this.debug(` ->>> no match, partial?`, t, d, e, u), d === a)); - } - let p; - if (typeof f == "string" ? (p = c === f, this.debug("string match", f, c, p)) : (p = f.test(c), this.debug("pattern match", f, c, p)), !p) return false; - } - if (h === a && o === l) return true; - if (h === a) return s; - if (o === l) return h === a - 1 && t[h] === ""; - throw new Error("wtf?"); - } - braceExpand() { - return (0, g.braceExpand)(this.pattern, this.options); - } - parse(t) { - (0, jt.assertValidPattern)(t); - let e = this.options; - if (t === "**") return g.GLOBSTAR; - if (t === "") return ""; - let s, i = null; - (s = t.match(Fi)) ? i = e.dot ? Ni : ji : (s = t.match(Oi)) ? i = (e.nocase ? e.dot ? Ri : Ci : e.dot ? Ti : xi)(s[1]) : (s = t.match(Li)) ? i = (e.nocase ? e.dot ? Bi : Wi : e.dot ? Ii : Gi)(s) : (s = t.match(Ai)) ? i = e.dot ? Mi : ki : (s = t.match(Pi)) && (i = Di); - let r = is.AST.fromGlob(t, this.options).toMMPattern(); - return i && typeof r == "object" && Reflect.defineProperty(r, "test", { value: i }), r; - } - makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - let t = this.set; - if (!t.length) return this.regexp = false, this.regexp; - let e = this.options, s = e.noglobstar ? Ui : e.dot ? $i : qi, i = new Set(e.nocase ? ["i"] : []), r = t.map((a) => { - let l = a.map((c) => { - if (c instanceof RegExp) for (let d of c.flags.split("")) i.add(d); - return typeof c == "string" ? Ji(c) : c === g.GLOBSTAR ? g.GLOBSTAR : c._src; - }); - l.forEach((c, d) => { - let u = l[d + 1], m = l[d - 1]; - c !== g.GLOBSTAR || m === g.GLOBSTAR || (m === void 0 ? u !== void 0 && u !== g.GLOBSTAR ? l[d + 1] = "(?:\\/|" + s + "\\/)?" + u : l[d] = s : u === void 0 ? l[d - 1] = m + "(?:\\/|\\/" + s + ")?" : u !== g.GLOBSTAR && (l[d - 1] = m + "(?:\\/|\\/" + s + "\\/)" + u, l[d + 1] = g.GLOBSTAR)); - }); - let f = l.filter((c) => c !== g.GLOBSTAR); - if (this.partial && f.length >= 1) { - let c = []; - for (let d = 1; d <= f.length; d++) c.push(f.slice(0, d).join("/")); - return "(?:" + c.join("|") + ")"; - } - return f.join("/"); - }).join("|"), [h, o] = t.length > 1 ? ["(?:", ")"] : ["", ""]; - r = "^" + h + r + o + "$", this.partial && (r = "^(?:\\/|" + h + r.slice(1, -1) + o + ")$"), this.negate && (r = "^(?!" + r + ").+$"); - try { - this.regexp = new RegExp(r, [...i].join("")); - } catch { - this.regexp = false; - } - return this.regexp; - } - slashSplit(t) { - return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/); - } - match(t, e = this.partial) { - if (this.debug("match", t, this.pattern), this.comment) return false; - if (this.empty) return t === ""; - if (t === "/" && e) return true; - let s = this.options; - this.isWindows && (t = t.split("\\").join("/")); - let i = this.slashSplit(t); - this.debug(this.pattern, "split", i); - let r = this.set; - this.debug(this.pattern, "set", r); - let h = i[i.length - 1]; - if (!h) for (let o = i.length - 2; !h && o >= 0; o--) h = i[o]; - for (let o = 0; o < r.length; o++) { - let a = r[o], l = i; - if (s.matchBase && a.length === 1 && (l = [h]), this.matchOne(l, a, e)) return s.flipNegate ? true : !this.negate; - } - return s.flipNegate ? false : this.negate; - } - static defaults(t) { - return g.minimatch.defaults(t).Minimatch; - } - }; - g.Minimatch = J; - var Zi = pe(); - Object.defineProperty(g, "AST", { enumerable: true, get: function() { - return Zi.AST; - } }); - var Qi = me(); - Object.defineProperty(g, "escape", { enumerable: true, get: function() { - return Qi.escape; - } }); - var tr = kt(); - Object.defineProperty(g, "unescape", { enumerable: true, get: function() { - return tr.unescape; - } }); - g.minimatch.AST = is.AST; - g.minimatch.Minimatch = J; - g.minimatch.escape = vi.escape; - g.minimatch.unescape = Ei.unescape; - }); - var fs32 = R((Wt) => { - "use strict"; - Object.defineProperty(Wt, "__esModule", { value: true }); - Wt.LRUCache = void 0; - var er = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, as = /* @__PURE__ */ new Set(), ge = typeof process == "object" && process ? process : {}, ls = (n, t, e, s) => { - typeof ge.emitWarning == "function" ? ge.emitWarning(n, t, e, s) : console.error(`[${e}] ${t}: ${n}`); - }, Lt = globalThis.AbortController, os7 = globalThis.AbortSignal; - if (typeof Lt > "u") { - os7 = class { - onabort; - _onabort = []; - reason; - aborted = false; - addEventListener(e, s) { - this._onabort.push(s); - } - }, Lt = class { - constructor() { - t(); - } - signal = new os7(); - abort(e) { - if (!this.signal.aborted) { - this.signal.reason = e, this.signal.aborted = true; - for (let s of this.signal._onabort) s(e); - this.signal.onabort?.(e); - } - } - }; - let n = ge.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => { - n && (n = false, ls("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t)); - }; - } - var sr = (n) => !as.has(n), V = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n), cs = (n) => V(n) ? n <= Math.pow(2, 8) ? Uint8Array : n <= Math.pow(2, 16) ? Uint16Array : n <= Math.pow(2, 32) ? Uint32Array : n <= Number.MAX_SAFE_INTEGER ? Nt : null : null, Nt = class extends Array { - constructor(n) { - super(n), this.fill(0); - } - }, ir = class at { - heap; - length; - static #t = false; - static create(t) { - let e = cs(t); - if (!e) return []; - at.#t = true; - let s = new at(t, e); - return at.#t = false, s; - } - constructor(t, e) { - if (!at.#t) throw new TypeError("instantiate Stack using Stack.create(n)"); - this.heap = new e(t), this.length = 0; - } - push(t) { - this.heap[this.length++] = t; - } - pop() { - return this.heap[--this.length]; - } - }, rr = class us { - #t; - #s; - #n; - #r; - #h; - #S; - #w; - #c; - get perf() { - return this.#c; - } - ttl; - ttlResolution; - ttlAutopurge; - updateAgeOnGet; - updateAgeOnHas; - allowStale; - noDisposeOnSet; - noUpdateTTL; - maxEntrySize; - sizeCalculation; - noDeleteOnFetchRejection; - noDeleteOnStaleGet; - allowStaleOnFetchAbort; - allowStaleOnFetchRejection; - ignoreFetchAbort; - #o; - #f; - #u; - #a; - #i; - #d; - #v; - #y; - #p; - #R; - #m; - #O; - #x; - #g; - #b; - #E; - #T; - #e; - #F; - static unsafeExposeInternals(t) { - return { starts: t.#x, ttls: t.#g, autopurgeTimers: t.#b, sizes: t.#O, keyMap: t.#u, keyList: t.#a, valList: t.#i, next: t.#d, prev: t.#v, get head() { - return t.#y; - }, get tail() { - return t.#p; - }, free: t.#R, isBackgroundFetch: (e) => t.#l(e), backgroundFetch: (e, s, i, r) => t.#z(e, s, i, r), moveToTail: (e) => t.#N(e), indexes: (e) => t.#k(e), rindexes: (e) => t.#M(e), isStale: (e) => t.#_(e) }; - } - get max() { - return this.#t; - } - get maxSize() { - return this.#s; - } - get calculatedSize() { - return this.#f; - } - get size() { - return this.#o; - } - get fetchMethod() { - return this.#S; - } - get memoMethod() { - return this.#w; - } - get dispose() { - return this.#n; - } - get onInsert() { - return this.#r; - } - get disposeAfter() { - return this.#h; - } - constructor(t) { - let { max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: r, updateAgeOnGet: h, updateAgeOnHas: o, allowStale: a, dispose: l, onInsert: f, disposeAfter: c, noDisposeOnSet: d, noUpdateTTL: u, maxSize: m = 0, maxEntrySize: p = 0, sizeCalculation: b, fetchMethod: w, memoMethod: v, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: y, allowStaleOnFetchRejection: S, allowStaleOnFetchAbort: B, ignoreFetchAbort: U, perf: et } = t; - if (et !== void 0 && typeof et?.now != "function") throw new TypeError("perf option must have a now() method if specified"); - if (this.#c = et ?? er, e !== 0 && !V(e)) throw new TypeError("max option must be a nonnegative integer"); - let st = e ? cs(e) : Array; - if (!st) throw new Error("invalid max value: " + e); - if (this.#t = e, this.#s = m, this.maxEntrySize = p || this.#s, this.sizeCalculation = b, this.sizeCalculation) { - if (!this.#s && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize"); - if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function"); - } - if (v !== void 0 && typeof v != "function") throw new TypeError("memoMethod must be a function if defined"); - if (this.#w = v, w !== void 0 && typeof w != "function") throw new TypeError("fetchMethod must be a function if specified"); - if (this.#S = w, this.#T = !!w, this.#u = /* @__PURE__ */ new Map(), this.#a = new Array(e).fill(void 0), this.#i = new Array(e).fill(void 0), this.#d = new st(e), this.#v = new st(e), this.#y = 0, this.#p = 0, this.#R = ir.create(e), this.#o = 0, this.#f = 0, typeof l == "function" && (this.#n = l), typeof f == "function" && (this.#r = f), typeof c == "function" ? (this.#h = c, this.#m = []) : (this.#h = void 0, this.#m = void 0), this.#E = !!this.#n, this.#F = !!this.#r, this.#e = !!this.#h, this.noDisposeOnSet = !!d, this.noUpdateTTL = !!u, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!S, this.allowStaleOnFetchAbort = !!B, this.ignoreFetchAbort = !!U, this.maxEntrySize !== 0) { - if (this.#s !== 0 && !V(this.#s)) throw new TypeError("maxSize must be a positive integer if specified"); - if (!V(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified"); - this.#$(); - } - if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!y, this.updateAgeOnGet = !!h, this.updateAgeOnHas = !!o, this.ttlResolution = V(i) || i === 0 ? i : 1, this.ttlAutopurge = !!r, this.ttl = s || 0, this.ttl) { - if (!V(this.ttl)) throw new TypeError("ttl must be a positive integer if specified"); - this.#P(); - } - if (this.#t === 0 && this.ttl === 0 && this.#s === 0) throw new TypeError("At least one of max, maxSize, or ttl is required"); - if (!this.ttlAutopurge && !this.#t && !this.#s) { - let le = "LRU_CACHE_UNBOUNDED"; - sr(le) && (as.add(le), ls("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", le, us)); - } - } - getRemainingTTL(t) { - return this.#u.has(t) ? 1 / 0 : 0; - } - #P() { - let t = new Nt(this.#t), e = new Nt(this.#t); - this.#g = t, this.#x = e; - let s = this.ttlAutopurge ? new Array(this.#t) : void 0; - this.#b = s, this.#W = (h, o, a = this.#c.now()) => { - if (e[h] = o !== 0 ? a : 0, t[h] = o, s?.[h] && (clearTimeout(s[h]), s[h] = void 0), o !== 0 && s) { - let l = setTimeout(() => { - this.#_(h) && this.#A(this.#a[h], "expire"); - }, o + 1); - l.unref && l.unref(), s[h] = l; - } - }, this.#C = (h) => { - e[h] = t[h] !== 0 ? this.#c.now() : 0; - }, this.#D = (h, o) => { - if (t[o]) { - let a = t[o], l = e[o]; - if (!a || !l) return; - h.ttl = a, h.start = l, h.now = i || r(); - let f = h.now - l; - h.remainingTTL = a - f; - } - }; - let i = 0, r = () => { - let h = this.#c.now(); - if (this.ttlResolution > 0) { - i = h; - let o = setTimeout(() => i = 0, this.ttlResolution); - o.unref && o.unref(); - } - return h; - }; - this.getRemainingTTL = (h) => { - let o = this.#u.get(h); - if (o === void 0) return 0; - let a = t[o], l = e[o]; - if (!a || !l) return 1 / 0; - let f = (i || r()) - l; - return a - f; - }, this.#_ = (h) => { - let o = e[h], a = t[h]; - return !!a && !!o && (i || r()) - o > a; - }; - } - #C = () => { - }; - #D = () => { - }; - #W = () => { - }; - #_ = () => false; - #$() { - let t = new Nt(this.#t); - this.#f = 0, this.#O = t, this.#L = (e) => { - this.#f -= t[e], t[e] = 0; - }, this.#B = (e, s, i, r) => { - if (this.#l(s)) return 0; - if (!V(i)) if (r) { - if (typeof r != "function") throw new TypeError("sizeCalculation must be a function"); - if (i = r(s, e), !V(i)) throw new TypeError("sizeCalculation return invalid (expect positive integer)"); - } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set."); - return i; - }, this.#j = (e, s, i) => { - if (t[e] = s, this.#s) { - let r = this.#s - t[e]; - for (; this.#f > r; ) this.#G(true); - } - this.#f += t[e], i && (i.entrySize = s, i.totalCalculatedSize = this.#f); - }; - } - #L = (t) => { - }; - #j = (t, e, s) => { - }; - #B = (t, e, s, i) => { - if (s || i) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache"); - return 0; - }; - *#k({ allowStale: t = this.allowStale } = {}) { - if (this.#o) for (let e = this.#p; !(!this.#I(e) || ((t || !this.#_(e)) && (yield e), e === this.#y)); ) e = this.#v[e]; - } - *#M({ allowStale: t = this.allowStale } = {}) { - if (this.#o) for (let e = this.#y; !(!this.#I(e) || ((t || !this.#_(e)) && (yield e), e === this.#p)); ) e = this.#d[e]; - } - #I(t) { - return t !== void 0 && this.#u.get(this.#a[t]) === t; - } - *entries() { - for (let t of this.#k()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]); - } - *rentries() { - for (let t of this.#M()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]); - } - *keys() { - for (let t of this.#k()) { - let e = this.#a[t]; - e !== void 0 && !this.#l(this.#i[t]) && (yield e); - } - } - *rkeys() { - for (let t of this.#M()) { - let e = this.#a[t]; - e !== void 0 && !this.#l(this.#i[t]) && (yield e); - } - } - *values() { - for (let t of this.#k()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]); - } - *rvalues() { - for (let t of this.#M()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]); - } - [Symbol.iterator]() { - return this.entries(); - } - [Symbol.toStringTag] = "LRUCache"; - find(t, e = {}) { - for (let s of this.#k()) { - let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i; - if (r !== void 0 && t(r, this.#a[s], this)) return this.get(this.#a[s], e); - } - } - forEach(t, e = this) { - for (let s of this.#k()) { - let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i; - r !== void 0 && t.call(e, r, this.#a[s], this); - } - } - rforEach(t, e = this) { - for (let s of this.#M()) { - let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i; - r !== void 0 && t.call(e, r, this.#a[s], this); - } - } - purgeStale() { - let t = false; - for (let e of this.#M({ allowStale: true })) this.#_(e) && (this.#A(this.#a[e], "expire"), t = true); - return t; - } - info(t) { - let e = this.#u.get(t); - if (e === void 0) return; - let s = this.#i[e], i = this.#l(s) ? s.__staleWhileFetching : s; - if (i === void 0) return; - let r = { value: i }; - if (this.#g && this.#x) { - let h = this.#g[e], o = this.#x[e]; - if (h && o) { - let a = h - (this.#c.now() - o); - r.ttl = a, r.start = Date.now(); - } - } - return this.#O && (r.size = this.#O[e]), r; - } - dump() { - let t = []; - for (let e of this.#k({ allowStale: true })) { - let s = this.#a[e], i = this.#i[e], r = this.#l(i) ? i.__staleWhileFetching : i; - if (r === void 0 || s === void 0) continue; - let h = { value: r }; - if (this.#g && this.#x) { - h.ttl = this.#g[e]; - let o = this.#c.now() - this.#x[e]; - h.start = Math.floor(Date.now() - o); - } - this.#O && (h.size = this.#O[e]), t.unshift([s, h]); - } - return t; - } - load(t) { - this.clear(); - for (let [e, s] of t) { - if (s.start) { - let i = Date.now() - s.start; - s.start = this.#c.now() - i; - } - this.set(e, s.value, s); - } - } - set(t, e, s = {}) { - if (e === void 0) return this.delete(t), this; - let { ttl: i = this.ttl, start: r, noDisposeOnSet: h = this.noDisposeOnSet, sizeCalculation: o = this.sizeCalculation, status: a } = s, { noUpdateTTL: l = this.noUpdateTTL } = s, f = this.#B(t, e, s.size || 0, o); - if (this.maxEntrySize && f > this.maxEntrySize) return a && (a.set = "miss", a.maxEntrySizeExceeded = true), this.#A(t, "set"), this; - let c = this.#o === 0 ? void 0 : this.#u.get(t); - if (c === void 0) c = this.#o === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#o === this.#t ? this.#G(false) : this.#o, this.#a[c] = t, this.#i[c] = e, this.#u.set(t, c), this.#d[this.#p] = c, this.#v[c] = this.#p, this.#p = c, this.#o++, this.#j(c, f, a), a && (a.set = "add"), l = false, this.#F && this.#r?.(e, t, "add"); - else { - this.#N(c); - let d = this.#i[c]; - if (e !== d) { - if (this.#T && this.#l(d)) { - d.__abortController.abort(new Error("replaced")); - let { __staleWhileFetching: u } = d; - u !== void 0 && !h && (this.#E && this.#n?.(u, t, "set"), this.#e && this.#m?.push([u, t, "set"])); - } else h || (this.#E && this.#n?.(d, t, "set"), this.#e && this.#m?.push([d, t, "set"])); - if (this.#L(c), this.#j(c, f, a), this.#i[c] = e, a) { - a.set = "replace"; - let u = d && this.#l(d) ? d.__staleWhileFetching : d; - u !== void 0 && (a.oldValue = u); - } - } else a && (a.set = "update"); - this.#F && this.onInsert?.(e, t, e === d ? "update" : "replace"); - } - if (i !== 0 && !this.#g && this.#P(), this.#g && (l || this.#W(c, i, r), a && this.#D(a, c)), !h && this.#e && this.#m) { - let d = this.#m, u; - for (; u = d?.shift(); ) this.#h?.(...u); - } - return this; - } - pop() { - try { - for (; this.#o; ) { - let t = this.#i[this.#y]; - if (this.#G(true), this.#l(t)) { - if (t.__staleWhileFetching) return t.__staleWhileFetching; - } else if (t !== void 0) return t; - } - } finally { - if (this.#e && this.#m) { - let t = this.#m, e; - for (; e = t?.shift(); ) this.#h?.(...e); - } - } - } - #G(t) { - let e = this.#y, s = this.#a[e], i = this.#i[e]; - return this.#T && this.#l(i) ? i.__abortController.abort(new Error("evicted")) : (this.#E || this.#e) && (this.#E && this.#n?.(i, s, "evict"), this.#e && this.#m?.push([i, s, "evict"])), this.#L(e), this.#b?.[e] && (clearTimeout(this.#b[e]), this.#b[e] = void 0), t && (this.#a[e] = void 0, this.#i[e] = void 0, this.#R.push(e)), this.#o === 1 ? (this.#y = this.#p = 0, this.#R.length = 0) : this.#y = this.#d[e], this.#u.delete(s), this.#o--, e; - } - has(t, e = {}) { - let { updateAgeOnHas: s = this.updateAgeOnHas, status: i } = e, r = this.#u.get(t); - if (r !== void 0) { - let h = this.#i[r]; - if (this.#l(h) && h.__staleWhileFetching === void 0) return false; - if (this.#_(r)) i && (i.has = "stale", this.#D(i, r)); - else return s && this.#C(r), i && (i.has = "hit", this.#D(i, r)), true; - } else i && (i.has = "miss"); - return false; - } - peek(t, e = {}) { - let { allowStale: s = this.allowStale } = e, i = this.#u.get(t); - if (i === void 0 || !s && this.#_(i)) return; - let r = this.#i[i]; - return this.#l(r) ? r.__staleWhileFetching : r; - } - #z(t, e, s, i) { - let r = e === void 0 ? void 0 : this.#i[e]; - if (this.#l(r)) return r; - let h = new Lt(), { signal: o } = s; - o?.addEventListener("abort", () => h.abort(o.reason), { signal: h.signal }); - let a = { signal: h.signal, options: s, context: i }, l = (p, b = false) => { - let { aborted: w } = h.signal, v = s.ignoreFetchAbort && p !== void 0, E = s.ignoreFetchAbort || !!(s.allowStaleOnFetchAbort && p !== void 0); - if (s.status && (w && !b ? (s.status.fetchAborted = true, s.status.fetchError = h.signal.reason, v && (s.status.fetchAbortIgnored = true)) : s.status.fetchResolved = true), w && !v && !b) return c(h.signal.reason, E); - let y = u, S = this.#i[e]; - return (S === u || v && b && S === void 0) && (p === void 0 ? y.__staleWhileFetching !== void 0 ? this.#i[e] = y.__staleWhileFetching : this.#A(t, "fetch") : (s.status && (s.status.fetchUpdated = true), this.set(t, p, a.options))), p; - }, f = (p) => (s.status && (s.status.fetchRejected = true, s.status.fetchError = p), c(p, false)), c = (p, b) => { - let { aborted: w } = h.signal, v = w && s.allowStaleOnFetchAbort, E = v || s.allowStaleOnFetchRejection, y = E || s.noDeleteOnFetchRejection, S = u; - if (this.#i[e] === u && (!y || !b && S.__staleWhileFetching === void 0 ? this.#A(t, "fetch") : v || (this.#i[e] = S.__staleWhileFetching)), E) return s.status && S.__staleWhileFetching !== void 0 && (s.status.returnedStale = true), S.__staleWhileFetching; - if (S.__returned === S) throw p; - }, d = (p, b) => { - let w = this.#S?.(t, r, a); - w && w instanceof Promise && w.then((v) => p(v === void 0 ? void 0 : v), b), h.signal.addEventListener("abort", () => { - (!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p(void 0), s.allowStaleOnFetchAbort && (p = (v) => l(v, true))); - }); - }; - s.status && (s.status.fetchDispatched = true); - let u = new Promise(d).then(l, f), m = Object.assign(u, { __abortController: h, __staleWhileFetching: r, __returned: void 0 }); - return e === void 0 ? (this.set(t, m, { ...a.options, status: void 0 }), e = this.#u.get(t)) : this.#i[e] = m, m; - } - #l(t) { - if (!this.#T) return false; - let e = t; - return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof Lt; - } - async fetch(t, e = {}) { - let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: h = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: a = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: f = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: u = this.ignoreFetchAbort, allowStaleOnFetchAbort: m = this.allowStaleOnFetchAbort, context: p, forceRefresh: b = false, status: w, signal: v } = e; - if (!this.#T) return w && (w.fetch = "get"), this.get(t, { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, status: w }); - let E = { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, ttl: h, noDisposeOnSet: o, size: a, sizeCalculation: l, noUpdateTTL: f, noDeleteOnFetchRejection: c, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: m, ignoreFetchAbort: u, status: w, signal: v }, y = this.#u.get(t); - if (y === void 0) { - w && (w.fetch = "miss"); - let S = this.#z(t, y, E, p); - return S.__returned = S; - } else { - let S = this.#i[y]; - if (this.#l(S)) { - let st = s && S.__staleWhileFetching !== void 0; - return w && (w.fetch = "inflight", st && (w.returnedStale = true)), st ? S.__staleWhileFetching : S.__returned = S; - } - let B = this.#_(y); - if (!b && !B) return w && (w.fetch = "hit"), this.#N(y), i && this.#C(y), w && this.#D(w, y), S; - let U = this.#z(t, y, E, p), et = U.__staleWhileFetching !== void 0 && s; - return w && (w.fetch = B ? "stale" : "refresh", et && B && (w.returnedStale = true)), et ? U.__staleWhileFetching : U.__returned = U; - } - } - async forceFetch(t, e = {}) { - let s = await this.fetch(t, e); - if (s === void 0) throw new Error("fetch() returned undefined"); - return s; - } - memo(t, e = {}) { - let s = this.#w; - if (!s) throw new Error("no memoMethod provided to constructor"); - let { context: i, forceRefresh: r, ...h } = e, o = this.get(t, h); - if (!r && o !== void 0) return o; - let a = s(t, o, { options: h, context: i }); - return this.set(t, a, h), a; - } - get(t, e = {}) { - let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, status: h } = e, o = this.#u.get(t); - if (o !== void 0) { - let a = this.#i[o], l = this.#l(a); - return h && this.#D(h, o), this.#_(o) ? (h && (h.get = "stale"), l ? (h && s && a.__staleWhileFetching !== void 0 && (h.returnedStale = true), s ? a.__staleWhileFetching : void 0) : (r || this.#A(t, "expire"), h && s && (h.returnedStale = true), s ? a : void 0)) : (h && (h.get = "hit"), l ? a.__staleWhileFetching : (this.#N(o), i && this.#C(o), a)); - } else h && (h.get = "miss"); - } - #U(t, e) { - this.#v[e] = t, this.#d[t] = e; - } - #N(t) { - t !== this.#p && (t === this.#y ? this.#y = this.#d[t] : this.#U(this.#v[t], this.#d[t]), this.#U(this.#p, t), this.#p = t); - } - delete(t) { - return this.#A(t, "delete"); - } - #A(t, e) { - let s = false; - if (this.#o !== 0) { - let i = this.#u.get(t); - if (i !== void 0) if (this.#b?.[i] && (clearTimeout(this.#b?.[i]), this.#b[i] = void 0), s = true, this.#o === 1) this.#q(e); - else { - this.#L(i); - let r = this.#i[i]; - if (this.#l(r) ? r.__abortController.abort(new Error("deleted")) : (this.#E || this.#e) && (this.#E && this.#n?.(r, t, e), this.#e && this.#m?.push([r, t, e])), this.#u.delete(t), this.#a[i] = void 0, this.#i[i] = void 0, i === this.#p) this.#p = this.#v[i]; - else if (i === this.#y) this.#y = this.#d[i]; - else { - let h = this.#v[i]; - this.#d[h] = this.#d[i]; - let o = this.#d[i]; - this.#v[o] = this.#v[i]; - } - this.#o--, this.#R.push(i); - } - } - if (this.#e && this.#m?.length) { - let i = this.#m, r; - for (; r = i?.shift(); ) this.#h?.(...r); - } - return s; - } - clear() { - return this.#q("delete"); - } - #q(t) { - for (let e of this.#M({ allowStale: true })) { - let s = this.#i[e]; - if (this.#l(s)) s.__abortController.abort(new Error("deleted")); - else { - let i = this.#a[e]; - this.#E && this.#n?.(s, i, t), this.#e && this.#m?.push([s, i, t]); - } - } - if (this.#u.clear(), this.#i.fill(void 0), this.#a.fill(void 0), this.#g && this.#x) { - this.#g.fill(0), this.#x.fill(0); - for (let e of this.#b ?? []) e !== void 0 && clearTimeout(e); - this.#b?.fill(void 0); - } - if (this.#O && this.#O.fill(0), this.#y = 0, this.#p = 0, this.#R.length = 0, this.#f = 0, this.#o = 0, this.#e && this.#m) { - let e = this.#m, s; - for (; s = e?.shift(); ) this.#h?.(...s); - } - } - }; - Wt.LRUCache = rr; - }); - var Oe = R((P) => { - "use strict"; - var nr = P && P.__importDefault || function(n) { - return n && n.__esModule ? n : { default: n }; - }; - Object.defineProperty(P, "__esModule", { value: true }); - P.Minipass = P.isWritable = P.isReadable = P.isStream = void 0; - var ds = typeof process == "object" && process ? process : { stdout: null, stderr: null }, _e = require("node:events"), ws = nr(require("node:stream")), hr = require("node:string_decoder"), or2 = (n) => !!n && typeof n == "object" && (n instanceof qt || n instanceof ws.default || (0, P.isReadable)(n) || (0, P.isWritable)(n)); - P.isStream = or2; - var ar = (n) => !!n && typeof n == "object" && n instanceof _e.EventEmitter && typeof n.pipe == "function" && n.pipe !== ws.default.Writable.prototype.pipe; - P.isReadable = ar; - var lr = (n) => !!n && typeof n == "object" && n instanceof _e.EventEmitter && typeof n.write == "function" && typeof n.end == "function"; - P.isWritable = lr; - var $ = /* @__PURE__ */ Symbol("EOF"), q = /* @__PURE__ */ Symbol("maybeEmitEnd"), K = /* @__PURE__ */ Symbol("emittedEnd"), Bt = /* @__PURE__ */ Symbol("emittingEnd"), lt2 = /* @__PURE__ */ Symbol("emittedError"), It = /* @__PURE__ */ Symbol("closed"), ps = /* @__PURE__ */ Symbol("read"), Gt = /* @__PURE__ */ Symbol("flush"), ms = /* @__PURE__ */ Symbol("flushChunk"), L = /* @__PURE__ */ Symbol("encoding"), rt = /* @__PURE__ */ Symbol("decoder"), x = /* @__PURE__ */ Symbol("flowing"), ct = /* @__PURE__ */ Symbol("paused"), nt = /* @__PURE__ */ Symbol("resume"), T = /* @__PURE__ */ Symbol("buffer"), M = /* @__PURE__ */ Symbol("pipes"), C = /* @__PURE__ */ Symbol("bufferLength"), we = /* @__PURE__ */ Symbol("bufferPush"), zt = /* @__PURE__ */ Symbol("bufferShift"), k = /* @__PURE__ */ Symbol("objectMode"), O = /* @__PURE__ */ Symbol("destroyed"), be = /* @__PURE__ */ Symbol("error"), ye = /* @__PURE__ */ Symbol("emitData"), gs = /* @__PURE__ */ Symbol("emitEnd"), Se = /* @__PURE__ */ Symbol("emitEnd2"), I = /* @__PURE__ */ Symbol("async"), ve = /* @__PURE__ */ Symbol("abort"), Ut = /* @__PURE__ */ Symbol("aborted"), ut = /* @__PURE__ */ Symbol("signal"), Z = /* @__PURE__ */ Symbol("dataListeners"), D = /* @__PURE__ */ Symbol("discarded"), ft = (n) => Promise.resolve().then(n), cr2 = (n) => n(), ur = (n) => n === "end" || n === "finish" || n === "prefinish", fr = (n) => n instanceof ArrayBuffer || !!n && typeof n == "object" && n.constructor && n.constructor.name === "ArrayBuffer" && n.byteLength >= 0, dr = (n) => !Buffer.isBuffer(n) && ArrayBuffer.isView(n), $t = class { - src; - dest; - opts; - ondrain; - constructor(t, e, s) { - this.src = t, this.dest = e, this.opts = s, this.ondrain = () => t[nt](), this.dest.on("drain", this.ondrain); - } - unpipe() { - this.dest.removeListener("drain", this.ondrain); - } - proxyErrors(t) { - } - end() { - this.unpipe(), this.opts.end && this.dest.end(); - } - }, Ee = class extends $t { - unpipe() { - this.src.removeListener("error", this.proxyErrors), super.unpipe(); - } - constructor(t, e, s) { - super(t, e, s), this.proxyErrors = (i) => this.dest.emit("error", i), t.on("error", this.proxyErrors); - } - }, pr = (n) => !!n.objectMode, mr = (n) => !n.objectMode && !!n.encoding && n.encoding !== "buffer", qt = class extends _e.EventEmitter { - [x] = false; - [ct] = false; - [M] = []; - [T] = []; - [k]; - [L]; - [I]; - [rt]; - [$] = false; - [K] = false; - [Bt] = false; - [It] = false; - [lt2] = null; - [C] = 0; - [O] = false; - [ut]; - [Ut] = false; - [Z] = 0; - [D] = false; - writable = true; - readable = true; - constructor(...t) { - let e = t[0] || {}; - if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together"); - pr(e) ? (this[k] = true, this[L] = null) : mr(e) ? (this[L] = e.encoding, this[k] = false) : (this[k] = false, this[L] = null), this[I] = !!e.async, this[rt] = this[L] ? new hr.StringDecoder(this[L]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[T] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[M] }); - let { signal: s } = e; - s && (this[ut] = s, s.aborted ? this[ve]() : s.addEventListener("abort", () => this[ve]())); - } - get bufferLength() { - return this[C]; - } - get encoding() { - return this[L]; - } - set encoding(t) { - throw new Error("Encoding must be set at instantiation time"); - } - setEncoding(t) { - throw new Error("Encoding must be set at instantiation time"); - } - get objectMode() { - return this[k]; - } - set objectMode(t) { - throw new Error("objectMode must be set at instantiation time"); - } - get async() { - return this[I]; - } - set async(t) { - this[I] = this[I] || !!t; - } - [ve]() { - this[Ut] = true, this.emit("abort", this[ut]?.reason), this.destroy(this[ut]?.reason); - } - get aborted() { - return this[Ut]; - } - set aborted(t) { - } - write(t, e, s) { - if (this[Ut]) return false; - if (this[$]) throw new Error("write after end"); - if (this[O]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true; - typeof e == "function" && (s = e, e = "utf8"), e || (e = "utf8"); - let i = this[I] ? ft : cr2; - if (!this[k] && !Buffer.isBuffer(t)) { - if (dr(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength); - else if (fr(t)) t = Buffer.from(t); - else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream"); - } - return this[k] ? (this[x] && this[C] !== 0 && this[Gt](true), this[x] ? this.emit("data", t) : this[we](t), this[C] !== 0 && this.emit("readable"), s && i(s), this[x]) : t.length ? (typeof t == "string" && !(e === this[L] && !this[rt]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[L] && (t = this[rt].write(t)), this[x] && this[C] !== 0 && this[Gt](true), this[x] ? this.emit("data", t) : this[we](t), this[C] !== 0 && this.emit("readable"), s && i(s), this[x]) : (this[C] !== 0 && this.emit("readable"), s && i(s), this[x]); - } - read(t) { - if (this[O]) return null; - if (this[D] = false, this[C] === 0 || t === 0 || t && t > this[C]) return this[q](), null; - this[k] && (t = null), this[T].length > 1 && !this[k] && (this[T] = [this[L] ? this[T].join("") : Buffer.concat(this[T], this[C])]); - let e = this[ps](t || null, this[T][0]); - return this[q](), e; - } - [ps](t, e) { - if (this[k]) this[zt](); - else { - let s = e; - t === s.length || t === null ? this[zt]() : typeof s == "string" ? (this[T][0] = s.slice(t), e = s.slice(0, t), this[C] -= t) : (this[T][0] = s.subarray(t), e = s.subarray(0, t), this[C] -= t); - } - return this.emit("data", e), !this[T].length && !this[$] && this.emit("drain"), e; - } - end(t, e, s) { - return typeof t == "function" && (s = t, t = void 0), typeof e == "function" && (s = e, e = "utf8"), t !== void 0 && this.write(t, e), s && this.once("end", s), this[$] = true, this.writable = false, (this[x] || !this[ct]) && this[q](), this; - } - [nt]() { - this[O] || (!this[Z] && !this[M].length && (this[D] = true), this[ct] = false, this[x] = true, this.emit("resume"), this[T].length ? this[Gt]() : this[$] ? this[q]() : this.emit("drain")); - } - resume() { - return this[nt](); - } - pause() { - this[x] = false, this[ct] = true, this[D] = false; - } - get destroyed() { - return this[O]; - } - get flowing() { - return this[x]; - } - get paused() { - return this[ct]; - } - [we](t) { - this[k] ? this[C] += 1 : this[C] += t.length, this[T].push(t); - } - [zt]() { - return this[k] ? this[C] -= 1 : this[C] -= this[T][0].length, this[T].shift(); - } - [Gt](t = false) { - do - ; - while (this[ms](this[zt]()) && this[T].length); - !t && !this[T].length && !this[$] && this.emit("drain"); - } - [ms](t) { - return this.emit("data", t), this[x]; - } - pipe(t, e) { - if (this[O]) return t; - this[D] = false; - let s = this[K]; - return e = e || {}, t === ds.stdout || t === ds.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, s ? e.end && t.end() : (this[M].push(e.proxyErrors ? new Ee(this, t, e) : new $t(this, t, e)), this[I] ? ft(() => this[nt]()) : this[nt]()), t; - } - unpipe(t) { - let e = this[M].find((s) => s.dest === t); - e && (this[M].length === 1 ? (this[x] && this[Z] === 0 && (this[x] = false), this[M] = []) : this[M].splice(this[M].indexOf(e), 1), e.unpipe()); - } - addListener(t, e) { - return this.on(t, e); - } - on(t, e) { - let s = super.on(t, e); - if (t === "data") this[D] = false, this[Z]++, !this[M].length && !this[x] && this[nt](); - else if (t === "readable" && this[C] !== 0) super.emit("readable"); - else if (ur(t) && this[K]) super.emit(t), this.removeAllListeners(t); - else if (t === "error" && this[lt2]) { - let i = e; - this[I] ? ft(() => i.call(this, this[lt2])) : i.call(this, this[lt2]); - } - return s; - } - removeListener(t, e) { - return this.off(t, e); - } - off(t, e) { - let s = super.off(t, e); - return t === "data" && (this[Z] = this.listeners("data").length, this[Z] === 0 && !this[D] && !this[M].length && (this[x] = false)), s; - } - removeAllListeners(t) { - let e = super.removeAllListeners(t); - return (t === "data" || t === void 0) && (this[Z] = 0, !this[D] && !this[M].length && (this[x] = false)), e; - } - get emittedEnd() { - return this[K]; - } - [q]() { - !this[Bt] && !this[K] && !this[O] && this[T].length === 0 && this[$] && (this[Bt] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[It] && this.emit("close"), this[Bt] = false); - } - emit(t, ...e) { - let s = e[0]; - if (t !== "error" && t !== "close" && t !== O && this[O]) return false; - if (t === "data") return !this[k] && !s ? false : this[I] ? (ft(() => this[ye](s)), true) : this[ye](s); - if (t === "end") return this[gs](); - if (t === "close") { - if (this[It] = true, !this[K] && !this[O]) return false; - let r = super.emit("close"); - return this.removeAllListeners("close"), r; - } else if (t === "error") { - this[lt2] = s, super.emit(be, s); - let r = !this[ut] || this.listeners("error").length ? super.emit("error", s) : false; - return this[q](), r; - } else if (t === "resume") { - let r = super.emit("resume"); - return this[q](), r; - } else if (t === "finish" || t === "prefinish") { - let r = super.emit(t); - return this.removeAllListeners(t), r; - } - let i = super.emit(t, ...e); - return this[q](), i; - } - [ye](t) { - for (let s of this[M]) s.dest.write(t) === false && this.pause(); - let e = this[D] ? false : super.emit("data", t); - return this[q](), e; - } - [gs]() { - return this[K] ? false : (this[K] = true, this.readable = false, this[I] ? (ft(() => this[Se]()), true) : this[Se]()); - } - [Se]() { - if (this[rt]) { - let e = this[rt].end(); - if (e) { - for (let s of this[M]) s.dest.write(e); - this[D] || super.emit("data", e); - } - } - for (let e of this[M]) e.end(); - let t = super.emit("end"); - return this.removeAllListeners("end"), t; - } - async collect() { - let t = Object.assign([], { dataLength: 0 }); - this[k] || (t.dataLength = 0); - let e = this.promise(); - return this.on("data", (s) => { - t.push(s), this[k] || (t.dataLength += s.length); - }), await e, t; - } - async concat() { - if (this[k]) throw new Error("cannot concat in objectMode"); - let t = await this.collect(); - return this[L] ? t.join("") : Buffer.concat(t, t.dataLength); - } - async promise() { - return new Promise((t, e) => { - this.on(O, () => e(new Error("stream destroyed"))), this.on("error", (s) => e(s)), this.on("end", () => t()); - }); - } - [Symbol.asyncIterator]() { - this[D] = false; - let t = false, e = async () => (this.pause(), t = true, { value: void 0, done: true }); - return { next: () => { - if (t) return e(); - let i = this.read(); - if (i !== null) return Promise.resolve({ done: false, value: i }); - if (this[$]) return e(); - let r, h, o = (c) => { - this.off("data", a), this.off("end", l), this.off(O, f), e(), h(c); - }, a = (c) => { - this.off("error", o), this.off("end", l), this.off(O, f), this.pause(), r({ value: c, done: !!this[$] }); - }, l = () => { - this.off("error", o), this.off("data", a), this.off(O, f), e(), r({ done: true, value: void 0 }); - }, f = () => o(new Error("stream destroyed")); - return new Promise((c, d) => { - h = d, r = c, this.once(O, f), this.once("error", o), this.once("end", l), this.once("data", a); - }); - }, throw: e, return: e, [Symbol.asyncIterator]() { - return this; - }, [Symbol.asyncDispose]: async () => { - } }; - } - [Symbol.iterator]() { - this[D] = false; - let t = false, e = () => (this.pause(), this.off(be, e), this.off(O, e), this.off("end", e), t = true, { done: true, value: void 0 }), s = () => { - if (t) return e(); - let i = this.read(); - return i === null ? e() : { done: false, value: i }; - }; - return this.once("end", e), this.once(be, e), this.once(O, e), { next: s, throw: e, return: e, [Symbol.iterator]() { - return this; - }, [Symbol.dispose]: () => { - } }; - } - destroy(t) { - if (this[O]) return t ? this.emit("error", t) : this.emit(O), this; - this[O] = true, this[D] = true, this[T].length = 0, this[C] = 0; - let e = this; - return typeof e.close == "function" && !this[It] && e.close(), t ? this.emit("error", t) : this.emit(O), this; - } - static get isStream() { - return P.isStream; - } - }; - P.Minipass = qt; - }); - var Ms = R((_2) => { - "use strict"; - var gr = _2 && _2.__createBinding || (Object.create ? (function(n, t, e, s) { - s === void 0 && (s = e); - var i = Object.getOwnPropertyDescriptor(t, e); - (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: true, get: function() { - return t[e]; - } }), Object.defineProperty(n, s, i); - }) : (function(n, t, e, s) { - s === void 0 && (s = e), n[s] = t[e]; - })), wr = _2 && _2.__setModuleDefault || (Object.create ? (function(n, t) { - Object.defineProperty(n, "default", { enumerable: true, value: t }); - }) : function(n, t) { - n.default = t; - }), br = _2 && _2.__importStar || function(n) { - if (n && n.__esModule) return n; - var t = {}; - if (n != null) for (var e in n) e !== "default" && Object.prototype.hasOwnProperty.call(n, e) && gr(t, n, e); - return wr(t, n), t; - }; - Object.defineProperty(_2, "__esModule", { value: true }); - _2.PathScurry = _2.Path = _2.PathScurryDarwin = _2.PathScurryPosix = _2.PathScurryWin32 = _2.PathScurryBase = _2.PathPosix = _2.PathWin32 = _2.PathBase = _2.ChildrenCache = _2.ResolveCache = void 0; - var Qt = fs32(), Yt = require("node:path"), yr = require("node:url"), pt = require("fs"), Sr = br(require("node:fs")), vr = pt.realpathSync.native, Ht = require("node:fs/promises"), bs = Oe(), mt = { lstatSync: pt.lstatSync, readdir: pt.readdir, readdirSync: pt.readdirSync, readlinkSync: pt.readlinkSync, realpathSync: vr, promises: { lstat: Ht.lstat, readdir: Ht.readdir, readlink: Ht.readlink, realpath: Ht.realpath } }, _s = (n) => !n || n === mt || n === Sr ? mt : { ...mt, ...n, promises: { ...mt.promises, ...n.promises || {} } }, Os = /^\\\\\?\\([a-z]:)\\?$/i, Er = (n) => n.replace(/\//g, "\\").replace(Os, "$1\\"), _r = /[\\\/]/, N = 0, xs = 1, Ts = 2, G = 4, Cs = 6, Rs = 8, Q = 10, As = 12, j = 15, dt = ~j, xe = 16, ys = 32, gt = 64, W = 128, Vt = 256, Xt = 512, Ss = gt | W | Xt, Or = 1023, Te = (n) => n.isFile() ? Rs : n.isDirectory() ? G : n.isSymbolicLink() ? Q : n.isCharacterDevice() ? Ts : n.isBlockDevice() ? Cs : n.isSocket() ? As : n.isFIFO() ? xs : N, vs = new Qt.LRUCache({ max: 2 ** 12 }), wt = (n) => { - let t = vs.get(n); - if (t) return t; - let e = n.normalize("NFKD"); - return vs.set(n, e), e; - }, Es = new Qt.LRUCache({ max: 2 ** 12 }), Kt = (n) => { - let t = Es.get(n); - if (t) return t; - let e = wt(n.toLowerCase()); - return Es.set(n, e), e; - }, bt = class extends Qt.LRUCache { - constructor() { - super({ max: 256 }); - } - }; - _2.ResolveCache = bt; - var Jt = class extends Qt.LRUCache { - constructor(t = 16 * 1024) { - super({ maxSize: t, sizeCalculation: (e) => e.length + 1 }); - } - }; - _2.ChildrenCache = Jt; - var ks = /* @__PURE__ */ Symbol("PathScurry setAsCwd"), A = class { - name; - root; - roots; - parent; - nocase; - isCWD = false; - #t; - #s; - get dev() { - return this.#s; - } - #n; - get mode() { - return this.#n; - } - #r; - get nlink() { - return this.#r; - } - #h; - get uid() { - return this.#h; - } - #S; - get gid() { - return this.#S; - } - #w; - get rdev() { - return this.#w; - } - #c; - get blksize() { - return this.#c; - } - #o; - get ino() { - return this.#o; - } - #f; - get size() { - return this.#f; - } - #u; - get blocks() { - return this.#u; - } - #a; - get atimeMs() { - return this.#a; - } - #i; - get mtimeMs() { - return this.#i; - } - #d; - get ctimeMs() { - return this.#d; - } - #v; - get birthtimeMs() { - return this.#v; - } - #y; - get atime() { - return this.#y; - } - #p; - get mtime() { - return this.#p; - } - #R; - get ctime() { - return this.#R; - } - #m; - get birthtime() { - return this.#m; - } - #O; - #x; - #g; - #b; - #E; - #T; - #e; - #F; - #P; - #C; - get parentPath() { - return (this.parent || this).fullpath(); - } - get path() { - return this.parentPath; - } - constructor(t, e = N, s, i, r, h, o) { - this.name = t, this.#O = r ? Kt(t) : wt(t), this.#e = e & Or, this.nocase = r, this.roots = i, this.root = s || this, this.#F = h, this.#g = o.fullpath, this.#E = o.relative, this.#T = o.relativePosix, this.parent = o.parent, this.parent ? this.#t = this.parent.#t : this.#t = _s(o.fs); - } - depth() { - return this.#x !== void 0 ? this.#x : this.parent ? this.#x = this.parent.depth() + 1 : this.#x = 0; - } - childrenCache() { - return this.#F; - } - resolve(t) { - if (!t) return this; - let e = this.getRootString(t), i = t.substring(e.length).split(this.splitSep); - return e ? this.getRoot(e).#D(i) : this.#D(i); - } - #D(t) { - let e = this; - for (let s of t) e = e.child(s); - return e; - } - children() { - let t = this.#F.get(this); - if (t) return t; - let e = Object.assign([], { provisional: 0 }); - return this.#F.set(this, e), this.#e &= ~xe, e; - } - child(t, e) { - if (t === "" || t === ".") return this; - if (t === "..") return this.parent || this; - let s = this.children(), i = this.nocase ? Kt(t) : wt(t); - for (let a of s) if (a.#O === i) return a; - let r = this.parent ? this.sep : "", h = this.#g ? this.#g + r + t : void 0, o = this.newChild(t, N, { ...e, parent: this, fullpath: h }); - return this.canReaddir() || (o.#e |= W), s.push(o), o; - } - relative() { - if (this.isCWD) return ""; - if (this.#E !== void 0) return this.#E; - let t = this.name, e = this.parent; - if (!e) return this.#E = this.name; - let s = e.relative(); - return s + (!s || !e.parent ? "" : this.sep) + t; - } - relativePosix() { - if (this.sep === "/") return this.relative(); - if (this.isCWD) return ""; - if (this.#T !== void 0) return this.#T; - let t = this.name, e = this.parent; - if (!e) return this.#T = this.fullpathPosix(); - let s = e.relativePosix(); - return s + (!s || !e.parent ? "" : "/") + t; - } - fullpath() { - if (this.#g !== void 0) return this.#g; - let t = this.name, e = this.parent; - if (!e) return this.#g = this.name; - let i = e.fullpath() + (e.parent ? this.sep : "") + t; - return this.#g = i; - } - fullpathPosix() { - if (this.#b !== void 0) return this.#b; - if (this.sep === "/") return this.#b = this.fullpath(); - if (!this.parent) { - let i = this.fullpath().replace(/\\/g, "/"); - return /^[a-z]:\//i.test(i) ? this.#b = `//?/${i}` : this.#b = i; - } - let t = this.parent, e = t.fullpathPosix(), s = e + (!e || !t.parent ? "" : "/") + this.name; - return this.#b = s; - } - isUnknown() { - return (this.#e & j) === N; - } - isType(t) { - return this[`is${t}`](); - } - getType() { - return this.isUnknown() ? "Unknown" : this.isDirectory() ? "Directory" : this.isFile() ? "File" : this.isSymbolicLink() ? "SymbolicLink" : this.isFIFO() ? "FIFO" : this.isCharacterDevice() ? "CharacterDevice" : this.isBlockDevice() ? "BlockDevice" : this.isSocket() ? "Socket" : "Unknown"; - } - isFile() { - return (this.#e & j) === Rs; - } - isDirectory() { - return (this.#e & j) === G; - } - isCharacterDevice() { - return (this.#e & j) === Ts; - } - isBlockDevice() { - return (this.#e & j) === Cs; - } - isFIFO() { - return (this.#e & j) === xs; - } - isSocket() { - return (this.#e & j) === As; - } - isSymbolicLink() { - return (this.#e & Q) === Q; - } - lstatCached() { - return this.#e & ys ? this : void 0; - } - readlinkCached() { - return this.#P; - } - realpathCached() { - return this.#C; - } - readdirCached() { - let t = this.children(); - return t.slice(0, t.provisional); - } - canReadlink() { - if (this.#P) return true; - if (!this.parent) return false; - let t = this.#e & j; - return !(t !== N && t !== Q || this.#e & Vt || this.#e & W); - } - calledReaddir() { - return !!(this.#e & xe); - } - isENOENT() { - return !!(this.#e & W); - } - isNamed(t) { - return this.nocase ? this.#O === Kt(t) : this.#O === wt(t); - } - async readlink() { - let t = this.#P; - if (t) return t; - if (this.canReadlink() && this.parent) try { - let e = await this.#t.promises.readlink(this.fullpath()), s = (await this.parent.realpath())?.resolve(e); - if (s) return this.#P = s; - } catch (e) { - this.#M(e.code); - return; - } - } - readlinkSync() { - let t = this.#P; - if (t) return t; - if (this.canReadlink() && this.parent) try { - let e = this.#t.readlinkSync(this.fullpath()), s = this.parent.realpathSync()?.resolve(e); - if (s) return this.#P = s; - } catch (e) { - this.#M(e.code); - return; - } - } - #W(t) { - this.#e |= xe; - for (let e = t.provisional; e < t.length; e++) { - let s = t[e]; - s && s.#_(); - } - } - #_() { - this.#e & W || (this.#e = (this.#e | W) & dt, this.#$()); - } - #$() { - let t = this.children(); - t.provisional = 0; - for (let e of t) e.#_(); - } - #L() { - this.#e |= Xt, this.#j(); - } - #j() { - if (this.#e & gt) return; - let t = this.#e; - (t & j) === G && (t &= dt), this.#e = t | gt, this.#$(); - } - #B(t = "") { - t === "ENOTDIR" || t === "EPERM" ? this.#j() : t === "ENOENT" ? this.#_() : this.children().provisional = 0; - } - #k(t = "") { - t === "ENOTDIR" ? this.parent.#j() : t === "ENOENT" && this.#_(); - } - #M(t = "") { - let e = this.#e; - e |= Vt, t === "ENOENT" && (e |= W), (t === "EINVAL" || t === "UNKNOWN") && (e &= dt), this.#e = e, t === "ENOTDIR" && this.parent && this.parent.#j(); - } - #I(t, e) { - return this.#z(t, e) || this.#G(t, e); - } - #G(t, e) { - let s = Te(t), i = this.newChild(t.name, s, { parent: this }), r = i.#e & j; - return r !== G && r !== Q && r !== N && (i.#e |= gt), e.unshift(i), e.provisional++, i; - } - #z(t, e) { - for (let s = e.provisional; s < e.length; s++) { - let i = e[s]; - if ((this.nocase ? Kt(t.name) : wt(t.name)) === i.#O) return this.#l(t, i, s, e); - } - } - #l(t, e, s, i) { - let r = e.name; - return e.#e = e.#e & dt | Te(t), r !== t.name && (e.name = t.name), s !== i.provisional && (s === i.length - 1 ? i.pop() : i.splice(s, 1), i.unshift(e)), i.provisional++, e; - } - async lstat() { - if ((this.#e & W) === 0) try { - return this.#U(await this.#t.promises.lstat(this.fullpath())), this; - } catch (t) { - this.#k(t.code); - } - } - lstatSync() { - if ((this.#e & W) === 0) try { - return this.#U(this.#t.lstatSync(this.fullpath())), this; - } catch (t) { - this.#k(t.code); - } - } - #U(t) { - let { atime: e, atimeMs: s, birthtime: i, birthtimeMs: r, blksize: h, blocks: o, ctime: a, ctimeMs: l, dev: f, gid: c, ino: d, mode: u, mtime: m, mtimeMs: p, nlink: b, rdev: w, size: v, uid: E } = t; - this.#y = e, this.#a = s, this.#m = i, this.#v = r, this.#c = h, this.#u = o, this.#R = a, this.#d = l, this.#s = f, this.#S = c, this.#o = d, this.#n = u, this.#p = m, this.#i = p, this.#r = b, this.#w = w, this.#f = v, this.#h = E; - let y = Te(t); - this.#e = this.#e & dt | y | ys, y !== N && y !== G && y !== Q && (this.#e |= gt); - } - #N = []; - #A = false; - #q(t) { - this.#A = false; - let e = this.#N.slice(); - this.#N.length = 0, e.forEach((s) => s(null, t)); - } - readdirCB(t, e = false) { - if (!this.canReaddir()) { - e ? t(null, []) : queueMicrotask(() => t(null, [])); - return; - } - let s = this.children(); - if (this.calledReaddir()) { - let r = s.slice(0, s.provisional); - e ? t(null, r) : queueMicrotask(() => t(null, r)); - return; - } - if (this.#N.push(t), this.#A) return; - this.#A = true; - let i = this.fullpath(); - this.#t.readdir(i, { withFileTypes: true }, (r, h) => { - if (r) this.#B(r.code), s.provisional = 0; - else { - for (let o of h) this.#I(o, s); - this.#W(s); - } - this.#q(s.slice(0, s.provisional)); - }); - } - #H; - async readdir() { - if (!this.canReaddir()) return []; - let t = this.children(); - if (this.calledReaddir()) return t.slice(0, t.provisional); - let e = this.fullpath(); - if (this.#H) await this.#H; - else { - let s = () => { - }; - this.#H = new Promise((i) => s = i); - try { - for (let i of await this.#t.promises.readdir(e, { withFileTypes: true })) this.#I(i, t); - this.#W(t); - } catch (i) { - this.#B(i.code), t.provisional = 0; - } - this.#H = void 0, s(); - } - return t.slice(0, t.provisional); - } - readdirSync() { - if (!this.canReaddir()) return []; - let t = this.children(); - if (this.calledReaddir()) return t.slice(0, t.provisional); - let e = this.fullpath(); - try { - for (let s of this.#t.readdirSync(e, { withFileTypes: true })) this.#I(s, t); - this.#W(t); - } catch (s) { - this.#B(s.code), t.provisional = 0; - } - return t.slice(0, t.provisional); - } - canReaddir() { - if (this.#e & Ss) return false; - let t = j & this.#e; - return t === N || t === G || t === Q; - } - shouldWalk(t, e) { - return (this.#e & G) === G && !(this.#e & Ss) && !t.has(this) && (!e || e(this)); - } - async realpath() { - if (this.#C) return this.#C; - if (!((Xt | Vt | W) & this.#e)) try { - let t = await this.#t.promises.realpath(this.fullpath()); - return this.#C = this.resolve(t); - } catch { - this.#L(); - } - } - realpathSync() { - if (this.#C) return this.#C; - if (!((Xt | Vt | W) & this.#e)) try { - let t = this.#t.realpathSync(this.fullpath()); - return this.#C = this.resolve(t); - } catch { - this.#L(); - } - } - [ks](t) { - if (t === this) return; - t.isCWD = false, this.isCWD = true; - let e = /* @__PURE__ */ new Set([]), s = [], i = this; - for (; i && i.parent; ) e.add(i), i.#E = s.join(this.sep), i.#T = s.join("/"), i = i.parent, s.push(".."); - for (i = t; i && i.parent && !e.has(i); ) i.#E = void 0, i.#T = void 0, i = i.parent; - } - }; - _2.PathBase = A; - var yt = class n extends A { - sep = "\\"; - splitSep = _r; - constructor(t, e = N, s, i, r, h, o) { - super(t, e, s, i, r, h, o); - } - newChild(t, e = N, s = {}) { - return new n(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s); - } - getRootString(t) { - return Yt.win32.parse(t).root; - } - getRoot(t) { - if (t = Er(t.toUpperCase()), t === this.root.name) return this.root; - for (let [e, s] of Object.entries(this.roots)) if (this.sameRoot(t, e)) return this.roots[t] = s; - return this.roots[t] = new Et(t, this).root; - } - sameRoot(t, e = this.root.name) { - return t = t.toUpperCase().replace(/\//g, "\\").replace(Os, "$1\\"), t === e; - } - }; - _2.PathWin32 = yt; - var St = class n extends A { - splitSep = "/"; - sep = "/"; - constructor(t, e = N, s, i, r, h, o) { - super(t, e, s, i, r, h, o); - } - getRootString(t) { - return t.startsWith("/") ? "/" : ""; - } - getRoot(t) { - return this.root; - } - newChild(t, e = N, s = {}) { - return new n(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s); - } - }; - _2.PathPosix = St; - var vt = class { - root; - rootPath; - roots; - cwd; - #t; - #s; - #n; - nocase; - #r; - constructor(t = process.cwd(), e, s, { nocase: i, childrenCacheSize: r = 16 * 1024, fs: h = mt } = {}) { - this.#r = _s(h), (t instanceof URL || t.startsWith("file://")) && (t = (0, yr.fileURLToPath)(t)); - let o = e.resolve(t); - this.roots = /* @__PURE__ */ Object.create(null), this.rootPath = this.parseRootPath(o), this.#t = new bt(), this.#s = new bt(), this.#n = new Jt(r); - let a = o.substring(this.rootPath.length).split(s); - if (a.length === 1 && !a[0] && a.pop(), i === void 0) throw new TypeError("must provide nocase setting to PathScurryBase ctor"); - this.nocase = i, this.root = this.newRoot(this.#r), this.roots[this.rootPath] = this.root; - let l = this.root, f = a.length - 1, c = e.sep, d = this.rootPath, u = false; - for (let m of a) { - let p = f--; - l = l.child(m, { relative: new Array(p).fill("..").join(c), relativePosix: new Array(p).fill("..").join("/"), fullpath: d += (u ? "" : c) + m }), u = true; - } - this.cwd = l; - } - depth(t = this.cwd) { - return typeof t == "string" && (t = this.cwd.resolve(t)), t.depth(); - } - childrenCache() { - return this.#n; - } - resolve(...t) { - let e = ""; - for (let r = t.length - 1; r >= 0; r--) { - let h = t[r]; - if (!(!h || h === ".") && (e = e ? `${h}/${e}` : h, this.isAbsolute(h))) break; - } - let s = this.#t.get(e); - if (s !== void 0) return s; - let i = this.cwd.resolve(e).fullpath(); - return this.#t.set(e, i), i; - } - resolvePosix(...t) { - let e = ""; - for (let r = t.length - 1; r >= 0; r--) { - let h = t[r]; - if (!(!h || h === ".") && (e = e ? `${h}/${e}` : h, this.isAbsolute(h))) break; - } - let s = this.#s.get(e); - if (s !== void 0) return s; - let i = this.cwd.resolve(e).fullpathPosix(); - return this.#s.set(e, i), i; - } - relative(t = this.cwd) { - return typeof t == "string" && (t = this.cwd.resolve(t)), t.relative(); - } - relativePosix(t = this.cwd) { - return typeof t == "string" && (t = this.cwd.resolve(t)), t.relativePosix(); - } - basename(t = this.cwd) { - return typeof t == "string" && (t = this.cwd.resolve(t)), t.name; - } - dirname(t = this.cwd) { - return typeof t == "string" && (t = this.cwd.resolve(t)), (t.parent || t).fullpath(); - } - async readdir(t = this.cwd, e = { withFileTypes: true }) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd); - let { withFileTypes: s } = e; - if (t.canReaddir()) { - let i = await t.readdir(); - return s ? i : i.map((r) => r.name); - } else return []; - } - readdirSync(t = this.cwd, e = { withFileTypes: true }) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd); - let { withFileTypes: s = true } = e; - return t.canReaddir() ? s ? t.readdirSync() : t.readdirSync().map((i) => i.name) : []; - } - async lstat(t = this.cwd) { - return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstat(); - } - lstatSync(t = this.cwd) { - return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstatSync(); - } - async readlink(t = this.cwd, { withFileTypes: e } = { withFileTypes: false }) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t.withFileTypes, t = this.cwd); - let s = await t.readlink(); - return e ? s : s?.fullpath(); - } - readlinkSync(t = this.cwd, { withFileTypes: e } = { withFileTypes: false }) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t.withFileTypes, t = this.cwd); - let s = t.readlinkSync(); - return e ? s : s?.fullpath(); - } - async realpath(t = this.cwd, { withFileTypes: e } = { withFileTypes: false }) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t.withFileTypes, t = this.cwd); - let s = await t.realpath(); - return e ? s : s?.fullpath(); - } - realpathSync(t = this.cwd, { withFileTypes: e } = { withFileTypes: false }) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t.withFileTypes, t = this.cwd); - let s = t.realpathSync(); - return e ? s : s?.fullpath(); - } - async walk(t = this.cwd, e = {}) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd); - let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: h } = e, o = []; - (!r || r(t)) && o.push(s ? t : t.fullpath()); - let a = /* @__PURE__ */ new Set(), l = (c, d) => { - a.add(c), c.readdirCB((u, m) => { - if (u) return d(u); - let p = m.length; - if (!p) return d(); - let b = () => { - --p === 0 && d(); - }; - for (let w of m) (!r || r(w)) && o.push(s ? w : w.fullpath()), i && w.isSymbolicLink() ? w.realpath().then((v) => v?.isUnknown() ? v.lstat() : v).then((v) => v?.shouldWalk(a, h) ? l(v, b) : b()) : w.shouldWalk(a, h) ? l(w, b) : b(); - }, true); - }, f = t; - return new Promise((c, d) => { - l(f, (u) => { - if (u) return d(u); - c(o); - }); - }); - } - walkSync(t = this.cwd, e = {}) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd); - let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: h } = e, o = []; - (!r || r(t)) && o.push(s ? t : t.fullpath()); - let a = /* @__PURE__ */ new Set([t]); - for (let l of a) { - let f = l.readdirSync(); - for (let c of f) { - (!r || r(c)) && o.push(s ? c : c.fullpath()); - let d = c; - if (c.isSymbolicLink()) { - if (!(i && (d = c.realpathSync()))) continue; - d.isUnknown() && d.lstatSync(); - } - d.shouldWalk(a, h) && a.add(d); - } - } - return o; - } - [Symbol.asyncIterator]() { - return this.iterate(); - } - iterate(t = this.cwd, e = {}) { - return typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd), this.stream(t, e)[Symbol.asyncIterator](); - } - [Symbol.iterator]() { - return this.iterateSync(); - } - *iterateSync(t = this.cwd, e = {}) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd); - let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: h } = e; - (!r || r(t)) && (yield s ? t : t.fullpath()); - let o = /* @__PURE__ */ new Set([t]); - for (let a of o) { - let l = a.readdirSync(); - for (let f of l) { - (!r || r(f)) && (yield s ? f : f.fullpath()); - let c = f; - if (f.isSymbolicLink()) { - if (!(i && (c = f.realpathSync()))) continue; - c.isUnknown() && c.lstatSync(); - } - c.shouldWalk(o, h) && o.add(c); - } - } - } - stream(t = this.cwd, e = {}) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd); - let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: h } = e, o = new bs.Minipass({ objectMode: true }); - (!r || r(t)) && o.write(s ? t : t.fullpath()); - let a = /* @__PURE__ */ new Set(), l = [t], f = 0, c = () => { - let d = false; - for (; !d; ) { - let u = l.shift(); - if (!u) { - f === 0 && o.end(); - return; - } - f++, a.add(u); - let m = (b, w, v = false) => { - if (b) return o.emit("error", b); - if (i && !v) { - let E = []; - for (let y of w) y.isSymbolicLink() && E.push(y.realpath().then((S) => S?.isUnknown() ? S.lstat() : S)); - if (E.length) { - Promise.all(E).then(() => m(null, w, true)); - return; - } - } - for (let E of w) E && (!r || r(E)) && (o.write(s ? E : E.fullpath()) || (d = true)); - f--; - for (let E of w) { - let y = E.realpathCached() || E; - y.shouldWalk(a, h) && l.push(y); - } - d && !o.flowing ? o.once("drain", c) : p || c(); - }, p = true; - u.readdirCB(m, true), p = false; - } - }; - return c(), o; - } - streamSync(t = this.cwd, e = {}) { - typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd); - let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: h } = e, o = new bs.Minipass({ objectMode: true }), a = /* @__PURE__ */ new Set(); - (!r || r(t)) && o.write(s ? t : t.fullpath()); - let l = [t], f = 0, c = () => { - let d = false; - for (; !d; ) { - let u = l.shift(); - if (!u) { - f === 0 && o.end(); - return; - } - f++, a.add(u); - let m = u.readdirSync(); - for (let p of m) (!r || r(p)) && (o.write(s ? p : p.fullpath()) || (d = true)); - f--; - for (let p of m) { - let b = p; - if (p.isSymbolicLink()) { - if (!(i && (b = p.realpathSync()))) continue; - b.isUnknown() && b.lstatSync(); - } - b.shouldWalk(a, h) && l.push(b); - } - } - d && !o.flowing && o.once("drain", c); - }; - return c(), o; - } - chdir(t = this.cwd) { - let e = this.cwd; - this.cwd = typeof t == "string" ? this.cwd.resolve(t) : t, this.cwd[ks](e); - } - }; - _2.PathScurryBase = vt; - var Et = class extends vt { - sep = "\\"; - constructor(t = process.cwd(), e = {}) { - let { nocase: s = true } = e; - super(t, Yt.win32, "\\", { ...e, nocase: s }), this.nocase = s; - for (let i = this.cwd; i; i = i.parent) i.nocase = this.nocase; - } - parseRootPath(t) { - return Yt.win32.parse(t).root.toUpperCase(); - } - newRoot(t) { - return new yt(this.rootPath, G, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t }); - } - isAbsolute(t) { - return t.startsWith("/") || t.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(t); - } - }; - _2.PathScurryWin32 = Et; - var _t = class extends vt { - sep = "/"; - constructor(t = process.cwd(), e = {}) { - let { nocase: s = false } = e; - super(t, Yt.posix, "/", { ...e, nocase: s }), this.nocase = s; - } - parseRootPath(t) { - return "/"; - } - newRoot(t) { - return new St(this.rootPath, G, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t }); - } - isAbsolute(t) { - return t.startsWith("/"); - } - }; - _2.PathScurryPosix = _t; - var Zt = class extends _t { - constructor(t = process.cwd(), e = {}) { - let { nocase: s = true } = e; - super(t, { ...e, nocase: s }); - } - }; - _2.PathScurryDarwin = Zt; - _2.Path = process.platform === "win32" ? yt : St; - _2.PathScurry = process.platform === "win32" ? Et : process.platform === "darwin" ? Zt : _t; - }); - var Re = R((te) => { - "use strict"; - Object.defineProperty(te, "__esModule", { value: true }); - te.Pattern = void 0; - var xr = H(), Tr = (n) => n.length >= 1, Cr = (n) => n.length >= 1, Rr = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), Ce = class n { - #t; - #s; - #n; - length; - #r; - #h; - #S; - #w; - #c; - #o; - #f = true; - constructor(t, e, s, i) { - if (!Tr(t)) throw new TypeError("empty pattern list"); - if (!Cr(e)) throw new TypeError("empty glob list"); - if (e.length !== t.length) throw new TypeError("mismatched pattern list and glob list lengths"); - if (this.length = t.length, s < 0 || s >= this.length) throw new TypeError("index out of range"); - if (this.#t = t, this.#s = e, this.#n = s, this.#r = i, this.#n === 0) { - if (this.isUNC()) { - let [r, h, o, a, ...l] = this.#t, [f, c, d, u, ...m] = this.#s; - l[0] === "" && (l.shift(), m.shift()); - let p = [r, h, o, a, ""].join("/"), b = [f, c, d, u, ""].join("/"); - this.#t = [p, ...l], this.#s = [b, ...m], this.length = this.#t.length; - } else if (this.isDrive() || this.isAbsolute()) { - let [r, ...h] = this.#t, [o, ...a] = this.#s; - h[0] === "" && (h.shift(), a.shift()); - let l = r + "/", f = o + "/"; - this.#t = [l, ...h], this.#s = [f, ...a], this.length = this.#t.length; - } - } - } - [Rr]() { - return "Pattern <" + this.#s.slice(this.#n).join("/") + ">"; - } - pattern() { - return this.#t[this.#n]; - } - isString() { - return typeof this.#t[this.#n] == "string"; - } - isGlobstar() { - return this.#t[this.#n] === xr.GLOBSTAR; - } - isRegExp() { - return this.#t[this.#n] instanceof RegExp; - } - globString() { - return this.#S = this.#S || (this.#n === 0 ? this.isAbsolute() ? this.#s[0] + this.#s.slice(1).join("/") : this.#s.join("/") : this.#s.slice(this.#n).join("/")); - } - hasMore() { - return this.length > this.#n + 1; - } - rest() { - return this.#h !== void 0 ? this.#h : this.hasMore() ? (this.#h = new n(this.#t, this.#s, this.#n + 1, this.#r), this.#h.#o = this.#o, this.#h.#c = this.#c, this.#h.#w = this.#w, this.#h) : this.#h = null; - } - isUNC() { - let t = this.#t; - return this.#c !== void 0 ? this.#c : this.#c = this.#r === "win32" && this.#n === 0 && t[0] === "" && t[1] === "" && typeof t[2] == "string" && !!t[2] && typeof t[3] == "string" && !!t[3]; - } - isDrive() { - let t = this.#t; - return this.#w !== void 0 ? this.#w : this.#w = this.#r === "win32" && this.#n === 0 && this.length > 1 && typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]); - } - isAbsolute() { - let t = this.#t; - return this.#o !== void 0 ? this.#o : this.#o = t[0] === "" && t.length > 1 || this.isDrive() || this.isUNC(); - } - root() { - let t = this.#t[0]; - return typeof t == "string" && this.isAbsolute() && this.#n === 0 ? t : ""; - } - checkFollowGlobstar() { - return !(this.#n === 0 || !this.isGlobstar() || !this.#f); - } - markFollowGlobstar() { - return this.#n === 0 || !this.isGlobstar() || !this.#f ? false : (this.#f = false, true); - } - }; - te.Pattern = Ce; - }); - var ke = R((ee) => { - "use strict"; - Object.defineProperty(ee, "__esModule", { value: true }); - ee.Ignore = void 0; - var Ps = H(), Ar = Re(), kr = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux", Ae = class { - relative; - relativeChildren; - absolute; - absoluteChildren; - platform; - mmopts; - constructor(t, { nobrace: e, nocase: s, noext: i, noglobstar: r, platform: h = kr }) { - this.relative = [], this.absolute = [], this.relativeChildren = [], this.absoluteChildren = [], this.platform = h, this.mmopts = { dot: true, nobrace: e, nocase: s, noext: i, noglobstar: r, optimizationLevel: 2, platform: h, nocomment: true, nonegate: true }; - for (let o of t) this.add(o); - } - add(t) { - let e = new Ps.Minimatch(t, this.mmopts); - for (let s = 0; s < e.set.length; s++) { - let i = e.set[s], r = e.globParts[s]; - if (!i || !r) throw new Error("invalid pattern object"); - for (; i[0] === "." && r[0] === "."; ) i.shift(), r.shift(); - let h = new Ar.Pattern(i, r, 0, this.platform), o = new Ps.Minimatch(h.globString(), this.mmopts), a = r[r.length - 1] === "**", l = h.isAbsolute(); - l ? this.absolute.push(o) : this.relative.push(o), a && (l ? this.absoluteChildren.push(o) : this.relativeChildren.push(o)); - } - } - ignored(t) { - let e = t.fullpath(), s = `${e}/`, i = t.relative() || ".", r = `${i}/`; - for (let h of this.relative) if (h.match(i) || h.match(r)) return true; - for (let h of this.absolute) if (h.match(e) || h.match(s)) return true; - return false; - } - childrenIgnored(t) { - let e = t.fullpath() + "/", s = (t.relative() || ".") + "/"; - for (let i of this.relativeChildren) if (i.match(s)) return true; - for (let i of this.absoluteChildren) if (i.match(e)) return true; - return false; - } - }; - ee.Ignore = Ae; - }); - var Fs = R((z) => { - "use strict"; - Object.defineProperty(z, "__esModule", { value: true }); - z.Processor = z.SubWalks = z.MatchRecord = z.HasWalkedCache = void 0; - var Ds = H(), se = class n { - store; - constructor(t = /* @__PURE__ */ new Map()) { - this.store = t; - } - copy() { - return new n(new Map(this.store)); - } - hasWalked(t, e) { - return this.store.get(t.fullpath())?.has(e.globString()); - } - storeWalked(t, e) { - let s = t.fullpath(), i = this.store.get(s); - i ? i.add(e.globString()) : this.store.set(s, /* @__PURE__ */ new Set([e.globString()])); - } - }; - z.HasWalkedCache = se; - var ie = class { - store = /* @__PURE__ */ new Map(); - add(t, e, s) { - let i = (e ? 2 : 0) | (s ? 1 : 0), r = this.store.get(t); - this.store.set(t, r === void 0 ? i : i & r); - } - entries() { - return [...this.store.entries()].map(([t, e]) => [t, !!(e & 2), !!(e & 1)]); - } - }; - z.MatchRecord = ie; - var re = class { - store = /* @__PURE__ */ new Map(); - add(t, e) { - if (!t.canReaddir()) return; - let s = this.store.get(t); - s ? s.find((i) => i.globString() === e.globString()) || s.push(e) : this.store.set(t, [e]); - } - get(t) { - let e = this.store.get(t); - if (!e) throw new Error("attempting to walk unknown path"); - return e; - } - entries() { - return this.keys().map((t) => [t, this.store.get(t)]); - } - keys() { - return [...this.store.keys()].filter((t) => t.canReaddir()); - } - }; - z.SubWalks = re; - var Me = class n { - hasWalkedCache; - matches = new ie(); - subwalks = new re(); - patterns; - follow; - dot; - opts; - constructor(t, e) { - this.opts = t, this.follow = !!t.follow, this.dot = !!t.dot, this.hasWalkedCache = e ? e.copy() : new se(); - } - processPatterns(t, e) { - this.patterns = e; - let s = e.map((i) => [t, i]); - for (let [i, r] of s) { - this.hasWalkedCache.storeWalked(i, r); - let h = r.root(), o = r.isAbsolute() && this.opts.absolute !== false; - if (h) { - i = i.resolve(h === "/" && this.opts.root !== void 0 ? this.opts.root : h); - let c = r.rest(); - if (c) r = c; - else { - this.matches.add(i, true, false); - continue; - } - } - if (i.isENOENT()) continue; - let a, l, f = false; - for (; typeof (a = r.pattern()) == "string" && (l = r.rest()); ) i = i.resolve(a), r = l, f = true; - if (a = r.pattern(), l = r.rest(), f) { - if (this.hasWalkedCache.hasWalked(i, r)) continue; - this.hasWalkedCache.storeWalked(i, r); - } - if (typeof a == "string") { - let c = a === ".." || a === "" || a === "."; - this.matches.add(i.resolve(a), o, c); - continue; - } else if (a === Ds.GLOBSTAR) { - (!i.isSymbolicLink() || this.follow || r.checkFollowGlobstar()) && this.subwalks.add(i, r); - let c = l?.pattern(), d = l?.rest(); - if (!l || (c === "" || c === ".") && !d) this.matches.add(i, o, c === "" || c === "."); - else if (c === "..") { - let u = i.parent || i; - d ? this.hasWalkedCache.hasWalked(u, d) || this.subwalks.add(u, d) : this.matches.add(u, o, true); - } - } else a instanceof RegExp && this.subwalks.add(i, r); - } - return this; - } - subwalkTargets() { - return this.subwalks.keys(); - } - child() { - return new n(this.opts, this.hasWalkedCache); - } - filterEntries(t, e) { - let s = this.subwalks.get(t), i = this.child(); - for (let r of e) for (let h of s) { - let o = h.isAbsolute(), a = h.pattern(), l = h.rest(); - a === Ds.GLOBSTAR ? i.testGlobstar(r, h, l, o) : a instanceof RegExp ? i.testRegExp(r, a, l, o) : i.testString(r, a, l, o); - } - return i; - } - testGlobstar(t, e, s, i) { - if ((this.dot || !t.name.startsWith(".")) && (e.hasMore() || this.matches.add(t, i, false), t.canReaddir() && (this.follow || !t.isSymbolicLink() ? this.subwalks.add(t, e) : t.isSymbolicLink() && (s && e.checkFollowGlobstar() ? this.subwalks.add(t, s) : e.markFollowGlobstar() && this.subwalks.add(t, e)))), s) { - let r = s.pattern(); - if (typeof r == "string" && r !== ".." && r !== "" && r !== ".") this.testString(t, r, s.rest(), i); - else if (r === "..") { - let h = t.parent || t; - this.subwalks.add(h, s); - } else r instanceof RegExp && this.testRegExp(t, r, s.rest(), i); - } - } - testRegExp(t, e, s, i) { - e.test(t.name) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, false)); - } - testString(t, e, s, i) { - t.isNamed(e) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, false)); - } - }; - z.Processor = Me; - }); - var Ls = R((X) => { - "use strict"; - Object.defineProperty(X, "__esModule", { value: true }); - X.GlobStream = X.GlobWalker = X.GlobUtil = void 0; - var Mr = Oe(), js = ke(), Ns = Fs(), Pr = (n, t) => typeof n == "string" ? new js.Ignore([n], t) : Array.isArray(n) ? new js.Ignore(n, t) : n, Ot = class { - path; - patterns; - opts; - seen = /* @__PURE__ */ new Set(); - paused = false; - aborted = false; - #t = []; - #s; - #n; - signal; - maxDepth; - includeChildMatches; - constructor(t, e, s) { - if (this.patterns = t, this.path = e, this.opts = s, this.#n = !s.posix && s.platform === "win32" ? "\\" : "/", this.includeChildMatches = s.includeChildMatches !== false, (s.ignore || !this.includeChildMatches) && (this.#s = Pr(s.ignore ?? [], s), !this.includeChildMatches && typeof this.#s.add != "function")) { - let i = "cannot ignore child matches, ignore lacks add() method."; - throw new Error(i); - } - this.maxDepth = s.maxDepth || 1 / 0, s.signal && (this.signal = s.signal, this.signal.addEventListener("abort", () => { - this.#t.length = 0; - })); - } - #r(t) { - return this.seen.has(t) || !!this.#s?.ignored?.(t); - } - #h(t) { - return !!this.#s?.childrenIgnored?.(t); - } - pause() { - this.paused = true; - } - resume() { - if (this.signal?.aborted) return; - this.paused = false; - let t; - for (; !this.paused && (t = this.#t.shift()); ) t(); - } - onResume(t) { - this.signal?.aborted || (this.paused ? this.#t.push(t) : t()); - } - async matchCheck(t, e) { - if (e && this.opts.nodir) return; - let s; - if (this.opts.realpath) { - if (s = t.realpathCached() || await t.realpath(), !s) return; - t = s; - } - let r = t.isUnknown() || this.opts.stat ? await t.lstat() : t; - if (this.opts.follow && this.opts.nodir && r?.isSymbolicLink()) { - let h = await r.realpath(); - h && (h.isUnknown() || this.opts.stat) && await h.lstat(); - } - return this.matchCheckTest(r, e); - } - matchCheckTest(t, e) { - return t && (this.maxDepth === 1 / 0 || t.depth() <= this.maxDepth) && (!e || t.canReaddir()) && (!this.opts.nodir || !t.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !t.isSymbolicLink() || !t.realpathCached()?.isDirectory()) && !this.#r(t) ? t : void 0; - } - matchCheckSync(t, e) { - if (e && this.opts.nodir) return; - let s; - if (this.opts.realpath) { - if (s = t.realpathCached() || t.realpathSync(), !s) return; - t = s; - } - let r = t.isUnknown() || this.opts.stat ? t.lstatSync() : t; - if (this.opts.follow && this.opts.nodir && r?.isSymbolicLink()) { - let h = r.realpathSync(); - h && (h?.isUnknown() || this.opts.stat) && h.lstatSync(); - } - return this.matchCheckTest(r, e); - } - matchFinish(t, e) { - if (this.#r(t)) return; - if (!this.includeChildMatches && this.#s?.add) { - let r = `${t.relativePosix()}/**`; - this.#s.add(r); - } - let s = this.opts.absolute === void 0 ? e : this.opts.absolute; - this.seen.add(t); - let i = this.opts.mark && t.isDirectory() ? this.#n : ""; - if (this.opts.withFileTypes) this.matchEmit(t); - else if (s) { - let r = this.opts.posix ? t.fullpathPosix() : t.fullpath(); - this.matchEmit(r + i); - } else { - let r = this.opts.posix ? t.relativePosix() : t.relative(), h = this.opts.dotRelative && !r.startsWith(".." + this.#n) ? "." + this.#n : ""; - this.matchEmit(r ? h + r + i : "." + i); - } - } - async match(t, e, s) { - let i = await this.matchCheck(t, s); - i && this.matchFinish(i, e); - } - matchSync(t, e, s) { - let i = this.matchCheckSync(t, s); - i && this.matchFinish(i, e); - } - walkCB(t, e, s) { - this.signal?.aborted && s(), this.walkCB2(t, e, new Ns.Processor(this.opts), s); - } - walkCB2(t, e, s, i) { - if (this.#h(t)) return i(); - if (this.signal?.aborted && i(), this.paused) { - this.onResume(() => this.walkCB2(t, e, s, i)); - return; - } - s.processPatterns(t, e); - let r = 1, h = () => { - --r === 0 && i(); - }; - for (let [o, a, l] of s.matches.entries()) this.#r(o) || (r++, this.match(o, a, l).then(() => h())); - for (let o of s.subwalkTargets()) { - if (this.maxDepth !== 1 / 0 && o.depth() >= this.maxDepth) continue; - r++; - let a = o.readdirCached(); - o.calledReaddir() ? this.walkCB3(o, a, s, h) : o.readdirCB((l, f) => this.walkCB3(o, f, s, h), true); - } - h(); - } - walkCB3(t, e, s, i) { - s = s.filterEntries(t, e); - let r = 1, h = () => { - --r === 0 && i(); - }; - for (let [o, a, l] of s.matches.entries()) this.#r(o) || (r++, this.match(o, a, l).then(() => h())); - for (let [o, a] of s.subwalks.entries()) r++, this.walkCB2(o, a, s.child(), h); - h(); - } - walkCBSync(t, e, s) { - this.signal?.aborted && s(), this.walkCB2Sync(t, e, new Ns.Processor(this.opts), s); - } - walkCB2Sync(t, e, s, i) { - if (this.#h(t)) return i(); - if (this.signal?.aborted && i(), this.paused) { - this.onResume(() => this.walkCB2Sync(t, e, s, i)); - return; - } - s.processPatterns(t, e); - let r = 1, h = () => { - --r === 0 && i(); - }; - for (let [o, a, l] of s.matches.entries()) this.#r(o) || this.matchSync(o, a, l); - for (let o of s.subwalkTargets()) { - if (this.maxDepth !== 1 / 0 && o.depth() >= this.maxDepth) continue; - r++; - let a = o.readdirSync(); - this.walkCB3Sync(o, a, s, h); - } - h(); - } - walkCB3Sync(t, e, s, i) { - s = s.filterEntries(t, e); - let r = 1, h = () => { - --r === 0 && i(); - }; - for (let [o, a, l] of s.matches.entries()) this.#r(o) || this.matchSync(o, a, l); - for (let [o, a] of s.subwalks.entries()) r++, this.walkCB2Sync(o, a, s.child(), h); - h(); - } - }; - X.GlobUtil = Ot; - var Pe = class extends Ot { - matches = /* @__PURE__ */ new Set(); - constructor(t, e, s) { - super(t, e, s); - } - matchEmit(t) { - this.matches.add(t); - } - async walk() { - if (this.signal?.aborted) throw this.signal.reason; - return this.path.isUnknown() && await this.path.lstat(), await new Promise((t, e) => { - this.walkCB(this.path, this.patterns, () => { - this.signal?.aborted ? e(this.signal.reason) : t(this.matches); - }); - }), this.matches; - } - walkSync() { - if (this.signal?.aborted) throw this.signal.reason; - return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => { - if (this.signal?.aborted) throw this.signal.reason; - }), this.matches; - } - }; - X.GlobWalker = Pe; - var De = class extends Ot { - results; - constructor(t, e, s) { - super(t, e, s), this.results = new Mr.Minipass({ signal: this.signal, objectMode: true }), this.results.on("drain", () => this.resume()), this.results.on("resume", () => this.resume()); - } - matchEmit(t) { - this.results.write(t), this.results.flowing || this.pause(); - } - stream() { - let t = this.path; - return t.isUnknown() ? t.lstat().then(() => { - this.walkCB(t, this.patterns, () => this.results.end()); - }) : this.walkCB(t, this.patterns, () => this.results.end()), this.results; - } - streamSync() { - return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => this.results.end()), this.results; - } - }; - X.GlobStream = De; - }); - var je = R((oe) => { - "use strict"; - Object.defineProperty(oe, "__esModule", { value: true }); - oe.Glob = void 0; - var Dr = H(), Fr = require("node:url"), ne = Ms(), jr = Re(), he = Ls(), Nr = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux", Fe = class { - absolute; - cwd; - root; - dot; - dotRelative; - follow; - ignore; - magicalBraces; - mark; - matchBase; - maxDepth; - nobrace; - nocase; - nodir; - noext; - noglobstar; - pattern; - platform; - realpath; - scurry; - stat; - signal; - windowsPathsNoEscape; - withFileTypes; - includeChildMatches; - opts; - patterns; - constructor(t, e) { - if (!e) throw new TypeError("glob options required"); - if (this.withFileTypes = !!e.withFileTypes, this.signal = e.signal, this.follow = !!e.follow, this.dot = !!e.dot, this.dotRelative = !!e.dotRelative, this.nodir = !!e.nodir, this.mark = !!e.mark, e.cwd ? (e.cwd instanceof URL || e.cwd.startsWith("file://")) && (e.cwd = (0, Fr.fileURLToPath)(e.cwd)) : this.cwd = "", this.cwd = e.cwd || "", this.root = e.root, this.magicalBraces = !!e.magicalBraces, this.nobrace = !!e.nobrace, this.noext = !!e.noext, this.realpath = !!e.realpath, this.absolute = e.absolute, this.includeChildMatches = e.includeChildMatches !== false, this.noglobstar = !!e.noglobstar, this.matchBase = !!e.matchBase, this.maxDepth = typeof e.maxDepth == "number" ? e.maxDepth : 1 / 0, this.stat = !!e.stat, this.ignore = e.ignore, this.withFileTypes && this.absolute !== void 0) throw new Error("cannot set absolute and withFileTypes:true"); - if (typeof t == "string" && (t = [t]), this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === false, this.windowsPathsNoEscape && (t = t.map((a) => a.replace(/\\/g, "/"))), this.matchBase) { - if (e.noglobstar) throw new TypeError("base matching requires globstar"); - t = t.map((a) => a.includes("/") ? a : `./**/${a}`); - } - if (this.pattern = t, this.platform = e.platform || Nr, this.opts = { ...e, platform: this.platform }, e.scurry) { - if (this.scurry = e.scurry, e.nocase !== void 0 && e.nocase !== e.scurry.nocase) throw new Error("nocase option contradicts provided scurry option"); - } else { - let a = e.platform === "win32" ? ne.PathScurryWin32 : e.platform === "darwin" ? ne.PathScurryDarwin : e.platform ? ne.PathScurryPosix : ne.PathScurry; - this.scurry = new a(this.cwd, { nocase: e.nocase, fs: e.fs }); - } - this.nocase = this.scurry.nocase; - let s = this.platform === "darwin" || this.platform === "win32", i = { braceExpandMax: 1e4, ...e, dot: this.dot, matchBase: this.matchBase, nobrace: this.nobrace, nocase: this.nocase, nocaseMagicOnly: s, nocomment: true, noext: this.noext, nonegate: true, optimizationLevel: 2, platform: this.platform, windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }, r = this.pattern.map((a) => new Dr.Minimatch(a, i)), [h, o] = r.reduce((a, l) => (a[0].push(...l.set), a[1].push(...l.globParts), a), [[], []]); - this.patterns = h.map((a, l) => { - let f = o[l]; - if (!f) throw new Error("invalid pattern object"); - return new jr.Pattern(a, f, 0, this.platform); - }); - } - async walk() { - return [...await new he.GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, maxDepth: this.maxDepth !== 1 / 0 ? this.maxDepth + this.scurry.cwd.depth() : 1 / 0, platform: this.platform, nocase: this.nocase, includeChildMatches: this.includeChildMatches }).walk()]; - } - walkSync() { - return [...new he.GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, maxDepth: this.maxDepth !== 1 / 0 ? this.maxDepth + this.scurry.cwd.depth() : 1 / 0, platform: this.platform, nocase: this.nocase, includeChildMatches: this.includeChildMatches }).walkSync()]; - } - stream() { - return new he.GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, maxDepth: this.maxDepth !== 1 / 0 ? this.maxDepth + this.scurry.cwd.depth() : 1 / 0, platform: this.platform, nocase: this.nocase, includeChildMatches: this.includeChildMatches }).stream(); - } - streamSync() { - return new he.GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, maxDepth: this.maxDepth !== 1 / 0 ? this.maxDepth + this.scurry.cwd.depth() : 1 / 0, platform: this.platform, nocase: this.nocase, includeChildMatches: this.includeChildMatches }).streamSync(); - } - iterateSync() { - return this.streamSync()[Symbol.iterator](); - } - [Symbol.iterator]() { - return this.iterateSync(); - } - iterate() { - return this.stream()[Symbol.asyncIterator](); - } - [Symbol.asyncIterator]() { - return this.iterate(); - } - }; - oe.Glob = Fe; - }); - var Ne = R((ae) => { - "use strict"; - Object.defineProperty(ae, "__esModule", { value: true }); - ae.hasMagic = void 0; - var Lr = H(), Wr = (n, t = {}) => { - Array.isArray(n) || (n = [n]); - for (let e of n) if (new Lr.Minimatch(e, t).hasMagic()) return true; - return false; - }; - ae.hasMagic = Wr; - }); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.glob = exports2.sync = exports2.iterate = exports2.iterateSync = exports2.stream = exports2.streamSync = exports2.Ignore = exports2.hasMagic = exports2.Glob = exports2.unescape = exports2.escape = void 0; - exports2.globStreamSync = xt; - exports2.globStream = Le; - exports2.globSync = We; - exports2.globIterateSync = Tt; - exports2.globIterate = Be; - var Ws = H(); - var tt = je(); - var Br = Ne(); - var Is = H(); - Object.defineProperty(exports2, "escape", { enumerable: true, get: function() { - return Is.escape; - } }); - Object.defineProperty(exports2, "unescape", { enumerable: true, get: function() { - return Is.unescape; - } }); - var Ir = je(); - Object.defineProperty(exports2, "Glob", { enumerable: true, get: function() { - return Ir.Glob; - } }); - var Gr = Ne(); - Object.defineProperty(exports2, "hasMagic", { enumerable: true, get: function() { - return Gr.hasMagic; - } }); - var zr = ke(); - Object.defineProperty(exports2, "Ignore", { enumerable: true, get: function() { - return zr.Ignore; - } }); - function xt(n, t = {}) { - return new tt.Glob(n, t).streamSync(); - } - function Le(n, t = {}) { - return new tt.Glob(n, t).stream(); - } - function We(n, t = {}) { - return new tt.Glob(n, t).walkSync(); - } - async function Bs(n, t = {}) { - return new tt.Glob(n, t).walk(); - } - function Tt(n, t = {}) { - return new tt.Glob(n, t).iterateSync(); - } - function Be(n, t = {}) { - return new tt.Glob(n, t).iterate(); - } - exports2.streamSync = xt; - exports2.stream = Object.assign(Le, { sync: xt }); - exports2.iterateSync = Tt; - exports2.iterate = Object.assign(Be, { sync: Tt }); - exports2.sync = Object.assign(We, { stream: xt, iterate: Tt }); - exports2.glob = Object.assign(Bs, { glob: Bs, globSync: We, sync: exports2.sync, globStream: Le, stream: exports2.stream, globStreamSync: xt, streamSync: exports2.streamSync, globIterate: Be, iterate: exports2.iterate, globIterateSync: Tt, iterateSync: exports2.iterateSync, Glob: tt.Glob, hasMagic: Br.hasMagic, escape: Ws.escape, unescape: Ws.unescape }); - exports2.glob.glob = exports2.glob; - } -}); - -// node_modules/archiver-utils/file.js -var require_file3 = __commonJS({ - "node_modules/archiver-utils/file.js"(exports2, module2) { - var fs32 = require_graceful_fs(); - var path30 = require("path"); - var flatten = require_flatten(); - var difference = require_difference(); - var union = require_union(); - var isPlainObject4 = require_isPlainObject(); - var glob2 = require_index_min(); - var file = module2.exports = {}; - var pathSeparatorRe = /[\/\\]/g; - var processPatterns = function(patterns, fn) { - var result = []; - flatten(patterns).forEach(function(pattern) { - var exclusion = pattern.indexOf("!") === 0; - if (exclusion) { - pattern = pattern.slice(1); - } - var matches = fn(pattern); - if (exclusion) { - result = difference(result, matches); - } else { - result = union(result, matches); - } - }); - return result; - }; - file.exists = function() { - var filepath = path30.join.apply(path30, arguments); - return fs32.existsSync(filepath); - }; - file.expand = function(...args) { - var options = isPlainObject4(args[0]) ? args.shift() : {}; - var patterns = Array.isArray(args[0]) ? args[0] : args; - if (patterns.length === 0) { - return []; - } - var matches = processPatterns(patterns, function(pattern) { - return glob2.sync(pattern, options); - }); - if (options.filter) { - matches = matches.filter(function(filepath) { - filepath = path30.join(options.cwd || "", filepath); - try { - if (typeof options.filter === "function") { - return options.filter(filepath); - } else { - return fs32.statSync(filepath)[options.filter](); - } - } catch (e) { - return false; - } - }); - } - return matches; - }; - file.expandMapping = function(patterns, destBase, options) { - options = Object.assign({ - rename: function(destBase2, destPath) { - return path30.join(destBase2 || "", destPath); - } - }, options); - var files = []; - var fileByDest = {}; - file.expand(options, patterns).forEach(function(src) { - var destPath = src; - if (options.flatten) { - destPath = path30.basename(destPath); - } - if (options.ext) { - destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); - } - var dest = options.rename(destBase, destPath, options); - if (options.cwd) { - src = path30.join(options.cwd, src); - } - dest = dest.replace(pathSeparatorRe, "/"); - src = src.replace(pathSeparatorRe, "/"); - if (fileByDest[dest]) { - fileByDest[dest].src.push(src); - } else { - files.push({ - src: [src], - dest - }); - fileByDest[dest] = files[files.length - 1]; - } - }); - return files; - }; - file.normalizeFilesArray = function(data) { - var files = []; - data.forEach(function(obj) { - var prop; - if ("src" in obj || "dest" in obj) { - files.push(obj); - } - }); - if (files.length === 0) { - return []; - } - files = _(files).chain().forEach(function(obj) { - if (!("src" in obj) || !obj.src) { - return; - } - if (Array.isArray(obj.src)) { - obj.src = flatten(obj.src); - } else { - obj.src = [obj.src]; - } - }).map(function(obj) { - var expandOptions = Object.assign({}, obj); - delete expandOptions.src; - delete expandOptions.dest; - if (obj.expand) { - return file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) { - var result2 = Object.assign({}, obj); - result2.orig = Object.assign({}, obj); - result2.src = mapObj.src; - result2.dest = mapObj.dest; - ["expand", "cwd", "flatten", "rename", "ext"].forEach(function(prop) { - delete result2[prop]; - }); - return result2; - }); - } - var result = Object.assign({}, obj); - result.orig = Object.assign({}, obj); - if ("src" in result) { - Object.defineProperty(result, "src", { - enumerable: true, - get: function fn() { - var src; - if (!("result" in fn)) { - src = obj.src; - src = Array.isArray(src) ? flatten(src) : [src]; - fn.result = file.expand(expandOptions, src); - } - return fn.result; - } - }); - } - if ("dest" in result) { - result.dest = obj.dest; - } - return result; - }).flatten().value(); - return files; - }; - } -}); - -// node_modules/archiver-utils/index.js -var require_archiver_utils = __commonJS({ - "node_modules/archiver-utils/index.js"(exports2, module2) { - var fs32 = require_graceful_fs(); - var path30 = require("path"); - var isStream2 = require_is_stream(); - var lazystream = require_lazystream(); - var normalizePath4 = require_normalize_path(); - var defaults3 = require_defaults(); - var Stream = require("stream").Stream; - var PassThrough3 = require_ours().PassThrough; - var utils = module2.exports = {}; - utils.file = require_file3(); - utils.collectStream = function(source, callback) { - var collection = []; - var size = 0; - source.on("error", callback); - source.on("data", function(chunk) { - collection.push(chunk); - size += chunk.length; - }); - source.on("end", function() { - var buf = Buffer.alloc(size); - var offset = 0; - collection.forEach(function(data) { - data.copy(buf, offset); - offset += data.length; - }); - callback(null, buf); - }); - }; - utils.dateify = function(dateish) { - dateish = dateish || /* @__PURE__ */ new Date(); - if (dateish instanceof Date) { - dateish = dateish; - } else if (typeof dateish === "string") { - dateish = new Date(dateish); - } else { - dateish = /* @__PURE__ */ new Date(); - } - return dateish; - }; - utils.defaults = function(object2, source, guard) { - var args = arguments; - args[0] = args[0] || {}; - return defaults3(...args); - }; - utils.isStream = function(source) { - return isStream2(source); - }; - utils.lazyReadStream = function(filepath) { - return new lazystream.Readable(function() { - return fs32.createReadStream(filepath); - }); - }; - utils.normalizeInputSource = function(source) { - if (source === null) { - return Buffer.alloc(0); - } else if (typeof source === "string") { - return Buffer.from(source); - } else if (utils.isStream(source)) { - return source.pipe(new PassThrough3()); - } - return source; - }; - utils.sanitizePath = function(filepath) { - return normalizePath4(filepath, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, ""); - }; - utils.trailingSlashIt = function(str) { - return str.slice(-1) !== "/" ? str + "/" : str; - }; - utils.unixifyPath = function(filepath) { - return normalizePath4(filepath, false).replace(/^\w+:/, ""); - }; - utils.walkdir = function(dirpath, base, callback) { - var results = []; - if (typeof base === "function") { - callback = base; - base = dirpath; - } - fs32.readdir(dirpath, function(err, list) { - var i = 0; - var file; - var filepath; - if (err) { - return callback(err); - } - (function next() { - file = list[i++]; - if (!file) { - return callback(null, results); - } - filepath = path30.join(dirpath, file); - fs32.stat(filepath, function(err2, stats) { - results.push({ - path: filepath, - relative: path30.relative(base, filepath).replace(/\\/g, "/"), - stats - }); - if (stats && stats.isDirectory()) { - utils.walkdir(filepath, base, function(err3, res) { - if (err3) { - return callback(err3); - } - res.forEach(function(dirEntry) { - results.push(dirEntry); - }); - next(); - }); - } else { - next(); - } - }); - })(); - }); - }; - } -}); - -// node_modules/@actions/artifact/node_modules/archiver/lib/error.js -var require_error3 = __commonJS({ - "node_modules/@actions/artifact/node_modules/archiver/lib/error.js"(exports2, module2) { - var util3 = require("util"); - var ERROR_CODES2 = { - "ABORTED": "archive was aborted", - "DIRECTORYDIRPATHREQUIRED": "diretory dirpath argument must be a non-empty string value", - "DIRECTORYFUNCTIONINVALIDDATA": "invalid data returned by directory custom data function", - "ENTRYNAMEREQUIRED": "entry name must be a non-empty string value", - "FILEFILEPATHREQUIRED": "file filepath argument must be a non-empty string value", - "FINALIZING": "archive already finalizing", - "QUEUECLOSED": "queue closed", - "NOENDMETHOD": "no suitable finalize/end method defined by module", - "DIRECTORYNOTSUPPORTED": "support for directory entries not defined by module", - "FORMATSET": "archive format already set", - "INPUTSTEAMBUFFERREQUIRED": "input source must be valid Stream or Buffer instance", - "MODULESET": "module already set", - "SYMLINKNOTSUPPORTED": "support for symlink entries not defined by module", - "SYMLINKFILEPATHREQUIRED": "symlink filepath argument must be a non-empty string value", - "SYMLINKTARGETREQUIRED": "symlink target argument must be a non-empty string value", - "ENTRYNOTSUPPORTED": "entry not supported" - }; - function ArchiverError2(code, data) { - Error.captureStackTrace(this, this.constructor); - this.message = ERROR_CODES2[code] || code; - this.code = code; - this.data = data; - } - util3.inherits(ArchiverError2, Error); - exports2 = module2.exports = ArchiverError2; - } -}); - -// node_modules/@actions/artifact/node_modules/archiver/lib/core.js -var require_core2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/archiver/lib/core.js"(exports2, module2) { - var fs32 = require("fs"); - var glob2 = require_readdir_glob(); - var async = require_async(); - var path30 = require("path"); - var util3 = require_archiver_utils(); - var inherits = require("util").inherits; - var ArchiverError2 = require_error3(); - var Transform5 = require_ours().Transform; - var win322 = process.platform === "win32"; - var Archiver2 = function(format, options) { - if (!(this instanceof Archiver2)) { - return new Archiver2(format, options); - } - if (typeof format !== "string") { - options = format; - format = "zip"; - } - options = this.options = util3.defaults(options, { - highWaterMark: 1024 * 1024, - statConcurrency: 4 - }); - Transform5.call(this, options); - this._format = false; - this._module = false; - this._pending = 0; - this._pointer = 0; - this._entriesCount = 0; - this._entriesProcessedCount = 0; - this._fsEntriesTotalBytes = 0; - this._fsEntriesProcessedBytes = 0; - this._queue = async.queue(this._onQueueTask.bind(this), 1); - this._queue.drain(this._onQueueDrain.bind(this)); - this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency); - this._statQueue.drain(this._onQueueDrain.bind(this)); - this._state = { - aborted: false, - finalize: false, - finalizing: false, - finalized: false, - modulePiped: false - }; - this._streams = []; - }; - inherits(Archiver2, Transform5); - Archiver2.prototype._abort = function() { - this._state.aborted = true; - this._queue.kill(); - this._statQueue.kill(); - if (this._queue.idle()) { - this._shutdown(); - } - }; - Archiver2.prototype._append = function(filepath, data) { - data = data || {}; - var task = { - source: null, - filepath - }; - if (!data.name) { - data.name = filepath; - } - data.sourcePath = filepath; - task.data = data; - this._entriesCount++; - if (data.stats && data.stats instanceof fs32.Stats) { - task = this._updateQueueTaskWithStats(task, data.stats); - if (task) { - if (data.stats.size) { - this._fsEntriesTotalBytes += data.stats.size; - } - this._queue.push(task); - } - } else { - this._statQueue.push(task); - } - }; - Archiver2.prototype._finalize = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return; - } - this._state.finalizing = true; - this._moduleFinalize(); - this._state.finalizing = false; - this._state.finalized = true; - }; - Archiver2.prototype._maybeFinalize = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return false; - } - if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - return true; - } - return false; - }; - Archiver2.prototype._moduleAppend = function(source, data, callback) { - if (this._state.aborted) { - callback(); - return; - } - this._module.append(source, data, function(err) { - this._task = null; - if (this._state.aborted) { - this._shutdown(); - return; - } - if (err) { - this.emit("error", err); - setImmediate(callback); - return; - } - this.emit("entry", data); - this._entriesProcessedCount++; - if (data.stats && data.stats.size) { - this._fsEntriesProcessedBytes += data.stats.size; - } - this.emit("progress", { - entries: { - total: this._entriesCount, - processed: this._entriesProcessedCount - }, - fs: { - totalBytes: this._fsEntriesTotalBytes, - processedBytes: this._fsEntriesProcessedBytes - } - }); - setImmediate(callback); - }.bind(this)); - }; - Archiver2.prototype._moduleFinalize = function() { - if (typeof this._module.finalize === "function") { - this._module.finalize(); - } else if (typeof this._module.end === "function") { - this._module.end(); - } else { - this.emit("error", new ArchiverError2("NOENDMETHOD")); - } - }; - Archiver2.prototype._modulePipe = function() { - this._module.on("error", this._onModuleError.bind(this)); - this._module.pipe(this); - this._state.modulePiped = true; - }; - Archiver2.prototype._moduleSupports = function(key) { - if (!this._module.supports || !this._module.supports[key]) { - return false; - } - return this._module.supports[key]; - }; - Archiver2.prototype._moduleUnpipe = function() { - this._module.unpipe(this); - this._state.modulePiped = false; - }; - Archiver2.prototype._normalizeEntryData = function(data, stats) { - data = util3.defaults(data, { - type: "file", - name: null, - date: null, - mode: null, - prefix: null, - sourcePath: null, - stats: false - }); - if (stats && data.stats === false) { - data.stats = stats; - } - var isDir = data.type === "directory"; - if (data.name) { - if (typeof data.prefix === "string" && "" !== data.prefix) { - data.name = data.prefix + "/" + data.name; - data.prefix = null; - } - data.name = util3.sanitizePath(data.name); - if (data.type !== "symlink" && data.name.slice(-1) === "/") { - isDir = true; - data.type = "directory"; - } else if (isDir) { - data.name += "/"; - } - } - if (typeof data.mode === "number") { - if (win322) { - data.mode &= 511; - } else { - data.mode &= 4095; - } - } else if (data.stats && data.mode === null) { - if (win322) { - data.mode = data.stats.mode & 511; - } else { - data.mode = data.stats.mode & 4095; - } - if (win322 && isDir) { - data.mode = 493; - } - } else if (data.mode === null) { - data.mode = isDir ? 493 : 420; - } - if (data.stats && data.date === null) { - data.date = data.stats.mtime; - } else { - data.date = util3.dateify(data.date); - } - return data; - }; - Archiver2.prototype._onModuleError = function(err) { - this.emit("error", err); - }; - Archiver2.prototype._onQueueDrain = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return; - } - if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - } - }; - Archiver2.prototype._onQueueTask = function(task, callback) { - var fullCallback = () => { - if (task.data.callback) { - task.data.callback(); - } - callback(); - }; - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - fullCallback(); - return; - } - this._task = task; - this._moduleAppend(task.source, task.data, fullCallback); - }; - Archiver2.prototype._onStatQueueTask = function(task, callback) { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - callback(); - return; - } - fs32.lstat(task.filepath, function(err, stats) { - if (this._state.aborted) { - setImmediate(callback); - return; - } - if (err) { - this._entriesCount--; - this.emit("warning", err); - setImmediate(callback); - return; - } - task = this._updateQueueTaskWithStats(task, stats); - if (task) { - if (stats.size) { - this._fsEntriesTotalBytes += stats.size; - } - this._queue.push(task); - } - setImmediate(callback); - }.bind(this)); - }; - Archiver2.prototype._shutdown = function() { - this._moduleUnpipe(); - this.end(); - }; - Archiver2.prototype._transform = function(chunk, encoding, callback) { - if (chunk) { - this._pointer += chunk.length; - } - callback(null, chunk); - }; - Archiver2.prototype._updateQueueTaskWithStats = function(task, stats) { - if (stats.isFile()) { - task.data.type = "file"; - task.data.sourceType = "stream"; - task.source = util3.lazyReadStream(task.filepath); - } else if (stats.isDirectory() && this._moduleSupports("directory")) { - task.data.name = util3.trailingSlashIt(task.data.name); - task.data.type = "directory"; - task.data.sourcePath = util3.trailingSlashIt(task.filepath); - task.data.sourceType = "buffer"; - task.source = Buffer.concat([]); - } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) { - var linkPath = fs32.readlinkSync(task.filepath); - var dirName = path30.dirname(task.filepath); - task.data.type = "symlink"; - task.data.linkname = path30.relative(dirName, path30.resolve(dirName, linkPath)); - task.data.sourceType = "buffer"; - task.source = Buffer.concat([]); - } else { - if (stats.isDirectory()) { - this.emit("warning", new ArchiverError2("DIRECTORYNOTSUPPORTED", task.data)); - } else if (stats.isSymbolicLink()) { - this.emit("warning", new ArchiverError2("SYMLINKNOTSUPPORTED", task.data)); - } else { - this.emit("warning", new ArchiverError2("ENTRYNOTSUPPORTED", task.data)); - } - return null; - } - task.data = this._normalizeEntryData(task.data, stats); - return task; - }; - Archiver2.prototype.abort = function() { - if (this._state.aborted || this._state.finalized) { - return this; - } - this._abort(); - return this; - }; - Archiver2.prototype.append = function(source, data) { - if (this._state.finalize || this._state.aborted) { - this.emit("error", new ArchiverError2("QUEUECLOSED")); - return this; - } - data = this._normalizeEntryData(data); - if (typeof data.name !== "string" || data.name.length === 0) { - this.emit("error", new ArchiverError2("ENTRYNAMEREQUIRED")); - return this; - } - if (data.type === "directory" && !this._moduleSupports("directory")) { - this.emit("error", new ArchiverError2("DIRECTORYNOTSUPPORTED", { name: data.name })); - return this; - } - source = util3.normalizeInputSource(source); - if (Buffer.isBuffer(source)) { - data.sourceType = "buffer"; - } else if (util3.isStream(source)) { - data.sourceType = "stream"; - } else { - this.emit("error", new ArchiverError2("INPUTSTEAMBUFFERREQUIRED", { name: data.name })); - return this; - } - this._entriesCount++; - this._queue.push({ - data, - source - }); - return this; - }; - Archiver2.prototype.directory = function(dirpath, destpath, data) { - if (this._state.finalize || this._state.aborted) { - this.emit("error", new ArchiverError2("QUEUECLOSED")); - return this; - } - if (typeof dirpath !== "string" || dirpath.length === 0) { - this.emit("error", new ArchiverError2("DIRECTORYDIRPATHREQUIRED")); - return this; - } - this._pending++; - if (destpath === false) { - destpath = ""; - } else if (typeof destpath !== "string") { - destpath = dirpath; - } - var dataFunction = false; - if (typeof data === "function") { - dataFunction = data; - data = {}; - } else if (typeof data !== "object") { - data = {}; - } - var globOptions = { - stat: true, - dot: true - }; - function onGlobEnd() { - this._pending--; - this._maybeFinalize(); - } - function onGlobError(err) { - this.emit("error", err); - } - function onGlobMatch(match2) { - globber.pause(); - var ignoreMatch = false; - var entryData = Object.assign({}, data); - entryData.name = match2.relative; - entryData.prefix = destpath; - entryData.stats = match2.stat; - entryData.callback = globber.resume.bind(globber); - try { - if (dataFunction) { - entryData = dataFunction(entryData); - if (entryData === false) { - ignoreMatch = true; - } else if (typeof entryData !== "object") { - throw new ArchiverError2("DIRECTORYFUNCTIONINVALIDDATA", { dirpath }); - } - } - } catch (e) { - this.emit("error", e); - return; - } - if (ignoreMatch) { - globber.resume(); - return; - } - this._append(match2.absolute, entryData); - } - var globber = glob2(dirpath, globOptions); - globber.on("error", onGlobError.bind(this)); - globber.on("match", onGlobMatch.bind(this)); - globber.on("end", onGlobEnd.bind(this)); - return this; - }; - Archiver2.prototype.file = function(filepath, data) { - if (this._state.finalize || this._state.aborted) { - this.emit("error", new ArchiverError2("QUEUECLOSED")); - return this; - } - if (typeof filepath !== "string" || filepath.length === 0) { - this.emit("error", new ArchiverError2("FILEFILEPATHREQUIRED")); - return this; - } - this._append(filepath, data); - return this; - }; - Archiver2.prototype.glob = function(pattern, options, data) { - this._pending++; - options = util3.defaults(options, { - stat: true, - pattern - }); - function onGlobEnd() { - this._pending--; - this._maybeFinalize(); - } - function onGlobError(err) { - this.emit("error", err); - } - function onGlobMatch(match2) { - globber.pause(); - var entryData = Object.assign({}, data); - entryData.callback = globber.resume.bind(globber); - entryData.stats = match2.stat; - entryData.name = match2.relative; - this._append(match2.absolute, entryData); - } - var globber = glob2(options.cwd || ".", options); - globber.on("error", onGlobError.bind(this)); - globber.on("match", onGlobMatch.bind(this)); - globber.on("end", onGlobEnd.bind(this)); - return this; - }; - Archiver2.prototype.finalize = function() { - if (this._state.aborted) { - var abortedError = new ArchiverError2("ABORTED"); - this.emit("error", abortedError); - return Promise.reject(abortedError); - } - if (this._state.finalize) { - var finalizingError = new ArchiverError2("FINALIZING"); - this.emit("error", finalizingError); - return Promise.reject(finalizingError); - } - this._state.finalize = true; - if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - } - var self2 = this; - return new Promise(function(resolve14, reject) { - var errored; - self2._module.on("end", function() { - if (!errored) { - resolve14(); - } - }); - self2._module.on("error", function(err) { - errored = true; - reject(err); - }); - }); - }; - Archiver2.prototype.setFormat = function(format) { - if (this._format) { - this.emit("error", new ArchiverError2("FORMATSET")); - return this; - } - this._format = format; - return this; - }; - Archiver2.prototype.setModule = function(module3) { - if (this._state.aborted) { - this.emit("error", new ArchiverError2("ABORTED")); - return this; - } - if (this._state.module) { - this.emit("error", new ArchiverError2("MODULESET")); - return this; - } - this._module = module3; - this._modulePipe(); - return this; - }; - Archiver2.prototype.symlink = function(filepath, target, mode) { - if (this._state.finalize || this._state.aborted) { - this.emit("error", new ArchiverError2("QUEUECLOSED")); - return this; - } - if (typeof filepath !== "string" || filepath.length === 0) { - this.emit("error", new ArchiverError2("SYMLINKFILEPATHREQUIRED")); - return this; - } - if (typeof target !== "string" || target.length === 0) { - this.emit("error", new ArchiverError2("SYMLINKTARGETREQUIRED", { filepath })); - return this; - } - if (!this._moduleSupports("symlink")) { - this.emit("error", new ArchiverError2("SYMLINKNOTSUPPORTED", { filepath })); - return this; - } - var data = {}; - data.type = "symlink"; - data.name = filepath.replace(/\\/g, "/"); - data.linkname = target.replace(/\\/g, "/"); - data.sourceType = "buffer"; - if (typeof mode === "number") { - data.mode = mode; - } - this._entriesCount++; - this._queue.push({ - data, - source: Buffer.concat([]) - }); - return this; - }; - Archiver2.prototype.pointer = function() { - return this._pointer; - }; - Archiver2.prototype.use = function(plugin) { - this._streams.push(plugin); - return this; - }; - module2.exports = Archiver2; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/archive-entry.js -var require_archive_entry = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/archive-entry.js"(exports2, module2) { - var ArchiveEntry2 = module2.exports = function() { - }; - ArchiveEntry2.prototype.getName = function() { - }; - ArchiveEntry2.prototype.getSize = function() { - }; - ArchiveEntry2.prototype.getLastModifiedDate = function() { - }; - ArchiveEntry2.prototype.isDirectory = function() { - }; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/util.js -var require_util14 = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/util.js"(exports2, module2) { - var util3 = module2.exports = {}; - util3.dateToDos = function(d, forceLocalTime) { - forceLocalTime = forceLocalTime || false; - var year = forceLocalTime ? d.getFullYear() : d.getUTCFullYear(); - if (year < 1980) { - return 2162688; - } else if (year >= 2044) { - return 2141175677; - } - var val = { - year, - month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), - date: forceLocalTime ? d.getDate() : d.getUTCDate(), - hours: forceLocalTime ? d.getHours() : d.getUTCHours(), - minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), - seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() - }; - return val.year - 1980 << 25 | val.month + 1 << 21 | val.date << 16 | val.hours << 11 | val.minutes << 5 | val.seconds / 2; - }; - util3.dosToDate = function(dos) { - return new Date((dos >> 25 & 127) + 1980, (dos >> 21 & 15) - 1, dos >> 16 & 31, dos >> 11 & 31, dos >> 5 & 63, (dos & 31) << 1); - }; - util3.fromDosTime = function(buf) { - return util3.dosToDate(buf.readUInt32LE(0)); - }; - util3.getEightBytes = function(v) { - var buf = Buffer.alloc(8); - buf.writeUInt32LE(v % 4294967296, 0); - buf.writeUInt32LE(v / 4294967296 | 0, 4); - return buf; - }; - util3.getShortBytes = function(v) { - var buf = Buffer.alloc(2); - buf.writeUInt16LE((v & 65535) >>> 0, 0); - return buf; - }; - util3.getShortBytesValue = function(buf, offset) { - return buf.readUInt16LE(offset); - }; - util3.getLongBytes = function(v) { - var buf = Buffer.alloc(4); - buf.writeUInt32LE((v & 4294967295) >>> 0, 0); - return buf; - }; - util3.getLongBytesValue = function(buf, offset) { - return buf.readUInt32LE(offset); - }; - util3.toDosTime = function(d) { - return util3.getLongBytes(util3.dateToDos(d)); - }; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js -var require_general_purpose_bit = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js"(exports2, module2) { - var zipUtil = require_util14(); - var DATA_DESCRIPTOR_FLAG2 = 1 << 3; - var ENCRYPTION_FLAG2 = 1 << 0; - var NUMBER_OF_SHANNON_FANO_TREES_FLAG2 = 1 << 2; - var SLIDING_DICTIONARY_SIZE_FLAG2 = 1 << 1; - var STRONG_ENCRYPTION_FLAG2 = 1 << 6; - var UFT8_NAMES_FLAG2 = 1 << 11; - var GeneralPurposeBit2 = module2.exports = function() { - if (!(this instanceof GeneralPurposeBit2)) { - return new GeneralPurposeBit2(); - } - this.descriptor = false; - this.encryption = false; - this.utf8 = false; - this.numberOfShannonFanoTrees = 0; - this.strongEncryption = false; - this.slidingDictionarySize = 0; - return this; - }; - GeneralPurposeBit2.prototype.encode = function() { - return zipUtil.getShortBytes( - (this.descriptor ? DATA_DESCRIPTOR_FLAG2 : 0) | (this.utf8 ? UFT8_NAMES_FLAG2 : 0) | (this.encryption ? ENCRYPTION_FLAG2 : 0) | (this.strongEncryption ? STRONG_ENCRYPTION_FLAG2 : 0) - ); - }; - GeneralPurposeBit2.prototype.parse = function(buf, offset) { - var flag = zipUtil.getShortBytesValue(buf, offset); - var gbp = new GeneralPurposeBit2(); - gbp.useDataDescriptor((flag & DATA_DESCRIPTOR_FLAG2) !== 0); - gbp.useUTF8ForNames((flag & UFT8_NAMES_FLAG2) !== 0); - gbp.useStrongEncryption((flag & STRONG_ENCRYPTION_FLAG2) !== 0); - gbp.useEncryption((flag & ENCRYPTION_FLAG2) !== 0); - gbp.setSlidingDictionarySize((flag & SLIDING_DICTIONARY_SIZE_FLAG2) !== 0 ? 8192 : 4096); - gbp.setNumberOfShannonFanoTrees((flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG2) !== 0 ? 3 : 2); - return gbp; - }; - GeneralPurposeBit2.prototype.setNumberOfShannonFanoTrees = function(n) { - this.numberOfShannonFanoTrees = n; - }; - GeneralPurposeBit2.prototype.getNumberOfShannonFanoTrees = function() { - return this.numberOfShannonFanoTrees; - }; - GeneralPurposeBit2.prototype.setSlidingDictionarySize = function(n) { - this.slidingDictionarySize = n; - }; - GeneralPurposeBit2.prototype.getSlidingDictionarySize = function() { - return this.slidingDictionarySize; - }; - GeneralPurposeBit2.prototype.useDataDescriptor = function(b) { - this.descriptor = b; - }; - GeneralPurposeBit2.prototype.usesDataDescriptor = function() { - return this.descriptor; - }; - GeneralPurposeBit2.prototype.useEncryption = function(b) { - this.encryption = b; - }; - GeneralPurposeBit2.prototype.usesEncryption = function() { - return this.encryption; - }; - GeneralPurposeBit2.prototype.useStrongEncryption = function(b) { - this.strongEncryption = b; - }; - GeneralPurposeBit2.prototype.usesStrongEncryption = function() { - return this.strongEncryption; - }; - GeneralPurposeBit2.prototype.useUTF8ForNames = function(b) { - this.utf8 = b; - }; - GeneralPurposeBit2.prototype.usesUTF8ForNames = function() { - return this.utf8; - }; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/unix-stat.js -var require_unix_stat = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/unix-stat.js"(exports2, module2) { - module2.exports = { - /** - * Bits used for permissions (and sticky bit) - */ - PERM_MASK: 4095, - // 07777 - /** - * Bits used to indicate the filesystem object type. - */ - FILE_TYPE_FLAG: 61440, - // 0170000 - /** - * Indicates symbolic links. - */ - LINK_FLAG: 40960, - // 0120000 - /** - * Indicates plain files. - */ - FILE_FLAG: 32768, - // 0100000 - /** - * Indicates directories. - */ - DIR_FLAG: 16384, - // 040000 - // ---------------------------------------------------------- - // somewhat arbitrary choices that are quite common for shared - // installations - // ----------------------------------------------------------- - /** - * Default permissions for symbolic links. - */ - DEFAULT_LINK_PERM: 511, - // 0777 - /** - * Default permissions for directories. - */ - DEFAULT_DIR_PERM: 493, - // 0755 - /** - * Default permissions for plain files. - */ - DEFAULT_FILE_PERM: 420 - // 0644 - }; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/constants.js -var require_constants13 = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/constants.js"(exports2, module2) { - module2.exports = { - WORD: 4, - DWORD: 8, - EMPTY: Buffer.alloc(0), - SHORT: 2, - SHORT_MASK: 65535, - SHORT_SHIFT: 16, - SHORT_ZERO: Buffer.from(Array(2)), - LONG: 4, - LONG_ZERO: Buffer.from(Array(4)), - MIN_VERSION_INITIAL: 10, - MIN_VERSION_DATA_DESCRIPTOR: 20, - MIN_VERSION_ZIP64: 45, - VERSION_MADEBY: 45, - METHOD_STORED: 0, - METHOD_DEFLATED: 8, - PLATFORM_UNIX: 3, - PLATFORM_FAT: 0, - SIG_LFH: 67324752, - SIG_DD: 134695760, - SIG_CFH: 33639248, - SIG_EOCD: 101010256, - SIG_ZIP64_EOCD: 101075792, - SIG_ZIP64_EOCD_LOC: 117853008, - ZIP64_MAGIC_SHORT: 65535, - ZIP64_MAGIC: 4294967295, - ZIP64_EXTRA_ID: 1, - ZLIB_NO_COMPRESSION: 0, - ZLIB_BEST_SPEED: 1, - ZLIB_BEST_COMPRESSION: 9, - ZLIB_DEFAULT_COMPRESSION: -1, - MODE_MASK: 4095, - DEFAULT_FILE_MODE: 33188, - // 010644 = -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH - DEFAULT_DIR_MODE: 16877, - // 040755 = drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH - EXT_FILE_ATTR_DIR: 1106051088, - // 010173200020 = drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D) - EXT_FILE_ATTR_FILE: 2175008800, - // 020151000040 = -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0 - // Unix file types - S_IFMT: 61440, - // 0170000 type of file mask - S_IFIFO: 4096, - // 010000 named pipe (fifo) - S_IFCHR: 8192, - // 020000 character special - S_IFDIR: 16384, - // 040000 directory - S_IFBLK: 24576, - // 060000 block special - S_IFREG: 32768, - // 0100000 regular - S_IFLNK: 40960, - // 0120000 symbolic link - S_IFSOCK: 49152, - // 0140000 socket - // DOS file type flags - S_DOS_A: 32, - // 040 Archive - S_DOS_D: 16, - // 020 Directory - S_DOS_V: 8, - // 010 Volume - S_DOS_S: 4, - // 04 System - S_DOS_H: 2, - // 02 Hidden - S_DOS_R: 1 - // 01 Read Only - }; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js -var require_zip_archive_entry = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js"(exports2, module2) { - var inherits = require("util").inherits; - var normalizePath4 = require_normalize_path(); - var ArchiveEntry2 = require_archive_entry(); - var GeneralPurposeBit2 = require_general_purpose_bit(); - var UnixStat = require_unix_stat(); - var constants = require_constants13(); - var zipUtil = require_util14(); - var ZipArchiveEntry2 = module2.exports = function(name) { - if (!(this instanceof ZipArchiveEntry2)) { - return new ZipArchiveEntry2(name); - } - ArchiveEntry2.call(this); - this.platform = constants.PLATFORM_FAT; - this.method = -1; - this.name = null; - this.size = 0; - this.csize = 0; - this.gpb = new GeneralPurposeBit2(); - this.crc = 0; - this.time = -1; - this.minver = constants.MIN_VERSION_INITIAL; - this.mode = -1; - this.extra = null; - this.exattr = 0; - this.inattr = 0; - this.comment = null; - if (name) { - this.setName(name); - } - }; - inherits(ZipArchiveEntry2, ArchiveEntry2); - ZipArchiveEntry2.prototype.getCentralDirectoryExtra = function() { - return this.getExtra(); - }; - ZipArchiveEntry2.prototype.getComment = function() { - return this.comment !== null ? this.comment : ""; - }; - ZipArchiveEntry2.prototype.getCompressedSize = function() { - return this.csize; - }; - ZipArchiveEntry2.prototype.getCrc = function() { - return this.crc; - }; - ZipArchiveEntry2.prototype.getExternalAttributes = function() { - return this.exattr; - }; - ZipArchiveEntry2.prototype.getExtra = function() { - return this.extra !== null ? this.extra : constants.EMPTY; - }; - ZipArchiveEntry2.prototype.getGeneralPurposeBit = function() { - return this.gpb; - }; - ZipArchiveEntry2.prototype.getInternalAttributes = function() { - return this.inattr; - }; - ZipArchiveEntry2.prototype.getLastModifiedDate = function() { - return this.getTime(); - }; - ZipArchiveEntry2.prototype.getLocalFileDataExtra = function() { - return this.getExtra(); - }; - ZipArchiveEntry2.prototype.getMethod = function() { - return this.method; - }; - ZipArchiveEntry2.prototype.getName = function() { - return this.name; - }; - ZipArchiveEntry2.prototype.getPlatform = function() { - return this.platform; - }; - ZipArchiveEntry2.prototype.getSize = function() { - return this.size; - }; - ZipArchiveEntry2.prototype.getTime = function() { - return this.time !== -1 ? zipUtil.dosToDate(this.time) : -1; - }; - ZipArchiveEntry2.prototype.getTimeDos = function() { - return this.time !== -1 ? this.time : 0; - }; - ZipArchiveEntry2.prototype.getUnixMode = function() { - return this.platform !== constants.PLATFORM_UNIX ? 0 : this.getExternalAttributes() >> constants.SHORT_SHIFT & constants.SHORT_MASK; - }; - ZipArchiveEntry2.prototype.getVersionNeededToExtract = function() { - return this.minver; - }; - ZipArchiveEntry2.prototype.setComment = function(comment) { - if (Buffer.byteLength(comment) !== comment.length) { - this.getGeneralPurposeBit().useUTF8ForNames(true); - } - this.comment = comment; - }; - ZipArchiveEntry2.prototype.setCompressedSize = function(size) { - if (size < 0) { - throw new Error("invalid entry compressed size"); - } - this.csize = size; - }; - ZipArchiveEntry2.prototype.setCrc = function(crc) { - if (crc < 0) { - throw new Error("invalid entry crc32"); - } - this.crc = crc; - }; - ZipArchiveEntry2.prototype.setExternalAttributes = function(attr) { - this.exattr = attr >>> 0; - }; - ZipArchiveEntry2.prototype.setExtra = function(extra) { - this.extra = extra; - }; - ZipArchiveEntry2.prototype.setGeneralPurposeBit = function(gpb) { - if (!(gpb instanceof GeneralPurposeBit2)) { - throw new Error("invalid entry GeneralPurposeBit"); - } - this.gpb = gpb; - }; - ZipArchiveEntry2.prototype.setInternalAttributes = function(attr) { - this.inattr = attr; - }; - ZipArchiveEntry2.prototype.setMethod = function(method) { - if (method < 0) { - throw new Error("invalid entry compression method"); - } - this.method = method; - }; - ZipArchiveEntry2.prototype.setName = function(name, prependSlash = false) { - name = normalizePath4(name, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, ""); - if (prependSlash) { - name = `/${name}`; - } - if (Buffer.byteLength(name) !== name.length) { - this.getGeneralPurposeBit().useUTF8ForNames(true); - } - this.name = name; - }; - ZipArchiveEntry2.prototype.setPlatform = function(platform2) { - this.platform = platform2; - }; - ZipArchiveEntry2.prototype.setSize = function(size) { - if (size < 0) { - throw new Error("invalid entry size"); - } - this.size = size; - }; - ZipArchiveEntry2.prototype.setTime = function(time, forceLocalTime) { - if (!(time instanceof Date)) { - throw new Error("invalid entry time"); - } - this.time = zipUtil.dateToDos(time, forceLocalTime); - }; - ZipArchiveEntry2.prototype.setUnixMode = function(mode) { - mode |= this.isDirectory() ? constants.S_IFDIR : constants.S_IFREG; - var extattr = 0; - extattr |= mode << constants.SHORT_SHIFT | (this.isDirectory() ? constants.S_DOS_D : constants.S_DOS_A); - this.setExternalAttributes(extattr); - this.mode = mode & constants.MODE_MASK; - this.platform = constants.PLATFORM_UNIX; - }; - ZipArchiveEntry2.prototype.setVersionNeededToExtract = function(minver) { - this.minver = minver; - }; - ZipArchiveEntry2.prototype.isDirectory = function() { - return this.getName().slice(-1) === "/"; - }; - ZipArchiveEntry2.prototype.isUnixSymlink = function() { - return (this.getUnixMode() & UnixStat.FILE_TYPE_FLAG) === UnixStat.LINK_FLAG; - }; - ZipArchiveEntry2.prototype.isZip64 = function() { - return this.csize > constants.ZIP64_MAGIC || this.size > constants.ZIP64_MAGIC; - }; - } -}); - -// node_modules/@actions/artifact/node_modules/is-stream/index.js -var require_is_stream2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/is-stream/index.js"(exports2, module2) { - "use strict"; - var isStream2 = (stream2) => stream2 !== null && typeof stream2 === "object" && typeof stream2.pipe === "function"; - isStream2.writable = (stream2) => isStream2(stream2) && stream2.writable !== false && typeof stream2._write === "function" && typeof stream2._writableState === "object"; - isStream2.readable = (stream2) => isStream2(stream2) && stream2.readable !== false && typeof stream2._read === "function" && typeof stream2._readableState === "object"; - isStream2.duplex = (stream2) => isStream2.writable(stream2) && isStream2.readable(stream2); - isStream2.transform = (stream2) => isStream2.duplex(stream2) && typeof stream2._transform === "function"; - module2.exports = isStream2; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/util/index.js -var require_util15 = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/util/index.js"(exports2, module2) { - var Stream = require("stream").Stream; - var PassThrough3 = require_ours().PassThrough; - var isStream2 = require_is_stream2(); - var util3 = module2.exports = {}; - util3.normalizeInputSource = function(source) { - if (source === null) { - return Buffer.alloc(0); - } else if (typeof source === "string") { - return Buffer.from(source); - } else if (isStream2(source) && !source._readableState) { - var normalized = new PassThrough3(); - source.pipe(normalized); - return normalized; - } - return source; - }; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/archive-output-stream.js -var require_archive_output_stream = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/archive-output-stream.js"(exports2, module2) { - var inherits = require("util").inherits; - var isStream2 = require_is_stream2(); - var Transform5 = require_ours().Transform; - var ArchiveEntry2 = require_archive_entry(); - var util3 = require_util15(); - var ArchiveOutputStream2 = module2.exports = function(options) { - if (!(this instanceof ArchiveOutputStream2)) { - return new ArchiveOutputStream2(options); - } - Transform5.call(this, options); - this.offset = 0; - this._archive = { - finish: false, - finished: false, - processing: false - }; - }; - inherits(ArchiveOutputStream2, Transform5); - ArchiveOutputStream2.prototype._appendBuffer = function(zae, source, callback) { - }; - ArchiveOutputStream2.prototype._appendStream = function(zae, source, callback) { - }; - ArchiveOutputStream2.prototype._emitErrorCallback = function(err) { - if (err) { - this.emit("error", err); - } - }; - ArchiveOutputStream2.prototype._finish = function(ae) { - }; - ArchiveOutputStream2.prototype._normalizeEntry = function(ae) { - }; - ArchiveOutputStream2.prototype._transform = function(chunk, encoding, callback) { - callback(null, chunk); - }; - ArchiveOutputStream2.prototype.entry = function(ae, source, callback) { - source = source || null; - if (typeof callback !== "function") { - callback = this._emitErrorCallback.bind(this); - } - if (!(ae instanceof ArchiveEntry2)) { - callback(new Error("not a valid instance of ArchiveEntry")); - return; - } - if (this._archive.finish || this._archive.finished) { - callback(new Error("unacceptable entry after finish")); - return; - } - if (this._archive.processing) { - callback(new Error("already processing an entry")); - return; - } - this._archive.processing = true; - this._normalizeEntry(ae); - this._entry = ae; - source = util3.normalizeInputSource(source); - if (Buffer.isBuffer(source)) { - this._appendBuffer(ae, source, callback); - } else if (isStream2(source)) { - this._appendStream(ae, source, callback); - } else { - this._archive.processing = false; - callback(new Error("input source must be valid Stream or Buffer instance")); - return; - } - return this; - }; - ArchiveOutputStream2.prototype.finish = function() { - if (this._archive.processing) { - this._archive.finish = true; - return; - } - this._finish(); - }; - ArchiveOutputStream2.prototype.getBytesWritten = function() { - return this.offset; - }; - ArchiveOutputStream2.prototype.write = function(chunk, cb) { - if (chunk) { - this.offset += chunk.length; - } - return Transform5.prototype.write.call(this, chunk, cb); - }; - } -}); - -// node_modules/crc-32/crc32.js -var require_crc32 = __commonJS({ - "node_modules/crc-32/crc32.js"(exports2) { - var CRC32; - (function(factory) { - if (typeof DO_NOT_EXPORT_CRC === "undefined") { - if ("object" === typeof exports2) { - factory(exports2); - } else if ("function" === typeof define && define.amd) { - define(function() { - var module3 = {}; - factory(module3); - return module3; - }); - } else { - factory(CRC32 = {}); - } - } else { - factory(CRC32 = {}); - } - })(function(CRC322) { - CRC322.version = "1.2.2"; - function signed_crc_table() { - var c = 0, table = new Array(256); - for (var n = 0; n != 256; ++n) { - c = n; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - table[n] = c; - } - return typeof Int32Array !== "undefined" ? new Int32Array(table) : table; - } - var T0 = signed_crc_table(); - function slice_by_16_tables(T) { - var c = 0, v = 0, n = 0, table = typeof Int32Array !== "undefined" ? new Int32Array(4096) : new Array(4096); - for (n = 0; n != 256; ++n) table[n] = T[n]; - for (n = 0; n != 256; ++n) { - v = T[n]; - for (c = 256 + n; c < 4096; c += 256) v = table[c] = v >>> 8 ^ T[v & 255]; - } - var out = []; - for (n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== "undefined" ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256); - return out; - } - var TT = slice_by_16_tables(T0); - var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4]; - var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9]; - var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14]; - function crc32_bstr(bstr, seed) { - var C = seed ^ -1; - for (var i = 0, L = bstr.length; i < L; ) C = C >>> 8 ^ T0[(C ^ bstr.charCodeAt(i++)) & 255]; - return ~C; - } - function crc32_buf(B, seed) { - var C = seed ^ -1, L = B.length - 15, i = 0; - for (; i < L; ) C = Tf[B[i++] ^ C & 255] ^ Te[B[i++] ^ C >> 8 & 255] ^ Td[B[i++] ^ C >> 16 & 255] ^ Tc[B[i++] ^ C >>> 24] ^ Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]]; - L += 15; - while (i < L) C = C >>> 8 ^ T0[(C ^ B[i++]) & 255]; - return ~C; - } - function crc32_str(str, seed) { - var C = seed ^ -1; - for (var i = 0, L = str.length, c = 0, d = 0; i < L; ) { - c = str.charCodeAt(i++); - if (c < 128) { - C = C >>> 8 ^ T0[(C ^ c) & 255]; - } else if (c < 2048) { - C = C >>> 8 ^ T0[(C ^ (192 | c >> 6 & 31)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | c & 63)) & 255]; - } else if (c >= 55296 && c < 57344) { - c = (c & 1023) + 64; - d = str.charCodeAt(i++) & 1023; - C = C >>> 8 ^ T0[(C ^ (240 | c >> 8 & 7)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | c >> 2 & 63)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | d >> 6 & 15 | (c & 3) << 4)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | d & 63)) & 255]; - } else { - C = C >>> 8 ^ T0[(C ^ (224 | c >> 12 & 15)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | c >> 6 & 63)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | c & 63)) & 255]; - } - } - return ~C; - } - CRC322.table = T0; - CRC322.bstr = crc32_bstr; - CRC322.buf = crc32_buf; - CRC322.str = crc32_str; - }); - } -}); - -// node_modules/@actions/artifact/node_modules/crc32-stream/lib/crc32-stream.js -var require_crc32_stream = __commonJS({ - "node_modules/@actions/artifact/node_modules/crc32-stream/lib/crc32-stream.js"(exports2, module2) { - "use strict"; - var { Transform: Transform5 } = require_ours(); - var crc325 = require_crc32(); - var CRC32Stream2 = class extends Transform5 { - constructor(options) { - super(options); - this.checksum = Buffer.allocUnsafe(4); - this.checksum.writeInt32BE(0, 0); - this.rawSize = 0; - } - _transform(chunk, encoding, callback) { - if (chunk) { - this.checksum = crc325.buf(chunk, this.checksum) >>> 0; - this.rawSize += chunk.length; - } - callback(null, chunk); - } - digest(encoding) { - const checksum = Buffer.allocUnsafe(4); - checksum.writeUInt32BE(this.checksum >>> 0, 0); - return encoding ? checksum.toString(encoding) : checksum; - } - hex() { - return this.digest("hex").toUpperCase(); - } - size() { - return this.rawSize; - } - }; - module2.exports = CRC32Stream2; - } -}); - -// node_modules/@actions/artifact/node_modules/crc32-stream/lib/deflate-crc32-stream.js -var require_deflate_crc32_stream = __commonJS({ - "node_modules/@actions/artifact/node_modules/crc32-stream/lib/deflate-crc32-stream.js"(exports2, module2) { - "use strict"; - var { DeflateRaw: DeflateRaw2 } = require("zlib"); - var crc325 = require_crc32(); - var DeflateCRC32Stream2 = class extends DeflateRaw2 { - constructor(options) { - super(options); - this.checksum = Buffer.allocUnsafe(4); - this.checksum.writeInt32BE(0, 0); - this.rawSize = 0; - this.compressedSize = 0; - } - push(chunk, encoding) { - if (chunk) { - this.compressedSize += chunk.length; - } - return super.push(chunk, encoding); - } - _transform(chunk, encoding, callback) { - if (chunk) { - this.checksum = crc325.buf(chunk, this.checksum) >>> 0; - this.rawSize += chunk.length; - } - super._transform(chunk, encoding, callback); - } - digest(encoding) { - const checksum = Buffer.allocUnsafe(4); - checksum.writeUInt32BE(this.checksum >>> 0, 0); - return encoding ? checksum.toString(encoding) : checksum; - } - hex() { - return this.digest("hex").toUpperCase(); - } - size(compressed = false) { - if (compressed) { - return this.compressedSize; - } else { - return this.rawSize; - } - } - }; - module2.exports = DeflateCRC32Stream2; - } -}); - -// node_modules/@actions/artifact/node_modules/crc32-stream/lib/index.js -var require_lib3 = __commonJS({ - "node_modules/@actions/artifact/node_modules/crc32-stream/lib/index.js"(exports2, module2) { - "use strict"; - module2.exports = { - CRC32Stream: require_crc32_stream(), - DeflateCRC32Stream: require_deflate_crc32_stream() - }; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js -var require_zip_archive_output_stream = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js"(exports2, module2) { - var inherits = require("util").inherits; - var crc325 = require_crc32(); - var { CRC32Stream: CRC32Stream2 } = require_lib3(); - var { DeflateCRC32Stream: DeflateCRC32Stream2 } = require_lib3(); - var ArchiveOutputStream2 = require_archive_output_stream(); - var ZipArchiveEntry2 = require_zip_archive_entry(); - var GeneralPurposeBit2 = require_general_purpose_bit(); - var constants = require_constants13(); - var util3 = require_util15(); - var zipUtil = require_util14(); - var ZipArchiveOutputStream2 = module2.exports = function(options) { - if (!(this instanceof ZipArchiveOutputStream2)) { - return new ZipArchiveOutputStream2(options); - } - options = this.options = this._defaults(options); - ArchiveOutputStream2.call(this, options); - this._entry = null; - this._entries = []; - this._archive = { - centralLength: 0, - centralOffset: 0, - comment: "", - finish: false, - finished: false, - processing: false, - forceZip64: options.forceZip64, - forceLocalTime: options.forceLocalTime - }; - }; - inherits(ZipArchiveOutputStream2, ArchiveOutputStream2); - ZipArchiveOutputStream2.prototype._afterAppend = function(ae) { - this._entries.push(ae); - if (ae.getGeneralPurposeBit().usesDataDescriptor()) { - this._writeDataDescriptor(ae); - } - this._archive.processing = false; - this._entry = null; - if (this._archive.finish && !this._archive.finished) { - this._finish(); - } - }; - ZipArchiveOutputStream2.prototype._appendBuffer = function(ae, source, callback) { - if (source.length === 0) { - ae.setMethod(constants.METHOD_STORED); - } - var method = ae.getMethod(); - if (method === constants.METHOD_STORED) { - ae.setSize(source.length); - ae.setCompressedSize(source.length); - ae.setCrc(crc325.buf(source) >>> 0); - } - this._writeLocalFileHeader(ae); - if (method === constants.METHOD_STORED) { - this.write(source); - this._afterAppend(ae); - callback(null, ae); - return; - } else if (method === constants.METHOD_DEFLATED) { - this._smartStream(ae, callback).end(source); - return; - } else { - callback(new Error("compression method " + method + " not implemented")); - return; - } - }; - ZipArchiveOutputStream2.prototype._appendStream = function(ae, source, callback) { - ae.getGeneralPurposeBit().useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); - this._writeLocalFileHeader(ae); - var smart = this._smartStream(ae, callback); - source.once("error", function(err) { - smart.emit("error", err); - smart.end(); - }); - source.pipe(smart); - }; - ZipArchiveOutputStream2.prototype._defaults = function(o) { - if (typeof o !== "object") { - o = {}; - } - if (typeof o.zlib !== "object") { - o.zlib = {}; - } - if (typeof o.zlib.level !== "number") { - o.zlib.level = constants.ZLIB_BEST_SPEED; - } - o.forceZip64 = !!o.forceZip64; - o.forceLocalTime = !!o.forceLocalTime; - return o; - }; - ZipArchiveOutputStream2.prototype._finish = function() { - this._archive.centralOffset = this.offset; - this._entries.forEach(function(ae) { - this._writeCentralFileHeader(ae); - }.bind(this)); - this._archive.centralLength = this.offset - this._archive.centralOffset; - if (this.isZip64()) { - this._writeCentralDirectoryZip64(); - } - this._writeCentralDirectoryEnd(); - this._archive.processing = false; - this._archive.finish = true; - this._archive.finished = true; - this.end(); - }; - ZipArchiveOutputStream2.prototype._normalizeEntry = function(ae) { - if (ae.getMethod() === -1) { - ae.setMethod(constants.METHOD_DEFLATED); - } - if (ae.getMethod() === constants.METHOD_DEFLATED) { - ae.getGeneralPurposeBit().useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); - } - if (ae.getTime() === -1) { - ae.setTime(/* @__PURE__ */ new Date(), this._archive.forceLocalTime); - } - ae._offsets = { - file: 0, - data: 0, - contents: 0 - }; - }; - ZipArchiveOutputStream2.prototype._smartStream = function(ae, callback) { - var deflate = ae.getMethod() === constants.METHOD_DEFLATED; - var process2 = deflate ? new DeflateCRC32Stream2(this.options.zlib) : new CRC32Stream2(); - var error3 = null; - function handleStuff() { - var digest = process2.digest().readUInt32BE(0); - ae.setCrc(digest); - ae.setSize(process2.size()); - ae.setCompressedSize(process2.size(true)); - this._afterAppend(ae); - callback(error3, ae); - } - process2.once("end", handleStuff.bind(this)); - process2.once("error", function(err) { - error3 = err; - }); - process2.pipe(this, { end: false }); - return process2; - }; - ZipArchiveOutputStream2.prototype._writeCentralDirectoryEnd = function() { - var records = this._entries.length; - var size = this._archive.centralLength; - var offset = this._archive.centralOffset; - if (this.isZip64()) { - records = constants.ZIP64_MAGIC_SHORT; - size = constants.ZIP64_MAGIC; - offset = constants.ZIP64_MAGIC; - } - this.write(zipUtil.getLongBytes(constants.SIG_EOCD)); - this.write(constants.SHORT_ZERO); - this.write(constants.SHORT_ZERO); - this.write(zipUtil.getShortBytes(records)); - this.write(zipUtil.getShortBytes(records)); - this.write(zipUtil.getLongBytes(size)); - this.write(zipUtil.getLongBytes(offset)); - var comment = this.getComment(); - var commentLength = Buffer.byteLength(comment); - this.write(zipUtil.getShortBytes(commentLength)); - this.write(comment); - }; - ZipArchiveOutputStream2.prototype._writeCentralDirectoryZip64 = function() { - this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD)); - this.write(zipUtil.getEightBytes(44)); - this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); - this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); - this.write(zipUtil.getEightBytes(this._entries.length)); - this.write(zipUtil.getEightBytes(this._entries.length)); - this.write(zipUtil.getEightBytes(this._archive.centralLength)); - this.write(zipUtil.getEightBytes(this._archive.centralOffset)); - this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD_LOC)); - this.write(constants.LONG_ZERO); - this.write(zipUtil.getEightBytes(this._archive.centralOffset + this._archive.centralLength)); - this.write(zipUtil.getLongBytes(1)); - }; - ZipArchiveOutputStream2.prototype._writeCentralFileHeader = function(ae) { - var gpb = ae.getGeneralPurposeBit(); - var method = ae.getMethod(); - var fileOffset = ae._offsets.file; - var size = ae.getSize(); - var compressedSize = ae.getCompressedSize(); - if (ae.isZip64() || fileOffset > constants.ZIP64_MAGIC) { - size = constants.ZIP64_MAGIC; - compressedSize = constants.ZIP64_MAGIC; - fileOffset = constants.ZIP64_MAGIC; - ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); - var extraBuf = Buffer.concat([ - zipUtil.getShortBytes(constants.ZIP64_EXTRA_ID), - zipUtil.getShortBytes(24), - zipUtil.getEightBytes(ae.getSize()), - zipUtil.getEightBytes(ae.getCompressedSize()), - zipUtil.getEightBytes(ae._offsets.file) - ], 28); - ae.setExtra(extraBuf); - } - this.write(zipUtil.getLongBytes(constants.SIG_CFH)); - this.write(zipUtil.getShortBytes(ae.getPlatform() << 8 | constants.VERSION_MADEBY)); - this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); - this.write(gpb.encode()); - this.write(zipUtil.getShortBytes(method)); - this.write(zipUtil.getLongBytes(ae.getTimeDos())); - this.write(zipUtil.getLongBytes(ae.getCrc())); - this.write(zipUtil.getLongBytes(compressedSize)); - this.write(zipUtil.getLongBytes(size)); - var name = ae.getName(); - var comment = ae.getComment(); - var extra = ae.getCentralDirectoryExtra(); - if (gpb.usesUTF8ForNames()) { - name = Buffer.from(name); - comment = Buffer.from(comment); - } - this.write(zipUtil.getShortBytes(name.length)); - this.write(zipUtil.getShortBytes(extra.length)); - this.write(zipUtil.getShortBytes(comment.length)); - this.write(constants.SHORT_ZERO); - this.write(zipUtil.getShortBytes(ae.getInternalAttributes())); - this.write(zipUtil.getLongBytes(ae.getExternalAttributes())); - this.write(zipUtil.getLongBytes(fileOffset)); - this.write(name); - this.write(extra); - this.write(comment); - }; - ZipArchiveOutputStream2.prototype._writeDataDescriptor = function(ae) { - this.write(zipUtil.getLongBytes(constants.SIG_DD)); - this.write(zipUtil.getLongBytes(ae.getCrc())); - if (ae.isZip64()) { - this.write(zipUtil.getEightBytes(ae.getCompressedSize())); - this.write(zipUtil.getEightBytes(ae.getSize())); - } else { - this.write(zipUtil.getLongBytes(ae.getCompressedSize())); - this.write(zipUtil.getLongBytes(ae.getSize())); - } - }; - ZipArchiveOutputStream2.prototype._writeLocalFileHeader = function(ae) { - var gpb = ae.getGeneralPurposeBit(); - var method = ae.getMethod(); - var name = ae.getName(); - var extra = ae.getLocalFileDataExtra(); - if (ae.isZip64()) { - gpb.useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); - } - if (gpb.usesUTF8ForNames()) { - name = Buffer.from(name); - } - ae._offsets.file = this.offset; - this.write(zipUtil.getLongBytes(constants.SIG_LFH)); - this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); - this.write(gpb.encode()); - this.write(zipUtil.getShortBytes(method)); - this.write(zipUtil.getLongBytes(ae.getTimeDos())); - ae._offsets.data = this.offset; - if (gpb.usesDataDescriptor()) { - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); - } else { - this.write(zipUtil.getLongBytes(ae.getCrc())); - this.write(zipUtil.getLongBytes(ae.getCompressedSize())); - this.write(zipUtil.getLongBytes(ae.getSize())); - } - this.write(zipUtil.getShortBytes(name.length)); - this.write(zipUtil.getShortBytes(extra.length)); - this.write(name); - this.write(extra); - ae._offsets.contents = this.offset; - }; - ZipArchiveOutputStream2.prototype.getComment = function(comment) { - return this._archive.comment !== null ? this._archive.comment : ""; - }; - ZipArchiveOutputStream2.prototype.isZip64 = function() { - return this._archive.forceZip64 || this._entries.length > constants.ZIP64_MAGIC_SHORT || this._archive.centralLength > constants.ZIP64_MAGIC || this._archive.centralOffset > constants.ZIP64_MAGIC; - }; - ZipArchiveOutputStream2.prototype.setComment = function(comment) { - this._archive.comment = comment; - }; - } -}); - -// node_modules/@actions/artifact/node_modules/compress-commons/lib/compress-commons.js -var require_compress_commons = __commonJS({ - "node_modules/@actions/artifact/node_modules/compress-commons/lib/compress-commons.js"(exports2, module2) { - module2.exports = { - ArchiveEntry: require_archive_entry(), - ZipArchiveEntry: require_zip_archive_entry(), - ArchiveOutputStream: require_archive_output_stream(), - ZipArchiveOutputStream: require_zip_archive_output_stream() - }; - } -}); - -// node_modules/@actions/artifact/node_modules/zip-stream/index.js -var require_zip_stream = __commonJS({ - "node_modules/@actions/artifact/node_modules/zip-stream/index.js"(exports2, module2) { - var inherits = require("util").inherits; - var ZipArchiveOutputStream2 = require_compress_commons().ZipArchiveOutputStream; - var ZipArchiveEntry2 = require_compress_commons().ZipArchiveEntry; - var util3 = require_archiver_utils(); - var ZipStream2 = module2.exports = function(options) { - if (!(this instanceof ZipStream2)) { - return new ZipStream2(options); - } - options = this.options = options || {}; - options.zlib = options.zlib || {}; - ZipArchiveOutputStream2.call(this, options); - if (typeof options.level === "number" && options.level >= 0) { - options.zlib.level = options.level; - delete options.level; - } - if (!options.forceZip64 && typeof options.zlib.level === "number" && options.zlib.level === 0) { - options.store = true; - } - options.namePrependSlash = options.namePrependSlash || false; - if (options.comment && options.comment.length > 0) { - this.setComment(options.comment); - } - }; - inherits(ZipStream2, ZipArchiveOutputStream2); - ZipStream2.prototype._normalizeFileData = function(data) { - data = util3.defaults(data, { - type: "file", - name: null, - namePrependSlash: this.options.namePrependSlash, - linkname: null, - date: null, - mode: null, - store: this.options.store, - comment: "" - }); - var isDir = data.type === "directory"; - var isSymlink = data.type === "symlink"; - if (data.name) { - data.name = util3.sanitizePath(data.name); - if (!isSymlink && data.name.slice(-1) === "/") { - isDir = true; - data.type = "directory"; - } else if (isDir) { - data.name += "/"; - } - } - if (isDir || isSymlink) { - data.store = true; - } - data.date = util3.dateify(data.date); - return data; - }; - ZipStream2.prototype.entry = function(source, data, callback) { - if (typeof callback !== "function") { - callback = this._emitErrorCallback.bind(this); - } - data = this._normalizeFileData(data); - if (data.type !== "file" && data.type !== "directory" && data.type !== "symlink") { - callback(new Error(data.type + " entries not currently supported")); - return; - } - if (typeof data.name !== "string" || data.name.length === 0) { - callback(new Error("entry name must be a non-empty string value")); - return; - } - if (data.type === "symlink" && typeof data.linkname !== "string") { - callback(new Error("entry linkname must be a non-empty string value when type equals symlink")); - return; - } - var entry = new ZipArchiveEntry2(data.name); - entry.setTime(data.date, this.options.forceLocalTime); - if (data.namePrependSlash) { - entry.setName(data.name, true); - } - if (data.store) { - entry.setMethod(0); - } - if (data.comment.length > 0) { - entry.setComment(data.comment); - } - if (data.type === "symlink" && typeof data.mode !== "number") { - data.mode = 40960; - } - if (typeof data.mode === "number") { - if (data.type === "symlink") { - data.mode |= 40960; - } - entry.setUnixMode(data.mode); - } - if (data.type === "symlink" && typeof data.linkname === "string") { - source = Buffer.from(data.linkname); - } - return ZipArchiveOutputStream2.prototype.entry.call(this, entry, source, callback); - }; - ZipStream2.prototype.finalize = function() { - this.finish(); - }; - } -}); - -// node_modules/@actions/artifact/node_modules/archiver/lib/plugins/zip.js -var require_zip = __commonJS({ - "node_modules/@actions/artifact/node_modules/archiver/lib/plugins/zip.js"(exports2, module2) { - var engine2 = require_zip_stream(); - var util3 = require_archiver_utils(); - var Zip2 = function(options) { - if (!(this instanceof Zip2)) { - return new Zip2(options); - } - options = this.options = util3.defaults(options, { - comment: "", - forceUTC: false, - namePrependSlash: false, - store: false - }); - this.supports = { - directory: true, - symlink: true - }; - this.engine = new engine2(options); - }; - Zip2.prototype.append = function(source, data, callback) { - this.engine.entry(source, data, callback); - }; - Zip2.prototype.finalize = function() { - this.engine.finalize(); - }; - Zip2.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); - }; - Zip2.prototype.pipe = function() { - return this.engine.pipe.apply(this.engine, arguments); - }; - Zip2.prototype.unpipe = function() { - return this.engine.unpipe.apply(this.engine, arguments); - }; - module2.exports = Zip2; - } -}); - -// node_modules/queue-tick/queue-microtask.js -var require_queue_microtask = __commonJS({ - "node_modules/queue-tick/queue-microtask.js"(exports2, module2) { - module2.exports = typeof queueMicrotask === "function" ? queueMicrotask : (fn) => Promise.resolve().then(fn); - } -}); - -// node_modules/queue-tick/process-next-tick.js -var require_process_next_tick = __commonJS({ - "node_modules/queue-tick/process-next-tick.js"(exports2, module2) { - module2.exports = typeof process !== "undefined" && typeof process.nextTick === "function" ? process.nextTick.bind(process) : require_queue_microtask(); - } -}); - -// node_modules/fast-fifo/fixed-size.js -var require_fixed_size = __commonJS({ - "node_modules/fast-fifo/fixed-size.js"(exports2, module2) { - module2.exports = class FixedFIFO { - constructor(hwm) { - if (!(hwm > 0) || (hwm - 1 & hwm) !== 0) throw new Error("Max size for a FixedFIFO should be a power of two"); - this.buffer = new Array(hwm); - this.mask = hwm - 1; - this.top = 0; - this.btm = 0; - this.next = null; - } - clear() { - this.top = this.btm = 0; - this.next = null; - this.buffer.fill(void 0); - } - push(data) { - if (this.buffer[this.top] !== void 0) return false; - this.buffer[this.top] = data; - this.top = this.top + 1 & this.mask; - return true; - } - shift() { - const last = this.buffer[this.btm]; - if (last === void 0) return void 0; - this.buffer[this.btm] = void 0; - this.btm = this.btm + 1 & this.mask; - return last; - } - peek() { - return this.buffer[this.btm]; - } - isEmpty() { - return this.buffer[this.btm] === void 0; - } - }; - } -}); - -// node_modules/fast-fifo/index.js -var require_fast_fifo = __commonJS({ - "node_modules/fast-fifo/index.js"(exports2, module2) { - var FixedFIFO = require_fixed_size(); - module2.exports = class FastFIFO { - constructor(hwm) { - this.hwm = hwm || 16; - this.head = new FixedFIFO(this.hwm); - this.tail = this.head; - this.length = 0; - } - clear() { - this.head = this.tail; - this.head.clear(); - this.length = 0; - } - push(val) { - this.length++; - if (!this.head.push(val)) { - const prev = this.head; - this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length); - this.head.push(val); - } - } - shift() { - if (this.length !== 0) this.length--; - const val = this.tail.shift(); - if (val === void 0 && this.tail.next) { - const next = this.tail.next; - this.tail.next = null; - this.tail = next; - return this.tail.shift(); - } - return val; - } - peek() { - const val = this.tail.peek(); - if (val === void 0 && this.tail.next) return this.tail.next.peek(); - return val; - } - isEmpty() { - return this.length === 0; - } - }; - } -}); - -// node_modules/b4a/index.js -var require_b4a = __commonJS({ - "node_modules/b4a/index.js"(exports2, module2) { - function isBuffer(value) { - return Buffer.isBuffer(value) || value instanceof Uint8Array; - } - function isEncoding(encoding) { - return Buffer.isEncoding(encoding); - } - function alloc(size, fill2, encoding) { - return Buffer.alloc(size, fill2, encoding); - } - function allocUnsafe(size) { - return Buffer.allocUnsafe(size); - } - function allocUnsafeSlow(size) { - return Buffer.allocUnsafeSlow(size); - } - function byteLength(string2, encoding) { - return Buffer.byteLength(string2, encoding); - } - function compare3(a, b) { - return Buffer.compare(a, b); - } - function concat(buffers, totalLength) { - return Buffer.concat(buffers, totalLength); - } - function copy(source, target, targetStart, start, end) { - return toBuffer(source).copy(target, targetStart, start, end); - } - function equals2(a, b) { - return toBuffer(a).equals(b); - } - function fill(buffer, value, offset, end, encoding) { - return toBuffer(buffer).fill(value, offset, end, encoding); - } - function from(value, encodingOrOffset, length) { - return Buffer.from(value, encodingOrOffset, length); - } - function includes(buffer, value, byteOffset, encoding) { - return toBuffer(buffer).includes(value, byteOffset, encoding); - } - function indexOf(buffer, value, byfeOffset, encoding) { - return toBuffer(buffer).indexOf(value, byfeOffset, encoding); - } - function lastIndexOf(buffer, value, byteOffset, encoding) { - return toBuffer(buffer).lastIndexOf(value, byteOffset, encoding); - } - function swap16(buffer) { - return toBuffer(buffer).swap16(); - } - function swap32(buffer) { - return toBuffer(buffer).swap32(); - } - function swap64(buffer) { - return toBuffer(buffer).swap64(); - } - function toBuffer(buffer) { - if (Buffer.isBuffer(buffer)) return buffer; - return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength); - } - function toString2(buffer, encoding, start, end) { - return toBuffer(buffer).toString(encoding, start, end); - } - function write(buffer, string2, offset, length, encoding) { - return toBuffer(buffer).write(string2, offset, length, encoding); - } - function writeDoubleLE(buffer, value, offset) { - return toBuffer(buffer).writeDoubleLE(value, offset); - } - function writeFloatLE(buffer, value, offset) { - return toBuffer(buffer).writeFloatLE(value, offset); - } - function writeUInt32LE(buffer, value, offset) { - return toBuffer(buffer).writeUInt32LE(value, offset); - } - function writeInt32LE(buffer, value, offset) { - return toBuffer(buffer).writeInt32LE(value, offset); - } - function readDoubleLE(buffer, offset) { - return toBuffer(buffer).readDoubleLE(offset); - } - function readFloatLE(buffer, offset) { - return toBuffer(buffer).readFloatLE(offset); - } - function readUInt32LE(buffer, offset) { - return toBuffer(buffer).readUInt32LE(offset); - } - function readInt32LE(buffer, offset) { - return toBuffer(buffer).readInt32LE(offset); - } - function writeDoubleBE(buffer, value, offset) { - return toBuffer(buffer).writeDoubleBE(value, offset); - } - function writeFloatBE(buffer, value, offset) { - return toBuffer(buffer).writeFloatBE(value, offset); - } - function writeUInt32BE(buffer, value, offset) { - return toBuffer(buffer).writeUInt32BE(value, offset); - } - function writeInt32BE(buffer, value, offset) { - return toBuffer(buffer).writeInt32BE(value, offset); - } - function readDoubleBE(buffer, offset) { - return toBuffer(buffer).readDoubleBE(offset); - } - function readFloatBE(buffer, offset) { - return toBuffer(buffer).readFloatBE(offset); - } - function readUInt32BE(buffer, offset) { - return toBuffer(buffer).readUInt32BE(offset); - } - function readInt32BE(buffer, offset) { - return toBuffer(buffer).readInt32BE(offset); - } - module2.exports = { - isBuffer, - isEncoding, - alloc, - allocUnsafe, - allocUnsafeSlow, - byteLength, - compare: compare3, - concat, - copy, - equals: equals2, - fill, - from, - includes, - indexOf, - lastIndexOf, - swap16, - swap32, - swap64, - toBuffer, - toString: toString2, - write, - writeDoubleLE, - writeFloatLE, - writeUInt32LE, - writeInt32LE, - readDoubleLE, - readFloatLE, - readUInt32LE, - readInt32LE, - writeDoubleBE, - writeFloatBE, - writeUInt32BE, - writeInt32BE, - readDoubleBE, - readFloatBE, - readUInt32BE, - readInt32BE - }; - } -}); - -// node_modules/text-decoder/lib/pass-through-decoder.js -var require_pass_through_decoder = __commonJS({ - "node_modules/text-decoder/lib/pass-through-decoder.js"(exports2, module2) { - var b4a = require_b4a(); - module2.exports = class PassThroughDecoder { - constructor(encoding) { - this.encoding = encoding; - } - get remaining() { - return 0; - } - decode(tail) { - return b4a.toString(tail, this.encoding); - } - flush() { - return ""; - } - }; - } -}); - -// node_modules/text-decoder/lib/utf8-decoder.js -var require_utf8_decoder = __commonJS({ - "node_modules/text-decoder/lib/utf8-decoder.js"(exports2, module2) { - var b4a = require_b4a(); - module2.exports = class UTF8Decoder { - constructor() { - this.codePoint = 0; - this.bytesSeen = 0; - this.bytesNeeded = 0; - this.lowerBoundary = 128; - this.upperBoundary = 191; - } - get remaining() { - return this.bytesSeen; - } - decode(data) { - if (this.bytesNeeded === 0) { - let isBoundary = true; - for (let i = Math.max(0, data.byteLength - 4), n = data.byteLength; i < n && isBoundary; i++) { - isBoundary = data[i] <= 127; - } - if (isBoundary) return b4a.toString(data, "utf8"); - } - let result = ""; - for (let i = 0, n = data.byteLength; i < n; i++) { - const byte = data[i]; - if (this.bytesNeeded === 0) { - if (byte <= 127) { - result += String.fromCharCode(byte); - } else { - this.bytesSeen = 1; - if (byte >= 194 && byte <= 223) { - this.bytesNeeded = 2; - this.codePoint = byte & 31; - } else if (byte >= 224 && byte <= 239) { - if (byte === 224) this.lowerBoundary = 160; - else if (byte === 237) this.upperBoundary = 159; - this.bytesNeeded = 3; - this.codePoint = byte & 15; - } else if (byte >= 240 && byte <= 244) { - if (byte === 240) this.lowerBoundary = 144; - if (byte === 244) this.upperBoundary = 143; - this.bytesNeeded = 4; - this.codePoint = byte & 7; - } else { - result += "\uFFFD"; - } - } - continue; - } - if (byte < this.lowerBoundary || byte > this.upperBoundary) { - this.codePoint = 0; - this.bytesNeeded = 0; - this.bytesSeen = 0; - this.lowerBoundary = 128; - this.upperBoundary = 191; - result += "\uFFFD"; - continue; - } - this.lowerBoundary = 128; - this.upperBoundary = 191; - this.codePoint = this.codePoint << 6 | byte & 63; - this.bytesSeen++; - if (this.bytesSeen !== this.bytesNeeded) continue; - result += String.fromCodePoint(this.codePoint); - this.codePoint = 0; - this.bytesNeeded = 0; - this.bytesSeen = 0; - } - return result; - } - flush() { - const result = this.bytesNeeded > 0 ? "\uFFFD" : ""; - this.codePoint = 0; - this.bytesNeeded = 0; - this.bytesSeen = 0; - this.lowerBoundary = 128; - this.upperBoundary = 191; - return result; - } - }; - } -}); - -// node_modules/text-decoder/index.js -var require_text_decoder = __commonJS({ - "node_modules/text-decoder/index.js"(exports2, module2) { - var PassThroughDecoder = require_pass_through_decoder(); - var UTF8Decoder = require_utf8_decoder(); - module2.exports = class TextDecoder { - constructor(encoding = "utf8") { - this.encoding = normalizeEncoding(encoding); - switch (this.encoding) { - case "utf8": - this.decoder = new UTF8Decoder(); - break; - case "utf16le": - case "base64": - throw new Error("Unsupported encoding: " + this.encoding); - default: - this.decoder = new PassThroughDecoder(this.encoding); - } - } - get remaining() { - return this.decoder.remaining; - } - push(data) { - if (typeof data === "string") return data; - return this.decoder.decode(data); - } - // For Node.js compatibility - write(data) { - return this.push(data); - } - end(data) { - let result = ""; - if (data) result = this.push(data); - result += this.decoder.flush(); - return result; - } - }; - function normalizeEncoding(encoding) { - encoding = encoding.toLowerCase(); - switch (encoding) { - case "utf8": - case "utf-8": - return "utf8"; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return "utf16le"; - case "latin1": - case "binary": - return "latin1"; - case "base64": - case "ascii": - case "hex": - return encoding; - default: - throw new Error("Unknown encoding: " + encoding); - } - } - } -}); - -// node_modules/streamx/index.js -var require_streamx = __commonJS({ - "node_modules/streamx/index.js"(exports2, module2) { - var { EventEmitter: EventEmitter2 } = require("events"); - var STREAM_DESTROYED = new Error("Stream was destroyed"); - var PREMATURE_CLOSE = new Error("Premature close"); - var queueTick = require_process_next_tick(); - var FIFO = require_fast_fifo(); - var TextDecoder2 = require_text_decoder(); - var MAX = (1 << 29) - 1; - var OPENING = 1; - var PREDESTROYING = 2; - var DESTROYING = 4; - var DESTROYED = 8; - var NOT_OPENING = MAX ^ OPENING; - var NOT_PREDESTROYING = MAX ^ PREDESTROYING; - var READ_ACTIVE = 1 << 4; - var READ_UPDATING = 2 << 4; - var READ_PRIMARY = 4 << 4; - var READ_QUEUED = 8 << 4; - var READ_RESUMED = 16 << 4; - var READ_PIPE_DRAINED = 32 << 4; - var READ_ENDING = 64 << 4; - var READ_EMIT_DATA = 128 << 4; - var READ_EMIT_READABLE = 256 << 4; - var READ_EMITTED_READABLE = 512 << 4; - var READ_DONE = 1024 << 4; - var READ_NEXT_TICK = 2048 << 4; - var READ_NEEDS_PUSH = 4096 << 4; - var READ_READ_AHEAD = 8192 << 4; - var READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED; - var READ_ACTIVE_AND_NEEDS_PUSH = READ_ACTIVE | READ_NEEDS_PUSH; - var READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE; - var READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED; - var READ_RESUMED_READ_AHEAD = READ_RESUMED | READ_READ_AHEAD; - var READ_NOT_ACTIVE = MAX ^ READ_ACTIVE; - var READ_NON_PRIMARY = MAX ^ READ_PRIMARY; - var READ_NON_PRIMARY_AND_PUSHED = MAX ^ (READ_PRIMARY | READ_NEEDS_PUSH); - var READ_PUSHED = MAX ^ READ_NEEDS_PUSH; - var READ_PAUSED = MAX ^ READ_RESUMED; - var READ_NOT_QUEUED = MAX ^ (READ_QUEUED | READ_EMITTED_READABLE); - var READ_NOT_ENDING = MAX ^ READ_ENDING; - var READ_PIPE_NOT_DRAINED = MAX ^ READ_FLOWING; - var READ_NOT_NEXT_TICK = MAX ^ READ_NEXT_TICK; - var READ_NOT_UPDATING = MAX ^ READ_UPDATING; - var READ_NO_READ_AHEAD = MAX ^ READ_READ_AHEAD; - var READ_PAUSED_NO_READ_AHEAD = MAX ^ READ_RESUMED_READ_AHEAD; - var WRITE_ACTIVE = 1 << 18; - var WRITE_UPDATING = 2 << 18; - var WRITE_PRIMARY = 4 << 18; - var WRITE_QUEUED = 8 << 18; - var WRITE_UNDRAINED = 16 << 18; - var WRITE_DONE = 32 << 18; - var WRITE_EMIT_DRAIN = 64 << 18; - var WRITE_NEXT_TICK = 128 << 18; - var WRITE_WRITING = 256 << 18; - var WRITE_FINISHING = 512 << 18; - var WRITE_CORKED = 1024 << 18; - var WRITE_NOT_ACTIVE = MAX ^ (WRITE_ACTIVE | WRITE_WRITING); - var WRITE_NON_PRIMARY = MAX ^ WRITE_PRIMARY; - var WRITE_NOT_FINISHING = MAX ^ WRITE_FINISHING; - var WRITE_DRAINED = MAX ^ WRITE_UNDRAINED; - var WRITE_NOT_QUEUED = MAX ^ WRITE_QUEUED; - var WRITE_NOT_NEXT_TICK = MAX ^ WRITE_NEXT_TICK; - var WRITE_NOT_UPDATING = MAX ^ WRITE_UPDATING; - var WRITE_NOT_CORKED = MAX ^ WRITE_CORKED; - var ACTIVE = READ_ACTIVE | WRITE_ACTIVE; - var NOT_ACTIVE = MAX ^ ACTIVE; - var DONE = READ_DONE | WRITE_DONE; - var DESTROY_STATUS = DESTROYING | DESTROYED | PREDESTROYING; - var OPEN_STATUS = DESTROY_STATUS | OPENING; - var AUTO_DESTROY = DESTROY_STATUS | DONE; - var NON_PRIMARY = WRITE_NON_PRIMARY & READ_NON_PRIMARY; - var ACTIVE_OR_TICKING = WRITE_NEXT_TICK | READ_NEXT_TICK; - var TICKING = ACTIVE_OR_TICKING & NOT_ACTIVE; - var IS_OPENING = OPEN_STATUS | TICKING; - var READ_PRIMARY_STATUS = OPEN_STATUS | READ_ENDING | READ_DONE; - var READ_STATUS = OPEN_STATUS | READ_DONE | READ_QUEUED; - var READ_ENDING_STATUS = OPEN_STATUS | READ_ENDING | READ_QUEUED; - var READ_READABLE_STATUS = OPEN_STATUS | READ_EMIT_READABLE | READ_QUEUED | READ_EMITTED_READABLE; - var SHOULD_NOT_READ = OPEN_STATUS | READ_ACTIVE | READ_ENDING | READ_DONE | READ_NEEDS_PUSH | READ_READ_AHEAD; - var READ_BACKPRESSURE_STATUS = DESTROY_STATUS | READ_ENDING | READ_DONE; - var READ_UPDATE_SYNC_STATUS = READ_UPDATING | OPEN_STATUS | READ_NEXT_TICK | READ_PRIMARY; - var WRITE_PRIMARY_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_DONE; - var WRITE_QUEUED_AND_UNDRAINED = WRITE_QUEUED | WRITE_UNDRAINED; - var WRITE_QUEUED_AND_ACTIVE = WRITE_QUEUED | WRITE_ACTIVE; - var WRITE_DRAIN_STATUS = WRITE_QUEUED | WRITE_UNDRAINED | OPEN_STATUS | WRITE_ACTIVE; - var WRITE_STATUS = OPEN_STATUS | WRITE_ACTIVE | WRITE_QUEUED | WRITE_CORKED; - var WRITE_PRIMARY_AND_ACTIVE = WRITE_PRIMARY | WRITE_ACTIVE; - var WRITE_ACTIVE_AND_WRITING = WRITE_ACTIVE | WRITE_WRITING; - var WRITE_FINISHING_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_QUEUED_AND_ACTIVE | WRITE_DONE; - var WRITE_BACKPRESSURE_STATUS = WRITE_UNDRAINED | DESTROY_STATUS | WRITE_FINISHING | WRITE_DONE; - var WRITE_UPDATE_SYNC_STATUS = WRITE_UPDATING | OPEN_STATUS | WRITE_NEXT_TICK | WRITE_PRIMARY; - var asyncIterator = Symbol.asyncIterator || /* @__PURE__ */ Symbol("asyncIterator"); - var WritableState = class { - constructor(stream2, { highWaterMark = 16384, map = null, mapWritable, byteLength, byteLengthWritable } = {}) { - this.stream = stream2; - this.queue = new FIFO(); - this.highWaterMark = highWaterMark; - this.buffered = 0; - this.error = null; - this.pipeline = null; - this.drains = null; - this.byteLength = byteLengthWritable || byteLength || defaultByteLength; - this.map = mapWritable || map; - this.afterWrite = afterWrite.bind(this); - this.afterUpdateNextTick = updateWriteNT.bind(this); - } - get ended() { - return (this.stream._duplexState & WRITE_DONE) !== 0; - } - push(data) { - if (this.map !== null) data = this.map(data); - this.buffered += this.byteLength(data); - this.queue.push(data); - if (this.buffered < this.highWaterMark) { - this.stream._duplexState |= WRITE_QUEUED; - return true; - } - this.stream._duplexState |= WRITE_QUEUED_AND_UNDRAINED; - return false; - } - shift() { - const data = this.queue.shift(); - this.buffered -= this.byteLength(data); - if (this.buffered === 0) this.stream._duplexState &= WRITE_NOT_QUEUED; - return data; - } - end(data) { - if (typeof data === "function") this.stream.once("finish", data); - else if (data !== void 0 && data !== null) this.push(data); - this.stream._duplexState = (this.stream._duplexState | WRITE_FINISHING) & WRITE_NON_PRIMARY; - } - autoBatch(data, cb) { - const buffer = []; - const stream2 = this.stream; - buffer.push(data); - while ((stream2._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) { - buffer.push(stream2._writableState.shift()); - } - if ((stream2._duplexState & OPEN_STATUS) !== 0) return cb(null); - stream2._writev(buffer, cb); - } - update() { - const stream2 = this.stream; - stream2._duplexState |= WRITE_UPDATING; - do { - while ((stream2._duplexState & WRITE_STATUS) === WRITE_QUEUED) { - const data = this.shift(); - stream2._duplexState |= WRITE_ACTIVE_AND_WRITING; - stream2._write(data, this.afterWrite); - } - if ((stream2._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); - } while (this.continueUpdate() === true); - stream2._duplexState &= WRITE_NOT_UPDATING; - } - updateNonPrimary() { - const stream2 = this.stream; - if ((stream2._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) { - stream2._duplexState = (stream2._duplexState | WRITE_ACTIVE) & WRITE_NOT_FINISHING; - stream2._final(afterFinal.bind(this)); - return; - } - if ((stream2._duplexState & DESTROY_STATUS) === DESTROYING) { - if ((stream2._duplexState & ACTIVE_OR_TICKING) === 0) { - stream2._duplexState |= ACTIVE; - stream2._destroy(afterDestroy.bind(this)); - } - return; - } - if ((stream2._duplexState & IS_OPENING) === OPENING) { - stream2._duplexState = (stream2._duplexState | ACTIVE) & NOT_OPENING; - stream2._open(afterOpen.bind(this)); - } - } - continueUpdate() { - if ((this.stream._duplexState & WRITE_NEXT_TICK) === 0) return false; - this.stream._duplexState &= WRITE_NOT_NEXT_TICK; - return true; - } - updateCallback() { - if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) this.update(); - else this.updateNextTick(); - } - updateNextTick() { - if ((this.stream._duplexState & WRITE_NEXT_TICK) !== 0) return; - this.stream._duplexState |= WRITE_NEXT_TICK; - if ((this.stream._duplexState & WRITE_UPDATING) === 0) queueTick(this.afterUpdateNextTick); - } - }; - var ReadableState = class { - constructor(stream2, { highWaterMark = 16384, map = null, mapReadable, byteLength, byteLengthReadable } = {}) { - this.stream = stream2; - this.queue = new FIFO(); - this.highWaterMark = highWaterMark === 0 ? 1 : highWaterMark; - this.buffered = 0; - this.readAhead = highWaterMark > 0; - this.error = null; - this.pipeline = null; - this.byteLength = byteLengthReadable || byteLength || defaultByteLength; - this.map = mapReadable || map; - this.pipeTo = null; - this.afterRead = afterRead.bind(this); - this.afterUpdateNextTick = updateReadNT.bind(this); - } - get ended() { - return (this.stream._duplexState & READ_DONE) !== 0; - } - pipe(pipeTo, cb) { - if (this.pipeTo !== null) throw new Error("Can only pipe to one destination"); - if (typeof cb !== "function") cb = null; - this.stream._duplexState |= READ_PIPE_DRAINED; - this.pipeTo = pipeTo; - this.pipeline = new Pipeline(this.stream, pipeTo, cb); - if (cb) this.stream.on("error", noop3); - if (isStreamx(pipeTo)) { - pipeTo._writableState.pipeline = this.pipeline; - if (cb) pipeTo.on("error", noop3); - pipeTo.on("finish", this.pipeline.finished.bind(this.pipeline)); - } else { - const onerror = this.pipeline.done.bind(this.pipeline, pipeTo); - const onclose = this.pipeline.done.bind(this.pipeline, pipeTo, null); - pipeTo.on("error", onerror); - pipeTo.on("close", onclose); - pipeTo.on("finish", this.pipeline.finished.bind(this.pipeline)); - } - pipeTo.on("drain", afterDrain.bind(this)); - this.stream.emit("piping", pipeTo); - pipeTo.emit("pipe", this.stream); - } - push(data) { - const stream2 = this.stream; - if (data === null) { - this.highWaterMark = 0; - stream2._duplexState = (stream2._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED; - return false; - } - if (this.map !== null) { - data = this.map(data); - if (data === null) { - stream2._duplexState &= READ_PUSHED; - return this.buffered < this.highWaterMark; - } - } - this.buffered += this.byteLength(data); - this.queue.push(data); - stream2._duplexState = (stream2._duplexState | READ_QUEUED) & READ_PUSHED; - return this.buffered < this.highWaterMark; - } - shift() { - const data = this.queue.shift(); - this.buffered -= this.byteLength(data); - if (this.buffered === 0) this.stream._duplexState &= READ_NOT_QUEUED; - return data; - } - unshift(data) { - const pending = [this.map !== null ? this.map(data) : data]; - while (this.buffered > 0) pending.push(this.shift()); - for (let i = 0; i < pending.length - 1; i++) { - const data2 = pending[i]; - this.buffered += this.byteLength(data2); - this.queue.push(data2); - } - this.push(pending[pending.length - 1]); - } - read() { - const stream2 = this.stream; - if ((stream2._duplexState & READ_STATUS) === READ_QUEUED) { - const data = this.shift(); - if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream2._duplexState &= READ_PIPE_NOT_DRAINED; - if ((stream2._duplexState & READ_EMIT_DATA) !== 0) stream2.emit("data", data); - return data; - } - if (this.readAhead === false) { - stream2._duplexState |= READ_READ_AHEAD; - this.updateNextTick(); - } - return null; - } - drain() { - const stream2 = this.stream; - while ((stream2._duplexState & READ_STATUS) === READ_QUEUED && (stream2._duplexState & READ_FLOWING) !== 0) { - const data = this.shift(); - if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream2._duplexState &= READ_PIPE_NOT_DRAINED; - if ((stream2._duplexState & READ_EMIT_DATA) !== 0) stream2.emit("data", data); - } - } - update() { - const stream2 = this.stream; - stream2._duplexState |= READ_UPDATING; - do { - this.drain(); - while (this.buffered < this.highWaterMark && (stream2._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) { - stream2._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH; - stream2._read(this.afterRead); - this.drain(); - } - if ((stream2._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) { - stream2._duplexState |= READ_EMITTED_READABLE; - stream2.emit("readable"); - } - if ((stream2._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); - } while (this.continueUpdate() === true); - stream2._duplexState &= READ_NOT_UPDATING; - } - updateNonPrimary() { - const stream2 = this.stream; - if ((stream2._duplexState & READ_ENDING_STATUS) === READ_ENDING) { - stream2._duplexState = (stream2._duplexState | READ_DONE) & READ_NOT_ENDING; - stream2.emit("end"); - if ((stream2._duplexState & AUTO_DESTROY) === DONE) stream2._duplexState |= DESTROYING; - if (this.pipeTo !== null) this.pipeTo.end(); - } - if ((stream2._duplexState & DESTROY_STATUS) === DESTROYING) { - if ((stream2._duplexState & ACTIVE_OR_TICKING) === 0) { - stream2._duplexState |= ACTIVE; - stream2._destroy(afterDestroy.bind(this)); - } - return; - } - if ((stream2._duplexState & IS_OPENING) === OPENING) { - stream2._duplexState = (stream2._duplexState | ACTIVE) & NOT_OPENING; - stream2._open(afterOpen.bind(this)); - } - } - continueUpdate() { - if ((this.stream._duplexState & READ_NEXT_TICK) === 0) return false; - this.stream._duplexState &= READ_NOT_NEXT_TICK; - return true; - } - updateCallback() { - if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) this.update(); - else this.updateNextTick(); - } - updateNextTick() { - if ((this.stream._duplexState & READ_NEXT_TICK) !== 0) return; - this.stream._duplexState |= READ_NEXT_TICK; - if ((this.stream._duplexState & READ_UPDATING) === 0) queueTick(this.afterUpdateNextTick); - } - }; - var TransformState = class { - constructor(stream2) { - this.data = null; - this.afterTransform = afterTransform.bind(stream2); - this.afterFinal = null; - } - }; - var Pipeline = class { - constructor(src, dst, cb) { - this.from = src; - this.to = dst; - this.afterPipe = cb; - this.error = null; - this.pipeToFinished = false; - } - finished() { - this.pipeToFinished = true; - } - done(stream2, err) { - if (err) this.error = err; - if (stream2 === this.to) { - this.to = null; - if (this.from !== null) { - if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) { - this.from.destroy(this.error || new Error("Writable stream closed prematurely")); - } - return; - } - } - if (stream2 === this.from) { - this.from = null; - if (this.to !== null) { - if ((stream2._duplexState & READ_DONE) === 0) { - this.to.destroy(this.error || new Error("Readable stream closed before ending")); - } - return; - } - } - if (this.afterPipe !== null) this.afterPipe(this.error); - this.to = this.from = this.afterPipe = null; - } - }; - function afterDrain() { - this.stream._duplexState |= READ_PIPE_DRAINED; - this.updateCallback(); - } - function afterFinal(err) { - const stream2 = this.stream; - if (err) stream2.destroy(err); - if ((stream2._duplexState & DESTROY_STATUS) === 0) { - stream2._duplexState |= WRITE_DONE; - stream2.emit("finish"); - } - if ((stream2._duplexState & AUTO_DESTROY) === DONE) { - stream2._duplexState |= DESTROYING; - } - stream2._duplexState &= WRITE_NOT_ACTIVE; - if ((stream2._duplexState & WRITE_UPDATING) === 0) this.update(); - else this.updateNextTick(); - } - function afterDestroy(err) { - const stream2 = this.stream; - if (!err && this.error !== STREAM_DESTROYED) err = this.error; - if (err) stream2.emit("error", err); - stream2._duplexState |= DESTROYED; - stream2.emit("close"); - const rs = stream2._readableState; - const ws = stream2._writableState; - if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream2, err); - if (ws !== null) { - while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false); - if (ws.pipeline !== null) ws.pipeline.done(stream2, err); - } - } - function afterWrite(err) { - const stream2 = this.stream; - if (err) stream2.destroy(err); - stream2._duplexState &= WRITE_NOT_ACTIVE; - if (this.drains !== null) tickDrains(this.drains); - if ((stream2._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) { - stream2._duplexState &= WRITE_DRAINED; - if ((stream2._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) { - stream2.emit("drain"); - } - } - this.updateCallback(); - } - function afterRead(err) { - if (err) this.stream.destroy(err); - this.stream._duplexState &= READ_NOT_ACTIVE; - if (this.readAhead === false && (this.stream._duplexState & READ_RESUMED) === 0) this.stream._duplexState &= READ_NO_READ_AHEAD; - this.updateCallback(); - } - function updateReadNT() { - if ((this.stream._duplexState & READ_UPDATING) === 0) { - this.stream._duplexState &= READ_NOT_NEXT_TICK; - this.update(); - } - } - function updateWriteNT() { - if ((this.stream._duplexState & WRITE_UPDATING) === 0) { - this.stream._duplexState &= WRITE_NOT_NEXT_TICK; - this.update(); - } - } - function tickDrains(drains) { - for (let i = 0; i < drains.length; i++) { - if (--drains[i].writes === 0) { - drains.shift().resolve(true); - i--; - } - } - } - function afterOpen(err) { - const stream2 = this.stream; - if (err) stream2.destroy(err); - if ((stream2._duplexState & DESTROYING) === 0) { - if ((stream2._duplexState & READ_PRIMARY_STATUS) === 0) stream2._duplexState |= READ_PRIMARY; - if ((stream2._duplexState & WRITE_PRIMARY_STATUS) === 0) stream2._duplexState |= WRITE_PRIMARY; - stream2.emit("open"); - } - stream2._duplexState &= NOT_ACTIVE; - if (stream2._writableState !== null) { - stream2._writableState.updateCallback(); - } - if (stream2._readableState !== null) { - stream2._readableState.updateCallback(); - } - } - function afterTransform(err, data) { - if (data !== void 0 && data !== null) this.push(data); - this._writableState.afterWrite(err); - } - function newListener(name) { - if (this._readableState !== null) { - if (name === "data") { - this._duplexState |= READ_EMIT_DATA | READ_RESUMED_READ_AHEAD; - this._readableState.updateNextTick(); - } - if (name === "readable") { - this._duplexState |= READ_EMIT_READABLE; - this._readableState.updateNextTick(); - } - } - if (this._writableState !== null) { - if (name === "drain") { - this._duplexState |= WRITE_EMIT_DRAIN; - this._writableState.updateNextTick(); - } - } - } - var Stream = class extends EventEmitter2 { - constructor(opts) { - super(); - this._duplexState = 0; - this._readableState = null; - this._writableState = null; - if (opts) { - if (opts.open) this._open = opts.open; - if (opts.destroy) this._destroy = opts.destroy; - if (opts.predestroy) this._predestroy = opts.predestroy; - if (opts.signal) { - opts.signal.addEventListener("abort", abort.bind(this)); - } - } - this.on("newListener", newListener); - } - _open(cb) { - cb(null); - } - _destroy(cb) { - cb(null); - } - _predestroy() { - } - get readable() { - return this._readableState !== null ? true : void 0; - } - get writable() { - return this._writableState !== null ? true : void 0; - } - get destroyed() { - return (this._duplexState & DESTROYED) !== 0; - } - get destroying() { - return (this._duplexState & DESTROY_STATUS) !== 0; - } - destroy(err) { - if ((this._duplexState & DESTROY_STATUS) === 0) { - if (!err) err = STREAM_DESTROYED; - this._duplexState = (this._duplexState | DESTROYING) & NON_PRIMARY; - if (this._readableState !== null) { - this._readableState.highWaterMark = 0; - this._readableState.error = err; - } - if (this._writableState !== null) { - this._writableState.highWaterMark = 0; - this._writableState.error = err; - } - this._duplexState |= PREDESTROYING; - this._predestroy(); - this._duplexState &= NOT_PREDESTROYING; - if (this._readableState !== null) this._readableState.updateNextTick(); - if (this._writableState !== null) this._writableState.updateNextTick(); - } - } - }; - var Readable3 = class _Readable extends Stream { - constructor(opts) { - super(opts); - this._duplexState |= OPENING | WRITE_DONE | READ_READ_AHEAD; - this._readableState = new ReadableState(this, opts); - if (opts) { - if (this._readableState.readAhead === false) this._duplexState &= READ_NO_READ_AHEAD; - if (opts.read) this._read = opts.read; - if (opts.eagerOpen) this._readableState.updateNextTick(); - if (opts.encoding) this.setEncoding(opts.encoding); - } - } - setEncoding(encoding) { - const dec = new TextDecoder2(encoding); - const map = this._readableState.map || echo; - this._readableState.map = mapOrSkip; - return this; - function mapOrSkip(data) { - const next = dec.push(data); - return next === "" && (data.byteLength !== 0 || dec.remaining > 0) ? null : map(next); - } - } - _read(cb) { - cb(null); - } - pipe(dest, cb) { - this._readableState.updateNextTick(); - this._readableState.pipe(dest, cb); - return dest; - } - read() { - this._readableState.updateNextTick(); - return this._readableState.read(); - } - push(data) { - this._readableState.updateNextTick(); - return this._readableState.push(data); - } - unshift(data) { - this._readableState.updateNextTick(); - return this._readableState.unshift(data); - } - resume() { - this._duplexState |= READ_RESUMED_READ_AHEAD; - this._readableState.updateNextTick(); - return this; - } - pause() { - this._duplexState &= this._readableState.readAhead === false ? READ_PAUSED_NO_READ_AHEAD : READ_PAUSED; - return this; - } - static _fromAsyncIterator(ite, opts) { - let destroy; - const rs = new _Readable({ - ...opts, - read(cb) { - ite.next().then(push).then(cb.bind(null, null)).catch(cb); - }, - predestroy() { - destroy = ite.return(); - }, - destroy(cb) { - if (!destroy) return cb(null); - destroy.then(cb.bind(null, null)).catch(cb); - } - }); - return rs; - function push(data) { - if (data.done) rs.push(null); - else rs.push(data.value); - } - } - static from(data, opts) { - if (isReadStreamx(data)) return data; - if (data[asyncIterator]) return this._fromAsyncIterator(data[asyncIterator](), opts); - if (!Array.isArray(data)) data = data === void 0 ? [] : [data]; - let i = 0; - return new _Readable({ - ...opts, - read(cb) { - this.push(i === data.length ? null : data[i++]); - cb(null); - } - }); - } - static isBackpressured(rs) { - return (rs._duplexState & READ_BACKPRESSURE_STATUS) !== 0 || rs._readableState.buffered >= rs._readableState.highWaterMark; - } - static isPaused(rs) { - return (rs._duplexState & READ_RESUMED) === 0; - } - [asyncIterator]() { - const stream2 = this; - let error3 = null; - let promiseResolve = null; - let promiseReject = null; - this.on("error", (err) => { - error3 = err; - }); - this.on("readable", onreadable); - this.on("close", onclose); - return { - [asyncIterator]() { - return this; - }, - next() { - return new Promise(function(resolve14, reject) { - promiseResolve = resolve14; - promiseReject = reject; - const data = stream2.read(); - if (data !== null) ondata(data); - else if ((stream2._duplexState & DESTROYED) !== 0) ondata(null); - }); - }, - return() { - return destroy(null); - }, - throw(err) { - return destroy(err); - } - }; - function onreadable() { - if (promiseResolve !== null) ondata(stream2.read()); - } - function onclose() { - if (promiseResolve !== null) ondata(null); - } - function ondata(data) { - if (promiseReject === null) return; - if (error3) promiseReject(error3); - else if (data === null && (stream2._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED); - else promiseResolve({ value: data, done: data === null }); - promiseReject = promiseResolve = null; - } - function destroy(err) { - stream2.destroy(err); - return new Promise((resolve14, reject) => { - if (stream2._duplexState & DESTROYED) return resolve14({ value: void 0, done: true }); - stream2.once("close", function() { - if (err) reject(err); - else resolve14({ value: void 0, done: true }); - }); - }); - } - } - }; - var Writable = class extends Stream { - constructor(opts) { - super(opts); - this._duplexState |= OPENING | READ_DONE; - this._writableState = new WritableState(this, opts); - if (opts) { - if (opts.writev) this._writev = opts.writev; - if (opts.write) this._write = opts.write; - if (opts.final) this._final = opts.final; - if (opts.eagerOpen) this._writableState.updateNextTick(); - } - } - cork() { - this._duplexState |= WRITE_CORKED; - } - uncork() { - this._duplexState &= WRITE_NOT_CORKED; - this._writableState.updateNextTick(); - } - _writev(batch, cb) { - cb(null); - } - _write(data, cb) { - this._writableState.autoBatch(data, cb); - } - _final(cb) { - cb(null); - } - static isBackpressured(ws) { - return (ws._duplexState & WRITE_BACKPRESSURE_STATUS) !== 0; - } - static drained(ws) { - if (ws.destroyed) return Promise.resolve(false); - const state = ws._writableState; - const pending = isWritev(ws) ? Math.min(1, state.queue.length) : state.queue.length; - const writes = pending + (ws._duplexState & WRITE_WRITING ? 1 : 0); - if (writes === 0) return Promise.resolve(true); - if (state.drains === null) state.drains = []; - return new Promise((resolve14) => { - state.drains.push({ writes, resolve: resolve14 }); - }); - } - write(data) { - this._writableState.updateNextTick(); - return this._writableState.push(data); - } - end(data) { - this._writableState.updateNextTick(); - this._writableState.end(data); - return this; - } - }; - var Duplex = class extends Readable3 { - // and Writable - constructor(opts) { - super(opts); - this._duplexState = OPENING | this._duplexState & READ_READ_AHEAD; - this._writableState = new WritableState(this, opts); - if (opts) { - if (opts.writev) this._writev = opts.writev; - if (opts.write) this._write = opts.write; - if (opts.final) this._final = opts.final; - } - } - cork() { - this._duplexState |= WRITE_CORKED; - } - uncork() { - this._duplexState &= WRITE_NOT_CORKED; - this._writableState.updateNextTick(); - } - _writev(batch, cb) { - cb(null); - } - _write(data, cb) { - this._writableState.autoBatch(data, cb); - } - _final(cb) { - cb(null); - } - write(data) { - this._writableState.updateNextTick(); - return this._writableState.push(data); - } - end(data) { - this._writableState.updateNextTick(); - this._writableState.end(data); - return this; - } - }; - var Transform5 = class extends Duplex { - constructor(opts) { - super(opts); - this._transformState = new TransformState(this); - if (opts) { - if (opts.transform) this._transform = opts.transform; - if (opts.flush) this._flush = opts.flush; - } - } - _write(data, cb) { - if (this._readableState.buffered >= this._readableState.highWaterMark) { - this._transformState.data = data; - } else { - this._transform(data, this._transformState.afterTransform); - } - } - _read(cb) { - if (this._transformState.data !== null) { - const data = this._transformState.data; - this._transformState.data = null; - cb(null); - this._transform(data, this._transformState.afterTransform); - } else { - cb(null); - } - } - destroy(err) { - super.destroy(err); - if (this._transformState.data !== null) { - this._transformState.data = null; - this._transformState.afterTransform(); - } - } - _transform(data, cb) { - cb(null, data); - } - _flush(cb) { - cb(null); - } - _final(cb) { - this._transformState.afterFinal = cb; - this._flush(transformAfterFlush.bind(this)); - } - }; - var PassThrough3 = class extends Transform5 { - }; - function transformAfterFlush(err, data) { - const cb = this._transformState.afterFinal; - if (err) return cb(err); - if (data !== null && data !== void 0) this.push(data); - this.push(null); - cb(null); - } - function pipelinePromise(...streams) { - return new Promise((resolve14, reject) => { - return pipeline2(...streams, (err) => { - if (err) return reject(err); - resolve14(); - }); - }); - } - function pipeline2(stream2, ...streams) { - const all = Array.isArray(stream2) ? [...stream2, ...streams] : [stream2, ...streams]; - const done = all.length && typeof all[all.length - 1] === "function" ? all.pop() : null; - if (all.length < 2) throw new Error("Pipeline requires at least 2 streams"); - let src = all[0]; - let dest = null; - let error3 = null; - for (let i = 1; i < all.length; i++) { - dest = all[i]; - if (isStreamx(src)) { - src.pipe(dest, onerror); - } else { - errorHandle(src, true, i > 1, onerror); - src.pipe(dest); - } - src = dest; - } - if (done) { - let fin = false; - const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy); - dest.on("error", (err) => { - if (error3 === null) error3 = err; - }); - dest.on("finish", () => { - fin = true; - if (!autoDestroy) done(error3); - }); - if (autoDestroy) { - dest.on("close", () => done(error3 || (fin ? null : PREMATURE_CLOSE))); - } - } - return dest; - function errorHandle(s, rd, wr, onerror2) { - s.on("error", onerror2); - s.on("close", onclose); - function onclose() { - if (rd && s._readableState && !s._readableState.ended) return onerror2(PREMATURE_CLOSE); - if (wr && s._writableState && !s._writableState.ended) return onerror2(PREMATURE_CLOSE); - } - } - function onerror(err) { - if (!err || error3) return; - error3 = err; - for (const s of all) { - s.destroy(err); - } - } - } - function echo(s) { - return s; - } - function isStream2(stream2) { - return !!stream2._readableState || !!stream2._writableState; - } - function isStreamx(stream2) { - return typeof stream2._duplexState === "number" && isStream2(stream2); - } - function isEnded(stream2) { - return !!stream2._readableState && stream2._readableState.ended; - } - function isFinished(stream2) { - return !!stream2._writableState && stream2._writableState.ended; - } - function getStreamError(stream2, opts = {}) { - const err = stream2._readableState && stream2._readableState.error || stream2._writableState && stream2._writableState.error; - return !opts.all && err === STREAM_DESTROYED ? null : err; - } - function isReadStreamx(stream2) { - return isStreamx(stream2) && stream2.readable; - } - function isTypedArray(data) { - return typeof data === "object" && data !== null && typeof data.byteLength === "number"; - } - function defaultByteLength(data) { - return isTypedArray(data) ? data.byteLength : 1024; - } - function noop3() { - } - function abort() { - this.destroy(new Error("Stream aborted.")); - } - function isWritev(s) { - return s._writev !== Writable.prototype._writev && s._writev !== Duplex.prototype._writev; - } - module2.exports = { - pipeline: pipeline2, - pipelinePromise, - isStream: isStream2, - isStreamx, - isEnded, - isFinished, - getStreamError, - Stream, - Writable, - Readable: Readable3, - Duplex, - Transform: Transform5, - // Export PassThrough for compatibility with Node.js core's stream module - PassThrough: PassThrough3 - }; - } -}); - -// node_modules/tar-stream/headers.js -var require_headers2 = __commonJS({ - "node_modules/tar-stream/headers.js"(exports2) { - var b4a = require_b4a(); - var ZEROS = "0000000000000000000"; - var SEVENS = "7777777777777777777"; - var ZERO_OFFSET = "0".charCodeAt(0); - var USTAR_MAGIC = b4a.from([117, 115, 116, 97, 114, 0]); - var USTAR_VER = b4a.from([ZERO_OFFSET, ZERO_OFFSET]); - var GNU_MAGIC = b4a.from([117, 115, 116, 97, 114, 32]); - var GNU_VER = b4a.from([32, 0]); - var MASK = 4095; - var MAGIC_OFFSET = 257; - var VERSION_OFFSET = 263; - exports2.decodeLongPath = function decodeLongPath(buf, encoding) { - return decodeStr(buf, 0, buf.length, encoding); - }; - exports2.encodePax = function encodePax(opts) { - let result = ""; - if (opts.name) result += addLength(" path=" + opts.name + "\n"); - if (opts.linkname) result += addLength(" linkpath=" + opts.linkname + "\n"); - const pax = opts.pax; - if (pax) { - for (const key in pax) { - result += addLength(" " + key + "=" + pax[key] + "\n"); - } - } - return b4a.from(result); - }; - exports2.decodePax = function decodePax(buf) { - const result = {}; - while (buf.length) { - let i = 0; - while (i < buf.length && buf[i] !== 32) i++; - const len = parseInt(b4a.toString(buf.subarray(0, i)), 10); - if (!len) return result; - const b = b4a.toString(buf.subarray(i + 1, len - 1)); - const keyIndex = b.indexOf("="); - if (keyIndex === -1) return result; - result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1); - buf = buf.subarray(len); - } - return result; - }; - exports2.encode = function encode(opts) { - const buf = b4a.alloc(512); - let name = opts.name; - let prefix = ""; - if (opts.typeflag === 5 && name[name.length - 1] !== "/") name += "/"; - if (b4a.byteLength(name) !== name.length) return null; - while (b4a.byteLength(name) > 100) { - const i = name.indexOf("/"); - if (i === -1) return null; - prefix += prefix ? "/" + name.slice(0, i) : name.slice(0, i); - name = name.slice(i + 1); - } - if (b4a.byteLength(name) > 100 || b4a.byteLength(prefix) > 155) return null; - if (opts.linkname && b4a.byteLength(opts.linkname) > 100) return null; - b4a.write(buf, name); - b4a.write(buf, encodeOct(opts.mode & MASK, 6), 100); - b4a.write(buf, encodeOct(opts.uid, 6), 108); - b4a.write(buf, encodeOct(opts.gid, 6), 116); - encodeSize(opts.size, buf, 124); - b4a.write(buf, encodeOct(opts.mtime.getTime() / 1e3 | 0, 11), 136); - buf[156] = ZERO_OFFSET + toTypeflag(opts.type); - if (opts.linkname) b4a.write(buf, opts.linkname, 157); - b4a.copy(USTAR_MAGIC, buf, MAGIC_OFFSET); - b4a.copy(USTAR_VER, buf, VERSION_OFFSET); - if (opts.uname) b4a.write(buf, opts.uname, 265); - if (opts.gname) b4a.write(buf, opts.gname, 297); - b4a.write(buf, encodeOct(opts.devmajor || 0, 6), 329); - b4a.write(buf, encodeOct(opts.devminor || 0, 6), 337); - if (prefix) b4a.write(buf, prefix, 345); - b4a.write(buf, encodeOct(cksum(buf), 6), 148); - return buf; - }; - exports2.decode = function decode(buf, filenameEncoding, allowUnknownFormat) { - let typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET; - let name = decodeStr(buf, 0, 100, filenameEncoding); - const mode = decodeOct(buf, 100, 8); - const uid = decodeOct(buf, 108, 8); - const gid = decodeOct(buf, 116, 8); - const size = decodeOct(buf, 124, 12); - const mtime = decodeOct(buf, 136, 12); - const type = toType(typeflag); - const linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding); - const uname = decodeStr(buf, 265, 32); - const gname = decodeStr(buf, 297, 32); - const devmajor = decodeOct(buf, 329, 8); - const devminor = decodeOct(buf, 337, 8); - const c = cksum(buf); - if (c === 8 * 32) return null; - if (c !== decodeOct(buf, 148, 8)) throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?"); - if (isUSTAR(buf)) { - if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name; - } else if (isGNU(buf)) { - } else { - if (!allowUnknownFormat) { - throw new Error("Invalid tar header: unknown format."); - } - } - if (typeflag === 0 && name && name[name.length - 1] === "/") typeflag = 5; - return { - name, - mode, - uid, - gid, - size, - mtime: new Date(1e3 * mtime), - type, - linkname, - uname, - gname, - devmajor, - devminor, - pax: null - }; - }; - function isUSTAR(buf) { - return b4a.equals(USTAR_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6)); - } - function isGNU(buf) { - return b4a.equals(GNU_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6)) && b4a.equals(GNU_VER, buf.subarray(VERSION_OFFSET, VERSION_OFFSET + 2)); - } - function clamp(index2, len, defaultValue) { - if (typeof index2 !== "number") return defaultValue; - index2 = ~~index2; - if (index2 >= len) return len; - if (index2 >= 0) return index2; - index2 += len; - if (index2 >= 0) return index2; - return 0; - } - function toType(flag) { - switch (flag) { - case 0: - return "file"; - case 1: - return "link"; - case 2: - return "symlink"; - case 3: - return "character-device"; - case 4: - return "block-device"; - case 5: - return "directory"; - case 6: - return "fifo"; - case 7: - return "contiguous-file"; - case 72: - return "pax-header"; - case 55: - return "pax-global-header"; - case 27: - return "gnu-long-link-path"; - case 28: - case 30: - return "gnu-long-path"; - } - return null; - } - function toTypeflag(flag) { - switch (flag) { - case "file": - return 0; - case "link": - return 1; - case "symlink": - return 2; - case "character-device": - return 3; - case "block-device": - return 4; - case "directory": - return 5; - case "fifo": - return 6; - case "contiguous-file": - return 7; - case "pax-header": - return 72; - } - return 0; - } - function indexOf(block, num, offset, end) { - for (; offset < end; offset++) { - if (block[offset] === num) return offset; - } - return end; - } - function cksum(block) { - let sum = 8 * 32; - for (let i = 0; i < 148; i++) sum += block[i]; - for (let j = 156; j < 512; j++) sum += block[j]; - return sum; - } - function encodeOct(val, n) { - val = val.toString(8); - if (val.length > n) return SEVENS.slice(0, n) + " "; - return ZEROS.slice(0, n - val.length) + val + " "; - } - function encodeSizeBin(num, buf, off) { - buf[off] = 128; - for (let i = 11; i > 0; i--) { - buf[off + i] = num & 255; - num = Math.floor(num / 256); - } - } - function encodeSize(num, buf, off) { - if (num.toString(8).length > 11) { - encodeSizeBin(num, buf, off); - } else { - b4a.write(buf, encodeOct(num, 11), off); - } - } - function parse256(buf) { - let positive; - if (buf[0] === 128) positive = true; - else if (buf[0] === 255) positive = false; - else return null; - const tuple = []; - let i; - for (i = buf.length - 1; i > 0; i--) { - const byte = buf[i]; - if (positive) tuple.push(byte); - else tuple.push(255 - byte); - } - let sum = 0; - const l = tuple.length; - for (i = 0; i < l; i++) { - sum += tuple[i] * Math.pow(256, i); - } - return positive ? sum : -1 * sum; - } - function decodeOct(val, offset, length) { - val = val.subarray(offset, offset + length); - offset = 0; - if (val[offset] & 128) { - return parse256(val); - } else { - while (offset < val.length && val[offset] === 32) offset++; - const end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length); - while (offset < end && val[offset] === 0) offset++; - if (end === offset) return 0; - return parseInt(b4a.toString(val.subarray(offset, end)), 8); - } - } - function decodeStr(val, offset, length, encoding) { - return b4a.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding); - } - function addLength(str) { - const len = b4a.byteLength(str); - let digits = Math.floor(Math.log(len) / Math.log(10)) + 1; - if (len + digits >= Math.pow(10, digits)) digits++; - return len + digits + str; - } - } -}); - -// node_modules/tar-stream/extract.js -var require_extract = __commonJS({ - "node_modules/tar-stream/extract.js"(exports2, module2) { - var { Writable, Readable: Readable3, getStreamError } = require_streamx(); - var FIFO = require_fast_fifo(); - var b4a = require_b4a(); - var headers = require_headers2(); - var EMPTY2 = b4a.alloc(0); - var BufferList = class { - constructor() { - this.buffered = 0; - this.shifted = 0; - this.queue = new FIFO(); - this._offset = 0; - } - push(buffer) { - this.buffered += buffer.byteLength; - this.queue.push(buffer); - } - shiftFirst(size) { - return this._buffered === 0 ? null : this._next(size); - } - shift(size) { - if (size > this.buffered) return null; - if (size === 0) return EMPTY2; - let chunk = this._next(size); - if (size === chunk.byteLength) return chunk; - const chunks = [chunk]; - while ((size -= chunk.byteLength) > 0) { - chunk = this._next(size); - chunks.push(chunk); - } - return b4a.concat(chunks); - } - _next(size) { - const buf = this.queue.peek(); - const rem = buf.byteLength - this._offset; - if (size >= rem) { - const sub = this._offset ? buf.subarray(this._offset, buf.byteLength) : buf; - this.queue.shift(); - this._offset = 0; - this.buffered -= rem; - this.shifted += rem; - return sub; - } - this.buffered -= size; - this.shifted += size; - return buf.subarray(this._offset, this._offset += size); - } - }; - var Source = class extends Readable3 { - constructor(self2, header, offset) { - super(); - this.header = header; - this.offset = offset; - this._parent = self2; - } - _read(cb) { - if (this.header.size === 0) { - this.push(null); - } - if (this._parent._stream === this) { - this._parent._update(); - } - cb(null); - } - _predestroy() { - this._parent.destroy(getStreamError(this)); - } - _detach() { - if (this._parent._stream === this) { - this._parent._stream = null; - this._parent._missing = overflow(this.header.size); - this._parent._update(); - } - } - _destroy(cb) { - this._detach(); - cb(null); - } - }; - var Extract = class extends Writable { - constructor(opts) { - super(opts); - if (!opts) opts = {}; - this._buffer = new BufferList(); - this._offset = 0; - this._header = null; - this._stream = null; - this._missing = 0; - this._longHeader = false; - this._callback = noop3; - this._locked = false; - this._finished = false; - this._pax = null; - this._paxGlobal = null; - this._gnuLongPath = null; - this._gnuLongLinkPath = null; - this._filenameEncoding = opts.filenameEncoding || "utf-8"; - this._allowUnknownFormat = !!opts.allowUnknownFormat; - this._unlockBound = this._unlock.bind(this); - } - _unlock(err) { - this._locked = false; - if (err) { - this.destroy(err); - this._continueWrite(err); - return; - } - this._update(); - } - _consumeHeader() { - if (this._locked) return false; - this._offset = this._buffer.shifted; - try { - this._header = headers.decode(this._buffer.shift(512), this._filenameEncoding, this._allowUnknownFormat); - } catch (err) { - this._continueWrite(err); - return false; - } - if (!this._header) return true; - switch (this._header.type) { - case "gnu-long-path": - case "gnu-long-link-path": - case "pax-global-header": - case "pax-header": - this._longHeader = true; - this._missing = this._header.size; - return true; - } - this._locked = true; - this._applyLongHeaders(); - if (this._header.size === 0 || this._header.type === "directory") { - this.emit("entry", this._header, this._createStream(), this._unlockBound); - return true; - } - this._stream = this._createStream(); - this._missing = this._header.size; - this.emit("entry", this._header, this._stream, this._unlockBound); - return true; - } - _applyLongHeaders() { - if (this._gnuLongPath) { - this._header.name = this._gnuLongPath; - this._gnuLongPath = null; - } - if (this._gnuLongLinkPath) { - this._header.linkname = this._gnuLongLinkPath; - this._gnuLongLinkPath = null; - } - if (this._pax) { - if (this._pax.path) this._header.name = this._pax.path; - if (this._pax.linkpath) this._header.linkname = this._pax.linkpath; - if (this._pax.size) this._header.size = parseInt(this._pax.size, 10); - this._header.pax = this._pax; - this._pax = null; - } - } - _decodeLongHeader(buf) { - switch (this._header.type) { - case "gnu-long-path": - this._gnuLongPath = headers.decodeLongPath(buf, this._filenameEncoding); - break; - case "gnu-long-link-path": - this._gnuLongLinkPath = headers.decodeLongPath(buf, this._filenameEncoding); - break; - case "pax-global-header": - this._paxGlobal = headers.decodePax(buf); - break; - case "pax-header": - this._pax = this._paxGlobal === null ? headers.decodePax(buf) : Object.assign({}, this._paxGlobal, headers.decodePax(buf)); - break; - } - } - _consumeLongHeader() { - this._longHeader = false; - this._missing = overflow(this._header.size); - const buf = this._buffer.shift(this._header.size); - try { - this._decodeLongHeader(buf); - } catch (err) { - this._continueWrite(err); - return false; - } - return true; - } - _consumeStream() { - const buf = this._buffer.shiftFirst(this._missing); - if (buf === null) return false; - this._missing -= buf.byteLength; - const drained = this._stream.push(buf); - if (this._missing === 0) { - this._stream.push(null); - if (drained) this._stream._detach(); - return drained && this._locked === false; - } - return drained; - } - _createStream() { - return new Source(this, this._header, this._offset); - } - _update() { - while (this._buffer.buffered > 0 && !this.destroying) { - if (this._missing > 0) { - if (this._stream !== null) { - if (this._consumeStream() === false) return; - continue; - } - if (this._longHeader === true) { - if (this._missing > this._buffer.buffered) break; - if (this._consumeLongHeader() === false) return false; - continue; - } - const ignore = this._buffer.shiftFirst(this._missing); - if (ignore !== null) this._missing -= ignore.byteLength; - continue; - } - if (this._buffer.buffered < 512) break; - if (this._stream !== null || this._consumeHeader() === false) return; - } - this._continueWrite(null); - } - _continueWrite(err) { - const cb = this._callback; - this._callback = noop3; - cb(err); - } - _write(data, cb) { - this._callback = cb; - this._buffer.push(data); - this._update(); - } - _final(cb) { - this._finished = this._missing === 0 && this._buffer.buffered === 0; - cb(this._finished ? null : new Error("Unexpected end of data")); - } - _predestroy() { - this._continueWrite(null); - } - _destroy(cb) { - if (this._stream) this._stream.destroy(getStreamError(this)); - cb(null); - } - [Symbol.asyncIterator]() { - let error3 = null; - let promiseResolve = null; - let promiseReject = null; - let entryStream = null; - let entryCallback = null; - const extract2 = this; - this.on("entry", onentry); - this.on("error", (err) => { - error3 = err; - }); - this.on("close", onclose); - return { - [Symbol.asyncIterator]() { - return this; - }, - next() { - return new Promise(onnext); - }, - return() { - return destroy(null); - }, - throw(err) { - return destroy(err); - } - }; - function consumeCallback(err) { - if (!entryCallback) return; - const cb = entryCallback; - entryCallback = null; - cb(err); - } - function onnext(resolve14, reject) { - if (error3) { - return reject(error3); - } - if (entryStream) { - resolve14({ value: entryStream, done: false }); - entryStream = null; - return; - } - promiseResolve = resolve14; - promiseReject = reject; - consumeCallback(null); - if (extract2._finished && promiseResolve) { - promiseResolve({ value: void 0, done: true }); - promiseResolve = promiseReject = null; - } - } - function onentry(header, stream2, callback) { - entryCallback = callback; - stream2.on("error", noop3); - if (promiseResolve) { - promiseResolve({ value: stream2, done: false }); - promiseResolve = promiseReject = null; - } else { - entryStream = stream2; - } - } - function onclose() { - consumeCallback(error3); - if (!promiseResolve) return; - if (error3) promiseReject(error3); - else promiseResolve({ value: void 0, done: true }); - promiseResolve = promiseReject = null; - } - function destroy(err) { - extract2.destroy(err); - consumeCallback(err); - return new Promise((resolve14, reject) => { - if (extract2.destroyed) return resolve14({ value: void 0, done: true }); - extract2.once("close", function() { - if (err) reject(err); - else resolve14({ value: void 0, done: true }); - }); - }); - } - } - }; - module2.exports = function extract2(opts) { - return new Extract(opts); - }; - function noop3() { - } - function overflow(size) { - size &= 511; - return size && 512 - size; - } - } -}); - -// node_modules/tar-stream/constants.js -var require_constants14 = __commonJS({ - "node_modules/tar-stream/constants.js"(exports2, module2) { - var constants = { - // just for envs without fs - S_IFMT: 61440, - S_IFDIR: 16384, - S_IFCHR: 8192, - S_IFBLK: 24576, - S_IFIFO: 4096, - S_IFLNK: 40960 - }; - try { - module2.exports = require("fs").constants || constants; - } catch { - module2.exports = constants; - } - } -}); - -// node_modules/tar-stream/pack.js -var require_pack = __commonJS({ - "node_modules/tar-stream/pack.js"(exports2, module2) { - var { Readable: Readable3, Writable, getStreamError } = require_streamx(); - var b4a = require_b4a(); - var constants = require_constants14(); - var headers = require_headers2(); - var DMODE = 493; - var FMODE = 420; - var END_OF_TAR = b4a.alloc(1024); - var Sink = class extends Writable { - constructor(pack, header, callback) { - super({ mapWritable, eagerOpen: true }); - this.written = 0; - this.header = header; - this._callback = callback; - this._linkname = null; - this._isLinkname = header.type === "symlink" && !header.linkname; - this._isVoid = header.type !== "file" && header.type !== "contiguous-file"; - this._finished = false; - this._pack = pack; - this._openCallback = null; - if (this._pack._stream === null) this._pack._stream = this; - else this._pack._pending.push(this); - } - _open(cb) { - this._openCallback = cb; - if (this._pack._stream === this) this._continueOpen(); - } - _continuePack(err) { - if (this._callback === null) return; - const callback = this._callback; - this._callback = null; - callback(err); - } - _continueOpen() { - if (this._pack._stream === null) this._pack._stream = this; - const cb = this._openCallback; - this._openCallback = null; - if (cb === null) return; - if (this._pack.destroying) return cb(new Error("pack stream destroyed")); - if (this._pack._finalized) return cb(new Error("pack stream is already finalized")); - this._pack._stream = this; - if (!this._isLinkname) { - this._pack._encode(this.header); - } - if (this._isVoid) { - this._finish(); - this._continuePack(null); - } - cb(null); - } - _write(data, cb) { - if (this._isLinkname) { - this._linkname = this._linkname ? b4a.concat([this._linkname, data]) : data; - return cb(null); - } - if (this._isVoid) { - if (data.byteLength > 0) { - return cb(new Error("No body allowed for this entry")); - } - return cb(); - } - this.written += data.byteLength; - if (this._pack.push(data)) return cb(); - this._pack._drain = cb; - } - _finish() { - if (this._finished) return; - this._finished = true; - if (this._isLinkname) { - this.header.linkname = this._linkname ? b4a.toString(this._linkname, "utf-8") : ""; - this._pack._encode(this.header); - } - overflow(this._pack, this.header.size); - this._pack._done(this); - } - _final(cb) { - if (this.written !== this.header.size) { - return cb(new Error("Size mismatch")); - } - this._finish(); - cb(null); - } - _getError() { - return getStreamError(this) || new Error("tar entry destroyed"); - } - _predestroy() { - this._pack.destroy(this._getError()); - } - _destroy(cb) { - this._pack._done(this); - this._continuePack(this._finished ? null : this._getError()); - cb(); - } - }; - var Pack = class extends Readable3 { - constructor(opts) { - super(opts); - this._drain = noop3; - this._finalized = false; - this._finalizing = false; - this._pending = []; - this._stream = null; - } - entry(header, buffer, callback) { - if (this._finalized || this.destroying) throw new Error("already finalized or destroyed"); - if (typeof buffer === "function") { - callback = buffer; - buffer = null; - } - if (!callback) callback = noop3; - if (!header.size || header.type === "symlink") header.size = 0; - if (!header.type) header.type = modeToType(header.mode); - if (!header.mode) header.mode = header.type === "directory" ? DMODE : FMODE; - if (!header.uid) header.uid = 0; - if (!header.gid) header.gid = 0; - if (!header.mtime) header.mtime = /* @__PURE__ */ new Date(); - if (typeof buffer === "string") buffer = b4a.from(buffer); - const sink = new Sink(this, header, callback); - if (b4a.isBuffer(buffer)) { - header.size = buffer.byteLength; - sink.write(buffer); - sink.end(); - return sink; - } - if (sink._isVoid) { - return sink; - } - return sink; - } - finalize() { - if (this._stream || this._pending.length > 0) { - this._finalizing = true; - return; - } - if (this._finalized) return; - this._finalized = true; - this.push(END_OF_TAR); - this.push(null); - } - _done(stream2) { - if (stream2 !== this._stream) return; - this._stream = null; - if (this._finalizing) this.finalize(); - if (this._pending.length) this._pending.shift()._continueOpen(); - } - _encode(header) { - if (!header.pax) { - const buf = headers.encode(header); - if (buf) { - this.push(buf); - return; - } - } - this._encodePax(header); - } - _encodePax(header) { - const paxHeader = headers.encodePax({ - name: header.name, - linkname: header.linkname, - pax: header.pax - }); - const newHeader = { - name: "PaxHeader", - mode: header.mode, - uid: header.uid, - gid: header.gid, - size: paxHeader.byteLength, - mtime: header.mtime, - type: "pax-header", - linkname: header.linkname && "PaxHeader", - uname: header.uname, - gname: header.gname, - devmajor: header.devmajor, - devminor: header.devminor - }; - this.push(headers.encode(newHeader)); - this.push(paxHeader); - overflow(this, paxHeader.byteLength); - newHeader.size = header.size; - newHeader.type = header.type; - this.push(headers.encode(newHeader)); - } - _doDrain() { - const drain = this._drain; - this._drain = noop3; - drain(); - } - _predestroy() { - const err = getStreamError(this); - if (this._stream) this._stream.destroy(err); - while (this._pending.length) { - const stream2 = this._pending.shift(); - stream2.destroy(err); - stream2._continueOpen(); - } - this._doDrain(); - } - _read(cb) { - this._doDrain(); - cb(); - } - }; - module2.exports = function pack(opts) { - return new Pack(opts); - }; - function modeToType(mode) { - switch (mode & constants.S_IFMT) { - case constants.S_IFBLK: - return "block-device"; - case constants.S_IFCHR: - return "character-device"; - case constants.S_IFDIR: - return "directory"; - case constants.S_IFIFO: - return "fifo"; - case constants.S_IFLNK: - return "symlink"; - } - return "file"; - } - function noop3() { - } - function overflow(self2, size) { - size &= 511; - if (size) self2.push(END_OF_TAR.subarray(0, 512 - size)); - } - function mapWritable(buf) { - return b4a.isBuffer(buf) ? buf : b4a.from(buf); - } - } -}); - -// node_modules/tar-stream/index.js -var require_tar_stream = __commonJS({ - "node_modules/tar-stream/index.js"(exports2) { - exports2.extract = require_extract(); - exports2.pack = require_pack(); - } -}); - -// node_modules/@actions/artifact/node_modules/archiver/lib/plugins/tar.js -var require_tar2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/archiver/lib/plugins/tar.js"(exports2, module2) { - var zlib3 = require("zlib"); - var engine2 = require_tar_stream(); - var util3 = require_archiver_utils(); - var Tar2 = function(options) { - if (!(this instanceof Tar2)) { - return new Tar2(options); - } - options = this.options = util3.defaults(options, { - gzip: false - }); - if (typeof options.gzipOptions !== "object") { - options.gzipOptions = {}; - } - this.supports = { - directory: true, - symlink: true - }; - this.engine = engine2.pack(options); - this.compressor = false; - if (options.gzip) { - this.compressor = zlib3.createGzip(options.gzipOptions); - this.compressor.on("error", this._onCompressorError.bind(this)); - } - }; - Tar2.prototype._onCompressorError = function(err) { - this.engine.emit("error", err); - }; - Tar2.prototype.append = function(source, data, callback) { - var self2 = this; - data.mtime = data.date; - function append(err, sourceBuffer) { - if (err) { - callback(err); - return; - } - self2.engine.entry(data, sourceBuffer, function(err2) { - callback(err2, data); - }); - } - if (data.sourceType === "buffer") { - append(null, source); - } else if (data.sourceType === "stream" && data.stats) { - data.size = data.stats.size; - var entry = self2.engine.entry(data, function(err) { - callback(err, data); - }); - source.pipe(entry); - } else if (data.sourceType === "stream") { - util3.collectStream(source, append); - } - }; - Tar2.prototype.finalize = function() { - this.engine.finalize(); - }; - Tar2.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); - }; - Tar2.prototype.pipe = function(destination, options) { - if (this.compressor) { - return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options); - } else { - return this.engine.pipe.apply(this.engine, arguments); - } - }; - Tar2.prototype.unpipe = function() { - if (this.compressor) { - return this.compressor.unpipe.apply(this.compressor, arguments); - } else { - return this.engine.unpipe.apply(this.engine, arguments); - } - }; - module2.exports = Tar2; - } -}); - -// node_modules/buffer-crc32/dist/index.cjs -var require_dist6 = __commonJS({ - "node_modules/buffer-crc32/dist/index.cjs"(exports2, module2) { - "use strict"; - function getDefaultExportFromCjs(x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; - } - var CRC_TABLE2 = new Int32Array([ - 0, - 1996959894, - 3993919788, - 2567524794, - 124634137, - 1886057615, - 3915621685, - 2657392035, - 249268274, - 2044508324, - 3772115230, - 2547177864, - 162941995, - 2125561021, - 3887607047, - 2428444049, - 498536548, - 1789927666, - 4089016648, - 2227061214, - 450548861, - 1843258603, - 4107580753, - 2211677639, - 325883990, - 1684777152, - 4251122042, - 2321926636, - 335633487, - 1661365465, - 4195302755, - 2366115317, - 997073096, - 1281953886, - 3579855332, - 2724688242, - 1006888145, - 1258607687, - 3524101629, - 2768942443, - 901097722, - 1119000684, - 3686517206, - 2898065728, - 853044451, - 1172266101, - 3705015759, - 2882616665, - 651767980, - 1373503546, - 3369554304, - 3218104598, - 565507253, - 1454621731, - 3485111705, - 3099436303, - 671266974, - 1594198024, - 3322730930, - 2970347812, - 795835527, - 1483230225, - 3244367275, - 3060149565, - 1994146192, - 31158534, - 2563907772, - 4023717930, - 1907459465, - 112637215, - 2680153253, - 3904427059, - 2013776290, - 251722036, - 2517215374, - 3775830040, - 2137656763, - 141376813, - 2439277719, - 3865271297, - 1802195444, - 476864866, - 2238001368, - 4066508878, - 1812370925, - 453092731, - 2181625025, - 4111451223, - 1706088902, - 314042704, - 2344532202, - 4240017532, - 1658658271, - 366619977, - 2362670323, - 4224994405, - 1303535960, - 984961486, - 2747007092, - 3569037538, - 1256170817, - 1037604311, - 2765210733, - 3554079995, - 1131014506, - 879679996, - 2909243462, - 3663771856, - 1141124467, - 855842277, - 2852801631, - 3708648649, - 1342533948, - 654459306, - 3188396048, - 3373015174, - 1466479909, - 544179635, - 3110523913, - 3462522015, - 1591671054, - 702138776, - 2966460450, - 3352799412, - 1504918807, - 783551873, - 3082640443, - 3233442989, - 3988292384, - 2596254646, - 62317068, - 1957810842, - 3939845945, - 2647816111, - 81470997, - 1943803523, - 3814918930, - 2489596804, - 225274430, - 2053790376, - 3826175755, - 2466906013, - 167816743, - 2097651377, - 4027552580, - 2265490386, - 503444072, - 1762050814, - 4150417245, - 2154129355, - 426522225, - 1852507879, - 4275313526, - 2312317920, - 282753626, - 1742555852, - 4189708143, - 2394877945, - 397917763, - 1622183637, - 3604390888, - 2714866558, - 953729732, - 1340076626, - 3518719985, - 2797360999, - 1068828381, - 1219638859, - 3624741850, - 2936675148, - 906185462, - 1090812512, - 3747672003, - 2825379669, - 829329135, - 1181335161, - 3412177804, - 3160834842, - 628085408, - 1382605366, - 3423369109, - 3138078467, - 570562233, - 1426400815, - 3317316542, - 2998733608, - 733239954, - 1555261956, - 3268935591, - 3050360625, - 752459403, - 1541320221, - 2607071920, - 3965973030, - 1969922972, - 40735498, - 2617837225, - 3943577151, - 1913087877, - 83908371, - 2512341634, - 3803740692, - 2075208622, - 213261112, - 2463272603, - 3855990285, - 2094854071, - 198958881, - 2262029012, - 4057260610, - 1759359992, - 534414190, - 2176718541, - 4139329115, - 1873836001, - 414664567, - 2282248934, - 4279200368, - 1711684554, - 285281116, - 2405801727, - 4167216745, - 1634467795, - 376229701, - 2685067896, - 3608007406, - 1308918612, - 956543938, - 2808555105, - 3495958263, - 1231636301, - 1047427035, - 2932959818, - 3654703836, - 1088359270, - 936918e3, - 2847714899, - 3736837829, - 1202900863, - 817233897, - 3183342108, - 3401237130, - 1404277552, - 615818150, - 3134207493, - 3453421203, - 1423857449, - 601450431, - 3009837614, - 3294710456, - 1567103746, - 711928724, - 3020668471, - 3272380065, - 1510334235, - 755167117 - ]); - function ensureBuffer2(input) { - if (Buffer.isBuffer(input)) { - return input; - } - if (typeof input === "number") { - return Buffer.alloc(input); - } else if (typeof input === "string") { - return Buffer.from(input); - } else { - throw new Error("input must be buffer, number, or string, received " + typeof input); - } - } - function bufferizeInt2(num) { - const tmp = ensureBuffer2(4); - tmp.writeInt32BE(num, 0); - return tmp; - } - function _crc322(buf, previous) { - buf = ensureBuffer2(buf); - if (Buffer.isBuffer(previous)) { - previous = previous.readUInt32BE(0); - } - let crc = ~~previous ^ -1; - for (var n = 0; n < buf.length; n++) { - crc = CRC_TABLE2[(crc ^ buf[n]) & 255] ^ crc >>> 8; - } - return crc ^ -1; - } - function crc325() { - return bufferizeInt2(_crc322.apply(null, arguments)); - } - crc325.signed = function() { - return _crc322.apply(null, arguments); - }; - crc325.unsigned = function() { - return _crc322.apply(null, arguments) >>> 0; - }; - var bufferCrc32 = crc325; - var index2 = /* @__PURE__ */ getDefaultExportFromCjs(bufferCrc32); - module2.exports = index2; - } -}); - -// node_modules/@actions/artifact/node_modules/archiver/lib/plugins/json.js -var require_json = __commonJS({ - "node_modules/@actions/artifact/node_modules/archiver/lib/plugins/json.js"(exports2, module2) { - var inherits = require("util").inherits; - var Transform5 = require_ours().Transform; - var crc325 = require_dist6(); - var util3 = require_archiver_utils(); - var Json2 = function(options) { - if (!(this instanceof Json2)) { - return new Json2(options); - } - options = this.options = util3.defaults(options, {}); - Transform5.call(this, options); - this.supports = { - directory: true, - symlink: true - }; - this.files = []; - }; - inherits(Json2, Transform5); - Json2.prototype._transform = function(chunk, encoding, callback) { - callback(null, chunk); - }; - Json2.prototype._writeStringified = function() { - var fileString = JSON.stringify(this.files); - this.write(fileString); - }; - Json2.prototype.append = function(source, data, callback) { - var self2 = this; - data.crc32 = 0; - function onend(err, sourceBuffer) { - if (err) { - callback(err); - return; - } - data.size = sourceBuffer.length || 0; - data.crc32 = crc325.unsigned(sourceBuffer); - self2.files.push(data); - callback(null, data); - } - if (data.sourceType === "buffer") { - onend(null, source); - } else if (data.sourceType === "stream") { - util3.collectStream(source, onend); - } - }; - Json2.prototype.finalize = function() { - this._writeStringified(); - this.end(); - }; - module2.exports = Json2; - } -}); - -// node_modules/@actions/artifact/node_modules/archiver/index.js -var require_archiver = __commonJS({ - "node_modules/@actions/artifact/node_modules/archiver/index.js"(exports2, module2) { - var Archiver2 = require_core2(); - var formats = {}; - var vending = function(format, options) { - return vending.create(format, options); - }; - vending.create = function(format, options) { - if (formats[format]) { - var instance = new Archiver2(format, options); - instance.setFormat(format); - instance.setModule(new formats[format](options)); - return instance; - } else { - throw new Error("create(" + format + "): format not registered"); - } - }; - vending.registerFormat = function(format, module3) { - if (formats[format]) { - throw new Error("register(" + format + "): format already registered"); - } - if (typeof module3 !== "function") { - throw new Error("register(" + format + "): format module invalid"); - } - if (typeof module3.prototype.append !== "function" || typeof module3.prototype.finalize !== "function") { - throw new Error("register(" + format + "): format module missing methods"); - } - formats[format] = module3; - }; - vending.isRegisteredFormat = function(format) { - if (formats[format]) { - return true; - } - return false; - }; - vending.registerFormat("zip", require_zip()); - vending.registerFormat("tar", require_tar2()); - vending.registerFormat("json", require_json()); - module2.exports = vending; - } -}); - -// node_modules/@actions/artifact/lib/internal/upload/zip.js -var require_zip2 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/upload/zip.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createZipUploadStream = exports2.ZipUploadStream = exports2.DEFAULT_COMPRESSION_LEVEL = void 0; - var stream2 = __importStar2(require("stream")); - var promises_1 = require("fs/promises"); - var archiver = __importStar2(require_archiver()); - var core31 = __importStar2(require_core()); - var config_1 = require_config2(); - exports2.DEFAULT_COMPRESSION_LEVEL = 6; - var ZipUploadStream = class extends stream2.Transform { - constructor(bufferSize) { - super({ - highWaterMark: bufferSize - }); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - _transform(chunk, enc, cb) { - cb(null, chunk); - } - }; - exports2.ZipUploadStream = ZipUploadStream; - function createZipUploadStream(uploadSpecification_1) { - return __awaiter2(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { - core31.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); - const zip = archiver.create("zip", { - highWaterMark: (0, config_1.getUploadChunkSize)(), - zlib: { level: compressionLevel } - }); - zip.on("error", zipErrorCallback); - zip.on("warning", zipWarningCallback); - zip.on("finish", zipFinishCallback); - zip.on("end", zipEndCallback); - for (const file of uploadSpecification) { - if (file.sourcePath !== null) { - let sourcePath = file.sourcePath; - if (file.stats.isSymbolicLink()) { - sourcePath = yield (0, promises_1.realpath)(file.sourcePath); - } - zip.file(sourcePath, { - name: file.destinationPath - }); - } else { - zip.append("", { name: file.destinationPath }); - } - } - const bufferSize = (0, config_1.getUploadChunkSize)(); - const zipUploadStream = new ZipUploadStream(bufferSize); - core31.debug(`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`); - core31.debug(`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`); - zip.pipe(zipUploadStream); - zip.finalize(); - return zipUploadStream; - }); - } - exports2.createZipUploadStream = createZipUploadStream; - var zipErrorCallback = (error3) => { - core31.error("An error has occurred while creating the zip file for upload"); - core31.info(error3); - throw new Error("An error has occurred during zip creation for the artifact"); - }; - var zipWarningCallback = (error3) => { - if (error3.code === "ENOENT") { - core31.warning("ENOENT warning during artifact zip creation. No such file or directory"); - core31.info(error3); - } else { - core31.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); - core31.info(error3); - } - }; - var zipFinishCallback = () => { - core31.debug("Zip stream for upload has finished."); - }; - var zipEndCallback = () => { - core31.debug("Zip stream for upload has ended."); - }; - } -}); - -// node_modules/@actions/artifact/lib/internal/upload/upload-artifact.js -var require_upload_artifact = __commonJS({ - "node_modules/@actions/artifact/lib/internal/upload/upload-artifact.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadArtifact = void 0; - var core31 = __importStar2(require_core()); - var retention_1 = require_retention(); - var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var upload_zip_specification_1 = require_upload_zip_specification(); - var util_1 = require_util11(); - var blob_upload_1 = require_blob_upload(); - var zip_1 = require_zip2(); - var generated_1 = require_generated(); - var errors_1 = require_errors3(); - function uploadArtifact(name, files, rootDirectory, options) { - return __awaiter2(this, void 0, void 0, function* () { - (0, path_and_artifact_name_validation_1.validateArtifactName)(name); - (0, upload_zip_specification_1.validateRootDirectory)(rootDirectory); - const zipSpecification = (0, upload_zip_specification_1.getUploadZipSpecification)(files, rootDirectory); - if (zipSpecification.length === 0) { - throw new errors_1.FilesNotFoundError(zipSpecification.flatMap((s) => s.sourcePath ? [s.sourcePath] : [])); - } - const backendIds = (0, util_1.getBackendIdsFromToken)(); - const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); - const createArtifactReq = { - workflowRunBackendId: backendIds.workflowRunBackendId, - workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - name, - version: 4 - }; - const expiresAt = (0, retention_1.getExpiration)(options === null || options === void 0 ? void 0 : options.retentionDays); - if (expiresAt) { - createArtifactReq.expiresAt = expiresAt; - } - const createArtifactResp = yield artifactClient.CreateArtifact(createArtifactReq); - if (!createArtifactResp.ok) { - throw new errors_1.InvalidResponseError("CreateArtifact: response from backend was not ok"); - } - const zipUploadStream = yield (0, zip_1.createZipUploadStream)(zipSpecification, options === null || options === void 0 ? void 0 : options.compressionLevel); - const uploadResult = yield (0, blob_upload_1.uploadZipToBlobStorage)(createArtifactResp.signedUploadUrl, zipUploadStream); - const finalizeArtifactReq = { - workflowRunBackendId: backendIds.workflowRunBackendId, - workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - name, - size: uploadResult.uploadSize ? uploadResult.uploadSize.toString() : "0" - }; - if (uploadResult.sha256Hash) { - finalizeArtifactReq.hash = generated_1.StringValue.create({ - value: `sha256:${uploadResult.sha256Hash}` - }); - } - core31.info(`Finalizing artifact upload`); - const finalizeArtifactResp = yield artifactClient.FinalizeArtifact(finalizeArtifactReq); - if (!finalizeArtifactResp.ok) { - throw new errors_1.InvalidResponseError("FinalizeArtifact: response from backend was not ok"); - } - const artifactId = BigInt(finalizeArtifactResp.artifactId); - core31.info(`Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}`); - return { - size: uploadResult.uploadSize, - digest: uploadResult.sha256Hash, - id: Number(artifactId) - }; - }); - } - exports2.uploadArtifact = uploadArtifact; - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/github/lib/context.js -var require_context2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/github/lib/context.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Context = void 0; - var fs_1 = require("fs"); - var os_1 = require("os"); - var Context = class { - /** - * Hydrate the context from the environment - */ - constructor() { - var _a2, _b, _c; - this.payload = {}; - if (process.env.GITHUB_EVENT_PATH) { - if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { - this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); - } else { - const path30 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path30} does not exist${os_1.EOL}`); - } - } - this.eventName = process.env.GITHUB_EVENT_NAME; - this.sha = process.env.GITHUB_SHA; - this.ref = process.env.GITHUB_REF; - this.workflow = process.env.GITHUB_WORKFLOW; - this.action = process.env.GITHUB_ACTION; - this.actor = process.env.GITHUB_ACTOR; - this.job = process.env.GITHUB_JOB; - this.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10); - this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); - this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); - this.apiUrl = (_a2 = process.env.GITHUB_API_URL) !== null && _a2 !== void 0 ? _a2 : `https://api.github.com`; - this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; - this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; - } - get issue() { - const payload = this.payload; - return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); - } - get repo() { - if (process.env.GITHUB_REPOSITORY) { - const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); - return { owner, repo }; - } - if (this.payload.repository) { - return { - owner: this.payload.repository.owner.login, - repo: this.payload.repository.name - }; - } - throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); - } - }; - exports2.Context = Context; - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/github/node_modules/@actions/http-client/lib/proxy.js -var require_proxy2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/github/node_modules/@actions/http-client/lib/proxy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; - function getProxyUrl(reqUrl) { - const usingSsl = reqUrl.protocol === "https:"; - if (checkBypass(reqUrl)) { - return void 0; - } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; - } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a2) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); - } - } else { - return void 0; - } - } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; - } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; - } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { - if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { - return true; - } - } - return false; - } - exports2.checkBypass = checkBypass; - function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); - } - var DecodedURL = class extends URL { - constructor(url2, base) { - super(url2, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar2(require("http")); - var https3 = __importStar2(require("https")); - var pm = __importStar2(require_proxy2()); - var tunnel = __importStar2(require_tunnel2()); - var undici_1 = require_undici(); - var HttpCodes; - (function(HttpCodes2) { - HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; - HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; - HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; - HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; - HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; - HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; - HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; - HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; - HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; - HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; - HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; - })(HttpCodes || (exports2.HttpCodes = HttpCodes = {})); - var Headers; - (function(Headers2) { - Headers2["Accept"] = "accept"; - Headers2["ContentType"] = "content-type"; - })(Headers || (exports2.Headers = Headers = {})); - var MediaTypes; - (function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; - })(MediaTypes || (exports2.MediaTypes = MediaTypes = {})); - function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ""; - } - exports2.getProxyUrl = getProxyUrl; - var HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect - ]; - var HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout - ]; - var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; - var ExponentialBackoffCeiling = 10; - var ExponentialBackoffTimeSlice = 5; - var HttpClientError = class _HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = "HttpClientError"; - this.statusCode = statusCode; - Object.setPrototypeOf(this, _HttpClientError.prototype); - } - }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => __awaiter2(this, void 0, void 0, function* () { - let output = Buffer.alloc(0); - this.message.on("data", (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on("end", () => { - resolve14(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => __awaiter2(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve14(Buffer.concat(chunks)); - }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent2, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent2; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter2(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info8 = this._prepareRequest(verb, parsedUrl, headers); - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; - let numTries = 0; - let response; - do { - response = yield this.requestRaw(info8, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler2 of this.handlers) { - if (handler2.canHandleAuthentication(response)) { - authenticationHandler = handler2; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info8, data); - } else { - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { - const redirectUrl = response.message.headers["location"]; - if (!redirectUrl) { - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { - throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } - } - info8 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info8, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info8, data) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve14(res); - } - } - this.requestRawWithCallback(info8, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info8, data, onResult) { - if (typeof data === "string") { - if (!info8.options.headers) { - info8.options.headers = {}; - } - info8.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info8.httpModule.request(info8.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(void 0, res); - }); - let socket; - req.on("socket", (sock) => { - socket = sock; - }); - req.setTimeout(this._socketTimeout || 3 * 6e4, () => { - if (socket) { - socket.end(); - } - handleResult(new Error(`Request timeout: ${info8.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); - } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - getAgentDispatcher(serverUrl) { - const parsedUrl = new URL(serverUrl); - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (!useProxy) { - return; - } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info8 = {}; - info8.parsedUrl = requestUrl; - const usingSsl = info8.parsedUrl.protocol === "https:"; - info8.httpModule = usingSsl ? https3 : http; - const defaultPort = usingSsl ? 443 : 80; - info8.options = {}; - info8.options.host = info8.parsedUrl.hostname; - info8.options.port = info8.parsedUrl.port ? parseInt(info8.parsedUrl.port) : defaultPort; - info8.options.path = (info8.parsedUrl.pathname || "") + (info8.parsedUrl.search || ""); - info8.options.method = method; - info8.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info8.options.headers["user-agent"] = this.userAgent; - } - info8.options.agent = this._getAgent(info8.parsedUrl); - if (this.handlers) { - for (const handler2 of this.handlers) { - handler2.prepareRequest(info8.options); - } - } - return info8; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys2(this.requestOptions.headers), lowercaseKeys2(headers || {})); - } - return lowercaseKeys2(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys2(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; - } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (!useProxy) { - agent = this._agent; - } - if (agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (proxyUrl && proxyUrl.hostname) { - const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), { host: proxyUrl.hostname, port: proxyUrl.port }) - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === "https:"; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https3.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; - } - if (proxyAgent) { - return proxyAgent; - } - const usingSsl = parsedUrl.protocol === "https:"; - proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { - token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString("base64")}` - })); - this._proxyAgentDispatcher = proxyAgent; - if (usingSsl && this._ignoreSslError) { - proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { - rejectUnauthorized: false - }); - } - return proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter2(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve14) => setTimeout(() => resolve14(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14, reject) => __awaiter2(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve14(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - let obj; - let contents; - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { - } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; - } else { - msg = `Failed request: (${statusCode})`; - } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve14(response); - } - })); - }); - } - }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/github/lib/internal/utils.js -var require_utils8 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/github/lib/internal/utils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar2(require_lib4()); - var undici_1 = require_undici(); - function getAuthString(token, options) { - if (!token && !options.auth) { - throw new Error("Parameter token or opts.auth is required"); - } else if (token && options.auth) { - throw new Error("Parameters token and opts.auth may not both be specified"); - } - return typeof options.auth === "string" ? options.auth : `token ${token}`; - } - exports2.getAuthString = getAuthString; - function getProxyAgent(destinationUrl) { - const hc = new httpClient.HttpClient(); - return hc.getAgent(destinationUrl); - } - exports2.getProxyAgent = getProxyAgent; - function getProxyAgentDispatcher(destinationUrl) { - const hc = new httpClient.HttpClient(); - return hc.getAgentDispatcher(destinationUrl); - } - exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; - function getProxyFetch(destinationUrl) { - const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url2, opts) => __awaiter2(this, void 0, void 0, function* () { - return (0, undici_1.fetch)(url2, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); - }); - return proxyFetch; - } - exports2.getProxyFetch = getProxyFetch; - function getApiBaseUrl() { - return process.env["GITHUB_API_URL"] || "https://api.github.com"; - } - exports2.getApiBaseUrl = getApiBaseUrl; - } -}); - -// node_modules/universal-user-agent/dist-node/index.js -var require_dist_node = __commonJS({ - "node_modules/universal-user-agent/dist-node/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function getUserAgent5() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } - if (typeof process === "object" && "version" in process) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; - } - return ""; - } - exports2.getUserAgent = getUserAgent5; - } -}); - -// node_modules/@actions/artifact/node_modules/before-after-hook/lib/register.js -var require_register = __commonJS({ - "node_modules/@actions/artifact/node_modules/before-after-hook/lib/register.js"(exports2, module2) { - module2.exports = register2; - function register2(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } - if (!options) { - options = {}; - } - if (Array.isArray(name)) { - return name.reverse().reduce(function(callback, name2) { - return register2.bind(null, state, name2, callback, options); - }, method)(); - } - return Promise.resolve().then(function() { - if (!state.registry[name]) { - return method(options); - } - return state.registry[name].reduce(function(method2, registered) { - return registered.hook.bind(null, method2, options); - }, method)(); - }); - } - } -}); - -// node_modules/@actions/artifact/node_modules/before-after-hook/lib/add.js -var require_add = __commonJS({ - "node_modules/@actions/artifact/node_modules/before-after-hook/lib/add.js"(exports2, module2) { - module2.exports = addHook2; - function addHook2(state, kind, name, hook2) { - var orig = hook2; - if (!state.registry[name]) { - state.registry[name] = []; - } - if (kind === "before") { - hook2 = function(method, options) { - return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options)); - }; - } - if (kind === "after") { - hook2 = function(method, options) { - var result; - return Promise.resolve().then(method.bind(null, options)).then(function(result_) { - result = result_; - return orig(result, options); - }).then(function() { - return result; - }); - }; - } - if (kind === "error") { - hook2 = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { - return orig(error3, options); - }); - }; - } - state.registry[name].push({ - hook: hook2, - orig - }); - } - } -}); - -// node_modules/@actions/artifact/node_modules/before-after-hook/lib/remove.js -var require_remove = __commonJS({ - "node_modules/@actions/artifact/node_modules/before-after-hook/lib/remove.js"(exports2, module2) { - module2.exports = removeHook2; - function removeHook2(state, name, method) { - if (!state.registry[name]) { - return; - } - var index2 = state.registry[name].map(function(registered) { - return registered.orig; - }).indexOf(method); - if (index2 === -1) { - return; - } - state.registry[name].splice(index2, 1); - } - } -}); - -// node_modules/@actions/artifact/node_modules/before-after-hook/index.js -var require_before_after_hook = __commonJS({ - "node_modules/@actions/artifact/node_modules/before-after-hook/index.js"(exports2, module2) { - var register2 = require_register(); - var addHook2 = require_add(); - var removeHook2 = require_remove(); - var bind2 = Function.bind; - var bindable2 = bind2.bind(bind2); - function bindApi2(hook2, state, name) { - var removeHookRef = bindable2(removeHook2, null).apply( - null, - name ? [state, name] : [state] - ); - hook2.api = { remove: removeHookRef }; - hook2.remove = removeHookRef; - ["before", "error", "after", "wrap"].forEach(function(kind) { - var args = name ? [state, kind, name] : [state, kind]; - hook2[kind] = hook2.api[kind] = bindable2(addHook2, null).apply(null, args); - }); - } - function HookSingular() { - var singularHookName = "h"; - var singularHookState = { - registry: {} - }; - var singularHook = register2.bind(null, singularHookState, singularHookName); - bindApi2(singularHook, singularHookState, singularHookName); - return singularHook; - } - function HookCollection() { - var state = { - registry: {} - }; - var hook2 = register2.bind(null, state); - bindApi2(hook2, state); - return hook2; - } - var collectionHookDeprecationMessageDisplayed = false; - function Hook() { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn( - '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' - ); - collectionHookDeprecationMessageDisplayed = true; - } - return HookCollection(); - } - Hook.Singular = HookSingular.bind(); - Hook.Collection = HookCollection.bind(); - module2.exports = Hook; - module2.exports.Hook = Hook; - module2.exports.Singular = Hook.Singular; - module2.exports.Collection = Hook.Collection; - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/endpoint/dist-node/index.js -var require_dist_node2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/endpoint/dist-node/index.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports3 = {}; - __export2(dist_src_exports3, { - endpoint: () => endpoint2 - }); - module2.exports = __toCommonJS2(dist_src_exports3); - var import_universal_user_agent5 = require_dist_node(); - var VERSION8 = "9.0.6"; - var userAgent2 = `octokit-endpoint.js/${VERSION8} ${(0, import_universal_user_agent5.getUserAgent)()}`; - var DEFAULTS2 = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent2 - }, - mediaType: { - format: "" - } - }; - function lowercaseKeys2(object2) { - if (!object2) { - return {}; - } - return Object.keys(object2).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object2[key]; - return newObj; - }, {}); - } - function isPlainObject4(value) { - if (typeof value !== "object" || value === null) - return false; - if (Object.prototype.toString.call(value) !== "[object Object]") - return false; - const proto = Object.getPrototypeOf(value); - if (proto === null) - return true; - const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); - } - function mergeDeep2(defaults3, options) { - const result = Object.assign({}, defaults3); - Object.keys(options).forEach((key) => { - if (isPlainObject4(options[key])) { - if (!(key in defaults3)) - Object.assign(result, { [key]: options[key] }); - else - result[key] = mergeDeep2(defaults3[key], options[key]); - } else { - Object.assign(result, { [key]: options[key] }); - } - }); - return result; - } - function removeUndefinedProperties2(obj) { - for (const key in obj) { - if (obj[key] === void 0) { - delete obj[key]; - } - } - return obj; - } - function merge2(defaults3, route, options) { - if (typeof route === "string") { - let [method, url2] = route.split(" "); - options = Object.assign(url2 ? { method, url: url2 } : { url: method }, options); - } else { - options = Object.assign({}, route); - } - options.headers = lowercaseKeys2(options.headers); - removeUndefinedProperties2(options); - removeUndefinedProperties2(options.headers); - const mergedOptions = mergeDeep2(defaults3 || {}, options); - if (options.url === "/graphql") { - if (defaults3 && defaults3.mediaType.previews?.length) { - mergedOptions.mediaType.previews = defaults3.mediaType.previews.filter( - (preview) => !mergedOptions.mediaType.previews.includes(preview) - ).concat(mergedOptions.mediaType.previews); - } - mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); - } - return mergedOptions; - } - function addQueryParameters2(url2, parameters) { - const separator = /\?/.test(url2) ? "&" : "?"; - const names = Object.keys(parameters); - if (names.length === 0) { - return url2; - } - return url2 + separator + names.map((name) => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); - } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); - } - var urlVariableRegex2 = /\{[^{}}]+\}/g; - function removeNonChars2(variableName) { - return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []); - } - function omit2(object2, keysToOmit) { - const result = { __proto__: null }; - for (const key of Object.keys(object2)) { - if (keysToOmit.indexOf(key) === -1) { - result[key] = object2[key]; - } - } - return result; - } - function encodeReserved2(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); - } - return part; - }).join(""); - } - function encodeUnreserved2(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); - } - function encodeValue2(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved2(value) : encodeUnreserved2(value); - if (key) { - return encodeUnreserved2(key) + "=" + value; - } else { - return value; - } - } - function isDefined3(value) { - return value !== void 0 && value !== null; - } - function isKeyOperator2(operator) { - return operator === ";" || operator === "&" || operator === "?"; - } - function getValues2(context5, operator, key, modifier) { - var value = context5[key], result = []; - if (isDefined3(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - value = value.toString(); - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } - result.push( - encodeValue2(operator, value, isKeyOperator2(operator) ? key : "") - ); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined3).forEach(function(value2) { - result.push( - encodeValue2(operator, value2, isKeyOperator2(operator) ? key : "") - ); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined3(value[k])) { - result.push(encodeValue2(operator, value[k], k)); - } - }); - } - } else { - const tmp = []; - if (Array.isArray(value)) { - value.filter(isDefined3).forEach(function(value2) { - tmp.push(encodeValue2(operator, value2)); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined3(value[k])) { - tmp.push(encodeUnreserved2(k)); - tmp.push(encodeValue2(operator, value[k].toString())); - } - }); - } - if (isKeyOperator2(operator)) { - result.push(encodeUnreserved2(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); - } - } - } - } else { - if (operator === ";") { - if (isDefined3(value)) { - result.push(encodeUnreserved2(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved2(key) + "="); - } else if (value === "") { - result.push(""); - } - } - return result; - } - function parseUrl2(template) { - return { - expand: expand3.bind(null, template) - }; - } - function expand3(template, context5) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - template = template.replace( - /\{([^\{\}]+)\}|([^\{\}]+)/g, - function(_2, expression, literal) { - if (expression) { - let operator = ""; - const values = []; - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } - expression.split(/,/g).forEach(function(variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues2(context5, operator, tmp[1], tmp[2] || tmp[3])); - }); - if (operator && operator !== "+") { - var separator = ","; - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; - } - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved2(literal); - } - } - ); - if (template === "/") { - return template; - } else { - return template.replace(/\/$/, ""); - } - } - function parse3(options) { - let method = options.method.toUpperCase(); - let url2 = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({}, options.headers); - let body; - let parameters = omit2(options, [ - "method", - "baseUrl", - "url", - "headers", - "request", - "mediaType" - ]); - const urlVariableNames = extractUrlVariableNames2(url2); - url2 = parseUrl2(url2).expand(parameters); - if (!/^http/.test(url2)) { - url2 = options.baseUrl + url2; - } - const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); - const remainingParameters = omit2(parameters, omittedParameters); - const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); - if (!isBinaryRequest) { - if (options.mediaType.format) { - headers.accept = headers.accept.split(/,/).map( - (format) => format.replace( - /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, - `application/vnd$1$2.${options.mediaType.format}` - ) - ).join(","); - } - if (url2.endsWith("/graphql")) { - if (options.mediaType.previews?.length) { - const previewsFromAcceptHeader = headers.accept.match(/(? { - const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format}`; - }).join(","); - } - } - } - if (["GET", "HEAD"].includes(method)) { - url2 = addQueryParameters2(url2, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; - } else { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; - } - } - } - if (!headers["content-type"] && typeof body !== "undefined") { - headers["content-type"] = "application/json; charset=utf-8"; - } - if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } - return Object.assign( - { method, url: url2, headers }, - typeof body !== "undefined" ? { body } : null, - options.request ? { request: options.request } : null - ); - } - function endpointWithDefaults2(defaults3, route, options) { - return parse3(merge2(defaults3, route, options)); - } - function withDefaults4(oldDefaults, newDefaults) { - const DEFAULTS22 = merge2(oldDefaults, newDefaults); - const endpoint22 = endpointWithDefaults2.bind(null, DEFAULTS22); - return Object.assign(endpoint22, { - DEFAULTS: DEFAULTS22, - defaults: withDefaults4.bind(null, DEFAULTS22), - merge: merge2.bind(null, DEFAULTS22), - parse: parse3 - }); - } - var endpoint2 = withDefaults4(null, DEFAULTS2); - } -}); - -// node_modules/deprecation/dist-node/index.js -var require_dist_node3 = __commonJS({ - "node_modules/deprecation/dist-node/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var Deprecation = class extends Error { - constructor(message) { - super(message); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - this.name = "Deprecation"; - } - }; - exports2.Deprecation = Deprecation; - } -}); - -// node_modules/wrappy/wrappy.js -var require_wrappy = __commonJS({ - "node_modules/wrappy/wrappy.js"(exports2, module2) { - module2.exports = wrappy; - function wrappy(fn, cb) { - if (fn && cb) return wrappy(fn)(cb); - if (typeof fn !== "function") - throw new TypeError("need wrapper function"); - Object.keys(fn).forEach(function(k) { - wrapper[k] = fn[k]; - }); - return wrapper; - function wrapper() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - var ret = fn.apply(this, args); - var cb2 = args[args.length - 1]; - if (typeof ret === "function" && ret !== cb2) { - Object.keys(cb2).forEach(function(k) { - ret[k] = cb2[k]; - }); - } - return ret; - } - } - } -}); - -// node_modules/once/once.js -var require_once = __commonJS({ - "node_modules/once/once.js"(exports2, module2) { - var wrappy = require_wrappy(); - module2.exports = wrappy(once); - module2.exports.strict = wrappy(onceStrict); - once.proto = once(function() { - Object.defineProperty(Function.prototype, "once", { - value: function() { - return once(this); - }, - configurable: true - }); - Object.defineProperty(Function.prototype, "onceStrict", { - value: function() { - return onceStrict(this); - }, - configurable: true - }); - }); - function once(fn) { - var f = function() { - if (f.called) return f.value; - f.called = true; - return f.value = fn.apply(this, arguments); - }; - f.called = false; - return f; - } - function onceStrict(fn) { - var f = function() { - if (f.called) - throw new Error(f.onceError); - f.called = true; - return f.value = fn.apply(this, arguments); - }; - var name = fn.name || "Function wrapped with `once`"; - f.onceError = name + " shouldn't be called more than once"; - f.called = false; - return f; - } - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/request-error/dist-node/index.js -var require_dist_node4 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/request-error/dist-node/index.js"(exports2, module2) { - "use strict"; - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, - mod - )); - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports3 = {}; - __export2(dist_src_exports3, { - RequestError: () => RequestError2 - }); - module2.exports = __toCommonJS2(dist_src_exports3); - var import_deprecation = require_dist_node3(); - var import_once = __toESM2(require_once()); - var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation)); - var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation)); - var RequestError2 = class extends Error { - constructor(message, statusCode, options) { - super(message); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - this.name = "HttpError"; - this.status = statusCode; - let headers; - if ("headers" in options && typeof options.headers !== "undefined") { - headers = options.headers; - } - if ("response" in options) { - this.response = options.response; - headers = options.response.headers; - } - const requestCopy = Object.assign({}, options.request); - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace( - /(? { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports3 = {}; - __export2(dist_src_exports3, { - request: () => request3 - }); - module2.exports = __toCommonJS2(dist_src_exports3); - var import_endpoint2 = require_dist_node2(); - var import_universal_user_agent5 = require_dist_node(); - var VERSION8 = "8.4.1"; - function isPlainObject4(value) { - if (typeof value !== "object" || value === null) - return false; - if (Object.prototype.toString.call(value) !== "[object Object]") - return false; - const proto = Object.getPrototypeOf(value); - if (proto === null) - return true; - const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); - } - var import_request_error3 = require_dist_node4(); - function getBufferResponse(response) { - return response.arrayBuffer(); - } - function fetchWrapper2(requestOptions) { - var _a2, _b, _c, _d; - const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; - const parseSuccessResponseBody = ((_a2 = requestOptions.request) == null ? void 0 : _a2.parseSuccessResponseBody) !== false; - if (isPlainObject4(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); - } - let headers = {}; - let status; - let url2; - let { fetch } = globalThis; - if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) { - fetch = requestOptions.request.fetch; - } - if (!fetch) { - throw new Error( - "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing" - ); - } - return fetch(requestOptions.url, { - method: requestOptions.method, - body: requestOptions.body, - redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect, - headers: requestOptions.headers, - signal: (_d = requestOptions.request) == null ? void 0 : _d.signal, - // duplex must be set if request.body is ReadableStream or Async Iterables. - // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. - ...requestOptions.body && { duplex: "half" } - }).then(async (response) => { - url2 = response.url; - status = response.status; - for (const keyAndValue of response.headers) { - headers[keyAndValue[0]] = keyAndValue[1]; - } - if ("deprecation" in headers) { - const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/); - const deprecationLink = matches && matches.pop(); - log.warn( - `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` - ); - } - if (status === 204 || status === 205) { - return; - } - if (requestOptions.method === "HEAD") { - if (status < 400) { - return; - } - throw new import_request_error3.RequestError(response.statusText, status, { - response: { - url: url2, - status, - headers, - data: void 0 - }, - request: requestOptions - }); - } - if (status === 304) { - throw new import_request_error3.RequestError("Not modified", status, { - response: { - url: url2, - status, - headers, - data: await getResponseData2(response) - }, - request: requestOptions - }); - } - if (status >= 400) { - const data = await getResponseData2(response); - const error3 = new import_request_error3.RequestError(toErrorMessage2(data), status, { - response: { - url: url2, - status, - headers, - data - }, - request: requestOptions - }); - throw error3; - } - return parseSuccessResponseBody ? await getResponseData2(response) : response.body; - }).then((data) => { - return { - status, - url: url2, - headers, - data - }; - }).catch((error3) => { - if (error3 instanceof import_request_error3.RequestError) - throw error3; - else if (error3.name === "AbortError") - throw error3; - let message = error3.message; - if (error3.name === "TypeError" && "cause" in error3) { - if (error3.cause instanceof Error) { - message = error3.cause.message; - } else if (typeof error3.cause === "string") { - message = error3.cause; - } - } - throw new import_request_error3.RequestError(message, 500, { - request: requestOptions - }); - }); - } - async function getResponseData2(response) { - const contentType = response.headers.get("content-type"); - if (/application\/json/.test(contentType)) { - return response.json().catch(() => response.text()).catch(() => ""); - } - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } - return getBufferResponse(response); - } - function toErrorMessage2(data) { - if (typeof data === "string") - return data; - let suffix; - if ("documentation_url" in data) { - suffix = ` - ${data.documentation_url}`; - } else { - suffix = ""; - } - if ("message" in data) { - if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; - } - return `${data.message}${suffix}`; - } - return `Unknown error: ${JSON.stringify(data)}`; - } - function withDefaults4(oldEndpoint, newDefaults) { - const endpoint2 = oldEndpoint.defaults(newDefaults); - const newApi = function(route, parameters) { - const endpointOptions = endpoint2.merge(route, parameters); - if (!endpointOptions.request || !endpointOptions.request.hook) { - return fetchWrapper2(endpoint2.parse(endpointOptions)); - } - const request22 = (route2, parameters2) => { - return fetchWrapper2( - endpoint2.parse(endpoint2.merge(route2, parameters2)) - ); - }; - Object.assign(request22, { - endpoint: endpoint2, - defaults: withDefaults4.bind(null, endpoint2) - }); - return endpointOptions.request.hook(request22, endpointOptions); - }; - return Object.assign(newApi, { - endpoint: endpoint2, - defaults: withDefaults4.bind(null, endpoint2) - }); - } - var request3 = withDefaults4(import_endpoint2.endpoint, { - headers: { - "user-agent": `octokit-request.js/${VERSION8} ${(0, import_universal_user_agent5.getUserAgent)()}` - } - }); - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/graphql/dist-node/index.js -var require_dist_node6 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/graphql/dist-node/index.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var index_exports = {}; - __export2(index_exports, { - GraphqlResponseError: () => GraphqlResponseError2, - graphql: () => graphql22, - withCustomRequest: () => withCustomRequest2 - }); - module2.exports = __toCommonJS2(index_exports); - var import_request3 = require_dist_node5(); - var import_universal_user_agent5 = require_dist_node(); - var VERSION8 = "7.1.1"; - var import_request22 = require_dist_node5(); - var import_request4 = require_dist_node5(); - function _buildMessageForResponseErrors2(data) { - return `Request failed due to following response errors: -` + data.errors.map((e) => ` - ${e.message}`).join("\n"); - } - var GraphqlResponseError2 = class extends Error { - constructor(request22, headers, response) { - super(_buildMessageForResponseErrors2(response)); - this.request = request22; - this.headers = headers; - this.response = response; - this.name = "GraphqlResponseError"; - this.errors = response.errors; - this.data = response.data; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - } - }; - var NON_VARIABLE_OPTIONS2 = [ - "method", - "baseUrl", - "url", - "headers", - "request", - "query", - "mediaType" - ]; - var FORBIDDEN_VARIABLE_OPTIONS2 = ["query", "method", "url"]; - var GHES_V3_SUFFIX_REGEX2 = /\/api\/v3\/?$/; - function graphql3(request22, query, options) { - if (options) { - if (typeof query === "string" && "query" in options) { - return Promise.reject( - new Error(`[@octokit/graphql] "query" cannot be used as variable name`) - ); - } - for (const key in options) { - if (!FORBIDDEN_VARIABLE_OPTIONS2.includes(key)) continue; - return Promise.reject( - new Error( - `[@octokit/graphql] "${key}" cannot be used as variable name` - ) - ); - } - } - const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; - const requestOptions = Object.keys( - parsedOptions - ).reduce((result, key) => { - if (NON_VARIABLE_OPTIONS2.includes(key)) { - result[key] = parsedOptions[key]; - return result; - } - if (!result.variables) { - result.variables = {}; - } - result.variables[key] = parsedOptions[key]; - return result; - }, {}); - const baseUrl = parsedOptions.baseUrl || request22.endpoint.DEFAULTS.baseUrl; - if (GHES_V3_SUFFIX_REGEX2.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX2, "/api/graphql"); - } - return request22(requestOptions).then((response) => { - if (response.data.errors) { - const headers = {}; - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } - throw new GraphqlResponseError2( - requestOptions, - headers, - response.data - ); - } - return response.data.data; - }); - } - function withDefaults4(request22, newDefaults) { - const newRequest = request22.defaults(newDefaults); - const newApi = (query, options) => { - return graphql3(newRequest, query, options); - }; - return Object.assign(newApi, { - defaults: withDefaults4.bind(null, newRequest), - endpoint: newRequest.endpoint - }); - } - var graphql22 = withDefaults4(import_request3.request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION8} ${(0, import_universal_user_agent5.getUserAgent)()}` - }, - method: "POST", - url: "/graphql" - }); - function withCustomRequest2(customRequest) { - return withDefaults4(customRequest, { - method: "POST", - url: "/graphql" - }); - } - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/auth-token/dist-node/index.js -var require_dist_node7 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/auth-token/dist-node/index.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports3 = {}; - __export2(dist_src_exports3, { - createTokenAuth: () => createTokenAuth3 - }); - module2.exports = __toCommonJS2(dist_src_exports3); - var REGEX_IS_INSTALLATION_LEGACY = /^v1\./; - var REGEX_IS_INSTALLATION = /^ghs_/; - var REGEX_IS_USER_TO_SERVER = /^ghu_/; - async function auth2(token) { - const isApp = token.split(/\./).length === 3; - const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); - const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); - const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; - return { - type: "token", - token, - tokenType - }; - } - function withAuthorizationPrefix2(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } - return `token ${token}`; - } - async function hook2(token, request3, route, parameters) { - const endpoint2 = request3.endpoint.merge( - route, - parameters - ); - endpoint2.headers.authorization = withAuthorizationPrefix2(token); - return request3(endpoint2); - } - var createTokenAuth3 = function createTokenAuth22(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } - if (typeof token !== "string") { - throw new Error( - "[@octokit/auth-token] Token passed to createTokenAuth is not a string" - ); - } - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth2.bind(null, token), { - hook: hook2.bind(null, token) - }); - }; - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/core/dist-node/index.js -var require_dist_node8 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/core/dist-node/index.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var index_exports = {}; - __export2(index_exports, { - Octokit: () => Octokit2 - }); - module2.exports = __toCommonJS2(index_exports); - var import_universal_user_agent5 = require_dist_node(); - var import_before_after_hook2 = require_before_after_hook(); - var import_request3 = require_dist_node5(); - var import_graphql2 = require_dist_node6(); - var import_auth_token2 = require_dist_node7(); - var VERSION8 = "5.2.2"; - var noop3 = () => { - }; - var consoleWarn2 = console.warn.bind(console); - var consoleError2 = console.error.bind(console); - function createLogger2(logger = {}) { - if (typeof logger.debug !== "function") { - logger.debug = noop3; - } - if (typeof logger.info !== "function") { - logger.info = noop3; - } - if (typeof logger.warn !== "function") { - logger.warn = consoleWarn2; - } - if (typeof logger.error !== "function") { - logger.error = consoleError2; - } - return logger; - } - var userAgentTrail2 = `octokit-core.js/${VERSION8} ${(0, import_universal_user_agent5.getUserAgent)()}`; - var Octokit2 = class { - static { - this.VERSION = VERSION8; - } - static defaults(defaults3) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; - if (typeof defaults3 === "function") { - super(defaults3(options)); - return; - } - super( - Object.assign( - {}, - defaults3, - options, - options.userAgent && defaults3.userAgent ? { - userAgent: `${options.userAgent} ${defaults3.userAgent}` - } : null - ) - ); - } - }; - return OctokitWithDefaults; - } - static { - this.plugins = []; - } - /** - * Attach a plugin (or many) to your Octokit instance. - * - * @example - * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) - */ - static plugin(...newPlugins) { - const currentPlugins = this.plugins; - const NewOctokit = class extends this { - static { - this.plugins = currentPlugins.concat( - newPlugins.filter((plugin) => !currentPlugins.includes(plugin)) - ); - } - }; - return NewOctokit; - } - constructor(options = {}) { - const hook2 = new import_before_after_hook2.Collection(); - const requestDefaults = { - baseUrl: import_request3.request.endpoint.DEFAULTS.baseUrl, - headers: {}, - request: Object.assign({}, options.request, { - // @ts-ignore internal usage only, no need to type - hook: hook2.bind(null, "request") - }), - mediaType: { - previews: [], - format: "" - } - }; - requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail2}` : userAgentTrail2; - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; - } - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; - } - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; - } - this.request = import_request3.request.defaults(requestDefaults); - this.graphql = (0, import_graphql2.withCustomRequest)(this.request).defaults(requestDefaults); - this.log = createLogger2(options.log); - this.hook = hook2; - if (!options.authStrategy) { - if (!options.auth) { - this.auth = async () => ({ - type: "unauthenticated" - }); - } else { - const auth2 = (0, import_auth_token2.createTokenAuth)(options.auth); - hook2.wrap("request", auth2.hook); - this.auth = auth2; - } - } else { - const { authStrategy, ...otherOptions } = options; - const auth2 = authStrategy( - Object.assign( - { - request: this.request, - log: this.log, - // we pass the current octokit instance as well as its constructor options - // to allow for authentication strategies that return a new octokit instance - // that shares the same internal state as the current one. The original - // requirement for this was the "event-octokit" authentication strategy - // of https://github.com/probot/octokit-auth-probot. - octokit: this, - octokitOptions: otherOptions - }, - options.auth - ) - ); - hook2.wrap("request", auth2.hook); - this.auth = auth2; - } - const classConstructor = this.constructor; - for (let i = 0; i < classConstructor.plugins.length; ++i) { - Object.assign(this, classConstructor.plugins[i](this, options)); - } - } - }; - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js -var require_dist_node9 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports3 = {}; - __export2(dist_src_exports3, { - legacyRestEndpointMethods: () => legacyRestEndpointMethods2, - restEndpointMethods: () => restEndpointMethods2 - }); - module2.exports = __toCommonJS2(dist_src_exports3); - var VERSION8 = "10.4.1"; - var Endpoints2 = { - actions: { - addCustomLabelsToSelfHostedRunnerForOrg: [ - "POST /orgs/{org}/actions/runners/{runner_id}/labels" - ], - addCustomLabelsToSelfHostedRunnerForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" - ], - addSelectedRepoToOrgVariable: [ - "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" - ], - approveWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve" - ], - cancelWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel" - ], - createEnvironmentVariable: [ - "POST /repositories/{repository_id}/environments/{environment_name}/variables" - ], - createOrUpdateEnvironmentSecret: [ - "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" - ], - createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}" - ], - createOrgVariable: ["POST /orgs/{org}/actions/variables"], - createRegistrationTokenForOrg: [ - "POST /orgs/{org}/actions/runners/registration-token" - ], - createRegistrationTokenForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/registration-token" - ], - createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], - createRemoveTokenForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/remove-token" - ], - createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"], - createWorkflowDispatch: [ - "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" - ], - deleteActionsCacheById: [ - "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}" - ], - deleteActionsCacheByKey: [ - "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}" - ], - deleteArtifact: [ - "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}" - ], - deleteEnvironmentSecret: [ - "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" - ], - deleteEnvironmentVariable: [ - "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], - deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}" - ], - deleteRepoVariable: [ - "DELETE /repos/{owner}/{repo}/actions/variables/{name}" - ], - deleteSelfHostedRunnerFromOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}" - ], - deleteSelfHostedRunnerFromRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}" - ], - deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], - deleteWorkflowRunLogs: [ - "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs" - ], - disableSelectedRepositoryGithubActionsOrganization: [ - "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}" - ], - disableWorkflow: [ - "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable" - ], - downloadArtifact: [ - "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}" - ], - downloadJobLogsForWorkflowRun: [ - "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs" - ], - downloadWorkflowRunAttemptLogs: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs" - ], - downloadWorkflowRunLogs: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs" - ], - enableSelectedRepositoryGithubActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}" - ], - enableWorkflow: [ - "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable" - ], - forceCancelWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel" - ], - generateRunnerJitconfigForOrg: [ - "POST /orgs/{org}/actions/runners/generate-jitconfig" - ], - generateRunnerJitconfigForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig" - ], - getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], - getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], - getActionsCacheUsageByRepoForOrg: [ - "GET /orgs/{org}/actions/cache/usage-by-repository" - ], - getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], - getAllowedActionsOrganization: [ - "GET /orgs/{org}/actions/permissions/selected-actions" - ], - getAllowedActionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" - ], - getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - getCustomOidcSubClaimForRepo: [ - "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" - ], - getEnvironmentPublicKey: [ - "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" - ], - getEnvironmentSecret: [ - "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" - ], - getEnvironmentVariable: [ - "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}" - ], - getGithubActionsDefaultWorkflowPermissionsOrganization: [ - "GET /orgs/{org}/actions/permissions/workflow" - ], - getGithubActionsDefaultWorkflowPermissionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/workflow" - ], - getGithubActionsPermissionsOrganization: [ - "GET /orgs/{org}/actions/permissions" - ], - getGithubActionsPermissionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions" - ], - getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], - getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], - getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"], - getPendingDeploymentsForRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - ], - getRepoPermissions: [ - "GET /repos/{owner}/{repo}/actions/permissions", - {}, - { renamed: ["actions", "getGithubActionsPermissionsRepository"] } - ], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"], - getReviewsForRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals" - ], - getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], - getSelfHostedRunnerForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/{runner_id}" - ], - getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], - getWorkflowAccessToRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/access" - ], - getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], - getWorkflowRunAttempt: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}" - ], - getWorkflowRunUsage: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing" - ], - getWorkflowUsage: [ - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing" - ], - listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], - listEnvironmentSecrets: [ - "GET /repositories/{repository_id}/environments/{environment_name}/secrets" - ], - listEnvironmentVariables: [ - "GET /repositories/{repository_id}/environments/{environment_name}/variables" - ], - listJobsForWorkflowRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs" - ], - listJobsForWorkflowRunAttempt: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs" - ], - listLabelsForSelfHostedRunnerForOrg: [ - "GET /orgs/{org}/actions/runners/{runner_id}/labels" - ], - listLabelsForSelfHostedRunnerForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], - listOrgVariables: ["GET /orgs/{org}/actions/variables"], - listRepoOrganizationSecrets: [ - "GET /repos/{owner}/{repo}/actions/organization-secrets" - ], - listRepoOrganizationVariables: [ - "GET /repos/{owner}/{repo}/actions/organization-variables" - ], - listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], - listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"], - listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], - listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], - listRunnerApplicationsForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/downloads" - ], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/actions/secrets/{secret_name}/repositories" - ], - listSelectedReposForOrgVariable: [ - "GET /orgs/{org}/actions/variables/{name}/repositories" - ], - listSelectedRepositoriesEnabledGithubActionsOrganization: [ - "GET /orgs/{org}/actions/permissions/repositories" - ], - listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], - listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], - listWorkflowRunArtifacts: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts" - ], - listWorkflowRuns: [ - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs" - ], - listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], - reRunJobForWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" - ], - reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], - reRunWorkflowFailedJobs: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" - ], - removeAllCustomLabelsFromSelfHostedRunnerForOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}/labels" - ], - removeAllCustomLabelsFromSelfHostedRunnerForRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - removeCustomLabelFromSelfHostedRunnerForOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}" - ], - removeCustomLabelFromSelfHostedRunnerForRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" - ], - removeSelectedRepoFromOrgVariable: [ - "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" - ], - reviewCustomGatesForRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" - ], - reviewPendingDeploymentsForRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - ], - setAllowedActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/selected-actions" - ], - setAllowedActionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions" - ], - setCustomLabelsForSelfHostedRunnerForOrg: [ - "PUT /orgs/{org}/actions/runners/{runner_id}/labels" - ], - setCustomLabelsForSelfHostedRunnerForRepo: [ - "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - setCustomOidcSubClaimForRepo: [ - "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" - ], - setGithubActionsDefaultWorkflowPermissionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/workflow" - ], - setGithubActionsDefaultWorkflowPermissionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/workflow" - ], - setGithubActionsPermissionsOrganization: [ - "PUT /orgs/{org}/actions/permissions" - ], - setGithubActionsPermissionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories" - ], - setSelectedReposForOrgVariable: [ - "PUT /orgs/{org}/actions/variables/{name}/repositories" - ], - setSelectedRepositoriesEnabledGithubActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/repositories" - ], - setWorkflowAccessToRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/access" - ], - updateEnvironmentVariable: [ - "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}" - ], - updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"], - updateRepoVariable: [ - "PATCH /repos/{owner}/{repo}/actions/variables/{name}" - ] - }, - activity: { - checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], - deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], - deleteThreadSubscription: [ - "DELETE /notifications/threads/{thread_id}/subscription" - ], - getFeeds: ["GET /feeds"], - getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], - getThread: ["GET /notifications/threads/{thread_id}"], - getThreadSubscriptionForAuthenticatedUser: [ - "GET /notifications/threads/{thread_id}/subscription" - ], - listEventsForAuthenticatedUser: ["GET /users/{username}/events"], - listNotificationsForAuthenticatedUser: ["GET /notifications"], - listOrgEventsForAuthenticatedUser: [ - "GET /users/{username}/events/orgs/{org}" - ], - listPublicEvents: ["GET /events"], - listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], - listPublicEventsForUser: ["GET /users/{username}/events/public"], - listPublicOrgEvents: ["GET /orgs/{org}/events"], - listReceivedEventsForUser: ["GET /users/{username}/received_events"], - listReceivedPublicEventsForUser: [ - "GET /users/{username}/received_events/public" - ], - listRepoEvents: ["GET /repos/{owner}/{repo}/events"], - listRepoNotificationsForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/notifications" - ], - listReposStarredByAuthenticatedUser: ["GET /user/starred"], - listReposStarredByUser: ["GET /users/{username}/starred"], - listReposWatchedByUser: ["GET /users/{username}/subscriptions"], - listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], - listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], - listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], - markNotificationsAsRead: ["PUT /notifications"], - markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], - markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], - markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], - setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], - setThreadSubscription: [ - "PUT /notifications/threads/{thread_id}/subscription" - ], - starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], - unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] - }, - apps: { - addRepoToInstallation: [ - "PUT /user/installations/{installation_id}/repositories/{repository_id}", - {}, - { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] } - ], - addRepoToInstallationForAuthenticatedUser: [ - "PUT /user/installations/{installation_id}/repositories/{repository_id}" - ], - checkToken: ["POST /applications/{client_id}/token"], - createFromManifest: ["POST /app-manifests/{code}/conversions"], - createInstallationAccessToken: [ - "POST /app/installations/{installation_id}/access_tokens" - ], - deleteAuthorization: ["DELETE /applications/{client_id}/grant"], - deleteInstallation: ["DELETE /app/installations/{installation_id}"], - deleteToken: ["DELETE /applications/{client_id}/token"], - getAuthenticated: ["GET /app"], - getBySlug: ["GET /apps/{app_slug}"], - getInstallation: ["GET /app/installations/{installation_id}"], - getOrgInstallation: ["GET /orgs/{org}/installation"], - getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], - getSubscriptionPlanForAccount: [ - "GET /marketplace_listing/accounts/{account_id}" - ], - getSubscriptionPlanForAccountStubbed: [ - "GET /marketplace_listing/stubbed/accounts/{account_id}" - ], - getUserInstallation: ["GET /users/{username}/installation"], - getWebhookConfigForApp: ["GET /app/hook/config"], - getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], - listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], - listAccountsForPlanStubbed: [ - "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts" - ], - listInstallationReposForAuthenticatedUser: [ - "GET /user/installations/{installation_id}/repositories" - ], - listInstallationRequestsForAuthenticatedApp: [ - "GET /app/installation-requests" - ], - listInstallations: ["GET /app/installations"], - listInstallationsForAuthenticatedUser: ["GET /user/installations"], - listPlans: ["GET /marketplace_listing/plans"], - listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], - listReposAccessibleToInstallation: ["GET /installation/repositories"], - listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], - listSubscriptionsForAuthenticatedUserStubbed: [ - "GET /user/marketplace_purchases/stubbed" - ], - listWebhookDeliveries: ["GET /app/hook/deliveries"], - redeliverWebhookDelivery: [ - "POST /app/hook/deliveries/{delivery_id}/attempts" - ], - removeRepoFromInstallation: [ - "DELETE /user/installations/{installation_id}/repositories/{repository_id}", - {}, - { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] } - ], - removeRepoFromInstallationForAuthenticatedUser: [ - "DELETE /user/installations/{installation_id}/repositories/{repository_id}" - ], - resetToken: ["PATCH /applications/{client_id}/token"], - revokeInstallationAccessToken: ["DELETE /installation/token"], - scopeToken: ["POST /applications/{client_id}/token/scoped"], - suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], - unsuspendInstallation: [ - "DELETE /app/installations/{installation_id}/suspended" - ], - updateWebhookConfigForApp: ["PATCH /app/hook/config"] - }, - billing: { - getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], - getGithubActionsBillingUser: [ - "GET /users/{username}/settings/billing/actions" - ], - getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], - getGithubPackagesBillingUser: [ - "GET /users/{username}/settings/billing/packages" - ], - getSharedStorageBillingOrg: [ - "GET /orgs/{org}/settings/billing/shared-storage" - ], - getSharedStorageBillingUser: [ - "GET /users/{username}/settings/billing/shared-storage" - ] - }, - checks: { - create: ["POST /repos/{owner}/{repo}/check-runs"], - createSuite: ["POST /repos/{owner}/{repo}/check-suites"], - get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], - getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], - listAnnotations: [ - "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations" - ], - listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], - listForSuite: [ - "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs" - ], - listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], - rerequestRun: [ - "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest" - ], - rerequestSuite: [ - "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest" - ], - setSuitesPreferences: [ - "PATCH /repos/{owner}/{repo}/check-suites/preferences" - ], - update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] - }, - codeScanning: { - deleteAnalysis: [ - "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}" - ], - getAlert: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", - {}, - { renamedParameters: { alert_id: "alert_number" } } - ], - getAnalysis: [ - "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}" - ], - getCodeqlDatabase: [ - "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" - ], - getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"], - getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], - listAlertInstances: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances" - ], - listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], - listAlertsInstances: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", - {}, - { renamed: ["codeScanning", "listAlertInstances"] } - ], - listCodeqlDatabases: [ - "GET /repos/{owner}/{repo}/code-scanning/codeql/databases" - ], - listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" - ], - updateDefaultSetup: [ - "PATCH /repos/{owner}/{repo}/code-scanning/default-setup" - ], - uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] - }, - codesOfConduct: { - getAllCodesOfConduct: ["GET /codes_of_conduct"], - getConductCode: ["GET /codes_of_conduct/{key}"] - }, - codespaces: { - addRepositoryForSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - checkPermissionsForDevcontainer: [ - "GET /repos/{owner}/{repo}/codespaces/permissions_check" - ], - codespaceMachinesForAuthenticatedUser: [ - "GET /user/codespaces/{codespace_name}/machines" - ], - createForAuthenticatedUser: ["POST /user/codespaces"], - createOrUpdateOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}" - ], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - createOrUpdateSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}" - ], - createWithPrForAuthenticatedUser: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces" - ], - createWithRepoForAuthenticatedUser: [ - "POST /repos/{owner}/{repo}/codespaces" - ], - deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], - deleteFromOrganization: [ - "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - deleteSecretForAuthenticatedUser: [ - "DELETE /user/codespaces/secrets/{secret_name}" - ], - exportForAuthenticatedUser: [ - "POST /user/codespaces/{codespace_name}/exports" - ], - getCodespacesForUserInOrg: [ - "GET /orgs/{org}/members/{username}/codespaces" - ], - getExportDetailsForAuthenticatedUser: [ - "GET /user/codespaces/{codespace_name}/exports/{export_id}" - ], - getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], - getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"], - getPublicKeyForAuthenticatedUser: [ - "GET /user/codespaces/secrets/public-key" - ], - getRepoPublicKey: [ - "GET /repos/{owner}/{repo}/codespaces/secrets/public-key" - ], - getRepoSecret: [ - "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - getSecretForAuthenticatedUser: [ - "GET /user/codespaces/secrets/{secret_name}" - ], - listDevcontainersInRepositoryForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/devcontainers" - ], - listForAuthenticatedUser: ["GET /user/codespaces"], - listInOrganization: [ - "GET /orgs/{org}/codespaces", - {}, - { renamedParameters: { org_id: "org" } } - ], - listInRepositoryForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces" - ], - listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], - listRepositoriesForSecretForAuthenticatedUser: [ - "GET /user/codespaces/secrets/{secret_name}/repositories" - ], - listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories" - ], - preFlightWithRepoForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/new" - ], - publishForAuthenticatedUser: [ - "POST /user/codespaces/{codespace_name}/publish" - ], - removeRepositoryForSecretForAuthenticatedUser: [ - "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - repoMachinesForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/machines" - ], - setRepositoriesForSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}/repositories" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories" - ], - startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], - stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], - stopInOrganization: [ - "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop" - ], - updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] - }, - copilot: { - addCopilotSeatsForTeams: [ - "POST /orgs/{org}/copilot/billing/selected_teams" - ], - addCopilotSeatsForUsers: [ - "POST /orgs/{org}/copilot/billing/selected_users" - ], - cancelCopilotSeatAssignmentForTeams: [ - "DELETE /orgs/{org}/copilot/billing/selected_teams" - ], - cancelCopilotSeatAssignmentForUsers: [ - "DELETE /orgs/{org}/copilot/billing/selected_users" - ], - getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"], - getCopilotSeatDetailsForUser: [ - "GET /orgs/{org}/members/{username}/copilot" - ], - listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] - }, - dependabot: { - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" - ], - createOrUpdateOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}" - ], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"], - getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], - getRepoPublicKey: [ - "GET /repos/{owner}/{repo}/dependabot/secrets/public-key" - ], - getRepoSecret: [ - "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - listAlertsForEnterprise: [ - "GET /enterprises/{enterprise}/dependabot/alerts" - ], - listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"], - listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories" - ], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}" - ] - }, - dependencyGraph: { - createRepositorySnapshot: [ - "POST /repos/{owner}/{repo}/dependency-graph/snapshots" - ], - diffRange: [ - "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}" - ], - exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"] - }, - emojis: { get: ["GET /emojis"] }, - gists: { - checkIsStarred: ["GET /gists/{gist_id}/star"], - create: ["POST /gists"], - createComment: ["POST /gists/{gist_id}/comments"], - delete: ["DELETE /gists/{gist_id}"], - deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], - fork: ["POST /gists/{gist_id}/forks"], - get: ["GET /gists/{gist_id}"], - getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], - getRevision: ["GET /gists/{gist_id}/{sha}"], - list: ["GET /gists"], - listComments: ["GET /gists/{gist_id}/comments"], - listCommits: ["GET /gists/{gist_id}/commits"], - listForUser: ["GET /users/{username}/gists"], - listForks: ["GET /gists/{gist_id}/forks"], - listPublic: ["GET /gists/public"], - listStarred: ["GET /gists/starred"], - star: ["PUT /gists/{gist_id}/star"], - unstar: ["DELETE /gists/{gist_id}/star"], - update: ["PATCH /gists/{gist_id}"], - updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] - }, - git: { - createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], - createCommit: ["POST /repos/{owner}/{repo}/git/commits"], - createRef: ["POST /repos/{owner}/{repo}/git/refs"], - createTag: ["POST /repos/{owner}/{repo}/git/tags"], - createTree: ["POST /repos/{owner}/{repo}/git/trees"], - deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], - getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], - getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], - getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], - getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], - getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], - listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], - updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] - }, - gitignore: { - getAllTemplates: ["GET /gitignore/templates"], - getTemplate: ["GET /gitignore/templates/{name}"] - }, - interactions: { - getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], - getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], - getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], - getRestrictionsForYourPublicRepos: [ - "GET /user/interaction-limits", - {}, - { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] } - ], - removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], - removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], - removeRestrictionsForRepo: [ - "DELETE /repos/{owner}/{repo}/interaction-limits" - ], - removeRestrictionsForYourPublicRepos: [ - "DELETE /user/interaction-limits", - {}, - { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] } - ], - setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], - setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], - setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], - setRestrictionsForYourPublicRepos: [ - "PUT /user/interaction-limits", - {}, - { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] } - ] - }, - issues: { - addAssignees: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees" - ], - addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], - checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], - checkUserCanBeAssignedToIssue: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}" - ], - create: ["POST /repos/{owner}/{repo}/issues"], - createComment: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/comments" - ], - createLabel: ["POST /repos/{owner}/{repo}/labels"], - createMilestone: ["POST /repos/{owner}/{repo}/milestones"], - deleteComment: [ - "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}" - ], - deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], - deleteMilestone: [ - "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}" - ], - get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], - getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], - getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], - getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], - getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], - list: ["GET /issues"], - listAssignees: ["GET /repos/{owner}/{repo}/assignees"], - listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], - listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], - listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], - listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], - listEventsForTimeline: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline" - ], - listForAuthenticatedUser: ["GET /user/issues"], - listForOrg: ["GET /orgs/{org}/issues"], - listForRepo: ["GET /repos/{owner}/{repo}/issues"], - listLabelsForMilestone: [ - "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels" - ], - listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], - listLabelsOnIssue: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/labels" - ], - listMilestones: ["GET /repos/{owner}/{repo}/milestones"], - lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], - removeAllLabels: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels" - ], - removeAssignees: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees" - ], - removeLabel: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}" - ], - setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], - unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], - update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], - updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], - updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], - updateMilestone: [ - "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}" - ] - }, - licenses: { - get: ["GET /licenses/{license}"], - getAllCommonlyUsed: ["GET /licenses"], - getForRepo: ["GET /repos/{owner}/{repo}/license"] - }, - markdown: { - render: ["POST /markdown"], - renderRaw: [ - "POST /markdown/raw", - { headers: { "content-type": "text/plain; charset=utf-8" } } - ] - }, - meta: { - get: ["GET /meta"], - getAllVersions: ["GET /versions"], - getOctocat: ["GET /octocat"], - getZen: ["GET /zen"], - root: ["GET /"] - }, - migrations: { - cancelImport: [ - "DELETE /repos/{owner}/{repo}/import", - {}, - { - deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import" - } - ], - deleteArchiveForAuthenticatedUser: [ - "DELETE /user/migrations/{migration_id}/archive" - ], - deleteArchiveForOrg: [ - "DELETE /orgs/{org}/migrations/{migration_id}/archive" - ], - downloadArchiveForOrg: [ - "GET /orgs/{org}/migrations/{migration_id}/archive" - ], - getArchiveForAuthenticatedUser: [ - "GET /user/migrations/{migration_id}/archive" - ], - getCommitAuthors: [ - "GET /repos/{owner}/{repo}/import/authors", - {}, - { - deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors" - } - ], - getImportStatus: [ - "GET /repos/{owner}/{repo}/import", - {}, - { - deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status" - } - ], - getLargeFiles: [ - "GET /repos/{owner}/{repo}/import/large_files", - {}, - { - deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files" - } - ], - getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], - getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], - listForAuthenticatedUser: ["GET /user/migrations"], - listForOrg: ["GET /orgs/{org}/migrations"], - listReposForAuthenticatedUser: [ - "GET /user/migrations/{migration_id}/repositories" - ], - listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], - listReposForUser: [ - "GET /user/migrations/{migration_id}/repositories", - {}, - { renamed: ["migrations", "listReposForAuthenticatedUser"] } - ], - mapCommitAuthor: [ - "PATCH /repos/{owner}/{repo}/import/authors/{author_id}", - {}, - { - deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author" - } - ], - setLfsPreference: [ - "PATCH /repos/{owner}/{repo}/import/lfs", - {}, - { - deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference" - } - ], - startForAuthenticatedUser: ["POST /user/migrations"], - startForOrg: ["POST /orgs/{org}/migrations"], - startImport: [ - "PUT /repos/{owner}/{repo}/import", - {}, - { - deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import" - } - ], - unlockRepoForAuthenticatedUser: [ - "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock" - ], - unlockRepoForOrg: [ - "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock" - ], - updateImport: [ - "PATCH /repos/{owner}/{repo}/import", - {}, - { - deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import" - } - ] - }, - oidc: { - getOidcCustomSubTemplateForOrg: [ - "GET /orgs/{org}/actions/oidc/customization/sub" - ], - updateOidcCustomSubTemplateForOrg: [ - "PUT /orgs/{org}/actions/oidc/customization/sub" - ] - }, - orgs: { - addSecurityManagerTeam: [ - "PUT /orgs/{org}/security-managers/teams/{team_slug}" - ], - assignTeamToOrgRole: [ - "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" - ], - assignUserToOrgRole: [ - "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" - ], - blockUser: ["PUT /orgs/{org}/blocks/{username}"], - cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], - checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], - checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], - checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], - convertMemberToOutsideCollaborator: [ - "PUT /orgs/{org}/outside_collaborators/{username}" - ], - createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"], - createInvitation: ["POST /orgs/{org}/invitations"], - createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], - createOrUpdateCustomPropertiesValuesForRepos: [ - "PATCH /orgs/{org}/properties/values" - ], - createOrUpdateCustomProperty: [ - "PUT /orgs/{org}/properties/schema/{custom_property_name}" - ], - createWebhook: ["POST /orgs/{org}/hooks"], - delete: ["DELETE /orgs/{org}"], - deleteCustomOrganizationRole: [ - "DELETE /orgs/{org}/organization-roles/{role_id}" - ], - deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], - enableOrDisableSecurityProductOnAllOrgRepos: [ - "POST /orgs/{org}/{security_product}/{enablement}" - ], - get: ["GET /orgs/{org}"], - getAllCustomProperties: ["GET /orgs/{org}/properties/schema"], - getCustomProperty: [ - "GET /orgs/{org}/properties/schema/{custom_property_name}" - ], - getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], - getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], - getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], - getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], - getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], - getWebhookDelivery: [ - "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}" - ], - list: ["GET /organizations"], - listAppInstallations: ["GET /orgs/{org}/installations"], - listBlockedUsers: ["GET /orgs/{org}/blocks"], - listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"], - listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], - listForAuthenticatedUser: ["GET /user/orgs"], - listForUser: ["GET /users/{username}/orgs"], - listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], - listMembers: ["GET /orgs/{org}/members"], - listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], - listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], - listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], - listOrgRoles: ["GET /orgs/{org}/organization-roles"], - listOrganizationFineGrainedPermissions: [ - "GET /orgs/{org}/organization-fine-grained-permissions" - ], - listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], - listPatGrantRepositories: [ - "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" - ], - listPatGrantRequestRepositories: [ - "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories" - ], - listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"], - listPatGrants: ["GET /orgs/{org}/personal-access-tokens"], - listPendingInvitations: ["GET /orgs/{org}/invitations"], - listPublicMembers: ["GET /orgs/{org}/public_members"], - listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], - listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], - listWebhooks: ["GET /orgs/{org}/hooks"], - patchCustomOrganizationRole: [ - "PATCH /orgs/{org}/organization-roles/{role_id}" - ], - pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: [ - "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" - ], - removeCustomProperty: [ - "DELETE /orgs/{org}/properties/schema/{custom_property_name}" - ], - removeMember: ["DELETE /orgs/{org}/members/{username}"], - removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], - removeOutsideCollaborator: [ - "DELETE /orgs/{org}/outside_collaborators/{username}" - ], - removePublicMembershipForAuthenticatedUser: [ - "DELETE /orgs/{org}/public_members/{username}" - ], - removeSecurityManagerTeam: [ - "DELETE /orgs/{org}/security-managers/teams/{team_slug}" - ], - reviewPatGrantRequest: [ - "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}" - ], - reviewPatGrantRequestsInBulk: [ - "POST /orgs/{org}/personal-access-token-requests" - ], - revokeAllOrgRolesTeam: [ - "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" - ], - revokeAllOrgRolesUser: [ - "DELETE /orgs/{org}/organization-roles/users/{username}" - ], - revokeOrgRoleTeam: [ - "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" - ], - revokeOrgRoleUser: [ - "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" - ], - setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], - setPublicMembershipForAuthenticatedUser: [ - "PUT /orgs/{org}/public_members/{username}" - ], - unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], - update: ["PATCH /orgs/{org}"], - updateMembershipForAuthenticatedUser: [ - "PATCH /user/memberships/orgs/{org}" - ], - updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"], - updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"], - updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], - updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] - }, - packages: { - deletePackageForAuthenticatedUser: [ - "DELETE /user/packages/{package_type}/{package_name}" - ], - deletePackageForOrg: [ - "DELETE /orgs/{org}/packages/{package_type}/{package_name}" - ], - deletePackageForUser: [ - "DELETE /users/{username}/packages/{package_type}/{package_name}" - ], - deletePackageVersionForAuthenticatedUser: [ - "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - deletePackageVersionForOrg: [ - "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - deletePackageVersionForUser: [ - "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getAllPackageVersionsForAPackageOwnedByAnOrg: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", - {}, - { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] } - ], - getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions", - {}, - { - renamed: [ - "packages", - "getAllPackageVersionsForPackageOwnedByAuthenticatedUser" - ] - } - ], - getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions" - ], - getAllPackageVersionsForPackageOwnedByOrg: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions" - ], - getAllPackageVersionsForPackageOwnedByUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}/versions" - ], - getPackageForAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}" - ], - getPackageForOrganization: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}" - ], - getPackageForUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}" - ], - getPackageVersionForAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getPackageVersionForOrganization: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getPackageVersionForUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - listDockerMigrationConflictingPackagesForAuthenticatedUser: [ - "GET /user/docker/conflicts" - ], - listDockerMigrationConflictingPackagesForOrganization: [ - "GET /orgs/{org}/docker/conflicts" - ], - listDockerMigrationConflictingPackagesForUser: [ - "GET /users/{username}/docker/conflicts" - ], - listPackagesForAuthenticatedUser: ["GET /user/packages"], - listPackagesForOrganization: ["GET /orgs/{org}/packages"], - listPackagesForUser: ["GET /users/{username}/packages"], - restorePackageForAuthenticatedUser: [ - "POST /user/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageForOrg: [ - "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageForUser: [ - "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageVersionForAuthenticatedUser: [ - "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ], - restorePackageVersionForOrg: [ - "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ], - restorePackageVersionForUser: [ - "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ] - }, - projects: { - addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], - createCard: ["POST /projects/columns/{column_id}/cards"], - createColumn: ["POST /projects/{project_id}/columns"], - createForAuthenticatedUser: ["POST /user/projects"], - createForOrg: ["POST /orgs/{org}/projects"], - createForRepo: ["POST /repos/{owner}/{repo}/projects"], - delete: ["DELETE /projects/{project_id}"], - deleteCard: ["DELETE /projects/columns/cards/{card_id}"], - deleteColumn: ["DELETE /projects/columns/{column_id}"], - get: ["GET /projects/{project_id}"], - getCard: ["GET /projects/columns/cards/{card_id}"], - getColumn: ["GET /projects/columns/{column_id}"], - getPermissionForUser: [ - "GET /projects/{project_id}/collaborators/{username}/permission" - ], - listCards: ["GET /projects/columns/{column_id}/cards"], - listCollaborators: ["GET /projects/{project_id}/collaborators"], - listColumns: ["GET /projects/{project_id}/columns"], - listForOrg: ["GET /orgs/{org}/projects"], - listForRepo: ["GET /repos/{owner}/{repo}/projects"], - listForUser: ["GET /users/{username}/projects"], - moveCard: ["POST /projects/columns/cards/{card_id}/moves"], - moveColumn: ["POST /projects/columns/{column_id}/moves"], - removeCollaborator: [ - "DELETE /projects/{project_id}/collaborators/{username}" - ], - update: ["PATCH /projects/{project_id}"], - updateCard: ["PATCH /projects/columns/cards/{card_id}"], - updateColumn: ["PATCH /projects/columns/{column_id}"] - }, - pulls: { - checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - create: ["POST /repos/{owner}/{repo}/pulls"], - createReplyForReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" - ], - createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - createReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments" - ], - deletePendingReview: [ - "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - deleteReviewComment: [ - "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}" - ], - dismissReview: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" - ], - get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], - getReview: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - list: ["GET /repos/{owner}/{repo}/pulls"], - listCommentsForReview: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments" - ], - listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], - listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], - listRequestedReviewers: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - listReviewComments: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments" - ], - listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], - listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - removeRequestedReviewers: [ - "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - requestReviewers: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - submitReview: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" - ], - update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], - updateBranch: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch" - ], - updateReview: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - updateReviewComment: [ - "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}" - ] - }, - rateLimit: { get: ["GET /rate_limit"] }, - reactions: { - createForCommitComment: [ - "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions" - ], - createForIssue: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions" - ], - createForIssueComment: [ - "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - ], - createForPullRequestReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - ], - createForRelease: [ - "POST /repos/{owner}/{repo}/releases/{release_id}/reactions" - ], - createForTeamDiscussionCommentInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - ], - createForTeamDiscussionInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - ], - deleteForCommitComment: [ - "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForIssue: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}" - ], - deleteForIssueComment: [ - "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForPullRequestComment: [ - "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForRelease: [ - "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}" - ], - deleteForTeamDiscussion: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}" - ], - deleteForTeamDiscussionComment: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}" - ], - listForCommitComment: [ - "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions" - ], - listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - listForIssueComment: [ - "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - ], - listForPullRequestReviewComment: [ - "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - ], - listForRelease: [ - "GET /repos/{owner}/{repo}/releases/{release_id}/reactions" - ], - listForTeamDiscussionCommentInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - ], - listForTeamDiscussionInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - ] - }, - repos: { - acceptInvitation: [ - "PATCH /user/repository_invitations/{invitation_id}", - {}, - { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] } - ], - acceptInvitationForAuthenticatedUser: [ - "PATCH /user/repository_invitations/{invitation_id}" - ], - addAppAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], - addStatusCheckContexts: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - addTeamAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - addUserAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - cancelPagesDeployment: [ - "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" - ], - checkAutomatedSecurityFixes: [ - "GET /repos/{owner}/{repo}/automated-security-fixes" - ], - checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], - checkVulnerabilityAlerts: [ - "GET /repos/{owner}/{repo}/vulnerability-alerts" - ], - codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], - compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], - compareCommitsWithBasehead: [ - "GET /repos/{owner}/{repo}/compare/{basehead}" - ], - createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], - createCommitComment: [ - "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments" - ], - createCommitSignatureProtection: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], - createDeployKey: ["POST /repos/{owner}/{repo}/keys"], - createDeployment: ["POST /repos/{owner}/{repo}/deployments"], - createDeploymentBranchPolicy: [ - "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - ], - createDeploymentProtectionRule: [ - "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - ], - createDeploymentStatus: [ - "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - ], - createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], - createForAuthenticatedUser: ["POST /user/repos"], - createFork: ["POST /repos/{owner}/{repo}/forks"], - createInOrg: ["POST /orgs/{org}/repos"], - createOrUpdateCustomPropertiesValues: [ - "PATCH /repos/{owner}/{repo}/properties/values" - ], - createOrUpdateEnvironment: [ - "PUT /repos/{owner}/{repo}/environments/{environment_name}" - ], - createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], - createOrgRuleset: ["POST /orgs/{org}/rulesets"], - createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], - createPagesSite: ["POST /repos/{owner}/{repo}/pages"], - createRelease: ["POST /repos/{owner}/{repo}/releases"], - createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], - createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], - createUsingTemplate: [ - "POST /repos/{template_owner}/{template_repo}/generate" - ], - createWebhook: ["POST /repos/{owner}/{repo}/hooks"], - declineInvitation: [ - "DELETE /user/repository_invitations/{invitation_id}", - {}, - { renamed: ["repos", "declineInvitationForAuthenticatedUser"] } - ], - declineInvitationForAuthenticatedUser: [ - "DELETE /user/repository_invitations/{invitation_id}" - ], - delete: ["DELETE /repos/{owner}/{repo}"], - deleteAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" - ], - deleteAdminBranchProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - deleteAnEnvironment: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}" - ], - deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], - deleteBranchProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection" - ], - deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], - deleteCommitSignatureProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], - deleteDeployment: [ - "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}" - ], - deleteDeploymentBranchPolicy: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], - deleteInvitation: [ - "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}" - ], - deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"], - deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], - deletePullRequestReviewProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], - deleteReleaseAsset: [ - "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}" - ], - deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - deleteTagProtection: [ - "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}" - ], - deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], - disableAutomatedSecurityFixes: [ - "DELETE /repos/{owner}/{repo}/automated-security-fixes" - ], - disableDeploymentProtectionRule: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" - ], - disablePrivateVulnerabilityReporting: [ - "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting" - ], - disableVulnerabilityAlerts: [ - "DELETE /repos/{owner}/{repo}/vulnerability-alerts" - ], - downloadArchive: [ - "GET /repos/{owner}/{repo}/zipball/{ref}", - {}, - { renamed: ["repos", "downloadZipballArchive"] } - ], - downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], - downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], - enableAutomatedSecurityFixes: [ - "PUT /repos/{owner}/{repo}/automated-security-fixes" - ], - enablePrivateVulnerabilityReporting: [ - "PUT /repos/{owner}/{repo}/private-vulnerability-reporting" - ], - enableVulnerabilityAlerts: [ - "PUT /repos/{owner}/{repo}/vulnerability-alerts" - ], - generateReleaseNotes: [ - "POST /repos/{owner}/{repo}/releases/generate-notes" - ], - get: ["GET /repos/{owner}/{repo}"], - getAccessRestrictions: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" - ], - getAdminBranchProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - getAllDeploymentProtectionRules: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - ], - getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], - getAllStatusCheckContexts: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - ], - getAllTopics: ["GET /repos/{owner}/{repo}/topics"], - getAppsWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - ], - getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], - getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], - getBranchProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection" - ], - getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"], - getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], - getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], - getCollaboratorPermissionLevel: [ - "GET /repos/{owner}/{repo}/collaborators/{username}/permission" - ], - getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], - getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], - getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], - getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], - getCommitSignatureProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], - getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], - getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], - getCustomDeploymentProtectionRule: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" - ], - getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"], - getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], - getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], - getDeploymentBranchPolicy: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - getDeploymentStatus: [ - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" - ], - getEnvironment: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}" - ], - getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], - getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], - getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"], - getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"], - getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"], - getOrgRulesets: ["GET /orgs/{org}/rulesets"], - getPages: ["GET /repos/{owner}/{repo}/pages"], - getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], - getPagesDeployment: [ - "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" - ], - getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], - getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], - getPullRequestReviewProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], - getReadme: ["GET /repos/{owner}/{repo}/readme"], - getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], - getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], - getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], - getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], - getRepoRuleSuite: [ - "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" - ], - getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"], - getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"], - getStatusChecksProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - getTeamsWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - ], - getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], - getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], - getUsersWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - ], - getViews: ["GET /repos/{owner}/{repo}/traffic/views"], - getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], - getWebhookConfigForRepo: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/config" - ], - getWebhookDelivery: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}" - ], - listActivities: ["GET /repos/{owner}/{repo}/activity"], - listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], - listBranches: ["GET /repos/{owner}/{repo}/branches"], - listBranchesForHeadCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head" - ], - listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], - listCommentsForCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments" - ], - listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], - listCommitStatusesForRef: [ - "GET /repos/{owner}/{repo}/commits/{ref}/statuses" - ], - listCommits: ["GET /repos/{owner}/{repo}/commits"], - listContributors: ["GET /repos/{owner}/{repo}/contributors"], - listCustomDeploymentRuleIntegrations: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps" - ], - listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], - listDeploymentBranchPolicies: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - ], - listDeploymentStatuses: [ - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - ], - listDeployments: ["GET /repos/{owner}/{repo}/deployments"], - listForAuthenticatedUser: ["GET /user/repos"], - listForOrg: ["GET /orgs/{org}/repos"], - listForUser: ["GET /users/{username}/repos"], - listForks: ["GET /repos/{owner}/{repo}/forks"], - listInvitations: ["GET /repos/{owner}/{repo}/invitations"], - listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], - listLanguages: ["GET /repos/{owner}/{repo}/languages"], - listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], - listPublic: ["GET /repositories"], - listPullRequestsAssociatedWithCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" - ], - listReleaseAssets: [ - "GET /repos/{owner}/{repo}/releases/{release_id}/assets" - ], - listReleases: ["GET /repos/{owner}/{repo}/releases"], - listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], - listTags: ["GET /repos/{owner}/{repo}/tags"], - listTeams: ["GET /repos/{owner}/{repo}/teams"], - listWebhookDeliveries: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries" - ], - listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], - merge: ["POST /repos/{owner}/{repo}/merges"], - mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], - pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: [ - "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" - ], - removeAppAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - removeCollaborator: [ - "DELETE /repos/{owner}/{repo}/collaborators/{username}" - ], - removeStatusCheckContexts: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - removeStatusCheckProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - removeTeamAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - removeUserAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], - replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], - requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], - setAdminBranchProtection: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - setAppAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - setStatusCheckContexts: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - setTeamAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - setUserAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], - transfer: ["POST /repos/{owner}/{repo}/transfer"], - update: ["PATCH /repos/{owner}/{repo}"], - updateBranchProtection: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection" - ], - updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], - updateDeploymentBranchPolicy: [ - "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], - updateInvitation: [ - "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}" - ], - updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"], - updatePullRequestReviewProtection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], - updateReleaseAsset: [ - "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}" - ], - updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - updateStatusCheckPotection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", - {}, - { renamed: ["repos", "updateStatusCheckProtection"] } - ], - updateStatusCheckProtection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], - updateWebhookConfigForRepo: [ - "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config" - ], - uploadReleaseAsset: [ - "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", - { baseUrl: "https://uploads.github.com" } - ] - }, - search: { - code: ["GET /search/code"], - commits: ["GET /search/commits"], - issuesAndPullRequests: ["GET /search/issues"], - labels: ["GET /search/labels"], - repos: ["GET /search/repositories"], - topics: ["GET /search/topics"], - users: ["GET /search/users"] - }, - secretScanning: { - getAlert: [ - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - ], - listAlertsForEnterprise: [ - "GET /enterprises/{enterprise}/secret-scanning/alerts" - ], - listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], - listLocationsForAlert: [ - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations" - ], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - ] - }, - securityAdvisories: { - createFork: [ - "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" - ], - createPrivateVulnerabilityReport: [ - "POST /repos/{owner}/{repo}/security-advisories/reports" - ], - createRepositoryAdvisory: [ - "POST /repos/{owner}/{repo}/security-advisories" - ], - createRepositoryAdvisoryCveRequest: [ - "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve" - ], - getGlobalAdvisory: ["GET /advisories/{ghsa_id}"], - getRepositoryAdvisory: [ - "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}" - ], - listGlobalAdvisories: ["GET /advisories"], - listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"], - listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"], - updateRepositoryAdvisory: [ - "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}" - ] - }, - teams: { - addOrUpdateMembershipForUserInOrg: [ - "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - addOrUpdateProjectPermissionsInOrg: [ - "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}" - ], - addOrUpdateRepoPermissionsInOrg: [ - "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - checkPermissionsForProjectInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}" - ], - checkPermissionsForRepoInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - create: ["POST /orgs/{org}/teams"], - createDiscussionCommentInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - ], - createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], - deleteDiscussionCommentInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - deleteDiscussionInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], - getByName: ["GET /orgs/{org}/teams/{team_slug}"], - getDiscussionCommentInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - getDiscussionInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - getMembershipForUserInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - list: ["GET /orgs/{org}/teams"], - listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], - listDiscussionCommentsInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - ], - listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], - listForAuthenticatedUser: ["GET /user/teams"], - listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], - listPendingInvitationsInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/invitations" - ], - listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], - listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], - removeMembershipForUserInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - removeProjectInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}" - ], - removeRepoInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - updateDiscussionCommentInOrg: [ - "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - updateDiscussionInOrg: [ - "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] - }, - users: { - addEmailForAuthenticated: [ - "POST /user/emails", - {}, - { renamed: ["users", "addEmailForAuthenticatedUser"] } - ], - addEmailForAuthenticatedUser: ["POST /user/emails"], - addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"], - block: ["PUT /user/blocks/{username}"], - checkBlocked: ["GET /user/blocks/{username}"], - checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], - checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], - createGpgKeyForAuthenticated: [ - "POST /user/gpg_keys", - {}, - { renamed: ["users", "createGpgKeyForAuthenticatedUser"] } - ], - createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], - createPublicSshKeyForAuthenticated: [ - "POST /user/keys", - {}, - { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] } - ], - createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], - createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"], - deleteEmailForAuthenticated: [ - "DELETE /user/emails", - {}, - { renamed: ["users", "deleteEmailForAuthenticatedUser"] } - ], - deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], - deleteGpgKeyForAuthenticated: [ - "DELETE /user/gpg_keys/{gpg_key_id}", - {}, - { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] } - ], - deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], - deletePublicSshKeyForAuthenticated: [ - "DELETE /user/keys/{key_id}", - {}, - { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] } - ], - deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], - deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"], - deleteSshSigningKeyForAuthenticatedUser: [ - "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" - ], - follow: ["PUT /user/following/{username}"], - getAuthenticated: ["GET /user"], - getByUsername: ["GET /users/{username}"], - getContextForUser: ["GET /users/{username}/hovercard"], - getGpgKeyForAuthenticated: [ - "GET /user/gpg_keys/{gpg_key_id}", - {}, - { renamed: ["users", "getGpgKeyForAuthenticatedUser"] } - ], - getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], - getPublicSshKeyForAuthenticated: [ - "GET /user/keys/{key_id}", - {}, - { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] } - ], - getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], - getSshSigningKeyForAuthenticatedUser: [ - "GET /user/ssh_signing_keys/{ssh_signing_key_id}" - ], - list: ["GET /users"], - listBlockedByAuthenticated: [ - "GET /user/blocks", - {}, - { renamed: ["users", "listBlockedByAuthenticatedUser"] } - ], - listBlockedByAuthenticatedUser: ["GET /user/blocks"], - listEmailsForAuthenticated: [ - "GET /user/emails", - {}, - { renamed: ["users", "listEmailsForAuthenticatedUser"] } - ], - listEmailsForAuthenticatedUser: ["GET /user/emails"], - listFollowedByAuthenticated: [ - "GET /user/following", - {}, - { renamed: ["users", "listFollowedByAuthenticatedUser"] } - ], - listFollowedByAuthenticatedUser: ["GET /user/following"], - listFollowersForAuthenticatedUser: ["GET /user/followers"], - listFollowersForUser: ["GET /users/{username}/followers"], - listFollowingForUser: ["GET /users/{username}/following"], - listGpgKeysForAuthenticated: [ - "GET /user/gpg_keys", - {}, - { renamed: ["users", "listGpgKeysForAuthenticatedUser"] } - ], - listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], - listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], - listPublicEmailsForAuthenticated: [ - "GET /user/public_emails", - {}, - { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] } - ], - listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], - listPublicKeysForUser: ["GET /users/{username}/keys"], - listPublicSshKeysForAuthenticated: [ - "GET /user/keys", - {}, - { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] } - ], - listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], - listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"], - listSocialAccountsForUser: ["GET /users/{username}/social_accounts"], - listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"], - listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"], - setPrimaryEmailVisibilityForAuthenticated: [ - "PATCH /user/email/visibility", - {}, - { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] } - ], - setPrimaryEmailVisibilityForAuthenticatedUser: [ - "PATCH /user/email/visibility" - ], - unblock: ["DELETE /user/blocks/{username}"], - unfollow: ["DELETE /user/following/{username}"], - updateAuthenticated: ["PATCH /user"] - } - }; - var endpoints_default2 = Endpoints2; - var endpointMethodsMap2 = /* @__PURE__ */ new Map(); - for (const [scope, endpoints] of Object.entries(endpoints_default2)) { - for (const [methodName, endpoint2] of Object.entries(endpoints)) { - const [route, defaults3, decorations] = endpoint2; - const [method, url2] = route.split(/ /); - const endpointDefaults = Object.assign( - { - method, - url: url2 - }, - defaults3 - ); - if (!endpointMethodsMap2.has(scope)) { - endpointMethodsMap2.set(scope, /* @__PURE__ */ new Map()); - } - endpointMethodsMap2.get(scope).set(methodName, { - scope, - methodName, - endpointDefaults, - decorations - }); - } - } - var handler2 = { - has({ scope }, methodName) { - return endpointMethodsMap2.get(scope).has(methodName); - }, - getOwnPropertyDescriptor(target, methodName) { - return { - value: this.get(target, methodName), - // ensures method is in the cache - configurable: true, - writable: true, - enumerable: true - }; - }, - defineProperty(target, methodName, descriptor) { - Object.defineProperty(target.cache, methodName, descriptor); - return true; - }, - deleteProperty(target, methodName) { - delete target.cache[methodName]; - return true; - }, - ownKeys({ scope }) { - return [...endpointMethodsMap2.get(scope).keys()]; - }, - set(target, methodName, value) { - return target.cache[methodName] = value; - }, - get({ octokit, scope, cache }, methodName) { - if (cache[methodName]) { - return cache[methodName]; - } - const method = endpointMethodsMap2.get(scope).get(methodName); - if (!method) { - return void 0; - } - const { endpointDefaults, decorations } = method; - if (decorations) { - cache[methodName] = decorate2( - octokit, - scope, - methodName, - endpointDefaults, - decorations - ); - } else { - cache[methodName] = octokit.request.defaults(endpointDefaults); - } - return cache[methodName]; - } - }; - function endpointsToMethods2(octokit) { - const newMethods = {}; - for (const scope of endpointMethodsMap2.keys()) { - newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler2); - } - return newMethods; - } - function decorate2(octokit, scope, methodName, defaults3, decorations) { - const requestWithDefaults = octokit.request.defaults(defaults3); - function withDecorations(...args) { - let options = requestWithDefaults.endpoint.merge(...args); - if (decorations.mapToData) { - options = Object.assign({}, options, { - data: options[decorations.mapToData], - [decorations.mapToData]: void 0 - }); - return requestWithDefaults(options); - } - if (decorations.renamed) { - const [newScope, newMethodName] = decorations.renamed; - octokit.log.warn( - `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()` - ); - } - if (decorations.deprecated) { - octokit.log.warn(decorations.deprecated); - } - if (decorations.renamedParameters) { - const options2 = requestWithDefaults.endpoint.merge(...args); - for (const [name, alias] of Object.entries( - decorations.renamedParameters - )) { - if (name in options2) { - octokit.log.warn( - `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead` - ); - if (!(alias in options2)) { - options2[alias] = options2[name]; - } - delete options2[name]; - } - } - return requestWithDefaults(options2); - } - return requestWithDefaults(...args); - } - return Object.assign(withDecorations, requestWithDefaults); - } - function restEndpointMethods2(octokit) { - const api = endpointsToMethods2(octokit); - return { - rest: api - }; - } - restEndpointMethods2.VERSION = VERSION8; - function legacyRestEndpointMethods2(octokit) { - const api = endpointsToMethods2(octokit); - return { - ...api, - rest: api - }; - } - legacyRestEndpointMethods2.VERSION = VERSION8; - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js -var require_dist_node10 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports3 = {}; - __export2(dist_src_exports3, { - composePaginateRest: () => composePaginateRest2, - isPaginatingEndpoint: () => isPaginatingEndpoint2, - paginateRest: () => paginateRest2, - paginatingEndpoints: () => paginatingEndpoints2 - }); - module2.exports = __toCommonJS2(dist_src_exports3); - var VERSION8 = "9.2.2"; - function normalizePaginatedListResponse2(response) { - if (!response.data) { - return { - ...response, - data: [] - }; - } - const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); - if (!responseNeedsNormalization) - return response; - const incompleteResults = response.data.incomplete_results; - const repositorySelection = response.data.repository_selection; - const totalCount = response.data.total_count; - delete response.data.incomplete_results; - delete response.data.repository_selection; - delete response.data.total_count; - const namespaceKey = Object.keys(response.data)[0]; - const data = response.data[namespaceKey]; - response.data = data; - if (typeof incompleteResults !== "undefined") { - response.data.incomplete_results = incompleteResults; - } - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; - } - response.data.total_count = totalCount; - return response; - } - function iterator2(octokit, route, parameters) { - const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); - const requestMethod = typeof route === "function" ? route : octokit.request; - const method = options.method; - const headers = options.headers; - let url2 = options.url; - return { - [Symbol.asyncIterator]: () => ({ - async next() { - if (!url2) - return { done: true }; - try { - const response = await requestMethod({ method, url: url2, headers }); - const normalizedResponse = normalizePaginatedListResponse2(response); - url2 = ((normalizedResponse.headers.link || "").match( - /<([^<>]+)>;\s*rel="next"/ - ) || [])[1]; - return { value: normalizedResponse }; - } catch (error3) { - if (error3.status !== 409) - throw error3; - url2 = ""; - return { - value: { - status: 200, - headers: {}, - data: [] - } - }; - } - } - }) - }; - } - function paginate2(octokit, route, parameters, mapFn) { - if (typeof parameters === "function") { - mapFn = parameters; - parameters = void 0; - } - return gather2( - octokit, - [], - iterator2(octokit, route, parameters)[Symbol.asyncIterator](), - mapFn - ); - } - function gather2(octokit, results, iterator22, mapFn) { - return iterator22.next().then((result) => { - if (result.done) { - return results; - } - let earlyExit = false; - function done() { - earlyExit = true; - } - results = results.concat( - mapFn ? mapFn(result.value, done) : result.value.data - ); - if (earlyExit) { - return results; - } - return gather2(octokit, results, iterator22, mapFn); - }); - } - var composePaginateRest2 = Object.assign(paginate2, { - iterator: iterator2 - }); - var paginatingEndpoints2 = [ - "GET /advisories", - "GET /app/hook/deliveries", - "GET /app/installation-requests", - "GET /app/installations", - "GET /assignments/{assignment_id}/accepted_assignments", - "GET /classrooms", - "GET /classrooms/{classroom_id}/assignments", - "GET /enterprises/{enterprise}/dependabot/alerts", - "GET /enterprises/{enterprise}/secret-scanning/alerts", - "GET /events", - "GET /gists", - "GET /gists/public", - "GET /gists/starred", - "GET /gists/{gist_id}/comments", - "GET /gists/{gist_id}/commits", - "GET /gists/{gist_id}/forks", - "GET /installation/repositories", - "GET /issues", - "GET /licenses", - "GET /marketplace_listing/plans", - "GET /marketplace_listing/plans/{plan_id}/accounts", - "GET /marketplace_listing/stubbed/plans", - "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", - "GET /networks/{owner}/{repo}/events", - "GET /notifications", - "GET /organizations", - "GET /orgs/{org}/actions/cache/usage-by-repository", - "GET /orgs/{org}/actions/permissions/repositories", - "GET /orgs/{org}/actions/runners", - "GET /orgs/{org}/actions/secrets", - "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", - "GET /orgs/{org}/actions/variables", - "GET /orgs/{org}/actions/variables/{name}/repositories", - "GET /orgs/{org}/blocks", - "GET /orgs/{org}/code-scanning/alerts", - "GET /orgs/{org}/codespaces", - "GET /orgs/{org}/codespaces/secrets", - "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories", - "GET /orgs/{org}/copilot/billing/seats", - "GET /orgs/{org}/dependabot/alerts", - "GET /orgs/{org}/dependabot/secrets", - "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", - "GET /orgs/{org}/events", - "GET /orgs/{org}/failed_invitations", - "GET /orgs/{org}/hooks", - "GET /orgs/{org}/hooks/{hook_id}/deliveries", - "GET /orgs/{org}/installations", - "GET /orgs/{org}/invitations", - "GET /orgs/{org}/invitations/{invitation_id}/teams", - "GET /orgs/{org}/issues", - "GET /orgs/{org}/members", - "GET /orgs/{org}/members/{username}/codespaces", - "GET /orgs/{org}/migrations", - "GET /orgs/{org}/migrations/{migration_id}/repositories", - "GET /orgs/{org}/organization-roles/{role_id}/teams", - "GET /orgs/{org}/organization-roles/{role_id}/users", - "GET /orgs/{org}/outside_collaborators", - "GET /orgs/{org}/packages", - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", - "GET /orgs/{org}/personal-access-token-requests", - "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories", - "GET /orgs/{org}/personal-access-tokens", - "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories", - "GET /orgs/{org}/projects", - "GET /orgs/{org}/properties/values", - "GET /orgs/{org}/public_members", - "GET /orgs/{org}/repos", - "GET /orgs/{org}/rulesets", - "GET /orgs/{org}/rulesets/rule-suites", - "GET /orgs/{org}/secret-scanning/alerts", - "GET /orgs/{org}/security-advisories", - "GET /orgs/{org}/teams", - "GET /orgs/{org}/teams/{team_slug}/discussions", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", - "GET /orgs/{org}/teams/{team_slug}/invitations", - "GET /orgs/{org}/teams/{team_slug}/members", - "GET /orgs/{org}/teams/{team_slug}/projects", - "GET /orgs/{org}/teams/{team_slug}/repos", - "GET /orgs/{org}/teams/{team_slug}/teams", - "GET /projects/columns/{column_id}/cards", - "GET /projects/{project_id}/collaborators", - "GET /projects/{project_id}/columns", - "GET /repos/{owner}/{repo}/actions/artifacts", - "GET /repos/{owner}/{repo}/actions/caches", - "GET /repos/{owner}/{repo}/actions/organization-secrets", - "GET /repos/{owner}/{repo}/actions/organization-variables", - "GET /repos/{owner}/{repo}/actions/runners", - "GET /repos/{owner}/{repo}/actions/runs", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", - "GET /repos/{owner}/{repo}/actions/secrets", - "GET /repos/{owner}/{repo}/actions/variables", - "GET /repos/{owner}/{repo}/actions/workflows", - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", - "GET /repos/{owner}/{repo}/activity", - "GET /repos/{owner}/{repo}/assignees", - "GET /repos/{owner}/{repo}/branches", - "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", - "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", - "GET /repos/{owner}/{repo}/code-scanning/alerts", - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", - "GET /repos/{owner}/{repo}/code-scanning/analyses", - "GET /repos/{owner}/{repo}/codespaces", - "GET /repos/{owner}/{repo}/codespaces/devcontainers", - "GET /repos/{owner}/{repo}/codespaces/secrets", - "GET /repos/{owner}/{repo}/collaborators", - "GET /repos/{owner}/{repo}/comments", - "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/commits", - "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", - "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", - "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", - "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", - "GET /repos/{owner}/{repo}/commits/{ref}/status", - "GET /repos/{owner}/{repo}/commits/{ref}/statuses", - "GET /repos/{owner}/{repo}/contributors", - "GET /repos/{owner}/{repo}/dependabot/alerts", - "GET /repos/{owner}/{repo}/dependabot/secrets", - "GET /repos/{owner}/{repo}/deployments", - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", - "GET /repos/{owner}/{repo}/environments", - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies", - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps", - "GET /repos/{owner}/{repo}/events", - "GET /repos/{owner}/{repo}/forks", - "GET /repos/{owner}/{repo}/hooks", - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", - "GET /repos/{owner}/{repo}/invitations", - "GET /repos/{owner}/{repo}/issues", - "GET /repos/{owner}/{repo}/issues/comments", - "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/issues/events", - "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", - "GET /repos/{owner}/{repo}/issues/{issue_number}/events", - "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", - "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", - "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", - "GET /repos/{owner}/{repo}/keys", - "GET /repos/{owner}/{repo}/labels", - "GET /repos/{owner}/{repo}/milestones", - "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", - "GET /repos/{owner}/{repo}/notifications", - "GET /repos/{owner}/{repo}/pages/builds", - "GET /repos/{owner}/{repo}/projects", - "GET /repos/{owner}/{repo}/pulls", - "GET /repos/{owner}/{repo}/pulls/comments", - "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", - "GET /repos/{owner}/{repo}/releases", - "GET /repos/{owner}/{repo}/releases/{release_id}/assets", - "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", - "GET /repos/{owner}/{repo}/rules/branches/{branch}", - "GET /repos/{owner}/{repo}/rulesets", - "GET /repos/{owner}/{repo}/rulesets/rule-suites", - "GET /repos/{owner}/{repo}/secret-scanning/alerts", - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", - "GET /repos/{owner}/{repo}/security-advisories", - "GET /repos/{owner}/{repo}/stargazers", - "GET /repos/{owner}/{repo}/subscribers", - "GET /repos/{owner}/{repo}/tags", - "GET /repos/{owner}/{repo}/teams", - "GET /repos/{owner}/{repo}/topics", - "GET /repositories", - "GET /repositories/{repository_id}/environments/{environment_name}/secrets", - "GET /repositories/{repository_id}/environments/{environment_name}/variables", - "GET /search/code", - "GET /search/commits", - "GET /search/issues", - "GET /search/labels", - "GET /search/repositories", - "GET /search/topics", - "GET /search/users", - "GET /teams/{team_id}/discussions", - "GET /teams/{team_id}/discussions/{discussion_number}/comments", - "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", - "GET /teams/{team_id}/discussions/{discussion_number}/reactions", - "GET /teams/{team_id}/invitations", - "GET /teams/{team_id}/members", - "GET /teams/{team_id}/projects", - "GET /teams/{team_id}/repos", - "GET /teams/{team_id}/teams", - "GET /user/blocks", - "GET /user/codespaces", - "GET /user/codespaces/secrets", - "GET /user/emails", - "GET /user/followers", - "GET /user/following", - "GET /user/gpg_keys", - "GET /user/installations", - "GET /user/installations/{installation_id}/repositories", - "GET /user/issues", - "GET /user/keys", - "GET /user/marketplace_purchases", - "GET /user/marketplace_purchases/stubbed", - "GET /user/memberships/orgs", - "GET /user/migrations", - "GET /user/migrations/{migration_id}/repositories", - "GET /user/orgs", - "GET /user/packages", - "GET /user/packages/{package_type}/{package_name}/versions", - "GET /user/public_emails", - "GET /user/repos", - "GET /user/repository_invitations", - "GET /user/social_accounts", - "GET /user/ssh_signing_keys", - "GET /user/starred", - "GET /user/subscriptions", - "GET /user/teams", - "GET /users", - "GET /users/{username}/events", - "GET /users/{username}/events/orgs/{org}", - "GET /users/{username}/events/public", - "GET /users/{username}/followers", - "GET /users/{username}/following", - "GET /users/{username}/gists", - "GET /users/{username}/gpg_keys", - "GET /users/{username}/keys", - "GET /users/{username}/orgs", - "GET /users/{username}/packages", - "GET /users/{username}/projects", - "GET /users/{username}/received_events", - "GET /users/{username}/received_events/public", - "GET /users/{username}/repos", - "GET /users/{username}/social_accounts", - "GET /users/{username}/ssh_signing_keys", - "GET /users/{username}/starred", - "GET /users/{username}/subscriptions" - ]; - function isPaginatingEndpoint2(arg) { - if (typeof arg === "string") { - return paginatingEndpoints2.includes(arg); - } else { - return false; - } - } - function paginateRest2(octokit) { - return { - paginate: Object.assign(paginate2.bind(null, octokit), { - iterator: iterator2.bind(null, octokit) - }) - }; - } - paginateRest2.VERSION = VERSION8; - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/github/lib/utils.js -var require_utils9 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/github/lib/utils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar2(require_context2()); - var Utils = __importStar2(require_utils8()); - var core_1 = require_dist_node8(); - var plugin_rest_endpoint_methods_1 = require_dist_node9(); - var plugin_paginate_rest_1 = require_dist_node10(); - exports2.context = new Context.Context(); - var baseUrl = Utils.getApiBaseUrl(); - exports2.defaults = { - baseUrl, - request: { - agent: Utils.getProxyAgent(baseUrl), - fetch: Utils.getProxyFetch(baseUrl) - } - }; - exports2.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports2.defaults); - function getOctokitOptions2(token, options) { - const opts = Object.assign({}, options || {}); - const auth2 = Utils.getAuthString(token, opts); - if (auth2) { - opts.auth = auth2; - } - return opts; - } - exports2.getOctokitOptions = getOctokitOptions2; - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/github/lib/github.js -var require_github2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/github/lib/github.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOctokit = exports2.context = void 0; - var Context = __importStar2(require_context2()); - var utils_1 = require_utils9(); - exports2.context = new Context.Context(); - function getOctokit(token, options, ...additionalPlugins) { - const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins); - return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options)); - } - exports2.getOctokit = getOctokit; - } -}); - -// node_modules/traverse/index.js -var require_traverse = __commonJS({ - "node_modules/traverse/index.js"(exports2, module2) { - module2.exports = Traverse; - function Traverse(obj) { - if (!(this instanceof Traverse)) return new Traverse(obj); - this.value = obj; - } - Traverse.prototype.get = function(ps) { - var node = this.value; - for (var i = 0; i < ps.length; i++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) { - node = void 0; - break; - } - node = node[key]; - } - return node; - }; - Traverse.prototype.set = function(ps, value) { - var node = this.value; - for (var i = 0; i < ps.length - 1; i++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; - node = node[key]; - } - node[ps[i]] = value; - return value; - }; - Traverse.prototype.map = function(cb) { - return walk(this.value, cb, true); - }; - Traverse.prototype.forEach = function(cb) { - this.value = walk(this.value, cb, false); - return this.value; - }; - Traverse.prototype.reduce = function(cb, init2) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init2; - this.forEach(function(x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; - }; - Traverse.prototype.deepEqual = function(obj) { - if (arguments.length !== 1) { - throw new Error( - "deepEqual requires exactly one object to compare against" - ); - } - var equal = true; - var node = obj; - this.forEach(function(y) { - var notEqual = (function() { - equal = false; - return void 0; - }).bind(this); - if (!this.isRoot) { - if (typeof node !== "object") return notEqual(); - node = node[this.key]; - } - var x = node; - this.post(function() { - node = x; - }); - var toS = function(o) { - return Object.prototype.toString.call(o); - }; - if (this.circular) { - if (Traverse(obj).get(this.circular.path) !== x) notEqual(); - } else if (typeof x !== typeof y) { - notEqual(); - } else if (x === null || y === null || x === void 0 || y === void 0) { - if (x !== y) notEqual(); - } else if (x.__proto__ !== y.__proto__) { - notEqual(); - } else if (x === y) { - } else if (typeof x === "function") { - if (x instanceof RegExp) { - if (x.toString() != y.toString()) notEqual(); - } else if (x !== y) notEqual(); - } else if (typeof x === "object") { - if (toS(y) === "[object Arguments]" || toS(x) === "[object Arguments]") { - if (toS(x) !== toS(y)) { - notEqual(); - } - } else if (x instanceof Date || y instanceof Date) { - if (!(x instanceof Date) || !(y instanceof Date) || x.getTime() !== y.getTime()) { - notEqual(); - } - } else { - var kx = Object.keys(x); - var ky = Object.keys(y); - if (kx.length !== ky.length) return notEqual(); - for (var i = 0; i < kx.length; i++) { - var k = kx[i]; - if (!Object.hasOwnProperty.call(y, k)) { - notEqual(); - } - } - } - } - }); - return equal; - }; - Traverse.prototype.paths = function() { - var acc = []; - this.forEach(function(x) { - acc.push(this.path); - }); - return acc; - }; - Traverse.prototype.nodes = function() { - var acc = []; - this.forEach(function(x) { - acc.push(this.node); - }); - return acc; - }; - Traverse.prototype.clone = function() { - var parents = [], nodes = []; - return (function clone(src) { - for (var i = 0; i < parents.length; i++) { - if (parents[i] === src) { - return nodes[i]; - } - } - if (typeof src === "object" && src !== null) { - var dst = copy(src); - parents.push(src); - nodes.push(dst); - Object.keys(src).forEach(function(key) { - dst[key] = clone(src[key]); - }); - parents.pop(); - nodes.pop(); - return dst; - } else { - return src; - } - })(this.value); - }; - function walk(root, cb, immutable) { - var path30 = []; - var parents = []; - var alive = true; - return (function walker(node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - var state = { - node, - node_, - path: [].concat(path30), - parent: parents.slice(-1)[0], - key: path30.slice(-1)[0], - isRoot: path30.length === 0, - level: path30.length, - circular: null, - update: function(x) { - if (!state.isRoot) { - state.parent.node[state.key] = x; - } - state.node = x; - }, - "delete": function() { - delete state.parent.node[state.key]; - }, - remove: function() { - if (Array.isArray(state.parent.node)) { - state.parent.node.splice(state.key, 1); - } else { - delete state.parent.node[state.key]; - } - }, - before: function(f) { - modifiers.before = f; - }, - after: function(f) { - modifiers.after = f; - }, - pre: function(f) { - modifiers.pre = f; - }, - post: function(f) { - modifiers.post = f; - }, - stop: function() { - alive = false; - } - }; - if (!alive) return state; - if (typeof node === "object" && node !== null) { - state.isLeaf = Object.keys(node).length == 0; - for (var i = 0; i < parents.length; i++) { - if (parents[i].node_ === node_) { - state.circular = parents[i]; - break; - } - } - } else { - state.isLeaf = true; - } - state.notLeaf = !state.isLeaf; - state.notRoot = !state.isRoot; - var ret = cb.call(state, state.node); - if (ret !== void 0 && state.update) state.update(ret); - if (modifiers.before) modifiers.before.call(state, state.node); - if (typeof state.node == "object" && state.node !== null && !state.circular) { - parents.push(state); - var keys = Object.keys(state.node); - keys.forEach(function(key, i2) { - path30.push(key); - if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); - var child = walker(state.node[key]); - if (immutable && Object.hasOwnProperty.call(state.node, key)) { - state.node[key] = child.node; - } - child.isLast = i2 == keys.length - 1; - child.isFirst = i2 == 0; - if (modifiers.post) modifiers.post.call(state, child); - path30.pop(); - }); - parents.pop(); - } - if (modifiers.after) modifiers.after.call(state, state.node); - return state; - })(root).node; - } - Object.keys(Traverse.prototype).forEach(function(key) { - Traverse[key] = function(obj) { - var args = [].slice.call(arguments, 1); - var t = Traverse(obj); - return t[key].apply(t, args); - }; - }); - function copy(src) { - if (typeof src === "object" && src !== null) { - var dst; - if (Array.isArray(src)) { - dst = []; - } else if (src instanceof Date) { - dst = new Date(src); - } else if (src instanceof Boolean) { - dst = new Boolean(src); - } else if (src instanceof Number) { - dst = new Number(src); - } else if (src instanceof String) { - dst = new String(src); - } else { - dst = Object.create(Object.getPrototypeOf(src)); - } - Object.keys(src).forEach(function(key) { - dst[key] = src[key]; - }); - return dst; - } else return src; - } - } -}); - -// node_modules/chainsaw/index.js -var require_chainsaw = __commonJS({ - "node_modules/chainsaw/index.js"(exports2, module2) { - var Traverse = require_traverse(); - var EventEmitter2 = require("events").EventEmitter; - module2.exports = Chainsaw; - function Chainsaw(builder) { - var saw = Chainsaw.saw(builder, {}); - var r = builder.call(saw.handlers, saw); - if (r !== void 0) saw.handlers = r; - saw.record(); - return saw.chain(); - } - Chainsaw.light = function ChainsawLight(builder) { - var saw = Chainsaw.saw(builder, {}); - var r = builder.call(saw.handlers, saw); - if (r !== void 0) saw.handlers = r; - return saw.chain(); - }; - Chainsaw.saw = function(builder, handlers) { - var saw = new EventEmitter2(); - saw.handlers = handlers; - saw.actions = []; - saw.chain = function() { - var ch = Traverse(saw.handlers).map(function(node) { - if (this.isRoot) return node; - var ps = this.path; - if (typeof node === "function") { - this.update(function() { - saw.actions.push({ - path: ps, - args: [].slice.call(arguments) - }); - return ch; - }); - } - }); - process.nextTick(function() { - saw.emit("begin"); - saw.next(); - }); - return ch; - }; - saw.pop = function() { - return saw.actions.shift(); - }; - saw.next = function() { - var action = saw.pop(); - if (!action) { - saw.emit("end"); - } else if (!action.trap) { - var node = saw.handlers; - action.path.forEach(function(key) { - node = node[key]; - }); - node.apply(saw.handlers, action.args); - } - }; - saw.nest = function(cb) { - var args = [].slice.call(arguments, 1); - var autonext = true; - if (typeof cb === "boolean") { - var autonext = cb; - cb = args.shift(); - } - var s = Chainsaw.saw(builder, {}); - var r = builder.call(s.handlers, s); - if (r !== void 0) s.handlers = r; - if ("undefined" !== typeof saw.step) { - s.record(); - } - cb.apply(s.chain(), args); - if (autonext !== false) s.on("end", saw.next); - }; - saw.record = function() { - upgradeChainsaw(saw); - }; - ["trap", "down", "jump"].forEach(function(method) { - saw[method] = function() { - throw new Error("To use the trap, down and jump features, please call record() first to start recording actions."); - }; - }); - return saw; - }; - function upgradeChainsaw(saw) { - saw.step = 0; - saw.pop = function() { - return saw.actions[saw.step++]; - }; - saw.trap = function(name, cb) { - var ps = Array.isArray(name) ? name : [name]; - saw.actions.push({ - path: ps, - step: saw.step, - cb, - trap: true - }); - }; - saw.down = function(name) { - var ps = (Array.isArray(name) ? name : [name]).join("/"); - var i = saw.actions.slice(saw.step).map(function(x) { - if (x.trap && x.step <= saw.step) return false; - return x.path.join("/") == ps; - }).indexOf(true); - if (i >= 0) saw.step += i; - else saw.step = saw.actions.length; - var act = saw.actions[saw.step - 1]; - if (act && act.trap) { - saw.step = act.step; - act.cb(); - } else saw.next(); - }; - saw.jump = function(step) { - saw.step = step; - saw.next(); - }; - } - } -}); - -// node_modules/buffers/index.js -var require_buffers = __commonJS({ - "node_modules/buffers/index.js"(exports2, module2) { - module2.exports = Buffers; - function Buffers(bufs) { - if (!(this instanceof Buffers)) return new Buffers(bufs); - this.buffers = bufs || []; - this.length = this.buffers.reduce(function(size, buf) { - return size + buf.length; - }, 0); - } - Buffers.prototype.push = function() { - for (var i = 0; i < arguments.length; i++) { - if (!Buffer.isBuffer(arguments[i])) { - throw new TypeError("Tried to push a non-buffer"); - } - } - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.push(buf); - this.length += buf.length; - } - return this.length; - }; - Buffers.prototype.unshift = function() { - for (var i = 0; i < arguments.length; i++) { - if (!Buffer.isBuffer(arguments[i])) { - throw new TypeError("Tried to unshift a non-buffer"); - } - } - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.unshift(buf); - this.length += buf.length; - } - return this.length; - }; - Buffers.prototype.copy = function(dst, dStart, start, end) { - return this.slice(start, end).copy(dst, dStart, 0, end - start); - }; - Buffers.prototype.splice = function(i, howMany) { - var buffers = this.buffers; - var index2 = i >= 0 ? i : this.length - i; - var reps = [].slice.call(arguments, 2); - if (howMany === void 0) { - howMany = this.length - index2; - } else if (howMany > this.length - index2) { - howMany = this.length - index2; - } - for (var i = 0; i < reps.length; i++) { - this.length += reps[i].length; - } - var removed = new Buffers(); - var bytes = 0; - var startBytes = 0; - for (var ii = 0; ii < buffers.length && startBytes + buffers[ii].length < index2; ii++) { - startBytes += buffers[ii].length; - } - if (index2 - startBytes > 0) { - var start = index2 - startBytes; - if (start + howMany < buffers[ii].length) { - removed.push(buffers[ii].slice(start, start + howMany)); - var orig = buffers[ii]; - var buf0 = new Buffer(start); - for (var i = 0; i < start; i++) { - buf0[i] = orig[i]; - } - var buf1 = new Buffer(orig.length - start - howMany); - for (var i = start + howMany; i < orig.length; i++) { - buf1[i - howMany - start] = orig[i]; - } - if (reps.length > 0) { - var reps_ = reps.slice(); - reps_.unshift(buf0); - reps_.push(buf1); - buffers.splice.apply(buffers, [ii, 1].concat(reps_)); - ii += reps_.length; - reps = []; - } else { - buffers.splice(ii, 1, buf0, buf1); - ii += 2; - } - } else { - removed.push(buffers[ii].slice(start)); - buffers[ii] = buffers[ii].slice(0, start); - ii++; - } - } - if (reps.length > 0) { - buffers.splice.apply(buffers, [ii, 0].concat(reps)); - ii += reps.length; - } - while (removed.length < howMany) { - var buf = buffers[ii]; - var len = buf.length; - var take = Math.min(len, howMany - removed.length); - if (take === len) { - removed.push(buf); - buffers.splice(ii, 1); - } else { - removed.push(buf.slice(0, take)); - buffers[ii] = buffers[ii].slice(take); - } - } - this.length -= removed.length; - return removed; - }; - Buffers.prototype.slice = function(i, j) { - var buffers = this.buffers; - if (j === void 0) j = this.length; - if (i === void 0) i = 0; - if (j > this.length) j = this.length; - var startBytes = 0; - for (var si = 0; si < buffers.length && startBytes + buffers[si].length <= i; si++) { - startBytes += buffers[si].length; - } - var target = new Buffer(j - i); - var ti = 0; - for (var ii = si; ti < j - i && ii < buffers.length; ii++) { - var len = buffers[ii].length; - var start = ti === 0 ? i - startBytes : 0; - var end = ti + len >= j - i ? Math.min(start + (j - i) - ti, len) : len; - buffers[ii].copy(target, ti, start, end); - ti += end - start; - } - return target; - }; - Buffers.prototype.pos = function(i) { - if (i < 0 || i >= this.length) throw new Error("oob"); - var l = i, bi = 0, bu = null; - for (; ; ) { - bu = this.buffers[bi]; - if (l < bu.length) { - return { buf: bi, offset: l }; - } else { - l -= bu.length; - } - bi++; - } - }; - Buffers.prototype.get = function get(i) { - var pos = this.pos(i); - return this.buffers[pos.buf].get(pos.offset); - }; - Buffers.prototype.set = function set(i, b) { - var pos = this.pos(i); - return this.buffers[pos.buf].set(pos.offset, b); - }; - Buffers.prototype.indexOf = function(needle, offset) { - if ("string" === typeof needle) { - needle = new Buffer(needle); - } else if (needle instanceof Buffer) { - } else { - throw new Error("Invalid type for a search string"); - } - if (!needle.length) { - return 0; - } - if (!this.length) { - return -1; - } - var i = 0, j = 0, match2 = 0, mstart, pos = 0; - if (offset) { - var p = this.pos(offset); - i = p.buf; - j = p.offset; - pos = offset; - } - for (; ; ) { - while (j >= this.buffers[i].length) { - j = 0; - i++; - if (i >= this.buffers.length) { - return -1; - } - } - var char = this.buffers[i][j]; - if (char == needle[match2]) { - if (match2 == 0) { - mstart = { - i, - j, - pos - }; - } - match2++; - if (match2 == needle.length) { - return mstart.pos; - } - } else if (match2 != 0) { - i = mstart.i; - j = mstart.j; - pos = mstart.pos; - match2 = 0; - } - j++; - pos++; - } - }; - Buffers.prototype.toBuffer = function() { - return this.slice(); - }; - Buffers.prototype.toString = function(encoding, start, end) { - return this.slice(start, end).toString(encoding); - }; - } -}); - -// node_modules/binary/lib/vars.js -var require_vars = __commonJS({ - "node_modules/binary/lib/vars.js"(exports2, module2) { - module2.exports = function(store) { - function getset(name, value) { - var node = vars.store; - var keys = name.split("."); - keys.slice(0, -1).forEach(function(k) { - if (node[k] === void 0) node[k] = {}; - node = node[k]; - }); - var key = keys[keys.length - 1]; - if (arguments.length == 1) { - return node[key]; - } else { - return node[key] = value; - } - } - var vars = { - get: function(name) { - return getset(name); - }, - set: function(name, value) { - return getset(name, value); - }, - store: store || {} - }; - return vars; - }; - } -}); - -// node_modules/binary/index.js -var require_binary = __commonJS({ - "node_modules/binary/index.js"(exports2, module2) { - var Chainsaw = require_chainsaw(); - var EventEmitter2 = require("events").EventEmitter; - var Buffers = require_buffers(); - var Vars = require_vars(); - var Stream = require("stream").Stream; - exports2 = module2.exports = function(bufOrEm, eventName) { - if (Buffer.isBuffer(bufOrEm)) { - return exports2.parse(bufOrEm); - } - var s = exports2.stream(); - if (bufOrEm && bufOrEm.pipe) { - bufOrEm.pipe(s); - } else if (bufOrEm) { - bufOrEm.on(eventName || "data", function(buf) { - s.write(buf); - }); - bufOrEm.on("end", function() { - s.end(); - }); - } - return s; - }; - exports2.stream = function(input) { - if (input) return exports2.apply(null, arguments); - var pending = null; - function getBytes(bytes, cb, skip) { - pending = { - bytes, - skip, - cb: function(buf) { - pending = null; - cb(buf); - } - }; - dispatch(); - } - var offset = null; - function dispatch() { - if (!pending) { - if (caughtEnd) done = true; - return; - } - if (typeof pending === "function") { - pending(); - } else { - var bytes = offset + pending.bytes; - if (buffers.length >= bytes) { - var buf; - if (offset == null) { - buf = buffers.splice(0, bytes); - if (!pending.skip) { - buf = buf.slice(); - } - } else { - if (!pending.skip) { - buf = buffers.slice(offset, bytes); - } - offset = bytes; - } - if (pending.skip) { - pending.cb(); - } else { - pending.cb(buf); - } - } - } - } - function builder(saw) { - function next() { - if (!done) saw.next(); - } - var self2 = words(function(bytes, cb) { - return function(name) { - getBytes(bytes, function(buf) { - vars.set(name, cb(buf)); - next(); - }); - }; - }); - self2.tap = function(cb) { - saw.nest(cb, vars.store); - }; - self2.into = function(key, cb) { - if (!vars.get(key)) vars.set(key, {}); - var parent = vars; - vars = Vars(parent.get(key)); - saw.nest(function() { - cb.apply(this, arguments); - this.tap(function() { - vars = parent; - }); - }, vars.store); - }; - self2.flush = function() { - vars.store = {}; - next(); - }; - self2.loop = function(cb) { - var end = false; - saw.nest(false, function loop() { - this.vars = vars.store; - cb.call(this, function() { - end = true; - next(); - }, vars.store); - this.tap(function() { - if (end) saw.next(); - else loop.call(this); - }.bind(this)); - }, vars.store); - }; - self2.buffer = function(name, bytes) { - if (typeof bytes === "string") { - bytes = vars.get(bytes); - } - getBytes(bytes, function(buf) { - vars.set(name, buf); - next(); - }); - }; - self2.skip = function(bytes) { - if (typeof bytes === "string") { - bytes = vars.get(bytes); - } - getBytes(bytes, function() { - next(); - }); - }; - self2.scan = function find3(name, search) { - if (typeof search === "string") { - search = new Buffer(search); - } else if (!Buffer.isBuffer(search)) { - throw new Error("search must be a Buffer or a string"); - } - var taken = 0; - pending = function() { - var pos = buffers.indexOf(search, offset + taken); - var i = pos - offset - taken; - if (pos !== -1) { - pending = null; - if (offset != null) { - vars.set( - name, - buffers.slice(offset, offset + taken + i) - ); - offset += taken + i + search.length; - } else { - vars.set( - name, - buffers.slice(0, taken + i) - ); - buffers.splice(0, taken + i + search.length); - } - next(); - dispatch(); - } else { - i = Math.max(buffers.length - search.length - offset - taken, 0); - } - taken += i; - }; - dispatch(); - }; - self2.peek = function(cb) { - offset = 0; - saw.nest(function() { - cb.call(this, vars.store); - this.tap(function() { - offset = null; - }); - }); - }; - return self2; - } - ; - var stream2 = Chainsaw.light(builder); - stream2.writable = true; - var buffers = Buffers(); - stream2.write = function(buf) { - buffers.push(buf); - dispatch(); - }; - var vars = Vars(); - var done = false, caughtEnd = false; - stream2.end = function() { - caughtEnd = true; - }; - stream2.pipe = Stream.prototype.pipe; - Object.getOwnPropertyNames(EventEmitter2.prototype).forEach(function(name) { - stream2[name] = EventEmitter2.prototype[name]; - }); - return stream2; - }; - exports2.parse = function parse3(buffer) { - var self2 = words(function(bytes, cb) { - return function(name) { - if (offset + bytes <= buffer.length) { - var buf = buffer.slice(offset, offset + bytes); - offset += bytes; - vars.set(name, cb(buf)); - } else { - vars.set(name, null); - } - return self2; - }; - }); - var offset = 0; - var vars = Vars(); - self2.vars = vars.store; - self2.tap = function(cb) { - cb.call(self2, vars.store); - return self2; - }; - self2.into = function(key, cb) { - if (!vars.get(key)) { - vars.set(key, {}); - } - var parent = vars; - vars = Vars(parent.get(key)); - cb.call(self2, vars.store); - vars = parent; - return self2; - }; - self2.loop = function(cb) { - var end = false; - var ender = function() { - end = true; - }; - while (end === false) { - cb.call(self2, ender, vars.store); - } - return self2; - }; - self2.buffer = function(name, size) { - if (typeof size === "string") { - size = vars.get(size); - } - var buf = buffer.slice(offset, Math.min(buffer.length, offset + size)); - offset += size; - vars.set(name, buf); - return self2; - }; - self2.skip = function(bytes) { - if (typeof bytes === "string") { - bytes = vars.get(bytes); - } - offset += bytes; - return self2; - }; - self2.scan = function(name, search) { - if (typeof search === "string") { - search = new Buffer(search); - } else if (!Buffer.isBuffer(search)) { - throw new Error("search must be a Buffer or a string"); - } - vars.set(name, null); - for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) { - for (var j = 0; j < search.length && buffer[offset + i + j] === search[j]; j++) ; - if (j === search.length) break; - } - vars.set(name, buffer.slice(offset, offset + i)); - offset += i + search.length; - return self2; - }; - self2.peek = function(cb) { - var was = offset; - cb.call(self2, vars.store); - offset = was; - return self2; - }; - self2.flush = function() { - vars.store = {}; - return self2; - }; - self2.eof = function() { - return offset >= buffer.length; - }; - return self2; - }; - function decodeLEu(bytes) { - var acc = 0; - for (var i = 0; i < bytes.length; i++) { - acc += Math.pow(256, i) * bytes[i]; - } - return acc; - } - function decodeBEu(bytes) { - var acc = 0; - for (var i = 0; i < bytes.length; i++) { - acc += Math.pow(256, bytes.length - i - 1) * bytes[i]; - } - return acc; - } - function decodeBEs(bytes) { - var val = decodeBEu(bytes); - if ((bytes[0] & 128) == 128) { - val -= Math.pow(256, bytes.length); - } - return val; - } - function decodeLEs(bytes) { - var val = decodeLEu(bytes); - if ((bytes[bytes.length - 1] & 128) == 128) { - val -= Math.pow(256, bytes.length); - } - return val; - } - function words(decode) { - var self2 = {}; - [1, 2, 4, 8].forEach(function(bytes) { - var bits = bytes * 8; - self2["word" + bits + "le"] = self2["word" + bits + "lu"] = decode(bytes, decodeLEu); - self2["word" + bits + "ls"] = decode(bytes, decodeLEs); - self2["word" + bits + "be"] = self2["word" + bits + "bu"] = decode(bytes, decodeBEu); - self2["word" + bits + "bs"] = decode(bytes, decodeBEs); - }); - self2.word8 = self2.word8u = self2.word8be; - self2.word8s = self2.word8bs; - return self2; - } - } -}); - -// node_modules/unzip-stream/lib/matcher-stream.js -var require_matcher_stream = __commonJS({ - "node_modules/unzip-stream/lib/matcher-stream.js"(exports2, module2) { - var Transform5 = require("stream").Transform; - var util3 = require("util"); - function MatcherStream(patternDesc, matchFn) { - if (!(this instanceof MatcherStream)) { - return new MatcherStream(); - } - Transform5.call(this); - var p = typeof patternDesc === "object" ? patternDesc.pattern : patternDesc; - this.pattern = Buffer.isBuffer(p) ? p : Buffer.from(p); - this.requiredLength = this.pattern.length; - if (patternDesc.requiredExtraSize) this.requiredLength += patternDesc.requiredExtraSize; - this.data = new Buffer(""); - this.bytesSoFar = 0; - this.matchFn = matchFn; - } - util3.inherits(MatcherStream, Transform5); - MatcherStream.prototype.checkDataChunk = function(ignoreMatchZero) { - var enoughData = this.data.length >= this.requiredLength; - if (!enoughData) { - return; - } - var matchIndex = this.data.indexOf(this.pattern, ignoreMatchZero ? 1 : 0); - if (matchIndex >= 0 && matchIndex + this.requiredLength > this.data.length) { - if (matchIndex > 0) { - var packet = this.data.slice(0, matchIndex); - this.push(packet); - this.bytesSoFar += matchIndex; - this.data = this.data.slice(matchIndex); - } - return; - } - if (matchIndex === -1) { - var packetLen = this.data.length - this.requiredLength + 1; - var packet = this.data.slice(0, packetLen); - this.push(packet); - this.bytesSoFar += packetLen; - this.data = this.data.slice(packetLen); - return; - } - if (matchIndex > 0) { - var packet = this.data.slice(0, matchIndex); - this.data = this.data.slice(matchIndex); - this.push(packet); - this.bytesSoFar += matchIndex; - } - var finished = this.matchFn ? this.matchFn(this.data, this.bytesSoFar) : true; - if (finished) { - this.data = new Buffer(""); - return; - } - return true; - }; - MatcherStream.prototype._transform = function(chunk, encoding, cb) { - this.data = Buffer.concat([this.data, chunk]); - var firstIteration = true; - while (this.checkDataChunk(!firstIteration)) { - firstIteration = false; - } - cb(); - }; - MatcherStream.prototype._flush = function(cb) { - if (this.data.length > 0) { - var firstIteration = true; - while (this.checkDataChunk(!firstIteration)) { - firstIteration = false; - } - } - if (this.data.length > 0) { - this.push(this.data); - this.data = null; - } - cb(); - }; - module2.exports = MatcherStream; - } -}); - -// node_modules/unzip-stream/lib/entry.js -var require_entry = __commonJS({ - "node_modules/unzip-stream/lib/entry.js"(exports2, module2) { - "use strict"; - var stream2 = require("stream"); - var inherits = require("util").inherits; - function Entry() { - if (!(this instanceof Entry)) { - return new Entry(); - } - stream2.PassThrough.call(this); - this.path = null; - this.type = null; - this.isDirectory = false; - } - inherits(Entry, stream2.PassThrough); - Entry.prototype.autodrain = function() { - return this.pipe(new stream2.Transform({ transform: function(d, e, cb) { - cb(); - } })); - }; - module2.exports = Entry; - } -}); - -// node_modules/unzip-stream/lib/unzip-stream.js -var require_unzip_stream = __commonJS({ - "node_modules/unzip-stream/lib/unzip-stream.js"(exports2, module2) { - "use strict"; - var binary = require_binary(); - var stream2 = require("stream"); - var util3 = require("util"); - var zlib3 = require("zlib"); - var MatcherStream = require_matcher_stream(); - var Entry = require_entry(); - var states = { - STREAM_START: 0, - START: 1, - LOCAL_FILE_HEADER: 2, - LOCAL_FILE_HEADER_SUFFIX: 3, - FILE_DATA: 4, - FILE_DATA_END: 5, - DATA_DESCRIPTOR: 6, - CENTRAL_DIRECTORY_FILE_HEADER: 7, - CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: 8, - CDIR64_END: 9, - CDIR64_END_DATA_SECTOR: 10, - CDIR64_LOCATOR: 11, - CENTRAL_DIRECTORY_END: 12, - CENTRAL_DIRECTORY_END_COMMENT: 13, - TRAILING_JUNK: 14, - ERROR: 99 - }; - var FOUR_GIGS = 4294967296; - var SIG_LOCAL_FILE_HEADER = 67324752; - var SIG_DATA_DESCRIPTOR = 134695760; - var SIG_CDIR_RECORD = 33639248; - var SIG_CDIR64_RECORD_END = 101075792; - var SIG_CDIR64_LOCATOR_END = 117853008; - var SIG_CDIR_RECORD_END = 101010256; - function UnzipStream(options) { - if (!(this instanceof UnzipStream)) { - return new UnzipStream(options); - } - stream2.Transform.call(this); - this.options = options || {}; - this.data = new Buffer(""); - this.state = states.STREAM_START; - this.skippedBytes = 0; - this.parsedEntity = null; - this.outStreamInfo = {}; - } - util3.inherits(UnzipStream, stream2.Transform); - UnzipStream.prototype.processDataChunk = function(chunk) { - var requiredLength; - switch (this.state) { - case states.STREAM_START: - case states.START: - requiredLength = 4; - break; - case states.LOCAL_FILE_HEADER: - requiredLength = 26; - break; - case states.LOCAL_FILE_HEADER_SUFFIX: - requiredLength = this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength; - break; - case states.DATA_DESCRIPTOR: - requiredLength = 12; - break; - case states.CENTRAL_DIRECTORY_FILE_HEADER: - requiredLength = 42; - break; - case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: - requiredLength = this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength + this.parsedEntity.fileCommentLength; - break; - case states.CDIR64_END: - requiredLength = 52; - break; - case states.CDIR64_END_DATA_SECTOR: - requiredLength = this.parsedEntity.centralDirectoryRecordSize - 44; - break; - case states.CDIR64_LOCATOR: - requiredLength = 16; - break; - case states.CENTRAL_DIRECTORY_END: - requiredLength = 18; - break; - case states.CENTRAL_DIRECTORY_END_COMMENT: - requiredLength = this.parsedEntity.commentLength; - break; - case states.FILE_DATA: - return 0; - case states.FILE_DATA_END: - return 0; - case states.TRAILING_JUNK: - if (this.options.debug) console.log("found", chunk.length, "bytes of TRAILING_JUNK"); - return chunk.length; - default: - return chunk.length; - } - var chunkLength = chunk.length; - if (chunkLength < requiredLength) { - return 0; - } - switch (this.state) { - case states.STREAM_START: - case states.START: - var signature = chunk.readUInt32LE(0); - switch (signature) { - case SIG_LOCAL_FILE_HEADER: - this.state = states.LOCAL_FILE_HEADER; - break; - case SIG_CDIR_RECORD: - this.state = states.CENTRAL_DIRECTORY_FILE_HEADER; - break; - case SIG_CDIR64_RECORD_END: - this.state = states.CDIR64_END; - break; - case SIG_CDIR64_LOCATOR_END: - this.state = states.CDIR64_LOCATOR; - break; - case SIG_CDIR_RECORD_END: - this.state = states.CENTRAL_DIRECTORY_END; - break; - default: - var isStreamStart = this.state === states.STREAM_START; - if (!isStreamStart && (signature & 65535) !== 19280 && this.skippedBytes < 26) { - var remaining = signature; - var toSkip = 4; - for (var i = 1; i < 4 && remaining !== 0; i++) { - remaining = remaining >>> 8; - if ((remaining & 255) === 80) { - toSkip = i; - break; - } - } - this.skippedBytes += toSkip; - if (this.options.debug) console.log("Skipped", this.skippedBytes, "bytes"); - return toSkip; - } - this.state = states.ERROR; - var errMsg = isStreamStart ? "Not a valid zip file" : "Invalid signature in zip file"; - if (this.options.debug) { - var sig = chunk.readUInt32LE(0); - var asString; - try { - asString = chunk.slice(0, 4).toString(); - } catch (e) { - } - console.log("Unexpected signature in zip file: 0x" + sig.toString(16), '"' + asString + '", skipped', this.skippedBytes, "bytes"); - } - this.emit("error", new Error(errMsg)); - return chunk.length; - } - this.skippedBytes = 0; - return requiredLength; - case states.LOCAL_FILE_HEADER: - this.parsedEntity = this._readFile(chunk); - this.state = states.LOCAL_FILE_HEADER_SUFFIX; - return requiredLength; - case states.LOCAL_FILE_HEADER_SUFFIX: - var entry = new Entry(); - var isUtf8 = (this.parsedEntity.flags & 2048) !== 0; - entry.path = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); - var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength); - var extra = this._readExtraFields(extraDataBuffer); - if (extra && extra.parsed) { - if (extra.parsed.path && !isUtf8) { - entry.path = extra.parsed.path; - } - if (Number.isFinite(extra.parsed.uncompressedSize) && this.parsedEntity.uncompressedSize === FOUR_GIGS - 1) { - this.parsedEntity.uncompressedSize = extra.parsed.uncompressedSize; - } - if (Number.isFinite(extra.parsed.compressedSize) && this.parsedEntity.compressedSize === FOUR_GIGS - 1) { - this.parsedEntity.compressedSize = extra.parsed.compressedSize; - } - } - this.parsedEntity.extra = extra.parsed || {}; - if (this.options.debug) { - const debugObj = Object.assign({}, this.parsedEntity, { - path: entry.path, - flags: "0x" + this.parsedEntity.flags.toString(16), - extraFields: extra && extra.debug - }); - console.log("decoded LOCAL_FILE_HEADER:", JSON.stringify(debugObj, null, 2)); - } - this._prepareOutStream(this.parsedEntity, entry); - this.emit("entry", entry); - this.state = states.FILE_DATA; - return requiredLength; - case states.CENTRAL_DIRECTORY_FILE_HEADER: - this.parsedEntity = this._readCentralDirectoryEntry(chunk); - this.state = states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX; - return requiredLength; - case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: - var isUtf8 = (this.parsedEntity.flags & 2048) !== 0; - var path30 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); - var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength); - var extra = this._readExtraFields(extraDataBuffer); - if (extra && extra.parsed && extra.parsed.path && !isUtf8) { - path30 = extra.parsed.path; - } - this.parsedEntity.extra = extra.parsed; - var isUnix = (this.parsedEntity.versionMadeBy & 65280) >> 8 === 3; - var unixAttrs, isSymlink; - if (isUnix) { - unixAttrs = this.parsedEntity.externalFileAttributes >>> 16; - var fileType = unixAttrs >>> 12; - isSymlink = (fileType & 10) === 10; - } - if (this.options.debug) { - const debugObj = Object.assign({}, this.parsedEntity, { - path: path30, - flags: "0x" + this.parsedEntity.flags.toString(16), - unixAttrs: unixAttrs && "0" + unixAttrs.toString(8), - isSymlink, - extraFields: extra.debug - }); - console.log("decoded CENTRAL_DIRECTORY_FILE_HEADER:", JSON.stringify(debugObj, null, 2)); - } - this.state = states.START; - return requiredLength; - case states.CDIR64_END: - this.parsedEntity = this._readEndOfCentralDirectory64(chunk); - if (this.options.debug) { - console.log("decoded CDIR64_END_RECORD:", this.parsedEntity); - } - this.state = states.CDIR64_END_DATA_SECTOR; - return requiredLength; - case states.CDIR64_END_DATA_SECTOR: - this.state = states.START; - return requiredLength; - case states.CDIR64_LOCATOR: - this.state = states.START; - return requiredLength; - case states.CENTRAL_DIRECTORY_END: - this.parsedEntity = this._readEndOfCentralDirectory(chunk); - if (this.options.debug) { - console.log("decoded CENTRAL_DIRECTORY_END:", this.parsedEntity); - } - this.state = states.CENTRAL_DIRECTORY_END_COMMENT; - return requiredLength; - case states.CENTRAL_DIRECTORY_END_COMMENT: - if (this.options.debug) { - console.log("decoded CENTRAL_DIRECTORY_END_COMMENT:", chunk.slice(0, requiredLength).toString()); - } - this.state = states.TRAILING_JUNK; - return requiredLength; - case states.ERROR: - return chunk.length; - // discard - default: - console.log("didn't handle state #", this.state, "discarding"); - return chunk.length; - } - }; - UnzipStream.prototype._prepareOutStream = function(vars, entry) { - var self2 = this; - var isDirectory = vars.uncompressedSize === 0 && /[\/\\]$/.test(entry.path); - entry.path = entry.path.replace(/(?<=^|[/\\]+)[.][.]+(?=[/\\]+|$)/g, "."); - entry.type = isDirectory ? "Directory" : "File"; - entry.isDirectory = isDirectory; - var fileSizeKnown = !(vars.flags & 8); - if (fileSizeKnown) { - entry.size = vars.uncompressedSize; - } - var isVersionSupported = vars.versionsNeededToExtract <= 45; - this.outStreamInfo = { - stream: null, - limit: fileSizeKnown ? vars.compressedSize : -1, - written: 0 - }; - if (!fileSizeKnown) { - var pattern = new Buffer(4); - pattern.writeUInt32LE(SIG_DATA_DESCRIPTOR, 0); - var zip64Mode = vars.extra.zip64Mode; - var extraSize = zip64Mode ? 20 : 12; - var searchPattern = { - pattern, - requiredExtraSize: extraSize - }; - var matcherStream = new MatcherStream(searchPattern, function(matchedChunk, sizeSoFar) { - var vars2 = self2._readDataDescriptor(matchedChunk, zip64Mode); - var compressedSizeMatches = vars2.compressedSize === sizeSoFar; - if (!zip64Mode && !compressedSizeMatches && sizeSoFar >= FOUR_GIGS) { - var overflown = sizeSoFar - FOUR_GIGS; - while (overflown >= 0) { - compressedSizeMatches = vars2.compressedSize === overflown; - if (compressedSizeMatches) break; - overflown -= FOUR_GIGS; - } - } - if (!compressedSizeMatches) { - return; - } - self2.state = states.FILE_DATA_END; - var sliceOffset = zip64Mode ? 24 : 16; - if (self2.data.length > 0) { - self2.data = Buffer.concat([matchedChunk.slice(sliceOffset), self2.data]); - } else { - self2.data = matchedChunk.slice(sliceOffset); - } - return true; - }); - this.outStreamInfo.stream = matcherStream; - } else { - this.outStreamInfo.stream = new stream2.PassThrough(); - } - var isEncrypted = vars.flags & 1 || vars.flags & 64; - if (isEncrypted || !isVersionSupported) { - var message = isEncrypted ? "Encrypted files are not supported!" : "Zip version " + Math.floor(vars.versionsNeededToExtract / 10) + "." + vars.versionsNeededToExtract % 10 + " is not supported"; - entry.skip = true; - setImmediate(() => { - self2.emit("error", new Error(message)); - }); - this.outStreamInfo.stream.pipe(new Entry().autodrain()); - return; - } - var isCompressed = vars.compressionMethod > 0; - if (isCompressed) { - var inflater = zlib3.createInflateRaw(); - inflater.on("error", function(err) { - self2.state = states.ERROR; - self2.emit("error", err); - }); - this.outStreamInfo.stream.pipe(inflater).pipe(entry); - } else { - this.outStreamInfo.stream.pipe(entry); - } - if (this._drainAllEntries) { - entry.autodrain(); - } - }; - UnzipStream.prototype._readFile = function(data) { - var vars = binary.parse(data).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars; - return vars; - }; - UnzipStream.prototype._readExtraFields = function(data) { - var extra = {}; - var result = { parsed: extra }; - if (this.options.debug) { - result.debug = []; - } - var index2 = 0; - while (index2 < data.length) { - var vars = binary.parse(data).skip(index2).word16lu("extraId").word16lu("extraSize").vars; - index2 += 4; - var fieldType = void 0; - switch (vars.extraId) { - case 1: - fieldType = "Zip64 extended information extra field"; - var z64vars = binary.parse(data.slice(index2, index2 + vars.extraSize)).word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offsetToLocalHeader").word32lu("diskStartNumber").vars; - if (z64vars.uncompressedSize !== null) { - extra.uncompressedSize = z64vars.uncompressedSize; - } - if (z64vars.compressedSize !== null) { - extra.compressedSize = z64vars.compressedSize; - } - extra.zip64Mode = true; - break; - case 10: - fieldType = "NTFS extra field"; - break; - case 21589: - fieldType = "extended timestamp"; - var timestampFields = data.readUInt8(index2); - var offset = 1; - if (vars.extraSize >= offset + 4 && timestampFields & 1) { - extra.mtime = new Date(data.readUInt32LE(index2 + offset) * 1e3); - offset += 4; - } - if (vars.extraSize >= offset + 4 && timestampFields & 2) { - extra.atime = new Date(data.readUInt32LE(index2 + offset) * 1e3); - offset += 4; - } - if (vars.extraSize >= offset + 4 && timestampFields & 4) { - extra.ctime = new Date(data.readUInt32LE(index2 + offset) * 1e3); - } - break; - case 28789: - fieldType = "Info-ZIP Unicode Path Extra Field"; - var fieldVer = data.readUInt8(index2); - if (fieldVer === 1) { - var offset = 1; - var nameCrc32 = data.readUInt32LE(index2 + offset); - offset += 4; - var pathBuffer = data.slice(index2 + offset); - extra.path = pathBuffer.toString(); - } - break; - case 13: - case 22613: - fieldType = vars.extraId === 13 ? "PKWARE Unix" : "Info-ZIP UNIX (type 1)"; - var offset = 0; - if (vars.extraSize >= 8) { - var atime = new Date(data.readUInt32LE(index2 + offset) * 1e3); - offset += 4; - var mtime = new Date(data.readUInt32LE(index2 + offset) * 1e3); - offset += 4; - extra.atime = atime; - extra.mtime = mtime; - if (vars.extraSize >= 12) { - var uid = data.readUInt16LE(index2 + offset); - offset += 2; - var gid = data.readUInt16LE(index2 + offset); - offset += 2; - extra.uid = uid; - extra.gid = gid; - } - } - break; - case 30805: - fieldType = "Info-ZIP UNIX (type 2)"; - var offset = 0; - if (vars.extraSize >= 4) { - var uid = data.readUInt16LE(index2 + offset); - offset += 2; - var gid = data.readUInt16LE(index2 + offset); - offset += 2; - extra.uid = uid; - extra.gid = gid; - } - break; - case 30837: - fieldType = "Info-ZIP New Unix"; - var offset = 0; - var extraVer = data.readUInt8(index2); - offset += 1; - if (extraVer === 1) { - var uidSize = data.readUInt8(index2 + offset); - offset += 1; - if (uidSize <= 6) { - extra.uid = data.readUIntLE(index2 + offset, uidSize); - } - offset += uidSize; - var gidSize = data.readUInt8(index2 + offset); - offset += 1; - if (gidSize <= 6) { - extra.gid = data.readUIntLE(index2 + offset, gidSize); - } - } - break; - case 30062: - fieldType = "ASi Unix"; - var offset = 0; - if (vars.extraSize >= 14) { - var crc = data.readUInt32LE(index2 + offset); - offset += 4; - var mode = data.readUInt16LE(index2 + offset); - offset += 2; - var sizdev = data.readUInt32LE(index2 + offset); - offset += 4; - var uid = data.readUInt16LE(index2 + offset); - offset += 2; - var gid = data.readUInt16LE(index2 + offset); - offset += 2; - extra.mode = mode; - extra.uid = uid; - extra.gid = gid; - if (vars.extraSize > 14) { - var start = index2 + offset; - var end = index2 + vars.extraSize - 14; - var symlinkName = this._decodeString(data.slice(start, end)); - extra.symlink = symlinkName; - } - } - break; - } - if (this.options.debug) { - result.debug.push({ - extraId: "0x" + vars.extraId.toString(16), - description: fieldType, - data: data.slice(index2, index2 + vars.extraSize).inspect() - }); - } - index2 += vars.extraSize; - } - return result; - }; - UnzipStream.prototype._readDataDescriptor = function(data, zip64Mode) { - if (zip64Mode) { - var vars = binary.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars; - return vars; - } - var vars = binary.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars; - return vars; - }; - UnzipStream.prototype._readCentralDirectoryEntry = function(data) { - var vars = binary.parse(data).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars; - return vars; - }; - UnzipStream.prototype._readEndOfCentralDirectory64 = function(data) { - var vars = binary.parse(data).word64lu("centralDirectoryRecordSize").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskNumberWithCentralDirectoryStart").word64lu("centralDirectoryEntries").word64lu("totalCentralDirectoryEntries").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars; - return vars; - }; - UnzipStream.prototype._readEndOfCentralDirectory = function(data) { - var vars = binary.parse(data).word16lu("diskNumber").word16lu("diskStart").word16lu("centralDirectoryEntries").word16lu("totalCentralDirectoryEntries").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars; - return vars; - }; - var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 "; - UnzipStream.prototype._decodeString = function(buffer, isUtf8) { - if (isUtf8) { - return buffer.toString("utf8"); - } - if (this.options.decodeString) { - return this.options.decodeString(buffer); - } - let result = ""; - for (var i = 0; i < buffer.length; i++) { - result += cp437[buffer[i]]; - } - return result; - }; - UnzipStream.prototype._parseOrOutput = function(encoding, cb) { - var consume; - while ((consume = this.processDataChunk(this.data)) > 0) { - this.data = this.data.slice(consume); - if (this.data.length === 0) break; - } - if (this.state === states.FILE_DATA) { - if (this.outStreamInfo.limit >= 0) { - var remaining = this.outStreamInfo.limit - this.outStreamInfo.written; - var packet; - if (remaining < this.data.length) { - packet = this.data.slice(0, remaining); - this.data = this.data.slice(remaining); - } else { - packet = this.data; - this.data = new Buffer(""); - } - this.outStreamInfo.written += packet.length; - if (this.outStreamInfo.limit === this.outStreamInfo.written) { - this.state = states.START; - this.outStreamInfo.stream.end(packet, encoding, cb); - } else { - this.outStreamInfo.stream.write(packet, encoding, cb); - } - } else { - var packet = this.data; - this.data = new Buffer(""); - this.outStreamInfo.written += packet.length; - var outputStream = this.outStreamInfo.stream; - outputStream.write(packet, encoding, () => { - if (this.state === states.FILE_DATA_END) { - this.state = states.START; - return outputStream.end(cb); - } - cb(); - }); - } - return; - } - cb(); - }; - UnzipStream.prototype.drainAll = function() { - this._drainAllEntries = true; - }; - UnzipStream.prototype._transform = function(chunk, encoding, cb) { - var self2 = this; - if (self2.data.length > 0) { - self2.data = Buffer.concat([self2.data, chunk]); - } else { - self2.data = chunk; - } - var startDataLength = self2.data.length; - var done = function() { - if (self2.data.length > 0 && self2.data.length < startDataLength) { - startDataLength = self2.data.length; - self2._parseOrOutput(encoding, done); - return; - } - cb(); - }; - self2._parseOrOutput(encoding, done); - }; - UnzipStream.prototype._flush = function(cb) { - var self2 = this; - if (self2.data.length > 0) { - self2._parseOrOutput("buffer", function() { - if (self2.data.length > 0) return setImmediate(function() { - self2._flush(cb); - }); - cb(); - }); - return; - } - if (self2.state === states.FILE_DATA) { - return cb(new Error("Stream finished in an invalid state, uncompression failed")); - } - setImmediate(cb); - }; - module2.exports = UnzipStream; - } -}); - -// node_modules/unzip-stream/lib/parser-stream.js -var require_parser_stream = __commonJS({ - "node_modules/unzip-stream/lib/parser-stream.js"(exports2, module2) { - var Transform5 = require("stream").Transform; - var util3 = require("util"); - var UnzipStream = require_unzip_stream(); - function ParserStream(opts) { - if (!(this instanceof ParserStream)) { - return new ParserStream(opts); - } - var transformOpts = opts || {}; - Transform5.call(this, { readableObjectMode: true }); - this.opts = opts || {}; - this.unzipStream = new UnzipStream(this.opts); - var self2 = this; - this.unzipStream.on("entry", function(entry) { - self2.push(entry); - }); - this.unzipStream.on("error", function(error3) { - self2.emit("error", error3); - }); - } - util3.inherits(ParserStream, Transform5); - ParserStream.prototype._transform = function(chunk, encoding, cb) { - this.unzipStream.write(chunk, encoding, cb); - }; - ParserStream.prototype._flush = function(cb) { - var self2 = this; - this.unzipStream.end(function() { - process.nextTick(function() { - self2.emit("close"); - }); - cb(); - }); - }; - ParserStream.prototype.on = function(eventName, fn) { - if (eventName === "entry") { - return Transform5.prototype.on.call(this, "data", fn); - } - return Transform5.prototype.on.call(this, eventName, fn); - }; - ParserStream.prototype.drainAll = function() { - this.unzipStream.drainAll(); - return this.pipe(new Transform5({ objectMode: true, transform: function(d, e, cb) { - cb(); - } })); - }; - module2.exports = ParserStream; - } -}); - -// node_modules/mkdirp/index.js -var require_mkdirp = __commonJS({ - "node_modules/mkdirp/index.js"(exports2, module2) { - var path30 = require("path"); - var fs32 = require("fs"); - var _0777 = parseInt("0777", 8); - module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - function mkdirP(p, opts, f, made) { - if (typeof opts === "function") { - f = opts; - opts = {}; - } else if (!opts || typeof opts !== "object") { - opts = { mode: opts }; - } - var mode = opts.mode; - var xfs = opts.fs || fs32; - if (mode === void 0) { - mode = _0777; - } - if (!made) made = null; - var cb = f || /* istanbul ignore next */ - function() { - }; - p = path30.resolve(p); - xfs.mkdir(p, mode, function(er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case "ENOENT": - if (path30.dirname(p) === p) return cb(er); - mkdirP(path30.dirname(p), opts, function(er2, made2) { - if (er2) cb(er2, made2); - else mkdirP(p, opts, cb, made2); - }); - break; - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function(er2, stat2) { - if (er2 || !stat2.isDirectory()) cb(er, made); - else cb(null, made); - }); - break; - } - }); - } - mkdirP.sync = function sync(p, opts, made) { - if (!opts || typeof opts !== "object") { - opts = { mode: opts }; - } - var mode = opts.mode; - var xfs = opts.fs || fs32; - if (mode === void 0) { - mode = _0777; - } - if (!made) made = null; - p = path30.resolve(p); - try { - xfs.mkdirSync(p, mode); - made = made || p; - } catch (err0) { - switch (err0.code) { - case "ENOENT": - made = sync(path30.dirname(p), opts, made); - sync(p, opts, made); - break; - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat2; - try { - stat2 = xfs.statSync(p); - } catch (err1) { - throw err0; - } - if (!stat2.isDirectory()) throw err0; - break; - } - } - return made; - }; - } -}); - -// node_modules/unzip-stream/lib/extract.js -var require_extract2 = __commonJS({ - "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { - var fs32 = require("fs"); - var path30 = require("path"); - var util3 = require("util"); - var mkdirp = require_mkdirp(); - var Transform5 = require("stream").Transform; - var UnzipStream = require_unzip_stream(); - function Extract(opts) { - if (!(this instanceof Extract)) - return new Extract(opts); - Transform5.call(this); - this.opts = opts || {}; - this.unzipStream = new UnzipStream(this.opts); - this.unfinishedEntries = 0; - this.afterFlushWait = false; - this.createdDirectories = {}; - var self2 = this; - this.unzipStream.on("entry", this._processEntry.bind(this)); - this.unzipStream.on("error", function(error3) { - self2.emit("error", error3); - }); - } - util3.inherits(Extract, Transform5); - Extract.prototype._transform = function(chunk, encoding, cb) { - this.unzipStream.write(chunk, encoding, cb); - }; - Extract.prototype._flush = function(cb) { - var self2 = this; - var allDone = function() { - process.nextTick(function() { - self2.emit("close"); - }); - cb(); - }; - this.unzipStream.end(function() { - if (self2.unfinishedEntries > 0) { - self2.afterFlushWait = true; - return self2.on("await-finished", allDone); - } - allDone(); - }); - }; - Extract.prototype._processEntry = function(entry) { - var self2 = this; - var destPath = path30.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path30.dirname(destPath); - this.unfinishedEntries++; - var writeFileFn = function() { - var pipedStream = fs32.createWriteStream(destPath); - pipedStream.on("close", function() { - self2.unfinishedEntries--; - self2._notifyAwaiter(); - }); - pipedStream.on("error", function(error3) { - self2.emit("error", error3); - }); - entry.pipe(pipedStream); - }; - if (this.createdDirectories[directory] || directory === ".") { - return writeFileFn(); - } - mkdirp(directory, function(err) { - if (err) return self2.emit("error", err); - self2.createdDirectories[directory] = true; - if (entry.isDirectory) { - self2.unfinishedEntries--; - self2._notifyAwaiter(); - return; - } - writeFileFn(); - }); - }; - Extract.prototype._notifyAwaiter = function() { - if (this.afterFlushWait && this.unfinishedEntries === 0) { - this.emit("await-finished"); - this.afterFlushWait = false; - } - }; - module2.exports = Extract; - } -}); - -// node_modules/unzip-stream/unzip.js -var require_unzip = __commonJS({ - "node_modules/unzip-stream/unzip.js"(exports2) { - "use strict"; - exports2.Parse = require_parser_stream(); - exports2.Extract = require_extract2(); - } -}); - -// node_modules/@actions/artifact/lib/internal/download/download-artifact.js -var require_download_artifact = __commonJS({ - "node_modules/@actions/artifact/lib/internal/download/download-artifact.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadArtifactInternal = exports2.downloadArtifactPublic = exports2.streamExtractExternal = void 0; - var promises_1 = __importDefault2(require("fs/promises")); - var crypto3 = __importStar2(require("crypto")); - var stream2 = __importStar2(require("stream")); - var github5 = __importStar2(require_github2()); - var core31 = __importStar2(require_core()); - var httpClient = __importStar2(require_lib()); - var unzip_stream_1 = __importDefault2(require_unzip()); - var user_agent_1 = require_user_agent2(); - var config_1 = require_config2(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var generated_1 = require_generated(); - var util_1 = require_util11(); - var errors_1 = require_errors3(); - var scrubQueryParameters = (url2) => { - const parsed = new URL(url2); - parsed.search = ""; - return parsed.toString(); - }; - function exists(path30) { - return __awaiter2(this, void 0, void 0, function* () { - try { - yield promises_1.default.access(path30); - return true; - } catch (error3) { - if (error3.code === "ENOENT") { - return false; - } else { - throw error3; - } - } - }); - } - function streamExtract(url2, directory) { - return __awaiter2(this, void 0, void 0, function* () { - let retryCount = 0; - while (retryCount < 5) { - try { - return yield streamExtractExternal(url2, directory); - } catch (error3) { - retryCount++; - core31.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); - yield new Promise((resolve14) => setTimeout(resolve14, 5e3)); - } - } - throw new Error(`Artifact download failed after ${retryCount} retries.`); - }); - } - function streamExtractExternal(url_1, directory_1) { - return __awaiter2(this, arguments, void 0, function* (url2, directory, opts = { timeout: 30 * 1e3 }) { - const client = new httpClient.HttpClient((0, user_agent_1.getUserAgentString)()); - const response = yield client.get(url2); - if (response.message.statusCode !== 200) { - throw new Error(`Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}`); - } - let sha256Digest = void 0; - return new Promise((resolve14, reject) => { - const timerFn = () => { - const timeoutError = new Error(`Blob storage chunk did not respond in ${opts.timeout}ms`); - response.message.destroy(timeoutError); - reject(timeoutError); - }; - const timer = setTimeout(timerFn, opts.timeout); - const hashStream = crypto3.createHash("sha256").setEncoding("hex"); - const passThrough = new stream2.PassThrough(); - response.message.pipe(passThrough); - passThrough.pipe(hashStream); - const extractStream = passThrough; - extractStream.on("data", () => { - timer.refresh(); - }).on("error", (error3) => { - core31.debug(`response.message: Artifact download failed: ${error3.message}`); - clearTimeout(timer); - reject(error3); - }).pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", () => { - clearTimeout(timer); - if (hashStream) { - hashStream.end(); - sha256Digest = hashStream.read(); - core31.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); - } - resolve14({ sha256Digest: `sha256:${sha256Digest}` }); - }).on("error", (error3) => { - reject(error3); - }); - }); - }); - } - exports2.streamExtractExternal = streamExtractExternal; - function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, options) { - return __awaiter2(this, void 0, void 0, function* () { - const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); - const api = github5.getOctokit(token); - let digestMismatch = false; - core31.info(`Downloading artifact '${artifactId}' from '${repositoryOwner}/${repositoryName}'`); - const { headers, status } = yield api.rest.actions.downloadArtifact({ - owner: repositoryOwner, - repo: repositoryName, - artifact_id: artifactId, - archive_format: "zip", - request: { - redirect: "manual" - } - }); - if (status !== 302) { - throw new Error(`Unable to download artifact. Unexpected status: ${status}`); - } - const { location } = headers; - if (!location) { - throw new Error(`Unable to redirect to artifact download url`); - } - core31.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); - try { - core31.info(`Starting download of artifact to: ${downloadPath}`); - const extractResponse = yield streamExtract(location, downloadPath); - core31.info(`Artifact download completed successfully.`); - if (options === null || options === void 0 ? void 0 : options.expectedHash) { - if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) { - digestMismatch = true; - core31.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core31.debug(`Expected digest: ${options.expectedHash}`); - } - } - } catch (error3) { - throw new Error(`Unable to download and extract artifact: ${error3.message}`); - } - return { downloadPath, digestMismatch }; - }); - } - exports2.downloadArtifactPublic = downloadArtifactPublic; - function downloadArtifactInternal(artifactId, options) { - return __awaiter2(this, void 0, void 0, function* () { - const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); - const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); - let digestMismatch = false; - const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)(); - const listReq = { - workflowRunBackendId, - workflowJobRunBackendId, - idFilter: generated_1.Int64Value.create({ value: artifactId.toString() }) - }; - const { artifacts } = yield artifactClient.ListArtifacts(listReq); - if (artifacts.length === 0) { - throw new errors_1.ArtifactNotFoundError(`No artifacts found for ID: ${artifactId} -Are you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`); - } - if (artifacts.length > 1) { - core31.warning("Multiple artifacts found, defaulting to first."); - } - const signedReq = { - workflowRunBackendId: artifacts[0].workflowRunBackendId, - workflowJobRunBackendId: artifacts[0].workflowJobRunBackendId, - name: artifacts[0].name - }; - const { signedUrl } = yield artifactClient.GetSignedArtifactURL(signedReq); - core31.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); - try { - core31.info(`Starting download of artifact to: ${downloadPath}`); - const extractResponse = yield streamExtract(signedUrl, downloadPath); - core31.info(`Artifact download completed successfully.`); - if (options === null || options === void 0 ? void 0 : options.expectedHash) { - if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) { - digestMismatch = true; - core31.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core31.debug(`Expected digest: ${options.expectedHash}`); - } - } - } catch (error3) { - throw new Error(`Unable to download and extract artifact: ${error3.message}`); - } - return { downloadPath, digestMismatch }; - }); - } - exports2.downloadArtifactInternal = downloadArtifactInternal; - function resolveOrCreateDirectory() { - return __awaiter2(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { - if (!(yield exists(downloadPath))) { - core31.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); - yield promises_1.default.mkdir(downloadPath, { recursive: true }); - } else { - core31.debug(`Artifact destination folder already exists: ${downloadPath}`); - } - return downloadPath; - }); - } - } -}); - -// node_modules/@actions/artifact/lib/internal/find/retry-options.js -var require_retry_options = __commonJS({ - "node_modules/@actions/artifact/lib/internal/find/retry-options.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRetryOptions = void 0; - var core31 = __importStar2(require_core()); - var defaultMaxRetryNumber = 5; - var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; - function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { - var _a2; - if (retries <= 0) { - return [{ enabled: false }, defaultOptions.request]; - } - const retryOptions = { - enabled: true - }; - if (exemptStatusCodes.length > 0) { - retryOptions.doNotRetry = exemptStatusCodes; - } - const requestOptions = Object.assign(Object.assign({}, defaultOptions.request), { retries }); - core31.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a2 = retryOptions.doNotRetry) !== null && _a2 !== void 0 ? _a2 : "octokit default: [400, 401, 403, 404, 422]"})`); - return [retryOptions, requestOptions]; - } - exports2.getRetryOptions = getRetryOptions; - } -}); - -// node_modules/@octokit/plugin-request-log/dist-node/index.js -var require_dist_node11 = __commonJS({ - "node_modules/@octokit/plugin-request-log/dist-node/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var VERSION8 = "1.0.4"; - function requestLog(octokit) { - octokit.hook.wrap("request", (request3, options) => { - octokit.log.debug("request", options); - const start = Date.now(); - const requestOptions = octokit.request.endpoint.parse(options); - const path30 = requestOptions.url.replace(options.baseUrl, ""); - return request3(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path30} - ${response.status} in ${Date.now() - start}ms`); - return response; - }).catch((error3) => { - octokit.log.info(`${requestOptions.method} ${path30} - ${error3.status} in ${Date.now() - start}ms`); - throw error3; - }); - }); - } - requestLog.VERSION = VERSION8; - exports2.requestLog = requestLog; - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/plugin-retry/dist-node/index.js -var require_dist_node12 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/plugin-retry/dist-node/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function _interopDefault(ex) { - return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; - } - var Bottleneck2 = _interopDefault(require_light()); - async function errorRequest2(octokit, state, error3, options) { - if (!error3.request || !error3.request.request) { - throw error3; - } - if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { - const retries = options.request.retries != null ? options.request.retries : state.retries; - const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2); - throw octokit.retry.retryRequest(error3, retries, retryAfter); - } - throw error3; - } - async function wrapRequest2(state, request3, options) { - const limiter = new Bottleneck2(); - limiter.on("failed", function(error3, info8) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; - options.request.retryCount = info8.retryCount + 1; - if (maxRetries > info8.retryCount) { - return after * state.retryAfterBaseValue; - } - }); - return limiter.schedule(request3, options); - } - var VERSION8 = "3.0.9"; - function retry2(octokit, octokitOptions) { - const state = Object.assign({ - enabled: true, - retryAfterBaseValue: 1e3, - doNotRetry: [400, 401, 403, 404, 422], - retries: 3 - }, octokitOptions.retry); - if (state.enabled) { - octokit.hook.error("request", errorRequest2.bind(null, octokit, state)); - octokit.hook.wrap("request", wrapRequest2.bind(null, state)); - } - return { - retry: { - retryRequest: (error3, retries, retryAfter) => { - error3.request.request = Object.assign({}, error3.request.request, { - retries, - retryAfter - }); - return error3; - } - } - }; - } - retry2.VERSION = VERSION8; - exports2.VERSION = VERSION8; - exports2.retry = retry2; - } -}); - -// node_modules/@actions/artifact/lib/internal/find/get-artifact.js -var require_get_artifact = __commonJS({ - "node_modules/@actions/artifact/lib/internal/find/get-artifact.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getArtifactInternal = exports2.getArtifactPublic = void 0; - var github_1 = require_github2(); - var plugin_retry_1 = require_dist_node12(); - var core31 = __importStar2(require_core()); - var utils_1 = require_utils9(); - var retry_options_1 = require_retry_options(); - var plugin_request_log_1 = require_dist_node11(); - var util_1 = require_util11(); - var user_agent_1 = require_user_agent2(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var generated_1 = require_generated(); - var errors_1 = require_errors3(); - function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const [retryOpts, requestOpts] = (0, retry_options_1.getRetryOptions)(utils_1.defaults); - const opts = { - log: void 0, - userAgent: (0, user_agent_1.getUserAgentString)(), - previews: void 0, - retry: retryOpts, - request: requestOpts - }; - const github5 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); - const getArtifactResp = yield github5.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}", { - owner: repositoryOwner, - repo: repositoryName, - run_id: workflowRunId, - name: artifactName - }); - if (getArtifactResp.status !== 200) { - throw new errors_1.InvalidResponseError(`Invalid response from GitHub API: ${getArtifactResp.status} (${(_a2 = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp.headers) === null || _a2 === void 0 ? void 0 : _a2["x-github-request-id"]})`); - } - if (getArtifactResp.data.artifacts.length === 0) { - throw new errors_1.ArtifactNotFoundError(`Artifact not found for name: ${artifactName} - Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact. - For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`); - } - let artifact2 = getArtifactResp.data.artifacts[0]; - if (getArtifactResp.data.artifacts.length > 1) { - artifact2 = getArtifactResp.data.artifacts.sort((a, b) => b.id - a.id)[0]; - core31.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.id})`); - } - return { - artifact: { - name: artifact2.name, - id: artifact2.id, - size: artifact2.size_in_bytes, - createdAt: artifact2.created_at ? new Date(artifact2.created_at) : void 0, - digest: artifact2.digest - } - }; - }); - } - exports2.getArtifactPublic = getArtifactPublic; - function getArtifactInternal(artifactName) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); - const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)(); - const req = { - workflowRunBackendId, - workflowJobRunBackendId, - nameFilter: generated_1.StringValue.create({ value: artifactName }) - }; - const res = yield artifactClient.ListArtifacts(req); - if (res.artifacts.length === 0) { - throw new errors_1.ArtifactNotFoundError(`Artifact not found for name: ${artifactName} - Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact. - For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`); - } - let artifact2 = res.artifacts[0]; - if (res.artifacts.length > 1) { - artifact2 = res.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0]; - core31.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); - } - return { - artifact: { - name: artifact2.name, - id: Number(artifact2.databaseId), - size: Number(artifact2.size), - createdAt: artifact2.createdAt ? generated_1.Timestamp.toDate(artifact2.createdAt) : void 0, - digest: (_a2 = artifact2.digest) === null || _a2 === void 0 ? void 0 : _a2.value - } - }; - }); - } - exports2.getArtifactInternal = getArtifactInternal; - } -}); - -// node_modules/@actions/artifact/lib/internal/delete/delete-artifact.js -var require_delete_artifact = __commonJS({ - "node_modules/@actions/artifact/lib/internal/delete/delete-artifact.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.deleteArtifactInternal = exports2.deleteArtifactPublic = void 0; - var core_1 = require_core(); - var github_1 = require_github2(); - var user_agent_1 = require_user_agent2(); - var retry_options_1 = require_retry_options(); - var utils_1 = require_utils9(); - var plugin_request_log_1 = require_dist_node11(); - var plugin_retry_1 = require_dist_node12(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var util_1 = require_util11(); - var generated_1 = require_generated(); - var get_artifact_1 = require_get_artifact(); - var errors_1 = require_errors3(); - function deleteArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const [retryOpts, requestOpts] = (0, retry_options_1.getRetryOptions)(utils_1.defaults); - const opts = { - log: void 0, - userAgent: (0, user_agent_1.getUserAgentString)(), - previews: void 0, - retry: retryOpts, - request: requestOpts - }; - const github5 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); - const getArtifactResp = yield (0, get_artifact_1.getArtifactPublic)(artifactName, workflowRunId, repositoryOwner, repositoryName, token); - const deleteArtifactResp = yield github5.rest.actions.deleteArtifact({ - owner: repositoryOwner, - repo: repositoryName, - artifact_id: getArtifactResp.artifact.id - }); - if (deleteArtifactResp.status !== 204) { - throw new errors_1.InvalidResponseError(`Invalid response from GitHub API: ${deleteArtifactResp.status} (${(_a2 = deleteArtifactResp === null || deleteArtifactResp === void 0 ? void 0 : deleteArtifactResp.headers) === null || _a2 === void 0 ? void 0 : _a2["x-github-request-id"]})`); - } - return { - id: getArtifactResp.artifact.id - }; - }); - } - exports2.deleteArtifactPublic = deleteArtifactPublic; - function deleteArtifactInternal(artifactName) { - return __awaiter2(this, void 0, void 0, function* () { - const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); - const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)(); - const listReq = { - workflowRunBackendId, - workflowJobRunBackendId, - nameFilter: generated_1.StringValue.create({ value: artifactName }) - }; - const listRes = yield artifactClient.ListArtifacts(listReq); - if (listRes.artifacts.length === 0) { - throw new errors_1.ArtifactNotFoundError(`Artifact not found for name: ${artifactName}`); - } - let artifact2 = listRes.artifacts[0]; - if (listRes.artifacts.length > 1) { - artifact2 = listRes.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0]; - (0, core_1.debug)(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); - } - const req = { - workflowRunBackendId: artifact2.workflowRunBackendId, - workflowJobRunBackendId: artifact2.workflowJobRunBackendId, - name: artifact2.name - }; - const res = yield artifactClient.DeleteArtifact(req); - (0, core_1.info)(`Artifact '${artifactName}' (ID: ${res.artifactId}) deleted`); - return { - id: Number(res.artifactId) - }; - }); - } - exports2.deleteArtifactInternal = deleteArtifactInternal; - } -}); - -// node_modules/@actions/artifact/lib/internal/find/list-artifacts.js -var require_list_artifacts = __commonJS({ - "node_modules/@actions/artifact/lib/internal/find/list-artifacts.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.listArtifactsInternal = exports2.listArtifactsPublic = void 0; - var core_1 = require_core(); - var github_1 = require_github2(); - var user_agent_1 = require_user_agent2(); - var retry_options_1 = require_retry_options(); - var utils_1 = require_utils9(); - var plugin_request_log_1 = require_dist_node11(); - var plugin_retry_1 = require_dist_node12(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var util_1 = require_util11(); - var config_1 = require_config2(); - var generated_1 = require_generated(); - var maximumArtifactCount = (0, config_1.getMaxArtifactListCount)(); - var paginationCount = 100; - var maxNumberOfPages = Math.ceil(maximumArtifactCount / paginationCount); - function listArtifactsPublic(workflowRunId_1, repositoryOwner_1, repositoryName_1, token_1) { - return __awaiter2(this, arguments, void 0, function* (workflowRunId, repositoryOwner, repositoryName, token, latest = false) { - (0, core_1.info)(`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}/${repositoryName}`); - let artifacts = []; - const [retryOpts, requestOpts] = (0, retry_options_1.getRetryOptions)(utils_1.defaults); - const opts = { - log: void 0, - userAgent: (0, user_agent_1.getUserAgentString)(), - previews: void 0, - retry: retryOpts, - request: requestOpts - }; - const github5 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); - let currentPageNumber = 1; - const { data: listArtifactResponse } = yield github5.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { - owner: repositoryOwner, - repo: repositoryName, - run_id: workflowRunId, - per_page: paginationCount, - page: currentPageNumber - }); - let numberOfPages = Math.ceil(listArtifactResponse.total_count / paginationCount); - const totalArtifactCount = listArtifactResponse.total_count; - if (totalArtifactCount > maximumArtifactCount) { - (0, core_1.warning)(`Workflow run ${workflowRunId} has ${totalArtifactCount} artifacts, exceeding the limit of ${maximumArtifactCount}. Results will be incomplete as only the first ${maximumArtifactCount} artifacts will be returned`); - numberOfPages = maxNumberOfPages; - } - for (const artifact2 of listArtifactResponse.artifacts) { - artifacts.push({ - name: artifact2.name, - id: artifact2.id, - size: artifact2.size_in_bytes, - createdAt: artifact2.created_at ? new Date(artifact2.created_at) : void 0, - digest: artifact2.digest - }); - } - currentPageNumber++; - for (currentPageNumber; currentPageNumber <= numberOfPages; currentPageNumber++) { - (0, core_1.debug)(`Fetching page ${currentPageNumber} of artifact list`); - const { data: listArtifactResponse2 } = yield github5.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { - owner: repositoryOwner, - repo: repositoryName, - run_id: workflowRunId, - per_page: paginationCount, - page: currentPageNumber - }); - for (const artifact2 of listArtifactResponse2.artifacts) { - artifacts.push({ - name: artifact2.name, - id: artifact2.id, - size: artifact2.size_in_bytes, - createdAt: artifact2.created_at ? new Date(artifact2.created_at) : void 0, - digest: artifact2.digest - }); - } - } - if (latest) { - artifacts = filterLatest(artifacts); - } - (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); - return { - artifacts - }; - }); - } - exports2.listArtifactsPublic = listArtifactsPublic; - function listArtifactsInternal() { - return __awaiter2(this, arguments, void 0, function* (latest = false) { - const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); - const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)(); - const req = { - workflowRunBackendId, - workflowJobRunBackendId - }; - const res = yield artifactClient.ListArtifacts(req); - let artifacts = res.artifacts.map((artifact2) => { - var _a2; - return { - name: artifact2.name, - id: Number(artifact2.databaseId), - size: Number(artifact2.size), - createdAt: artifact2.createdAt ? generated_1.Timestamp.toDate(artifact2.createdAt) : void 0, - digest: (_a2 = artifact2.digest) === null || _a2 === void 0 ? void 0 : _a2.value - }; - }); - if (latest) { - artifacts = filterLatest(artifacts); - } - (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); - return { - artifacts - }; - }); - } - exports2.listArtifactsInternal = listArtifactsInternal; - function filterLatest(artifacts) { - artifacts.sort((a, b) => b.id - a.id); - const latestArtifacts = []; - const seenArtifactNames = /* @__PURE__ */ new Set(); - for (const artifact2 of artifacts) { - if (!seenArtifactNames.has(artifact2.name)) { - latestArtifacts.push(artifact2); - seenArtifactNames.add(artifact2.name); - } - } - return latestArtifacts; - } - } -}); - -// node_modules/@actions/artifact/lib/internal/client.js -var require_client2 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/client.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __rest2 = exports2 && exports2.__rest || function(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultArtifactClient = void 0; - var core_1 = require_core(); - var config_1 = require_config2(); - var upload_artifact_1 = require_upload_artifact(); - var download_artifact_1 = require_download_artifact(); - var delete_artifact_1 = require_delete_artifact(); - var get_artifact_1 = require_get_artifact(); - var list_artifacts_1 = require_list_artifacts(); - var errors_1 = require_errors3(); - var DefaultArtifactClient2 = class { - uploadArtifact(name, files, rootDirectory, options) { - return __awaiter2(this, void 0, void 0, function* () { - try { - if ((0, config_1.isGhes)()) { - throw new errors_1.GHESNotSupportedError(); - } - return (0, upload_artifact_1.uploadArtifact)(name, files, rootDirectory, options); - } catch (error3) { - (0, core_1.warning)(`Artifact upload failed with error: ${error3}. - -Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information. - -If the error persists, please check whether Actions is operating normally at [https://githubstatus.com](https://www.githubstatus.com).`); - throw error3; - } - }); - } - downloadArtifact(artifactId, options) { - return __awaiter2(this, void 0, void 0, function* () { - try { - if ((0, config_1.isGhes)()) { - throw new errors_1.GHESNotSupportedError(); - } - if (options === null || options === void 0 ? void 0 : options.findBy) { - const { findBy: { repositoryOwner, repositoryName, token } } = options, downloadOptions = __rest2(options, ["findBy"]); - return (0, download_artifact_1.downloadArtifactPublic)(artifactId, repositoryOwner, repositoryName, token, downloadOptions); - } - return (0, download_artifact_1.downloadArtifactInternal)(artifactId, options); - } catch (error3) { - (0, core_1.warning)(`Download Artifact failed with error: ${error3}. - -Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information. - -If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).`); - throw error3; - } - }); - } - listArtifacts(options) { - return __awaiter2(this, void 0, void 0, function* () { - try { - if ((0, config_1.isGhes)()) { - throw new errors_1.GHESNotSupportedError(); - } - if (options === null || options === void 0 ? void 0 : options.findBy) { - const { findBy: { workflowRunId, repositoryOwner, repositoryName, token } } = options; - return (0, list_artifacts_1.listArtifactsPublic)(workflowRunId, repositoryOwner, repositoryName, token, options === null || options === void 0 ? void 0 : options.latest); - } - return (0, list_artifacts_1.listArtifactsInternal)(options === null || options === void 0 ? void 0 : options.latest); - } catch (error3) { - (0, core_1.warning)(`Listing Artifacts failed with error: ${error3}. - -Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information. - -If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).`); - throw error3; - } - }); - } - getArtifact(artifactName, options) { - return __awaiter2(this, void 0, void 0, function* () { - try { - if ((0, config_1.isGhes)()) { - throw new errors_1.GHESNotSupportedError(); - } - if (options === null || options === void 0 ? void 0 : options.findBy) { - const { findBy: { workflowRunId, repositoryOwner, repositoryName, token } } = options; - return (0, get_artifact_1.getArtifactPublic)(artifactName, workflowRunId, repositoryOwner, repositoryName, token); - } - return (0, get_artifact_1.getArtifactInternal)(artifactName); - } catch (error3) { - (0, core_1.warning)(`Get Artifact failed with error: ${error3}. - -Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information. - -If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).`); - throw error3; - } - }); - } - deleteArtifact(artifactName, options) { - return __awaiter2(this, void 0, void 0, function* () { - try { - if ((0, config_1.isGhes)()) { - throw new errors_1.GHESNotSupportedError(); - } - if (options === null || options === void 0 ? void 0 : options.findBy) { - const { findBy: { repositoryOwner, repositoryName, workflowRunId, token } } = options; - return (0, delete_artifact_1.deleteArtifactPublic)(artifactName, workflowRunId, repositoryOwner, repositoryName, token); - } - return (0, delete_artifact_1.deleteArtifactInternal)(artifactName); - } catch (error3) { - (0, core_1.warning)(`Delete Artifact failed with error: ${error3}. - -Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information. - -If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).`); - throw error3; - } - }); - } - }; - exports2.DefaultArtifactClient = DefaultArtifactClient2; - } -}); - -// node_modules/@actions/artifact/lib/internal/shared/interfaces.js -var require_interfaces2 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/shared/interfaces.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@actions/artifact/lib/artifact.js -var require_artifact2 = __commonJS({ - "node_modules/@actions/artifact/lib/artifact.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - var client_1 = require_client2(); - __exportStar2(require_interfaces2(), exports2); - __exportStar2(require_errors3(), exports2); - __exportStar2(require_client2(), exports2); - var client = new client_1.DefaultArtifactClient(); - exports2.default = client; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/utils.js -var require_utils10 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; - function toCommandValue(input) { - if (input === null || input === void 0) { - return ""; - } else if (typeof input === "string" || input instanceof String) { - return input; - } - return JSON.stringify(input); - } - exports2.toCommandValue = toCommandValue; - function toCommandProperties(annotationProperties) { - if (!Object.keys(annotationProperties).length) { - return {}; - } - return { - title: annotationProperties.title, - file: annotationProperties.file, - line: annotationProperties.startLine, - endLine: annotationProperties.endLine, - col: annotationProperties.startColumn, - endColumn: annotationProperties.endColumn - }; - } - exports2.toCommandProperties = toCommandProperties; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/command.js -var require_command2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/command.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.issue = exports2.issueCommand = void 0; - var os7 = __importStar2(require("os")); - var utils_1 = require_utils10(); - function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os7.EOL); - } - exports2.issueCommand = issueCommand; - function issue(name, message = "") { - issueCommand(name, {}, message); - } - exports2.issue = issue; - var CMD_STRING = "::"; - var Command = class { - constructor(command, properties, message) { - if (!command) { - command = "missing.command"; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += " "; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } else { - cmdStr += ","; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } - } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } - }; - function escapeData(s) { - return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); - } - function escapeProperty(s) { - return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); - } - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/file-command.js -var require_file_command2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/file-command.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto3 = __importStar2(require("crypto")); - var fs32 = __importStar2(require("fs")); - var os7 = __importStar2(require("os")); - var utils_1 = require_utils10(); - function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs32.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs32.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os7.EOL}`, { - encoding: "utf8" - }); - } - exports2.issueFileCommand = issueFileCommand; - function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto3.randomUUID()}`; - const convertedValue = (0, utils_1.toCommandValue)(value); - if (key.includes(delimiter)) { - throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); - } - if (convertedValue.includes(delimiter)) { - throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); - } - return `${key}<<${delimiter}${os7.EOL}${convertedValue}${os7.EOL}${delimiter}`; - } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; - function getProxyUrl(reqUrl) { - const usingSsl = reqUrl.protocol === "https:"; - if (checkBypass(reqUrl)) { - return void 0; - } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; - } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a2) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); - } - } else { - return void 0; - } - } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; - } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; - } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { - if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { - return true; - } - } - return false; - } - exports2.checkBypass = checkBypass; - function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); - } - var DecodedURL = class extends URL { - constructor(url2, base) { - super(url2, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar2(require("http")); - var https3 = __importStar2(require("https")); - var pm = __importStar2(require_proxy3()); - var tunnel = __importStar2(require_tunnel2()); - var undici_1 = require_undici(); - var HttpCodes; - (function(HttpCodes2) { - HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; - HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; - HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; - HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; - HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; - HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; - HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; - HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; - HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; - HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; - HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; - })(HttpCodes || (exports2.HttpCodes = HttpCodes = {})); - var Headers; - (function(Headers2) { - Headers2["Accept"] = "accept"; - Headers2["ContentType"] = "content-type"; - })(Headers || (exports2.Headers = Headers = {})); - var MediaTypes; - (function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; - })(MediaTypes || (exports2.MediaTypes = MediaTypes = {})); - function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ""; - } - exports2.getProxyUrl = getProxyUrl; - var HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect - ]; - var HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout - ]; - var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; - var ExponentialBackoffCeiling = 10; - var ExponentialBackoffTimeSlice = 5; - var HttpClientError = class _HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = "HttpClientError"; - this.statusCode = statusCode; - Object.setPrototypeOf(this, _HttpClientError.prototype); - } - }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => __awaiter2(this, void 0, void 0, function* () { - let output = Buffer.alloc(0); - this.message.on("data", (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on("end", () => { - resolve14(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => __awaiter2(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve14(Buffer.concat(chunks)); - }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent2, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent2; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter2(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info8 = this._prepareRequest(verb, parsedUrl, headers); - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; - let numTries = 0; - let response; - do { - response = yield this.requestRaw(info8, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler2 of this.handlers) { - if (handler2.canHandleAuthentication(response)) { - authenticationHandler = handler2; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info8, data); - } else { - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { - const redirectUrl = response.message.headers["location"]; - if (!redirectUrl) { - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { - throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } - } - info8 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info8, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info8, data) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve14(res); - } - } - this.requestRawWithCallback(info8, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info8, data, onResult) { - if (typeof data === "string") { - if (!info8.options.headers) { - info8.options.headers = {}; - } - info8.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info8.httpModule.request(info8.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(void 0, res); - }); - let socket; - req.on("socket", (sock) => { - socket = sock; - }); - req.setTimeout(this._socketTimeout || 3 * 6e4, () => { - if (socket) { - socket.end(); - } - handleResult(new Error(`Request timeout: ${info8.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); - } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - getAgentDispatcher(serverUrl) { - const parsedUrl = new URL(serverUrl); - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (!useProxy) { - return; - } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info8 = {}; - info8.parsedUrl = requestUrl; - const usingSsl = info8.parsedUrl.protocol === "https:"; - info8.httpModule = usingSsl ? https3 : http; - const defaultPort = usingSsl ? 443 : 80; - info8.options = {}; - info8.options.host = info8.parsedUrl.hostname; - info8.options.port = info8.parsedUrl.port ? parseInt(info8.parsedUrl.port) : defaultPort; - info8.options.path = (info8.parsedUrl.pathname || "") + (info8.parsedUrl.search || ""); - info8.options.method = method; - info8.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info8.options.headers["user-agent"] = this.userAgent; - } - info8.options.agent = this._getAgent(info8.parsedUrl); - if (this.handlers) { - for (const handler2 of this.handlers) { - handler2.prepareRequest(info8.options); - } - } - return info8; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys2(this.requestOptions.headers), lowercaseKeys2(headers || {})); - } - return lowercaseKeys2(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys2(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; - } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (!useProxy) { - agent = this._agent; - } - if (agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (proxyUrl && proxyUrl.hostname) { - const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), { host: proxyUrl.hostname, port: proxyUrl.port }) - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === "https:"; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https3.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; - } - if (proxyAgent) { - return proxyAgent; - } - const usingSsl = parsedUrl.protocol === "https:"; - proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { - token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString("base64")}` - })); - this._proxyAgentDispatcher = proxyAgent; - if (usingSsl && this._ignoreSslError) { - proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { - rejectUnauthorized: false - }); - } - return proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter2(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve14) => setTimeout(() => resolve14(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14, reject) => __awaiter2(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve14(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - let obj; - let contents; - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { - } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; - } else { - msg = `Failed request: (${statusCode})`; - } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve14(response); - } - })); - }); - } - }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; - } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/oidc-utils.js -var require_oidc_utils2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OidcClient = void 0; - var http_client_1 = require_lib5(); - var auth_1 = require_auth2(); - var core_1 = require_core3(); - var OidcClient = class _OidcClient { - static createHttpClient(allowRetry = true, maxRetry = 10) { - const requestOptions = { - allowRetries: allowRetry, - maxRetries: maxRetry - }; - return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); - } - static getRequestToken() { - const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; - if (!token) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); - } - return token; - } - static getIDTokenUrl() { - const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; - if (!runtimeUrl) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); - } - return runtimeUrl; - } - static getCall(id_token_url) { - var _a2; - return __awaiter2(this, void 0, void 0, function* () { - const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error3) => { - throw new Error(`Failed to get ID Token. - - Error Code : ${error3.statusCode} - - Error Message: ${error3.message}`); - }); - const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; - if (!id_token) { - throw new Error("Response json body do not have ID Token field"); - } - return id_token; - }); - } - static getIDToken(audience) { - return __awaiter2(this, void 0, void 0, function* () { - try { - let id_token_url = _OidcClient.getIDTokenUrl(); - if (audience) { - const encodedAudience = encodeURIComponent(audience); - id_token_url = `${id_token_url}&audience=${encodedAudience}`; - } - (0, core_1.debug)(`ID token url is ${id_token_url}`); - const id_token = yield _OidcClient.getCall(id_token_url); - (0, core_1.setSecret)(id_token); - return id_token; - } catch (error3) { - throw new Error(`Error message: ${error3.message}`); - } - }); - } - }; - exports2.OidcClient = OidcClient; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/summary.js -var require_summary2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/summary.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.summary = exports2.markdownSummary = exports2.SUMMARY_DOCS_URL = exports2.SUMMARY_ENV_VAR = void 0; - var os_1 = require("os"); - var fs_1 = require("fs"); - var { access, appendFile, writeFile } = fs_1.promises; - exports2.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; - exports2.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; - var Summary = class { - constructor() { - this._buffer = ""; - } - /** - * Finds the summary file path from the environment, rejects if env var is not found or file does not exist - * Also checks r/w permissions. - * - * @returns step summary file path - */ - filePath() { - return __awaiter2(this, void 0, void 0, function* () { - if (this._filePath) { - return this._filePath; - } - const pathFromEnv = process.env[exports2.SUMMARY_ENV_VAR]; - if (!pathFromEnv) { - throw new Error(`Unable to find environment variable for $${exports2.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); - } - try { - yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } catch (_a2) { - throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); - } - this._filePath = pathFromEnv; - return this._filePath; - }); - } - /** - * Wraps content in an HTML tag, adding any HTML attributes - * - * @param {string} tag HTML tag to wrap - * @param {string | null} content content within the tag - * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add - * - * @returns {string} content wrapped in HTML element - */ - wrap(tag, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); - if (!content) { - return `<${tag}${htmlAttrs}>`; - } - return `<${tag}${htmlAttrs}>${content}`; - } - /** - * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. - * - * @param {SummaryWriteOptions} [options] (optional) options for write operation - * - * @returns {Promise} summary instance - */ - write(options) { - return __awaiter2(this, void 0, void 0, function* () { - const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); - const filePath = yield this.filePath(); - const writeFunc = overwrite ? writeFile : appendFile; - yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); - return this.emptyBuffer(); - }); - } - /** - * Clears the summary buffer and wipes the summary file - * - * @returns {Summary} summary instance - */ - clear() { - return __awaiter2(this, void 0, void 0, function* () { - return this.emptyBuffer().write({ overwrite: true }); - }); - } - /** - * Returns the current summary buffer as a string - * - * @returns {string} string of summary buffer - */ - stringify() { - return this._buffer; - } - /** - * If the summary buffer is empty - * - * @returns {boolen} true if the buffer is empty - */ - isEmptyBuffer() { - return this._buffer.length === 0; - } - /** - * Resets the summary buffer without writing to summary file - * - * @returns {Summary} summary instance - */ - emptyBuffer() { - this._buffer = ""; - return this; - } - /** - * Adds raw text to the summary buffer - * - * @param {string} text content to add - * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) - * - * @returns {Summary} summary instance - */ - addRaw(text, addEOL = false) { - this._buffer += text; - return addEOL ? this.addEOL() : this; - } - /** - * Adds the operating system-specific end-of-line marker to the buffer - * - * @returns {Summary} summary instance - */ - addEOL() { - return this.addRaw(os_1.EOL); - } - /** - * Adds an HTML codeblock to the summary buffer - * - * @param {string} code content to render within fenced code block - * @param {string} lang (optional) language to syntax highlight code - * - * @returns {Summary} summary instance - */ - addCodeBlock(code, lang) { - const attrs = Object.assign({}, lang && { lang }); - const element = this.wrap("pre", this.wrap("code", code), attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML list to the summary buffer - * - * @param {string[]} items list of items to render - * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) - * - * @returns {Summary} summary instance - */ - addList(items, ordered = false) { - const tag = ordered ? "ol" : "ul"; - const listItems = items.map((item) => this.wrap("li", item)).join(""); - const element = this.wrap(tag, listItems); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML table to the summary buffer - * - * @param {SummaryTableCell[]} rows table rows - * - * @returns {Summary} summary instance - */ - addTable(rows) { - const tableBody = rows.map((row) => { - const cells = row.map((cell) => { - if (typeof cell === "string") { - return this.wrap("td", cell); - } - const { header, data, colspan, rowspan } = cell; - const tag = header ? "th" : "td"; - const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); - return this.wrap(tag, data, attrs); - }).join(""); - return this.wrap("tr", cells); - }).join(""); - const element = this.wrap("table", tableBody); - return this.addRaw(element).addEOL(); - } - /** - * Adds a collapsable HTML details element to the summary buffer - * - * @param {string} label text for the closed state - * @param {string} content collapsable content - * - * @returns {Summary} summary instance - */ - addDetails(label, content) { - const element = this.wrap("details", this.wrap("summary", label) + content); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML image tag to the summary buffer - * - * @param {string} src path to the image you to embed - * @param {string} alt text description of the image - * @param {SummaryImageOptions} options (optional) addition image attributes - * - * @returns {Summary} summary instance - */ - addImage(src, alt, options) { - const { width, height } = options || {}; - const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); - const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML section heading element - * - * @param {string} text heading text - * @param {number | string} [level=1] (optional) the heading level, default: 1 - * - * @returns {Summary} summary instance - */ - addHeading(text, level) { - const tag = `h${level}`; - const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; - const element = this.wrap(allowedTag, text); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML thematic break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addSeparator() { - const element = this.wrap("hr", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML line break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addBreak() { - const element = this.wrap("br", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML blockquote to the summary buffer - * - * @param {string} text quote text - * @param {string} cite (optional) citation url - * - * @returns {Summary} summary instance - */ - addQuote(text, cite) { - const attrs = Object.assign({}, cite && { cite }); - const element = this.wrap("blockquote", text, attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML anchor tag to the summary buffer - * - * @param {string} text link text/content - * @param {string} href hyperlink - * - * @returns {Summary} summary instance - */ - addLink(text, href) { - const element = this.wrap("a", text, { href }); - return this.addRaw(element).addEOL(); - } - }; - var _summary = new Summary(); - exports2.markdownSummary = _summary; - exports2.summary = _summary; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/path-utils.js -var require_path_utils2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/path-utils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path30 = __importStar2(require("path")); - function toPosixPath(pth) { - return pth.replace(/[\\]/g, "/"); - } - exports2.toPosixPath = toPosixPath; - function toWin32Path(pth) { - return pth.replace(/[/]/g, "\\"); - } - exports2.toWin32Path = toWin32Path; - function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path30.sep); - } - exports2.toPlatformPath = toPlatformPath; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io-util.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a2; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readlink = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - var fs32 = __importStar2(require("fs")); - var path30 = __importStar2(require("path")); - _a2 = fs32.promises, exports2.chmod = _a2.chmod, exports2.copyFile = _a2.copyFile, exports2.lstat = _a2.lstat, exports2.mkdir = _a2.mkdir, exports2.open = _a2.open, exports2.readdir = _a2.readdir, exports2.readlink = _a2.readlink, exports2.rename = _a2.rename, exports2.rm = _a2.rm, exports2.rmdir = _a2.rmdir, exports2.stat = _a2.stat, exports2.symlink = _a2.symlink, exports2.unlink = _a2.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs32.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - try { - yield exports2.stat(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; - } - throw err; - } - return true; - }); - } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter2(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); - return stats.isDirectory(); - }); - } - exports2.isDirectory = isDirectory; - function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); - } - return p.startsWith("/"); - } - exports2.isRooted = isRooted; - function tryGetExecutablePath(filePath, extensions) { - return __awaiter2(this, void 0, void 0, function* () { - let stats = void 0; - try { - stats = yield exports2.stat(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path30.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = void 0; - try { - stats = yield exports2.stat(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - try { - const directory = path30.dirname(filePath); - const upperName = path30.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path30.join(directory, actualName); - break; - } - } - } catch (err) { - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - } - return ""; - }); - } - exports2.tryGetExecutablePath = tryGetExecutablePath; - function normalizeSeparators(p) { - p = p || ""; - if (exports2.IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - return p.replace(/\\\\+/g, "\\"); - } - return p.replace(/\/\/+/g, "/"); - } - function isUnixExecutable(stats) { - return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && stats.uid === process.getuid(); - } - function getCmdPath() { - var _a3; - return (_a3 = process.env["COMSPEC"]) !== null && _a3 !== void 0 ? _a3 : `cmd.exe`; - } - exports2.getCmdPath = getCmdPath; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; - var assert_1 = require("assert"); - var path30 = __importStar2(require("path")); - var ioUtil = __importStar2(require_io_util2()); - function cp(source, dest, options = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const { force, recursive, copySourceDirectory } = readCopyOptions(options); - const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; - if (destStat && destStat.isFile() && !force) { - return; - } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path30.join(dest, path30.basename(source)) : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); - } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); - } else { - yield cpDirRecursive(source, newDest, 0, force); - } - } else { - if (path30.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile2(source, newDest, force); - } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter2(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path30.join(dest, path30.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } else { - throw new Error("Destination already exists"); - } - } - } - yield mkdirP(path30.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - exports2.mv = mv; - function rmRF(inputPath) { - return __awaiter2(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - if (/[*"<>|]/.test(inputPath)) { - throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); - } - } - try { - yield ioUtil.rm(inputPath, { - force: true, - maxRetries: 3, - recursive: true, - retryDelay: 300 - }); - } catch (err) { - throw new Error(`File was unable to be removed ${err}`); - } - }); - } - exports2.rmRF = rmRF; - function mkdirP(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - exports2.mkdirP = mkdirP; - function which9(tool, check) { - return __awaiter2(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which9(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } - } - return result; - } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; - } - return ""; - }); - } - exports2.which = which9; - function findInPath(tool) { - return __awaiter2(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path30.delimiter)) { - if (extension) { - extensions.push(extension); - } - } - } - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; - } - return []; - } - if (tool.includes(path30.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path30.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path30.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } - } - return matches; - }); - } - exports2.findInPath = findInPath; - function readCopyOptions(options) { - const force = options.force == null ? true : options.force; - const recursive = Boolean(options.recursive); - const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); - return { force, recursive, copySourceDirectory }; - } - function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter2(this, void 0, void 0, function* () { - if (currentDepth >= 255) - return; - currentDepth++; - yield mkdirP(destDir); - const files = yield ioUtil.readdir(sourceDir); - for (const fileName of files) { - const srcFile = `${sourceDir}/${fileName}`; - const destFile = `${destDir}/${fileName}`; - const srcFileStat = yield ioUtil.lstat(srcFile); - if (srcFileStat.isDirectory()) { - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } else { - yield copyFile2(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile2(srcFile, destFile, force) { - return __awaiter2(this, void 0, void 0, function* () { - if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { - try { - yield ioUtil.lstat(destFile); - yield ioUtil.unlink(destFile); - } catch (e) { - if (e.code === "EPERM") { - yield ioUtil.chmod(destFile, "0666"); - yield ioUtil.unlink(destFile); - } - } - const symlinkFull = yield ioUtil.readlink(srcFile); - yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? "junction" : null); - } else if (!(yield ioUtil.exists(destFile)) || force) { - yield ioUtil.copyFile(srcFile, destFile); - } - }); - } - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/toolrunner.js -var require_toolrunner2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os7 = __importStar2(require("os")); - var events = __importStar2(require("events")); - var child = __importStar2(require("child_process")); - var path30 = __importStar2(require("path")); - var io9 = __importStar2(require_io2()); - var ioUtil = __importStar2(require_io_util2()); - var timers_1 = require("timers"); - var IS_WINDOWS = process.platform === "win32"; - var ToolRunner7 = class extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); - } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); - } - } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? "" : "[command]"; - if (IS_WINDOWS) { - if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; - } - } else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } - } - } else { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } - return cmd; - } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os7.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - s = s.substring(n + os7.EOL.length); - n = s.indexOf(os7.EOL); - } - return s; - } catch (err) { - this._debug(`error processing line. Failed with error ${err}`); - return ""; - } - } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env["COMSPEC"] || "cmd.exe"; - } - } - return this.toolPath; - } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += " "; - argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; - } - } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); - } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); - } - _windowsQuoteCmdArg(arg) { - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); - } - if (!arg) { - return '""'; - } - const cmdSpecialChars = [ - " ", - " ", - "&", - "(", - ")", - "[", - "]", - "{", - "}", - "^", - "=", - ";", - "!", - "'", - "+", - ",", - "`", - "~", - "|", - "<", - ">", - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some((x) => x === char)) { - needsQuotes = true; - break; - } - } - if (!needsQuotes) { - return arg; - } - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === "\\") { - reverse += "\\"; - } else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; - } else { - quoteHit = false; - } - } - reverse += '"'; - return reverse.split("").reverse().join(""); - } - _uvQuoteCmdArg(arg) { - if (!arg) { - return '""'; - } - if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { - return arg; - } - if (!arg.includes('"') && !arg.includes("\\")) { - return `"${arg}"`; - } - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === "\\") { - reverse += "\\"; - } else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += "\\"; - } else { - quoteHit = false; - } - } - reverse += '"'; - return reverse.split("").reverse().join(""); - } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 1e4 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; - } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; - } - /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number - */ - exec() { - return __awaiter2(this, void 0, void 0, function* () { - if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path30.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); - } - this.toolPath = yield io9.which(this.toolPath, true); - return new Promise((resolve14, reject) => __awaiter2(this, void 0, void 0, function* () { - this._debug(`exec tool: ${this.toolPath}`); - this._debug("arguments:"); - for (const arg of this.args) { - this._debug(` ${arg}`); - } - const optionsNonNull = this._cloneExecOptions(this.options); - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os7.EOL); - } - const state = new ExecState(optionsNonNull, this.toolPath); - state.on("debug", (message) => { - this._debug(message); - }); - if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { - return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); - } - const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - let stdbuffer = ""; - if (cp.stdout) { - cp.stdout.on("data", (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); - } - stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); - } - let errbuffer = ""; - if (cp.stderr) { - cp.stderr.on("data", (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; - s.write(data); - } - errbuffer = this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); - } - cp.on("error", (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on("exit", (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); - }); - cp.on("close", (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); - }); - state.on("done", (error3, exitCode) => { - if (stdbuffer.length > 0) { - this.emit("stdline", stdbuffer); - } - if (errbuffer.length > 0) { - this.emit("errline", errbuffer); - } - cp.removeAllListeners(); - if (error3) { - reject(error3); - } else { - resolve14(exitCode); - } - }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error("child process missing stdin"); - } - cp.stdin.end(this.options.input); - } - })); - }); - } - }; - exports2.ToolRunner = ToolRunner7; - function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ""; - function append(c) { - if (escaped && c !== '"') { - arg += "\\"; - } - arg += c; - escaped = false; - } - for (let i = 0; i < argString.length; i++) { - const c = argString.charAt(i); - if (c === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } else { - append(c); - } - continue; - } - if (c === "\\" && escaped) { - append(c); - continue; - } - if (c === "\\" && inQuotes) { - escaped = true; - continue; - } - if (c === " " && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ""; - } - continue; - } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; - } - exports2.argStringToArray = argStringToArray; - var ExecState = class _ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; - this.processError = ""; - this.processExitCode = 0; - this.processExited = false; - this.processStderr = false; - this.delay = 1e4; - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error("toolPath must not be empty"); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; - } - } - CheckComplete() { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); - } - } - _debug(message) { - this.emit("debug", message); - } - _setResult() { - let error3; - if (this.processExited) { - if (this.processError) { - error3 = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } else if (this.processStderr && this.options.failOnStdErr) { - error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit("done", error3, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { - return; - } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state._debug(message); - } - state._setResult(); - } - }; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/exec.js -var require_exec2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/exec.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getExecOutput = exports2.exec = void 0; - var string_decoder_1 = require("string_decoder"); - var tr = __importStar2(require_toolrunner2()); - function exec3(commandLine, args, options) { - return __awaiter2(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); - } - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); - } - exports2.exec = exec3; - function getExecOutput(commandLine, args, options) { - var _a2, _b; - return __awaiter2(this, void 0, void 0, function* () { - let stdout = ""; - let stderr = ""; - const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); - const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); - const originalStdoutListener = (_a2 = options === null || options === void 0 ? void 0 : options.listeners) === null || _a2 === void 0 ? void 0 : _a2.stdout; - const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; - const stdErrListener = (data) => { - stderr += stderrDecoder.write(data); - if (originalStdErrListener) { - originalStdErrListener(data); - } - }; - const stdOutListener = (data) => { - stdout += stdoutDecoder.write(data); - if (originalStdoutListener) { - originalStdoutListener(data); - } - }; - const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec3(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/platform.js -var require_platform2 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; - var os_1 = __importDefault2(require("os")); - var exec3 = __importStar2(require_exec2()); - var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec3.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec3.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - var _a2, _b, _c, _d; - const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a2 = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a2 === void 0 ? void 0 : _a2[1]) !== null && _b !== void 0 ? _b : ""; - const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ""; - return { - name, - version - }; - }); - var getLinuxInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - const { stdout } = yield exec3.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version - }; - }); - exports2.platform = os_1.default.platform(); - exports2.arch = os_1.default.arch(); - exports2.isWindows = exports2.platform === "win32"; - exports2.isMacOS = exports2.platform === "darwin"; - exports2.isLinux = exports2.platform === "linux"; - function getDetails() { - return __awaiter2(this, void 0, void 0, function* () { - return Object.assign(Object.assign({}, yield exports2.isWindows ? getWindowsInfo() : exports2.isMacOS ? getMacOsInfo() : getLinuxInfo()), { - platform: exports2.platform, - arch: exports2.arch, - isWindows: exports2.isWindows, - isMacOS: exports2.isMacOS, - isLinux: exports2.isLinux - }); - }); - } - exports2.getDetails = getDetails; - } -}); - -// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/core.js -var require_core3 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.getIDToken = exports2.getState = exports2.saveState = exports2.group = exports2.endGroup = exports2.startGroup = exports2.info = exports2.notice = exports2.warning = exports2.error = exports2.debug = exports2.isDebug = exports2.setFailed = exports2.setCommandEcho = exports2.setOutput = exports2.getBooleanInput = exports2.getMultilineInput = exports2.getInput = exports2.addPath = exports2.setSecret = exports2.exportVariable = exports2.ExitCode = void 0; - var command_1 = require_command2(); - var file_command_1 = require_file_command2(); - var utils_1 = require_utils10(); - var os7 = __importStar2(require("os")); - var path30 = __importStar2(require("path")); - var oidc_utils_1 = require_oidc_utils2(); - var ExitCode; - (function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; - })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable16(name, val) { - const convertedVal = (0, utils_1.toCommandValue)(val); - process.env[name] = convertedVal; - const filePath = process.env["GITHUB_ENV"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); - } - (0, command_1.issueCommand)("set-env", { name }, convertedVal); - } - exports2.exportVariable = exportVariable16; - function setSecret2(secret) { - (0, command_1.issueCommand)("add-mask", {}, secret); - } - exports2.setSecret = setSecret2; - function addPath2(inputPath) { - const filePath = process.env["GITHUB_PATH"] || ""; - if (filePath) { - (0, file_command_1.issueFileCommand)("PATH", inputPath); - } else { - (0, command_1.issueCommand)("add-path", {}, inputPath); - } - process.env["PATH"] = `${inputPath}${path30.delimiter}${process.env["PATH"]}`; - } - exports2.addPath = addPath2; - function getInput2(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); - } - if (options && options.trimWhitespace === false) { - return val; - } - return val.trim(); - } - exports2.getInput = getInput2; - function getMultilineInput(name, options) { - const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); - if (options && options.trimWhitespace === false) { - return inputs; - } - return inputs.map((input) => input.trim()); - } - exports2.getMultilineInput = getMultilineInput; - function getBooleanInput(name, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val = getInput2(name, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) - return false; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); - } - exports2.getBooleanInput = getBooleanInput; - function setOutput7(name, value) { - const filePath = process.env["GITHUB_OUTPUT"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); - } - process.stdout.write(os7.EOL); - (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); - } - exports2.setOutput = setOutput7; - function setCommandEcho(enabled) { - (0, command_1.issue)("echo", enabled ? "on" : "off"); - } - exports2.setCommandEcho = setCommandEcho; - function setFailed12(message) { - process.exitCode = ExitCode.Failure; - error3(message); - } - exports2.setFailed = setFailed12; - function isDebug5() { - return process.env["RUNNER_DEBUG"] === "1"; - } - exports2.isDebug = isDebug5; - function debug6(message) { - (0, command_1.issueCommand)("debug", {}, message); - } - exports2.debug = debug6; - function error3(message, properties = {}) { - (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.error = error3; - function warning14(message, properties = {}) { - (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.warning = warning14; - function notice(message, properties = {}) { - (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.notice = notice; - function info8(message) { - process.stdout.write(message + os7.EOL); - } - exports2.info = info8; - function startGroup4(name) { - (0, command_1.issue)("group", name); - } - exports2.startGroup = startGroup4; - function endGroup4() { - (0, command_1.issue)("endgroup"); - } - exports2.endGroup = endGroup4; - function group(name, fn) { - return __awaiter2(this, void 0, void 0, function* () { - startGroup4(name); - let result; - try { - result = yield fn(); - } finally { - endGroup4(); - } - return result; - }); - } - exports2.group = group; - function saveState3(name, value) { - const filePath = process.env["GITHUB_STATE"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); - } - (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); - } - exports2.saveState = saveState3; - function getState3(name) { - return process.env[`STATE_${name}`] || ""; - } - exports2.getState = getState3; - function getIDToken(aud) { - return __awaiter2(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); - } - exports2.getIDToken = getIDToken; - var summary_1 = require_summary2(); - Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { - return summary_1.summary; - } }); - var summary_2 = require_summary2(); - Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { - return summary_2.markdownSummary; - } }); - var path_utils_1 = require_path_utils2(); - Object.defineProperty(exports2, "toPosixPath", { enumerable: true, get: function() { - return path_utils_1.toPosixPath; - } }); - Object.defineProperty(exports2, "toWin32Path", { enumerable: true, get: function() { - return path_utils_1.toWin32Path; - } }); - Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { - return path_utils_1.toPlatformPath; - } }); - exports2.platform = __importStar2(require_platform2()); - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/path-and-artifact-name-validation.js -var require_path_and_artifact_name_validation2 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/path-and-artifact-name-validation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkArtifactFilePath = exports2.checkArtifactName = void 0; - var core_1 = require_core3(); - var invalidArtifactFilePathCharacters = /* @__PURE__ */ new Map([ - ['"', ' Double quote "'], - [":", " Colon :"], - ["<", " Less than <"], - [">", " Greater than >"], - ["|", " Vertical bar |"], - ["*", " Asterisk *"], - ["?", " Question mark ?"], - ["\r", " Carriage return \\r"], - ["\n", " Line feed \\n"] - ]); - var invalidArtifactNameCharacters = new Map([ - ...invalidArtifactFilePathCharacters, - ["\\", " Backslash \\"], - ["/", " Forward slash /"] - ]); - function checkArtifactName(name) { - if (!name) { - throw new Error(`Artifact name: ${name}, is incorrectly provided`); - } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactNameCharacters) { - if (name.includes(invalidCharacterKey)) { - throw new Error(`Artifact name is not valid: ${name}. Contains the following character: ${errorMessageForCharacter} - -Invalid characters include: ${Array.from(invalidArtifactNameCharacters.values()).toString()} - -These characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.`); - } - } - (0, core_1.info)(`Artifact name is valid!`); - } - exports2.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path30) { - if (!path30) { - throw new Error(`Artifact path: ${path30}, is incorrectly provided`); - } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path30.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path30}. Contains the following character: ${errorMessageForCharacter} - -Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} - -The following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems. - `); - } - } - } - exports2.checkArtifactFilePath = checkArtifactFilePath; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/upload-specification.js -var require_upload_specification = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/upload-specification.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUploadSpecification = void 0; - var fs32 = __importStar2(require("fs")); - var core_1 = require_core3(); - var path_1 = require("path"); - var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation2(); - function getUploadSpecification(artifactName, rootDirectory, artifactFiles) { - const specifications = []; - if (!fs32.existsSync(rootDirectory)) { - throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); - } - if (!fs32.statSync(rootDirectory).isDirectory()) { - throw new Error(`Provided rootDirectory ${rootDirectory} is not a valid directory`); - } - rootDirectory = (0, path_1.normalize)(rootDirectory); - rootDirectory = (0, path_1.resolve)(rootDirectory); - for (let file of artifactFiles) { - if (!fs32.existsSync(file)) { - throw new Error(`File ${file} does not exist`); - } - if (!fs32.statSync(file).isDirectory()) { - file = (0, path_1.normalize)(file); - file = (0, path_1.resolve)(file); - if (!file.startsWith(rootDirectory)) { - throw new Error(`The rootDirectory: ${rootDirectory} is not a parent directory of the file: ${file}`); - } - const uploadPath = file.replace(rootDirectory, ""); - (0, path_and_artifact_name_validation_1.checkArtifactFilePath)(uploadPath); - specifications.push({ - absoluteFilePath: file, - uploadFilePath: (0, path_1.join)(artifactName, uploadPath) - }); - } else { - (0, core_1.debug)(`Removing ${file} from rawSearchResults because it is a directory`); - } - } - return specifications; - } - exports2.getUploadSpecification = getUploadSpecification; - } -}); - -// node_modules/tmp/lib/tmp.js -var require_tmp = __commonJS({ - "node_modules/tmp/lib/tmp.js"(exports2, module2) { - var fs32 = require("fs"); - var os7 = require("os"); - var path30 = require("path"); - var crypto3 = require("crypto"); - var _c = { fs: fs32.constants, os: os7.constants }; - var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - var TEMPLATE_PATTERN = /XXXXXX/; - var DEFAULT_TRIES = 3; - var CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR); - var IS_WIN32 = os7.platform() === "win32"; - var EBADF = _c.EBADF || _c.os.errno.EBADF; - var ENOENT = _c.ENOENT || _c.os.errno.ENOENT; - var DIR_MODE = 448; - var FILE_MODE = 384; - var EXIT = "exit"; - var _removeObjects = []; - var FN_RMDIR_SYNC = fs32.rmdirSync.bind(fs32); - var _gracefulCleanup = false; - function rimraf(dirPath, callback) { - return fs32.rm(dirPath, { recursive: true }, callback); - } - function FN_RIMRAF_SYNC(dirPath) { - return fs32.rmSync(dirPath, { recursive: true }); - } - function tmpName(options, callback) { - const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; - _assertAndSanitizeOptions(opts, function(err, sanitizedOptions) { - if (err) return cb(err); - let tries = sanitizedOptions.tries; - (function _getUniqueName() { - try { - const name = _generateTmpName(sanitizedOptions); - fs32.stat(name, function(err2) { - if (!err2) { - if (tries-- > 0) return _getUniqueName(); - return cb(new Error("Could not get a unique tmp filename, max tries reached " + name)); - } - cb(null, name); - }); - } catch (err2) { - cb(err2); - } - })(); - }); - } - function tmpNameSync(options) { - const args = _parseArguments(options), opts = args[0]; - const sanitizedOptions = _assertAndSanitizeOptionsSync(opts); - let tries = sanitizedOptions.tries; - do { - const name = _generateTmpName(sanitizedOptions); - try { - fs32.statSync(name); - } catch (e) { - return name; - } - } while (tries-- > 0); - throw new Error("Could not get a unique tmp filename, max tries reached"); - } - function file(options, callback) { - const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; - tmpName(opts, function _tmpNameCreated(err, name) { - if (err) return cb(err); - fs32.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { - if (err2) return cb(err2); - if (opts.discardDescriptor) { - return fs32.close(fd, function _discardCallback(possibleErr) { - return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false)); - }); - } else { - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false)); - } - }); - }); - } - function fileSync(options) { - const args = _parseArguments(options), opts = args[0]; - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - const name = tmpNameSync(opts); - let fd = fs32.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); - if (opts.discardDescriptor) { - fs32.closeSync(fd); - fd = void 0; - } - return { - name, - fd, - removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true) - }; - } - function dir(options, callback) { - const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; - tmpName(opts, function _tmpNameCreated(err, name) { - if (err) return cb(err); - fs32.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { - if (err2) return cb(err2); - cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); - }); - }); - } - function dirSync(options) { - const args = _parseArguments(options), opts = args[0]; - const name = tmpNameSync(opts); - fs32.mkdirSync(name, opts.mode || DIR_MODE); - return { - name, - removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) - }; - } - function _removeFileAsync(fdPath, next) { - const _handler = function(err) { - if (err && !_isENOENT(err)) { - return next(err); - } - next(); - }; - if (0 <= fdPath[0]) - fs32.close(fdPath[0], function() { - fs32.unlink(fdPath[1], _handler); - }); - else fs32.unlink(fdPath[1], _handler); - } - function _removeFileSync(fdPath) { - let rethrownException = null; - try { - if (0 <= fdPath[0]) fs32.closeSync(fdPath[0]); - } catch (e) { - if (!_isEBADF(e) && !_isENOENT(e)) throw e; - } finally { - try { - fs32.unlinkSync(fdPath[1]); - } catch (e) { - if (!_isENOENT(e)) rethrownException = e; - } - } - if (rethrownException !== null) { - throw rethrownException; - } - } - function _prepareTmpFileRemoveCallback(name, fd, opts, sync) { - const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync); - const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync); - if (!opts.keep) _removeObjects.unshift(removeCallbackSync); - return sync ? removeCallbackSync : removeCallback; - } - function _prepareTmpDirRemoveCallback(name, opts, sync) { - const removeFunction = opts.unsafeCleanup ? rimraf : fs32.rmdir.bind(fs32); - const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC; - const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync); - const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync); - if (!opts.keep) _removeObjects.unshift(removeCallbackSync); - return sync ? removeCallbackSync : removeCallback; - } - function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) { - let called = false; - return function _cleanupCallback(next) { - if (!called) { - const toRemove = cleanupCallbackSync || _cleanupCallback; - const index2 = _removeObjects.indexOf(toRemove); - if (index2 >= 0) _removeObjects.splice(index2, 1); - called = true; - if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { - return removeFunction(fileOrDirName); - } else { - return removeFunction(fileOrDirName, next || function() { - }); - } - } - }; - } - function _garbageCollector() { - if (!_gracefulCleanup) return; - while (_removeObjects.length) { - try { - _removeObjects[0](); - } catch (e) { - } - } - } - function _randomChars(howMany) { - let value = [], rnd = null; - try { - rnd = crypto3.randomBytes(howMany); - } catch (e) { - rnd = crypto3.pseudoRandomBytes(howMany); - } - for (let i = 0; i < howMany; i++) { - value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); - } - return value.join(""); - } - function _isUndefined(obj) { - return typeof obj === "undefined"; - } - function _parseArguments(options, callback) { - if (typeof options === "function") { - return [{}, options]; - } - if (_isUndefined(options)) { - return [{}, callback]; - } - const actualOptions = {}; - for (const key of Object.getOwnPropertyNames(options)) { - actualOptions[key] = options[key]; - } - return [actualOptions, callback]; - } - function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path30.isAbsolute(name) ? name : path30.join(tmpDir, name); - fs32.stat(pathToResolve, function(err) { - if (err) { - fs32.realpath(path30.dirname(pathToResolve), function(err2, parentDir) { - if (err2) return cb(err2); - cb(null, path30.join(parentDir, path30.basename(pathToResolve))); - }); - } else { - fs32.realpath(pathToResolve, cb); - } - }); - } - function _resolvePathSync(name, tmpDir) { - const pathToResolve = path30.isAbsolute(name) ? name : path30.join(tmpDir, name); - try { - fs32.statSync(pathToResolve); - return fs32.realpathSync(pathToResolve); - } catch (_err) { - const parentDir = fs32.realpathSync(path30.dirname(pathToResolve)); - return path30.join(parentDir, path30.basename(pathToResolve)); - } - } - function _generateTmpName(opts) { - const tmpDir = opts.tmpdir; - if (!_isUndefined(opts.name)) { - return path30.join(tmpDir, opts.dir, opts.name); - } - if (!_isUndefined(opts.template)) { - return path30.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); - } - const name = [ - opts.prefix ? opts.prefix : "tmp", - "-", - process.pid, - "-", - _randomChars(12), - opts.postfix ? "-" + opts.postfix : "" - ].join(""); - return path30.join(tmpDir, opts.dir, name); - } - function _assertPath(option, value) { - if (typeof value !== "string") { - throw new Error(`${option} option must be a string, got "${typeof value}".`); - } - if (value.includes("..")) { - throw new Error("Relative value not allowed"); - } - return value; - } - function _assertOptionsBase(options) { - if (!_isUndefined(options.name)) { - const name = options.name; - if (path30.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename2 = path30.basename(name); - if (basename2 === ".." || basename2 === "." || basename2 !== name) { - throw new Error(`name option must not contain a path, found "${name}".`); - } - } - if (!_isUndefined(options.template)) { - if (typeof options.template !== "string") { - throw new Error(`template option must be a string, got "${typeof options.template}".`); - } - if (!options.template.match(TEMPLATE_PATTERN)) { - throw new Error(`Invalid template, found "${options.template}".`); - } - } - if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) { - throw new Error(`Invalid tries, found "${options.tries}".`); - } - options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1; - options.keep = !!options.keep; - options.detachDescriptor = !!options.detachDescriptor; - options.discardDescriptor = !!options.discardDescriptor; - options.unsafeCleanup = !!options.unsafeCleanup; - options.prefix = _isUndefined(options.prefix) ? "" : _assertPath("prefix", options.prefix); - options.postfix = _isUndefined(options.postfix) ? "" : _assertPath("postfix", options.postfix); - options.template = _isUndefined(options.template) ? void 0 : _assertPath("template", options.template); - } - function _getRelativePath(option, name, tmpDir, cb) { - if (_isUndefined(name)) return cb(null); - _resolvePath(name, tmpDir, function(err, resolvedPath) { - if (err) return cb(err); - const relativePath2 = path30.relative(tmpDir, resolvedPath); - if (relativePath2.startsWith("..") || path30.isAbsolute(relativePath2)) { - return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath2}".`)); - } - cb(null, relativePath2); - }); - } - function _getRelativePathSync(option, name, tmpDir) { - if (_isUndefined(name)) return; - const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath2 = path30.relative(tmpDir, resolvedPath); - if (relativePath2.startsWith("..") || path30.isAbsolute(relativePath2)) { - throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath2}".`); - } - return relativePath2; - } - function _assertAndSanitizeOptions(options, cb) { - _getTmpDir(options, function(err, tmpDir) { - if (err) return cb(err); - options.tmpdir = tmpDir; - try { - _assertOptionsBase(options, tmpDir); - } catch (err2) { - return cb(err2); - } - _getRelativePath("dir", options.dir, tmpDir, function(err2, dir2) { - if (err2) return cb(err2); - options.dir = _isUndefined(dir2) ? "" : dir2; - _getRelativePath("template", options.template, tmpDir, function(err3, template) { - if (err3) return cb(err3); - options.template = template; - cb(null, options); - }); - }); - }); - } - function _assertAndSanitizeOptionsSync(options) { - const tmpDir = options.tmpdir = _getTmpDirSync(options); - _assertOptionsBase(options, tmpDir); - const dir2 = _getRelativePathSync("dir", options.dir, tmpDir); - options.dir = _isUndefined(dir2) ? "" : dir2; - options.template = _getRelativePathSync("template", options.template, tmpDir); - return options; - } - function _isEBADF(error3) { - return _isExpectedError(error3, -EBADF, "EBADF"); - } - function _isENOENT(error3) { - return _isExpectedError(error3, -ENOENT, "ENOENT"); - } - function _isExpectedError(error3, errno, code) { - return IS_WIN32 ? error3.code === code : error3.code === code && error3.errno === errno; - } - function setGracefulCleanup() { - _gracefulCleanup = true; - } - function _getTmpDir(options, cb) { - return fs32.realpath(options && options.tmpdir || os7.tmpdir(), cb); - } - function _getTmpDirSync(options) { - return fs32.realpathSync(options && options.tmpdir || os7.tmpdir()); - } - process.addListener(EXIT, _garbageCollector); - Object.defineProperty(module2.exports, "tmpdir", { - enumerable: true, - configurable: false, - get: function() { - return _getTmpDirSync(); - } - }); - module2.exports.dir = dir; - module2.exports.dirSync = dirSync; - module2.exports.file = file; - module2.exports.fileSync = fileSync; - module2.exports.tmpName = tmpName; - module2.exports.tmpNameSync = tmpNameSync; - module2.exports.setGracefulCleanup = setGracefulCleanup; - } -}); - -// node_modules/tmp-promise/index.js -var require_tmp_promise = __commonJS({ - "node_modules/tmp-promise/index.js"(exports2, module2) { - "use strict"; - var { promisify } = require("util"); - var tmp = require_tmp(); - module2.exports.fileSync = tmp.fileSync; - var fileWithOptions = promisify( - (options, cb) => tmp.file( - options, - (err, path30, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path30, fd, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.file = async (options) => fileWithOptions(options); - module2.exports.withFile = async function withFile(fn, options) { - const { path: path30, fd, cleanup } = await module2.exports.file(options); - try { - return await fn({ path: path30, fd }); - } finally { - await cleanup(); - } - }; - module2.exports.dirSync = tmp.dirSync; - var dirWithOptions = promisify( - (options, cb) => tmp.dir( - options, - (err, path30, cleanup) => err ? cb(err) : cb(void 0, { path: path30, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.dir = async (options) => dirWithOptions(options); - module2.exports.withDir = async function withDir(fn, options) { - const { path: path30, cleanup } = await module2.exports.dir(options); - try { - return await fn({ path: path30 }); - } finally { - await cleanup(); - } - }; - module2.exports.tmpNameSync = tmp.tmpNameSync; - module2.exports.tmpName = promisify(tmp.tmpName); - module2.exports.tmpdir = tmp.tmpdir; - module2.exports.setGracefulCleanup = tmp.setGracefulCleanup; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/config-variables.js -var require_config_variables = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/config-variables.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isGhes = exports2.getRetentionDays = exports2.getWorkSpaceDirectory = exports2.getWorkFlowRunId = exports2.getRuntimeUrl = exports2.getRuntimeToken = exports2.getDownloadFileConcurrency = exports2.getInitialRetryIntervalInMilliseconds = exports2.getRetryMultiplier = exports2.getRetryLimit = exports2.getUploadChunkSize = exports2.getUploadFileConcurrency = void 0; - function getUploadFileConcurrency() { - return 2; - } - exports2.getUploadFileConcurrency = getUploadFileConcurrency; - function getUploadChunkSize() { - return 8 * 1024 * 1024; - } - exports2.getUploadChunkSize = getUploadChunkSize; - function getRetryLimit() { - return 5; - } - exports2.getRetryLimit = getRetryLimit; - function getRetryMultiplier() { - return 1.5; - } - exports2.getRetryMultiplier = getRetryMultiplier; - function getInitialRetryIntervalInMilliseconds() { - return 3e3; - } - exports2.getInitialRetryIntervalInMilliseconds = getInitialRetryIntervalInMilliseconds; - function getDownloadFileConcurrency() { - return 2; - } - exports2.getDownloadFileConcurrency = getDownloadFileConcurrency; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get ACTIONS_RUNTIME_TOKEN env variable"); - } - return token; - } - exports2.getRuntimeToken = getRuntimeToken; - function getRuntimeUrl() { - const runtimeUrl = process.env["ACTIONS_RUNTIME_URL"]; - if (!runtimeUrl) { - throw new Error("Unable to get ACTIONS_RUNTIME_URL env variable"); - } - return runtimeUrl; - } - exports2.getRuntimeUrl = getRuntimeUrl; - function getWorkFlowRunId() { - const workFlowRunId = process.env["GITHUB_RUN_ID"]; - if (!workFlowRunId) { - throw new Error("Unable to get GITHUB_RUN_ID env variable"); - } - return workFlowRunId; - } - exports2.getWorkFlowRunId = getWorkFlowRunId; - function getWorkSpaceDirectory() { - const workspaceDirectory = process.env["GITHUB_WORKSPACE"]; - if (!workspaceDirectory) { - throw new Error("Unable to get GITHUB_WORKSPACE env variable"); - } - return workspaceDirectory; - } - exports2.getWorkSpaceDirectory = getWorkSpaceDirectory; - function getRetentionDays() { - return process.env["GITHUB_RETENTION_DAYS"]; - } - exports2.getRetentionDays = getRetentionDays; - function isGhes() { - const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); - return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; - } - exports2.isGhes = isGhes; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/crc64.js -var require_crc64 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/crc64.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var PREGEN_POLY_TABLE = [ - BigInt("0x0000000000000000"), - BigInt("0x7F6EF0C830358979"), - BigInt("0xFEDDE190606B12F2"), - BigInt("0x81B31158505E9B8B"), - BigInt("0xC962E5739841B68F"), - BigInt("0xB60C15BBA8743FF6"), - BigInt("0x37BF04E3F82AA47D"), - BigInt("0x48D1F42BC81F2D04"), - BigInt("0xA61CECB46814FE75"), - BigInt("0xD9721C7C5821770C"), - BigInt("0x58C10D24087FEC87"), - BigInt("0x27AFFDEC384A65FE"), - BigInt("0x6F7E09C7F05548FA"), - BigInt("0x1010F90FC060C183"), - BigInt("0x91A3E857903E5A08"), - BigInt("0xEECD189FA00BD371"), - BigInt("0x78E0FF3B88BE6F81"), - BigInt("0x078E0FF3B88BE6F8"), - BigInt("0x863D1EABE8D57D73"), - BigInt("0xF953EE63D8E0F40A"), - BigInt("0xB1821A4810FFD90E"), - BigInt("0xCEECEA8020CA5077"), - BigInt("0x4F5FFBD87094CBFC"), - BigInt("0x30310B1040A14285"), - BigInt("0xDEFC138FE0AA91F4"), - BigInt("0xA192E347D09F188D"), - BigInt("0x2021F21F80C18306"), - BigInt("0x5F4F02D7B0F40A7F"), - BigInt("0x179EF6FC78EB277B"), - BigInt("0x68F0063448DEAE02"), - BigInt("0xE943176C18803589"), - BigInt("0x962DE7A428B5BCF0"), - BigInt("0xF1C1FE77117CDF02"), - BigInt("0x8EAF0EBF2149567B"), - BigInt("0x0F1C1FE77117CDF0"), - BigInt("0x7072EF2F41224489"), - BigInt("0x38A31B04893D698D"), - BigInt("0x47CDEBCCB908E0F4"), - BigInt("0xC67EFA94E9567B7F"), - BigInt("0xB9100A5CD963F206"), - BigInt("0x57DD12C379682177"), - BigInt("0x28B3E20B495DA80E"), - BigInt("0xA900F35319033385"), - BigInt("0xD66E039B2936BAFC"), - BigInt("0x9EBFF7B0E12997F8"), - BigInt("0xE1D10778D11C1E81"), - BigInt("0x606216208142850A"), - BigInt("0x1F0CE6E8B1770C73"), - BigInt("0x8921014C99C2B083"), - BigInt("0xF64FF184A9F739FA"), - BigInt("0x77FCE0DCF9A9A271"), - BigInt("0x08921014C99C2B08"), - BigInt("0x4043E43F0183060C"), - BigInt("0x3F2D14F731B68F75"), - BigInt("0xBE9E05AF61E814FE"), - BigInt("0xC1F0F56751DD9D87"), - BigInt("0x2F3DEDF8F1D64EF6"), - BigInt("0x50531D30C1E3C78F"), - BigInt("0xD1E00C6891BD5C04"), - BigInt("0xAE8EFCA0A188D57D"), - BigInt("0xE65F088B6997F879"), - BigInt("0x9931F84359A27100"), - BigInt("0x1882E91B09FCEA8B"), - BigInt("0x67EC19D339C963F2"), - BigInt("0xD75ADABD7A6E2D6F"), - BigInt("0xA8342A754A5BA416"), - BigInt("0x29873B2D1A053F9D"), - BigInt("0x56E9CBE52A30B6E4"), - BigInt("0x1E383FCEE22F9BE0"), - BigInt("0x6156CF06D21A1299"), - BigInt("0xE0E5DE5E82448912"), - BigInt("0x9F8B2E96B271006B"), - BigInt("0x71463609127AD31A"), - BigInt("0x0E28C6C1224F5A63"), - BigInt("0x8F9BD7997211C1E8"), - BigInt("0xF0F5275142244891"), - BigInt("0xB824D37A8A3B6595"), - BigInt("0xC74A23B2BA0EECEC"), - BigInt("0x46F932EAEA507767"), - BigInt("0x3997C222DA65FE1E"), - BigInt("0xAFBA2586F2D042EE"), - BigInt("0xD0D4D54EC2E5CB97"), - BigInt("0x5167C41692BB501C"), - BigInt("0x2E0934DEA28ED965"), - BigInt("0x66D8C0F56A91F461"), - BigInt("0x19B6303D5AA47D18"), - BigInt("0x980521650AFAE693"), - BigInt("0xE76BD1AD3ACF6FEA"), - BigInt("0x09A6C9329AC4BC9B"), - BigInt("0x76C839FAAAF135E2"), - BigInt("0xF77B28A2FAAFAE69"), - BigInt("0x8815D86ACA9A2710"), - BigInt("0xC0C42C4102850A14"), - BigInt("0xBFAADC8932B0836D"), - BigInt("0x3E19CDD162EE18E6"), - BigInt("0x41773D1952DB919F"), - BigInt("0x269B24CA6B12F26D"), - BigInt("0x59F5D4025B277B14"), - BigInt("0xD846C55A0B79E09F"), - BigInt("0xA72835923B4C69E6"), - BigInt("0xEFF9C1B9F35344E2"), - BigInt("0x90973171C366CD9B"), - BigInt("0x1124202993385610"), - BigInt("0x6E4AD0E1A30DDF69"), - BigInt("0x8087C87E03060C18"), - BigInt("0xFFE938B633338561"), - BigInt("0x7E5A29EE636D1EEA"), - BigInt("0x0134D92653589793"), - BigInt("0x49E52D0D9B47BA97"), - BigInt("0x368BDDC5AB7233EE"), - BigInt("0xB738CC9DFB2CA865"), - BigInt("0xC8563C55CB19211C"), - BigInt("0x5E7BDBF1E3AC9DEC"), - BigInt("0x21152B39D3991495"), - BigInt("0xA0A63A6183C78F1E"), - BigInt("0xDFC8CAA9B3F20667"), - BigInt("0x97193E827BED2B63"), - BigInt("0xE877CE4A4BD8A21A"), - BigInt("0x69C4DF121B863991"), - BigInt("0x16AA2FDA2BB3B0E8"), - BigInt("0xF86737458BB86399"), - BigInt("0x8709C78DBB8DEAE0"), - BigInt("0x06BAD6D5EBD3716B"), - BigInt("0x79D4261DDBE6F812"), - BigInt("0x3105D23613F9D516"), - BigInt("0x4E6B22FE23CC5C6F"), - BigInt("0xCFD833A67392C7E4"), - BigInt("0xB0B6C36E43A74E9D"), - BigInt("0x9A6C9329AC4BC9B5"), - BigInt("0xE50263E19C7E40CC"), - BigInt("0x64B172B9CC20DB47"), - BigInt("0x1BDF8271FC15523E"), - BigInt("0x530E765A340A7F3A"), - BigInt("0x2C608692043FF643"), - BigInt("0xADD397CA54616DC8"), - BigInt("0xD2BD67026454E4B1"), - BigInt("0x3C707F9DC45F37C0"), - BigInt("0x431E8F55F46ABEB9"), - BigInt("0xC2AD9E0DA4342532"), - BigInt("0xBDC36EC59401AC4B"), - BigInt("0xF5129AEE5C1E814F"), - BigInt("0x8A7C6A266C2B0836"), - BigInt("0x0BCF7B7E3C7593BD"), - BigInt("0x74A18BB60C401AC4"), - BigInt("0xE28C6C1224F5A634"), - BigInt("0x9DE29CDA14C02F4D"), - BigInt("0x1C518D82449EB4C6"), - BigInt("0x633F7D4A74AB3DBF"), - BigInt("0x2BEE8961BCB410BB"), - BigInt("0x548079A98C8199C2"), - BigInt("0xD53368F1DCDF0249"), - BigInt("0xAA5D9839ECEA8B30"), - BigInt("0x449080A64CE15841"), - BigInt("0x3BFE706E7CD4D138"), - BigInt("0xBA4D61362C8A4AB3"), - BigInt("0xC52391FE1CBFC3CA"), - BigInt("0x8DF265D5D4A0EECE"), - BigInt("0xF29C951DE49567B7"), - BigInt("0x732F8445B4CBFC3C"), - BigInt("0x0C41748D84FE7545"), - BigInt("0x6BAD6D5EBD3716B7"), - BigInt("0x14C39D968D029FCE"), - BigInt("0x95708CCEDD5C0445"), - BigInt("0xEA1E7C06ED698D3C"), - BigInt("0xA2CF882D2576A038"), - BigInt("0xDDA178E515432941"), - BigInt("0x5C1269BD451DB2CA"), - BigInt("0x237C997575283BB3"), - BigInt("0xCDB181EAD523E8C2"), - BigInt("0xB2DF7122E51661BB"), - BigInt("0x336C607AB548FA30"), - BigInt("0x4C0290B2857D7349"), - BigInt("0x04D364994D625E4D"), - BigInt("0x7BBD94517D57D734"), - BigInt("0xFA0E85092D094CBF"), - BigInt("0x856075C11D3CC5C6"), - BigInt("0x134D926535897936"), - BigInt("0x6C2362AD05BCF04F"), - BigInt("0xED9073F555E26BC4"), - BigInt("0x92FE833D65D7E2BD"), - BigInt("0xDA2F7716ADC8CFB9"), - BigInt("0xA54187DE9DFD46C0"), - BigInt("0x24F29686CDA3DD4B"), - BigInt("0x5B9C664EFD965432"), - BigInt("0xB5517ED15D9D8743"), - BigInt("0xCA3F8E196DA80E3A"), - BigInt("0x4B8C9F413DF695B1"), - BigInt("0x34E26F890DC31CC8"), - BigInt("0x7C339BA2C5DC31CC"), - BigInt("0x035D6B6AF5E9B8B5"), - BigInt("0x82EE7A32A5B7233E"), - BigInt("0xFD808AFA9582AA47"), - BigInt("0x4D364994D625E4DA"), - BigInt("0x3258B95CE6106DA3"), - BigInt("0xB3EBA804B64EF628"), - BigInt("0xCC8558CC867B7F51"), - BigInt("0x8454ACE74E645255"), - BigInt("0xFB3A5C2F7E51DB2C"), - BigInt("0x7A894D772E0F40A7"), - BigInt("0x05E7BDBF1E3AC9DE"), - BigInt("0xEB2AA520BE311AAF"), - BigInt("0x944455E88E0493D6"), - BigInt("0x15F744B0DE5A085D"), - BigInt("0x6A99B478EE6F8124"), - BigInt("0x224840532670AC20"), - BigInt("0x5D26B09B16452559"), - BigInt("0xDC95A1C3461BBED2"), - BigInt("0xA3FB510B762E37AB"), - BigInt("0x35D6B6AF5E9B8B5B"), - BigInt("0x4AB846676EAE0222"), - BigInt("0xCB0B573F3EF099A9"), - BigInt("0xB465A7F70EC510D0"), - BigInt("0xFCB453DCC6DA3DD4"), - BigInt("0x83DAA314F6EFB4AD"), - BigInt("0x0269B24CA6B12F26"), - BigInt("0x7D0742849684A65F"), - BigInt("0x93CA5A1B368F752E"), - BigInt("0xECA4AAD306BAFC57"), - BigInt("0x6D17BB8B56E467DC"), - BigInt("0x12794B4366D1EEA5"), - BigInt("0x5AA8BF68AECEC3A1"), - BigInt("0x25C64FA09EFB4AD8"), - BigInt("0xA4755EF8CEA5D153"), - BigInt("0xDB1BAE30FE90582A"), - BigInt("0xBCF7B7E3C7593BD8"), - BigInt("0xC399472BF76CB2A1"), - BigInt("0x422A5673A732292A"), - BigInt("0x3D44A6BB9707A053"), - BigInt("0x759552905F188D57"), - BigInt("0x0AFBA2586F2D042E"), - BigInt("0x8B48B3003F739FA5"), - BigInt("0xF42643C80F4616DC"), - BigInt("0x1AEB5B57AF4DC5AD"), - BigInt("0x6585AB9F9F784CD4"), - BigInt("0xE436BAC7CF26D75F"), - BigInt("0x9B584A0FFF135E26"), - BigInt("0xD389BE24370C7322"), - BigInt("0xACE74EEC0739FA5B"), - BigInt("0x2D545FB4576761D0"), - BigInt("0x523AAF7C6752E8A9"), - BigInt("0xC41748D84FE75459"), - BigInt("0xBB79B8107FD2DD20"), - BigInt("0x3ACAA9482F8C46AB"), - BigInt("0x45A459801FB9CFD2"), - BigInt("0x0D75ADABD7A6E2D6"), - BigInt("0x721B5D63E7936BAF"), - BigInt("0xF3A84C3BB7CDF024"), - BigInt("0x8CC6BCF387F8795D"), - BigInt("0x620BA46C27F3AA2C"), - BigInt("0x1D6554A417C62355"), - BigInt("0x9CD645FC4798B8DE"), - BigInt("0xE3B8B53477AD31A7"), - BigInt("0xAB69411FBFB21CA3"), - BigInt("0xD407B1D78F8795DA"), - BigInt("0x55B4A08FDFD90E51"), - BigInt("0x2ADA5047EFEC8728") - ]; - var CRC64 = class _CRC64 { - constructor() { - this._crc = BigInt(0); - } - update(data) { - const buffer = typeof data === "string" ? Buffer.from(data) : data; - let crc = _CRC64.flip64Bits(this._crc); - for (const dataByte of buffer) { - const crcByte = Number(crc & BigInt(255)); - crc = PREGEN_POLY_TABLE[crcByte ^ dataByte] ^ crc >> BigInt(8); - } - this._crc = _CRC64.flip64Bits(crc); - } - digest(encoding) { - switch (encoding) { - case "hex": - return this._crc.toString(16).toUpperCase(); - case "base64": - return this.toBuffer().toString("base64"); - default: - return this.toBuffer(); - } - } - toBuffer() { - return Buffer.from([0, 8, 16, 24, 32, 40, 48, 56].map((s) => Number(this._crc >> BigInt(s) & BigInt(255)))); - } - static flip64Bits(n) { - return (BigInt(1) << BigInt(64)) - BigInt(1) - n; - } - }; - exports2.default = CRC64; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/utils.js -var require_utils11 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/utils.js"(exports2) { - "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.digestForStream = exports2.sleep = exports2.getProperRetention = exports2.rmFile = exports2.getFileSize = exports2.createEmptyFilesForArtifact = exports2.createDirectoriesForArtifact = exports2.displayHttpDiagnostics = exports2.getArtifactUrl = exports2.createHttpClient = exports2.getUploadHeaders = exports2.getDownloadHeaders = exports2.getContentRange = exports2.tryGetRetryAfterValueTimeInMilliseconds = exports2.isThrottledStatusCode = exports2.isRetryableStatusCode = exports2.isForbiddenStatusCode = exports2.isSuccessStatusCode = exports2.getApiVersion = exports2.parseEnvNumber = exports2.getExponentialRetryTimeInMilliseconds = void 0; - var crypto_1 = __importDefault2(require("crypto")); - var fs_1 = require("fs"); - var core_1 = require_core3(); - var http_client_1 = require_lib5(); - var auth_1 = require_auth2(); - var config_variables_1 = require_config_variables(); - var crc64_1 = __importDefault2(require_crc64()); - function getExponentialRetryTimeInMilliseconds(retryCount) { - if (retryCount < 0) { - throw new Error("RetryCount should not be negative"); - } else if (retryCount === 0) { - return (0, config_variables_1.getInitialRetryIntervalInMilliseconds)(); - } - const minTime = (0, config_variables_1.getInitialRetryIntervalInMilliseconds)() * (0, config_variables_1.getRetryMultiplier)() * retryCount; - const maxTime = minTime * (0, config_variables_1.getRetryMultiplier)(); - return Math.trunc(Math.random() * (maxTime - minTime) + minTime); - } - exports2.getExponentialRetryTimeInMilliseconds = getExponentialRetryTimeInMilliseconds; - function parseEnvNumber(key) { - const value = Number(process.env[key]); - if (Number.isNaN(value) || value < 0) { - return void 0; - } - return value; - } - exports2.parseEnvNumber = parseEnvNumber; - function getApiVersion() { - return "6.0-preview"; - } - exports2.getApiVersion = getApiVersion; - function isSuccessStatusCode(statusCode) { - if (!statusCode) { - return false; - } - return statusCode >= 200 && statusCode < 300; - } - exports2.isSuccessStatusCode = isSuccessStatusCode; - function isForbiddenStatusCode(statusCode) { - if (!statusCode) { - return false; - } - return statusCode === http_client_1.HttpCodes.Forbidden; - } - exports2.isForbiddenStatusCode = isForbiddenStatusCode; - function isRetryableStatusCode(statusCode) { - if (!statusCode) { - return false; - } - const retryableStatusCodes = [ - http_client_1.HttpCodes.BadGateway, - http_client_1.HttpCodes.GatewayTimeout, - http_client_1.HttpCodes.InternalServerError, - http_client_1.HttpCodes.ServiceUnavailable, - http_client_1.HttpCodes.TooManyRequests, - 413 - // Payload Too Large - ]; - return retryableStatusCodes.includes(statusCode); - } - exports2.isRetryableStatusCode = isRetryableStatusCode; - function isThrottledStatusCode(statusCode) { - if (!statusCode) { - return false; - } - return statusCode === http_client_1.HttpCodes.TooManyRequests; - } - exports2.isThrottledStatusCode = isThrottledStatusCode; - function tryGetRetryAfterValueTimeInMilliseconds(headers) { - if (headers["retry-after"]) { - const retryTime = Number(headers["retry-after"]); - if (!isNaN(retryTime)) { - (0, core_1.info)(`Retry-After header is present with a value of ${retryTime}`); - return retryTime * 1e3; - } - (0, core_1.info)(`Returned retry-after header value: ${retryTime} is non-numeric and cannot be used`); - return void 0; - } - (0, core_1.info)(`No retry-after header was found. Dumping all headers for diagnostic purposes`); - console.log(headers); - return void 0; - } - exports2.tryGetRetryAfterValueTimeInMilliseconds = tryGetRetryAfterValueTimeInMilliseconds; - function getContentRange(start, end, total) { - return `bytes ${start}-${end}/${total}`; - } - exports2.getContentRange = getContentRange; - function getDownloadHeaders(contentType, isKeepAlive, acceptGzip) { - const requestOptions = {}; - if (contentType) { - requestOptions["Content-Type"] = contentType; - } - if (isKeepAlive) { - requestOptions["Connection"] = "Keep-Alive"; - requestOptions["Keep-Alive"] = "10"; - } - if (acceptGzip) { - requestOptions["Accept-Encoding"] = "gzip"; - requestOptions["Accept"] = `application/octet-stream;api-version=${getApiVersion()}`; - } else { - requestOptions["Accept"] = `application/json;api-version=${getApiVersion()}`; - } - return requestOptions; - } - exports2.getDownloadHeaders = getDownloadHeaders; - function getUploadHeaders(contentType, isKeepAlive, isGzip, uncompressedLength, contentLength, contentRange, digest) { - const requestOptions = {}; - requestOptions["Accept"] = `application/json;api-version=${getApiVersion()}`; - if (contentType) { - requestOptions["Content-Type"] = contentType; - } - if (isKeepAlive) { - requestOptions["Connection"] = "Keep-Alive"; - requestOptions["Keep-Alive"] = "10"; - } - if (isGzip) { - requestOptions["Content-Encoding"] = "gzip"; - requestOptions["x-tfs-filelength"] = uncompressedLength; - } - if (contentLength) { - requestOptions["Content-Length"] = contentLength; - } - if (contentRange) { - requestOptions["Content-Range"] = contentRange; - } - if (digest) { - requestOptions["x-actions-results-crc64"] = digest.crc64; - requestOptions["x-actions-results-md5"] = digest.md5; - } - return requestOptions; - } - exports2.getUploadHeaders = getUploadHeaders; - function createHttpClient(userAgent2) { - return new http_client_1.HttpClient(userAgent2, [ - new auth_1.BearerCredentialHandler((0, config_variables_1.getRuntimeToken)()) - ]); - } - exports2.createHttpClient = createHttpClient; - function getArtifactUrl() { - const artifactUrl = `${(0, config_variables_1.getRuntimeUrl)()}_apis/pipelines/workflows/${(0, config_variables_1.getWorkFlowRunId)()}/artifacts?api-version=${getApiVersion()}`; - (0, core_1.debug)(`Artifact Url: ${artifactUrl}`); - return artifactUrl; - } - exports2.getArtifactUrl = getArtifactUrl; - function displayHttpDiagnostics(response) { - (0, core_1.info)(`##### Begin Diagnostic HTTP information ##### -Status Code: ${response.message.statusCode} -Status Message: ${response.message.statusMessage} -Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} -###### End Diagnostic HTTP information ######`); - } - exports2.displayHttpDiagnostics = displayHttpDiagnostics; - function createDirectoriesForArtifact(directories) { - return __awaiter2(this, void 0, void 0, function* () { - for (const directory of directories) { - yield fs_1.promises.mkdir(directory, { - recursive: true - }); - } - }); - } - exports2.createDirectoriesForArtifact = createDirectoriesForArtifact; - function createEmptyFilesForArtifact(emptyFilesToCreate) { - return __awaiter2(this, void 0, void 0, function* () { - for (const filePath of emptyFilesToCreate) { - yield (yield fs_1.promises.open(filePath, "w")).close(); - } - }); - } - exports2.createEmptyFilesForArtifact = createEmptyFilesForArtifact; - function getFileSize(filePath) { - return __awaiter2(this, void 0, void 0, function* () { - const stats = yield fs_1.promises.stat(filePath); - (0, core_1.debug)(`${filePath} size:(${stats.size}) blksize:(${stats.blksize}) blocks:(${stats.blocks})`); - return stats.size; - }); - } - exports2.getFileSize = getFileSize; - function rmFile(filePath) { - return __awaiter2(this, void 0, void 0, function* () { - yield fs_1.promises.unlink(filePath); - }); - } - exports2.rmFile = rmFile; - function getProperRetention(retentionInput, retentionSetting) { - if (retentionInput < 0) { - throw new Error("Invalid retention, minimum value is 1."); - } - let retention = retentionInput; - if (retentionSetting) { - const maxRetention = parseInt(retentionSetting); - if (!isNaN(maxRetention) && maxRetention < retention) { - (0, core_1.warning)(`Retention days is greater than the max value allowed by the repository setting, reduce retention to ${maxRetention} days`); - retention = maxRetention; - } - } - return retention; - } - exports2.getProperRetention = getProperRetention; - function sleep(milliseconds) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => setTimeout(resolve14, milliseconds)); - }); - } - exports2.sleep = sleep; - function digestForStream(stream2) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14, reject) => { - const crc64 = new crc64_1.default(); - const md5 = crypto_1.default.createHash("md5"); - stream2.on("data", (data) => { - crc64.update(data); - md5.update(data); - }).on("end", () => resolve14({ - crc64: crc64.digest("base64"), - md5: md5.digest("base64") - })).on("error", reject); - }); - }); - } - exports2.digestForStream = digestForStream; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/status-reporter.js -var require_status_reporter = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/status-reporter.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.StatusReporter = void 0; - var core_1 = require_core3(); - var StatusReporter = class { - constructor(displayFrequencyInMilliseconds) { - this.totalNumberOfFilesToProcess = 0; - this.processedCount = 0; - this.largeFiles = /* @__PURE__ */ new Map(); - this.totalFileStatus = void 0; - this.displayFrequencyInMilliseconds = displayFrequencyInMilliseconds; - } - setTotalNumberOfFilesToProcess(fileTotal) { - this.totalNumberOfFilesToProcess = fileTotal; - this.processedCount = 0; - } - start() { - this.totalFileStatus = setInterval(() => { - const percentage = this.formatPercentage(this.processedCount, this.totalNumberOfFilesToProcess); - (0, core_1.info)(`Total file count: ${this.totalNumberOfFilesToProcess} ---- Processed file #${this.processedCount} (${percentage.slice(0, percentage.indexOf(".") + 2)}%)`); - }, this.displayFrequencyInMilliseconds); - } - // if there is a large file that is being uploaded in chunks, this is used to display extra information about the status of the upload - updateLargeFileStatus(fileName, chunkStartIndex, chunkEndIndex, totalUploadFileSize) { - const percentage = this.formatPercentage(chunkEndIndex, totalUploadFileSize); - (0, core_1.info)(`Uploaded ${fileName} (${percentage.slice(0, percentage.indexOf(".") + 2)}%) bytes ${chunkStartIndex}:${chunkEndIndex}`); - } - stop() { - if (this.totalFileStatus) { - clearInterval(this.totalFileStatus); - } - } - incrementProcessedCount() { - this.processedCount++; - } - formatPercentage(numerator, denominator) { - return (numerator / denominator * 100).toFixed(4).toString(); - } - }; - exports2.StatusReporter = StatusReporter; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/http-manager.js -var require_http_manager = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/http-manager.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpManager = void 0; - var utils_1 = require_utils11(); - var HttpManager = class { - constructor(clientCount, userAgent2) { - if (clientCount < 1) { - throw new Error("There must be at least one client"); - } - this.userAgent = userAgent2; - this.clients = new Array(clientCount).fill((0, utils_1.createHttpClient)(userAgent2)); - } - getClient(index2) { - return this.clients[index2]; - } - // client disposal is necessary if a keep-alive connection is used to properly close the connection - // for more information see: https://github.com/actions/http-client/blob/04e5ad73cd3fd1f5610a32116b0759eddf6570d2/index.ts#L292 - disposeAndReplaceClient(index2) { - this.clients[index2].dispose(); - this.clients[index2] = (0, utils_1.createHttpClient)(this.userAgent); - } - disposeAndReplaceAllClients() { - for (const [index2] of this.clients.entries()) { - this.disposeAndReplaceClient(index2); - } - } - }; - exports2.HttpManager = HttpManager; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/upload-gzip.js -var require_upload_gzip = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/upload-gzip.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues2 = exports2 && exports2.__asyncValues || function(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function(v) { - return new Promise(function(resolve14, reject) { - v = o[n](v), settle(resolve14, reject, v.done, v.value); - }); - }; - } - function settle(resolve14, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve14({ value: v2, done: d }); - }, reject); - } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; - var fs32 = __importStar2(require("fs")); - var zlib3 = __importStar2(require("zlib")); - var util_1 = require("util"); - var stat2 = (0, util_1.promisify)(fs32.stat); - var gzipExemptFileExtensions = [ - ".gz", - ".gzip", - ".tgz", - ".taz", - ".Z", - ".taZ", - ".bz2", - ".tbz", - ".tbz2", - ".tz2", - ".lz", - ".lzma", - ".tlz", - ".lzo", - ".xz", - ".txz", - ".zst", - ".zstd", - ".tzst", - ".zip", - ".7z" - // 7ZIP - ]; - function createGZipFileOnDisk(originalFilePath, tempFilePath) { - return __awaiter2(this, void 0, void 0, function* () { - for (const gzipExemptExtension of gzipExemptFileExtensions) { - if (originalFilePath.endsWith(gzipExemptExtension)) { - return Number.MAX_SAFE_INTEGER; - } - } - return new Promise((resolve14, reject) => { - const inputStream = fs32.createReadStream(originalFilePath); - const gzip = zlib3.createGzip(); - const outputStream = fs32.createWriteStream(tempFilePath); - inputStream.pipe(gzip).pipe(outputStream); - outputStream.on("finish", () => __awaiter2(this, void 0, void 0, function* () { - const size = (yield stat2(tempFilePath)).size; - resolve14(size); - })); - outputStream.on("error", (error3) => { - console.log(error3); - reject(error3); - }); - }); - }); - } - exports2.createGZipFileOnDisk = createGZipFileOnDisk; - function createGZipFileInBuffer(originalFilePath) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve14) => __awaiter2(this, void 0, void 0, function* () { - var _a2, e_1, _b, _c; - const inputStream = fs32.createReadStream(originalFilePath); - const gzip = zlib3.createGzip(); - inputStream.pipe(gzip); - const chunks = []; - try { - for (var _d = true, gzip_1 = __asyncValues2(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), _a2 = gzip_1_1.done, !_a2; ) { - _c = gzip_1_1.value; - _d = false; - try { - const chunk = _c; - chunks.push(chunk); - } finally { - _d = true; - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a2 && (_b = gzip_1.return)) yield _b.call(gzip_1); - } finally { - if (e_1) throw e_1.error; - } - } - resolve14(Buffer.concat(chunks)); - })); - }); - } - exports2.createGZipFileInBuffer = createGZipFileInBuffer; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/requestUtils.js -var require_requestUtils2 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/requestUtils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientRequest = exports2.retry = void 0; - var utils_1 = require_utils11(); - var core31 = __importStar2(require_core3()); - var config_variables_1 = require_config_variables(); - function retry2(name, operation, customErrorMessages, maxAttempts) { - return __awaiter2(this, void 0, void 0, function* () { - let response = void 0; - let statusCode = void 0; - let isRetryable = false; - let errorMessage = ""; - let customErrorInformation = void 0; - let attempt = 1; - while (attempt <= maxAttempts) { - try { - response = yield operation(); - statusCode = response.message.statusCode; - if ((0, utils_1.isSuccessStatusCode)(statusCode)) { - return response; - } - if (statusCode) { - customErrorInformation = customErrorMessages.get(statusCode); - } - isRetryable = (0, utils_1.isRetryableStatusCode)(statusCode); - errorMessage = `Artifact service responded with ${statusCode}`; - } catch (error3) { - isRetryable = true; - errorMessage = error3.message; - } - if (!isRetryable) { - core31.info(`${name} - Error is not retryable`); - if (response) { - (0, utils_1.displayHttpDiagnostics)(response); - } - break; - } - core31.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); - yield (0, utils_1.sleep)((0, utils_1.getExponentialRetryTimeInMilliseconds)(attempt)); - attempt++; - } - if (response) { - (0, utils_1.displayHttpDiagnostics)(response); - } - if (customErrorInformation) { - throw Error(`${name} failed: ${customErrorInformation}`); - } - throw Error(`${name} failed: ${errorMessage}`); - }); - } - exports2.retry = retry2; - function retryHttpClientRequest(name, method, customErrorMessages = /* @__PURE__ */ new Map(), maxAttempts = (0, config_variables_1.getRetryLimit)()) { - return __awaiter2(this, void 0, void 0, function* () { - return yield retry2(name, method, customErrorMessages, maxAttempts); - }); - } - exports2.retryHttpClientRequest = retryHttpClientRequest; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/upload-http-client.js -var require_upload_http_client = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/upload-http-client.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UploadHttpClient = void 0; - var fs32 = __importStar2(require("fs")); - var core31 = __importStar2(require_core3()); - var tmp = __importStar2(require_tmp_promise()); - var stream2 = __importStar2(require("stream")); - var utils_1 = require_utils11(); - var config_variables_1 = require_config_variables(); - var util_1 = require("util"); - var url_1 = require("url"); - var perf_hooks_1 = require("perf_hooks"); - var status_reporter_1 = require_status_reporter(); - var http_client_1 = require_lib5(); - var http_manager_1 = require_http_manager(); - var upload_gzip_1 = require_upload_gzip(); - var requestUtils_1 = require_requestUtils2(); - var stat2 = (0, util_1.promisify)(fs32.stat); - var UploadHttpClient = class { - constructor() { - this.uploadHttpManager = new http_manager_1.HttpManager((0, config_variables_1.getUploadFileConcurrency)(), "@actions/artifact-upload"); - this.statusReporter = new status_reporter_1.StatusReporter(1e4); - } - /** - * Creates a file container for the new artifact in the remote blob storage/file service - * @param {string} artifactName Name of the artifact being created - * @returns The response from the Artifact Service if the file container was successfully created - */ - createArtifactInFileContainer(artifactName, options) { - return __awaiter2(this, void 0, void 0, function* () { - const parameters = { - Type: "actions_storage", - Name: artifactName - }; - if (options && options.retentionDays) { - const maxRetentionStr = (0, config_variables_1.getRetentionDays)(); - parameters.RetentionDays = (0, utils_1.getProperRetention)(options.retentionDays, maxRetentionStr); - } - const data = JSON.stringify(parameters, null, 2); - const artifactUrl = (0, utils_1.getArtifactUrl)(); - const client = this.uploadHttpManager.getClient(0); - const headers = (0, utils_1.getUploadHeaders)("application/json", false); - const customErrorMessages = /* @__PURE__ */ new Map([ - [ - http_client_1.HttpCodes.Forbidden, - (0, config_variables_1.isGhes)() ? "Please reference [Enabling GitHub Actions for GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.8/admin/github-actions/enabling-github-actions-for-github-enterprise-server) to ensure Actions storage is configured correctly." : "Artifact storage quota has been hit. Unable to upload any new artifacts" - ], - [ - http_client_1.HttpCodes.BadRequest, - `The artifact name ${artifactName} is not valid. Request URL ${artifactUrl}` - ] - ]); - const response = yield (0, requestUtils_1.retryHttpClientRequest)("Create Artifact Container", () => __awaiter2(this, void 0, void 0, function* () { - return client.post(artifactUrl, data, headers); - }), customErrorMessages); - const body = yield response.readBody(); - return JSON.parse(body); - }); - } - /** - * Concurrently upload all of the files in chunks - * @param {string} uploadUrl Base Url for the artifact that was created - * @param {SearchResult[]} filesToUpload A list of information about the files being uploaded - * @returns The size of all the files uploaded in bytes - */ - uploadArtifactToFileContainer(uploadUrl, filesToUpload, options) { - return __awaiter2(this, void 0, void 0, function* () { - const FILE_CONCURRENCY = (0, config_variables_1.getUploadFileConcurrency)(); - const MAX_CHUNK_SIZE = (0, config_variables_1.getUploadChunkSize)(); - core31.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); - const parameters = []; - let continueOnError = true; - if (options) { - if (options.continueOnError === false) { - continueOnError = false; - } - } - for (const file of filesToUpload) { - const resourceUrl = new url_1.URL(uploadUrl); - resourceUrl.searchParams.append("itemPath", file.uploadFilePath); - parameters.push({ - file: file.absoluteFilePath, - resourceUrl: resourceUrl.toString(), - maxChunkSize: MAX_CHUNK_SIZE, - continueOnError - }); - } - const parallelUploads = [...new Array(FILE_CONCURRENCY).keys()]; - const failedItemsToReport = []; - let currentFile = 0; - let completedFiles = 0; - let uploadFileSize = 0; - let totalFileSize = 0; - let abortPendingFileUploads = false; - this.statusReporter.setTotalNumberOfFilesToProcess(filesToUpload.length); - this.statusReporter.start(); - yield Promise.all(parallelUploads.map((index2) => __awaiter2(this, void 0, void 0, function* () { - while (currentFile < filesToUpload.length) { - const currentFileParameters = parameters[currentFile]; - currentFile += 1; - if (abortPendingFileUploads) { - failedItemsToReport.push(currentFileParameters.file); - continue; - } - const startTime = perf_hooks_1.performance.now(); - const uploadFileResult = yield this.uploadFileAsync(index2, currentFileParameters); - if (core31.isDebug()) { - core31.debug(`File: ${++completedFiles}/${filesToUpload.length}. ${currentFileParameters.file} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish upload`); - } - uploadFileSize += uploadFileResult.successfulUploadSize; - totalFileSize += uploadFileResult.totalSize; - if (uploadFileResult.isSuccess === false) { - failedItemsToReport.push(currentFileParameters.file); - if (!continueOnError) { - core31.error(`aborting artifact upload`); - abortPendingFileUploads = true; - } - } - this.statusReporter.incrementProcessedCount(); - } - }))); - this.statusReporter.stop(); - this.uploadHttpManager.disposeAndReplaceAllClients(); - core31.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); - return { - uploadSize: uploadFileSize, - totalSize: totalFileSize, - failedItems: failedItemsToReport - }; - }); - } - /** - * Asynchronously uploads a file. The file is compressed and uploaded using GZip if it is determined to save space. - * If the upload file is bigger than the max chunk size it will be uploaded via multiple calls - * @param {number} httpClientIndex The index of the httpClient that is being used to make all of the calls - * @param {UploadFileParameters} parameters Information about the file that needs to be uploaded - * @returns The size of the file that was uploaded in bytes along with any failed uploads - */ - uploadFileAsync(httpClientIndex, parameters) { - return __awaiter2(this, void 0, void 0, function* () { - const fileStat = yield stat2(parameters.file); - const totalFileSize = fileStat.size; - const isFIFO = fileStat.isFIFO(); - let offset = 0; - let isUploadSuccessful = true; - let failedChunkSizes = 0; - let uploadFileSize = 0; - let isGzip = true; - if (!isFIFO && totalFileSize < 65536) { - core31.debug(`${parameters.file} is less than 64k in size. Creating a gzip file in-memory to potentially reduce the upload size`); - const buffer = yield (0, upload_gzip_1.createGZipFileInBuffer)(parameters.file); - let openUploadStream; - if (totalFileSize < buffer.byteLength) { - core31.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); - openUploadStream = () => fs32.createReadStream(parameters.file); - isGzip = false; - uploadFileSize = totalFileSize; - } else { - core31.debug(`A gzip file created for ${parameters.file} helped with reducing the size of the original file. The file will be uploaded using gzip.`); - openUploadStream = () => { - const passThrough = new stream2.PassThrough(); - passThrough.end(buffer); - return passThrough; - }; - uploadFileSize = buffer.byteLength; - } - const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, openUploadStream, 0, uploadFileSize - 1, uploadFileSize, isGzip, totalFileSize); - if (!result) { - isUploadSuccessful = false; - failedChunkSizes += uploadFileSize; - core31.warning(`Aborting upload for ${parameters.file} due to failure`); - } - return { - isSuccess: isUploadSuccessful, - successfulUploadSize: uploadFileSize - failedChunkSizes, - totalSize: totalFileSize - }; - } else { - const tempFile = yield tmp.file(); - core31.debug(`${parameters.file} is greater than 64k in size. Creating a gzip file on-disk ${tempFile.path} to potentially reduce the upload size`); - uploadFileSize = yield (0, upload_gzip_1.createGZipFileOnDisk)(parameters.file, tempFile.path); - let uploadFilePath = tempFile.path; - if (!isFIFO && totalFileSize < uploadFileSize) { - core31.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); - uploadFileSize = totalFileSize; - uploadFilePath = parameters.file; - isGzip = false; - } else { - core31.debug(`The gzip file created for ${parameters.file} is smaller than the original file. The file will be uploaded using gzip.`); - } - let abortFileUpload = false; - while (offset < uploadFileSize) { - const chunkSize = Math.min(uploadFileSize - offset, parameters.maxChunkSize); - const startChunkIndex = offset; - const endChunkIndex = offset + chunkSize - 1; - offset += parameters.maxChunkSize; - if (abortFileUpload) { - failedChunkSizes += chunkSize; - continue; - } - const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs32.createReadStream(uploadFilePath, { - start: startChunkIndex, - end: endChunkIndex, - autoClose: false - }), startChunkIndex, endChunkIndex, uploadFileSize, isGzip, totalFileSize); - if (!result) { - isUploadSuccessful = false; - failedChunkSizes += chunkSize; - core31.warning(`Aborting upload for ${parameters.file} due to failure`); - abortFileUpload = true; - } else { - if (uploadFileSize > 8388608) { - this.statusReporter.updateLargeFileStatus(parameters.file, startChunkIndex, endChunkIndex, uploadFileSize); - } - } - } - core31.debug(`deleting temporary gzip file ${tempFile.path}`); - yield tempFile.cleanup(); - return { - isSuccess: isUploadSuccessful, - successfulUploadSize: uploadFileSize - failedChunkSizes, - totalSize: totalFileSize - }; - } - }); - } - /** - * Uploads a chunk of an individual file to the specified resourceUrl. If the upload fails and the status code - * indicates a retryable status, we try to upload the chunk as well - * @param {number} httpClientIndex The index of the httpClient being used to make all the necessary calls - * @param {string} resourceUrl Url of the resource that the chunk will be uploaded to - * @param {NodeJS.ReadableStream} openStream Stream of the file that will be uploaded - * @param {number} start Starting byte index of file that the chunk belongs to - * @param {number} end Ending byte index of file that the chunk belongs to - * @param {number} uploadFileSize Total size of the file in bytes that is being uploaded - * @param {boolean} isGzip Denotes if we are uploading a Gzip compressed stream - * @param {number} totalFileSize Original total size of the file that is being uploaded - * @returns if the chunk was successfully uploaded - */ - uploadChunk(httpClientIndex, resourceUrl, openStream, start, end, uploadFileSize, isGzip, totalFileSize) { - return __awaiter2(this, void 0, void 0, function* () { - const digest = yield (0, utils_1.digestForStream)(openStream()); - const headers = (0, utils_1.getUploadHeaders)("application/octet-stream", true, isGzip, totalFileSize, end - start + 1, (0, utils_1.getContentRange)(start, end, uploadFileSize), digest); - const uploadChunkRequest = () => __awaiter2(this, void 0, void 0, function* () { - const client = this.uploadHttpManager.getClient(httpClientIndex); - return yield client.sendStream("PUT", resourceUrl, openStream(), headers); - }); - let retryCount = 0; - const retryLimit = (0, config_variables_1.getRetryLimit)(); - const incrementAndCheckRetryLimit = (response) => { - retryCount++; - if (retryCount > retryLimit) { - if (response) { - (0, utils_1.displayHttpDiagnostics)(response); - } - core31.info(`Retry limit has been reached for chunk at offset ${start} to ${resourceUrl}`); - return true; - } - return false; - }; - const backOff = (retryAfterValue) => __awaiter2(this, void 0, void 0, function* () { - this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); - if (retryAfterValue) { - core31.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); - yield (0, utils_1.sleep)(retryAfterValue); - } else { - const backoffTime = (0, utils_1.getExponentialRetryTimeInMilliseconds)(retryCount); - core31.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); - yield (0, utils_1.sleep)(backoffTime); - } - core31.info(`Finished backoff for retry #${retryCount}, continuing with upload`); - return; - }); - while (retryCount <= retryLimit) { - let response; - try { - response = yield uploadChunkRequest(); - } catch (error3) { - core31.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); - console.log(error3); - if (incrementAndCheckRetryLimit()) { - return false; - } - yield backOff(); - continue; - } - yield response.readBody(); - if ((0, utils_1.isSuccessStatusCode)(response.message.statusCode)) { - return true; - } else if ((0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core31.info(`A ${response.message.statusCode} status code has been received, will attempt to retry the upload`); - if (incrementAndCheckRetryLimit(response)) { - return false; - } - (0, utils_1.isThrottledStatusCode)(response.message.statusCode) ? yield backOff((0, utils_1.tryGetRetryAfterValueTimeInMilliseconds)(response.message.headers)) : yield backOff(); - } else { - core31.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); - (0, utils_1.displayHttpDiagnostics)(response); - return false; - } - } - return false; - }); - } - /** - * Updates the size of the artifact from -1 which was initially set when the container was first created for the artifact. - * Updating the size indicates that we are done uploading all the contents of the artifact - */ - patchArtifactSize(size, artifactName) { - return __awaiter2(this, void 0, void 0, function* () { - const resourceUrl = new url_1.URL((0, utils_1.getArtifactUrl)()); - resourceUrl.searchParams.append("artifactName", artifactName); - const parameters = { Size: size }; - const data = JSON.stringify(parameters, null, 2); - core31.debug(`URL is ${resourceUrl.toString()}`); - const client = this.uploadHttpManager.getClient(0); - const headers = (0, utils_1.getUploadHeaders)("application/json", false); - const customErrorMessages = /* @__PURE__ */ new Map([ - [ - http_client_1.HttpCodes.NotFound, - `An Artifact with the name ${artifactName} was not found` - ] - ]); - const response = yield (0, requestUtils_1.retryHttpClientRequest)("Finalize artifact upload", () => __awaiter2(this, void 0, void 0, function* () { - return client.patch(resourceUrl.toString(), data, headers); - }), customErrorMessages); - yield response.readBody(); - core31.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); - }); - } - }; - exports2.UploadHttpClient = UploadHttpClient; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/download-http-client.js -var require_download_http_client = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/download-http-client.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DownloadHttpClient = void 0; - var fs32 = __importStar2(require("fs")); - var core31 = __importStar2(require_core3()); - var zlib3 = __importStar2(require("zlib")); - var utils_1 = require_utils11(); - var url_1 = require("url"); - var status_reporter_1 = require_status_reporter(); - var perf_hooks_1 = require("perf_hooks"); - var http_manager_1 = require_http_manager(); - var config_variables_1 = require_config_variables(); - var requestUtils_1 = require_requestUtils2(); - var DownloadHttpClient = class { - constructor() { - this.downloadHttpManager = new http_manager_1.HttpManager((0, config_variables_1.getDownloadFileConcurrency)(), "@actions/artifact-download"); - this.statusReporter = new status_reporter_1.StatusReporter(1e3); - } - /** - * Gets a list of all artifacts that are in a specific container - */ - listArtifacts() { - return __awaiter2(this, void 0, void 0, function* () { - const artifactUrl = (0, utils_1.getArtifactUrl)(); - const client = this.downloadHttpManager.getClient(0); - const headers = (0, utils_1.getDownloadHeaders)("application/json"); - const response = yield (0, requestUtils_1.retryHttpClientRequest)("List Artifacts", () => __awaiter2(this, void 0, void 0, function* () { - return client.get(artifactUrl, headers); - })); - const body = yield response.readBody(); - return JSON.parse(body); - }); - } - /** - * Fetches a set of container items that describe the contents of an artifact - * @param artifactName the name of the artifact - * @param containerUrl the artifact container URL for the run - */ - getContainerItems(artifactName, containerUrl) { - return __awaiter2(this, void 0, void 0, function* () { - const resourceUrl = new url_1.URL(containerUrl); - resourceUrl.searchParams.append("itemPath", artifactName); - const client = this.downloadHttpManager.getClient(0); - const headers = (0, utils_1.getDownloadHeaders)("application/json"); - const response = yield (0, requestUtils_1.retryHttpClientRequest)("Get Container Items", () => __awaiter2(this, void 0, void 0, function* () { - return client.get(resourceUrl.toString(), headers); - })); - const body = yield response.readBody(); - return JSON.parse(body); - }); - } - /** - * Concurrently downloads all the files that are part of an artifact - * @param downloadItems information about what items to download and where to save them - */ - downloadSingleArtifact(downloadItems) { - return __awaiter2(this, void 0, void 0, function* () { - const DOWNLOAD_CONCURRENCY = (0, config_variables_1.getDownloadFileConcurrency)(); - core31.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); - const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; - let currentFile = 0; - let downloadedFiles = 0; - core31.info(`Total number of files that will be downloaded: ${downloadItems.length}`); - this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); - this.statusReporter.start(); - yield Promise.all(parallelDownloads.map((index2) => __awaiter2(this, void 0, void 0, function* () { - while (currentFile < downloadItems.length) { - const currentFileToDownload = downloadItems[currentFile]; - currentFile += 1; - const startTime = perf_hooks_1.performance.now(); - yield this.downloadIndividualFile(index2, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); - if (core31.isDebug()) { - core31.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); - } - this.statusReporter.incrementProcessedCount(); - } - }))).catch((error3) => { - throw new Error(`Unable to download the artifact: ${error3}`); - }).finally(() => { - this.statusReporter.stop(); - this.downloadHttpManager.disposeAndReplaceAllClients(); - }); - }); - } - /** - * Downloads an individual file - * @param httpClientIndex the index of the http client that is used to make all of the calls - * @param artifactLocation origin location where a file will be downloaded from - * @param downloadPath destination location for the file being downloaded - */ - downloadIndividualFile(httpClientIndex, artifactLocation, downloadPath) { - return __awaiter2(this, void 0, void 0, function* () { - let retryCount = 0; - const retryLimit = (0, config_variables_1.getRetryLimit)(); - let destinationStream = fs32.createWriteStream(downloadPath); - const headers = (0, utils_1.getDownloadHeaders)("application/json", true, true); - const makeDownloadRequest = () => __awaiter2(this, void 0, void 0, function* () { - const client = this.downloadHttpManager.getClient(httpClientIndex); - return yield client.get(artifactLocation, headers); - }); - const isGzip = (incomingHeaders) => { - return "content-encoding" in incomingHeaders && incomingHeaders["content-encoding"] === "gzip"; - }; - const backOff = (retryAfterValue) => __awaiter2(this, void 0, void 0, function* () { - retryCount++; - if (retryCount > retryLimit) { - return Promise.reject(new Error(`Retry limit has been reached. Unable to download ${artifactLocation}`)); - } else { - this.downloadHttpManager.disposeAndReplaceClient(httpClientIndex); - if (retryAfterValue) { - core31.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the download`); - yield (0, utils_1.sleep)(retryAfterValue); - } else { - const backoffTime = (0, utils_1.getExponentialRetryTimeInMilliseconds)(retryCount); - core31.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); - yield (0, utils_1.sleep)(backoffTime); - } - core31.info(`Finished backoff for retry #${retryCount}, continuing with download`); - } - }); - const isAllBytesReceived = (expected, received) => { - if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { - core31.info("Skipping download validation."); - return true; - } - return parseInt(expected) === received; - }; - const resetDestinationStream = (fileDownloadPath) => __awaiter2(this, void 0, void 0, function* () { - destinationStream.close(); - yield new Promise((resolve14) => { - destinationStream.on("close", resolve14); - if (destinationStream.writableFinished) { - resolve14(); - } - }); - yield (0, utils_1.rmFile)(fileDownloadPath); - destinationStream = fs32.createWriteStream(fileDownloadPath); - }); - while (retryCount <= retryLimit) { - let response; - try { - response = yield makeDownloadRequest(); - } catch (error3) { - core31.info("An error occurred while attempting to download a file"); - console.log(error3); - yield backOff(); - continue; - } - let forceRetry = false; - if ((0, utils_1.isSuccessStatusCode)(response.message.statusCode)) { - try { - const isGzipped = isGzip(response.message.headers); - yield this.pipeResponseToFile(response, destinationStream, isGzipped); - if (isGzipped || isAllBytesReceived(response.message.headers["content-length"], yield (0, utils_1.getFileSize)(downloadPath))) { - return; - } else { - forceRetry = true; - } - } catch (error3) { - forceRetry = true; - } - } - if (forceRetry || (0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core31.info(`A ${response.message.statusCode} response code has been received while attempting to download an artifact`); - resetDestinationStream(downloadPath); - (0, utils_1.isThrottledStatusCode)(response.message.statusCode) ? yield backOff((0, utils_1.tryGetRetryAfterValueTimeInMilliseconds)(response.message.headers)) : yield backOff(); - } else { - (0, utils_1.displayHttpDiagnostics)(response); - return Promise.reject(new Error(`Unexpected http ${response.message.statusCode} during download for ${artifactLocation}`)); - } - } - }); - } - /** - * Pipes the response from downloading an individual file to the appropriate destination stream while decoding gzip content if necessary - * @param response the http response received when downloading a file - * @param destinationStream the stream where the file should be written to - * @param isGzip a boolean denoting if the content is compressed using gzip and if we need to decode it - */ - pipeResponseToFile(response, destinationStream, isGzip) { - return __awaiter2(this, void 0, void 0, function* () { - yield new Promise((resolve14, reject) => { - if (isGzip) { - const gunzip = zlib3.createGunzip(); - response.message.on("error", (error3) => { - core31.info(`An error occurred while attempting to read the response stream`); - gunzip.close(); - destinationStream.close(); - reject(error3); - }).pipe(gunzip).on("error", (error3) => { - core31.info(`An error occurred while attempting to decompress the response stream`); - destinationStream.close(); - reject(error3); - }).pipe(destinationStream).on("close", () => { - resolve14(); - }).on("error", (error3) => { - core31.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error3); - }); - } else { - response.message.on("error", (error3) => { - core31.info(`An error occurred while attempting to read the response stream`); - destinationStream.close(); - reject(error3); - }).pipe(destinationStream).on("close", () => { - resolve14(); - }).on("error", (error3) => { - core31.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error3); - }); - } - }); - return; - }); - } - }; - exports2.DownloadHttpClient = DownloadHttpClient; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/download-specification.js -var require_download_specification = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/download-specification.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getDownloadSpecification = void 0; - var path30 = __importStar2(require("path")); - function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { - const directories = /* @__PURE__ */ new Set(); - const specifications = { - rootDownloadLocation: includeRootDirectory ? path30.join(downloadPath, artifactName) : downloadPath, - directoryStructure: [], - emptyFilesToCreate: [], - filesToDownload: [] - }; - for (const entry of artifactEntries) { - if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { - const normalizedPathEntry = path30.normalize(entry.path); - const filePath = path30.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); - if (entry.itemType === "file") { - directories.add(path30.dirname(filePath)); - if (entry.fileLength === 0) { - specifications.emptyFilesToCreate.push(filePath); - } else { - specifications.filesToDownload.push({ - sourceLocation: entry.contentLocation, - targetPath: filePath - }); - } - } - } - } - specifications.directoryStructure = Array.from(directories); - return specifications; - } - exports2.getDownloadSpecification = getDownloadSpecification; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/artifact-client.js -var require_artifact_client = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/artifact-client.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve14) { - resolve14(value); - }); - } - return new (P || (P = Promise))(function(resolve14, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultArtifactClient = void 0; - var core31 = __importStar2(require_core3()); - var upload_specification_1 = require_upload_specification(); - var upload_http_client_1 = require_upload_http_client(); - var utils_1 = require_utils11(); - var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation2(); - var download_http_client_1 = require_download_http_client(); - var download_specification_1 = require_download_specification(); - var config_variables_1 = require_config_variables(); - var path_1 = require("path"); - var DefaultArtifactClient2 = class _DefaultArtifactClient { - /** - * Constructs a DefaultArtifactClient - */ - static create() { - return new _DefaultArtifactClient(); - } - /** - * Uploads an artifact - */ - uploadArtifact(name, files, rootDirectory, options) { - return __awaiter2(this, void 0, void 0, function* () { - core31.info(`Starting artifact upload -For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging`); - (0, path_and_artifact_name_validation_1.checkArtifactName)(name); - const uploadSpecification = (0, upload_specification_1.getUploadSpecification)(name, rootDirectory, files); - const uploadResponse = { - artifactName: name, - artifactItems: [], - size: 0, - failedItems: [] - }; - const uploadHttpClient = new upload_http_client_1.UploadHttpClient(); - if (uploadSpecification.length === 0) { - core31.warning(`No files found that can be uploaded`); - } else { - const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); - if (!response.fileContainerResourceUrl) { - core31.debug(response.toString()); - throw new Error("No URL provided by the Artifact Service to upload an artifact to"); - } - core31.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); - core31.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); - const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); - core31.info(`File upload process has finished. Finalizing the artifact upload`); - yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); - if (uploadResult.failedItems.length > 0) { - core31.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); - } else { - core31.info(`Artifact has been finalized. All files have been successfully uploaded!`); - } - core31.info(` -The raw size of all the files that were specified for upload is ${uploadResult.totalSize} bytes -The size of all the files that were uploaded is ${uploadResult.uploadSize} bytes. This takes into account any gzip compression used to reduce the upload size, time and storage - -Note: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads \r -`); - uploadResponse.artifactItems = uploadSpecification.map((item) => item.absoluteFilePath); - uploadResponse.size = uploadResult.uploadSize; - uploadResponse.failedItems = uploadResult.failedItems; - } - return uploadResponse; - }); - } - downloadArtifact(name, path30, options) { - return __awaiter2(this, void 0, void 0, function* () { - const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); - const artifacts = yield downloadHttpClient.listArtifacts(); - if (artifacts.count === 0) { - throw new Error(`Unable to find any artifacts for the associated workflow`); - } - const artifactToDownload = artifacts.value.find((artifact2) => { - return artifact2.name === name; - }); - if (!artifactToDownload) { - throw new Error(`Unable to find an artifact with the name: ${name}`); - } - const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl); - if (!path30) { - path30 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path30 = (0, path_1.normalize)(path30); - path30 = (0, path_1.resolve)(path30); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path30, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); - if (downloadSpecification.filesToDownload.length === 0) { - core31.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); - } else { - yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); - core31.info("Directory structure has been set up for the artifact"); - yield (0, utils_1.createEmptyFilesForArtifact)(downloadSpecification.emptyFilesToCreate); - yield downloadHttpClient.downloadSingleArtifact(downloadSpecification.filesToDownload); - } - return { - artifactName: name, - downloadPath: downloadSpecification.rootDownloadLocation - }; - }); - } - downloadAllArtifacts(path30) { - return __awaiter2(this, void 0, void 0, function* () { - const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); - const response = []; - const artifacts = yield downloadHttpClient.listArtifacts(); - if (artifacts.count === 0) { - core31.info("Unable to find any artifacts for the associated workflow"); - return response; - } - if (!path30) { - path30 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path30 = (0, path_1.normalize)(path30); - path30 = (0, path_1.resolve)(path30); - let downloadedArtifacts = 0; - while (downloadedArtifacts < artifacts.count) { - const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; - downloadedArtifacts += 1; - core31.info(`starting download of artifact ${currentArtifactToDownload.name} : ${downloadedArtifacts}/${artifacts.count}`); - const items = yield downloadHttpClient.getContainerItems(currentArtifactToDownload.name, currentArtifactToDownload.fileContainerResourceUrl); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(currentArtifactToDownload.name, items.value, path30, true); - if (downloadSpecification.filesToDownload.length === 0) { - core31.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`); - } else { - yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); - yield (0, utils_1.createEmptyFilesForArtifact)(downloadSpecification.emptyFilesToCreate); - yield downloadHttpClient.downloadSingleArtifact(downloadSpecification.filesToDownload); - } - response.push({ - artifactName: currentArtifactToDownload.name, - downloadPath: downloadSpecification.rootDownloadLocation - }); - } - return response; - }); - } - }; - exports2.DefaultArtifactClient = DefaultArtifactClient2; - } -}); - -// node_modules/@actions/artifact-legacy/lib/artifact-client.js -var require_artifact_client2 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/artifact-client.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.create = void 0; - var artifact_client_1 = require_artifact_client(); - function create3() { - return artifact_client_1.DefaultArtifactClient.create(); - } - exports2.create = create3; - } -}); - -// node_modules/node-forge/lib/forge.js -var require_forge = __commonJS({ - "node_modules/node-forge/lib/forge.js"(exports2, module2) { - module2.exports = { - // default options - options: { - usePureJavaScript: false - } - }; - } -}); - -// node_modules/node-forge/lib/baseN.js -var require_baseN = __commonJS({ - "node_modules/node-forge/lib/baseN.js"(exports2, module2) { - var api = {}; - module2.exports = api; - var _reverseAlphabets = {}; - api.encode = function(input, alphabet, maxline) { - if (typeof alphabet !== "string") { - throw new TypeError('"alphabet" must be a string.'); - } - if (maxline !== void 0 && typeof maxline !== "number") { - throw new TypeError('"maxline" must be a number.'); - } - var output = ""; - if (!(input instanceof Uint8Array)) { - output = _encodeWithByteBuffer(input, alphabet); - } else { - var i = 0; - var base = alphabet.length; - var first = alphabet.charAt(0); - var digits = [0]; - for (i = 0; i < input.length; ++i) { - for (var j = 0, carry = input[i]; j < digits.length; ++j) { - carry += digits[j] << 8; - digits[j] = carry % base; - carry = carry / base | 0; - } - while (carry > 0) { - digits.push(carry % base); - carry = carry / base | 0; - } - } - for (i = 0; input[i] === 0 && i < input.length - 1; ++i) { - output += first; - } - for (i = digits.length - 1; i >= 0; --i) { - output += alphabet[digits[i]]; - } - } - if (maxline) { - var regex = new RegExp(".{1," + maxline + "}", "g"); - output = output.match(regex).join("\r\n"); - } - return output; - }; - api.decode = function(input, alphabet) { - if (typeof input !== "string") { - throw new TypeError('"input" must be a string.'); - } - if (typeof alphabet !== "string") { - throw new TypeError('"alphabet" must be a string.'); - } - var table = _reverseAlphabets[alphabet]; - if (!table) { - table = _reverseAlphabets[alphabet] = []; - for (var i = 0; i < alphabet.length; ++i) { - table[alphabet.charCodeAt(i)] = i; - } - } - input = input.replace(/\s/g, ""); - var base = alphabet.length; - var first = alphabet.charAt(0); - var bytes = [0]; - for (var i = 0; i < input.length; i++) { - var value = table[input.charCodeAt(i)]; - if (value === void 0) { - return; - } - for (var j = 0, carry = value; j < bytes.length; ++j) { - carry += bytes[j] * base; - bytes[j] = carry & 255; - carry >>= 8; - } - while (carry > 0) { - bytes.push(carry & 255); - carry >>= 8; - } - } - for (var k = 0; input[k] === first && k < input.length - 1; ++k) { - bytes.push(0); - } - if (typeof Buffer !== "undefined") { - return Buffer.from(bytes.reverse()); - } - return new Uint8Array(bytes.reverse()); - }; - function _encodeWithByteBuffer(input, alphabet) { - var i = 0; - var base = alphabet.length; - var first = alphabet.charAt(0); - var digits = [0]; - for (i = 0; i < input.length(); ++i) { - for (var j = 0, carry = input.at(i); j < digits.length; ++j) { - carry += digits[j] << 8; - digits[j] = carry % base; - carry = carry / base | 0; - } - while (carry > 0) { - digits.push(carry % base); - carry = carry / base | 0; - } - } - var output = ""; - for (i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) { - output += first; - } - for (i = digits.length - 1; i >= 0; --i) { - output += alphabet[digits[i]]; - } - return output; - } - } -}); - -// node_modules/node-forge/lib/util.js -var require_util16 = __commonJS({ - "node_modules/node-forge/lib/util.js"(exports2, module2) { - var forge = require_forge(); - var baseN = require_baseN(); - var util3 = module2.exports = forge.util = forge.util || {}; - (function() { - if (typeof process !== "undefined" && process.nextTick && !process.browser) { - util3.nextTick = process.nextTick; - if (typeof setImmediate === "function") { - util3.setImmediate = setImmediate; - } else { - util3.setImmediate = util3.nextTick; - } - return; - } - if (typeof setImmediate === "function") { - util3.setImmediate = function() { - return setImmediate.apply(void 0, arguments); - }; - util3.nextTick = function(callback) { - return setImmediate(callback); - }; - return; - } - util3.setImmediate = function(callback) { - setTimeout(callback, 0); - }; - if (typeof window !== "undefined" && typeof window.postMessage === "function") { - let handler3 = function(event) { - if (event.source === window && event.data === msg) { - event.stopPropagation(); - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); - } - }; - var handler2 = handler3; - var msg = "forge.setImmediate"; - var callbacks = []; - util3.setImmediate = function(callback) { - callbacks.push(callback); - if (callbacks.length === 1) { - window.postMessage(msg, "*"); - } - }; - window.addEventListener("message", handler3, true); - } - if (typeof MutationObserver !== "undefined") { - var now = Date.now(); - var attr = true; - var div = document.createElement("div"); - var callbacks = []; - new MutationObserver(function() { - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); - }).observe(div, { attributes: true }); - var oldSetImmediate = util3.setImmediate; - util3.setImmediate = function(callback) { - if (Date.now() - now > 15) { - now = Date.now(); - oldSetImmediate(callback); - } else { - callbacks.push(callback); - if (callbacks.length === 1) { - div.setAttribute("a", attr = !attr); - } - } - }; - } - util3.nextTick = util3.setImmediate; - })(); - util3.isNodejs = typeof process !== "undefined" && process.versions && process.versions.node; - util3.globalScope = (function() { - if (util3.isNodejs) { - return global; - } - return typeof self === "undefined" ? window : self; - })(); - util3.isArray = Array.isArray || function(x) { - return Object.prototype.toString.call(x) === "[object Array]"; - }; - util3.isArrayBuffer = function(x) { - return typeof ArrayBuffer !== "undefined" && x instanceof ArrayBuffer; - }; - util3.isArrayBufferView = function(x) { - return x && util3.isArrayBuffer(x.buffer) && x.byteLength !== void 0; - }; - function _checkBitsParam(n) { - if (!(n === 8 || n === 16 || n === 24 || n === 32)) { - throw new Error("Only 8, 16, 24, or 32 bits supported: " + n); - } - } - util3.ByteBuffer = ByteStringBuffer; - function ByteStringBuffer(b) { - this.data = ""; - this.read = 0; - if (typeof b === "string") { - this.data = b; - } else if (util3.isArrayBuffer(b) || util3.isArrayBufferView(b)) { - if (typeof Buffer !== "undefined" && b instanceof Buffer) { - this.data = b.toString("binary"); - } else { - var arr = new Uint8Array(b); - try { - this.data = String.fromCharCode.apply(null, arr); - } catch (e) { - for (var i = 0; i < arr.length; ++i) { - this.putByte(arr[i]); - } - } - } - } else if (b instanceof ByteStringBuffer || typeof b === "object" && typeof b.data === "string" && typeof b.read === "number") { - this.data = b.data; - this.read = b.read; - } - this._constructedStringLength = 0; - } - util3.ByteStringBuffer = ByteStringBuffer; - var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; - util3.ByteStringBuffer.prototype._optimizeConstructedString = function(x) { - this._constructedStringLength += x; - if (this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { - this.data.substr(0, 1); - this._constructedStringLength = 0; - } - }; - util3.ByteStringBuffer.prototype.length = function() { - return this.data.length - this.read; - }; - util3.ByteStringBuffer.prototype.isEmpty = function() { - return this.length() <= 0; - }; - util3.ByteStringBuffer.prototype.putByte = function(b) { - return this.putBytes(String.fromCharCode(b)); - }; - util3.ByteStringBuffer.prototype.fillWithByte = function(b, n) { - b = String.fromCharCode(b); - var d = this.data; - while (n > 0) { - if (n & 1) { - d += b; - } - n >>>= 1; - if (n > 0) { - b += b; - } - } - this.data = d; - this._optimizeConstructedString(n); - return this; - }; - util3.ByteStringBuffer.prototype.putBytes = function(bytes) { - this.data += bytes; - this._optimizeConstructedString(bytes.length); - return this; - }; - util3.ByteStringBuffer.prototype.putString = function(str) { - return this.putBytes(util3.encodeUtf8(str)); - }; - util3.ByteStringBuffer.prototype.putInt16 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255) - ); - }; - util3.ByteStringBuffer.prototype.putInt24 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 16 & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255) - ); - }; - util3.ByteStringBuffer.prototype.putInt32 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 24 & 255) + String.fromCharCode(i >> 16 & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255) - ); - }; - util3.ByteStringBuffer.prototype.putInt16Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 255) + String.fromCharCode(i >> 8 & 255) - ); - }; - util3.ByteStringBuffer.prototype.putInt24Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i >> 16 & 255) - ); - }; - util3.ByteStringBuffer.prototype.putInt32Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i >> 16 & 255) + String.fromCharCode(i >> 24 & 255) - ); - }; - util3.ByteStringBuffer.prototype.putInt = function(i, n) { - _checkBitsParam(n); - var bytes = ""; - do { - n -= 8; - bytes += String.fromCharCode(i >> n & 255); - } while (n > 0); - return this.putBytes(bytes); - }; - util3.ByteStringBuffer.prototype.putSignedInt = function(i, n) { - if (i < 0) { - i += 2 << n - 1; - } - return this.putInt(i, n); - }; - util3.ByteStringBuffer.prototype.putBuffer = function(buffer) { - return this.putBytes(buffer.getBytes()); - }; - util3.ByteStringBuffer.prototype.getByte = function() { - return this.data.charCodeAt(this.read++); - }; - util3.ByteStringBuffer.prototype.getInt16 = function() { - var rval = this.data.charCodeAt(this.read) << 8 ^ this.data.charCodeAt(this.read + 1); - this.read += 2; - return rval; - }; - util3.ByteStringBuffer.prototype.getInt24 = function() { - var rval = this.data.charCodeAt(this.read) << 16 ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2); - this.read += 3; - return rval; - }; - util3.ByteStringBuffer.prototype.getInt32 = function() { - var rval = this.data.charCodeAt(this.read) << 24 ^ this.data.charCodeAt(this.read + 1) << 16 ^ this.data.charCodeAt(this.read + 2) << 8 ^ this.data.charCodeAt(this.read + 3); - this.read += 4; - return rval; - }; - util3.ByteStringBuffer.prototype.getInt16Le = function() { - var rval = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8; - this.read += 2; - return rval; - }; - util3.ByteStringBuffer.prototype.getInt24Le = function() { - var rval = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16; - this.read += 3; - return rval; - }; - util3.ByteStringBuffer.prototype.getInt32Le = function() { - var rval = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16 ^ this.data.charCodeAt(this.read + 3) << 24; - this.read += 4; - return rval; - }; - util3.ByteStringBuffer.prototype.getInt = function(n) { - _checkBitsParam(n); - var rval = 0; - do { - rval = (rval << 8) + this.data.charCodeAt(this.read++); - n -= 8; - } while (n > 0); - return rval; - }; - util3.ByteStringBuffer.prototype.getSignedInt = function(n) { - var x = this.getInt(n); - var max = 2 << n - 2; - if (x >= max) { - x -= max << 1; - } - return x; - }; - util3.ByteStringBuffer.prototype.getBytes = function(count) { - var rval; - if (count) { - count = Math.min(this.length(), count); - rval = this.data.slice(this.read, this.read + count); - this.read += count; - } else if (count === 0) { - rval = ""; - } else { - rval = this.read === 0 ? this.data : this.data.slice(this.read); - this.clear(); - } - return rval; - }; - util3.ByteStringBuffer.prototype.bytes = function(count) { - return typeof count === "undefined" ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count); - }; - util3.ByteStringBuffer.prototype.at = function(i) { - return this.data.charCodeAt(this.read + i); - }; - util3.ByteStringBuffer.prototype.setAt = function(i, b) { - this.data = this.data.substr(0, this.read + i) + String.fromCharCode(b) + this.data.substr(this.read + i + 1); - return this; - }; - util3.ByteStringBuffer.prototype.last = function() { - return this.data.charCodeAt(this.data.length - 1); - }; - util3.ByteStringBuffer.prototype.copy = function() { - var c = util3.createBuffer(this.data); - c.read = this.read; - return c; - }; - util3.ByteStringBuffer.prototype.compact = function() { - if (this.read > 0) { - this.data = this.data.slice(this.read); - this.read = 0; - } - return this; - }; - util3.ByteStringBuffer.prototype.clear = function() { - this.data = ""; - this.read = 0; - return this; - }; - util3.ByteStringBuffer.prototype.truncate = function(count) { - var len = Math.max(0, this.length() - count); - this.data = this.data.substr(this.read, len); - this.read = 0; - return this; - }; - util3.ByteStringBuffer.prototype.toHex = function() { - var rval = ""; - for (var i = this.read; i < this.data.length; ++i) { - var b = this.data.charCodeAt(i); - if (b < 16) { - rval += "0"; - } - rval += b.toString(16); - } - return rval; - }; - util3.ByteStringBuffer.prototype.toString = function() { - return util3.decodeUtf8(this.bytes()); - }; - function DataBuffer(b, options) { - options = options || {}; - this.read = options.readOffset || 0; - this.growSize = options.growSize || 1024; - var isArrayBuffer = util3.isArrayBuffer(b); - var isArrayBufferView = util3.isArrayBufferView(b); - if (isArrayBuffer || isArrayBufferView) { - if (isArrayBuffer) { - this.data = new DataView(b); - } else { - this.data = new DataView(b.buffer, b.byteOffset, b.byteLength); - } - this.write = "writeOffset" in options ? options.writeOffset : this.data.byteLength; - return; - } - this.data = new DataView(new ArrayBuffer(0)); - this.write = 0; - if (b !== null && b !== void 0) { - this.putBytes(b); - } - if ("writeOffset" in options) { - this.write = options.writeOffset; - } - } - util3.DataBuffer = DataBuffer; - util3.DataBuffer.prototype.length = function() { - return this.write - this.read; - }; - util3.DataBuffer.prototype.isEmpty = function() { - return this.length() <= 0; - }; - util3.DataBuffer.prototype.accommodate = function(amount, growSize) { - if (this.length() >= amount) { - return this; - } - growSize = Math.max(growSize || this.growSize, amount); - var src = new Uint8Array( - this.data.buffer, - this.data.byteOffset, - this.data.byteLength - ); - var dst = new Uint8Array(this.length() + growSize); - dst.set(src); - this.data = new DataView(dst.buffer); - return this; - }; - util3.DataBuffer.prototype.putByte = function(b) { - this.accommodate(1); - this.data.setUint8(this.write++, b); - return this; - }; - util3.DataBuffer.prototype.fillWithByte = function(b, n) { - this.accommodate(n); - for (var i = 0; i < n; ++i) { - this.data.setUint8(b); - } - return this; - }; - util3.DataBuffer.prototype.putBytes = function(bytes, encoding) { - if (util3.isArrayBufferView(bytes)) { - var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); - var len = src.byteLength - src.byteOffset; - this.accommodate(len); - var dst = new Uint8Array(this.data.buffer, this.write); - dst.set(src); - this.write += len; - return this; - } - if (util3.isArrayBuffer(bytes)) { - var src = new Uint8Array(bytes); - this.accommodate(src.byteLength); - var dst = new Uint8Array(this.data.buffer); - dst.set(src, this.write); - this.write += src.byteLength; - return this; - } - if (bytes instanceof util3.DataBuffer || typeof bytes === "object" && typeof bytes.read === "number" && typeof bytes.write === "number" && util3.isArrayBufferView(bytes.data)) { - var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length()); - this.accommodate(src.byteLength); - var dst = new Uint8Array(bytes.data.byteLength, this.write); - dst.set(src); - this.write += src.byteLength; - return this; - } - if (bytes instanceof util3.ByteStringBuffer) { - bytes = bytes.data; - encoding = "binary"; - } - encoding = encoding || "binary"; - if (typeof bytes === "string") { - var view; - if (encoding === "hex") { - this.accommodate(Math.ceil(bytes.length / 2)); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util3.binary.hex.decode(bytes, view, this.write); - return this; - } - if (encoding === "base64") { - this.accommodate(Math.ceil(bytes.length / 4) * 3); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util3.binary.base64.decode(bytes, view, this.write); - return this; - } - if (encoding === "utf8") { - bytes = util3.encodeUtf8(bytes); - encoding = "binary"; - } - if (encoding === "binary" || encoding === "raw") { - this.accommodate(bytes.length); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util3.binary.raw.decode(view); - return this; - } - if (encoding === "utf16") { - this.accommodate(bytes.length * 2); - view = new Uint16Array(this.data.buffer, this.write); - this.write += util3.text.utf16.encode(view); - return this; - } - throw new Error("Invalid encoding: " + encoding); - } - throw Error("Invalid parameter: " + bytes); - }; - util3.DataBuffer.prototype.putBuffer = function(buffer) { - this.putBytes(buffer); - buffer.clear(); - return this; - }; - util3.DataBuffer.prototype.putString = function(str) { - return this.putBytes(str, "utf16"); - }; - util3.DataBuffer.prototype.putInt16 = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i); - this.write += 2; - return this; - }; - util3.DataBuffer.prototype.putInt24 = function(i) { - this.accommodate(3); - this.data.setInt16(this.write, i >> 8 & 65535); - this.data.setInt8(this.write, i >> 16 & 255); - this.write += 3; - return this; - }; - util3.DataBuffer.prototype.putInt32 = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i); - this.write += 4; - return this; - }; - util3.DataBuffer.prototype.putInt16Le = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i, true); - this.write += 2; - return this; - }; - util3.DataBuffer.prototype.putInt24Le = function(i) { - this.accommodate(3); - this.data.setInt8(this.write, i >> 16 & 255); - this.data.setInt16(this.write, i >> 8 & 65535, true); - this.write += 3; - return this; - }; - util3.DataBuffer.prototype.putInt32Le = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i, true); - this.write += 4; - return this; - }; - util3.DataBuffer.prototype.putInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - do { - n -= 8; - this.data.setInt8(this.write++, i >> n & 255); - } while (n > 0); - return this; - }; - util3.DataBuffer.prototype.putSignedInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - if (i < 0) { - i += 2 << n - 1; - } - return this.putInt(i, n); - }; - util3.DataBuffer.prototype.getByte = function() { - return this.data.getInt8(this.read++); - }; - util3.DataBuffer.prototype.getInt16 = function() { - var rval = this.data.getInt16(this.read); - this.read += 2; - return rval; - }; - util3.DataBuffer.prototype.getInt24 = function() { - var rval = this.data.getInt16(this.read) << 8 ^ this.data.getInt8(this.read + 2); - this.read += 3; - return rval; - }; - util3.DataBuffer.prototype.getInt32 = function() { - var rval = this.data.getInt32(this.read); - this.read += 4; - return rval; - }; - util3.DataBuffer.prototype.getInt16Le = function() { - var rval = this.data.getInt16(this.read, true); - this.read += 2; - return rval; - }; - util3.DataBuffer.prototype.getInt24Le = function() { - var rval = this.data.getInt8(this.read) ^ this.data.getInt16(this.read + 1, true) << 8; - this.read += 3; - return rval; - }; - util3.DataBuffer.prototype.getInt32Le = function() { - var rval = this.data.getInt32(this.read, true); - this.read += 4; - return rval; - }; - util3.DataBuffer.prototype.getInt = function(n) { - _checkBitsParam(n); - var rval = 0; - do { - rval = (rval << 8) + this.data.getInt8(this.read++); - n -= 8; - } while (n > 0); - return rval; - }; - util3.DataBuffer.prototype.getSignedInt = function(n) { - var x = this.getInt(n); - var max = 2 << n - 2; - if (x >= max) { - x -= max << 1; - } - return x; - }; - util3.DataBuffer.prototype.getBytes = function(count) { - var rval; - if (count) { - count = Math.min(this.length(), count); - rval = this.data.slice(this.read, this.read + count); - this.read += count; - } else if (count === 0) { - rval = ""; - } else { - rval = this.read === 0 ? this.data : this.data.slice(this.read); - this.clear(); - } - return rval; - }; - util3.DataBuffer.prototype.bytes = function(count) { - return typeof count === "undefined" ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count); - }; - util3.DataBuffer.prototype.at = function(i) { - return this.data.getUint8(this.read + i); - }; - util3.DataBuffer.prototype.setAt = function(i, b) { - this.data.setUint8(i, b); - return this; - }; - util3.DataBuffer.prototype.last = function() { - return this.data.getUint8(this.write - 1); - }; - util3.DataBuffer.prototype.copy = function() { - return new util3.DataBuffer(this); - }; - util3.DataBuffer.prototype.compact = function() { - if (this.read > 0) { - var src = new Uint8Array(this.data.buffer, this.read); - var dst = new Uint8Array(src.byteLength); - dst.set(src); - this.data = new DataView(dst); - this.write -= this.read; - this.read = 0; - } - return this; - }; - util3.DataBuffer.prototype.clear = function() { - this.data = new DataView(new ArrayBuffer(0)); - this.read = this.write = 0; - return this; - }; - util3.DataBuffer.prototype.truncate = function(count) { - this.write = Math.max(0, this.length() - count); - this.read = Math.min(this.read, this.write); - return this; - }; - util3.DataBuffer.prototype.toHex = function() { - var rval = ""; - for (var i = this.read; i < this.data.byteLength; ++i) { - var b = this.data.getUint8(i); - if (b < 16) { - rval += "0"; - } - rval += b.toString(16); - } - return rval; - }; - util3.DataBuffer.prototype.toString = function(encoding) { - var view = new Uint8Array(this.data, this.read, this.length()); - encoding = encoding || "utf8"; - if (encoding === "binary" || encoding === "raw") { - return util3.binary.raw.encode(view); - } - if (encoding === "hex") { - return util3.binary.hex.encode(view); - } - if (encoding === "base64") { - return util3.binary.base64.encode(view); - } - if (encoding === "utf8") { - return util3.text.utf8.decode(view); - } - if (encoding === "utf16") { - return util3.text.utf16.decode(view); - } - throw new Error("Invalid encoding: " + encoding); - }; - util3.createBuffer = function(input, encoding) { - encoding = encoding || "raw"; - if (input !== void 0 && encoding === "utf8") { - input = util3.encodeUtf8(input); - } - return new util3.ByteBuffer(input); - }; - util3.fillString = function(c, n) { - var s = ""; - while (n > 0) { - if (n & 1) { - s += c; - } - n >>>= 1; - if (n > 0) { - c += c; - } - } - return s; - }; - util3.xorBytes = function(s1, s2, n) { - var s3 = ""; - var b = ""; - var t = ""; - var i = 0; - var c = 0; - for (; n > 0; --n, ++i) { - b = s1.charCodeAt(i) ^ s2.charCodeAt(i); - if (c >= 10) { - s3 += t; - t = ""; - c = 0; - } - t += String.fromCharCode(b); - ++c; - } - s3 += t; - return s3; - }; - util3.hexToBytes = function(hex) { - var rval = ""; - var i = 0; - if (hex.length & true) { - i = 1; - rval += String.fromCharCode(parseInt(hex[0], 16)); - } - for (; i < hex.length; i += 2) { - rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); - } - return rval; - }; - util3.bytesToHex = function(bytes) { - return util3.createBuffer(bytes).toHex(); - }; - util3.int32ToBytes = function(i) { - return String.fromCharCode(i >> 24 & 255) + String.fromCharCode(i >> 16 & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255); - }; - var _base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - var _base64Idx = [ - /*43 -43 = 0*/ - /*'+', 1, 2, 3,'/' */ - 62, - -1, - -1, - -1, - 63, - /*'0','1','2','3','4','5','6','7','8','9' */ - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - /*15, 16, 17,'=', 19, 20, 21 */ - -1, - -1, - -1, - 64, - -1, - -1, - -1, - /*65 - 43 = 22*/ - /*'A','B','C','D','E','F','G','H','I','J','K','L','M', */ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - /*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */ - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - /*91 - 43 = 48 */ - /*48, 49, 50, 51, 52, 53 */ - -1, - -1, - -1, - -1, - -1, - -1, - /*97 - 43 = 54*/ - /*'a','b','c','d','e','f','g','h','i','j','k','l','m' */ - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - /*'n','o','p','q','r','s','t','u','v','w','x','y','z' */ - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51 - ]; - var _base58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; - util3.encode64 = function(input, maxline) { - var line = ""; - var output = ""; - var chr1, chr2, chr3; - var i = 0; - while (i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - line += _base64.charAt(chr1 >> 2); - line += _base64.charAt((chr1 & 3) << 4 | chr2 >> 4); - if (isNaN(chr2)) { - line += "=="; - } else { - line += _base64.charAt((chr2 & 15) << 2 | chr3 >> 6); - line += isNaN(chr3) ? "=" : _base64.charAt(chr3 & 63); - } - if (maxline && line.length > maxline) { - output += line.substr(0, maxline) + "\r\n"; - line = line.substr(maxline); - } - } - output += line; - return output; - }; - util3.decode64 = function(input) { - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - var output = ""; - var enc1, enc2, enc3, enc4; - var i = 0; - while (i < input.length) { - enc1 = _base64Idx[input.charCodeAt(i++) - 43]; - enc2 = _base64Idx[input.charCodeAt(i++) - 43]; - enc3 = _base64Idx[input.charCodeAt(i++) - 43]; - enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - output += String.fromCharCode(enc1 << 2 | enc2 >> 4); - if (enc3 !== 64) { - output += String.fromCharCode((enc2 & 15) << 4 | enc3 >> 2); - if (enc4 !== 64) { - output += String.fromCharCode((enc3 & 3) << 6 | enc4); - } - } - } - return output; - }; - util3.encodeUtf8 = function(str) { - return unescape(encodeURIComponent(str)); - }; - util3.decodeUtf8 = function(str) { - return decodeURIComponent(escape(str)); - }; - util3.binary = { - raw: {}, - hex: {}, - base64: {}, - base58: {}, - baseN: { - encode: baseN.encode, - decode: baseN.decode - } - }; - util3.binary.raw.encode = function(bytes) { - return String.fromCharCode.apply(null, bytes); - }; - util3.binary.raw.decode = function(str, output, offset) { - var out = output; - if (!out) { - out = new Uint8Array(str.length); - } - offset = offset || 0; - var j = offset; - for (var i = 0; i < str.length; ++i) { - out[j++] = str.charCodeAt(i); - } - return output ? j - offset : out; - }; - util3.binary.hex.encode = util3.bytesToHex; - util3.binary.hex.decode = function(hex, output, offset) { - var out = output; - if (!out) { - out = new Uint8Array(Math.ceil(hex.length / 2)); - } - offset = offset || 0; - var i = 0, j = offset; - if (hex.length & 1) { - i = 1; - out[j++] = parseInt(hex[0], 16); - } - for (; i < hex.length; i += 2) { - out[j++] = parseInt(hex.substr(i, 2), 16); - } - return output ? j - offset : out; - }; - util3.binary.base64.encode = function(input, maxline) { - var line = ""; - var output = ""; - var chr1, chr2, chr3; - var i = 0; - while (i < input.byteLength) { - chr1 = input[i++]; - chr2 = input[i++]; - chr3 = input[i++]; - line += _base64.charAt(chr1 >> 2); - line += _base64.charAt((chr1 & 3) << 4 | chr2 >> 4); - if (isNaN(chr2)) { - line += "=="; - } else { - line += _base64.charAt((chr2 & 15) << 2 | chr3 >> 6); - line += isNaN(chr3) ? "=" : _base64.charAt(chr3 & 63); - } - if (maxline && line.length > maxline) { - output += line.substr(0, maxline) + "\r\n"; - line = line.substr(maxline); - } - } - output += line; - return output; - }; - util3.binary.base64.decode = function(input, output, offset) { - var out = output; - if (!out) { - out = new Uint8Array(Math.ceil(input.length / 4) * 3); - } - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - offset = offset || 0; - var enc1, enc2, enc3, enc4; - var i = 0, j = offset; - while (i < input.length) { - enc1 = _base64Idx[input.charCodeAt(i++) - 43]; - enc2 = _base64Idx[input.charCodeAt(i++) - 43]; - enc3 = _base64Idx[input.charCodeAt(i++) - 43]; - enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - out[j++] = enc1 << 2 | enc2 >> 4; - if (enc3 !== 64) { - out[j++] = (enc2 & 15) << 4 | enc3 >> 2; - if (enc4 !== 64) { - out[j++] = (enc3 & 3) << 6 | enc4; - } - } - } - return output ? j - offset : out.subarray(0, j); - }; - util3.binary.base58.encode = function(input, maxline) { - return util3.binary.baseN.encode(input, _base58, maxline); - }; - util3.binary.base58.decode = function(input, maxline) { - return util3.binary.baseN.decode(input, _base58, maxline); - }; - util3.text = { - utf8: {}, - utf16: {} - }; - util3.text.utf8.encode = function(str, output, offset) { - str = util3.encodeUtf8(str); - var out = output; - if (!out) { - out = new Uint8Array(str.length); - } - offset = offset || 0; - var j = offset; - for (var i = 0; i < str.length; ++i) { - out[j++] = str.charCodeAt(i); - } - return output ? j - offset : out; - }; - util3.text.utf8.decode = function(bytes) { - return util3.decodeUtf8(String.fromCharCode.apply(null, bytes)); - }; - util3.text.utf16.encode = function(str, output, offset) { - var out = output; - if (!out) { - out = new Uint8Array(str.length * 2); - } - var view = new Uint16Array(out.buffer); - offset = offset || 0; - var j = offset; - var k = offset; - for (var i = 0; i < str.length; ++i) { - view[k++] = str.charCodeAt(i); - j += 2; - } - return output ? j - offset : out; - }; - util3.text.utf16.decode = function(bytes) { - return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); - }; - util3.deflate = function(api, bytes, raw) { - bytes = util3.decode64(api.deflate(util3.encode64(bytes)).rval); - if (raw) { - var start = 2; - var flg = bytes.charCodeAt(1); - if (flg & 32) { - start = 6; - } - bytes = bytes.substring(start, bytes.length - 4); - } - return bytes; - }; - util3.inflate = function(api, bytes, raw) { - var rval = api.inflate(util3.encode64(bytes)).rval; - return rval === null ? null : util3.decode64(rval); - }; - var _setStorageObject = function(api, id, obj) { - if (!api) { - throw new Error("WebStorage not available."); - } - var rval; - if (obj === null) { - rval = api.removeItem(id); - } else { - obj = util3.encode64(JSON.stringify(obj)); - rval = api.setItem(id, obj); - } - if (typeof rval !== "undefined" && rval.rval !== true) { - var error3 = new Error(rval.error.message); - error3.id = rval.error.id; - error3.name = rval.error.name; - throw error3; - } - }; - var _getStorageObject = function(api, id) { - if (!api) { - throw new Error("WebStorage not available."); - } - var rval = api.getItem(id); - if (api.init) { - if (rval.rval === null) { - if (rval.error) { - var error3 = new Error(rval.error.message); - error3.id = rval.error.id; - error3.name = rval.error.name; - throw error3; - } - rval = null; - } else { - rval = rval.rval; - } - } - if (rval !== null) { - rval = JSON.parse(util3.decode64(rval)); - } - return rval; - }; - var _setItem = function(api, id, key, data) { - var obj = _getStorageObject(api, id); - if (obj === null) { - obj = {}; - } - obj[key] = data; - _setStorageObject(api, id, obj); - }; - var _getItem = function(api, id, key) { - var rval = _getStorageObject(api, id); - if (rval !== null) { - rval = key in rval ? rval[key] : null; - } - return rval; - }; - var _removeItem = function(api, id, key) { - var obj = _getStorageObject(api, id); - if (obj !== null && key in obj) { - delete obj[key]; - var empty = true; - for (var prop in obj) { - empty = false; - break; - } - if (empty) { - obj = null; - } - _setStorageObject(api, id, obj); - } - }; - var _clearItems = function(api, id) { - _setStorageObject(api, id, null); - }; - var _callStorageFunction = function(func, args, location) { - var rval = null; - if (typeof location === "undefined") { - location = ["web", "flash"]; - } - var type; - var done = false; - var exception = null; - for (var idx in location) { - type = location[idx]; - try { - if (type === "flash" || type === "both") { - if (args[0] === null) { - throw new Error("Flash local storage not available."); - } - rval = func.apply(this, args); - done = type === "flash"; - } - if (type === "web" || type === "both") { - args[0] = localStorage; - rval = func.apply(this, args); - done = true; - } - } catch (ex) { - exception = ex; - } - if (done) { - break; - } - } - if (!done) { - throw exception; - } - return rval; - }; - util3.setItem = function(api, id, key, data, location) { - _callStorageFunction(_setItem, arguments, location); - }; - util3.getItem = function(api, id, key, location) { - return _callStorageFunction(_getItem, arguments, location); - }; - util3.removeItem = function(api, id, key, location) { - _callStorageFunction(_removeItem, arguments, location); - }; - util3.clearItems = function(api, id, location) { - _callStorageFunction(_clearItems, arguments, location); - }; - util3.isEmpty = function(obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - return false; - } - } - return true; - }; - util3.format = function(format) { - var re = /%./g; - var match2; - var part; - var argi = 0; - var parts = []; - var last = 0; - while (match2 = re.exec(format)) { - part = format.substring(last, re.lastIndex - 2); - if (part.length > 0) { - parts.push(part); - } - last = re.lastIndex; - var code = match2[0][1]; - switch (code) { - case "s": - case "o": - if (argi < arguments.length) { - parts.push(arguments[argi++ + 1]); - } else { - parts.push(""); - } - break; - // FIXME: do proper formatting for numbers, etc - //case 'f': - //case 'd': - case "%": - parts.push("%"); - break; - default: - parts.push("<%" + code + "?>"); - } - } - parts.push(format.substring(last)); - return parts.join(""); - }; - util3.formatNumber = function(number2, decimals, dec_point, thousands_sep) { - var n = number2, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; - var d = dec_point === void 0 ? "," : dec_point; - var t = thousands_sep === void 0 ? "." : thousands_sep, s = n < 0 ? "-" : ""; - var i = parseInt(n = Math.abs(+n || 0).toFixed(c), 10) + ""; - var j = i.length > 3 ? i.length % 3 : 0; - return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); - }; - util3.formatSize = function(size) { - if (size >= 1073741824) { - size = util3.formatNumber(size / 1073741824, 2, ".", "") + " GiB"; - } else if (size >= 1048576) { - size = util3.formatNumber(size / 1048576, 2, ".", "") + " MiB"; - } else if (size >= 1024) { - size = util3.formatNumber(size / 1024, 0) + " KiB"; - } else { - size = util3.formatNumber(size, 0) + " bytes"; - } - return size; - }; - util3.bytesFromIP = function(ip) { - if (ip.indexOf(".") !== -1) { - return util3.bytesFromIPv4(ip); - } - if (ip.indexOf(":") !== -1) { - return util3.bytesFromIPv6(ip); - } - return null; - }; - util3.bytesFromIPv4 = function(ip) { - ip = ip.split("."); - if (ip.length !== 4) { - return null; - } - var b = util3.createBuffer(); - for (var i = 0; i < ip.length; ++i) { - var num = parseInt(ip[i], 10); - if (isNaN(num)) { - return null; - } - b.putByte(num); - } - return b.getBytes(); - }; - util3.bytesFromIPv6 = function(ip) { - var blanks = 0; - ip = ip.split(":").filter(function(e) { - if (e.length === 0) ++blanks; - return true; - }); - var zeros = (8 - ip.length + blanks) * 2; - var b = util3.createBuffer(); - for (var i = 0; i < 8; ++i) { - if (!ip[i] || ip[i].length === 0) { - b.fillWithByte(0, zeros); - zeros = 0; - continue; - } - var bytes = util3.hexToBytes(ip[i]); - if (bytes.length < 2) { - b.putByte(0); - } - b.putBytes(bytes); - } - return b.getBytes(); - }; - util3.bytesToIP = function(bytes) { - if (bytes.length === 4) { - return util3.bytesToIPv4(bytes); - } - if (bytes.length === 16) { - return util3.bytesToIPv6(bytes); - } - return null; - }; - util3.bytesToIPv4 = function(bytes) { - if (bytes.length !== 4) { - return null; - } - var ip = []; - for (var i = 0; i < bytes.length; ++i) { - ip.push(bytes.charCodeAt(i)); - } - return ip.join("."); - }; - util3.bytesToIPv6 = function(bytes) { - if (bytes.length !== 16) { - return null; - } - var ip = []; - var zeroGroups = []; - var zeroMaxGroup = 0; - for (var i = 0; i < bytes.length; i += 2) { - var hex = util3.bytesToHex(bytes[i] + bytes[i + 1]); - while (hex[0] === "0" && hex !== "0") { - hex = hex.substr(1); - } - if (hex === "0") { - var last = zeroGroups[zeroGroups.length - 1]; - var idx = ip.length; - if (!last || idx !== last.end + 1) { - zeroGroups.push({ start: idx, end: idx }); - } else { - last.end = idx; - if (last.end - last.start > zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start) { - zeroMaxGroup = zeroGroups.length - 1; - } - } - } - ip.push(hex); - } - if (zeroGroups.length > 0) { - var group = zeroGroups[zeroMaxGroup]; - if (group.end - group.start > 0) { - ip.splice(group.start, group.end - group.start + 1, ""); - if (group.start === 0) { - ip.unshift(""); - } - if (group.end === 7) { - ip.push(""); - } - } - } - return ip.join(":"); - }; - util3.estimateCores = function(options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; - } - options = options || {}; - if ("cores" in util3 && !options.update) { - return callback(null, util3.cores); - } - if (typeof navigator !== "undefined" && "hardwareConcurrency" in navigator && navigator.hardwareConcurrency > 0) { - util3.cores = navigator.hardwareConcurrency; - return callback(null, util3.cores); - } - if (typeof Worker === "undefined") { - util3.cores = 1; - return callback(null, util3.cores); - } - if (typeof Blob === "undefined") { - util3.cores = 2; - return callback(null, util3.cores); - } - var blobUrl = URL.createObjectURL(new Blob([ - "(", - function() { - self.addEventListener("message", function(e) { - var st = Date.now(); - var et = st + 4; - while (Date.now() < et) ; - self.postMessage({ st, et }); - }); - }.toString(), - ")()" - ], { type: "application/javascript" })); - sample([], 5, 16); - function sample(max, samples, numWorkers) { - if (samples === 0) { - var avg = Math.floor(max.reduce(function(avg2, x) { - return avg2 + x; - }, 0) / max.length); - util3.cores = Math.max(1, avg); - URL.revokeObjectURL(blobUrl); - return callback(null, util3.cores); - } - map(numWorkers, function(err, results) { - max.push(reduce(numWorkers, results)); - sample(max, samples - 1, numWorkers); - }); - } - function map(numWorkers, callback2) { - var workers = []; - var results = []; - for (var i = 0; i < numWorkers; ++i) { - var worker = new Worker(blobUrl); - worker.addEventListener("message", function(e) { - results.push(e.data); - if (results.length === numWorkers) { - for (var i2 = 0; i2 < numWorkers; ++i2) { - workers[i2].terminate(); - } - callback2(null, results); - } - }); - workers.push(worker); - } - for (var i = 0; i < numWorkers; ++i) { - workers[i].postMessage(i); - } - } - function reduce(numWorkers, results) { - var overlaps = []; - for (var n = 0; n < numWorkers; ++n) { - var r1 = results[n]; - var overlap = overlaps[n] = []; - for (var i = 0; i < numWorkers; ++i) { - if (n === i) { - continue; - } - var r2 = results[i]; - if (r1.st > r2.st && r1.st < r2.et || r2.st > r1.st && r2.st < r1.et) { - overlap.push(i); - } - } - } - return overlaps.reduce(function(max, overlap2) { - return Math.max(max, overlap2.length); - }, 0); - } - }; - } -}); - -// node_modules/node-forge/lib/cipher.js -var require_cipher = __commonJS({ - "node_modules/node-forge/lib/cipher.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - module2.exports = forge.cipher = forge.cipher || {}; - forge.cipher.algorithms = forge.cipher.algorithms || {}; - forge.cipher.createCipher = function(algorithm, key) { - var api = algorithm; - if (typeof api === "string") { - api = forge.cipher.getAlgorithm(api); - if (api) { - api = api(); - } - } - if (!api) { - throw new Error("Unsupported algorithm: " + algorithm); - } - return new forge.cipher.BlockCipher({ - algorithm: api, - key, - decrypt: false - }); - }; - forge.cipher.createDecipher = function(algorithm, key) { - var api = algorithm; - if (typeof api === "string") { - api = forge.cipher.getAlgorithm(api); - if (api) { - api = api(); - } - } - if (!api) { - throw new Error("Unsupported algorithm: " + algorithm); - } - return new forge.cipher.BlockCipher({ - algorithm: api, - key, - decrypt: true - }); - }; - forge.cipher.registerAlgorithm = function(name, algorithm) { - name = name.toUpperCase(); - forge.cipher.algorithms[name] = algorithm; - }; - forge.cipher.getAlgorithm = function(name) { - name = name.toUpperCase(); - if (name in forge.cipher.algorithms) { - return forge.cipher.algorithms[name]; - } - return null; - }; - var BlockCipher = forge.cipher.BlockCipher = function(options) { - this.algorithm = options.algorithm; - this.mode = this.algorithm.mode; - this.blockSize = this.mode.blockSize; - this._finish = false; - this._input = null; - this.output = null; - this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt; - this._decrypt = options.decrypt; - this.algorithm.initialize(options); - }; - BlockCipher.prototype.start = function(options) { - options = options || {}; - var opts = {}; - for (var key in options) { - opts[key] = options[key]; - } - opts.decrypt = this._decrypt; - this._finish = false; - this._input = forge.util.createBuffer(); - this.output = options.output || forge.util.createBuffer(); - this.mode.start(opts); - }; - BlockCipher.prototype.update = function(input) { - if (input) { - this._input.putBuffer(input); - } - while (!this._op.call(this.mode, this._input, this.output, this._finish) && !this._finish) { - } - this._input.compact(); - }; - BlockCipher.prototype.finish = function(pad) { - if (pad && (this.mode.name === "ECB" || this.mode.name === "CBC")) { - this.mode.pad = function(input) { - return pad(this.blockSize, input, false); - }; - this.mode.unpad = function(output) { - return pad(this.blockSize, output, true); - }; - } - var options = {}; - options.decrypt = this._decrypt; - options.overflow = this._input.length() % this.blockSize; - if (!this._decrypt && this.mode.pad) { - if (!this.mode.pad(this._input, options)) { - return false; - } - } - this._finish = true; - this.update(); - if (this._decrypt && this.mode.unpad) { - if (!this.mode.unpad(this.output, options)) { - return false; - } - } - if (this.mode.afterFinish) { - if (!this.mode.afterFinish(this.output, options)) { - return false; - } - } - return true; - }; - } -}); - -// node_modules/node-forge/lib/cipherModes.js -var require_cipherModes = __commonJS({ - "node_modules/node-forge/lib/cipherModes.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - forge.cipher = forge.cipher || {}; - var modes = module2.exports = forge.cipher.modes = forge.cipher.modes || {}; - modes.ecb = function(options) { - options = options || {}; - this.name = "ECB"; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); - }; - modes.ecb.prototype.start = function(options) { - }; - modes.ecb.prototype.encrypt = function(input, output, finish) { - if (input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - this.cipher.encrypt(this._inBlock, this._outBlock); - for (var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } - }; - modes.ecb.prototype.decrypt = function(input, output, finish) { - if (input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - this.cipher.decrypt(this._inBlock, this._outBlock); - for (var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } - }; - modes.ecb.prototype.pad = function(input, options) { - var padding = input.length() === this.blockSize ? this.blockSize : this.blockSize - input.length(); - input.fillWithByte(padding, padding); - return true; - }; - modes.ecb.prototype.unpad = function(output, options) { - if (options.overflow > 0) { - return false; - } - var len = output.length(); - var count = output.at(len - 1); - if (count > this.blockSize << 2) { - return false; - } - output.truncate(count); - return true; - }; - modes.cbc = function(options) { - options = options || {}; - this.name = "CBC"; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); - }; - modes.cbc.prototype.start = function(options) { - if (options.iv === null) { - if (!this._prev) { - throw new Error("Invalid IV parameter."); - } - this._iv = this._prev.slice(0); - } else if (!("iv" in options)) { - throw new Error("Invalid IV parameter."); - } else { - this._iv = transformIV(options.iv, this.blockSize); - this._prev = this._iv.slice(0); - } - }; - modes.cbc.prototype.encrypt = function(input, output, finish) { - if (input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._prev[i] ^ input.getInt32(); - } - this.cipher.encrypt(this._inBlock, this._outBlock); - for (var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } - this._prev = this._outBlock; - }; - modes.cbc.prototype.decrypt = function(input, output, finish) { - if (input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - this.cipher.decrypt(this._inBlock, this._outBlock); - for (var i = 0; i < this._ints; ++i) { - output.putInt32(this._prev[i] ^ this._outBlock[i]); - } - this._prev = this._inBlock.slice(0); - }; - modes.cbc.prototype.pad = function(input, options) { - var padding = input.length() === this.blockSize ? this.blockSize : this.blockSize - input.length(); - input.fillWithByte(padding, padding); - return true; - }; - modes.cbc.prototype.unpad = function(output, options) { - if (options.overflow > 0) { - return false; - } - var len = output.length(); - var count = output.at(len - 1); - if (count > this.blockSize << 2) { - return false; - } - output.truncate(count); - return true; - }; - modes.cfb = function(options) { - options = options || {}; - this.name = "CFB"; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; - }; - modes.cfb.prototype.start = function(options) { - if (!("iv" in options)) { - throw new Error("Invalid IV parameter."); - } - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; - }; - modes.cfb.prototype.encrypt = function(input, output, finish) { - var inputLength = input.length(); - if (inputLength === 0) { - return true; - } - this.cipher.encrypt(this._inBlock, this._outBlock); - if (this._partialBytes === 0 && inputLength >= this.blockSize) { - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32() ^ this._outBlock[i]; - output.putInt32(this._inBlock[i]); - } - return; - } - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if (partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - this._partialOutput.clear(); - for (var i = 0; i < this._ints; ++i) { - this._partialBlock[i] = input.getInt32() ^ this._outBlock[i]; - this._partialOutput.putInt32(this._partialBlock[i]); - } - if (partialBytes > 0) { - input.read -= this.blockSize; - } else { - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._partialBlock[i]; - } - } - if (this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - if (partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes - )); - this._partialBytes = partialBytes; - return true; - } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; - }; - modes.cfb.prototype.decrypt = function(input, output, finish) { - var inputLength = input.length(); - if (inputLength === 0) { - return true; - } - this.cipher.encrypt(this._inBlock, this._outBlock); - if (this._partialBytes === 0 && inputLength >= this.blockSize) { - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - output.putInt32(this._inBlock[i] ^ this._outBlock[i]); - } - return; - } - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if (partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - this._partialOutput.clear(); - for (var i = 0; i < this._ints; ++i) { - this._partialBlock[i] = input.getInt32(); - this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]); - } - if (partialBytes > 0) { - input.read -= this.blockSize; - } else { - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._partialBlock[i]; - } - } - if (this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - if (partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes - )); - this._partialBytes = partialBytes; - return true; - } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; - }; - modes.ofb = function(options) { - options = options || {}; - this.name = "OFB"; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; - }; - modes.ofb.prototype.start = function(options) { - if (!("iv" in options)) { - throw new Error("Invalid IV parameter."); - } - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; - }; - modes.ofb.prototype.encrypt = function(input, output, finish) { - var inputLength = input.length(); - if (input.length() === 0) { - return true; - } - this.cipher.encrypt(this._inBlock, this._outBlock); - if (this._partialBytes === 0 && inputLength >= this.blockSize) { - for (var i = 0; i < this._ints; ++i) { - output.putInt32(input.getInt32() ^ this._outBlock[i]); - this._inBlock[i] = this._outBlock[i]; - } - return; - } - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if (partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - this._partialOutput.clear(); - for (var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - if (partialBytes > 0) { - input.read -= this.blockSize; - } else { - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._outBlock[i]; - } - } - if (this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - if (partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes - )); - this._partialBytes = partialBytes; - return true; - } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; - }; - modes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt; - modes.ctr = function(options) { - options = options || {}; - this.name = "CTR"; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; - }; - modes.ctr.prototype.start = function(options) { - if (!("iv" in options)) { - throw new Error("Invalid IV parameter."); - } - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; - }; - modes.ctr.prototype.encrypt = function(input, output, finish) { - var inputLength = input.length(); - if (inputLength === 0) { - return true; - } - this.cipher.encrypt(this._inBlock, this._outBlock); - if (this._partialBytes === 0 && inputLength >= this.blockSize) { - for (var i = 0; i < this._ints; ++i) { - output.putInt32(input.getInt32() ^ this._outBlock[i]); - } - } else { - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if (partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - this._partialOutput.clear(); - for (var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - if (partialBytes > 0) { - input.read -= this.blockSize; - } - if (this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - if (partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes - )); - this._partialBytes = partialBytes; - return true; - } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; - } - inc32(this._inBlock); - }; - modes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt; - modes.gcm = function(options) { - options = options || {}; - this.name = "GCM"; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; - this._R = 3774873600; - }; - modes.gcm.prototype.start = function(options) { - if (!("iv" in options)) { - throw new Error("Invalid IV parameter."); - } - var iv = forge.util.createBuffer(options.iv); - this._cipherLength = 0; - var additionalData; - if ("additionalData" in options) { - additionalData = forge.util.createBuffer(options.additionalData); - } else { - additionalData = forge.util.createBuffer(); - } - if ("tagLength" in options) { - this._tagLength = options.tagLength; - } else { - this._tagLength = 128; - } - this._tag = null; - if (options.decrypt) { - this._tag = forge.util.createBuffer(options.tag).getBytes(); - if (this._tag.length !== this._tagLength / 8) { - throw new Error("Authentication tag does not match tag length."); - } - } - this._hashBlock = new Array(this._ints); - this.tag = null; - this._hashSubkey = new Array(this._ints); - this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey); - this.componentBits = 4; - this._m = this.generateHashTable(this._hashSubkey, this.componentBits); - var ivLength = iv.length(); - if (ivLength === 12) { - this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1]; - } else { - this._j0 = [0, 0, 0, 0]; - while (iv.length() > 0) { - this._j0 = this.ghash( - this._hashSubkey, - this._j0, - [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()] - ); - } - this._j0 = this.ghash( - this._hashSubkey, - this._j0, - [0, 0].concat(from64To32(ivLength * 8)) - ); - } - this._inBlock = this._j0.slice(0); - inc32(this._inBlock); - this._partialBytes = 0; - additionalData = forge.util.createBuffer(additionalData); - this._aDataLength = from64To32(additionalData.length() * 8); - var overflow = additionalData.length() % this.blockSize; - if (overflow) { - additionalData.fillWithByte(0, this.blockSize - overflow); - } - this._s = [0, 0, 0, 0]; - while (additionalData.length() > 0) { - this._s = this.ghash(this._hashSubkey, this._s, [ - additionalData.getInt32(), - additionalData.getInt32(), - additionalData.getInt32(), - additionalData.getInt32() - ]); - } - }; - modes.gcm.prototype.encrypt = function(input, output, finish) { - var inputLength = input.length(); - if (inputLength === 0) { - return true; - } - this.cipher.encrypt(this._inBlock, this._outBlock); - if (this._partialBytes === 0 && inputLength >= this.blockSize) { - for (var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i] ^= input.getInt32()); - } - this._cipherLength += this.blockSize; - } else { - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if (partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - this._partialOutput.clear(); - for (var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - if (partialBytes <= 0 || finish) { - if (finish) { - var overflow = inputLength % this.blockSize; - this._cipherLength += overflow; - this._partialOutput.truncate(this.blockSize - overflow); - } else { - this._cipherLength += this.blockSize; - } - for (var i = 0; i < this._ints; ++i) { - this._outBlock[i] = this._partialOutput.getInt32(); - } - this._partialOutput.read -= this.blockSize; - } - if (this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - if (partialBytes > 0 && !finish) { - input.read -= this.blockSize; - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes - )); - this._partialBytes = partialBytes; - return true; - } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; - } - this._s = this.ghash(this._hashSubkey, this._s, this._outBlock); - inc32(this._inBlock); - }; - modes.gcm.prototype.decrypt = function(input, output, finish) { - var inputLength = input.length(); - if (inputLength < this.blockSize && !(finish && inputLength > 0)) { - return true; - } - this.cipher.encrypt(this._inBlock, this._outBlock); - inc32(this._inBlock); - this._hashBlock[0] = input.getInt32(); - this._hashBlock[1] = input.getInt32(); - this._hashBlock[2] = input.getInt32(); - this._hashBlock[3] = input.getInt32(); - this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock); - for (var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i] ^ this._hashBlock[i]); - } - if (inputLength < this.blockSize) { - this._cipherLength += inputLength % this.blockSize; - } else { - this._cipherLength += this.blockSize; - } - }; - modes.gcm.prototype.afterFinish = function(output, options) { - var rval = true; - if (options.decrypt && options.overflow) { - output.truncate(this.blockSize - options.overflow); - } - this.tag = forge.util.createBuffer(); - var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8)); - this._s = this.ghash(this._hashSubkey, this._s, lengths); - var tag = []; - this.cipher.encrypt(this._j0, tag); - for (var i = 0; i < this._ints; ++i) { - this.tag.putInt32(this._s[i] ^ tag[i]); - } - this.tag.truncate(this.tag.length() % (this._tagLength / 8)); - if (options.decrypt && this.tag.bytes() !== this._tag) { - rval = false; - } - return rval; - }; - modes.gcm.prototype.multiply = function(x, y) { - var z_i = [0, 0, 0, 0]; - var v_i = y.slice(0); - for (var i = 0; i < 128; ++i) { - var x_i = x[i / 32 | 0] & 1 << 31 - i % 32; - if (x_i) { - z_i[0] ^= v_i[0]; - z_i[1] ^= v_i[1]; - z_i[2] ^= v_i[2]; - z_i[3] ^= v_i[3]; - } - this.pow(v_i, v_i); - } - return z_i; - }; - modes.gcm.prototype.pow = function(x, out) { - var lsb = x[3] & 1; - for (var i = 3; i > 0; --i) { - out[i] = x[i] >>> 1 | (x[i - 1] & 1) << 31; - } - out[0] = x[0] >>> 1; - if (lsb) { - out[0] ^= this._R; - } - }; - modes.gcm.prototype.tableMultiply = function(x) { - var z = [0, 0, 0, 0]; - for (var i = 0; i < 32; ++i) { - var idx = i / 8 | 0; - var x_i = x[idx] >>> (7 - i % 8) * 4 & 15; - var ah = this._m[i][x_i]; - z[0] ^= ah[0]; - z[1] ^= ah[1]; - z[2] ^= ah[2]; - z[3] ^= ah[3]; - } - return z; - }; - modes.gcm.prototype.ghash = function(h, y, x) { - y[0] ^= x[0]; - y[1] ^= x[1]; - y[2] ^= x[2]; - y[3] ^= x[3]; - return this.tableMultiply(y); - }; - modes.gcm.prototype.generateHashTable = function(h, bits) { - var multiplier = 8 / bits; - var perInt = 4 * multiplier; - var size = 16 * multiplier; - var m = new Array(size); - for (var i = 0; i < size; ++i) { - var tmp = [0, 0, 0, 0]; - var idx = i / perInt | 0; - var shft = (perInt - 1 - i % perInt) * bits; - tmp[idx] = 1 << bits - 1 << shft; - m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits); - } - return m; - }; - modes.gcm.prototype.generateSubHashTable = function(mid, bits) { - var size = 1 << bits; - var half = size >>> 1; - var m = new Array(size); - m[half] = mid.slice(0); - var i = half >>> 1; - while (i > 0) { - this.pow(m[2 * i], m[i] = []); - i >>= 1; - } - i = 2; - while (i < half) { - for (var j = 1; j < i; ++j) { - var m_i = m[i]; - var m_j = m[j]; - m[i + j] = [ - m_i[0] ^ m_j[0], - m_i[1] ^ m_j[1], - m_i[2] ^ m_j[2], - m_i[3] ^ m_j[3] - ]; - } - i *= 2; - } - m[0] = [0, 0, 0, 0]; - for (i = half + 1; i < size; ++i) { - var c = m[i ^ half]; - m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]]; - } - return m; - }; - function transformIV(iv, blockSize) { - if (typeof iv === "string") { - iv = forge.util.createBuffer(iv); - } - if (forge.util.isArray(iv) && iv.length > 4) { - var tmp = iv; - iv = forge.util.createBuffer(); - for (var i = 0; i < tmp.length; ++i) { - iv.putByte(tmp[i]); - } - } - if (iv.length() < blockSize) { - throw new Error( - "Invalid IV length; got " + iv.length() + " bytes and expected " + blockSize + " bytes." - ); - } - if (!forge.util.isArray(iv)) { - var ints = []; - var blocks = blockSize / 4; - for (var i = 0; i < blocks; ++i) { - ints.push(iv.getInt32()); - } - iv = ints; - } - return iv; - } - function inc32(block) { - block[block.length - 1] = block[block.length - 1] + 1 & 4294967295; - } - function from64To32(num) { - return [num / 4294967296 | 0, num & 4294967295]; - } - } -}); - -// node_modules/node-forge/lib/aes.js -var require_aes = __commonJS({ - "node_modules/node-forge/lib/aes.js"(exports2, module2) { - var forge = require_forge(); - require_cipher(); - require_cipherModes(); - require_util16(); - module2.exports = forge.aes = forge.aes || {}; - forge.aes.startEncrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key, - output, - decrypt: false, - mode - }); - cipher.start(iv); - return cipher; - }; - forge.aes.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key, - output: null, - decrypt: false, - mode - }); - }; - forge.aes.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key, - output, - decrypt: true, - mode - }); - cipher.start(iv); - return cipher; - }; - forge.aes.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key, - output: null, - decrypt: true, - mode - }); - }; - forge.aes.Algorithm = function(name, mode) { - if (!init2) { - initialize(); - } - var self2 = this; - self2.name = name; - self2.mode = new mode({ - blockSize: 16, - cipher: { - encrypt: function(inBlock, outBlock) { - return _updateBlock(self2._w, inBlock, outBlock, false); - }, - decrypt: function(inBlock, outBlock) { - return _updateBlock(self2._w, inBlock, outBlock, true); - } - } - }); - self2._init = false; - }; - forge.aes.Algorithm.prototype.initialize = function(options) { - if (this._init) { - return; - } - var key = options.key; - var tmp; - if (typeof key === "string" && (key.length === 16 || key.length === 24 || key.length === 32)) { - key = forge.util.createBuffer(key); - } else if (forge.util.isArray(key) && (key.length === 16 || key.length === 24 || key.length === 32)) { - tmp = key; - key = forge.util.createBuffer(); - for (var i = 0; i < tmp.length; ++i) { - key.putByte(tmp[i]); - } - } - if (!forge.util.isArray(key)) { - tmp = key; - key = []; - var len = tmp.length(); - if (len === 16 || len === 24 || len === 32) { - len = len >>> 2; - for (var i = 0; i < len; ++i) { - key.push(tmp.getInt32()); - } - } - } - if (!forge.util.isArray(key) || !(key.length === 4 || key.length === 6 || key.length === 8)) { - throw new Error("Invalid key parameter."); - } - var mode = this.mode.name; - var encryptOp = ["CFB", "OFB", "CTR", "GCM"].indexOf(mode) !== -1; - this._w = _expandKey(key, options.decrypt && !encryptOp); - this._init = true; - }; - forge.aes._expandKey = function(key, decrypt) { - if (!init2) { - initialize(); - } - return _expandKey(key, decrypt); - }; - forge.aes._updateBlock = _updateBlock; - registerAlgorithm("AES-ECB", forge.cipher.modes.ecb); - registerAlgorithm("AES-CBC", forge.cipher.modes.cbc); - registerAlgorithm("AES-CFB", forge.cipher.modes.cfb); - registerAlgorithm("AES-OFB", forge.cipher.modes.ofb); - registerAlgorithm("AES-CTR", forge.cipher.modes.ctr); - registerAlgorithm("AES-GCM", forge.cipher.modes.gcm); - function registerAlgorithm(name, mode) { - var factory = function() { - return new forge.aes.Algorithm(name, mode); - }; - forge.cipher.registerAlgorithm(name, factory); - } - var init2 = false; - var Nb = 4; - var sbox; - var isbox; - var rcon; - var mix; - var imix; - function initialize() { - init2 = true; - rcon = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]; - var xtime = new Array(256); - for (var i = 0; i < 128; ++i) { - xtime[i] = i << 1; - xtime[i + 128] = i + 128 << 1 ^ 283; - } - sbox = new Array(256); - isbox = new Array(256); - mix = new Array(4); - imix = new Array(4); - for (var i = 0; i < 4; ++i) { - mix[i] = new Array(256); - imix[i] = new Array(256); - } - var e = 0, ei = 0, e2, e4, e8, sx, sx2, me, ime; - for (var i = 0; i < 256; ++i) { - sx = ei ^ ei << 1 ^ ei << 2 ^ ei << 3 ^ ei << 4; - sx = sx >> 8 ^ sx & 255 ^ 99; - sbox[e] = sx; - isbox[sx] = e; - sx2 = xtime[sx]; - e2 = xtime[e]; - e4 = xtime[e2]; - e8 = xtime[e4]; - me = sx2 << 24 ^ // 2 - sx << 16 ^ // 1 - sx << 8 ^ // 1 - (sx ^ sx2); - ime = (e2 ^ e4 ^ e8) << 24 ^ // E (14) - (e ^ e8) << 16 ^ // 9 - (e ^ e4 ^ e8) << 8 ^ // D (13) - (e ^ e2 ^ e8); - for (var n = 0; n < 4; ++n) { - mix[n][e] = me; - imix[n][sx] = ime; - me = me << 24 | me >>> 8; - ime = ime << 24 | ime >>> 8; - } - if (e === 0) { - e = ei = 1; - } else { - e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]]; - ei ^= xtime[xtime[ei]]; - } - } - } - function _expandKey(key, decrypt) { - var w = key.slice(0); - var temp, iNk = 1; - var Nk = w.length; - var Nr1 = Nk + 6 + 1; - var end = Nb * Nr1; - for (var i = Nk; i < end; ++i) { - temp = w[i - 1]; - if (i % Nk === 0) { - temp = sbox[temp >>> 16 & 255] << 24 ^ sbox[temp >>> 8 & 255] << 16 ^ sbox[temp & 255] << 8 ^ sbox[temp >>> 24] ^ rcon[iNk] << 24; - iNk++; - } else if (Nk > 6 && i % Nk === 4) { - temp = sbox[temp >>> 24] << 24 ^ sbox[temp >>> 16 & 255] << 16 ^ sbox[temp >>> 8 & 255] << 8 ^ sbox[temp & 255]; - } - w[i] = w[i - Nk] ^ temp; - } - if (decrypt) { - var tmp; - var m0 = imix[0]; - var m1 = imix[1]; - var m2 = imix[2]; - var m3 = imix[3]; - var wnew = w.slice(0); - end = w.length; - for (var i = 0, wi = end - Nb; i < end; i += Nb, wi -= Nb) { - if (i === 0 || i === end - Nb) { - wnew[i] = w[wi]; - wnew[i + 1] = w[wi + 3]; - wnew[i + 2] = w[wi + 2]; - wnew[i + 3] = w[wi + 1]; - } else { - for (var n = 0; n < Nb; ++n) { - tmp = w[wi + n]; - wnew[i + (3 & -n)] = m0[sbox[tmp >>> 24]] ^ m1[sbox[tmp >>> 16 & 255]] ^ m2[sbox[tmp >>> 8 & 255]] ^ m3[sbox[tmp & 255]]; - } - } - } - w = wnew; - } - return w; - } - function _updateBlock(w, input, output, decrypt) { - var Nr = w.length / 4 - 1; - var m0, m1, m2, m3, sub; - if (decrypt) { - m0 = imix[0]; - m1 = imix[1]; - m2 = imix[2]; - m3 = imix[3]; - sub = isbox; - } else { - m0 = mix[0]; - m1 = mix[1]; - m2 = mix[2]; - m3 = mix[3]; - sub = sbox; - } - var a, b, c, d, a2, b2, c2; - a = input[0] ^ w[0]; - b = input[decrypt ? 3 : 1] ^ w[1]; - c = input[2] ^ w[2]; - d = input[decrypt ? 1 : 3] ^ w[3]; - var i = 3; - for (var round = 1; round < Nr; ++round) { - a2 = m0[a >>> 24] ^ m1[b >>> 16 & 255] ^ m2[c >>> 8 & 255] ^ m3[d & 255] ^ w[++i]; - b2 = m0[b >>> 24] ^ m1[c >>> 16 & 255] ^ m2[d >>> 8 & 255] ^ m3[a & 255] ^ w[++i]; - c2 = m0[c >>> 24] ^ m1[d >>> 16 & 255] ^ m2[a >>> 8 & 255] ^ m3[b & 255] ^ w[++i]; - d = m0[d >>> 24] ^ m1[a >>> 16 & 255] ^ m2[b >>> 8 & 255] ^ m3[c & 255] ^ w[++i]; - a = a2; - b = b2; - c = c2; - } - output[0] = sub[a >>> 24] << 24 ^ sub[b >>> 16 & 255] << 16 ^ sub[c >>> 8 & 255] << 8 ^ sub[d & 255] ^ w[++i]; - output[decrypt ? 3 : 1] = sub[b >>> 24] << 24 ^ sub[c >>> 16 & 255] << 16 ^ sub[d >>> 8 & 255] << 8 ^ sub[a & 255] ^ w[++i]; - output[2] = sub[c >>> 24] << 24 ^ sub[d >>> 16 & 255] << 16 ^ sub[a >>> 8 & 255] << 8 ^ sub[b & 255] ^ w[++i]; - output[decrypt ? 1 : 3] = sub[d >>> 24] << 24 ^ sub[a >>> 16 & 255] << 16 ^ sub[b >>> 8 & 255] << 8 ^ sub[c & 255] ^ w[++i]; - } - function _createCipher(options) { - options = options || {}; - var mode = (options.mode || "CBC").toUpperCase(); - var algorithm = "AES-" + mode; - var cipher; - if (options.decrypt) { - cipher = forge.cipher.createDecipher(algorithm, options.key); - } else { - cipher = forge.cipher.createCipher(algorithm, options.key); - } - var start = cipher.start; - cipher.start = function(iv, options2) { - var output = null; - if (options2 instanceof forge.util.ByteBuffer) { - output = options2; - options2 = {}; - } - options2 = options2 || {}; - options2.output = output; - options2.iv = iv; - start.call(cipher, options2); - }; - return cipher; - } - } -}); - -// node_modules/node-forge/lib/oids.js -var require_oids = __commonJS({ - "node_modules/node-forge/lib/oids.js"(exports2, module2) { - var forge = require_forge(); - forge.pki = forge.pki || {}; - var oids = module2.exports = forge.pki.oids = forge.oids = forge.oids || {}; - function _IN(id, name) { - oids[id] = name; - oids[name] = id; - } - function _I_(id, name) { - oids[id] = name; - } - _IN("1.2.840.113549.1.1.1", "rsaEncryption"); - _IN("1.2.840.113549.1.1.4", "md5WithRSAEncryption"); - _IN("1.2.840.113549.1.1.5", "sha1WithRSAEncryption"); - _IN("1.2.840.113549.1.1.7", "RSAES-OAEP"); - _IN("1.2.840.113549.1.1.8", "mgf1"); - _IN("1.2.840.113549.1.1.9", "pSpecified"); - _IN("1.2.840.113549.1.1.10", "RSASSA-PSS"); - _IN("1.2.840.113549.1.1.11", "sha256WithRSAEncryption"); - _IN("1.2.840.113549.1.1.12", "sha384WithRSAEncryption"); - _IN("1.2.840.113549.1.1.13", "sha512WithRSAEncryption"); - _IN("1.3.101.112", "EdDSA25519"); - _IN("1.2.840.10040.4.3", "dsa-with-sha1"); - _IN("1.3.14.3.2.7", "desCBC"); - _IN("1.3.14.3.2.26", "sha1"); - _IN("1.3.14.3.2.29", "sha1WithRSASignature"); - _IN("2.16.840.1.101.3.4.2.1", "sha256"); - _IN("2.16.840.1.101.3.4.2.2", "sha384"); - _IN("2.16.840.1.101.3.4.2.3", "sha512"); - _IN("2.16.840.1.101.3.4.2.4", "sha224"); - _IN("2.16.840.1.101.3.4.2.5", "sha512-224"); - _IN("2.16.840.1.101.3.4.2.6", "sha512-256"); - _IN("1.2.840.113549.2.2", "md2"); - _IN("1.2.840.113549.2.5", "md5"); - _IN("1.2.840.113549.1.7.1", "data"); - _IN("1.2.840.113549.1.7.2", "signedData"); - _IN("1.2.840.113549.1.7.3", "envelopedData"); - _IN("1.2.840.113549.1.7.4", "signedAndEnvelopedData"); - _IN("1.2.840.113549.1.7.5", "digestedData"); - _IN("1.2.840.113549.1.7.6", "encryptedData"); - _IN("1.2.840.113549.1.9.1", "emailAddress"); - _IN("1.2.840.113549.1.9.2", "unstructuredName"); - _IN("1.2.840.113549.1.9.3", "contentType"); - _IN("1.2.840.113549.1.9.4", "messageDigest"); - _IN("1.2.840.113549.1.9.5", "signingTime"); - _IN("1.2.840.113549.1.9.6", "counterSignature"); - _IN("1.2.840.113549.1.9.7", "challengePassword"); - _IN("1.2.840.113549.1.9.8", "unstructuredAddress"); - _IN("1.2.840.113549.1.9.14", "extensionRequest"); - _IN("1.2.840.113549.1.9.20", "friendlyName"); - _IN("1.2.840.113549.1.9.21", "localKeyId"); - _IN("1.2.840.113549.1.9.22.1", "x509Certificate"); - _IN("1.2.840.113549.1.12.10.1.1", "keyBag"); - _IN("1.2.840.113549.1.12.10.1.2", "pkcs8ShroudedKeyBag"); - _IN("1.2.840.113549.1.12.10.1.3", "certBag"); - _IN("1.2.840.113549.1.12.10.1.4", "crlBag"); - _IN("1.2.840.113549.1.12.10.1.5", "secretBag"); - _IN("1.2.840.113549.1.12.10.1.6", "safeContentsBag"); - _IN("1.2.840.113549.1.5.13", "pkcs5PBES2"); - _IN("1.2.840.113549.1.5.12", "pkcs5PBKDF2"); - _IN("1.2.840.113549.1.12.1.1", "pbeWithSHAAnd128BitRC4"); - _IN("1.2.840.113549.1.12.1.2", "pbeWithSHAAnd40BitRC4"); - _IN("1.2.840.113549.1.12.1.3", "pbeWithSHAAnd3-KeyTripleDES-CBC"); - _IN("1.2.840.113549.1.12.1.4", "pbeWithSHAAnd2-KeyTripleDES-CBC"); - _IN("1.2.840.113549.1.12.1.5", "pbeWithSHAAnd128BitRC2-CBC"); - _IN("1.2.840.113549.1.12.1.6", "pbewithSHAAnd40BitRC2-CBC"); - _IN("1.2.840.113549.2.7", "hmacWithSHA1"); - _IN("1.2.840.113549.2.8", "hmacWithSHA224"); - _IN("1.2.840.113549.2.9", "hmacWithSHA256"); - _IN("1.2.840.113549.2.10", "hmacWithSHA384"); - _IN("1.2.840.113549.2.11", "hmacWithSHA512"); - _IN("1.2.840.113549.3.7", "des-EDE3-CBC"); - _IN("2.16.840.1.101.3.4.1.2", "aes128-CBC"); - _IN("2.16.840.1.101.3.4.1.22", "aes192-CBC"); - _IN("2.16.840.1.101.3.4.1.42", "aes256-CBC"); - _IN("2.5.4.3", "commonName"); - _IN("2.5.4.4", "surname"); - _IN("2.5.4.5", "serialNumber"); - _IN("2.5.4.6", "countryName"); - _IN("2.5.4.7", "localityName"); - _IN("2.5.4.8", "stateOrProvinceName"); - _IN("2.5.4.9", "streetAddress"); - _IN("2.5.4.10", "organizationName"); - _IN("2.5.4.11", "organizationalUnitName"); - _IN("2.5.4.12", "title"); - _IN("2.5.4.13", "description"); - _IN("2.5.4.15", "businessCategory"); - _IN("2.5.4.17", "postalCode"); - _IN("2.5.4.42", "givenName"); - _IN("2.5.4.65", "pseudonym"); - _IN("1.3.6.1.4.1.311.60.2.1.2", "jurisdictionOfIncorporationStateOrProvinceName"); - _IN("1.3.6.1.4.1.311.60.2.1.3", "jurisdictionOfIncorporationCountryName"); - _IN("2.16.840.1.113730.1.1", "nsCertType"); - _IN("2.16.840.1.113730.1.13", "nsComment"); - _I_("2.5.29.1", "authorityKeyIdentifier"); - _I_("2.5.29.2", "keyAttributes"); - _I_("2.5.29.3", "certificatePolicies"); - _I_("2.5.29.4", "keyUsageRestriction"); - _I_("2.5.29.5", "policyMapping"); - _I_("2.5.29.6", "subtreesConstraint"); - _I_("2.5.29.7", "subjectAltName"); - _I_("2.5.29.8", "issuerAltName"); - _I_("2.5.29.9", "subjectDirectoryAttributes"); - _I_("2.5.29.10", "basicConstraints"); - _I_("2.5.29.11", "nameConstraints"); - _I_("2.5.29.12", "policyConstraints"); - _I_("2.5.29.13", "basicConstraints"); - _IN("2.5.29.14", "subjectKeyIdentifier"); - _IN("2.5.29.15", "keyUsage"); - _I_("2.5.29.16", "privateKeyUsagePeriod"); - _IN("2.5.29.17", "subjectAltName"); - _IN("2.5.29.18", "issuerAltName"); - _IN("2.5.29.19", "basicConstraints"); - _I_("2.5.29.20", "cRLNumber"); - _I_("2.5.29.21", "cRLReason"); - _I_("2.5.29.22", "expirationDate"); - _I_("2.5.29.23", "instructionCode"); - _I_("2.5.29.24", "invalidityDate"); - _I_("2.5.29.25", "cRLDistributionPoints"); - _I_("2.5.29.26", "issuingDistributionPoint"); - _I_("2.5.29.27", "deltaCRLIndicator"); - _I_("2.5.29.28", "issuingDistributionPoint"); - _I_("2.5.29.29", "certificateIssuer"); - _I_("2.5.29.30", "nameConstraints"); - _IN("2.5.29.31", "cRLDistributionPoints"); - _IN("2.5.29.32", "certificatePolicies"); - _I_("2.5.29.33", "policyMappings"); - _I_("2.5.29.34", "policyConstraints"); - _IN("2.5.29.35", "authorityKeyIdentifier"); - _I_("2.5.29.36", "policyConstraints"); - _IN("2.5.29.37", "extKeyUsage"); - _I_("2.5.29.46", "freshestCRL"); - _I_("2.5.29.54", "inhibitAnyPolicy"); - _IN("1.3.6.1.4.1.11129.2.4.2", "timestampList"); - _IN("1.3.6.1.5.5.7.1.1", "authorityInfoAccess"); - _IN("1.3.6.1.5.5.7.3.1", "serverAuth"); - _IN("1.3.6.1.5.5.7.3.2", "clientAuth"); - _IN("1.3.6.1.5.5.7.3.3", "codeSigning"); - _IN("1.3.6.1.5.5.7.3.4", "emailProtection"); - _IN("1.3.6.1.5.5.7.3.8", "timeStamping"); - } -}); - -// node_modules/node-forge/lib/asn1.js -var require_asn1 = __commonJS({ - "node_modules/node-forge/lib/asn1.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - require_oids(); - var asn1 = module2.exports = forge.asn1 = forge.asn1 || {}; - asn1.Class = { - UNIVERSAL: 0, - APPLICATION: 64, - CONTEXT_SPECIFIC: 128, - PRIVATE: 192 - }; - asn1.Type = { - NONE: 0, - BOOLEAN: 1, - INTEGER: 2, - BITSTRING: 3, - OCTETSTRING: 4, - NULL: 5, - OID: 6, - ODESC: 7, - EXTERNAL: 8, - REAL: 9, - ENUMERATED: 10, - EMBEDDED: 11, - UTF8: 12, - ROID: 13, - SEQUENCE: 16, - SET: 17, - PRINTABLESTRING: 19, - IA5STRING: 22, - UTCTIME: 23, - GENERALIZEDTIME: 24, - BMPSTRING: 30 - }; - asn1.maxDepth = 256; - asn1.create = function(tagClass, type, constructed, value, options) { - if (forge.util.isArray(value)) { - var tmp = []; - for (var i = 0; i < value.length; ++i) { - if (value[i] !== void 0) { - tmp.push(value[i]); - } - } - value = tmp; - } - var obj = { - tagClass, - type, - constructed, - composed: constructed || forge.util.isArray(value), - value - }; - if (options && "bitStringContents" in options) { - obj.bitStringContents = options.bitStringContents; - obj.original = asn1.copy(obj); - } - return obj; - }; - asn1.copy = function(obj, options) { - var copy; - if (forge.util.isArray(obj)) { - copy = []; - for (var i = 0; i < obj.length; ++i) { - copy.push(asn1.copy(obj[i], options)); - } - return copy; - } - if (typeof obj === "string") { - return obj; - } - copy = { - tagClass: obj.tagClass, - type: obj.type, - constructed: obj.constructed, - composed: obj.composed, - value: asn1.copy(obj.value, options) - }; - if (options && !options.excludeBitStringContents) { - copy.bitStringContents = obj.bitStringContents; - } - return copy; - }; - asn1.equals = function(obj1, obj2, options) { - if (forge.util.isArray(obj1)) { - if (!forge.util.isArray(obj2)) { - return false; - } - if (obj1.length !== obj2.length) { - return false; - } - for (var i = 0; i < obj1.length; ++i) { - if (!asn1.equals(obj1[i], obj2[i])) { - return false; - } - } - return true; - } - if (typeof obj1 !== typeof obj2) { - return false; - } - if (typeof obj1 === "string") { - return obj1 === obj2; - } - var equal = obj1.tagClass === obj2.tagClass && obj1.type === obj2.type && obj1.constructed === obj2.constructed && obj1.composed === obj2.composed && asn1.equals(obj1.value, obj2.value); - if (options && options.includeBitStringContents) { - equal = equal && obj1.bitStringContents === obj2.bitStringContents; - } - return equal; - }; - asn1.getBerValueLength = function(b) { - var b2 = b.getByte(); - if (b2 === 128) { - return void 0; - } - var length; - var longForm = b2 & 128; - if (!longForm) { - length = b2; - } else { - length = b.getInt((b2 & 127) << 3); - } - return length; - }; - function _checkBufferLength(bytes, remaining, n) { - if (n > remaining) { - var error3 = new Error("Too few bytes to parse DER."); - error3.available = bytes.length(); - error3.remaining = remaining; - error3.requested = n; - throw error3; - } - } - var _getValueLength = function(bytes, remaining) { - var b2 = bytes.getByte(); - remaining--; - if (b2 === 128) { - return void 0; - } - var length; - var longForm = b2 & 128; - if (!longForm) { - length = b2; - } else { - var longFormBytes = b2 & 127; - _checkBufferLength(bytes, remaining, longFormBytes); - length = bytes.getInt(longFormBytes << 3); - } - if (length < 0) { - throw new Error("Negative length: " + length); - } - return length; - }; - asn1.fromDer = function(bytes, options) { - if (options === void 0) { - options = { - strict: true, - parseAllBytes: true, - decodeBitStrings: true - }; - } - if (typeof options === "boolean") { - options = { - strict: options, - parseAllBytes: true, - decodeBitStrings: true - }; - } - if (!("strict" in options)) { - options.strict = true; - } - if (!("parseAllBytes" in options)) { - options.parseAllBytes = true; - } - if (!("decodeBitStrings" in options)) { - options.decodeBitStrings = true; - } - if (!("maxDepth" in options)) { - options.maxDepth = asn1.maxDepth; - } - if (typeof bytes === "string") { - bytes = forge.util.createBuffer(bytes); - } - var byteCount = bytes.length(); - var value = _fromDer(bytes, bytes.length(), 0, options); - if (options.parseAllBytes && bytes.length() !== 0) { - var error3 = new Error("Unparsed DER bytes remain after ASN.1 parsing."); - error3.byteCount = byteCount; - error3.remaining = bytes.length(); - throw error3; - } - return value; - }; - function _fromDer(bytes, remaining, depth, options) { - if (depth >= options.maxDepth) { - throw new Error("ASN.1 parsing error: Max depth exceeded."); - } - var start; - _checkBufferLength(bytes, remaining, 2); - var b1 = bytes.getByte(); - remaining--; - var tagClass = b1 & 192; - var type = b1 & 31; - start = bytes.length(); - var length = _getValueLength(bytes, remaining); - remaining -= start - bytes.length(); - if (length !== void 0 && length > remaining) { - if (options.strict) { - var error3 = new Error("Too few bytes to read ASN.1 value."); - error3.available = bytes.length(); - error3.remaining = remaining; - error3.requested = length; - throw error3; - } - length = remaining; - } - var value; - var bitStringContents; - var constructed = (b1 & 32) === 32; - if (constructed) { - value = []; - if (length === void 0) { - for (; ; ) { - _checkBufferLength(bytes, remaining, 2); - if (bytes.bytes(2) === String.fromCharCode(0, 0)) { - bytes.getBytes(2); - remaining -= 2; - break; - } - start = bytes.length(); - value.push(_fromDer(bytes, remaining, depth + 1, options)); - remaining -= start - bytes.length(); - } - } else { - while (length > 0) { - start = bytes.length(); - value.push(_fromDer(bytes, length, depth + 1, options)); - remaining -= start - bytes.length(); - length -= start - bytes.length(); - } - } - } - if (value === void 0 && tagClass === asn1.Class.UNIVERSAL && type === asn1.Type.BITSTRING) { - bitStringContents = bytes.bytes(length); - } - if (value === void 0 && options.decodeBitStrings && tagClass === asn1.Class.UNIVERSAL && // FIXME: OCTET STRINGs not yet supported here - // .. other parts of forge expect to decode OCTET STRINGs manually - type === asn1.Type.BITSTRING && length > 1) { - var savedRead = bytes.read; - var savedRemaining = remaining; - var unused = 0; - if (type === asn1.Type.BITSTRING) { - _checkBufferLength(bytes, remaining, 1); - unused = bytes.getByte(); - remaining--; - } - if (unused === 0) { - try { - start = bytes.length(); - var subOptions = { - // enforce strict mode to avoid parsing ASN.1 from plain data - strict: true, - decodeBitStrings: true - }; - var composed = _fromDer(bytes, remaining, depth + 1, subOptions); - var used = start - bytes.length(); - remaining -= used; - if (type == asn1.Type.BITSTRING) { - used++; - } - var tc = composed.tagClass; - if (used === length && (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { - value = [composed]; - } - } catch (ex) { - } - } - if (value === void 0) { - bytes.read = savedRead; - remaining = savedRemaining; - } - } - if (value === void 0) { - if (length === void 0) { - if (options.strict) { - throw new Error("Non-constructed ASN.1 object of indefinite length."); - } - length = remaining; - } - if (type === asn1.Type.BMPSTRING) { - value = ""; - for (; length > 0; length -= 2) { - _checkBufferLength(bytes, remaining, 2); - value += String.fromCharCode(bytes.getInt16()); - remaining -= 2; - } - } else { - value = bytes.getBytes(length); - remaining -= length; - } - } - var asn1Options = bitStringContents === void 0 ? null : { - bitStringContents - }; - return asn1.create(tagClass, type, constructed, value, asn1Options); - } - asn1.toDer = function(obj) { - var bytes = forge.util.createBuffer(); - var b1 = obj.tagClass | obj.type; - var value = forge.util.createBuffer(); - var useBitStringContents = false; - if ("bitStringContents" in obj) { - useBitStringContents = true; - if (obj.original) { - useBitStringContents = asn1.equals(obj, obj.original); - } - } - if (useBitStringContents) { - value.putBytes(obj.bitStringContents); - } else if (obj.composed) { - if (obj.constructed) { - b1 |= 32; - } else { - value.putByte(0); - } - for (var i = 0; i < obj.value.length; ++i) { - if (obj.value[i] !== void 0) { - value.putBuffer(asn1.toDer(obj.value[i])); - } - } - } else { - if (obj.type === asn1.Type.BMPSTRING) { - for (var i = 0; i < obj.value.length; ++i) { - value.putInt16(obj.value.charCodeAt(i)); - } - } else { - if (obj.type === asn1.Type.INTEGER && obj.value.length > 1 && // leading 0x00 for positive integer - (obj.value.charCodeAt(0) === 0 && (obj.value.charCodeAt(1) & 128) === 0 || // leading 0xFF for negative integer - obj.value.charCodeAt(0) === 255 && (obj.value.charCodeAt(1) & 128) === 128)) { - value.putBytes(obj.value.substr(1)); - } else { - value.putBytes(obj.value); - } - } - } - bytes.putByte(b1); - if (value.length() <= 127) { - bytes.putByte(value.length() & 127); - } else { - var len = value.length(); - var lenBytes = ""; - do { - lenBytes += String.fromCharCode(len & 255); - len = len >>> 8; - } while (len > 0); - bytes.putByte(lenBytes.length | 128); - for (var i = lenBytes.length - 1; i >= 0; --i) { - bytes.putByte(lenBytes.charCodeAt(i)); - } - } - bytes.putBuffer(value); - return bytes; - }; - asn1.oidToDer = function(oid) { - var values = oid.split("."); - var bytes = forge.util.createBuffer(); - bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10)); - var last, valueBytes, value, b; - for (var i = 2; i < values.length; ++i) { - last = true; - valueBytes = []; - value = parseInt(values[i], 10); - if (value > 4294967295) { - throw new Error("OID value too large; max is 32-bits."); - } - do { - b = value & 127; - value = value >>> 7; - if (!last) { - b |= 128; - } - valueBytes.push(b); - last = false; - } while (value > 0); - for (var n = valueBytes.length - 1; n >= 0; --n) { - bytes.putByte(valueBytes[n]); - } - } - return bytes; - }; - asn1.derToOid = function(bytes) { - var oid; - if (typeof bytes === "string") { - bytes = forge.util.createBuffer(bytes); - } - var b = bytes.getByte(); - oid = Math.floor(b / 40) + "." + b % 40; - var value = 0; - while (bytes.length() > 0) { - if (value > 70368744177663) { - throw new Error("OID value too large; max is 53-bits."); - } - b = bytes.getByte(); - value = value * 128; - if (b & 128) { - value += b & 127; - } else { - oid += "." + (value + b); - value = 0; - } - } - return oid; - }; - asn1.utcTimeToDate = function(utc) { - var date = /* @__PURE__ */ new Date(); - var year = parseInt(utc.substr(0, 2), 10); - year = year >= 50 ? 1900 + year : 2e3 + year; - var MM = parseInt(utc.substr(2, 2), 10) - 1; - var DD = parseInt(utc.substr(4, 2), 10); - var hh = parseInt(utc.substr(6, 2), 10); - var mm = parseInt(utc.substr(8, 2), 10); - var ss = 0; - if (utc.length > 11) { - var c = utc.charAt(10); - var end = 10; - if (c !== "+" && c !== "-") { - ss = parseInt(utc.substr(10, 2), 10); - end += 2; - } - } - date.setUTCFullYear(year, MM, DD); - date.setUTCHours(hh, mm, ss, 0); - if (end) { - c = utc.charAt(end); - if (c === "+" || c === "-") { - var hhoffset = parseInt(utc.substr(end + 1, 2), 10); - var mmoffset = parseInt(utc.substr(end + 4, 2), 10); - var offset = hhoffset * 60 + mmoffset; - offset *= 6e4; - if (c === "+") { - date.setTime(+date - offset); - } else { - date.setTime(+date + offset); - } - } - } - return date; - }; - asn1.generalizedTimeToDate = function(gentime) { - var date = /* @__PURE__ */ new Date(); - var YYYY = parseInt(gentime.substr(0, 4), 10); - var MM = parseInt(gentime.substr(4, 2), 10) - 1; - var DD = parseInt(gentime.substr(6, 2), 10); - var hh = parseInt(gentime.substr(8, 2), 10); - var mm = parseInt(gentime.substr(10, 2), 10); - var ss = parseInt(gentime.substr(12, 2), 10); - var fff = 0; - var offset = 0; - var isUTC = false; - if (gentime.charAt(gentime.length - 1) === "Z") { - isUTC = true; - } - var end = gentime.length - 5, c = gentime.charAt(end); - if (c === "+" || c === "-") { - var hhoffset = parseInt(gentime.substr(end + 1, 2), 10); - var mmoffset = parseInt(gentime.substr(end + 4, 2), 10); - offset = hhoffset * 60 + mmoffset; - offset *= 6e4; - if (c === "+") { - offset *= -1; - } - isUTC = true; - } - if (gentime.charAt(14) === ".") { - fff = parseFloat(gentime.substr(14), 10) * 1e3; - } - if (isUTC) { - date.setUTCFullYear(YYYY, MM, DD); - date.setUTCHours(hh, mm, ss, fff); - date.setTime(+date + offset); - } else { - date.setFullYear(YYYY, MM, DD); - date.setHours(hh, mm, ss, fff); - } - return date; - }; - asn1.dateToUtcTime = function(date) { - if (typeof date === "string") { - return date; - } - var rval = ""; - var format = []; - format.push(("" + date.getUTCFullYear()).substr(2)); - format.push("" + (date.getUTCMonth() + 1)); - format.push("" + date.getUTCDate()); - format.push("" + date.getUTCHours()); - format.push("" + date.getUTCMinutes()); - format.push("" + date.getUTCSeconds()); - for (var i = 0; i < format.length; ++i) { - if (format[i].length < 2) { - rval += "0"; - } - rval += format[i]; - } - rval += "Z"; - return rval; - }; - asn1.dateToGeneralizedTime = function(date) { - if (typeof date === "string") { - return date; - } - var rval = ""; - var format = []; - format.push("" + date.getUTCFullYear()); - format.push("" + (date.getUTCMonth() + 1)); - format.push("" + date.getUTCDate()); - format.push("" + date.getUTCHours()); - format.push("" + date.getUTCMinutes()); - format.push("" + date.getUTCSeconds()); - for (var i = 0; i < format.length; ++i) { - if (format[i].length < 2) { - rval += "0"; - } - rval += format[i]; - } - rval += "Z"; - return rval; - }; - asn1.integerToDer = function(x) { - var rval = forge.util.createBuffer(); - if (x >= -128 && x < 128) { - return rval.putSignedInt(x, 8); - } - if (x >= -32768 && x < 32768) { - return rval.putSignedInt(x, 16); - } - if (x >= -8388608 && x < 8388608) { - return rval.putSignedInt(x, 24); - } - if (x >= -2147483648 && x < 2147483648) { - return rval.putSignedInt(x, 32); - } - var error3 = new Error("Integer too large; max is 32-bits."); - error3.integer = x; - throw error3; - }; - asn1.derToInteger = function(bytes) { - if (typeof bytes === "string") { - bytes = forge.util.createBuffer(bytes); - } - var n = bytes.length() * 8; - if (n > 32) { - throw new Error("Integer too large; max is 32-bits."); - } - return bytes.getSignedInt(n); - }; - asn1.validate = function(obj, v, capture, errors) { - var rval = false; - if ((obj.tagClass === v.tagClass || typeof v.tagClass === "undefined") && (obj.type === v.type || typeof v.type === "undefined")) { - if (obj.constructed === v.constructed || typeof v.constructed === "undefined") { - rval = true; - if (v.value && forge.util.isArray(v.value)) { - var j = 0; - for (var i = 0; rval && i < v.value.length; ++i) { - var schemaItem = v.value[i]; - rval = !!schemaItem.optional; - var objChild = obj.value[j]; - if (!objChild) { - if (!schemaItem.optional) { - rval = false; - if (errors) { - errors.push("[" + v.name + '] Missing required element. Expected tag class "' + schemaItem.tagClass + '", type "' + schemaItem.type + '"'); - } - } - continue; - } - var schemaHasTag = typeof schemaItem.tagClass !== "undefined" && typeof schemaItem.type !== "undefined"; - if (schemaHasTag && (objChild.tagClass !== schemaItem.tagClass || objChild.type !== schemaItem.type)) { - if (schemaItem.optional) { - rval = true; - continue; - } else { - rval = false; - if (errors) { - errors.push("[" + v.name + "] Tag mismatch. Expected (" + schemaItem.tagClass + "," + schemaItem.type + "), got (" + objChild.tagClass + "," + objChild.type + ")"); - } - break; - } - } - var childRval = asn1.validate(objChild, schemaItem, capture, errors); - if (childRval) { - ++j; - rval = true; - } else if (schemaItem.optional) { - rval = true; - } else { - rval = false; - break; - } - } - } - if (rval && capture) { - if (v.capture) { - capture[v.capture] = obj.value; - } - if (v.captureAsn1) { - capture[v.captureAsn1] = obj; - } - if (v.captureBitStringContents && "bitStringContents" in obj) { - capture[v.captureBitStringContents] = obj.bitStringContents; - } - if (v.captureBitStringValue && "bitStringContents" in obj) { - var value; - if (obj.bitStringContents.length < 2) { - capture[v.captureBitStringValue] = ""; - } else { - var unused = obj.bitStringContents.charCodeAt(0); - if (unused !== 0) { - throw new Error( - "captureBitStringValue only supported for zero unused bits" - ); - } - capture[v.captureBitStringValue] = obj.bitStringContents.slice(1); - } - } - } - } else if (errors) { - errors.push( - "[" + v.name + '] Expected constructed "' + v.constructed + '", got "' + obj.constructed + '"' - ); - } - } else if (errors) { - if (obj.tagClass !== v.tagClass) { - errors.push( - "[" + v.name + '] Expected tag class "' + v.tagClass + '", got "' + obj.tagClass + '"' - ); - } - if (obj.type !== v.type) { - errors.push( - "[" + v.name + '] Expected type "' + v.type + '", got "' + obj.type + '"' - ); - } - } - return rval; - }; - var _nonLatinRegex = /[^\\u0000-\\u00ff]/; - asn1.prettyPrint = function(obj, level, indentation) { - var rval = ""; - level = level || 0; - indentation = indentation || 2; - if (level > 0) { - rval += "\n"; - } - var indent = ""; - for (var i = 0; i < level * indentation; ++i) { - indent += " "; - } - rval += indent + "Tag: "; - switch (obj.tagClass) { - case asn1.Class.UNIVERSAL: - rval += "Universal:"; - break; - case asn1.Class.APPLICATION: - rval += "Application:"; - break; - case asn1.Class.CONTEXT_SPECIFIC: - rval += "Context-Specific:"; - break; - case asn1.Class.PRIVATE: - rval += "Private:"; - break; - } - if (obj.tagClass === asn1.Class.UNIVERSAL) { - rval += obj.type; - switch (obj.type) { - case asn1.Type.NONE: - rval += " (None)"; - break; - case asn1.Type.BOOLEAN: - rval += " (Boolean)"; - break; - case asn1.Type.INTEGER: - rval += " (Integer)"; - break; - case asn1.Type.BITSTRING: - rval += " (Bit string)"; - break; - case asn1.Type.OCTETSTRING: - rval += " (Octet string)"; - break; - case asn1.Type.NULL: - rval += " (Null)"; - break; - case asn1.Type.OID: - rval += " (Object Identifier)"; - break; - case asn1.Type.ODESC: - rval += " (Object Descriptor)"; - break; - case asn1.Type.EXTERNAL: - rval += " (External or Instance of)"; - break; - case asn1.Type.REAL: - rval += " (Real)"; - break; - case asn1.Type.ENUMERATED: - rval += " (Enumerated)"; - break; - case asn1.Type.EMBEDDED: - rval += " (Embedded PDV)"; - break; - case asn1.Type.UTF8: - rval += " (UTF8)"; - break; - case asn1.Type.ROID: - rval += " (Relative Object Identifier)"; - break; - case asn1.Type.SEQUENCE: - rval += " (Sequence)"; - break; - case asn1.Type.SET: - rval += " (Set)"; - break; - case asn1.Type.PRINTABLESTRING: - rval += " (Printable String)"; - break; - case asn1.Type.IA5String: - rval += " (IA5String (ASCII))"; - break; - case asn1.Type.UTCTIME: - rval += " (UTC time)"; - break; - case asn1.Type.GENERALIZEDTIME: - rval += " (Generalized time)"; - break; - case asn1.Type.BMPSTRING: - rval += " (BMP String)"; - break; - } - } else { - rval += obj.type; - } - rval += "\n"; - rval += indent + "Constructed: " + obj.constructed + "\n"; - if (obj.composed) { - var subvalues = 0; - var sub = ""; - for (var i = 0; i < obj.value.length; ++i) { - if (obj.value[i] !== void 0) { - subvalues += 1; - sub += asn1.prettyPrint(obj.value[i], level + 1, indentation); - if (i + 1 < obj.value.length) { - sub += ","; - } - } - } - rval += indent + "Sub values: " + subvalues + sub; - } else { - rval += indent + "Value: "; - if (obj.type === asn1.Type.OID) { - var oid = asn1.derToOid(obj.value); - rval += oid; - if (forge.pki && forge.pki.oids) { - if (oid in forge.pki.oids) { - rval += " (" + forge.pki.oids[oid] + ") "; - } - } - } - if (obj.type === asn1.Type.INTEGER) { - try { - rval += asn1.derToInteger(obj.value); - } catch (ex) { - rval += "0x" + forge.util.bytesToHex(obj.value); - } - } else if (obj.type === asn1.Type.BITSTRING) { - if (obj.value.length > 1) { - rval += "0x" + forge.util.bytesToHex(obj.value.slice(1)); - } else { - rval += "(none)"; - } - if (obj.value.length > 0) { - var unused = obj.value.charCodeAt(0); - if (unused == 1) { - rval += " (1 unused bit shown)"; - } else if (unused > 1) { - rval += " (" + unused + " unused bits shown)"; - } - } - } else if (obj.type === asn1.Type.OCTETSTRING) { - if (!_nonLatinRegex.test(obj.value)) { - rval += "(" + obj.value + ") "; - } - rval += "0x" + forge.util.bytesToHex(obj.value); - } else if (obj.type === asn1.Type.UTF8) { - try { - rval += forge.util.decodeUtf8(obj.value); - } catch (e) { - if (e.message === "URI malformed") { - rval += "0x" + forge.util.bytesToHex(obj.value) + " (malformed UTF8)"; - } else { - throw e; - } - } - } else if (obj.type === asn1.Type.PRINTABLESTRING || obj.type === asn1.Type.IA5String) { - rval += obj.value; - } else if (_nonLatinRegex.test(obj.value)) { - rval += "0x" + forge.util.bytesToHex(obj.value); - } else if (obj.value.length === 0) { - rval += "[null]"; - } else { - rval += obj.value; - } - } - return rval; - }; - } -}); - -// node_modules/node-forge/lib/md.js -var require_md = __commonJS({ - "node_modules/node-forge/lib/md.js"(exports2, module2) { - var forge = require_forge(); - module2.exports = forge.md = forge.md || {}; - forge.md.algorithms = forge.md.algorithms || {}; - } -}); - -// node_modules/node-forge/lib/hmac.js -var require_hmac = __commonJS({ - "node_modules/node-forge/lib/hmac.js"(exports2, module2) { - var forge = require_forge(); - require_md(); - require_util16(); - var hmac = module2.exports = forge.hmac = forge.hmac || {}; - hmac.create = function() { - var _key = null; - var _md = null; - var _ipadding = null; - var _opadding = null; - var ctx = {}; - ctx.start = function(md2, key) { - if (md2 !== null) { - if (typeof md2 === "string") { - md2 = md2.toLowerCase(); - if (md2 in forge.md.algorithms) { - _md = forge.md.algorithms[md2].create(); - } else { - throw new Error('Unknown hash algorithm "' + md2 + '"'); - } - } else { - _md = md2; - } - } - if (key === null) { - key = _key; - } else { - if (typeof key === "string") { - key = forge.util.createBuffer(key); - } else if (forge.util.isArray(key)) { - var tmp = key; - key = forge.util.createBuffer(); - for (var i = 0; i < tmp.length; ++i) { - key.putByte(tmp[i]); - } - } - var keylen = key.length(); - if (keylen > _md.blockLength) { - _md.start(); - _md.update(key.bytes()); - key = _md.digest(); - } - _ipadding = forge.util.createBuffer(); - _opadding = forge.util.createBuffer(); - keylen = key.length(); - for (var i = 0; i < keylen; ++i) { - var tmp = key.at(i); - _ipadding.putByte(54 ^ tmp); - _opadding.putByte(92 ^ tmp); - } - if (keylen < _md.blockLength) { - var tmp = _md.blockLength - keylen; - for (var i = 0; i < tmp; ++i) { - _ipadding.putByte(54); - _opadding.putByte(92); - } - } - _key = key; - _ipadding = _ipadding.bytes(); - _opadding = _opadding.bytes(); - } - _md.start(); - _md.update(_ipadding); - }; - ctx.update = function(bytes) { - _md.update(bytes); - }; - ctx.getMac = function() { - var inner = _md.digest().bytes(); - _md.start(); - _md.update(_opadding); - _md.update(inner); - return _md.digest(); - }; - ctx.digest = ctx.getMac; - return ctx; - }; - } -}); - -// node_modules/node-forge/lib/md5.js -var require_md5 = __commonJS({ - "node_modules/node-forge/lib/md5.js"(exports2, module2) { - var forge = require_forge(); - require_md(); - require_util16(); - var md5 = module2.exports = forge.md5 = forge.md5 || {}; - forge.md.md5 = forge.md.algorithms.md5 = md5; - md5.create = function() { - if (!_initialized) { - _init(); - } - var _state = null; - var _input = forge.util.createBuffer(); - var _w = new Array(16); - var md2 = { - algorithm: "md5", - blockLength: 64, - digestLength: 16, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - md2.start = function() { - md2.messageLength = 0; - md2.fullMessageLength = md2.messageLength64 = []; - var int32s = md2.messageLengthSize / 4; - for (var i = 0; i < int32s; ++i) { - md2.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 1732584193, - h1: 4023233417, - h2: 2562383102, - h3: 271733878 - }; - return md2; - }; - md2.start(); - md2.update = function(msg, encoding) { - if (encoding === "utf8") { - msg = forge.util.encodeUtf8(msg); - } - var len = msg.length; - md2.messageLength += len; - len = [len / 4294967296 >>> 0, len >>> 0]; - for (var i = md2.fullMessageLength.length - 1; i >= 0; --i) { - md2.fullMessageLength[i] += len[1]; - len[1] = len[0] + (md2.fullMessageLength[i] / 4294967296 >>> 0); - md2.fullMessageLength[i] = md2.fullMessageLength[i] >>> 0; - len[0] = len[1] / 4294967296 >>> 0; - } - _input.putBytes(msg); - _update(_state, _w, _input); - if (_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - return md2; - }; - md2.digest = function() { - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - var remaining = md2.fullMessageLength[md2.fullMessageLength.length - 1] + md2.messageLengthSize; - var overflow = remaining & md2.blockLength - 1; - finalBlock.putBytes(_padding.substr(0, md2.blockLength - overflow)); - var bits, carry = 0; - for (var i = md2.fullMessageLength.length - 1; i >= 0; --i) { - bits = md2.fullMessageLength[i] * 8 + carry; - carry = bits / 4294967296 >>> 0; - finalBlock.putInt32Le(bits >>> 0); - } - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32Le(s2.h0); - rval.putInt32Le(s2.h1); - rval.putInt32Le(s2.h2); - rval.putInt32Le(s2.h3); - return rval; - }; - return md2; - }; - var _padding = null; - var _g = null; - var _r = null; - var _k = null; - var _initialized = false; - function _init() { - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0), 64); - _g = [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 1, - 6, - 11, - 0, - 5, - 10, - 15, - 4, - 9, - 14, - 3, - 8, - 13, - 2, - 7, - 12, - 5, - 8, - 11, - 14, - 1, - 4, - 7, - 10, - 13, - 0, - 3, - 6, - 9, - 12, - 15, - 2, - 0, - 7, - 14, - 5, - 12, - 3, - 10, - 1, - 8, - 15, - 6, - 13, - 4, - 11, - 2, - 9 - ]; - _r = [ - 7, - 12, - 17, - 22, - 7, - 12, - 17, - 22, - 7, - 12, - 17, - 22, - 7, - 12, - 17, - 22, - 5, - 9, - 14, - 20, - 5, - 9, - 14, - 20, - 5, - 9, - 14, - 20, - 5, - 9, - 14, - 20, - 4, - 11, - 16, - 23, - 4, - 11, - 16, - 23, - 4, - 11, - 16, - 23, - 4, - 11, - 16, - 23, - 6, - 10, - 15, - 21, - 6, - 10, - 15, - 21, - 6, - 10, - 15, - 21, - 6, - 10, - 15, - 21 - ]; - _k = new Array(64); - for (var i = 0; i < 64; ++i) { - _k[i] = Math.floor(Math.abs(Math.sin(i + 1)) * 4294967296); - } - _initialized = true; - } - function _update(s, w, bytes) { - var t, a, b, c, d, f, r, i; - var len = bytes.length(); - while (len >= 64) { - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - for (i = 0; i < 16; ++i) { - w[i] = bytes.getInt32Le(); - f = d ^ b & (c ^ d); - t = a + f + _k[i] + w[i]; - r = _r[i]; - a = d; - d = c; - c = b; - b += t << r | t >>> 32 - r; - } - for (; i < 32; ++i) { - f = c ^ d & (b ^ c); - t = a + f + _k[i] + w[_g[i]]; - r = _r[i]; - a = d; - d = c; - c = b; - b += t << r | t >>> 32 - r; - } - for (; i < 48; ++i) { - f = b ^ c ^ d; - t = a + f + _k[i] + w[_g[i]]; - r = _r[i]; - a = d; - d = c; - c = b; - b += t << r | t >>> 32 - r; - } - for (; i < 64; ++i) { - f = c ^ (b | ~d); - t = a + f + _k[i] + w[_g[i]]; - r = _r[i]; - a = d; - d = c; - c = b; - b += t << r | t >>> 32 - r; - } - s.h0 = s.h0 + a | 0; - s.h1 = s.h1 + b | 0; - s.h2 = s.h2 + c | 0; - s.h3 = s.h3 + d | 0; - len -= 64; - } - } - } -}); - -// node_modules/node-forge/lib/pem.js -var require_pem = __commonJS({ - "node_modules/node-forge/lib/pem.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - var pem = module2.exports = forge.pem = forge.pem || {}; - pem.encode = function(msg, options) { - options = options || {}; - var rval = "-----BEGIN " + msg.type + "-----\r\n"; - var header; - if (msg.procType) { - header = { - name: "Proc-Type", - values: [String(msg.procType.version), msg.procType.type] - }; - rval += foldHeader(header); - } - if (msg.contentDomain) { - header = { name: "Content-Domain", values: [msg.contentDomain] }; - rval += foldHeader(header); - } - if (msg.dekInfo) { - header = { name: "DEK-Info", values: [msg.dekInfo.algorithm] }; - if (msg.dekInfo.parameters) { - header.values.push(msg.dekInfo.parameters); - } - rval += foldHeader(header); - } - if (msg.headers) { - for (var i = 0; i < msg.headers.length; ++i) { - rval += foldHeader(msg.headers[i]); - } - } - if (msg.procType) { - rval += "\r\n"; - } - rval += forge.util.encode64(msg.body, options.maxline || 64) + "\r\n"; - rval += "-----END " + msg.type + "-----\r\n"; - return rval; - }; - pem.decode = function(str) { - var rval = []; - var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g; - var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/; - var rCRLF = /\r?\n/; - var match2; - while (true) { - match2 = rMessage.exec(str); - if (!match2) { - break; - } - var type = match2[1]; - if (type === "NEW CERTIFICATE REQUEST") { - type = "CERTIFICATE REQUEST"; - } - var msg = { - type, - procType: null, - contentDomain: null, - dekInfo: null, - headers: [], - body: forge.util.decode64(match2[3]) - }; - rval.push(msg); - if (!match2[2]) { - continue; - } - var lines = match2[2].split(rCRLF); - var li = 0; - while (match2 && li < lines.length) { - var line = lines[li].replace(/\s+$/, ""); - for (var nl = li + 1; nl < lines.length; ++nl) { - var next = lines[nl]; - if (!/\s/.test(next[0])) { - break; - } - line += next; - li = nl; - } - match2 = line.match(rHeader); - if (match2) { - var header = { name: match2[1], values: [] }; - var values = match2[2].split(","); - for (var vi = 0; vi < values.length; ++vi) { - header.values.push(ltrim(values[vi])); - } - if (!msg.procType) { - if (header.name !== "Proc-Type") { - throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".'); - } else if (header.values.length !== 2) { - throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.'); - } - msg.procType = { version: values[0], type: values[1] }; - } else if (!msg.contentDomain && header.name === "Content-Domain") { - msg.contentDomain = values[0] || ""; - } else if (!msg.dekInfo && header.name === "DEK-Info") { - if (header.values.length === 0) { - throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.'); - } - msg.dekInfo = { algorithm: values[0], parameters: values[1] || null }; - } else { - msg.headers.push(header); - } - } - ++li; - } - if (msg.procType === "ENCRYPTED" && !msg.dekInfo) { - throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".'); - } - } - if (rval.length === 0) { - throw new Error("Invalid PEM formatted message."); - } - return rval; - }; - function foldHeader(header) { - var rval = header.name + ": "; - var values = []; - var insertSpace = function(match2, $1) { - return " " + $1; - }; - for (var i = 0; i < header.values.length; ++i) { - values.push(header.values[i].replace(/^(\S+\r\n)/, insertSpace)); - } - rval += values.join(",") + "\r\n"; - var length = 0; - var candidate = -1; - for (var i = 0; i < rval.length; ++i, ++length) { - if (length > 65 && candidate !== -1) { - var insert = rval[candidate]; - if (insert === ",") { - ++candidate; - rval = rval.substr(0, candidate) + "\r\n " + rval.substr(candidate); - } else { - rval = rval.substr(0, candidate) + "\r\n" + insert + rval.substr(candidate + 1); - } - length = i - candidate - 1; - candidate = -1; - ++i; - } else if (rval[i] === " " || rval[i] === " " || rval[i] === ",") { - candidate = i; - } - } - return rval; - } - function ltrim(str) { - return str.replace(/^\s+/, ""); - } - } -}); - -// node_modules/node-forge/lib/des.js -var require_des = __commonJS({ - "node_modules/node-forge/lib/des.js"(exports2, module2) { - var forge = require_forge(); - require_cipher(); - require_cipherModes(); - require_util16(); - module2.exports = forge.des = forge.des || {}; - forge.des.startEncrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key, - output, - decrypt: false, - mode: mode || (iv === null ? "ECB" : "CBC") - }); - cipher.start(iv); - return cipher; - }; - forge.des.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key, - output: null, - decrypt: false, - mode - }); - }; - forge.des.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key, - output, - decrypt: true, - mode: mode || (iv === null ? "ECB" : "CBC") - }); - cipher.start(iv); - return cipher; - }; - forge.des.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key, - output: null, - decrypt: true, - mode - }); - }; - forge.des.Algorithm = function(name, mode) { - var self2 = this; - self2.name = name; - self2.mode = new mode({ - blockSize: 8, - cipher: { - encrypt: function(inBlock, outBlock) { - return _updateBlock(self2._keys, inBlock, outBlock, false); - }, - decrypt: function(inBlock, outBlock) { - return _updateBlock(self2._keys, inBlock, outBlock, true); - } - } - }); - self2._init = false; - }; - forge.des.Algorithm.prototype.initialize = function(options) { - if (this._init) { - return; - } - var key = forge.util.createBuffer(options.key); - if (this.name.indexOf("3DES") === 0) { - if (key.length() !== 24) { - throw new Error("Invalid Triple-DES key size: " + key.length() * 8); - } - } - this._keys = _createKeys(key); - this._init = true; - }; - registerAlgorithm("DES-ECB", forge.cipher.modes.ecb); - registerAlgorithm("DES-CBC", forge.cipher.modes.cbc); - registerAlgorithm("DES-CFB", forge.cipher.modes.cfb); - registerAlgorithm("DES-OFB", forge.cipher.modes.ofb); - registerAlgorithm("DES-CTR", forge.cipher.modes.ctr); - registerAlgorithm("3DES-ECB", forge.cipher.modes.ecb); - registerAlgorithm("3DES-CBC", forge.cipher.modes.cbc); - registerAlgorithm("3DES-CFB", forge.cipher.modes.cfb); - registerAlgorithm("3DES-OFB", forge.cipher.modes.ofb); - registerAlgorithm("3DES-CTR", forge.cipher.modes.ctr); - function registerAlgorithm(name, mode) { - var factory = function() { - return new forge.des.Algorithm(name, mode); - }; - forge.cipher.registerAlgorithm(name, factory); - } - var spfunction1 = [16843776, 0, 65536, 16843780, 16842756, 66564, 4, 65536, 1024, 16843776, 16843780, 1024, 16778244, 16842756, 16777216, 4, 1028, 16778240, 16778240, 66560, 66560, 16842752, 16842752, 16778244, 65540, 16777220, 16777220, 65540, 0, 1028, 66564, 16777216, 65536, 16843780, 4, 16842752, 16843776, 16777216, 16777216, 1024, 16842756, 65536, 66560, 16777220, 1024, 4, 16778244, 66564, 16843780, 65540, 16842752, 16778244, 16777220, 1028, 66564, 16843776, 1028, 16778240, 16778240, 0, 65540, 66560, 0, 16842756]; - var spfunction2 = [-2146402272, -2147450880, 32768, 1081376, 1048576, 32, -2146435040, -2147450848, -2147483616, -2146402272, -2146402304, -2147483648, -2147450880, 1048576, 32, -2146435040, 1081344, 1048608, -2147450848, 0, -2147483648, 32768, 1081376, -2146435072, 1048608, -2147483616, 0, 1081344, 32800, -2146402304, -2146435072, 32800, 0, 1081376, -2146435040, 1048576, -2147450848, -2146435072, -2146402304, 32768, -2146435072, -2147450880, 32, -2146402272, 1081376, 32, 32768, -2147483648, 32800, -2146402304, 1048576, -2147483616, 1048608, -2147450848, -2147483616, 1048608, 1081344, 0, -2147450880, 32800, -2147483648, -2146435040, -2146402272, 1081344]; - var spfunction3 = [520, 134349312, 0, 134348808, 134218240, 0, 131592, 134218240, 131080, 134217736, 134217736, 131072, 134349320, 131080, 134348800, 520, 134217728, 8, 134349312, 512, 131584, 134348800, 134348808, 131592, 134218248, 131584, 131072, 134218248, 8, 134349320, 512, 134217728, 134349312, 134217728, 131080, 520, 131072, 134349312, 134218240, 0, 512, 131080, 134349320, 134218240, 134217736, 512, 0, 134348808, 134218248, 131072, 134217728, 134349320, 8, 131592, 131584, 134217736, 134348800, 134218248, 520, 134348800, 131592, 8, 134348808, 131584]; - var spfunction4 = [8396801, 8321, 8321, 128, 8396928, 8388737, 8388609, 8193, 0, 8396800, 8396800, 8396929, 129, 0, 8388736, 8388609, 1, 8192, 8388608, 8396801, 128, 8388608, 8193, 8320, 8388737, 1, 8320, 8388736, 8192, 8396928, 8396929, 129, 8388736, 8388609, 8396800, 8396929, 129, 0, 0, 8396800, 8320, 8388736, 8388737, 1, 8396801, 8321, 8321, 128, 8396929, 129, 1, 8192, 8388609, 8193, 8396928, 8388737, 8193, 8320, 8388608, 8396801, 128, 8388608, 8192, 8396928]; - var spfunction5 = [256, 34078976, 34078720, 1107296512, 524288, 256, 1073741824, 34078720, 1074266368, 524288, 33554688, 1074266368, 1107296512, 1107820544, 524544, 1073741824, 33554432, 1074266112, 1074266112, 0, 1073742080, 1107820800, 1107820800, 33554688, 1107820544, 1073742080, 0, 1107296256, 34078976, 33554432, 1107296256, 524544, 524288, 1107296512, 256, 33554432, 1073741824, 34078720, 1107296512, 1074266368, 33554688, 1073741824, 1107820544, 34078976, 1074266368, 256, 33554432, 1107820544, 1107820800, 524544, 1107296256, 1107820800, 34078720, 0, 1074266112, 1107296256, 524544, 33554688, 1073742080, 524288, 0, 1074266112, 34078976, 1073742080]; - var spfunction6 = [536870928, 541065216, 16384, 541081616, 541065216, 16, 541081616, 4194304, 536887296, 4210704, 4194304, 536870928, 4194320, 536887296, 536870912, 16400, 0, 4194320, 536887312, 16384, 4210688, 536887312, 16, 541065232, 541065232, 0, 4210704, 541081600, 16400, 4210688, 541081600, 536870912, 536887296, 16, 541065232, 4210688, 541081616, 4194304, 16400, 536870928, 4194304, 536887296, 536870912, 16400, 536870928, 541081616, 4210688, 541065216, 4210704, 541081600, 0, 541065232, 16, 16384, 541065216, 4210704, 16384, 4194320, 536887312, 0, 541081600, 536870912, 4194320, 536887312]; - var spfunction7 = [2097152, 69206018, 67110914, 0, 2048, 67110914, 2099202, 69208064, 69208066, 2097152, 0, 67108866, 2, 67108864, 69206018, 2050, 67110912, 2099202, 2097154, 67110912, 67108866, 69206016, 69208064, 2097154, 69206016, 2048, 2050, 69208066, 2099200, 2, 67108864, 2099200, 67108864, 2099200, 2097152, 67110914, 67110914, 69206018, 69206018, 2, 2097154, 67108864, 67110912, 2097152, 69208064, 2050, 2099202, 69208064, 2050, 67108866, 69208066, 69206016, 2099200, 0, 2, 69208066, 0, 2099202, 69206016, 2048, 67108866, 67110912, 2048, 2097154]; - var spfunction8 = [268439616, 4096, 262144, 268701760, 268435456, 268439616, 64, 268435456, 262208, 268697600, 268701760, 266240, 268701696, 266304, 4096, 64, 268697600, 268435520, 268439552, 4160, 266240, 262208, 268697664, 268701696, 4160, 0, 0, 268697664, 268435520, 268439552, 266304, 262144, 266304, 262144, 268701696, 4096, 64, 268697664, 4096, 266304, 268439552, 64, 268435520, 268697600, 268697664, 268435456, 262144, 268439616, 0, 268701760, 262208, 268435520, 268697600, 268439552, 268439616, 0, 268701760, 266240, 266240, 4160, 4160, 262208, 268435456, 268701696]; - function _createKeys(key) { - var pc2bytes0 = [0, 4, 536870912, 536870916, 65536, 65540, 536936448, 536936452, 512, 516, 536871424, 536871428, 66048, 66052, 536936960, 536936964], pc2bytes1 = [0, 1, 1048576, 1048577, 67108864, 67108865, 68157440, 68157441, 256, 257, 1048832, 1048833, 67109120, 67109121, 68157696, 68157697], pc2bytes2 = [0, 8, 2048, 2056, 16777216, 16777224, 16779264, 16779272, 0, 8, 2048, 2056, 16777216, 16777224, 16779264, 16779272], pc2bytes3 = [0, 2097152, 134217728, 136314880, 8192, 2105344, 134225920, 136323072, 131072, 2228224, 134348800, 136445952, 139264, 2236416, 134356992, 136454144], pc2bytes4 = [0, 262144, 16, 262160, 0, 262144, 16, 262160, 4096, 266240, 4112, 266256, 4096, 266240, 4112, 266256], pc2bytes5 = [0, 1024, 32, 1056, 0, 1024, 32, 1056, 33554432, 33555456, 33554464, 33555488, 33554432, 33555456, 33554464, 33555488], pc2bytes6 = [0, 268435456, 524288, 268959744, 2, 268435458, 524290, 268959746, 0, 268435456, 524288, 268959744, 2, 268435458, 524290, 268959746], pc2bytes7 = [0, 65536, 2048, 67584, 536870912, 536936448, 536872960, 536938496, 131072, 196608, 133120, 198656, 537001984, 537067520, 537004032, 537069568], pc2bytes8 = [0, 262144, 0, 262144, 2, 262146, 2, 262146, 33554432, 33816576, 33554432, 33816576, 33554434, 33816578, 33554434, 33816578], pc2bytes9 = [0, 268435456, 8, 268435464, 0, 268435456, 8, 268435464, 1024, 268436480, 1032, 268436488, 1024, 268436480, 1032, 268436488], pc2bytes10 = [0, 32, 0, 32, 1048576, 1048608, 1048576, 1048608, 8192, 8224, 8192, 8224, 1056768, 1056800, 1056768, 1056800], pc2bytes11 = [0, 16777216, 512, 16777728, 2097152, 18874368, 2097664, 18874880, 67108864, 83886080, 67109376, 83886592, 69206016, 85983232, 69206528, 85983744], pc2bytes12 = [0, 4096, 134217728, 134221824, 524288, 528384, 134742016, 134746112, 16, 4112, 134217744, 134221840, 524304, 528400, 134742032, 134746128], pc2bytes13 = [0, 4, 256, 260, 0, 4, 256, 260, 1, 5, 257, 261, 1, 5, 257, 261]; - var iterations = key.length() > 8 ? 3 : 1; - var keys = []; - var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0]; - var n = 0, tmp; - for (var j = 0; j < iterations; j++) { - var left = key.getInt32(); - var right = key.getInt32(); - tmp = (left >>> 4 ^ right) & 252645135; - right ^= tmp; - left ^= tmp << 4; - tmp = (right >>> -16 ^ left) & 65535; - left ^= tmp; - right ^= tmp << -16; - tmp = (left >>> 2 ^ right) & 858993459; - right ^= tmp; - left ^= tmp << 2; - tmp = (right >>> -16 ^ left) & 65535; - left ^= tmp; - right ^= tmp << -16; - tmp = (left >>> 1 ^ right) & 1431655765; - right ^= tmp; - left ^= tmp << 1; - tmp = (right >>> 8 ^ left) & 16711935; - left ^= tmp; - right ^= tmp << 8; - tmp = (left >>> 1 ^ right) & 1431655765; - right ^= tmp; - left ^= tmp << 1; - tmp = left << 8 | right >>> 20 & 240; - left = right << 24 | right << 8 & 16711680 | right >>> 8 & 65280 | right >>> 24 & 240; - right = tmp; - for (var i = 0; i < shifts.length; ++i) { - if (shifts[i]) { - left = left << 2 | left >>> 26; - right = right << 2 | right >>> 26; - } else { - left = left << 1 | left >>> 27; - right = right << 1 | right >>> 27; - } - left &= -15; - right &= -15; - var lefttmp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 15] | pc2bytes2[left >>> 20 & 15] | pc2bytes3[left >>> 16 & 15] | pc2bytes4[left >>> 12 & 15] | pc2bytes5[left >>> 8 & 15] | pc2bytes6[left >>> 4 & 15]; - var righttmp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 15] | pc2bytes9[right >>> 20 & 15] | pc2bytes10[right >>> 16 & 15] | pc2bytes11[right >>> 12 & 15] | pc2bytes12[right >>> 8 & 15] | pc2bytes13[right >>> 4 & 15]; - tmp = (righttmp >>> 16 ^ lefttmp) & 65535; - keys[n++] = lefttmp ^ tmp; - keys[n++] = righttmp ^ tmp << 16; - } - } - return keys; - } - function _updateBlock(keys, input, output, decrypt) { - var iterations = keys.length === 32 ? 3 : 9; - var looping; - if (iterations === 3) { - looping = decrypt ? [30, -2, -2] : [0, 32, 2]; - } else { - looping = decrypt ? [94, 62, -2, 32, 64, 2, 30, -2, -2] : [0, 32, 2, 62, 30, -2, 64, 96, 2]; - } - var tmp; - var left = input[0]; - var right = input[1]; - tmp = (left >>> 4 ^ right) & 252645135; - right ^= tmp; - left ^= tmp << 4; - tmp = (left >>> 16 ^ right) & 65535; - right ^= tmp; - left ^= tmp << 16; - tmp = (right >>> 2 ^ left) & 858993459; - left ^= tmp; - right ^= tmp << 2; - tmp = (right >>> 8 ^ left) & 16711935; - left ^= tmp; - right ^= tmp << 8; - tmp = (left >>> 1 ^ right) & 1431655765; - right ^= tmp; - left ^= tmp << 1; - left = left << 1 | left >>> 31; - right = right << 1 | right >>> 31; - for (var j = 0; j < iterations; j += 3) { - var endloop = looping[j + 1]; - var loopinc = looping[j + 2]; - for (var i = looping[j]; i != endloop; i += loopinc) { - var right1 = right ^ keys[i]; - var right2 = (right >>> 4 | right << 28) ^ keys[i + 1]; - tmp = left; - left = right; - right = tmp ^ (spfunction2[right1 >>> 24 & 63] | spfunction4[right1 >>> 16 & 63] | spfunction6[right1 >>> 8 & 63] | spfunction8[right1 & 63] | spfunction1[right2 >>> 24 & 63] | spfunction3[right2 >>> 16 & 63] | spfunction5[right2 >>> 8 & 63] | spfunction7[right2 & 63]); - } - tmp = left; - left = right; - right = tmp; - } - left = left >>> 1 | left << 31; - right = right >>> 1 | right << 31; - tmp = (left >>> 1 ^ right) & 1431655765; - right ^= tmp; - left ^= tmp << 1; - tmp = (right >>> 8 ^ left) & 16711935; - left ^= tmp; - right ^= tmp << 8; - tmp = (right >>> 2 ^ left) & 858993459; - left ^= tmp; - right ^= tmp << 2; - tmp = (left >>> 16 ^ right) & 65535; - right ^= tmp; - left ^= tmp << 16; - tmp = (left >>> 4 ^ right) & 252645135; - right ^= tmp; - left ^= tmp << 4; - output[0] = left; - output[1] = right; - } - function _createCipher(options) { - options = options || {}; - var mode = (options.mode || "CBC").toUpperCase(); - var algorithm = "DES-" + mode; - var cipher; - if (options.decrypt) { - cipher = forge.cipher.createDecipher(algorithm, options.key); - } else { - cipher = forge.cipher.createCipher(algorithm, options.key); - } - var start = cipher.start; - cipher.start = function(iv, options2) { - var output = null; - if (options2 instanceof forge.util.ByteBuffer) { - output = options2; - options2 = {}; - } - options2 = options2 || {}; - options2.output = output; - options2.iv = iv; - start.call(cipher, options2); - }; - return cipher; - } - } -}); - -// node_modules/node-forge/lib/pbkdf2.js -var require_pbkdf2 = __commonJS({ - "node_modules/node-forge/lib/pbkdf2.js"(exports2, module2) { - var forge = require_forge(); - require_hmac(); - require_md(); - require_util16(); - var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; - var crypto3; - if (forge.util.isNodejs && !forge.options.usePureJavaScript) { - crypto3 = require("crypto"); - } - module2.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function(p, s, c, dkLen, md2, callback) { - if (typeof md2 === "function") { - callback = md2; - md2 = null; - } - if (forge.util.isNodejs && !forge.options.usePureJavaScript && crypto3.pbkdf2 && (md2 === null || typeof md2 !== "object") && (crypto3.pbkdf2Sync.length > 4 || (!md2 || md2 === "sha1"))) { - if (typeof md2 !== "string") { - md2 = "sha1"; - } - p = Buffer.from(p, "binary"); - s = Buffer.from(s, "binary"); - if (!callback) { - if (crypto3.pbkdf2Sync.length === 4) { - return crypto3.pbkdf2Sync(p, s, c, dkLen).toString("binary"); - } - return crypto3.pbkdf2Sync(p, s, c, dkLen, md2).toString("binary"); - } - if (crypto3.pbkdf2Sync.length === 4) { - return crypto3.pbkdf2(p, s, c, dkLen, function(err2, key) { - if (err2) { - return callback(err2); - } - callback(null, key.toString("binary")); - }); - } - return crypto3.pbkdf2(p, s, c, dkLen, md2, function(err2, key) { - if (err2) { - return callback(err2); - } - callback(null, key.toString("binary")); - }); - } - if (typeof md2 === "undefined" || md2 === null) { - md2 = "sha1"; - } - if (typeof md2 === "string") { - if (!(md2 in forge.md.algorithms)) { - throw new Error("Unknown hash algorithm: " + md2); - } - md2 = forge.md[md2].create(); - } - var hLen = md2.digestLength; - if (dkLen > 4294967295 * hLen) { - var err = new Error("Derived key is too long."); - if (callback) { - return callback(err); - } - throw err; - } - var len = Math.ceil(dkLen / hLen); - var r = dkLen - (len - 1) * hLen; - var prf = forge.hmac.create(); - prf.start(md2, p); - var dk = ""; - var xor2, u_c, u_c1; - if (!callback) { - for (var i = 1; i <= len; ++i) { - prf.start(null, null); - prf.update(s); - prf.update(forge.util.int32ToBytes(i)); - xor2 = u_c1 = prf.digest().getBytes(); - for (var j = 2; j <= c; ++j) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - xor2 = forge.util.xorBytes(xor2, u_c, hLen); - u_c1 = u_c; - } - dk += i < len ? xor2 : xor2.substr(0, r); - } - return dk; - } - var i = 1, j; - function outer() { - if (i > len) { - return callback(null, dk); - } - prf.start(null, null); - prf.update(s); - prf.update(forge.util.int32ToBytes(i)); - xor2 = u_c1 = prf.digest().getBytes(); - j = 2; - inner(); - } - function inner() { - if (j <= c) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - xor2 = forge.util.xorBytes(xor2, u_c, hLen); - u_c1 = u_c; - ++j; - return forge.util.setImmediate(inner); - } - dk += i < len ? xor2 : xor2.substr(0, r); - ++i; - outer(); - } - outer(); - }; - } -}); - -// node_modules/node-forge/lib/sha256.js -var require_sha2562 = __commonJS({ - "node_modules/node-forge/lib/sha256.js"(exports2, module2) { - var forge = require_forge(); - require_md(); - require_util16(); - var sha256 = module2.exports = forge.sha256 = forge.sha256 || {}; - forge.md.sha256 = forge.md.algorithms.sha256 = sha256; - sha256.create = function() { - if (!_initialized) { - _init(); - } - var _state = null; - var _input = forge.util.createBuffer(); - var _w = new Array(64); - var md2 = { - algorithm: "sha256", - blockLength: 64, - digestLength: 32, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - md2.start = function() { - md2.messageLength = 0; - md2.fullMessageLength = md2.messageLength64 = []; - var int32s = md2.messageLengthSize / 4; - for (var i = 0; i < int32s; ++i) { - md2.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 1779033703, - h1: 3144134277, - h2: 1013904242, - h3: 2773480762, - h4: 1359893119, - h5: 2600822924, - h6: 528734635, - h7: 1541459225 - }; - return md2; - }; - md2.start(); - md2.update = function(msg, encoding) { - if (encoding === "utf8") { - msg = forge.util.encodeUtf8(msg); - } - var len = msg.length; - md2.messageLength += len; - len = [len / 4294967296 >>> 0, len >>> 0]; - for (var i = md2.fullMessageLength.length - 1; i >= 0; --i) { - md2.fullMessageLength[i] += len[1]; - len[1] = len[0] + (md2.fullMessageLength[i] / 4294967296 >>> 0); - md2.fullMessageLength[i] = md2.fullMessageLength[i] >>> 0; - len[0] = len[1] / 4294967296 >>> 0; - } - _input.putBytes(msg); - _update(_state, _w, _input); - if (_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - return md2; - }; - md2.digest = function() { - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - var remaining = md2.fullMessageLength[md2.fullMessageLength.length - 1] + md2.messageLengthSize; - var overflow = remaining & md2.blockLength - 1; - finalBlock.putBytes(_padding.substr(0, md2.blockLength - overflow)); - var next, carry; - var bits = md2.fullMessageLength[0] * 8; - for (var i = 0; i < md2.fullMessageLength.length - 1; ++i) { - next = md2.fullMessageLength[i + 1] * 8; - carry = next / 4294967296 >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3, - h4: _state.h4, - h5: _state.h5, - h6: _state.h6, - h7: _state.h7 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32(s2.h0); - rval.putInt32(s2.h1); - rval.putInt32(s2.h2); - rval.putInt32(s2.h3); - rval.putInt32(s2.h4); - rval.putInt32(s2.h5); - rval.putInt32(s2.h6); - rval.putInt32(s2.h7); - return rval; - }; - return md2; - }; - var _padding = null; - var _initialized = false; - var _k = null; - function _init() { - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0), 64); - _k = [ - 1116352408, - 1899447441, - 3049323471, - 3921009573, - 961987163, - 1508970993, - 2453635748, - 2870763221, - 3624381080, - 310598401, - 607225278, - 1426881987, - 1925078388, - 2162078206, - 2614888103, - 3248222580, - 3835390401, - 4022224774, - 264347078, - 604807628, - 770255983, - 1249150122, - 1555081692, - 1996064986, - 2554220882, - 2821834349, - 2952996808, - 3210313671, - 3336571891, - 3584528711, - 113926993, - 338241895, - 666307205, - 773529912, - 1294757372, - 1396182291, - 1695183700, - 1986661051, - 2177026350, - 2456956037, - 2730485921, - 2820302411, - 3259730800, - 3345764771, - 3516065817, - 3600352804, - 4094571909, - 275423344, - 430227734, - 506948616, - 659060556, - 883997877, - 958139571, - 1322822218, - 1537002063, - 1747873779, - 1955562222, - 2024104815, - 2227730452, - 2361852424, - 2428436474, - 2756734187, - 3204031479, - 3329325298 - ]; - _initialized = true; - } - function _update(s, w, bytes) { - var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h; - var len = bytes.length(); - while (len >= 64) { - for (i = 0; i < 16; ++i) { - w[i] = bytes.getInt32(); - } - for (; i < 64; ++i) { - t1 = w[i - 2]; - t1 = (t1 >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10; - t2 = w[i - 15]; - t2 = (t2 >>> 7 | t2 << 25) ^ (t2 >>> 18 | t2 << 14) ^ t2 >>> 3; - w[i] = t1 + w[i - 7] + t2 + w[i - 16] | 0; - } - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - e = s.h4; - f = s.h5; - g = s.h6; - h = s.h7; - for (i = 0; i < 64; ++i) { - s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7); - ch = g ^ e & (f ^ g); - s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10); - maj = a & b | c & (a ^ b); - t1 = h + s1 + ch + _k[i] + w[i]; - t2 = s0 + maj; - h = g; - g = f; - f = e; - e = d + t1 >>> 0; - d = c; - c = b; - b = a; - a = t1 + t2 >>> 0; - } - s.h0 = s.h0 + a | 0; - s.h1 = s.h1 + b | 0; - s.h2 = s.h2 + c | 0; - s.h3 = s.h3 + d | 0; - s.h4 = s.h4 + e | 0; - s.h5 = s.h5 + f | 0; - s.h6 = s.h6 + g | 0; - s.h7 = s.h7 + h | 0; - len -= 64; - } - } - } -}); - -// node_modules/node-forge/lib/prng.js -var require_prng = __commonJS({ - "node_modules/node-forge/lib/prng.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - var _crypto = null; - if (forge.util.isNodejs && !forge.options.usePureJavaScript && !process.versions["node-webkit"]) { - _crypto = require("crypto"); - } - var prng = module2.exports = forge.prng = forge.prng || {}; - prng.create = function(plugin) { - var ctx = { - plugin, - key: null, - seed: null, - time: null, - // number of reseeds so far - reseeds: 0, - // amount of data generated so far - generated: 0, - // no initial key bytes - keyBytes: "" - }; - var md2 = plugin.md; - var pools = new Array(32); - for (var i = 0; i < 32; ++i) { - pools[i] = md2.create(); - } - ctx.pools = pools; - ctx.pool = 0; - ctx.generate = function(count, callback) { - if (!callback) { - return ctx.generateSync(count); - } - var cipher = ctx.plugin.cipher; - var increment = ctx.plugin.increment; - var formatKey = ctx.plugin.formatKey; - var formatSeed = ctx.plugin.formatSeed; - var b = forge.util.createBuffer(); - ctx.key = null; - generate(); - function generate(err) { - if (err) { - return callback(err); - } - if (b.length() >= count) { - return callback(null, b.getBytes(count)); - } - if (ctx.generated > 1048575) { - ctx.key = null; - } - if (ctx.key === null) { - return forge.util.nextTick(function() { - _reseed(generate); - }); - } - var bytes = cipher(ctx.key, ctx.seed); - ctx.generated += bytes.length; - b.putBytes(bytes); - ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); - ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); - forge.util.setImmediate(generate); - } - }; - ctx.generateSync = function(count) { - var cipher = ctx.plugin.cipher; - var increment = ctx.plugin.increment; - var formatKey = ctx.plugin.formatKey; - var formatSeed = ctx.plugin.formatSeed; - ctx.key = null; - var b = forge.util.createBuffer(); - while (b.length() < count) { - if (ctx.generated > 1048575) { - ctx.key = null; - } - if (ctx.key === null) { - _reseedSync(); - } - var bytes = cipher(ctx.key, ctx.seed); - ctx.generated += bytes.length; - b.putBytes(bytes); - ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); - ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); - } - return b.getBytes(count); - }; - function _reseed(callback) { - if (ctx.pools[0].messageLength >= 32) { - _seed(); - return callback(); - } - var needed = 32 - ctx.pools[0].messageLength << 5; - ctx.seedFile(needed, function(err, bytes) { - if (err) { - return callback(err); - } - ctx.collect(bytes); - _seed(); - callback(); - }); - } - function _reseedSync() { - if (ctx.pools[0].messageLength >= 32) { - return _seed(); - } - var needed = 32 - ctx.pools[0].messageLength << 5; - ctx.collect(ctx.seedFileSync(needed)); - _seed(); - } - function _seed() { - ctx.reseeds = ctx.reseeds === 4294967295 ? 0 : ctx.reseeds + 1; - var md3 = ctx.plugin.md.create(); - md3.update(ctx.keyBytes); - var _2powK = 1; - for (var k = 0; k < 32; ++k) { - if (ctx.reseeds % _2powK === 0) { - md3.update(ctx.pools[k].digest().getBytes()); - ctx.pools[k].start(); - } - _2powK = _2powK << 1; - } - ctx.keyBytes = md3.digest().getBytes(); - md3.start(); - md3.update(ctx.keyBytes); - var seedBytes = md3.digest().getBytes(); - ctx.key = ctx.plugin.formatKey(ctx.keyBytes); - ctx.seed = ctx.plugin.formatSeed(seedBytes); - ctx.generated = 0; - } - function defaultSeedFile(needed) { - var getRandomValues = null; - var globalScope = forge.util.globalScope; - var _crypto2 = globalScope.crypto || globalScope.msCrypto; - if (_crypto2 && _crypto2.getRandomValues) { - getRandomValues = function(arr) { - return _crypto2.getRandomValues(arr); - }; - } - var b = forge.util.createBuffer(); - if (getRandomValues) { - while (b.length() < needed) { - var count = Math.max(1, Math.min(needed - b.length(), 65536) / 4); - var entropy = new Uint32Array(Math.floor(count)); - try { - getRandomValues(entropy); - for (var i2 = 0; i2 < entropy.length; ++i2) { - b.putInt32(entropy[i2]); - } - } catch (e) { - if (!(typeof QuotaExceededError !== "undefined" && e instanceof QuotaExceededError)) { - throw e; - } - } - } - } - if (b.length() < needed) { - var hi, lo, next; - var seed = Math.floor(Math.random() * 65536); - while (b.length() < needed) { - lo = 16807 * (seed & 65535); - hi = 16807 * (seed >> 16); - lo += (hi & 32767) << 16; - lo += hi >> 15; - lo = (lo & 2147483647) + (lo >> 31); - seed = lo & 4294967295; - for (var i2 = 0; i2 < 3; ++i2) { - next = seed >>> (i2 << 3); - next ^= Math.floor(Math.random() * 256); - b.putByte(next & 255); - } - } - } - return b.getBytes(needed); - } - if (_crypto) { - ctx.seedFile = function(needed, callback) { - _crypto.randomBytes(needed, function(err, bytes) { - if (err) { - return callback(err); - } - callback(null, bytes.toString()); - }); - }; - ctx.seedFileSync = function(needed) { - return _crypto.randomBytes(needed).toString(); - }; - } else { - ctx.seedFile = function(needed, callback) { - try { - callback(null, defaultSeedFile(needed)); - } catch (e) { - callback(e); - } - }; - ctx.seedFileSync = defaultSeedFile; - } - ctx.collect = function(bytes) { - var count = bytes.length; - for (var i2 = 0; i2 < count; ++i2) { - ctx.pools[ctx.pool].update(bytes.substr(i2, 1)); - ctx.pool = ctx.pool === 31 ? 0 : ctx.pool + 1; - } - }; - ctx.collectInt = function(i2, n) { - var bytes = ""; - for (var x = 0; x < n; x += 8) { - bytes += String.fromCharCode(i2 >> x & 255); - } - ctx.collect(bytes); - }; - ctx.registerWorker = function(worker) { - if (worker === self) { - ctx.seedFile = function(needed, callback) { - function listener2(e) { - var data = e.data; - if (data.forge && data.forge.prng) { - self.removeEventListener("message", listener2); - callback(data.forge.prng.err, data.forge.prng.bytes); - } - } - self.addEventListener("message", listener2); - self.postMessage({ forge: { prng: { needed } } }); - }; - } else { - var listener = function(e) { - var data = e.data; - if (data.forge && data.forge.prng) { - ctx.seedFile(data.forge.prng.needed, function(err, bytes) { - worker.postMessage({ forge: { prng: { err, bytes } } }); - }); - } - }; - worker.addEventListener("message", listener); - } - }; - return ctx; - }; - } -}); - -// node_modules/node-forge/lib/random.js -var require_random2 = __commonJS({ - "node_modules/node-forge/lib/random.js"(exports2, module2) { - var forge = require_forge(); - require_aes(); - require_sha2562(); - require_prng(); - require_util16(); - (function() { - if (forge.random && forge.random.getBytes) { - module2.exports = forge.random; - return; - } - (function(jQuery2) { - var prng_aes = {}; - var _prng_aes_output = new Array(4); - var _prng_aes_buffer = forge.util.createBuffer(); - prng_aes.formatKey = function(key2) { - var tmp = forge.util.createBuffer(key2); - key2 = new Array(4); - key2[0] = tmp.getInt32(); - key2[1] = tmp.getInt32(); - key2[2] = tmp.getInt32(); - key2[3] = tmp.getInt32(); - return forge.aes._expandKey(key2, false); - }; - prng_aes.formatSeed = function(seed) { - var tmp = forge.util.createBuffer(seed); - seed = new Array(4); - seed[0] = tmp.getInt32(); - seed[1] = tmp.getInt32(); - seed[2] = tmp.getInt32(); - seed[3] = tmp.getInt32(); - return seed; - }; - prng_aes.cipher = function(key2, seed) { - forge.aes._updateBlock(key2, seed, _prng_aes_output, false); - _prng_aes_buffer.putInt32(_prng_aes_output[0]); - _prng_aes_buffer.putInt32(_prng_aes_output[1]); - _prng_aes_buffer.putInt32(_prng_aes_output[2]); - _prng_aes_buffer.putInt32(_prng_aes_output[3]); - return _prng_aes_buffer.getBytes(); - }; - prng_aes.increment = function(seed) { - ++seed[3]; - return seed; - }; - prng_aes.md = forge.md.sha256; - function spawnPrng() { - var ctx = forge.prng.create(prng_aes); - ctx.getBytes = function(count, callback) { - return ctx.generate(count, callback); - }; - ctx.getBytesSync = function(count) { - return ctx.generate(count); - }; - return ctx; - } - var _ctx = spawnPrng(); - var getRandomValues = null; - var globalScope = forge.util.globalScope; - var _crypto = globalScope.crypto || globalScope.msCrypto; - if (_crypto && _crypto.getRandomValues) { - getRandomValues = function(arr) { - return _crypto.getRandomValues(arr); - }; - } - if (forge.options.usePureJavaScript || !forge.util.isNodejs && !getRandomValues) { - if (typeof window === "undefined" || window.document === void 0) { - } - _ctx.collectInt(+/* @__PURE__ */ new Date(), 32); - if (typeof navigator !== "undefined") { - var _navBytes = ""; - for (var key in navigator) { - try { - if (typeof navigator[key] == "string") { - _navBytes += navigator[key]; - } - } catch (e) { - } - } - _ctx.collect(_navBytes); - _navBytes = null; - } - if (jQuery2) { - jQuery2().mousemove(function(e) { - _ctx.collectInt(e.clientX, 16); - _ctx.collectInt(e.clientY, 16); - }); - jQuery2().keypress(function(e) { - _ctx.collectInt(e.charCode, 8); - }); - } - } - if (!forge.random) { - forge.random = _ctx; - } else { - for (var key in _ctx) { - forge.random[key] = _ctx[key]; - } - } - forge.random.createInstance = spawnPrng; - module2.exports = forge.random; - })(typeof jQuery !== "undefined" ? jQuery : null); - })(); - } -}); - -// node_modules/node-forge/lib/rc2.js -var require_rc2 = __commonJS({ - "node_modules/node-forge/lib/rc2.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - var piTable = [ - 217, - 120, - 249, - 196, - 25, - 221, - 181, - 237, - 40, - 233, - 253, - 121, - 74, - 160, - 216, - 157, - 198, - 126, - 55, - 131, - 43, - 118, - 83, - 142, - 98, - 76, - 100, - 136, - 68, - 139, - 251, - 162, - 23, - 154, - 89, - 245, - 135, - 179, - 79, - 19, - 97, - 69, - 109, - 141, - 9, - 129, - 125, - 50, - 189, - 143, - 64, - 235, - 134, - 183, - 123, - 11, - 240, - 149, - 33, - 34, - 92, - 107, - 78, - 130, - 84, - 214, - 101, - 147, - 206, - 96, - 178, - 28, - 115, - 86, - 192, - 20, - 167, - 140, - 241, - 220, - 18, - 117, - 202, - 31, - 59, - 190, - 228, - 209, - 66, - 61, - 212, - 48, - 163, - 60, - 182, - 38, - 111, - 191, - 14, - 218, - 70, - 105, - 7, - 87, - 39, - 242, - 29, - 155, - 188, - 148, - 67, - 3, - 248, - 17, - 199, - 246, - 144, - 239, - 62, - 231, - 6, - 195, - 213, - 47, - 200, - 102, - 30, - 215, - 8, - 232, - 234, - 222, - 128, - 82, - 238, - 247, - 132, - 170, - 114, - 172, - 53, - 77, - 106, - 42, - 150, - 26, - 210, - 113, - 90, - 21, - 73, - 116, - 75, - 159, - 208, - 94, - 4, - 24, - 164, - 236, - 194, - 224, - 65, - 110, - 15, - 81, - 203, - 204, - 36, - 145, - 175, - 80, - 161, - 244, - 112, - 57, - 153, - 124, - 58, - 133, - 35, - 184, - 180, - 122, - 252, - 2, - 54, - 91, - 37, - 85, - 151, - 49, - 45, - 93, - 250, - 152, - 227, - 138, - 146, - 174, - 5, - 223, - 41, - 16, - 103, - 108, - 186, - 201, - 211, - 0, - 230, - 207, - 225, - 158, - 168, - 44, - 99, - 22, - 1, - 63, - 88, - 226, - 137, - 169, - 13, - 56, - 52, - 27, - 171, - 51, - 255, - 176, - 187, - 72, - 12, - 95, - 185, - 177, - 205, - 46, - 197, - 243, - 219, - 71, - 229, - 165, - 156, - 119, - 10, - 166, - 32, - 104, - 254, - 127, - 193, - 173 - ]; - var s = [1, 2, 3, 5]; - var rol = function(word, bits) { - return word << bits & 65535 | (word & 65535) >> 16 - bits; - }; - var ror = function(word, bits) { - return (word & 65535) >> bits | word << 16 - bits & 65535; - }; - module2.exports = forge.rc2 = forge.rc2 || {}; - forge.rc2.expandKey = function(key, effKeyBits) { - if (typeof key === "string") { - key = forge.util.createBuffer(key); - } - effKeyBits = effKeyBits || 128; - var L = key; - var T = key.length(); - var T1 = effKeyBits; - var T8 = Math.ceil(T1 / 8); - var TM = 255 >> (T1 & 7); - var i; - for (i = T; i < 128; i++) { - L.putByte(piTable[L.at(i - 1) + L.at(i - T) & 255]); - } - L.setAt(128 - T8, piTable[L.at(128 - T8) & TM]); - for (i = 127 - T8; i >= 0; i--) { - L.setAt(i, piTable[L.at(i + 1) ^ L.at(i + T8)]); - } - return L; - }; - var createCipher = function(key, bits, encrypt) { - var _finish = false, _input = null, _output = null, _iv = null; - var mixRound, mashRound; - var i, j, K = []; - key = forge.rc2.expandKey(key, bits); - for (i = 0; i < 64; i++) { - K.push(key.getInt16Le()); - } - if (encrypt) { - mixRound = function(R) { - for (i = 0; i < 4; i++) { - R[i] += K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + (~R[(i + 3) % 4] & R[(i + 1) % 4]); - R[i] = rol(R[i], s[i]); - j++; - } - }; - mashRound = function(R) { - for (i = 0; i < 4; i++) { - R[i] += K[R[(i + 3) % 4] & 63]; - } - }; - } else { - mixRound = function(R) { - for (i = 3; i >= 0; i--) { - R[i] = ror(R[i], s[i]); - R[i] -= K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + (~R[(i + 3) % 4] & R[(i + 1) % 4]); - j--; - } - }; - mashRound = function(R) { - for (i = 3; i >= 0; i--) { - R[i] -= K[R[(i + 3) % 4] & 63]; - } - }; - } - var runPlan = function(plan) { - var R = []; - for (i = 0; i < 4; i++) { - var val = _input.getInt16Le(); - if (_iv !== null) { - if (encrypt) { - val ^= _iv.getInt16Le(); - } else { - _iv.putInt16Le(val); - } - } - R.push(val & 65535); - } - j = encrypt ? 0 : 63; - for (var ptr = 0; ptr < plan.length; ptr++) { - for (var ctr = 0; ctr < plan[ptr][0]; ctr++) { - plan[ptr][1](R); - } - } - for (i = 0; i < 4; i++) { - if (_iv !== null) { - if (encrypt) { - _iv.putInt16Le(R[i]); - } else { - R[i] ^= _iv.getInt16Le(); - } - } - _output.putInt16Le(R[i]); - } - }; - var cipher = null; - cipher = { - /** - * Starts or restarts the encryption or decryption process, whichever - * was previously configured. - * - * To use the cipher in CBC mode, iv may be given either as a string - * of bytes, or as a byte buffer. For ECB mode, give null as iv. - * - * @param iv the initialization vector to use, null for ECB mode. - * @param output the output the buffer to write to, null to create one. - */ - start: function(iv, output) { - if (iv) { - if (typeof iv === "string") { - iv = forge.util.createBuffer(iv); - } - } - _finish = false; - _input = forge.util.createBuffer(); - _output = output || new forge.util.createBuffer(); - _iv = iv; - cipher.output = _output; - }, - /** - * Updates the next block. - * - * @param input the buffer to read from. - */ - update: function(input) { - if (!_finish) { - _input.putBuffer(input); - } - while (_input.length() >= 8) { - runPlan([ - [5, mixRound], - [1, mashRound], - [6, mixRound], - [1, mashRound], - [5, mixRound] - ]); - } - }, - /** - * Finishes encrypting or decrypting. - * - * @param pad a padding function to use, null for PKCS#7 padding, - * signature(blockSize, buffer, decrypt). - * - * @return true if successful, false on error. - */ - finish: function(pad) { - var rval = true; - if (encrypt) { - if (pad) { - rval = pad(8, _input, !encrypt); - } else { - var padding = _input.length() === 8 ? 8 : 8 - _input.length(); - _input.fillWithByte(padding, padding); - } - } - if (rval) { - _finish = true; - cipher.update(); - } - if (!encrypt) { - rval = _input.length() === 0; - if (rval) { - if (pad) { - rval = pad(8, _output, !encrypt); - } else { - var len = _output.length(); - var count = _output.at(len - 1); - if (count > len) { - rval = false; - } else { - _output.truncate(count); - } - } - } - } - return rval; - } - }; - return cipher; - }; - forge.rc2.startEncrypting = function(key, iv, output) { - var cipher = forge.rc2.createEncryptionCipher(key, 128); - cipher.start(iv, output); - return cipher; - }; - forge.rc2.createEncryptionCipher = function(key, bits) { - return createCipher(key, bits, true); - }; - forge.rc2.startDecrypting = function(key, iv, output) { - var cipher = forge.rc2.createDecryptionCipher(key, 128); - cipher.start(iv, output); - return cipher; - }; - forge.rc2.createDecryptionCipher = function(key, bits) { - return createCipher(key, bits, false); - }; - } -}); - -// node_modules/node-forge/lib/jsbn.js -var require_jsbn = __commonJS({ - "node_modules/node-forge/lib/jsbn.js"(exports2, module2) { - var forge = require_forge(); - module2.exports = forge.jsbn = forge.jsbn || {}; - var dbits; - var canary = 244837814094590; - var j_lm = (canary & 16777215) == 15715070; - function BigInteger(a, b, c) { - this.data = []; - if (a != null) - if ("number" == typeof a) this.fromNumber(a, b, c); - else if (b == null && "string" != typeof a) this.fromString(a, 256); - else this.fromString(a, b); - } - forge.jsbn.BigInteger = BigInteger; - function nbi() { - return new BigInteger(null); - } - function am1(i, x, w, j, c, n) { - while (--n >= 0) { - var v = x * this.data[i++] + w.data[j] + c; - c = Math.floor(v / 67108864); - w.data[j++] = v & 67108863; - } - return c; - } - function am2(i, x, w, j, c, n) { - var xl = x & 32767, xh = x >> 15; - while (--n >= 0) { - var l = this.data[i] & 32767; - var h = this.data[i++] >> 15; - var m = xh * l + h * xl; - l = xl * l + ((m & 32767) << 15) + w.data[j] + (c & 1073741823); - c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30); - w.data[j++] = l & 1073741823; - } - return c; - } - function am3(i, x, w, j, c, n) { - var xl = x & 16383, xh = x >> 14; - while (--n >= 0) { - var l = this.data[i] & 16383; - var h = this.data[i++] >> 14; - var m = xh * l + h * xl; - l = xl * l + ((m & 16383) << 14) + w.data[j] + c; - c = (l >> 28) + (m >> 14) + xh * h; - w.data[j++] = l & 268435455; - } - return c; - } - if (typeof navigator === "undefined") { - BigInteger.prototype.am = am3; - dbits = 28; - } else if (j_lm && navigator.appName == "Microsoft Internet Explorer") { - BigInteger.prototype.am = am2; - dbits = 30; - } else if (j_lm && navigator.appName != "Netscape") { - BigInteger.prototype.am = am1; - dbits = 26; - } else { - BigInteger.prototype.am = am3; - dbits = 28; - } - BigInteger.prototype.DB = dbits; - BigInteger.prototype.DM = (1 << dbits) - 1; - BigInteger.prototype.DV = 1 << dbits; - var BI_FP = 52; - BigInteger.prototype.FV = Math.pow(2, BI_FP); - BigInteger.prototype.F1 = BI_FP - dbits; - BigInteger.prototype.F2 = 2 * dbits - BI_FP; - var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; - var BI_RC = new Array(); - var rr; - var vv; - rr = "0".charCodeAt(0); - for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; - rr = "a".charCodeAt(0); - for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; - rr = "A".charCodeAt(0); - for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; - function int2char(n) { - return BI_RM.charAt(n); - } - function intAt(s, i) { - var c = BI_RC[s.charCodeAt(i)]; - return c == null ? -1 : c; - } - function bnpCopyTo(r) { - for (var i = this.t - 1; i >= 0; --i) r.data[i] = this.data[i]; - r.t = this.t; - r.s = this.s; - } - function bnpFromInt(x) { - this.t = 1; - this.s = x < 0 ? -1 : 0; - if (x > 0) this.data[0] = x; - else if (x < -1) this.data[0] = x + this.DV; - else this.t = 0; - } - function nbv(i) { - var r = nbi(); - r.fromInt(i); - return r; - } - function bnpFromString(s, b) { - var k; - if (b == 16) k = 4; - else if (b == 8) k = 3; - else if (b == 256) k = 8; - else if (b == 2) k = 1; - else if (b == 32) k = 5; - else if (b == 4) k = 2; - else { - this.fromRadix(s, b); - return; - } - this.t = 0; - this.s = 0; - var i = s.length, mi = false, sh = 0; - while (--i >= 0) { - var x = k == 8 ? s[i] & 255 : intAt(s, i); - if (x < 0) { - if (s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if (sh == 0) - this.data[this.t++] = x; - else if (sh + k > this.DB) { - this.data[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh; - this.data[this.t++] = x >> this.DB - sh; - } else - this.data[this.t - 1] |= x << sh; - sh += k; - if (sh >= this.DB) sh -= this.DB; - } - if (k == 8 && (s[0] & 128) != 0) { - this.s = -1; - if (sh > 0) this.data[this.t - 1] |= (1 << this.DB - sh) - 1 << sh; - } - this.clamp(); - if (mi) BigInteger.ZERO.subTo(this, this); - } - function bnpClamp() { - var c = this.s & this.DM; - while (this.t > 0 && this.data[this.t - 1] == c) --this.t; - } - function bnToString(b) { - if (this.s < 0) return "-" + this.negate().toString(b); - var k; - if (b == 16) k = 4; - else if (b == 8) k = 3; - else if (b == 2) k = 1; - else if (b == 32) k = 5; - else if (b == 4) k = 2; - else return this.toRadix(b); - var km = (1 << k) - 1, d, m = false, r = "", i = this.t; - var p = this.DB - i * this.DB % k; - if (i-- > 0) { - if (p < this.DB && (d = this.data[i] >> p) > 0) { - m = true; - r = int2char(d); - } - while (i >= 0) { - if (p < k) { - d = (this.data[i] & (1 << p) - 1) << k - p; - d |= this.data[--i] >> (p += this.DB - k); - } else { - d = this.data[i] >> (p -= k) & km; - if (p <= 0) { - p += this.DB; - --i; - } - } - if (d > 0) m = true; - if (m) r += int2char(d); - } - } - return m ? r : "0"; - } - function bnNegate() { - var r = nbi(); - BigInteger.ZERO.subTo(this, r); - return r; - } - function bnAbs() { - return this.s < 0 ? this.negate() : this; - } - function bnCompareTo(a) { - var r = this.s - a.s; - if (r != 0) return r; - var i = this.t; - r = i - a.t; - if (r != 0) return this.s < 0 ? -r : r; - while (--i >= 0) if ((r = this.data[i] - a.data[i]) != 0) return r; - return 0; - } - function nbits(x) { - var r = 1, t; - if ((t = x >>> 16) != 0) { - x = t; - r += 16; - } - if ((t = x >> 8) != 0) { - x = t; - r += 8; - } - if ((t = x >> 4) != 0) { - x = t; - r += 4; - } - if ((t = x >> 2) != 0) { - x = t; - r += 2; - } - if ((t = x >> 1) != 0) { - x = t; - r += 1; - } - return r; - } - function bnBitLength() { - if (this.t <= 0) return 0; - return this.DB * (this.t - 1) + nbits(this.data[this.t - 1] ^ this.s & this.DM); - } - function bnpDLShiftTo(n, r) { - var i; - for (i = this.t - 1; i >= 0; --i) r.data[i + n] = this.data[i]; - for (i = n - 1; i >= 0; --i) r.data[i] = 0; - r.t = this.t + n; - r.s = this.s; - } - function bnpDRShiftTo(n, r) { - for (var i = n; i < this.t; ++i) r.data[i - n] = this.data[i]; - r.t = Math.max(this.t - n, 0); - r.s = this.s; - } - function bnpLShiftTo(n, r) { - var bs = n % this.DB; - var cbs = this.DB - bs; - var bm = (1 << cbs) - 1; - var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i; - for (i = this.t - 1; i >= 0; --i) { - r.data[i + ds + 1] = this.data[i] >> cbs | c; - c = (this.data[i] & bm) << bs; - } - for (i = ds - 1; i >= 0; --i) r.data[i] = 0; - r.data[ds] = c; - r.t = this.t + ds + 1; - r.s = this.s; - r.clamp(); - } - function bnpRShiftTo(n, r) { - r.s = this.s; - var ds = Math.floor(n / this.DB); - if (ds >= this.t) { - r.t = 0; - return; - } - var bs = n % this.DB; - var cbs = this.DB - bs; - var bm = (1 << bs) - 1; - r.data[0] = this.data[ds] >> bs; - for (var i = ds + 1; i < this.t; ++i) { - r.data[i - ds - 1] |= (this.data[i] & bm) << cbs; - r.data[i - ds] = this.data[i] >> bs; - } - if (bs > 0) r.data[this.t - ds - 1] |= (this.s & bm) << cbs; - r.t = this.t - ds; - r.clamp(); - } - function bnpSubTo(a, r) { - var i = 0, c = 0, m = Math.min(a.t, this.t); - while (i < m) { - c += this.data[i] - a.data[i]; - r.data[i++] = c & this.DM; - c >>= this.DB; - } - if (a.t < this.t) { - c -= a.s; - while (i < this.t) { - c += this.data[i]; - r.data[i++] = c & this.DM; - c >>= this.DB; - } - c += this.s; - } else { - c += this.s; - while (i < a.t) { - c -= a.data[i]; - r.data[i++] = c & this.DM; - c >>= this.DB; - } - c -= a.s; - } - r.s = c < 0 ? -1 : 0; - if (c < -1) r.data[i++] = this.DV + c; - else if (c > 0) r.data[i++] = c; - r.t = i; - r.clamp(); - } - function bnpMultiplyTo(a, r) { - var x = this.abs(), y = a.abs(); - var i = x.t; - r.t = i + y.t; - while (--i >= 0) r.data[i] = 0; - for (i = 0; i < y.t; ++i) r.data[i + x.t] = x.am(0, y.data[i], r, i, 0, x.t); - r.s = 0; - r.clamp(); - if (this.s != a.s) BigInteger.ZERO.subTo(r, r); - } - function bnpSquareTo(r) { - var x = this.abs(); - var i = r.t = 2 * x.t; - while (--i >= 0) r.data[i] = 0; - for (i = 0; i < x.t - 1; ++i) { - var c = x.am(i, x.data[i], r, 2 * i, 0, 1); - if ((r.data[i + x.t] += x.am(i + 1, 2 * x.data[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) { - r.data[i + x.t] -= x.DV; - r.data[i + x.t + 1] = 1; - } - } - if (r.t > 0) r.data[r.t - 1] += x.am(i, x.data[i], r, 2 * i, 0, 1); - r.s = 0; - r.clamp(); - } - function bnpDivRemTo(m, q, r) { - var pm = m.abs(); - if (pm.t <= 0) return; - var pt = this.abs(); - if (pt.t < pm.t) { - if (q != null) q.fromInt(0); - if (r != null) this.copyTo(r); - return; - } - if (r == null) r = nbi(); - var y = nbi(), ts = this.s, ms = m.s; - var nsh = this.DB - nbits(pm.data[pm.t - 1]); - if (nsh > 0) { - pm.lShiftTo(nsh, y); - pt.lShiftTo(nsh, r); - } else { - pm.copyTo(y); - pt.copyTo(r); - } - var ys = y.t; - var y0 = y.data[ys - 1]; - if (y0 == 0) return; - var yt = y0 * (1 << this.F1) + (ys > 1 ? y.data[ys - 2] >> this.F2 : 0); - var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2; - var i = r.t, j = i - ys, t = q == null ? nbi() : q; - y.dlShiftTo(j, t); - if (r.compareTo(t) >= 0) { - r.data[r.t++] = 1; - r.subTo(t, r); - } - BigInteger.ONE.dlShiftTo(ys, t); - t.subTo(y, y); - while (y.t < ys) y.data[y.t++] = 0; - while (--j >= 0) { - var qd = r.data[--i] == y0 ? this.DM : Math.floor(r.data[i] * d1 + (r.data[i - 1] + e) * d2); - if ((r.data[i] += y.am(0, qd, r, j, 0, ys)) < qd) { - y.dlShiftTo(j, t); - r.subTo(t, r); - while (r.data[i] < --qd) r.subTo(t, r); - } - } - if (q != null) { - r.drShiftTo(ys, q); - if (ts != ms) BigInteger.ZERO.subTo(q, q); - } - r.t = ys; - r.clamp(); - if (nsh > 0) r.rShiftTo(nsh, r); - if (ts < 0) BigInteger.ZERO.subTo(r, r); - } - function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a, null, r); - if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r); - return r; - } - function Classic(m) { - this.m = m; - } - function cConvert(x) { - if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); - else return x; - } - function cRevert(x) { - return x; - } - function cReduce(x) { - x.divRemTo(this.m, null, x); - } - function cMulTo(x, y, r) { - x.multiplyTo(y, r); - this.reduce(r); - } - function cSqrTo(x, r) { - x.squareTo(r); - this.reduce(r); - } - Classic.prototype.convert = cConvert; - Classic.prototype.revert = cRevert; - Classic.prototype.reduce = cReduce; - Classic.prototype.mulTo = cMulTo; - Classic.prototype.sqrTo = cSqrTo; - function bnpInvDigit() { - if (this.t < 1) return 0; - var x = this.data[0]; - if ((x & 1) == 0) return 0; - var y = x & 3; - y = y * (2 - (x & 15) * y) & 15; - y = y * (2 - (x & 255) * y) & 255; - y = y * (2 - ((x & 65535) * y & 65535)) & 65535; - y = y * (2 - x * y % this.DV) % this.DV; - return y > 0 ? this.DV - y : -y; - } - function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp & 32767; - this.mph = this.mp >> 15; - this.um = (1 << m.DB - 15) - 1; - this.mt2 = 2 * m.t; - } - function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t, r); - r.divRemTo(this.m, null, r); - if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r); - return r; - } - function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; - } - function montReduce(x) { - while (x.t <= this.mt2) - x.data[x.t++] = 0; - for (var i = 0; i < this.m.t; ++i) { - var j = x.data[i] & 32767; - var u0 = j * this.mpl + ((j * this.mph + (x.data[i] >> 15) * this.mpl & this.um) << 15) & x.DM; - j = i + this.m.t; - x.data[j] += this.m.am(0, u0, x, i, 0, this.m.t); - while (x.data[j] >= x.DV) { - x.data[j] -= x.DV; - x.data[++j]++; - } - } - x.clamp(); - x.drShiftTo(this.m.t, x); - if (x.compareTo(this.m) >= 0) x.subTo(this.m, x); - } - function montSqrTo(x, r) { - x.squareTo(r); - this.reduce(r); - } - function montMulTo(x, y, r) { - x.multiplyTo(y, r); - this.reduce(r); - } - Montgomery.prototype.convert = montConvert; - Montgomery.prototype.revert = montRevert; - Montgomery.prototype.reduce = montReduce; - Montgomery.prototype.mulTo = montMulTo; - Montgomery.prototype.sqrTo = montSqrTo; - function bnpIsEven() { - return (this.t > 0 ? this.data[0] & 1 : this.s) == 0; - } - function bnpExp(e, z) { - if (e > 4294967295 || e < 1) return BigInteger.ONE; - var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e) - 1; - g.copyTo(r); - while (--i >= 0) { - z.sqrTo(r, r2); - if ((e & 1 << i) > 0) z.mulTo(r2, g, r); - else { - var t = r; - r = r2; - r2 = t; - } - } - return z.revert(r); - } - function bnModPowInt(e, m) { - var z; - if (e < 256 || m.isEven()) z = new Classic(m); - else z = new Montgomery(m); - return this.exp(e, z); - } - BigInteger.prototype.copyTo = bnpCopyTo; - BigInteger.prototype.fromInt = bnpFromInt; - BigInteger.prototype.fromString = bnpFromString; - BigInteger.prototype.clamp = bnpClamp; - BigInteger.prototype.dlShiftTo = bnpDLShiftTo; - BigInteger.prototype.drShiftTo = bnpDRShiftTo; - BigInteger.prototype.lShiftTo = bnpLShiftTo; - BigInteger.prototype.rShiftTo = bnpRShiftTo; - BigInteger.prototype.subTo = bnpSubTo; - BigInteger.prototype.multiplyTo = bnpMultiplyTo; - BigInteger.prototype.squareTo = bnpSquareTo; - BigInteger.prototype.divRemTo = bnpDivRemTo; - BigInteger.prototype.invDigit = bnpInvDigit; - BigInteger.prototype.isEven = bnpIsEven; - BigInteger.prototype.exp = bnpExp; - BigInteger.prototype.toString = bnToString; - BigInteger.prototype.negate = bnNegate; - BigInteger.prototype.abs = bnAbs; - BigInteger.prototype.compareTo = bnCompareTo; - BigInteger.prototype.bitLength = bnBitLength; - BigInteger.prototype.mod = bnMod; - BigInteger.prototype.modPowInt = bnModPowInt; - BigInteger.ZERO = nbv(0); - BigInteger.ONE = nbv(1); - function bnClone() { - var r = nbi(); - this.copyTo(r); - return r; - } - function bnIntValue() { - if (this.s < 0) { - if (this.t == 1) return this.data[0] - this.DV; - else if (this.t == 0) return -1; - } else if (this.t == 1) return this.data[0]; - else if (this.t == 0) return 0; - return (this.data[1] & (1 << 32 - this.DB) - 1) << this.DB | this.data[0]; - } - function bnByteValue() { - return this.t == 0 ? this.s : this.data[0] << 24 >> 24; - } - function bnShortValue() { - return this.t == 0 ? this.s : this.data[0] << 16 >> 16; - } - function bnpChunkSize(r) { - return Math.floor(Math.LN2 * this.DB / Math.log(r)); - } - function bnSigNum() { - if (this.s < 0) return -1; - else if (this.t <= 0 || this.t == 1 && this.data[0] <= 0) return 0; - else return 1; - } - function bnpToRadix(b) { - if (b == null) b = 10; - if (this.signum() == 0 || b < 2 || b > 36) return "0"; - var cs = this.chunkSize(b); - var a = Math.pow(b, cs); - var d = nbv(a), y = nbi(), z = nbi(), r = ""; - this.divRemTo(d, y, z); - while (y.signum() > 0) { - r = (a + z.intValue()).toString(b).substr(1) + r; - y.divRemTo(d, y, z); - } - return z.intValue().toString(b) + r; - } - function bnpFromRadix(s, b) { - this.fromInt(0); - if (b == null) b = 10; - var cs = this.chunkSize(b); - var d = Math.pow(b, cs), mi = false, j = 0, w = 0; - for (var i = 0; i < s.length; ++i) { - var x = intAt(s, i); - if (x < 0) { - if (s.charAt(i) == "-" && this.signum() == 0) mi = true; - continue; - } - w = b * w + x; - if (++j >= cs) { - this.dMultiply(d); - this.dAddOffset(w, 0); - j = 0; - w = 0; - } - } - if (j > 0) { - this.dMultiply(Math.pow(b, j)); - this.dAddOffset(w, 0); - } - if (mi) BigInteger.ZERO.subTo(this, this); - } - function bnpFromNumber(a, b, c) { - if ("number" == typeof b) { - if (a < 2) this.fromInt(1); - else { - this.fromNumber(a, c); - if (!this.testBit(a - 1)) - this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this); - if (this.isEven()) this.dAddOffset(1, 0); - while (!this.isProbablePrime(b)) { - this.dAddOffset(2, 0); - if (this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a - 1), this); - } - } - } else { - var x = new Array(), t = a & 7; - x.length = (a >> 3) + 1; - b.nextBytes(x); - if (t > 0) x[0] &= (1 << t) - 1; - else x[0] = 0; - this.fromString(x, 256); - } - } - function bnToByteArray() { - var i = this.t, r = new Array(); - r[0] = this.s; - var p = this.DB - i * this.DB % 8, d, k = 0; - if (i-- > 0) { - if (p < this.DB && (d = this.data[i] >> p) != (this.s & this.DM) >> p) - r[k++] = d | this.s << this.DB - p; - while (i >= 0) { - if (p < 8) { - d = (this.data[i] & (1 << p) - 1) << 8 - p; - d |= this.data[--i] >> (p += this.DB - 8); - } else { - d = this.data[i] >> (p -= 8) & 255; - if (p <= 0) { - p += this.DB; - --i; - } - } - if ((d & 128) != 0) d |= -256; - if (k == 0 && (this.s & 128) != (d & 128)) ++k; - if (k > 0 || d != this.s) r[k++] = d; - } - } - return r; - } - function bnEquals(a) { - return this.compareTo(a) == 0; - } - function bnMin(a) { - return this.compareTo(a) < 0 ? this : a; - } - function bnMax(a) { - return this.compareTo(a) > 0 ? this : a; - } - function bnpBitwiseTo(a, op, r) { - var i, f, m = Math.min(a.t, this.t); - for (i = 0; i < m; ++i) r.data[i] = op(this.data[i], a.data[i]); - if (a.t < this.t) { - f = a.s & this.DM; - for (i = m; i < this.t; ++i) r.data[i] = op(this.data[i], f); - r.t = this.t; - } else { - f = this.s & this.DM; - for (i = m; i < a.t; ++i) r.data[i] = op(f, a.data[i]); - r.t = a.t; - } - r.s = op(this.s, a.s); - r.clamp(); - } - function op_and(x, y) { - return x & y; - } - function bnAnd(a) { - var r = nbi(); - this.bitwiseTo(a, op_and, r); - return r; - } - function op_or(x, y) { - return x | y; - } - function bnOr(a) { - var r = nbi(); - this.bitwiseTo(a, op_or, r); - return r; - } - function op_xor(x, y) { - return x ^ y; - } - function bnXor(a) { - var r = nbi(); - this.bitwiseTo(a, op_xor, r); - return r; - } - function op_andnot(x, y) { - return x & ~y; - } - function bnAndNot(a) { - var r = nbi(); - this.bitwiseTo(a, op_andnot, r); - return r; - } - function bnNot() { - var r = nbi(); - for (var i = 0; i < this.t; ++i) r.data[i] = this.DM & ~this.data[i]; - r.t = this.t; - r.s = ~this.s; - return r; - } - function bnShiftLeft(n) { - var r = nbi(); - if (n < 0) this.rShiftTo(-n, r); - else this.lShiftTo(n, r); - return r; - } - function bnShiftRight(n) { - var r = nbi(); - if (n < 0) this.lShiftTo(-n, r); - else this.rShiftTo(n, r); - return r; - } - function lbit(x) { - if (x == 0) return -1; - var r = 0; - if ((x & 65535) == 0) { - x >>= 16; - r += 16; - } - if ((x & 255) == 0) { - x >>= 8; - r += 8; - } - if ((x & 15) == 0) { - x >>= 4; - r += 4; - } - if ((x & 3) == 0) { - x >>= 2; - r += 2; - } - if ((x & 1) == 0) ++r; - return r; - } - function bnGetLowestSetBit() { - for (var i = 0; i < this.t; ++i) - if (this.data[i] != 0) return i * this.DB + lbit(this.data[i]); - if (this.s < 0) return this.t * this.DB; - return -1; - } - function cbit(x) { - var r = 0; - while (x != 0) { - x &= x - 1; - ++r; - } - return r; - } - function bnBitCount() { - var r = 0, x = this.s & this.DM; - for (var i = 0; i < this.t; ++i) r += cbit(this.data[i] ^ x); - return r; - } - function bnTestBit(n) { - var j = Math.floor(n / this.DB); - if (j >= this.t) return this.s != 0; - return (this.data[j] & 1 << n % this.DB) != 0; - } - function bnpChangeBit(n, op) { - var r = BigInteger.ONE.shiftLeft(n); - this.bitwiseTo(r, op, r); - return r; - } - function bnSetBit(n) { - return this.changeBit(n, op_or); - } - function bnClearBit(n) { - return this.changeBit(n, op_andnot); - } - function bnFlipBit(n) { - return this.changeBit(n, op_xor); - } - function bnpAddTo(a, r) { - var i = 0, c = 0, m = Math.min(a.t, this.t); - while (i < m) { - c += this.data[i] + a.data[i]; - r.data[i++] = c & this.DM; - c >>= this.DB; - } - if (a.t < this.t) { - c += a.s; - while (i < this.t) { - c += this.data[i]; - r.data[i++] = c & this.DM; - c >>= this.DB; - } - c += this.s; - } else { - c += this.s; - while (i < a.t) { - c += a.data[i]; - r.data[i++] = c & this.DM; - c >>= this.DB; - } - c += a.s; - } - r.s = c < 0 ? -1 : 0; - if (c > 0) r.data[i++] = c; - else if (c < -1) r.data[i++] = this.DV + c; - r.t = i; - r.clamp(); - } - function bnAdd(a) { - var r = nbi(); - this.addTo(a, r); - return r; - } - function bnSubtract(a) { - var r = nbi(); - this.subTo(a, r); - return r; - } - function bnMultiply(a) { - var r = nbi(); - this.multiplyTo(a, r); - return r; - } - function bnSquare() { - var r = nbi(); - this.squareTo(r); - return r; - } - function bnDivide(a) { - var r = nbi(); - this.divRemTo(a, r, null); - return r; - } - function bnRemainder(a) { - var r = nbi(); - this.divRemTo(a, null, r); - return r; - } - function bnDivideAndRemainder(a) { - var q = nbi(), r = nbi(); - this.divRemTo(a, q, r); - return new Array(q, r); - } - function bnpDMultiply(n) { - this.data[this.t] = this.am(0, n - 1, this, 0, 0, this.t); - ++this.t; - this.clamp(); - } - function bnpDAddOffset(n, w) { - if (n == 0) return; - while (this.t <= w) this.data[this.t++] = 0; - this.data[w] += n; - while (this.data[w] >= this.DV) { - this.data[w] -= this.DV; - if (++w >= this.t) this.data[this.t++] = 0; - ++this.data[w]; - } - } - function NullExp() { - } - function nNop(x) { - return x; - } - function nMulTo(x, y, r) { - x.multiplyTo(y, r); - } - function nSqrTo(x, r) { - x.squareTo(r); - } - NullExp.prototype.convert = nNop; - NullExp.prototype.revert = nNop; - NullExp.prototype.mulTo = nMulTo; - NullExp.prototype.sqrTo = nSqrTo; - function bnPow(e) { - return this.exp(e, new NullExp()); - } - function bnpMultiplyLowerTo(a, n, r) { - var i = Math.min(this.t + a.t, n); - r.s = 0; - r.t = i; - while (i > 0) r.data[--i] = 0; - var j; - for (j = r.t - this.t; i < j; ++i) r.data[i + this.t] = this.am(0, a.data[i], r, i, 0, this.t); - for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a.data[i], r, i, 0, n - i); - r.clamp(); - } - function bnpMultiplyUpperTo(a, n, r) { - --n; - var i = r.t = this.t + a.t - n; - r.s = 0; - while (--i >= 0) r.data[i] = 0; - for (i = Math.max(n - this.t, 0); i < a.t; ++i) - r.data[this.t + i - n] = this.am(n - i, a.data[i], r, 0, 0, this.t + i - n); - r.clamp(); - r.drShiftTo(1, r); - } - function Barrett(m) { - this.r2 = nbi(); - this.q3 = nbi(); - BigInteger.ONE.dlShiftTo(2 * m.t, this.r2); - this.mu = this.r2.divide(m); - this.m = m; - } - function barrettConvert(x) { - if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m); - else if (x.compareTo(this.m) < 0) return x; - else { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; - } - } - function barrettRevert(x) { - return x; - } - function barrettReduce(x) { - x.drShiftTo(this.m.t - 1, this.r2); - if (x.t > this.m.t + 1) { - x.t = this.m.t + 1; - x.clamp(); - } - this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3); - this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); - while (x.compareTo(this.r2) < 0) x.dAddOffset(1, this.m.t + 1); - x.subTo(this.r2, x); - while (x.compareTo(this.m) >= 0) x.subTo(this.m, x); - } - function barrettSqrTo(x, r) { - x.squareTo(r); - this.reduce(r); - } - function barrettMulTo(x, y, r) { - x.multiplyTo(y, r); - this.reduce(r); - } - Barrett.prototype.convert = barrettConvert; - Barrett.prototype.revert = barrettRevert; - Barrett.prototype.reduce = barrettReduce; - Barrett.prototype.mulTo = barrettMulTo; - Barrett.prototype.sqrTo = barrettSqrTo; - function bnModPow(e, m) { - var i = e.bitLength(), k, r = nbv(1), z; - if (i <= 0) return r; - else if (i < 18) k = 1; - else if (i < 48) k = 3; - else if (i < 144) k = 4; - else if (i < 768) k = 5; - else k = 6; - if (i < 8) - z = new Classic(m); - else if (m.isEven()) - z = new Barrett(m); - else - z = new Montgomery(m); - var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1; - g[1] = z.convert(this); - if (k > 1) { - var g2 = nbi(); - z.sqrTo(g[1], g2); - while (n <= km) { - g[n] = nbi(); - z.mulTo(g2, g[n - 2], g[n]); - n += 2; - } - } - var j = e.t - 1, w, is1 = true, r2 = nbi(), t; - i = nbits(e.data[j]) - 1; - while (j >= 0) { - if (i >= k1) w = e.data[j] >> i - k1 & km; - else { - w = (e.data[j] & (1 << i + 1) - 1) << k1 - i; - if (j > 0) w |= e.data[j - 1] >> this.DB + i - k1; - } - n = k; - while ((w & 1) == 0) { - w >>= 1; - --n; - } - if ((i -= n) < 0) { - i += this.DB; - --j; - } - if (is1) { - g[w].copyTo(r); - is1 = false; - } else { - while (n > 1) { - z.sqrTo(r, r2); - z.sqrTo(r2, r); - n -= 2; - } - if (n > 0) z.sqrTo(r, r2); - else { - t = r; - r = r2; - r2 = t; - } - z.mulTo(r2, g[w], r); - } - while (j >= 0 && (e.data[j] & 1 << i) == 0) { - z.sqrTo(r, r2); - t = r; - r = r2; - r2 = t; - if (--i < 0) { - i = this.DB - 1; - --j; - } - } - } - return z.revert(r); - } - function bnGCD(a) { - var x = this.s < 0 ? this.negate() : this.clone(); - var y = a.s < 0 ? a.negate() : a.clone(); - if (x.compareTo(y) < 0) { - var t = x; - x = y; - y = t; - } - var i = x.getLowestSetBit(), g = y.getLowestSetBit(); - if (g < 0) return x; - if (i < g) g = i; - if (g > 0) { - x.rShiftTo(g, x); - y.rShiftTo(g, y); - } - while (x.signum() > 0) { - if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x); - if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y); - if (x.compareTo(y) >= 0) { - x.subTo(y, x); - x.rShiftTo(1, x); - } else { - y.subTo(x, y); - y.rShiftTo(1, y); - } - } - if (g > 0) y.lShiftTo(g, y); - return y; - } - function bnpModInt(n) { - if (n <= 0) return 0; - var d = this.DV % n, r = this.s < 0 ? n - 1 : 0; - if (this.t > 0) - if (d == 0) r = this.data[0] % n; - else for (var i = this.t - 1; i >= 0; --i) r = (d * r + this.data[i]) % n; - return r; - } - function bnModInverse(m) { - if (this.signum() == 0) { - return BigInteger.ZERO; - } - var ac = m.isEven(); - if (this.isEven() && ac || m.signum() == 0) return BigInteger.ZERO; - var u = m.clone(), v = this.clone(); - var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); - while (u.signum() != 0) { - while (u.isEven()) { - u.rShiftTo(1, u); - if (ac) { - if (!a.isEven() || !b.isEven()) { - a.addTo(this, a); - b.subTo(m, b); - } - a.rShiftTo(1, a); - } else if (!b.isEven()) b.subTo(m, b); - b.rShiftTo(1, b); - } - while (v.isEven()) { - v.rShiftTo(1, v); - if (ac) { - if (!c.isEven() || !d.isEven()) { - c.addTo(this, c); - d.subTo(m, d); - } - c.rShiftTo(1, c); - } else if (!d.isEven()) d.subTo(m, d); - d.rShiftTo(1, d); - } - if (u.compareTo(v) >= 0) { - u.subTo(v, u); - if (ac) a.subTo(c, a); - b.subTo(d, b); - } else { - v.subTo(u, v); - if (ac) c.subTo(a, c); - d.subTo(b, d); - } - } - if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; - if (d.compareTo(m) >= 0) return d.subtract(m); - if (d.signum() < 0) d.addTo(m, d); - else return d; - if (d.signum() < 0) return d.add(m); - else return d; - } - var lowprimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]; - var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]; - function bnIsProbablePrime(t) { - var i, x = this.abs(); - if (x.t == 1 && x.data[0] <= lowprimes[lowprimes.length - 1]) { - for (i = 0; i < lowprimes.length; ++i) - if (x.data[0] == lowprimes[i]) return true; - return false; - } - if (x.isEven()) return false; - i = 1; - while (i < lowprimes.length) { - var m = lowprimes[i], j = i + 1; - while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]; - m = x.modInt(m); - while (i < j) if (m % lowprimes[i++] == 0) return false; - } - return x.millerRabin(t); - } - function bnpMillerRabin(t) { - var n1 = this.subtract(BigInteger.ONE); - var k = n1.getLowestSetBit(); - if (k <= 0) return false; - var r = n1.shiftRight(k); - var prng = bnGetPrng(); - var a; - for (var i = 0; i < t; ++i) { - do { - a = new BigInteger(this.bitLength(), prng); - } while (a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0); - var y = a.modPow(r, this); - if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { - var j = 1; - while (j++ < k && y.compareTo(n1) != 0) { - y = y.modPowInt(2, this); - if (y.compareTo(BigInteger.ONE) == 0) return false; - } - if (y.compareTo(n1) != 0) return false; - } - } - return true; - } - function bnGetPrng() { - return { - // x is an array to fill with bytes - nextBytes: function(x) { - for (var i = 0; i < x.length; ++i) { - x[i] = Math.floor(Math.random() * 256); - } - } - }; - } - BigInteger.prototype.chunkSize = bnpChunkSize; - BigInteger.prototype.toRadix = bnpToRadix; - BigInteger.prototype.fromRadix = bnpFromRadix; - BigInteger.prototype.fromNumber = bnpFromNumber; - BigInteger.prototype.bitwiseTo = bnpBitwiseTo; - BigInteger.prototype.changeBit = bnpChangeBit; - BigInteger.prototype.addTo = bnpAddTo; - BigInteger.prototype.dMultiply = bnpDMultiply; - BigInteger.prototype.dAddOffset = bnpDAddOffset; - BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; - BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; - BigInteger.prototype.modInt = bnpModInt; - BigInteger.prototype.millerRabin = bnpMillerRabin; - BigInteger.prototype.clone = bnClone; - BigInteger.prototype.intValue = bnIntValue; - BigInteger.prototype.byteValue = bnByteValue; - BigInteger.prototype.shortValue = bnShortValue; - BigInteger.prototype.signum = bnSigNum; - BigInteger.prototype.toByteArray = bnToByteArray; - BigInteger.prototype.equals = bnEquals; - BigInteger.prototype.min = bnMin; - BigInteger.prototype.max = bnMax; - BigInteger.prototype.and = bnAnd; - BigInteger.prototype.or = bnOr; - BigInteger.prototype.xor = bnXor; - BigInteger.prototype.andNot = bnAndNot; - BigInteger.prototype.not = bnNot; - BigInteger.prototype.shiftLeft = bnShiftLeft; - BigInteger.prototype.shiftRight = bnShiftRight; - BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; - BigInteger.prototype.bitCount = bnBitCount; - BigInteger.prototype.testBit = bnTestBit; - BigInteger.prototype.setBit = bnSetBit; - BigInteger.prototype.clearBit = bnClearBit; - BigInteger.prototype.flipBit = bnFlipBit; - BigInteger.prototype.add = bnAdd; - BigInteger.prototype.subtract = bnSubtract; - BigInteger.prototype.multiply = bnMultiply; - BigInteger.prototype.divide = bnDivide; - BigInteger.prototype.remainder = bnRemainder; - BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; - BigInteger.prototype.modPow = bnModPow; - BigInteger.prototype.modInverse = bnModInverse; - BigInteger.prototype.pow = bnPow; - BigInteger.prototype.gcd = bnGCD; - BigInteger.prototype.isProbablePrime = bnIsProbablePrime; - BigInteger.prototype.square = bnSquare; - } -}); - -// node_modules/node-forge/lib/sha1.js -var require_sha1 = __commonJS({ - "node_modules/node-forge/lib/sha1.js"(exports2, module2) { - var forge = require_forge(); - require_md(); - require_util16(); - var sha1 = module2.exports = forge.sha1 = forge.sha1 || {}; - forge.md.sha1 = forge.md.algorithms.sha1 = sha1; - sha1.create = function() { - if (!_initialized) { - _init(); - } - var _state = null; - var _input = forge.util.createBuffer(); - var _w = new Array(80); - var md2 = { - algorithm: "sha1", - blockLength: 64, - digestLength: 20, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - md2.start = function() { - md2.messageLength = 0; - md2.fullMessageLength = md2.messageLength64 = []; - var int32s = md2.messageLengthSize / 4; - for (var i = 0; i < int32s; ++i) { - md2.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 1732584193, - h1: 4023233417, - h2: 2562383102, - h3: 271733878, - h4: 3285377520 - }; - return md2; - }; - md2.start(); - md2.update = function(msg, encoding) { - if (encoding === "utf8") { - msg = forge.util.encodeUtf8(msg); - } - var len = msg.length; - md2.messageLength += len; - len = [len / 4294967296 >>> 0, len >>> 0]; - for (var i = md2.fullMessageLength.length - 1; i >= 0; --i) { - md2.fullMessageLength[i] += len[1]; - len[1] = len[0] + (md2.fullMessageLength[i] / 4294967296 >>> 0); - md2.fullMessageLength[i] = md2.fullMessageLength[i] >>> 0; - len[0] = len[1] / 4294967296 >>> 0; - } - _input.putBytes(msg); - _update(_state, _w, _input); - if (_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - return md2; - }; - md2.digest = function() { - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - var remaining = md2.fullMessageLength[md2.fullMessageLength.length - 1] + md2.messageLengthSize; - var overflow = remaining & md2.blockLength - 1; - finalBlock.putBytes(_padding.substr(0, md2.blockLength - overflow)); - var next, carry; - var bits = md2.fullMessageLength[0] * 8; - for (var i = 0; i < md2.fullMessageLength.length - 1; ++i) { - next = md2.fullMessageLength[i + 1] * 8; - carry = next / 4294967296 >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3, - h4: _state.h4 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32(s2.h0); - rval.putInt32(s2.h1); - rval.putInt32(s2.h2); - rval.putInt32(s2.h3); - rval.putInt32(s2.h4); - return rval; - }; - return md2; - }; - var _padding = null; - var _initialized = false; - function _init() { - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0), 64); - _initialized = true; - } - function _update(s, w, bytes) { - var t, a, b, c, d, e, f, i; - var len = bytes.length(); - while (len >= 64) { - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - e = s.h4; - for (i = 0; i < 16; ++i) { - t = bytes.getInt32(); - w[i] = t; - f = d ^ b & (c ^ d); - t = (a << 5 | a >>> 27) + f + e + 1518500249 + t; - e = d; - d = c; - c = (b << 30 | b >>> 2) >>> 0; - b = a; - a = t; - } - for (; i < 20; ++i) { - t = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]; - t = t << 1 | t >>> 31; - w[i] = t; - f = d ^ b & (c ^ d); - t = (a << 5 | a >>> 27) + f + e + 1518500249 + t; - e = d; - d = c; - c = (b << 30 | b >>> 2) >>> 0; - b = a; - a = t; - } - for (; i < 32; ++i) { - t = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]; - t = t << 1 | t >>> 31; - w[i] = t; - f = b ^ c ^ d; - t = (a << 5 | a >>> 27) + f + e + 1859775393 + t; - e = d; - d = c; - c = (b << 30 | b >>> 2) >>> 0; - b = a; - a = t; - } - for (; i < 40; ++i) { - t = w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]; - t = t << 2 | t >>> 30; - w[i] = t; - f = b ^ c ^ d; - t = (a << 5 | a >>> 27) + f + e + 1859775393 + t; - e = d; - d = c; - c = (b << 30 | b >>> 2) >>> 0; - b = a; - a = t; - } - for (; i < 60; ++i) { - t = w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]; - t = t << 2 | t >>> 30; - w[i] = t; - f = b & c | d & (b ^ c); - t = (a << 5 | a >>> 27) + f + e + 2400959708 + t; - e = d; - d = c; - c = (b << 30 | b >>> 2) >>> 0; - b = a; - a = t; - } - for (; i < 80; ++i) { - t = w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]; - t = t << 2 | t >>> 30; - w[i] = t; - f = b ^ c ^ d; - t = (a << 5 | a >>> 27) + f + e + 3395469782 + t; - e = d; - d = c; - c = (b << 30 | b >>> 2) >>> 0; - b = a; - a = t; - } - s.h0 = s.h0 + a | 0; - s.h1 = s.h1 + b | 0; - s.h2 = s.h2 + c | 0; - s.h3 = s.h3 + d | 0; - s.h4 = s.h4 + e | 0; - len -= 64; - } - } - } -}); - -// node_modules/node-forge/lib/pkcs1.js -var require_pkcs1 = __commonJS({ - "node_modules/node-forge/lib/pkcs1.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - require_random2(); - require_sha1(); - var pkcs1 = module2.exports = forge.pkcs1 = forge.pkcs1 || {}; - pkcs1.encode_rsa_oaep = function(key, message, options) { - var label; - var seed; - var md2; - var mgf1Md; - if (typeof options === "string") { - label = options; - seed = arguments[3] || void 0; - md2 = arguments[4] || void 0; - } else if (options) { - label = options.label || void 0; - seed = options.seed || void 0; - md2 = options.md || void 0; - if (options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; - } - } - if (!md2) { - md2 = forge.md.sha1.create(); - } else { - md2.start(); - } - if (!mgf1Md) { - mgf1Md = md2; - } - var keyLength = Math.ceil(key.n.bitLength() / 8); - var maxLength = keyLength - 2 * md2.digestLength - 2; - if (message.length > maxLength) { - var error3 = new Error("RSAES-OAEP input message length is too long."); - error3.length = message.length; - error3.maxLength = maxLength; - throw error3; - } - if (!label) { - label = ""; - } - md2.update(label, "raw"); - var lHash = md2.digest(); - var PS = ""; - var PS_length = maxLength - message.length; - for (var i = 0; i < PS_length; i++) { - PS += "\0"; - } - var DB = lHash.getBytes() + PS + "" + message; - if (!seed) { - seed = forge.random.getBytes(md2.digestLength); - } else if (seed.length !== md2.digestLength) { - var error3 = new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."); - error3.seedLength = seed.length; - error3.digestLength = md2.digestLength; - throw error3; - } - var dbMask = rsa_mgf1(seed, keyLength - md2.digestLength - 1, mgf1Md); - var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); - var seedMask = rsa_mgf1(maskedDB, md2.digestLength, mgf1Md); - var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length); - return "\0" + maskedSeed + maskedDB; - }; - pkcs1.decode_rsa_oaep = function(key, em, options) { - var label; - var md2; - var mgf1Md; - if (typeof options === "string") { - label = options; - md2 = arguments[3] || void 0; - } else if (options) { - label = options.label || void 0; - md2 = options.md || void 0; - if (options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; - } - } - var keyLength = Math.ceil(key.n.bitLength() / 8); - if (em.length !== keyLength) { - var error3 = new Error("RSAES-OAEP encoded message length is invalid."); - error3.length = em.length; - error3.expectedLength = keyLength; - throw error3; - } - if (md2 === void 0) { - md2 = forge.md.sha1.create(); - } else { - md2.start(); - } - if (!mgf1Md) { - mgf1Md = md2; - } - if (keyLength < 2 * md2.digestLength + 2) { - throw new Error("RSAES-OAEP key is too short for the hash function."); - } - if (!label) { - label = ""; - } - md2.update(label, "raw"); - var lHash = md2.digest().getBytes(); - var y = em.charAt(0); - var maskedSeed = em.substring(1, md2.digestLength + 1); - var maskedDB = em.substring(1 + md2.digestLength); - var seedMask = rsa_mgf1(maskedDB, md2.digestLength, mgf1Md); - var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); - var dbMask = rsa_mgf1(seed, keyLength - md2.digestLength - 1, mgf1Md); - var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); - var lHashPrime = db.substring(0, md2.digestLength); - var error3 = y !== "\0"; - for (var i = 0; i < md2.digestLength; ++i) { - error3 |= lHash.charAt(i) !== lHashPrime.charAt(i); - } - var in_ps = 1; - var index2 = md2.digestLength; - for (var j = md2.digestLength; j < db.length; j++) { - var code = db.charCodeAt(j); - var is_0 = code & 1 ^ 1; - var error_mask = in_ps ? 65534 : 0; - error3 |= code & error_mask; - in_ps = in_ps & is_0; - index2 += in_ps; - } - if (error3 || db.charCodeAt(index2) !== 1) { - throw new Error("Invalid RSAES-OAEP padding."); - } - return db.substring(index2 + 1); - }; - function rsa_mgf1(seed, maskLength, hash2) { - if (!hash2) { - hash2 = forge.md.sha1.create(); - } - var t = ""; - var count = Math.ceil(maskLength / hash2.digestLength); - for (var i = 0; i < count; ++i) { - var c = String.fromCharCode( - i >> 24 & 255, - i >> 16 & 255, - i >> 8 & 255, - i & 255 - ); - hash2.start(); - hash2.update(seed + c); - t += hash2.digest().getBytes(); - } - return t.substring(0, maskLength); - } - } -}); - -// node_modules/node-forge/lib/prime.js -var require_prime = __commonJS({ - "node_modules/node-forge/lib/prime.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - require_jsbn(); - require_random2(); - (function() { - if (forge.prime) { - module2.exports = forge.prime; - return; - } - var prime = module2.exports = forge.prime = forge.prime || {}; - var BigInteger = forge.jsbn.BigInteger; - var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; - var THIRTY = new BigInteger(null); - THIRTY.fromInt(30); - var op_or = function(x, y) { - return x | y; - }; - prime.generateProbablePrime = function(bits, options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; - } - options = options || {}; - var algorithm = options.algorithm || "PRIMEINC"; - if (typeof algorithm === "string") { - algorithm = { name: algorithm }; - } - algorithm.options = algorithm.options || {}; - var prng = options.prng || forge.random; - var rng2 = { - // x is an array to fill with bytes - nextBytes: function(x) { - var b = prng.getBytesSync(x.length); - for (var i = 0; i < x.length; ++i) { - x[i] = b.charCodeAt(i); - } - } - }; - if (algorithm.name === "PRIMEINC") { - return primeincFindPrime(bits, rng2, algorithm.options, callback); - } - throw new Error("Invalid prime generation algorithm: " + algorithm.name); - }; - function primeincFindPrime(bits, rng2, options, callback) { - if ("workers" in options) { - return primeincFindPrimeWithWorkers(bits, rng2, options, callback); - } - return primeincFindPrimeWithoutWorkers(bits, rng2, options, callback); - } - function primeincFindPrimeWithoutWorkers(bits, rng2, options, callback) { - var num = generateRandom(bits, rng2); - var deltaIdx = 0; - var mrTests = getMillerRabinTests(num.bitLength()); - if ("millerRabinTests" in options) { - mrTests = options.millerRabinTests; - } - var maxBlockTime = 10; - if ("maxBlockTime" in options) { - maxBlockTime = options.maxBlockTime; - } - _primeinc(num, bits, rng2, deltaIdx, mrTests, maxBlockTime, callback); - } - function _primeinc(num, bits, rng2, deltaIdx, mrTests, maxBlockTime, callback) { - var start = +/* @__PURE__ */ new Date(); - do { - if (num.bitLength() > bits) { - num = generateRandom(bits, rng2); - } - if (num.isProbablePrime(mrTests)) { - return callback(null, num); - } - num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } while (maxBlockTime < 0 || +/* @__PURE__ */ new Date() - start < maxBlockTime); - forge.util.setImmediate(function() { - _primeinc(num, bits, rng2, deltaIdx, mrTests, maxBlockTime, callback); - }); - } - function primeincFindPrimeWithWorkers(bits, rng2, options, callback) { - if (typeof Worker === "undefined") { - return primeincFindPrimeWithoutWorkers(bits, rng2, options, callback); - } - var num = generateRandom(bits, rng2); - var numWorkers = options.workers; - var workLoad = options.workLoad || 100; - var range2 = workLoad * 30 / 8; - var workerScript = options.workerScript || "forge/prime.worker.js"; - if (numWorkers === -1) { - return forge.util.estimateCores(function(err, cores) { - if (err) { - cores = 2; - } - numWorkers = cores - 1; - generate(); - }); - } - generate(); - function generate() { - numWorkers = Math.max(1, numWorkers); - var workers = []; - for (var i = 0; i < numWorkers; ++i) { - workers[i] = new Worker(workerScript); - } - var running = numWorkers; - for (var i = 0; i < numWorkers; ++i) { - workers[i].addEventListener("message", workerMessage); - } - var found = false; - function workerMessage(e) { - if (found) { - return; - } - --running; - var data = e.data; - if (data.found) { - for (var i2 = 0; i2 < workers.length; ++i2) { - workers[i2].terminate(); - } - found = true; - return callback(null, new BigInteger(data.prime, 16)); - } - if (num.bitLength() > bits) { - num = generateRandom(bits, rng2); - } - var hex = num.toString(16); - e.target.postMessage({ - hex, - workLoad - }); - num.dAddOffset(range2, 0); - } - } - } - function generateRandom(bits, rng2) { - var num = new BigInteger(bits, rng2); - var bits1 = bits - 1; - if (!num.testBit(bits1)) { - num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num); - } - num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0); - return num; - } - function getMillerRabinTests(bits) { - if (bits <= 100) return 27; - if (bits <= 150) return 18; - if (bits <= 200) return 15; - if (bits <= 250) return 12; - if (bits <= 300) return 9; - if (bits <= 350) return 8; - if (bits <= 400) return 7; - if (bits <= 500) return 6; - if (bits <= 600) return 5; - if (bits <= 800) return 4; - if (bits <= 1250) return 3; - return 2; - } - })(); - } -}); - -// node_modules/node-forge/lib/rsa.js -var require_rsa = __commonJS({ - "node_modules/node-forge/lib/rsa.js"(exports2, module2) { - var forge = require_forge(); - require_asn1(); - require_jsbn(); - require_oids(); - require_pkcs1(); - require_prime(); - require_random2(); - require_util16(); - if (typeof BigInteger === "undefined") { - BigInteger = forge.jsbn.BigInteger; - } - var BigInteger; - var _crypto = forge.util.isNodejs ? require("crypto") : null; - var asn1 = forge.asn1; - var util3 = forge.util; - forge.pki = forge.pki || {}; - module2.exports = forge.pki.rsa = forge.rsa = forge.rsa || {}; - var pki2 = forge.pki; - var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; - var privateKeyValidator = { - // PrivateKeyInfo - name: "PrivateKeyInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: "PrivateKeyInfo.version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyVersion" - }, { - // privateKeyAlgorithm - name: "PrivateKeyInfo.privateKeyAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "AlgorithmIdentifier.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "privateKeyOid" - }] - }, { - // PrivateKey - name: "PrivateKeyInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "privateKey" - }] - }; - var rsaPrivateKeyValidator = { - // RSAPrivateKey - name: "RSAPrivateKey", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: "RSAPrivateKey.version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyVersion" - }, { - // modulus (n) - name: "RSAPrivateKey.modulus", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyModulus" - }, { - // publicExponent (e) - name: "RSAPrivateKey.publicExponent", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyPublicExponent" - }, { - // privateExponent (d) - name: "RSAPrivateKey.privateExponent", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyPrivateExponent" - }, { - // prime1 (p) - name: "RSAPrivateKey.prime1", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyPrime1" - }, { - // prime2 (q) - name: "RSAPrivateKey.prime2", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyPrime2" - }, { - // exponent1 (d mod (p-1)) - name: "RSAPrivateKey.exponent1", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyExponent1" - }, { - // exponent2 (d mod (q-1)) - name: "RSAPrivateKey.exponent2", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyExponent2" - }, { - // coefficient ((inverse of q) mod p) - name: "RSAPrivateKey.coefficient", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyCoefficient" - }] - }; - var rsaPublicKeyValidator = { - // RSAPublicKey - name: "RSAPublicKey", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // modulus (n) - name: "RSAPublicKey.modulus", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "publicKeyModulus" - }, { - // publicExponent (e) - name: "RSAPublicKey.exponent", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "publicKeyExponent" - }] - }; - var publicKeyValidator = forge.pki.rsa.publicKeyValidator = { - name: "SubjectPublicKeyInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "subjectPublicKeyInfo", - value: [{ - name: "SubjectPublicKeyInfo.AlgorithmIdentifier", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "AlgorithmIdentifier.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "publicKeyOid" - }] - }, { - // subjectPublicKey - name: "SubjectPublicKeyInfo.subjectPublicKey", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: "SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: "rsaPublicKey" - }] - }] - }; - var digestInfoValidator = { - name: "DigestInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "DigestInfo.DigestAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "DigestInfo.DigestAlgorithm.algorithmIdentifier", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "algorithmIdentifier" - }, { - // NULL parameters - name: "DigestInfo.DigestAlgorithm.parameters", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.NULL, - // captured only to check existence for md2 and md5 - capture: "parameters", - optional: true, - constructed: false - }] - }, { - // digest - name: "DigestInfo.digest", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "digest" - }] - }; - var emsaPkcs1v15encode = function(md2) { - var oid; - if (md2.algorithm in pki2.oids) { - oid = pki2.oids[md2.algorithm]; - } else { - var error3 = new Error("Unknown message digest algorithm."); - error3.algorithm = md2.algorithm; - throw error3; - } - var oidBytes = asn1.oidToDer(oid).getBytes(); - var digestInfo = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [] - ); - var digestAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [] - ); - digestAlgorithm.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - oidBytes - )); - digestAlgorithm.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.NULL, - false, - "" - )); - var digest = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - md2.digest().getBytes() - ); - digestInfo.value.push(digestAlgorithm); - digestInfo.value.push(digest); - return asn1.toDer(digestInfo).getBytes(); - }; - var _modPow = function(x, key, pub) { - if (pub) { - return x.modPow(key.e, key.n); - } - if (!key.p || !key.q) { - return x.modPow(key.d, key.n); - } - if (!key.dP) { - key.dP = key.d.mod(key.p.subtract(BigInteger.ONE)); - } - if (!key.dQ) { - key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE)); - } - if (!key.qInv) { - key.qInv = key.q.modInverse(key.p); - } - var r; - do { - r = new BigInteger( - forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)), - 16 - ); - } while (r.compareTo(key.n) >= 0 || !r.gcd(key.n).equals(BigInteger.ONE)); - x = x.multiply(r.modPow(key.e, key.n)).mod(key.n); - var xp = x.mod(key.p).modPow(key.dP, key.p); - var xq = x.mod(key.q).modPow(key.dQ, key.q); - while (xp.compareTo(xq) < 0) { - xp = xp.add(key.p); - } - var y = xp.subtract(xq).multiply(key.qInv).mod(key.p).multiply(key.q).add(xq); - y = y.multiply(r.modInverse(key.n)).mod(key.n); - return y; - }; - pki2.rsa.encrypt = function(m, key, bt) { - var pub = bt; - var eb; - var k = Math.ceil(key.n.bitLength() / 8); - if (bt !== false && bt !== true) { - pub = bt === 2; - eb = _encodePkcs1_v1_5(m, key, bt); - } else { - eb = forge.util.createBuffer(); - eb.putBytes(m); - } - var x = new BigInteger(eb.toHex(), 16); - var y = _modPow(x, key, pub); - var yhex = y.toString(16); - var ed = forge.util.createBuffer(); - var zeros = k - Math.ceil(yhex.length / 2); - while (zeros > 0) { - ed.putByte(0); - --zeros; - } - ed.putBytes(forge.util.hexToBytes(yhex)); - return ed.getBytes(); - }; - pki2.rsa.decrypt = function(ed, key, pub, ml) { - var k = Math.ceil(key.n.bitLength() / 8); - if (ed.length !== k) { - var error3 = new Error("Encrypted message length is invalid."); - error3.length = ed.length; - error3.expected = k; - throw error3; - } - var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); - if (y.compareTo(key.n) >= 0) { - throw new Error("Encrypted message is invalid."); - } - var x = _modPow(y, key, pub); - var xhex = x.toString(16); - var eb = forge.util.createBuffer(); - var zeros = k - Math.ceil(xhex.length / 2); - while (zeros > 0) { - eb.putByte(0); - --zeros; - } - eb.putBytes(forge.util.hexToBytes(xhex)); - if (ml !== false) { - return _decodePkcs1_v1_5(eb.getBytes(), key, pub); - } - return eb.getBytes(); - }; - pki2.rsa.createKeyPairGenerationState = function(bits, e, options) { - if (typeof bits === "string") { - bits = parseInt(bits, 10); - } - bits = bits || 2048; - options = options || {}; - var prng = options.prng || forge.random; - var rng2 = { - // x is an array to fill with bytes - nextBytes: function(x) { - var b = prng.getBytesSync(x.length); - for (var i = 0; i < x.length; ++i) { - x[i] = b.charCodeAt(i); - } - } - }; - var algorithm = options.algorithm || "PRIMEINC"; - var rval; - if (algorithm === "PRIMEINC") { - rval = { - algorithm, - state: 0, - bits, - rng: rng2, - eInt: e || 65537, - e: new BigInteger(null), - p: null, - q: null, - qBits: bits >> 1, - pBits: bits - (bits >> 1), - pqState: 0, - num: null, - keys: null - }; - rval.e.fromInt(rval.eInt); - } else { - throw new Error("Invalid key generation algorithm: " + algorithm); - } - return rval; - }; - pki2.rsa.stepKeyPairGenerationState = function(state, n) { - if (!("algorithm" in state)) { - state.algorithm = "PRIMEINC"; - } - var THIRTY = new BigInteger(null); - THIRTY.fromInt(30); - var deltaIdx = 0; - var op_or = function(x, y) { - return x | y; - }; - var t1 = +/* @__PURE__ */ new Date(); - var t2; - var total = 0; - while (state.keys === null && (n <= 0 || total < n)) { - if (state.state === 0) { - var bits = state.p === null ? state.pBits : state.qBits; - var bits1 = bits - 1; - if (state.pqState === 0) { - state.num = new BigInteger(bits, state.rng); - if (!state.num.testBit(bits1)) { - state.num.bitwiseTo( - BigInteger.ONE.shiftLeft(bits1), - op_or, - state.num - ); - } - state.num.dAddOffset(31 - state.num.mod(THIRTY).byteValue(), 0); - deltaIdx = 0; - ++state.pqState; - } else if (state.pqState === 1) { - if (state.num.bitLength() > bits) { - state.pqState = 0; - } else if (state.num.isProbablePrime( - _getMillerRabinTests(state.num.bitLength()) - )) { - ++state.pqState; - } else { - state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } - } else if (state.pqState === 2) { - state.pqState = state.num.subtract(BigInteger.ONE).gcd(state.e).compareTo(BigInteger.ONE) === 0 ? 3 : 0; - } else if (state.pqState === 3) { - state.pqState = 0; - if (state.p === null) { - state.p = state.num; - } else { - state.q = state.num; - } - if (state.p !== null && state.q !== null) { - ++state.state; - } - state.num = null; - } - } else if (state.state === 1) { - if (state.p.compareTo(state.q) < 0) { - state.num = state.p; - state.p = state.q; - state.q = state.num; - } - ++state.state; - } else if (state.state === 2) { - state.p1 = state.p.subtract(BigInteger.ONE); - state.q1 = state.q.subtract(BigInteger.ONE); - state.phi = state.p1.multiply(state.q1); - ++state.state; - } else if (state.state === 3) { - if (state.phi.gcd(state.e).compareTo(BigInteger.ONE) === 0) { - ++state.state; - } else { - state.p = null; - state.q = null; - state.state = 0; - } - } else if (state.state === 4) { - state.n = state.p.multiply(state.q); - if (state.n.bitLength() === state.bits) { - ++state.state; - } else { - state.q = null; - state.state = 0; - } - } else if (state.state === 5) { - var d = state.e.modInverse(state.phi); - state.keys = { - privateKey: pki2.rsa.setPrivateKey( - state.n, - state.e, - d, - state.p, - state.q, - d.mod(state.p1), - d.mod(state.q1), - state.q.modInverse(state.p) - ), - publicKey: pki2.rsa.setPublicKey(state.n, state.e) - }; - } - t2 = +/* @__PURE__ */ new Date(); - total += t2 - t1; - t1 = t2; - } - return state.keys !== null; - }; - pki2.rsa.generateKeyPair = function(bits, e, options, callback) { - if (arguments.length === 1) { - if (typeof bits === "object") { - options = bits; - bits = void 0; - } else if (typeof bits === "function") { - callback = bits; - bits = void 0; - } - } else if (arguments.length === 2) { - if (typeof bits === "number") { - if (typeof e === "function") { - callback = e; - e = void 0; - } else if (typeof e !== "number") { - options = e; - e = void 0; - } - } else { - options = bits; - callback = e; - bits = void 0; - e = void 0; - } - } else if (arguments.length === 3) { - if (typeof e === "number") { - if (typeof options === "function") { - callback = options; - options = void 0; - } - } else { - callback = options; - options = e; - e = void 0; - } - } - options = options || {}; - if (bits === void 0) { - bits = options.bits || 2048; - } - if (e === void 0) { - e = options.e || 65537; - } - if (!forge.options.usePureJavaScript && !options.prng && bits >= 256 && bits <= 16384 && (e === 65537 || e === 3)) { - if (callback) { - if (_detectNodeCrypto("generateKeyPair")) { - return _crypto.generateKeyPair("rsa", { - modulusLength: bits, - publicExponent: e, - publicKeyEncoding: { - type: "spki", - format: "pem" - }, - privateKeyEncoding: { - type: "pkcs8", - format: "pem" - } - }, function(err, pub, priv) { - if (err) { - return callback(err); - } - callback(null, { - privateKey: pki2.privateKeyFromPem(priv), - publicKey: pki2.publicKeyFromPem(pub) - }); - }); - } - if (_detectSubtleCrypto("generateKey") && _detectSubtleCrypto("exportKey")) { - return util3.globalScope.crypto.subtle.generateKey({ - name: "RSASSA-PKCS1-v1_5", - modulusLength: bits, - publicExponent: _intToUint8Array(e), - hash: { name: "SHA-256" } - }, true, ["sign", "verify"]).then(function(pair) { - return util3.globalScope.crypto.subtle.exportKey( - "pkcs8", - pair.privateKey - ); - }).then(void 0, function(err) { - callback(err); - }).then(function(pkcs8) { - if (pkcs8) { - var privateKey = pki2.privateKeyFromAsn1( - asn1.fromDer(forge.util.createBuffer(pkcs8)) - ); - callback(null, { - privateKey, - publicKey: pki2.setRsaPublicKey(privateKey.n, privateKey.e) - }); - } - }); - } - if (_detectSubtleMsCrypto("generateKey") && _detectSubtleMsCrypto("exportKey")) { - var genOp = util3.globalScope.msCrypto.subtle.generateKey({ - name: "RSASSA-PKCS1-v1_5", - modulusLength: bits, - publicExponent: _intToUint8Array(e), - hash: { name: "SHA-256" } - }, true, ["sign", "verify"]); - genOp.oncomplete = function(e2) { - var pair = e2.target.result; - var exportOp = util3.globalScope.msCrypto.subtle.exportKey( - "pkcs8", - pair.privateKey - ); - exportOp.oncomplete = function(e3) { - var pkcs8 = e3.target.result; - var privateKey = pki2.privateKeyFromAsn1( - asn1.fromDer(forge.util.createBuffer(pkcs8)) - ); - callback(null, { - privateKey, - publicKey: pki2.setRsaPublicKey(privateKey.n, privateKey.e) - }); - }; - exportOp.onerror = function(err) { - callback(err); - }; - }; - genOp.onerror = function(err) { - callback(err); - }; - return; - } - } else { - if (_detectNodeCrypto("generateKeyPairSync")) { - var keypair = _crypto.generateKeyPairSync("rsa", { - modulusLength: bits, - publicExponent: e, - publicKeyEncoding: { - type: "spki", - format: "pem" - }, - privateKeyEncoding: { - type: "pkcs8", - format: "pem" - } - }); - return { - privateKey: pki2.privateKeyFromPem(keypair.privateKey), - publicKey: pki2.publicKeyFromPem(keypair.publicKey) - }; - } - } - } - var state = pki2.rsa.createKeyPairGenerationState(bits, e, options); - if (!callback) { - pki2.rsa.stepKeyPairGenerationState(state, 0); - return state.keys; - } - _generateKeyPair(state, options, callback); - }; - pki2.setRsaPublicKey = pki2.rsa.setPublicKey = function(n, e) { - var key = { - n, - e - }; - key.encrypt = function(data, scheme, schemeOptions) { - if (typeof scheme === "string") { - scheme = scheme.toUpperCase(); - } else if (scheme === void 0) { - scheme = "RSAES-PKCS1-V1_5"; - } - if (scheme === "RSAES-PKCS1-V1_5") { - scheme = { - encode: function(m, key2, pub) { - return _encodePkcs1_v1_5(m, key2, 2).getBytes(); - } - }; - } else if (scheme === "RSA-OAEP" || scheme === "RSAES-OAEP") { - scheme = { - encode: function(m, key2) { - return forge.pkcs1.encode_rsa_oaep(key2, m, schemeOptions); - } - }; - } else if (["RAW", "NONE", "NULL", null].indexOf(scheme) !== -1) { - scheme = { encode: function(e3) { - return e3; - } }; - } else if (typeof scheme === "string") { - throw new Error('Unsupported encryption scheme: "' + scheme + '".'); - } - var e2 = scheme.encode(data, key, true); - return pki2.rsa.encrypt(e2, key, true); - }; - key.verify = function(digest, signature, scheme, options) { - if (typeof scheme === "string") { - scheme = scheme.toUpperCase(); - } else if (scheme === void 0) { - scheme = "RSASSA-PKCS1-V1_5"; - } - if (options === void 0) { - options = { - _parseAllDigestBytes: true, - _skipPaddingChecks: false - }; - } - if (!("_parseAllDigestBytes" in options)) { - options._parseAllDigestBytes = true; - } - if (!("_skipPaddingChecks" in options)) { - options._skipPaddingChecks = false; - } - if (scheme === "RSASSA-PKCS1-V1_5") { - scheme = { - verify: function(digest2, d2) { - d2 = _decodePkcs1_v1_5(d2, key, true, void 0, options); - var obj = asn1.fromDer(d2, { - parseAllBytes: options._parseAllDigestBytes - }); - var capture = {}; - var errors = []; - if (!asn1.validate(obj, digestInfoValidator, capture, errors) || obj.value.length !== 2) { - var error3 = new Error( - "ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value." - ); - error3.errors = errors; - throw error3; - } - var oid = asn1.derToOid(capture.algorithmIdentifier); - if (!(oid === forge.oids.md2 || oid === forge.oids.md5 || oid === forge.oids.sha1 || oid === forge.oids.sha224 || oid === forge.oids.sha256 || oid === forge.oids.sha384 || oid === forge.oids.sha512 || oid === forge.oids["sha512-224"] || oid === forge.oids["sha512-256"])) { - var error3 = new Error( - "Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier." - ); - error3.oid = oid; - throw error3; - } - if (oid === forge.oids.md2 || oid === forge.oids.md5) { - if (!("parameters" in capture)) { - throw new Error( - "ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters." - ); - } - } - return digest2 === capture.digest; - } - }; - } else if (scheme === "NONE" || scheme === "NULL" || scheme === null) { - scheme = { - verify: function(digest2, d2) { - d2 = _decodePkcs1_v1_5(d2, key, true, void 0, options); - return digest2 === d2; - } - }; - } - var d = pki2.rsa.decrypt(signature, key, true, false); - return scheme.verify(digest, d, key.n.bitLength()); - }; - return key; - }; - pki2.setRsaPrivateKey = pki2.rsa.setPrivateKey = function(n, e, d, p, q, dP, dQ, qInv) { - var key = { - n, - e, - d, - p, - q, - dP, - dQ, - qInv - }; - key.decrypt = function(data, scheme, schemeOptions) { - if (typeof scheme === "string") { - scheme = scheme.toUpperCase(); - } else if (scheme === void 0) { - scheme = "RSAES-PKCS1-V1_5"; - } - var d2 = pki2.rsa.decrypt(data, key, false, false); - if (scheme === "RSAES-PKCS1-V1_5") { - scheme = { decode: _decodePkcs1_v1_5 }; - } else if (scheme === "RSA-OAEP" || scheme === "RSAES-OAEP") { - scheme = { - decode: function(d3, key2) { - return forge.pkcs1.decode_rsa_oaep(key2, d3, schemeOptions); - } - }; - } else if (["RAW", "NONE", "NULL", null].indexOf(scheme) !== -1) { - scheme = { decode: function(d3) { - return d3; - } }; - } else { - throw new Error('Unsupported encryption scheme: "' + scheme + '".'); - } - return scheme.decode(d2, key, false); - }; - key.sign = function(md2, scheme) { - var bt = false; - if (typeof scheme === "string") { - scheme = scheme.toUpperCase(); - } - if (scheme === void 0 || scheme === "RSASSA-PKCS1-V1_5") { - scheme = { encode: emsaPkcs1v15encode }; - bt = 1; - } else if (scheme === "NONE" || scheme === "NULL" || scheme === null) { - scheme = { encode: function() { - return md2; - } }; - bt = 1; - } - var d2 = scheme.encode(md2, key.n.bitLength()); - return pki2.rsa.encrypt(d2, key, bt); - }; - return key; - }; - pki2.wrapRsaPrivateKey = function(rsaKey) { - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (0) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(0).getBytes() - ), - // privateKeyAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.rsaEncryption).getBytes() - ), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]), - // PrivateKey - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - asn1.toDer(rsaKey).getBytes() - ) - ]); - }; - pki2.privateKeyFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - if (asn1.validate(obj, privateKeyValidator, capture, errors)) { - obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey)); - } - capture = {}; - errors = []; - if (!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) { - var error3 = new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."); - error3.errors = errors; - throw error3; - } - var n, e, d, p, q, dP, dQ, qInv; - n = forge.util.createBuffer(capture.privateKeyModulus).toHex(); - e = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex(); - d = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex(); - p = forge.util.createBuffer(capture.privateKeyPrime1).toHex(); - q = forge.util.createBuffer(capture.privateKeyPrime2).toHex(); - dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex(); - dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex(); - qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex(); - return pki2.setRsaPrivateKey( - new BigInteger(n, 16), - new BigInteger(e, 16), - new BigInteger(d, 16), - new BigInteger(p, 16), - new BigInteger(q, 16), - new BigInteger(dP, 16), - new BigInteger(dQ, 16), - new BigInteger(qInv, 16) - ); - }; - pki2.privateKeyToAsn1 = pki2.privateKeyToRSAPrivateKey = function(key) { - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (0 = only 2 primes, 1 multiple primes) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(0).getBytes() - ), - // modulus (n) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.n) - ), - // publicExponent (e) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.e) - ), - // privateExponent (d) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.d) - ), - // privateKeyPrime1 (p) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.p) - ), - // privateKeyPrime2 (q) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.q) - ), - // privateKeyExponent1 (dP) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.dP) - ), - // privateKeyExponent2 (dQ) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.dQ) - ), - // coefficient (qInv) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.qInv) - ) - ]); - }; - pki2.publicKeyFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - if (asn1.validate(obj, publicKeyValidator, capture, errors)) { - var oid = asn1.derToOid(capture.publicKeyOid); - if (oid !== pki2.oids.rsaEncryption) { - var error3 = new Error("Cannot read public key. Unknown OID."); - error3.oid = oid; - throw error3; - } - obj = capture.rsaPublicKey; - } - errors = []; - if (!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) { - var error3 = new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."); - error3.errors = errors; - throw error3; - } - var n = forge.util.createBuffer(capture.publicKeyModulus).toHex(); - var e = forge.util.createBuffer(capture.publicKeyExponent).toHex(); - return pki2.setRsaPublicKey( - new BigInteger(n, 16), - new BigInteger(e, 16) - ); - }; - pki2.publicKeyToAsn1 = pki2.publicKeyToSubjectPublicKeyInfo = function(key) { - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.rsaEncryption).getBytes() - ), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]), - // subjectPublicKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ - pki2.publicKeyToRSAPublicKey(key) - ]) - ]); - }; - pki2.publicKeyToRSAPublicKey = function(key) { - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // modulus (n) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.n) - ), - // publicExponent (e) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - _bnToBytes(key.e) - ) - ]); - }; - function _encodePkcs1_v1_5(m, key, bt) { - var eb = forge.util.createBuffer(); - var k = Math.ceil(key.n.bitLength() / 8); - if (m.length > k - 11) { - var error3 = new Error("Message is too long for PKCS#1 v1.5 padding."); - error3.length = m.length; - error3.max = k - 11; - throw error3; - } - eb.putByte(0); - eb.putByte(bt); - var padNum = k - 3 - m.length; - var padByte; - if (bt === 0 || bt === 1) { - padByte = bt === 0 ? 0 : 255; - for (var i = 0; i < padNum; ++i) { - eb.putByte(padByte); - } - } else { - while (padNum > 0) { - var numZeros = 0; - var padBytes = forge.random.getBytes(padNum); - for (var i = 0; i < padNum; ++i) { - padByte = padBytes.charCodeAt(i); - if (padByte === 0) { - ++numZeros; - } else { - eb.putByte(padByte); - } - } - padNum = numZeros; - } - } - eb.putByte(0); - eb.putBytes(m); - return eb; - } - function _decodePkcs1_v1_5(em, key, pub, ml, options) { - var k = Math.ceil(key.n.bitLength() / 8); - var eb = forge.util.createBuffer(em); - var first = eb.getByte(); - var bt = eb.getByte(); - if (first !== 0 || pub && bt !== 0 && bt !== 1 || !pub && bt !== 2 || pub && bt === 0 && typeof ml === "undefined") { - throw new Error("Encryption block is invalid."); - } - var padNum = 0; - if (bt === 0) { - padNum = k - 3 - ml; - for (var i = 0; i < padNum; ++i) { - if (eb.getByte() !== 0) { - throw new Error("Encryption block is invalid."); - } - } - } else if (bt === 1) { - padNum = 0; - while (eb.length() > 1) { - if (eb.getByte() !== 255) { - --eb.read; - break; - } - ++padNum; - } - if (padNum < 8 && !(options ? options._skipPaddingChecks : false)) { - throw new Error("Encryption block is invalid."); - } - } else if (bt === 2) { - padNum = 0; - while (eb.length() > 1) { - if (eb.getByte() === 0) { - --eb.read; - break; - } - ++padNum; - } - if (padNum < 8 && !(options ? options._skipPaddingChecks : false)) { - throw new Error("Encryption block is invalid."); - } - } - var zero = eb.getByte(); - if (zero !== 0 || padNum !== k - 3 - eb.length()) { - throw new Error("Encryption block is invalid."); - } - return eb.getBytes(); - } - function _generateKeyPair(state, options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; - } - options = options || {}; - var opts = { - algorithm: { - name: options.algorithm || "PRIMEINC", - options: { - workers: options.workers || 2, - workLoad: options.workLoad || 100, - workerScript: options.workerScript - } - } - }; - if ("prng" in options) { - opts.prng = options.prng; - } - generate(); - function generate() { - getPrime(state.pBits, function(err, num) { - if (err) { - return callback(err); - } - state.p = num; - if (state.q !== null) { - return finish(err, state.q); - } - getPrime(state.qBits, finish); - }); - } - function getPrime(bits, callback2) { - forge.prime.generateProbablePrime(bits, opts, callback2); - } - function finish(err, num) { - if (err) { - return callback(err); - } - state.q = num; - if (state.p.compareTo(state.q) < 0) { - var tmp = state.p; - state.p = state.q; - state.q = tmp; - } - if (state.p.subtract(BigInteger.ONE).gcd(state.e).compareTo(BigInteger.ONE) !== 0) { - state.p = null; - generate(); - return; - } - if (state.q.subtract(BigInteger.ONE).gcd(state.e).compareTo(BigInteger.ONE) !== 0) { - state.q = null; - getPrime(state.qBits, finish); - return; - } - state.p1 = state.p.subtract(BigInteger.ONE); - state.q1 = state.q.subtract(BigInteger.ONE); - state.phi = state.p1.multiply(state.q1); - if (state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) { - state.p = state.q = null; - generate(); - return; - } - state.n = state.p.multiply(state.q); - if (state.n.bitLength() !== state.bits) { - state.q = null; - getPrime(state.qBits, finish); - return; - } - var d = state.e.modInverse(state.phi); - state.keys = { - privateKey: pki2.rsa.setPrivateKey( - state.n, - state.e, - d, - state.p, - state.q, - d.mod(state.p1), - d.mod(state.q1), - state.q.modInverse(state.p) - ), - publicKey: pki2.rsa.setPublicKey(state.n, state.e) - }; - callback(null, state.keys); - } - } - function _bnToBytes(b) { - var hex = b.toString(16); - if (hex[0] >= "8") { - hex = "00" + hex; - } - var bytes = forge.util.hexToBytes(hex); - if (bytes.length > 1 && // leading 0x00 for positive integer - (bytes.charCodeAt(0) === 0 && (bytes.charCodeAt(1) & 128) === 0 || // leading 0xFF for negative integer - bytes.charCodeAt(0) === 255 && (bytes.charCodeAt(1) & 128) === 128)) { - return bytes.substr(1); - } - return bytes; - } - function _getMillerRabinTests(bits) { - if (bits <= 100) return 27; - if (bits <= 150) return 18; - if (bits <= 200) return 15; - if (bits <= 250) return 12; - if (bits <= 300) return 9; - if (bits <= 350) return 8; - if (bits <= 400) return 7; - if (bits <= 500) return 6; - if (bits <= 600) return 5; - if (bits <= 800) return 4; - if (bits <= 1250) return 3; - return 2; - } - function _detectNodeCrypto(fn) { - return forge.util.isNodejs && typeof _crypto[fn] === "function"; - } - function _detectSubtleCrypto(fn) { - return typeof util3.globalScope !== "undefined" && typeof util3.globalScope.crypto === "object" && typeof util3.globalScope.crypto.subtle === "object" && typeof util3.globalScope.crypto.subtle[fn] === "function"; - } - function _detectSubtleMsCrypto(fn) { - return typeof util3.globalScope !== "undefined" && typeof util3.globalScope.msCrypto === "object" && typeof util3.globalScope.msCrypto.subtle === "object" && typeof util3.globalScope.msCrypto.subtle[fn] === "function"; - } - function _intToUint8Array(x) { - var bytes = forge.util.hexToBytes(x.toString(16)); - var buffer = new Uint8Array(bytes.length); - for (var i = 0; i < bytes.length; ++i) { - buffer[i] = bytes.charCodeAt(i); - } - return buffer; - } - } -}); - -// node_modules/node-forge/lib/pbe.js -var require_pbe = __commonJS({ - "node_modules/node-forge/lib/pbe.js"(exports2, module2) { - var forge = require_forge(); - require_aes(); - require_asn1(); - require_des(); - require_md(); - require_oids(); - require_pbkdf2(); - require_pem(); - require_random2(); - require_rc2(); - require_rsa(); - require_util16(); - if (typeof BigInteger === "undefined") { - BigInteger = forge.jsbn.BigInteger; - } - var BigInteger; - var asn1 = forge.asn1; - var pki2 = forge.pki = forge.pki || {}; - module2.exports = pki2.pbe = forge.pbe = forge.pbe || {}; - var oids = pki2.oids; - var encryptedPrivateKeyValidator = { - name: "EncryptedPrivateKeyInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "EncryptedPrivateKeyInfo.encryptionAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "AlgorithmIdentifier.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "encryptionOid" - }, { - name: "AlgorithmIdentifier.parameters", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "encryptionParams" - }] - }, { - // encryptedData - name: "EncryptedPrivateKeyInfo.encryptedData", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "encryptedData" - }] - }; - var PBES2AlgorithmsValidator = { - name: "PBES2Algorithms", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "PBES2Algorithms.keyDerivationFunc", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "PBES2Algorithms.keyDerivationFunc.oid", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "kdfOid" - }, { - name: "PBES2Algorithms.params", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "PBES2Algorithms.params.salt", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "kdfSalt" - }, { - name: "PBES2Algorithms.params.iterationCount", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "kdfIterationCount" - }, { - name: "PBES2Algorithms.params.keyLength", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - optional: true, - capture: "keyLength" - }, { - // prf - name: "PBES2Algorithms.params.prf", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: "PBES2Algorithms.params.prf.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "prfOid" - }] - }] - }] - }, { - name: "PBES2Algorithms.encryptionScheme", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "PBES2Algorithms.encryptionScheme.oid", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "encOid" - }, { - name: "PBES2Algorithms.encryptionScheme.iv", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "encIv" - }] - }] - }; - var pkcs12PbeParamsValidator = { - name: "pkcs-12PbeParams", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "pkcs-12PbeParams.salt", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "salt" - }, { - name: "pkcs-12PbeParams.iterations", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "iterations" - }] - }; - pki2.encryptPrivateKeyInfo = function(obj, password, options) { - options = options || {}; - options.saltSize = options.saltSize || 8; - options.count = options.count || 2048; - options.algorithm = options.algorithm || "aes128"; - options.prfAlgorithm = options.prfAlgorithm || "sha1"; - var salt = forge.random.getBytesSync(options.saltSize); - var count = options.count; - var countBytes = asn1.integerToDer(count); - var dkLen; - var encryptionAlgorithm; - var encryptedData; - if (options.algorithm.indexOf("aes") === 0 || options.algorithm === "des") { - var ivLen, encOid, cipherFn; - switch (options.algorithm) { - case "aes128": - dkLen = 16; - ivLen = 16; - encOid = oids["aes128-CBC"]; - cipherFn = forge.aes.createEncryptionCipher; - break; - case "aes192": - dkLen = 24; - ivLen = 16; - encOid = oids["aes192-CBC"]; - cipherFn = forge.aes.createEncryptionCipher; - break; - case "aes256": - dkLen = 32; - ivLen = 16; - encOid = oids["aes256-CBC"]; - cipherFn = forge.aes.createEncryptionCipher; - break; - case "des": - dkLen = 8; - ivLen = 8; - encOid = oids["desCBC"]; - cipherFn = forge.des.createEncryptionCipher; - break; - default: - var error3 = new Error("Cannot encrypt private key. Unknown encryption algorithm."); - error3.algorithm = options.algorithm; - throw error3; - } - var prfAlgorithm = "hmacWith" + options.prfAlgorithm.toUpperCase(); - var md2 = prfAlgorithmToMessageDigest(prfAlgorithm); - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md2); - var iv = forge.random.getBytesSync(ivLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(asn1.toDer(obj)); - cipher.finish(); - encryptedData = cipher.output.getBytes(); - var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm); - encryptionAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(oids["pkcs5PBES2"]).getBytes() - ), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // keyDerivationFunc - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(oids["pkcs5PBKDF2"]).getBytes() - ), - // PBKDF2-params - params - ]), - // encryptionScheme - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(encOid).getBytes() - ), - // iv - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - iv - ) - ]) - ]) - ] - ); - } else if (options.algorithm === "3des") { - dkLen = 24; - var saltBytes = new forge.util.ByteBuffer(salt); - var dk = pki2.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen); - var iv = pki2.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen); - var cipher = forge.des.createEncryptionCipher(dk); - cipher.start(iv); - cipher.update(asn1.toDer(obj)); - cipher.finish(); - encryptedData = cipher.output.getBytes(); - encryptionAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes() - ), - // pkcs-12PbeParams - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // salt - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), - // iteration count - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - countBytes.getBytes() - ) - ]) - ] - ); - } else { - var error3 = new Error("Cannot encrypt private key. Unknown encryption algorithm."); - error3.algorithm = options.algorithm; - throw error3; - } - var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // encryptionAlgorithm - encryptionAlgorithm, - // encryptedData - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - encryptedData - ) - ]); - return rval; - }; - pki2.decryptPrivateKeyInfo = function(obj, password) { - var rval = null; - var capture = {}; - var errors = []; - if (!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) { - var error3 = new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); - error3.errors = errors; - throw error3; - } - var oid = asn1.derToOid(capture.encryptionOid); - var cipher = pki2.pbe.getCipher(oid, capture.encryptionParams, password); - var encrypted = forge.util.createBuffer(capture.encryptedData); - cipher.update(encrypted); - if (cipher.finish()) { - rval = asn1.fromDer(cipher.output); - } - return rval; - }; - pki2.encryptedPrivateKeyToPem = function(epki, maxline) { - var msg = { - type: "ENCRYPTED PRIVATE KEY", - body: asn1.toDer(epki).getBytes() - }; - return forge.pem.encode(msg, { maxline }); - }; - pki2.encryptedPrivateKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "ENCRYPTED PRIVATE KEY") { - var error3 = new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".'); - error3.headerType = msg.type; - throw error3; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted."); - } - return asn1.fromDer(msg.body); - }; - pki2.encryptRsaPrivateKey = function(rsaKey, password, options) { - options = options || {}; - if (!options.legacy) { - var rval = pki2.wrapRsaPrivateKey(pki2.privateKeyToAsn1(rsaKey)); - rval = pki2.encryptPrivateKeyInfo(rval, password, options); - return pki2.encryptedPrivateKeyToPem(rval); - } - var algorithm; - var iv; - var dkLen; - var cipherFn; - switch (options.algorithm) { - case "aes128": - algorithm = "AES-128-CBC"; - dkLen = 16; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case "aes192": - algorithm = "AES-192-CBC"; - dkLen = 24; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case "aes256": - algorithm = "AES-256-CBC"; - dkLen = 32; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case "3des": - algorithm = "DES-EDE3-CBC"; - dkLen = 24; - iv = forge.random.getBytesSync(8); - cipherFn = forge.des.createEncryptionCipher; - break; - case "des": - algorithm = "DES-CBC"; - dkLen = 8; - iv = forge.random.getBytesSync(8); - cipherFn = forge.des.createEncryptionCipher; - break; - default: - var error3 = new Error('Could not encrypt RSA private key; unsupported encryption algorithm "' + options.algorithm + '".'); - error3.algorithm = options.algorithm; - throw error3; - } - var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(asn1.toDer(pki2.privateKeyToAsn1(rsaKey))); - cipher.finish(); - var msg = { - type: "RSA PRIVATE KEY", - procType: { - version: "4", - type: "ENCRYPTED" - }, - dekInfo: { - algorithm, - parameters: forge.util.bytesToHex(iv).toUpperCase() - }, - body: cipher.output.getBytes() - }; - return forge.pem.encode(msg); - }; - pki2.decryptRsaPrivateKey = function(pem, password) { - var rval = null; - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "ENCRYPTED PRIVATE KEY" && msg.type !== "PRIVATE KEY" && msg.type !== "RSA PRIVATE KEY") { - var error3 = new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'); - error3.headerType = error3; - throw error3; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - var dkLen; - var cipherFn; - switch (msg.dekInfo.algorithm) { - case "DES-CBC": - dkLen = 8; - cipherFn = forge.des.createDecryptionCipher; - break; - case "DES-EDE3-CBC": - dkLen = 24; - cipherFn = forge.des.createDecryptionCipher; - break; - case "AES-128-CBC": - dkLen = 16; - cipherFn = forge.aes.createDecryptionCipher; - break; - case "AES-192-CBC": - dkLen = 24; - cipherFn = forge.aes.createDecryptionCipher; - break; - case "AES-256-CBC": - dkLen = 32; - cipherFn = forge.aes.createDecryptionCipher; - break; - case "RC2-40-CBC": - dkLen = 5; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 40); - }; - break; - case "RC2-64-CBC": - dkLen = 8; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 64); - }; - break; - case "RC2-128-CBC": - dkLen = 16; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 128); - }; - break; - default: - var error3 = new Error('Could not decrypt private key; unsupported encryption algorithm "' + msg.dekInfo.algorithm + '".'); - error3.algorithm = msg.dekInfo.algorithm; - throw error3; - } - var iv = forge.util.hexToBytes(msg.dekInfo.parameters); - var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(forge.util.createBuffer(msg.body)); - if (cipher.finish()) { - rval = cipher.output.getBytes(); - } else { - return rval; - } - } else { - rval = msg.body; - } - if (msg.type === "ENCRYPTED PRIVATE KEY") { - rval = pki2.decryptPrivateKeyInfo(asn1.fromDer(rval), password); - } else { - rval = asn1.fromDer(rval); - } - if (rval !== null) { - rval = pki2.privateKeyFromAsn1(rval); - } - return rval; - }; - pki2.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md2) { - var j, l; - if (typeof md2 === "undefined" || md2 === null) { - if (!("sha1" in forge.md)) { - throw new Error('"sha1" hash algorithm unavailable.'); - } - md2 = forge.md.sha1.create(); - } - var u = md2.digestLength; - var v = md2.blockLength; - var result = new forge.util.ByteBuffer(); - var passBuf = new forge.util.ByteBuffer(); - if (password !== null && password !== void 0) { - for (l = 0; l < password.length; l++) { - passBuf.putInt16(password.charCodeAt(l)); - } - passBuf.putInt16(0); - } - var p = passBuf.length(); - var s = salt.length(); - var D = new forge.util.ByteBuffer(); - D.fillWithByte(id, v); - var Slen = v * Math.ceil(s / v); - var S = new forge.util.ByteBuffer(); - for (l = 0; l < Slen; l++) { - S.putByte(salt.at(l % s)); - } - var Plen = v * Math.ceil(p / v); - var P = new forge.util.ByteBuffer(); - for (l = 0; l < Plen; l++) { - P.putByte(passBuf.at(l % p)); - } - var I = S; - I.putBuffer(P); - var c = Math.ceil(n / u); - for (var i = 1; i <= c; i++) { - var buf = new forge.util.ByteBuffer(); - buf.putBytes(D.bytes()); - buf.putBytes(I.bytes()); - for (var round = 0; round < iter; round++) { - md2.start(); - md2.update(buf.getBytes()); - buf = md2.digest(); - } - var B = new forge.util.ByteBuffer(); - for (l = 0; l < v; l++) { - B.putByte(buf.at(l % u)); - } - var k = Math.ceil(s / v) + Math.ceil(p / v); - var Inew = new forge.util.ByteBuffer(); - for (j = 0; j < k; j++) { - var chunk = new forge.util.ByteBuffer(I.getBytes(v)); - var x = 511; - for (l = B.length() - 1; l >= 0; l--) { - x = x >> 8; - x += B.at(l) + chunk.at(l); - chunk.setAt(l, x & 255); - } - Inew.putBuffer(chunk); - } - I = Inew; - result.putBuffer(buf); - } - result.truncate(result.length() - n); - return result; - }; - pki2.pbe.getCipher = function(oid, params, password) { - switch (oid) { - case pki2.oids["pkcs5PBES2"]: - return pki2.pbe.getCipherForPBES2(oid, params, password); - case pki2.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]: - case pki2.oids["pbewithSHAAnd40BitRC2-CBC"]: - return pki2.pbe.getCipherForPKCS12PBE(oid, params, password); - default: - var error3 = new Error("Cannot read encrypted PBE data block. Unsupported OID."); - error3.oid = oid; - error3.supportedOids = [ - "pkcs5PBES2", - "pbeWithSHAAnd3-KeyTripleDES-CBC", - "pbewithSHAAnd40BitRC2-CBC" - ]; - throw error3; - } - }; - pki2.pbe.getCipherForPBES2 = function(oid, params, password) { - var capture = {}; - var errors = []; - if (!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) { - var error3 = new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); - error3.errors = errors; - throw error3; - } - oid = asn1.derToOid(capture.kdfOid); - if (oid !== pki2.oids["pkcs5PBKDF2"]) { - var error3 = new Error("Cannot read encrypted private key. Unsupported key derivation function OID."); - error3.oid = oid; - error3.supportedOids = ["pkcs5PBKDF2"]; - throw error3; - } - oid = asn1.derToOid(capture.encOid); - if (oid !== pki2.oids["aes128-CBC"] && oid !== pki2.oids["aes192-CBC"] && oid !== pki2.oids["aes256-CBC"] && oid !== pki2.oids["des-EDE3-CBC"] && oid !== pki2.oids["desCBC"]) { - var error3 = new Error("Cannot read encrypted private key. Unsupported encryption scheme OID."); - error3.oid = oid; - error3.supportedOids = [ - "aes128-CBC", - "aes192-CBC", - "aes256-CBC", - "des-EDE3-CBC", - "desCBC" - ]; - throw error3; - } - var salt = capture.kdfSalt; - var count = forge.util.createBuffer(capture.kdfIterationCount); - count = count.getInt(count.length() << 3); - var dkLen; - var cipherFn; - switch (pki2.oids[oid]) { - case "aes128-CBC": - dkLen = 16; - cipherFn = forge.aes.createDecryptionCipher; - break; - case "aes192-CBC": - dkLen = 24; - cipherFn = forge.aes.createDecryptionCipher; - break; - case "aes256-CBC": - dkLen = 32; - cipherFn = forge.aes.createDecryptionCipher; - break; - case "des-EDE3-CBC": - dkLen = 24; - cipherFn = forge.des.createDecryptionCipher; - break; - case "desCBC": - dkLen = 8; - cipherFn = forge.des.createDecryptionCipher; - break; - } - var md2 = prfOidToMessageDigest(capture.prfOid); - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md2); - var iv = capture.encIv; - var cipher = cipherFn(dk); - cipher.start(iv); - return cipher; - }; - pki2.pbe.getCipherForPKCS12PBE = function(oid, params, password) { - var capture = {}; - var errors = []; - if (!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) { - var error3 = new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); - error3.errors = errors; - throw error3; - } - var salt = forge.util.createBuffer(capture.salt); - var count = forge.util.createBuffer(capture.iterations); - count = count.getInt(count.length() << 3); - var dkLen, dIvLen, cipherFn; - switch (oid) { - case pki2.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]: - dkLen = 24; - dIvLen = 8; - cipherFn = forge.des.startDecrypting; - break; - case pki2.oids["pbewithSHAAnd40BitRC2-CBC"]: - dkLen = 5; - dIvLen = 8; - cipherFn = function(key2, iv2) { - var cipher = forge.rc2.createDecryptionCipher(key2, 40); - cipher.start(iv2, null); - return cipher; - }; - break; - default: - var error3 = new Error("Cannot read PKCS #12 PBE data block. Unsupported OID."); - error3.oid = oid; - throw error3; - } - var md2 = prfOidToMessageDigest(capture.prfOid); - var key = pki2.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md2); - md2.start(); - var iv = pki2.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md2); - return cipherFn(key, iv); - }; - pki2.pbe.opensslDeriveBytes = function(password, salt, dkLen, md2) { - if (typeof md2 === "undefined" || md2 === null) { - if (!("md5" in forge.md)) { - throw new Error('"md5" hash algorithm unavailable.'); - } - md2 = forge.md.md5.create(); - } - if (salt === null) { - salt = ""; - } - var digests = [hash2(md2, password + salt)]; - for (var length = 16, i = 1; length < dkLen; ++i, length += 16) { - digests.push(hash2(md2, digests[i - 1] + password + salt)); - } - return digests.join("").substr(0, dkLen); - }; - function hash2(md2, bytes) { - return md2.start().update(bytes).digest().getBytes(); - } - function prfOidToMessageDigest(prfOid) { - var prfAlgorithm; - if (!prfOid) { - prfAlgorithm = "hmacWithSHA1"; - } else { - prfAlgorithm = pki2.oids[asn1.derToOid(prfOid)]; - if (!prfAlgorithm) { - var error3 = new Error("Unsupported PRF OID."); - error3.oid = prfOid; - error3.supported = [ - "hmacWithSHA1", - "hmacWithSHA224", - "hmacWithSHA256", - "hmacWithSHA384", - "hmacWithSHA512" - ]; - throw error3; - } - } - return prfAlgorithmToMessageDigest(prfAlgorithm); - } - function prfAlgorithmToMessageDigest(prfAlgorithm) { - var factory = forge.md; - switch (prfAlgorithm) { - case "hmacWithSHA224": - factory = forge.md.sha512; - case "hmacWithSHA1": - case "hmacWithSHA256": - case "hmacWithSHA384": - case "hmacWithSHA512": - prfAlgorithm = prfAlgorithm.substr(8).toLowerCase(); - break; - default: - var error3 = new Error("Unsupported PRF algorithm."); - error3.algorithm = prfAlgorithm; - error3.supported = [ - "hmacWithSHA1", - "hmacWithSHA224", - "hmacWithSHA256", - "hmacWithSHA384", - "hmacWithSHA512" - ]; - throw error3; - } - if (!factory || !(prfAlgorithm in factory)) { - throw new Error("Unknown hash algorithm: " + prfAlgorithm); - } - return factory[prfAlgorithm].create(); - } - function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { - var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // salt - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - salt - ), - // iteration count - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - countBytes.getBytes() - ) - ]); - if (prfAlgorithm !== "hmacWithSHA1") { - params.value.push( - // key length - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - forge.util.hexToBytes(dkLen.toString(16)) - ), - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids[prfAlgorithm]).getBytes() - ), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]) - ); - } - return params; - } - } -}); - -// node_modules/node-forge/lib/pkcs7asn1.js -var require_pkcs7asn1 = __commonJS({ - "node_modules/node-forge/lib/pkcs7asn1.js"(exports2, module2) { - var forge = require_forge(); - require_asn1(); - require_util16(); - var asn1 = forge.asn1; - var p7v = module2.exports = forge.pkcs7asn1 = forge.pkcs7asn1 || {}; - forge.pkcs7 = forge.pkcs7 || {}; - forge.pkcs7.asn1 = p7v; - var contentInfoValidator = { - name: "ContentInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "ContentInfo.ContentType", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "contentType" - }, { - name: "ContentInfo.content", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - captureAsn1: "content" - }] - }; - p7v.contentInfoValidator = contentInfoValidator; - var encryptedContentInfoValidator = { - name: "EncryptedContentInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "EncryptedContentInfo.contentType", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "contentType" - }, { - name: "EncryptedContentInfo.contentEncryptionAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "EncryptedContentInfo.contentEncryptionAlgorithm.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "encAlgorithm" - }, { - name: "EncryptedContentInfo.contentEncryptionAlgorithm.parameter", - tagClass: asn1.Class.UNIVERSAL, - captureAsn1: "encParameter" - }] - }, { - name: "EncryptedContentInfo.encryptedContent", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - /* The PKCS#7 structure output by OpenSSL somewhat differs from what - * other implementations do generate. - * - * OpenSSL generates a structure like this: - * SEQUENCE { - * ... - * [0] - * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 - * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 - * ... - * } - * - * Whereas other implementations (and this PKCS#7 module) generate: - * SEQUENCE { - * ... - * [0] { - * OCTET STRING - * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 - * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 - * ... - * } - * } - * - * In order to support both, we just capture the context specific - * field here. The OCTET STRING bit is removed below. - */ - capture: "encryptedContent", - captureAsn1: "encryptedContentAsn1" - }] - }; - p7v.envelopedDataValidator = { - name: "EnvelopedData", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "EnvelopedData.Version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "version" - }, { - name: "EnvelopedData.RecipientInfos", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - captureAsn1: "recipientInfos" - }].concat(encryptedContentInfoValidator) - }; - p7v.encryptedDataValidator = { - name: "EncryptedData", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "EncryptedData.Version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "version" - }].concat(encryptedContentInfoValidator) - }; - var signerValidator = { - name: "SignerInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "SignerInfo.version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false - }, { - name: "SignerInfo.issuerAndSerialNumber", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "SignerInfo.issuerAndSerialNumber.issuer", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "issuer" - }, { - name: "SignerInfo.issuerAndSerialNumber.serialNumber", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "serial" - }] - }, { - name: "SignerInfo.digestAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "SignerInfo.digestAlgorithm.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "digestAlgorithm" - }, { - name: "SignerInfo.digestAlgorithm.parameter", - tagClass: asn1.Class.UNIVERSAL, - constructed: false, - captureAsn1: "digestParameter", - optional: true - }] - }, { - name: "SignerInfo.authenticatedAttributes", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - capture: "authenticatedAttributes" - }, { - name: "SignerInfo.digestEncryptionAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - capture: "signatureAlgorithm" - }, { - name: "SignerInfo.encryptedDigest", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "signature" - }, { - name: "SignerInfo.unauthenticatedAttributes", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - optional: true, - capture: "unauthenticatedAttributes" - }] - }; - p7v.signedDataValidator = { - name: "SignedData", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [ - { - name: "SignedData.Version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "version" - }, - { - name: "SignedData.DigestAlgorithms", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - captureAsn1: "digestAlgorithms" - }, - contentInfoValidator, - { - name: "SignedData.Certificates", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - optional: true, - captureAsn1: "certificates" - }, - { - name: "SignedData.CertificateRevocationLists", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - optional: true, - captureAsn1: "crls" - }, - { - name: "SignedData.SignerInfos", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - capture: "signerInfos", - optional: true, - value: [signerValidator] - } - ] - }; - p7v.recipientInfoValidator = { - name: "RecipientInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "RecipientInfo.version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "version" - }, { - name: "RecipientInfo.issuerAndSerial", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "RecipientInfo.issuerAndSerial.issuer", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "issuer" - }, { - name: "RecipientInfo.issuerAndSerial.serialNumber", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "serial" - }] - }, { - name: "RecipientInfo.keyEncryptionAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "RecipientInfo.keyEncryptionAlgorithm.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "encAlgorithm" - }, { - name: "RecipientInfo.keyEncryptionAlgorithm.parameter", - tagClass: asn1.Class.UNIVERSAL, - constructed: false, - captureAsn1: "encParameter", - optional: true - }] - }, { - name: "RecipientInfo.encryptedKey", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "encKey" - }] - }; - } -}); - -// node_modules/node-forge/lib/mgf1.js -var require_mgf1 = __commonJS({ - "node_modules/node-forge/lib/mgf1.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - forge.mgf = forge.mgf || {}; - var mgf1 = module2.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {}; - mgf1.create = function(md2) { - var mgf = { - /** - * Generate mask of specified length. - * - * @param {String} seed The seed for mask generation. - * @param maskLen Number of bytes to generate. - * @return {String} The generated mask. - */ - generate: function(seed, maskLen) { - var t = new forge.util.ByteBuffer(); - var len = Math.ceil(maskLen / md2.digestLength); - for (var i = 0; i < len; i++) { - var c = new forge.util.ByteBuffer(); - c.putInt32(i); - md2.start(); - md2.update(seed + c.getBytes()); - t.putBuffer(md2.digest()); - } - t.truncate(t.length() - maskLen); - return t.getBytes(); - } - }; - return mgf; - }; - } -}); - -// node_modules/node-forge/lib/mgf.js -var require_mgf = __commonJS({ - "node_modules/node-forge/lib/mgf.js"(exports2, module2) { - var forge = require_forge(); - require_mgf1(); - module2.exports = forge.mgf = forge.mgf || {}; - forge.mgf.mgf1 = forge.mgf1; - } -}); - -// node_modules/node-forge/lib/pss.js -var require_pss = __commonJS({ - "node_modules/node-forge/lib/pss.js"(exports2, module2) { - var forge = require_forge(); - require_random2(); - require_util16(); - var pss = module2.exports = forge.pss = forge.pss || {}; - pss.create = function(options) { - if (arguments.length === 3) { - options = { - md: arguments[0], - mgf: arguments[1], - saltLength: arguments[2] - }; - } - var hash2 = options.md; - var mgf = options.mgf; - var hLen = hash2.digestLength; - var salt_ = options.salt || null; - if (typeof salt_ === "string") { - salt_ = forge.util.createBuffer(salt_); - } - var sLen; - if ("saltLength" in options) { - sLen = options.saltLength; - } else if (salt_ !== null) { - sLen = salt_.length(); - } else { - throw new Error("Salt length not specified or specific salt not given."); - } - if (salt_ !== null && salt_.length() !== sLen) { - throw new Error("Given salt length does not match length of given salt."); - } - var prng = options.prng || forge.random; - var pssobj = {}; - pssobj.encode = function(md2, modBits) { - var i; - var emBits = modBits - 1; - var emLen = Math.ceil(emBits / 8); - var mHash = md2.digest().getBytes(); - if (emLen < hLen + sLen + 2) { - throw new Error("Message is too long to encrypt."); - } - var salt; - if (salt_ === null) { - salt = prng.getBytesSync(sLen); - } else { - salt = salt_.bytes(); - } - var m_ = new forge.util.ByteBuffer(); - m_.fillWithByte(0, 8); - m_.putBytes(mHash); - m_.putBytes(salt); - hash2.start(); - hash2.update(m_.getBytes()); - var h = hash2.digest().getBytes(); - var ps = new forge.util.ByteBuffer(); - ps.fillWithByte(0, emLen - sLen - hLen - 2); - ps.putByte(1); - ps.putBytes(salt); - var db = ps.getBytes(); - var maskLen = emLen - hLen - 1; - var dbMask = mgf.generate(h, maskLen); - var maskedDB = ""; - for (i = 0; i < maskLen; i++) { - maskedDB += String.fromCharCode(db.charCodeAt(i) ^ dbMask.charCodeAt(i)); - } - var mask = 65280 >> 8 * emLen - emBits & 255; - maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) + maskedDB.substr(1); - return maskedDB + h + String.fromCharCode(188); - }; - pssobj.verify = function(mHash, em, modBits) { - var i; - var emBits = modBits - 1; - var emLen = Math.ceil(emBits / 8); - em = em.substr(-emLen); - if (emLen < hLen + sLen + 2) { - throw new Error("Inconsistent parameters to PSS signature verification."); - } - if (em.charCodeAt(emLen - 1) !== 188) { - throw new Error("Encoded message does not end in 0xBC."); - } - var maskLen = emLen - hLen - 1; - var maskedDB = em.substr(0, maskLen); - var h = em.substr(maskLen, hLen); - var mask = 65280 >> 8 * emLen - emBits & 255; - if ((maskedDB.charCodeAt(0) & mask) !== 0) { - throw new Error("Bits beyond keysize not zero as expected."); - } - var dbMask = mgf.generate(h, maskLen); - var db = ""; - for (i = 0; i < maskLen; i++) { - db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i)); - } - db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1); - var checkLen = emLen - hLen - sLen - 2; - for (i = 0; i < checkLen; i++) { - if (db.charCodeAt(i) !== 0) { - throw new Error("Leftmost octets not zero as expected"); - } - } - if (db.charCodeAt(checkLen) !== 1) { - throw new Error("Inconsistent PSS signature, 0x01 marker not found"); - } - var salt = db.substr(-sLen); - var m_ = new forge.util.ByteBuffer(); - m_.fillWithByte(0, 8); - m_.putBytes(mHash); - m_.putBytes(salt); - hash2.start(); - hash2.update(m_.getBytes()); - var h_ = hash2.digest().getBytes(); - return h === h_; - }; - return pssobj; - }; - } -}); - -// node_modules/node-forge/lib/x509.js -var require_x509 = __commonJS({ - "node_modules/node-forge/lib/x509.js"(exports2, module2) { - var forge = require_forge(); - require_aes(); - require_asn1(); - require_des(); - require_md(); - require_mgf(); - require_oids(); - require_pem(); - require_pss(); - require_rsa(); - require_util16(); - var asn1 = forge.asn1; - var pki2 = module2.exports = forge.pki = forge.pki || {}; - var oids = pki2.oids; - var _shortNames = {}; - _shortNames["CN"] = oids["commonName"]; - _shortNames["commonName"] = "CN"; - _shortNames["C"] = oids["countryName"]; - _shortNames["countryName"] = "C"; - _shortNames["L"] = oids["localityName"]; - _shortNames["localityName"] = "L"; - _shortNames["ST"] = oids["stateOrProvinceName"]; - _shortNames["stateOrProvinceName"] = "ST"; - _shortNames["O"] = oids["organizationName"]; - _shortNames["organizationName"] = "O"; - _shortNames["OU"] = oids["organizationalUnitName"]; - _shortNames["organizationalUnitName"] = "OU"; - _shortNames["E"] = oids["emailAddress"]; - _shortNames["emailAddress"] = "E"; - var publicKeyValidator = forge.pki.rsa.publicKeyValidator; - var x509CertificateValidator = { - name: "Certificate", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "Certificate.TBSCertificate", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "tbsCertificate", - value: [ - { - name: "Certificate.TBSCertificate.version", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - value: [{ - name: "Certificate.TBSCertificate.version.integer", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "certVersion" - }] - }, - { - name: "Certificate.TBSCertificate.serialNumber", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "certSerialNumber" - }, - { - name: "Certificate.TBSCertificate.signature", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "Certificate.TBSCertificate.signature.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "certinfoSignatureOid" - }, { - name: "Certificate.TBSCertificate.signature.parameters", - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: "certinfoSignatureParams" - }] - }, - { - name: "Certificate.TBSCertificate.issuer", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "certIssuer" - }, - { - name: "Certificate.TBSCertificate.validity", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - // Note: UTC and generalized times may both appear so the capture - // names are based on their detected order, the names used below - // are only for the common case, which validity time really means - // "notBefore" and which means "notAfter" will be determined by order - value: [{ - // notBefore (Time) (UTC time case) - name: "Certificate.TBSCertificate.validity.notBefore (utc)", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.UTCTIME, - constructed: false, - optional: true, - capture: "certValidity1UTCTime" - }, { - // notBefore (Time) (generalized time case) - name: "Certificate.TBSCertificate.validity.notBefore (generalized)", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.GENERALIZEDTIME, - constructed: false, - optional: true, - capture: "certValidity2GeneralizedTime" - }, { - // notAfter (Time) (only UTC time is supported) - name: "Certificate.TBSCertificate.validity.notAfter (utc)", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.UTCTIME, - constructed: false, - optional: true, - capture: "certValidity3UTCTime" - }, { - // notAfter (Time) (only UTC time is supported) - name: "Certificate.TBSCertificate.validity.notAfter (generalized)", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.GENERALIZEDTIME, - constructed: false, - optional: true, - capture: "certValidity4GeneralizedTime" - }] - }, - { - // Name (subject) (RDNSequence) - name: "Certificate.TBSCertificate.subject", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "certSubject" - }, - // SubjectPublicKeyInfo - publicKeyValidator, - { - // issuerUniqueID (optional) - name: "Certificate.TBSCertificate.issuerUniqueID", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - optional: true, - value: [{ - name: "Certificate.TBSCertificate.issuerUniqueID.id", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - // TODO: support arbitrary bit length ids - captureBitStringValue: "certIssuerUniqueId" - }] - }, - { - // subjectUniqueID (optional) - name: "Certificate.TBSCertificate.subjectUniqueID", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 2, - constructed: true, - optional: true, - value: [{ - name: "Certificate.TBSCertificate.subjectUniqueID.id", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - // TODO: support arbitrary bit length ids - captureBitStringValue: "certSubjectUniqueId" - }] - }, - { - // Extensions (optional) - name: "Certificate.TBSCertificate.extensions", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 3, - constructed: true, - captureAsn1: "certExtensions", - optional: true - } - ] - }, { - // AlgorithmIdentifier (signature algorithm) - name: "Certificate.signatureAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // algorithm - name: "Certificate.signatureAlgorithm.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "certSignatureOid" - }, { - name: "Certificate.TBSCertificate.signature.parameters", - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: "certSignatureParams" - }] - }, { - // SignatureValue - name: "Certificate.signatureValue", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - captureBitStringValue: "certSignature" - }] - }; - var rsassaPssParameterValidator = { - name: "rsapss", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "rsapss.hashAlgorithm", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - value: [{ - name: "rsapss.hashAlgorithm.AlgorithmIdentifier", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: "rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "hashOid" - /* parameter block omitted, for SHA1 NULL anyhow. */ - }] - }] - }, { - name: "rsapss.maskGenAlgorithm", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - value: [{ - name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "maskGenOid" - }, { - name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.params", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "maskGenHashOid" - /* parameter block omitted, for SHA1 NULL anyhow. */ - }] - }] - }] - }, { - name: "rsapss.saltLength", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 2, - optional: true, - value: [{ - name: "rsapss.saltLength.saltLength", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.INTEGER, - constructed: false, - capture: "saltLength" - }] - }, { - name: "rsapss.trailerField", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 3, - optional: true, - value: [{ - name: "rsapss.trailer.trailer", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.INTEGER, - constructed: false, - capture: "trailer" - }] - }] - }; - var certificationRequestInfoValidator = { - name: "CertificationRequestInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "certificationRequestInfo", - value: [ - { - name: "CertificationRequestInfo.integer", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "certificationRequestInfoVersion" - }, - { - // Name (subject) (RDNSequence) - name: "CertificationRequestInfo.subject", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "certificationRequestInfoSubject" - }, - // SubjectPublicKeyInfo - publicKeyValidator, - { - name: "CertificationRequestInfo.attributes", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - capture: "certificationRequestInfoAttributes", - value: [{ - name: "CertificationRequestInfo.attributes", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "CertificationRequestInfo.attributes.type", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false - }, { - name: "CertificationRequestInfo.attributes.value", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true - }] - }] - } - ] - }; - var certificationRequestValidator = { - name: "CertificationRequest", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "csr", - value: [ - certificationRequestInfoValidator, - { - // AlgorithmIdentifier (signature algorithm) - name: "CertificationRequest.signatureAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // algorithm - name: "CertificationRequest.signatureAlgorithm.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "csrSignatureOid" - }, { - name: "CertificationRequest.signatureAlgorithm.parameters", - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: "csrSignatureParams" - }] - }, - { - // signature - name: "CertificationRequest.signature", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - captureBitStringValue: "csrSignature" - } - ] - }; - pki2.RDNAttributesAsArray = function(rdn, md2) { - var rval = []; - var set, attr, obj; - for (var si = 0; si < rdn.value.length; ++si) { - set = rdn.value[si]; - for (var i = 0; i < set.value.length; ++i) { - obj = {}; - attr = set.value[i]; - obj.type = asn1.derToOid(attr.value[0].value); - obj.value = attr.value[1].value; - obj.valueTagClass = attr.value[1].type; - if (obj.type in oids) { - obj.name = oids[obj.type]; - if (obj.name in _shortNames) { - obj.shortName = _shortNames[obj.name]; - } - } - if (md2) { - md2.update(obj.type); - md2.update(obj.value); - } - rval.push(obj); - } - } - return rval; - }; - pki2.CRIAttributesAsArray = function(attributes) { - var rval = []; - for (var si = 0; si < attributes.length; ++si) { - var seq = attributes[si]; - var type = asn1.derToOid(seq.value[0].value); - var values = seq.value[1].value; - for (var vi = 0; vi < values.length; ++vi) { - var obj = {}; - obj.type = type; - obj.value = values[vi].value; - obj.valueTagClass = values[vi].type; - if (obj.type in oids) { - obj.name = oids[obj.type]; - if (obj.name in _shortNames) { - obj.shortName = _shortNames[obj.name]; - } - } - if (obj.type === oids.extensionRequest) { - obj.extensions = []; - for (var ei = 0; ei < obj.value.length; ++ei) { - obj.extensions.push(pki2.certificateExtensionFromAsn1(obj.value[ei])); - } - } - rval.push(obj); - } - } - return rval; - }; - function _getAttribute(obj, options) { - if (typeof options === "string") { - options = { shortName: options }; - } - var rval = null; - var attr; - for (var i = 0; rval === null && i < obj.attributes.length; ++i) { - attr = obj.attributes[i]; - if (options.type && options.type === attr.type) { - rval = attr; - } else if (options.name && options.name === attr.name) { - rval = attr; - } else if (options.shortName && options.shortName === attr.shortName) { - rval = attr; - } - } - return rval; - } - var _readSignatureParameters = function(oid, obj, fillDefaults) { - var params = {}; - if (oid !== oids["RSASSA-PSS"]) { - return params; - } - if (fillDefaults) { - params = { - hash: { - algorithmOid: oids["sha1"] - }, - mgf: { - algorithmOid: oids["mgf1"], - hash: { - algorithmOid: oids["sha1"] - } - }, - saltLength: 20 - }; - } - var capture = {}; - var errors = []; - if (!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) { - var error3 = new Error("Cannot read RSASSA-PSS parameter block."); - error3.errors = errors; - throw error3; - } - if (capture.hashOid !== void 0) { - params.hash = params.hash || {}; - params.hash.algorithmOid = asn1.derToOid(capture.hashOid); - } - if (capture.maskGenOid !== void 0) { - params.mgf = params.mgf || {}; - params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid); - params.mgf.hash = params.mgf.hash || {}; - params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid); - } - if (capture.saltLength !== void 0) { - params.saltLength = capture.saltLength.charCodeAt(0); - } - return params; - }; - var _createSignatureDigest = function(options) { - switch (oids[options.signatureOid]) { - case "sha1WithRSAEncryption": - // deprecated alias - case "sha1WithRSASignature": - return forge.md.sha1.create(); - case "md5WithRSAEncryption": - return forge.md.md5.create(); - case "sha256WithRSAEncryption": - return forge.md.sha256.create(); - case "sha384WithRSAEncryption": - return forge.md.sha384.create(); - case "sha512WithRSAEncryption": - return forge.md.sha512.create(); - case "RSASSA-PSS": - return forge.md.sha256.create(); - default: - var error3 = new Error( - "Could not compute " + options.type + " digest. Unknown signature OID." - ); - error3.signatureOid = options.signatureOid; - throw error3; - } - }; - var _verifySignature = function(options) { - var cert = options.certificate; - var scheme; - switch (cert.signatureOid) { - case oids.sha1WithRSAEncryption: - // deprecated alias - case oids.sha1WithRSASignature: - break; - case oids["RSASSA-PSS"]: - var hash2, mgf; - hash2 = oids[cert.signatureParameters.mgf.hash.algorithmOid]; - if (hash2 === void 0 || forge.md[hash2] === void 0) { - var error3 = new Error("Unsupported MGF hash function."); - error3.oid = cert.signatureParameters.mgf.hash.algorithmOid; - error3.name = hash2; - throw error3; - } - mgf = oids[cert.signatureParameters.mgf.algorithmOid]; - if (mgf === void 0 || forge.mgf[mgf] === void 0) { - var error3 = new Error("Unsupported MGF function."); - error3.oid = cert.signatureParameters.mgf.algorithmOid; - error3.name = mgf; - throw error3; - } - mgf = forge.mgf[mgf].create(forge.md[hash2].create()); - hash2 = oids[cert.signatureParameters.hash.algorithmOid]; - if (hash2 === void 0 || forge.md[hash2] === void 0) { - var error3 = new Error("Unsupported RSASSA-PSS hash function."); - error3.oid = cert.signatureParameters.hash.algorithmOid; - error3.name = hash2; - throw error3; - } - scheme = forge.pss.create( - forge.md[hash2].create(), - mgf, - cert.signatureParameters.saltLength - ); - break; - } - return cert.publicKey.verify( - options.md.digest().getBytes(), - options.signature, - scheme - ); - }; - pki2.certificateFromPem = function(pem, computeHash, strict) { - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "CERTIFICATE" && msg.type !== "X509 CERTIFICATE" && msg.type !== "TRUSTED CERTIFICATE") { - var error3 = new Error( - 'Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".' - ); - error3.headerType = msg.type; - throw error3; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error( - "Could not convert certificate from PEM; PEM is encrypted." - ); - } - var obj = asn1.fromDer(msg.body, strict); - return pki2.certificateFromAsn1(obj, computeHash); - }; - pki2.certificateToPem = function(cert, maxline) { - var msg = { - type: "CERTIFICATE", - body: asn1.toDer(pki2.certificateToAsn1(cert)).getBytes() - }; - return forge.pem.encode(msg, { maxline }); - }; - pki2.publicKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "PUBLIC KEY" && msg.type !== "RSA PUBLIC KEY") { - var error3 = new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".'); - error3.headerType = msg.type; - throw error3; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert public key from PEM; PEM is encrypted."); - } - var obj = asn1.fromDer(msg.body); - return pki2.publicKeyFromAsn1(obj); - }; - pki2.publicKeyToPem = function(key, maxline) { - var msg = { - type: "PUBLIC KEY", - body: asn1.toDer(pki2.publicKeyToAsn1(key)).getBytes() - }; - return forge.pem.encode(msg, { maxline }); - }; - pki2.publicKeyToRSAPublicKeyPem = function(key, maxline) { - var msg = { - type: "RSA PUBLIC KEY", - body: asn1.toDer(pki2.publicKeyToRSAPublicKey(key)).getBytes() - }; - return forge.pem.encode(msg, { maxline }); - }; - pki2.getPublicKeyFingerprint = function(key, options) { - options = options || {}; - var md2 = options.md || forge.md.sha1.create(); - var type = options.type || "RSAPublicKey"; - var bytes; - switch (type) { - case "RSAPublicKey": - bytes = asn1.toDer(pki2.publicKeyToRSAPublicKey(key)).getBytes(); - break; - case "SubjectPublicKeyInfo": - bytes = asn1.toDer(pki2.publicKeyToAsn1(key)).getBytes(); - break; - default: - throw new Error('Unknown fingerprint type "' + options.type + '".'); - } - md2.start(); - md2.update(bytes); - var digest = md2.digest(); - if (options.encoding === "hex") { - var hex = digest.toHex(); - if (options.delimiter) { - return hex.match(/.{2}/g).join(options.delimiter); - } - return hex; - } else if (options.encoding === "binary") { - return digest.getBytes(); - } else if (options.encoding) { - throw new Error('Unknown encoding "' + options.encoding + '".'); - } - return digest; - }; - pki2.certificationRequestFromPem = function(pem, computeHash, strict) { - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "CERTIFICATE REQUEST") { - var error3 = new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".'); - error3.headerType = msg.type; - throw error3; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert certification request from PEM; PEM is encrypted."); - } - var obj = asn1.fromDer(msg.body, strict); - return pki2.certificationRequestFromAsn1(obj, computeHash); - }; - pki2.certificationRequestToPem = function(csr, maxline) { - var msg = { - type: "CERTIFICATE REQUEST", - body: asn1.toDer(pki2.certificationRequestToAsn1(csr)).getBytes() - }; - return forge.pem.encode(msg, { maxline }); - }; - pki2.createCertificate = function() { - var cert = {}; - cert.version = 2; - cert.serialNumber = "00"; - cert.signatureOid = null; - cert.signature = null; - cert.siginfo = {}; - cert.siginfo.algorithmOid = null; - cert.validity = {}; - cert.validity.notBefore = /* @__PURE__ */ new Date(); - cert.validity.notAfter = /* @__PURE__ */ new Date(); - cert.issuer = {}; - cert.issuer.getField = function(sn) { - return _getAttribute(cert.issuer, sn); - }; - cert.issuer.addField = function(attr) { - _fillMissingFields([attr]); - cert.issuer.attributes.push(attr); - }; - cert.issuer.attributes = []; - cert.issuer.hash = null; - cert.subject = {}; - cert.subject.getField = function(sn) { - return _getAttribute(cert.subject, sn); - }; - cert.subject.addField = function(attr) { - _fillMissingFields([attr]); - cert.subject.attributes.push(attr); - }; - cert.subject.attributes = []; - cert.subject.hash = null; - cert.extensions = []; - cert.publicKey = null; - cert.md = null; - cert.setSubject = function(attrs, uniqueId) { - _fillMissingFields(attrs); - cert.subject.attributes = attrs; - delete cert.subject.uniqueId; - if (uniqueId) { - cert.subject.uniqueId = uniqueId; - } - cert.subject.hash = null; - }; - cert.setIssuer = function(attrs, uniqueId) { - _fillMissingFields(attrs); - cert.issuer.attributes = attrs; - delete cert.issuer.uniqueId; - if (uniqueId) { - cert.issuer.uniqueId = uniqueId; - } - cert.issuer.hash = null; - }; - cert.setExtensions = function(exts) { - for (var i = 0; i < exts.length; ++i) { - _fillMissingExtensionFields(exts[i], { cert }); - } - cert.extensions = exts; - }; - cert.getExtension = function(options) { - if (typeof options === "string") { - options = { name: options }; - } - var rval = null; - var ext2; - for (var i = 0; rval === null && i < cert.extensions.length; ++i) { - ext2 = cert.extensions[i]; - if (options.id && ext2.id === options.id) { - rval = ext2; - } else if (options.name && ext2.name === options.name) { - rval = ext2; - } - } - return rval; - }; - cert.sign = function(key, md2) { - cert.md = md2 || forge.md.sha1.create(); - var algorithmOid = oids[cert.md.algorithm + "WithRSAEncryption"]; - if (!algorithmOid) { - var error3 = new Error("Could not compute certificate digest. Unknown message digest algorithm OID."); - error3.algorithm = cert.md.algorithm; - throw error3; - } - cert.signatureOid = cert.siginfo.algorithmOid = algorithmOid; - cert.tbsCertificate = pki2.getTBSCertificate(cert); - var bytes = asn1.toDer(cert.tbsCertificate); - cert.md.update(bytes.getBytes()); - cert.signature = key.sign(cert.md); - }; - cert.verify = function(child) { - var rval = false; - if (!cert.issued(child)) { - var issuer = child.issuer; - var subject = cert.subject; - var error3 = new Error( - "The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject." - ); - error3.expectedIssuer = subject.attributes; - error3.actualIssuer = issuer.attributes; - throw error3; - } - var md2 = child.md; - if (md2 === null) { - md2 = _createSignatureDigest({ - signatureOid: child.signatureOid, - type: "certificate" - }); - var tbsCertificate = child.tbsCertificate || pki2.getTBSCertificate(child); - var bytes = asn1.toDer(tbsCertificate); - md2.update(bytes.getBytes()); - } - if (md2 !== null) { - rval = _verifySignature({ - certificate: cert, - md: md2, - signature: child.signature - }); - } - return rval; - }; - cert.isIssuer = function(parent) { - var rval = false; - var i = cert.issuer; - var s = parent.subject; - if (i.hash && s.hash) { - rval = i.hash === s.hash; - } else if (i.attributes.length === s.attributes.length) { - rval = true; - var iattr, sattr; - for (var n = 0; rval && n < i.attributes.length; ++n) { - iattr = i.attributes[n]; - sattr = s.attributes[n]; - if (iattr.type !== sattr.type || iattr.value !== sattr.value) { - rval = false; - } - } - } - return rval; - }; - cert.issued = function(child) { - return child.isIssuer(cert); - }; - cert.generateSubjectKeyIdentifier = function() { - return pki2.getPublicKeyFingerprint(cert.publicKey, { type: "RSAPublicKey" }); - }; - cert.verifySubjectKeyIdentifier = function() { - var oid = oids["subjectKeyIdentifier"]; - for (var i = 0; i < cert.extensions.length; ++i) { - var ext2 = cert.extensions[i]; - if (ext2.id === oid) { - var ski = cert.generateSubjectKeyIdentifier().getBytes(); - return forge.util.hexToBytes(ext2.subjectKeyIdentifier) === ski; - } - } - return false; - }; - return cert; - }; - pki2.certificateFromAsn1 = function(obj, computeHash) { - var capture = {}; - var errors = []; - if (!asn1.validate(obj, x509CertificateValidator, capture, errors)) { - var error3 = new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate."); - error3.errors = errors; - throw error3; - } - var oid = asn1.derToOid(capture.publicKeyOid); - if (oid !== pki2.oids.rsaEncryption) { - throw new Error("Cannot read public key. OID is not RSA."); - } - var cert = pki2.createCertificate(); - cert.version = capture.certVersion ? capture.certVersion.charCodeAt(0) : 0; - var serial = forge.util.createBuffer(capture.certSerialNumber); - cert.serialNumber = serial.toHex(); - cert.signatureOid = forge.asn1.derToOid(capture.certSignatureOid); - cert.signatureParameters = _readSignatureParameters( - cert.signatureOid, - capture.certSignatureParams, - true - ); - cert.siginfo.algorithmOid = forge.asn1.derToOid(capture.certinfoSignatureOid); - cert.siginfo.parameters = _readSignatureParameters( - cert.siginfo.algorithmOid, - capture.certinfoSignatureParams, - false - ); - cert.signature = capture.certSignature; - var validity = []; - if (capture.certValidity1UTCTime !== void 0) { - validity.push(asn1.utcTimeToDate(capture.certValidity1UTCTime)); - } - if (capture.certValidity2GeneralizedTime !== void 0) { - validity.push(asn1.generalizedTimeToDate( - capture.certValidity2GeneralizedTime - )); - } - if (capture.certValidity3UTCTime !== void 0) { - validity.push(asn1.utcTimeToDate(capture.certValidity3UTCTime)); - } - if (capture.certValidity4GeneralizedTime !== void 0) { - validity.push(asn1.generalizedTimeToDate( - capture.certValidity4GeneralizedTime - )); - } - if (validity.length > 2) { - throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate."); - } - if (validity.length < 2) { - throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime."); - } - cert.validity.notBefore = validity[0]; - cert.validity.notAfter = validity[1]; - cert.tbsCertificate = capture.tbsCertificate; - if (computeHash) { - cert.md = _createSignatureDigest({ - signatureOid: cert.signatureOid, - type: "certificate" - }); - var bytes = asn1.toDer(cert.tbsCertificate); - cert.md.update(bytes.getBytes()); - } - var imd = forge.md.sha1.create(); - var ibytes = asn1.toDer(capture.certIssuer); - imd.update(ibytes.getBytes()); - cert.issuer.getField = function(sn) { - return _getAttribute(cert.issuer, sn); - }; - cert.issuer.addField = function(attr) { - _fillMissingFields([attr]); - cert.issuer.attributes.push(attr); - }; - cert.issuer.attributes = pki2.RDNAttributesAsArray(capture.certIssuer); - if (capture.certIssuerUniqueId) { - cert.issuer.uniqueId = capture.certIssuerUniqueId; - } - cert.issuer.hash = imd.digest().toHex(); - var smd = forge.md.sha1.create(); - var sbytes = asn1.toDer(capture.certSubject); - smd.update(sbytes.getBytes()); - cert.subject.getField = function(sn) { - return _getAttribute(cert.subject, sn); - }; - cert.subject.addField = function(attr) { - _fillMissingFields([attr]); - cert.subject.attributes.push(attr); - }; - cert.subject.attributes = pki2.RDNAttributesAsArray(capture.certSubject); - if (capture.certSubjectUniqueId) { - cert.subject.uniqueId = capture.certSubjectUniqueId; - } - cert.subject.hash = smd.digest().toHex(); - if (capture.certExtensions) { - cert.extensions = pki2.certificateExtensionsFromAsn1(capture.certExtensions); - } else { - cert.extensions = []; - } - cert.publicKey = pki2.publicKeyFromAsn1(capture.subjectPublicKeyInfo); - return cert; - }; - pki2.certificateExtensionsFromAsn1 = function(exts) { - var rval = []; - for (var i = 0; i < exts.value.length; ++i) { - var extseq = exts.value[i]; - for (var ei = 0; ei < extseq.value.length; ++ei) { - rval.push(pki2.certificateExtensionFromAsn1(extseq.value[ei])); - } - } - return rval; - }; - pki2.certificateExtensionFromAsn1 = function(ext2) { - var e = {}; - e.id = asn1.derToOid(ext2.value[0].value); - e.critical = false; - if (ext2.value[1].type === asn1.Type.BOOLEAN) { - e.critical = ext2.value[1].value.charCodeAt(0) !== 0; - e.value = ext2.value[2].value; - } else { - e.value = ext2.value[1].value; - } - if (e.id in oids) { - e.name = oids[e.id]; - if (e.name === "keyUsage") { - var ev = asn1.fromDer(e.value); - var b2 = 0; - var b3 = 0; - if (ev.value.length > 1) { - b2 = ev.value.charCodeAt(1); - b3 = ev.value.length > 2 ? ev.value.charCodeAt(2) : 0; - } - e.digitalSignature = (b2 & 128) === 128; - e.nonRepudiation = (b2 & 64) === 64; - e.keyEncipherment = (b2 & 32) === 32; - e.dataEncipherment = (b2 & 16) === 16; - e.keyAgreement = (b2 & 8) === 8; - e.keyCertSign = (b2 & 4) === 4; - e.cRLSign = (b2 & 2) === 2; - e.encipherOnly = (b2 & 1) === 1; - e.decipherOnly = (b3 & 128) === 128; - } else if (e.name === "basicConstraints") { - var ev = asn1.fromDer(e.value); - if (ev.value.length > 0 && ev.value[0].type === asn1.Type.BOOLEAN) { - e.cA = ev.value[0].value.charCodeAt(0) !== 0; - } else { - e.cA = false; - } - var value = null; - if (ev.value.length > 0 && ev.value[0].type === asn1.Type.INTEGER) { - value = ev.value[0].value; - } else if (ev.value.length > 1) { - value = ev.value[1].value; - } - if (value !== null) { - e.pathLenConstraint = asn1.derToInteger(value); - } - } else if (e.name === "extKeyUsage") { - var ev = asn1.fromDer(e.value); - for (var vi = 0; vi < ev.value.length; ++vi) { - var oid = asn1.derToOid(ev.value[vi].value); - if (oid in oids) { - e[oids[oid]] = true; - } else { - e[oid] = true; - } - } - } else if (e.name === "nsCertType") { - var ev = asn1.fromDer(e.value); - var b2 = 0; - if (ev.value.length > 1) { - b2 = ev.value.charCodeAt(1); - } - e.client = (b2 & 128) === 128; - e.server = (b2 & 64) === 64; - e.email = (b2 & 32) === 32; - e.objsign = (b2 & 16) === 16; - e.reserved = (b2 & 8) === 8; - e.sslCA = (b2 & 4) === 4; - e.emailCA = (b2 & 2) === 2; - e.objCA = (b2 & 1) === 1; - } else if (e.name === "subjectAltName" || e.name === "issuerAltName") { - e.altNames = []; - var gn; - var ev = asn1.fromDer(e.value); - for (var n = 0; n < ev.value.length; ++n) { - gn = ev.value[n]; - var altName = { - type: gn.type, - value: gn.value - }; - e.altNames.push(altName); - switch (gn.type) { - // rfc822Name - case 1: - // dNSName - case 2: - // uniformResourceIdentifier (URI) - case 6: - break; - // IPAddress - case 7: - altName.ip = forge.util.bytesToIP(gn.value); - break; - // registeredID - case 8: - altName.oid = asn1.derToOid(gn.value); - break; - default: - } - } - } else if (e.name === "subjectKeyIdentifier") { - var ev = asn1.fromDer(e.value); - e.subjectKeyIdentifier = forge.util.bytesToHex(ev.value); - } - } - return e; - }; - pki2.certificationRequestFromAsn1 = function(obj, computeHash) { - var capture = {}; - var errors = []; - if (!asn1.validate(obj, certificationRequestValidator, capture, errors)) { - var error3 = new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest."); - error3.errors = errors; - throw error3; - } - var oid = asn1.derToOid(capture.publicKeyOid); - if (oid !== pki2.oids.rsaEncryption) { - throw new Error("Cannot read public key. OID is not RSA."); - } - var csr = pki2.createCertificationRequest(); - csr.version = capture.csrVersion ? capture.csrVersion.charCodeAt(0) : 0; - csr.signatureOid = forge.asn1.derToOid(capture.csrSignatureOid); - csr.signatureParameters = _readSignatureParameters( - csr.signatureOid, - capture.csrSignatureParams, - true - ); - csr.siginfo.algorithmOid = forge.asn1.derToOid(capture.csrSignatureOid); - csr.siginfo.parameters = _readSignatureParameters( - csr.siginfo.algorithmOid, - capture.csrSignatureParams, - false - ); - csr.signature = capture.csrSignature; - csr.certificationRequestInfo = capture.certificationRequestInfo; - if (computeHash) { - csr.md = _createSignatureDigest({ - signatureOid: csr.signatureOid, - type: "certification request" - }); - var bytes = asn1.toDer(csr.certificationRequestInfo); - csr.md.update(bytes.getBytes()); - } - var smd = forge.md.sha1.create(); - csr.subject.getField = function(sn) { - return _getAttribute(csr.subject, sn); - }; - csr.subject.addField = function(attr) { - _fillMissingFields([attr]); - csr.subject.attributes.push(attr); - }; - csr.subject.attributes = pki2.RDNAttributesAsArray( - capture.certificationRequestInfoSubject, - smd - ); - csr.subject.hash = smd.digest().toHex(); - csr.publicKey = pki2.publicKeyFromAsn1(capture.subjectPublicKeyInfo); - csr.getAttribute = function(sn) { - return _getAttribute(csr, sn); - }; - csr.addAttribute = function(attr) { - _fillMissingFields([attr]); - csr.attributes.push(attr); - }; - csr.attributes = pki2.CRIAttributesAsArray( - capture.certificationRequestInfoAttributes || [] - ); - return csr; - }; - pki2.createCertificationRequest = function() { - var csr = {}; - csr.version = 0; - csr.signatureOid = null; - csr.signature = null; - csr.siginfo = {}; - csr.siginfo.algorithmOid = null; - csr.subject = {}; - csr.subject.getField = function(sn) { - return _getAttribute(csr.subject, sn); - }; - csr.subject.addField = function(attr) { - _fillMissingFields([attr]); - csr.subject.attributes.push(attr); - }; - csr.subject.attributes = []; - csr.subject.hash = null; - csr.publicKey = null; - csr.attributes = []; - csr.getAttribute = function(sn) { - return _getAttribute(csr, sn); - }; - csr.addAttribute = function(attr) { - _fillMissingFields([attr]); - csr.attributes.push(attr); - }; - csr.md = null; - csr.setSubject = function(attrs) { - _fillMissingFields(attrs); - csr.subject.attributes = attrs; - csr.subject.hash = null; - }; - csr.setAttributes = function(attrs) { - _fillMissingFields(attrs); - csr.attributes = attrs; - }; - csr.sign = function(key, md2) { - csr.md = md2 || forge.md.sha1.create(); - var algorithmOid = oids[csr.md.algorithm + "WithRSAEncryption"]; - if (!algorithmOid) { - var error3 = new Error("Could not compute certification request digest. Unknown message digest algorithm OID."); - error3.algorithm = csr.md.algorithm; - throw error3; - } - csr.signatureOid = csr.siginfo.algorithmOid = algorithmOid; - csr.certificationRequestInfo = pki2.getCertificationRequestInfo(csr); - var bytes = asn1.toDer(csr.certificationRequestInfo); - csr.md.update(bytes.getBytes()); - csr.signature = key.sign(csr.md); - }; - csr.verify = function() { - var rval = false; - var md2 = csr.md; - if (md2 === null) { - md2 = _createSignatureDigest({ - signatureOid: csr.signatureOid, - type: "certification request" - }); - var cri = csr.certificationRequestInfo || pki2.getCertificationRequestInfo(csr); - var bytes = asn1.toDer(cri); - md2.update(bytes.getBytes()); - } - if (md2 !== null) { - rval = _verifySignature({ - certificate: csr, - md: md2, - signature: csr.signature - }); - } - return rval; - }; - return csr; - }; - function _dnToAsn1(obj) { - var rval = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [] - ); - var attr, set; - var attrs = obj.attributes; - for (var i = 0; i < attrs.length; ++i) { - attr = attrs[i]; - var value = attr.value; - var valueTagClass = asn1.Type.PRINTABLESTRING; - if ("valueTagClass" in attr) { - valueTagClass = attr.valueTagClass; - if (valueTagClass === asn1.Type.UTF8) { - value = forge.util.encodeUtf8(value); - } - } - set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(attr.type).getBytes() - ), - // AttributeValue - asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value) - ]) - ]); - rval.value.push(set); - } - return rval; - } - function _fillMissingFields(attrs) { - var attr; - for (var i = 0; i < attrs.length; ++i) { - attr = attrs[i]; - if (typeof attr.name === "undefined") { - if (attr.type && attr.type in pki2.oids) { - attr.name = pki2.oids[attr.type]; - } else if (attr.shortName && attr.shortName in _shortNames) { - attr.name = pki2.oids[_shortNames[attr.shortName]]; - } - } - if (typeof attr.type === "undefined") { - if (attr.name && attr.name in pki2.oids) { - attr.type = pki2.oids[attr.name]; - } else { - var error3 = new Error("Attribute type not specified."); - error3.attribute = attr; - throw error3; - } - } - if (typeof attr.shortName === "undefined") { - if (attr.name && attr.name in _shortNames) { - attr.shortName = _shortNames[attr.name]; - } - } - if (attr.type === oids.extensionRequest) { - attr.valueConstructed = true; - attr.valueTagClass = asn1.Type.SEQUENCE; - if (!attr.value && attr.extensions) { - attr.value = []; - for (var ei = 0; ei < attr.extensions.length; ++ei) { - attr.value.push(pki2.certificateExtensionToAsn1( - _fillMissingExtensionFields(attr.extensions[ei]) - )); - } - } - } - if (typeof attr.value === "undefined") { - var error3 = new Error("Attribute value not specified."); - error3.attribute = attr; - throw error3; - } - } - } - function _fillMissingExtensionFields(e, options) { - options = options || {}; - if (typeof e.name === "undefined") { - if (e.id && e.id in pki2.oids) { - e.name = pki2.oids[e.id]; - } - } - if (typeof e.id === "undefined") { - if (e.name && e.name in pki2.oids) { - e.id = pki2.oids[e.name]; - } else { - var error3 = new Error("Extension ID not specified."); - error3.extension = e; - throw error3; - } - } - if (typeof e.value !== "undefined") { - return e; - } - if (e.name === "keyUsage") { - var unused = 0; - var b2 = 0; - var b3 = 0; - if (e.digitalSignature) { - b2 |= 128; - unused = 7; - } - if (e.nonRepudiation) { - b2 |= 64; - unused = 6; - } - if (e.keyEncipherment) { - b2 |= 32; - unused = 5; - } - if (e.dataEncipherment) { - b2 |= 16; - unused = 4; - } - if (e.keyAgreement) { - b2 |= 8; - unused = 3; - } - if (e.keyCertSign) { - b2 |= 4; - unused = 2; - } - if (e.cRLSign) { - b2 |= 2; - unused = 1; - } - if (e.encipherOnly) { - b2 |= 1; - unused = 0; - } - if (e.decipherOnly) { - b3 |= 128; - unused = 7; - } - var value = String.fromCharCode(unused); - if (b3 !== 0) { - value += String.fromCharCode(b2) + String.fromCharCode(b3); - } else if (b2 !== 0) { - value += String.fromCharCode(b2); - } - e.value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BITSTRING, - false, - value - ); - } else if (e.name === "basicConstraints") { - e.value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [] - ); - if (e.cA) { - e.value.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BOOLEAN, - false, - String.fromCharCode(255) - )); - } - if ("pathLenConstraint" in e) { - e.value.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(e.pathLenConstraint).getBytes() - )); - } - } else if (e.name === "extKeyUsage") { - e.value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [] - ); - var seq = e.value.value; - for (var key in e) { - if (e[key] !== true) { - continue; - } - if (key in oids) { - seq.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(oids[key]).getBytes() - )); - } else if (key.indexOf(".") !== -1) { - seq.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(key).getBytes() - )); - } - } - } else if (e.name === "nsCertType") { - var unused = 0; - var b2 = 0; - if (e.client) { - b2 |= 128; - unused = 7; - } - if (e.server) { - b2 |= 64; - unused = 6; - } - if (e.email) { - b2 |= 32; - unused = 5; - } - if (e.objsign) { - b2 |= 16; - unused = 4; - } - if (e.reserved) { - b2 |= 8; - unused = 3; - } - if (e.sslCA) { - b2 |= 4; - unused = 2; - } - if (e.emailCA) { - b2 |= 2; - unused = 1; - } - if (e.objCA) { - b2 |= 1; - unused = 0; - } - var value = String.fromCharCode(unused); - if (b2 !== 0) { - value += String.fromCharCode(b2); - } - e.value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BITSTRING, - false, - value - ); - } else if (e.name === "subjectAltName" || e.name === "issuerAltName") { - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var altName; - for (var n = 0; n < e.altNames.length; ++n) { - altName = e.altNames[n]; - var value = altName.value; - if (altName.type === 7 && altName.ip) { - value = forge.util.bytesFromIP(altName.ip); - if (value === null) { - var error3 = new Error( - 'Extension "ip" value is not a valid IPv4 or IPv6 address.' - ); - error3.extension = e; - throw error3; - } - } else if (altName.type === 8) { - if (altName.oid) { - value = asn1.oidToDer(asn1.oidToDer(altName.oid)); - } else { - value = asn1.oidToDer(value); - } - } - e.value.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, - altName.type, - false, - value - )); - } - } else if (e.name === "nsComment" && options.cert) { - if (!/^[\x00-\x7F]*$/.test(e.comment) || e.comment.length < 1 || e.comment.length > 128) { - throw new Error('Invalid "nsComment" content.'); - } - e.value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.IA5STRING, - false, - e.comment - ); - } else if (e.name === "subjectKeyIdentifier" && options.cert) { - var ski = options.cert.generateSubjectKeyIdentifier(); - e.subjectKeyIdentifier = ski.toHex(); - e.value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - ski.getBytes() - ); - } else if (e.name === "authorityKeyIdentifier" && options.cert) { - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var seq = e.value.value; - if (e.keyIdentifier) { - var keyIdentifier = e.keyIdentifier === true ? options.cert.generateSubjectKeyIdentifier().getBytes() : e.keyIdentifier; - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, false, keyIdentifier) - ); - } - if (e.authorityCertIssuer) { - var authorityCertIssuer = [ - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 4, true, [ - _dnToAsn1(e.authorityCertIssuer === true ? options.cert.issuer : e.authorityCertIssuer) - ]) - ]; - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, authorityCertIssuer) - ); - } - if (e.serialNumber) { - var serialNumber = forge.util.hexToBytes(e.serialNumber === true ? options.cert.serialNumber : e.serialNumber); - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, false, serialNumber) - ); - } - } else if (e.name === "cRLDistributionPoints") { - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var seq = e.value.value; - var subSeq = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [] - ); - var fullNameGeneralNames = asn1.create( - asn1.Class.CONTEXT_SPECIFIC, - 0, - true, - [] - ); - var altName; - for (var n = 0; n < e.altNames.length; ++n) { - altName = e.altNames[n]; - var value = altName.value; - if (altName.type === 7 && altName.ip) { - value = forge.util.bytesFromIP(altName.ip); - if (value === null) { - var error3 = new Error( - 'Extension "ip" value is not a valid IPv4 or IPv6 address.' - ); - error3.extension = e; - throw error3; - } - } else if (altName.type === 8) { - if (altName.oid) { - value = asn1.oidToDer(asn1.oidToDer(altName.oid)); - } else { - value = asn1.oidToDer(value); - } - } - fullNameGeneralNames.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, - altName.type, - false, - value - )); - } - subSeq.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, - 0, - true, - [fullNameGeneralNames] - )); - seq.push(subSeq); - } - if (typeof e.value === "undefined") { - var error3 = new Error("Extension value not specified."); - error3.extension = e; - throw error3; - } - return e; - } - function _signatureParametersToAsn1(oid, params) { - switch (oid) { - case oids["RSASSA-PSS"]: - var parts = []; - if (params.hash.algorithmOid !== void 0) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(params.hash.algorithmOid).getBytes() - ), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]) - ])); - } - if (params.mgf.algorithmOid !== void 0) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(params.mgf.algorithmOid).getBytes() - ), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(params.mgf.hash.algorithmOid).getBytes() - ), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]) - ]) - ])); - } - if (params.saltLength !== void 0) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(params.saltLength).getBytes() - ) - ])); - } - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, parts); - default: - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, ""); - } - } - function _CRIAttributesToAsn1(csr) { - var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []); - if (csr.attributes.length === 0) { - return rval; - } - var attrs = csr.attributes; - for (var i = 0; i < attrs.length; ++i) { - var attr = attrs[i]; - var value = attr.value; - var valueTagClass = asn1.Type.UTF8; - if ("valueTagClass" in attr) { - valueTagClass = attr.valueTagClass; - } - if (valueTagClass === asn1.Type.UTF8) { - value = forge.util.encodeUtf8(value); - } - var valueConstructed = false; - if ("valueConstructed" in attr) { - valueConstructed = attr.valueConstructed; - } - var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(attr.type).getBytes() - ), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - // AttributeValue - asn1.create( - asn1.Class.UNIVERSAL, - valueTagClass, - valueConstructed, - value - ) - ]) - ]); - rval.value.push(seq); - } - return rval; - } - var jan_1_1950 = /* @__PURE__ */ new Date("1950-01-01T00:00:00Z"); - var jan_1_2050 = /* @__PURE__ */ new Date("2050-01-01T00:00:00Z"); - function _dateToAsn1(date) { - if (date >= jan_1_1950 && date < jan_1_2050) { - return asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.UTCTIME, - false, - asn1.dateToUtcTime(date) - ); - } else { - return asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.GENERALIZEDTIME, - false, - asn1.dateToGeneralizedTime(date) - ); - } - } - pki2.getTBSCertificate = function(cert) { - var notBefore = _dateToAsn1(cert.validity.notBefore); - var notAfter = _dateToAsn1(cert.validity.notAfter); - var tbs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // integer - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(cert.version).getBytes() - ) - ]), - // serialNumber - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - forge.util.hexToBytes(cert.serialNumber) - ), - // signature - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(cert.siginfo.algorithmOid).getBytes() - ), - // parameters - _signatureParametersToAsn1( - cert.siginfo.algorithmOid, - cert.siginfo.parameters - ) - ]), - // issuer - _dnToAsn1(cert.issuer), - // validity - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - notBefore, - notAfter - ]), - // subject - _dnToAsn1(cert.subject), - // SubjectPublicKeyInfo - pki2.publicKeyToAsn1(cert.publicKey) - ]); - if (cert.issuer.uniqueId) { - tbs.value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BITSTRING, - false, - // TODO: support arbitrary bit length ids - String.fromCharCode(0) + cert.issuer.uniqueId - ) - ]) - ); - } - if (cert.subject.uniqueId) { - tbs.value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BITSTRING, - false, - // TODO: support arbitrary bit length ids - String.fromCharCode(0) + cert.subject.uniqueId - ) - ]) - ); - } - if (cert.extensions.length > 0) { - tbs.value.push(pki2.certificateExtensionsToAsn1(cert.extensions)); - } - return tbs; - }; - pki2.getCertificationRequestInfo = function(csr) { - var cri = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(csr.version).getBytes() - ), - // subject - _dnToAsn1(csr.subject), - // SubjectPublicKeyInfo - pki2.publicKeyToAsn1(csr.publicKey), - // attributes - _CRIAttributesToAsn1(csr) - ]); - return cri; - }; - pki2.distinguishedNameToAsn1 = function(dn) { - return _dnToAsn1(dn); - }; - pki2.certificateToAsn1 = function(cert) { - var tbsCertificate = cert.tbsCertificate || pki2.getTBSCertificate(cert); - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // TBSCertificate - tbsCertificate, - // AlgorithmIdentifier (signature algorithm) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(cert.signatureOid).getBytes() - ), - // parameters - _signatureParametersToAsn1(cert.signatureOid, cert.signatureParameters) - ]), - // SignatureValue - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BITSTRING, - false, - String.fromCharCode(0) + cert.signature - ) - ]); - }; - pki2.certificateExtensionsToAsn1 = function(exts) { - var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 3, true, []); - var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - rval.value.push(seq); - for (var i = 0; i < exts.length; ++i) { - seq.value.push(pki2.certificateExtensionToAsn1(exts[i])); - } - return rval; - }; - pki2.certificateExtensionToAsn1 = function(ext2) { - var extseq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(ext2.id).getBytes() - )); - if (ext2.critical) { - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BOOLEAN, - false, - String.fromCharCode(255) - )); - } - var value = ext2.value; - if (typeof ext2.value !== "string") { - value = asn1.toDer(value).getBytes(); - } - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - value - )); - return extseq; - }; - pki2.certificationRequestToAsn1 = function(csr) { - var cri = csr.certificationRequestInfo || pki2.getCertificationRequestInfo(csr); - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // CertificationRequestInfo - cri, - // AlgorithmIdentifier (signature algorithm) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(csr.signatureOid).getBytes() - ), - // parameters - _signatureParametersToAsn1(csr.signatureOid, csr.signatureParameters) - ]), - // signature - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BITSTRING, - false, - String.fromCharCode(0) + csr.signature - ) - ]); - }; - pki2.createCaStore = function(certs) { - var caStore = { - // stored certificates - certs: {} - }; - caStore.getIssuer = function(cert2) { - var rval = getBySubject(cert2.issuer); - return rval; - }; - caStore.addCertificate = function(cert2) { - if (typeof cert2 === "string") { - cert2 = forge.pki.certificateFromPem(cert2); - } - ensureSubjectHasHash(cert2.subject); - if (!caStore.hasCertificate(cert2)) { - if (cert2.subject.hash in caStore.certs) { - var tmp = caStore.certs[cert2.subject.hash]; - if (!forge.util.isArray(tmp)) { - tmp = [tmp]; - } - tmp.push(cert2); - caStore.certs[cert2.subject.hash] = tmp; - } else { - caStore.certs[cert2.subject.hash] = cert2; - } - } - }; - caStore.hasCertificate = function(cert2) { - if (typeof cert2 === "string") { - cert2 = forge.pki.certificateFromPem(cert2); - } - var match2 = getBySubject(cert2.subject); - if (!match2) { - return false; - } - if (!forge.util.isArray(match2)) { - match2 = [match2]; - } - var der1 = asn1.toDer(pki2.certificateToAsn1(cert2)).getBytes(); - for (var i2 = 0; i2 < match2.length; ++i2) { - var der2 = asn1.toDer(pki2.certificateToAsn1(match2[i2])).getBytes(); - if (der1 === der2) { - return true; - } - } - return false; - }; - caStore.listAllCertificates = function() { - var certList = []; - for (var hash2 in caStore.certs) { - if (caStore.certs.hasOwnProperty(hash2)) { - var value = caStore.certs[hash2]; - if (!forge.util.isArray(value)) { - certList.push(value); - } else { - for (var i2 = 0; i2 < value.length; ++i2) { - certList.push(value[i2]); - } - } - } - } - return certList; - }; - caStore.removeCertificate = function(cert2) { - var result; - if (typeof cert2 === "string") { - cert2 = forge.pki.certificateFromPem(cert2); - } - ensureSubjectHasHash(cert2.subject); - if (!caStore.hasCertificate(cert2)) { - return null; - } - var match2 = getBySubject(cert2.subject); - if (!forge.util.isArray(match2)) { - result = caStore.certs[cert2.subject.hash]; - delete caStore.certs[cert2.subject.hash]; - return result; - } - var der1 = asn1.toDer(pki2.certificateToAsn1(cert2)).getBytes(); - for (var i2 = 0; i2 < match2.length; ++i2) { - var der2 = asn1.toDer(pki2.certificateToAsn1(match2[i2])).getBytes(); - if (der1 === der2) { - result = match2[i2]; - match2.splice(i2, 1); - } - } - if (match2.length === 0) { - delete caStore.certs[cert2.subject.hash]; - } - return result; - }; - function getBySubject(subject) { - ensureSubjectHasHash(subject); - return caStore.certs[subject.hash] || null; - } - function ensureSubjectHasHash(subject) { - if (!subject.hash) { - var md2 = forge.md.sha1.create(); - subject.attributes = pki2.RDNAttributesAsArray(_dnToAsn1(subject), md2); - subject.hash = md2.digest().toHex(); - } - } - if (certs) { - for (var i = 0; i < certs.length; ++i) { - var cert = certs[i]; - caStore.addCertificate(cert); - } - } - return caStore; - }; - pki2.certificateError = { - bad_certificate: "forge.pki.BadCertificate", - unsupported_certificate: "forge.pki.UnsupportedCertificate", - certificate_revoked: "forge.pki.CertificateRevoked", - certificate_expired: "forge.pki.CertificateExpired", - certificate_unknown: "forge.pki.CertificateUnknown", - unknown_ca: "forge.pki.UnknownCertificateAuthority" - }; - pki2.verifyCertificateChain = function(caStore, chain, options) { - if (typeof options === "function") { - options = { verify: options }; - } - options = options || {}; - chain = chain.slice(0); - var certs = chain.slice(0); - var validityCheckDate = options.validityCheckDate; - if (typeof validityCheckDate === "undefined") { - validityCheckDate = /* @__PURE__ */ new Date(); - } - var first = true; - var error3 = null; - var depth = 0; - do { - var cert = chain.shift(); - var parent = null; - var selfSigned = false; - if (validityCheckDate) { - if (validityCheckDate < cert.validity.notBefore || validityCheckDate > cert.validity.notAfter) { - error3 = { - message: "Certificate is not valid yet or has expired.", - error: pki2.certificateError.certificate_expired, - notBefore: cert.validity.notBefore, - notAfter: cert.validity.notAfter, - // TODO: we might want to reconsider renaming 'now' to - // 'validityCheckDate' should this API be changed in the future. - now: validityCheckDate - }; - } - } - if (error3 === null) { - parent = chain[0] || caStore.getIssuer(cert); - if (parent === null) { - if (cert.isIssuer(cert)) { - selfSigned = true; - parent = cert; - } - } - if (parent) { - var parents = parent; - if (!forge.util.isArray(parents)) { - parents = [parents]; - } - var verified = false; - while (!verified && parents.length > 0) { - parent = parents.shift(); - try { - verified = parent.verify(cert); - } catch (ex) { - } - } - if (!verified) { - error3 = { - message: "Certificate signature is invalid.", - error: pki2.certificateError.bad_certificate - }; - } - } - if (error3 === null && (!parent || selfSigned) && !caStore.hasCertificate(cert)) { - error3 = { - message: "Certificate is not trusted.", - error: pki2.certificateError.unknown_ca - }; - } - } - if (error3 === null && parent && !cert.isIssuer(parent)) { - error3 = { - message: "Certificate issuer is invalid.", - error: pki2.certificateError.bad_certificate - }; - } - if (error3 === null) { - var se = { - keyUsage: true, - basicConstraints: true - }; - for (var i = 0; error3 === null && i < cert.extensions.length; ++i) { - var ext2 = cert.extensions[i]; - if (ext2.critical && !(ext2.name in se)) { - error3 = { - message: "Certificate has an unsupported critical extension.", - error: pki2.certificateError.unsupported_certificate - }; - } - } - } - if (error3 === null && (!first || chain.length === 0 && (!parent || selfSigned))) { - var bcExt = cert.getExtension("basicConstraints"); - var keyUsageExt = cert.getExtension("keyUsage"); - if (keyUsageExt !== null) { - if (!keyUsageExt.keyCertSign || bcExt === null) { - error3 = { - message: "Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.", - error: pki2.certificateError.bad_certificate - }; - } - } - if (error3 === null && bcExt === null) { - error3 = { - message: "Certificate is missing basicConstraints extension and cannot be used as a CA.", - error: pki2.certificateError.bad_certificate - }; - } - if (error3 === null && bcExt !== null && !bcExt.cA) { - error3 = { - message: "Certificate basicConstraints indicates the certificate is not a CA.", - error: pki2.certificateError.bad_certificate - }; - } - if (error3 === null && keyUsageExt !== null && "pathLenConstraint" in bcExt) { - var pathLen = depth - 1; - if (pathLen > bcExt.pathLenConstraint) { - error3 = { - message: "Certificate basicConstraints pathLenConstraint violated.", - error: pki2.certificateError.bad_certificate - }; - } - } - } - var vfd = error3 === null ? true : error3.error; - var ret = options.verify ? options.verify(vfd, depth, certs) : vfd; - if (ret === true) { - error3 = null; - } else { - if (vfd === true) { - error3 = { - message: "The application rejected the certificate.", - error: pki2.certificateError.bad_certificate - }; - } - if (ret || ret === 0) { - if (typeof ret === "object" && !forge.util.isArray(ret)) { - if (ret.message) { - error3.message = ret.message; - } - if (ret.error) { - error3.error = ret.error; - } - } else if (typeof ret === "string") { - error3.error = ret; - } - } - throw error3; - } - first = false; - ++depth; - } while (chain.length > 0); - return true; - }; - } -}); - -// node_modules/node-forge/lib/pkcs12.js -var require_pkcs12 = __commonJS({ - "node_modules/node-forge/lib/pkcs12.js"(exports2, module2) { - var forge = require_forge(); - require_asn1(); - require_hmac(); - require_oids(); - require_pkcs7asn1(); - require_pbe(); - require_random2(); - require_rsa(); - require_sha1(); - require_util16(); - require_x509(); - var asn1 = forge.asn1; - var pki2 = forge.pki; - var p12 = module2.exports = forge.pkcs12 = forge.pkcs12 || {}; - var contentInfoValidator = { - name: "ContentInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - // a ContentInfo - constructed: true, - value: [{ - name: "ContentInfo.contentType", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "contentType" - }, { - name: "ContentInfo.content", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - captureAsn1: "content" - }] - }; - var pfxValidator = { - name: "PFX", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [ - { - name: "PFX.version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "version" - }, - contentInfoValidator, - { - name: "PFX.macData", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: "mac", - value: [{ - name: "PFX.macData.mac", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - // DigestInfo - constructed: true, - value: [{ - name: "PFX.macData.mac.digestAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - // DigestAlgorithmIdentifier - constructed: true, - value: [{ - name: "PFX.macData.mac.digestAlgorithm.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "macAlgorithm" - }, { - name: "PFX.macData.mac.digestAlgorithm.parameters", - optional: true, - tagClass: asn1.Class.UNIVERSAL, - captureAsn1: "macAlgorithmParameters" - }] - }, { - name: "PFX.macData.mac.digest", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "macDigest" - }] - }, { - name: "PFX.macData.macSalt", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "macSalt" - }, { - name: "PFX.macData.iterations", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - optional: true, - capture: "macIterations" - }] - } - ] - }; - var safeBagValidator = { - name: "SafeBag", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "SafeBag.bagId", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "bagId" - }, { - name: "SafeBag.bagValue", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - captureAsn1: "bagValue" - }, { - name: "SafeBag.bagAttributes", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - optional: true, - capture: "bagAttributes" - }] - }; - var attributeValidator = { - name: "Attribute", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "Attribute.attrId", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "oid" - }, { - name: "Attribute.attrValues", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - capture: "values" - }] - }; - var certBagValidator = { - name: "CertBag", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "CertBag.certId", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "certId" - }, { - name: "CertBag.certValue", - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - /* So far we only support X.509 certificates (which are wrapped in - an OCTET STRING, hence hard code that here). */ - value: [{ - name: "CertBag.certValue[0]", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.OCTETSTRING, - constructed: false, - capture: "cert" - }] - }] - }; - function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) { - var result = []; - for (var i = 0; i < safeContents.length; i++) { - for (var j = 0; j < safeContents[i].safeBags.length; j++) { - var bag = safeContents[i].safeBags[j]; - if (bagType !== void 0 && bag.type !== bagType) { - continue; - } - if (attrName === null) { - result.push(bag); - continue; - } - if (bag.attributes[attrName] !== void 0 && bag.attributes[attrName].indexOf(attrValue) >= 0) { - result.push(bag); - } - } - } - return result; - } - p12.pkcs12FromAsn1 = function(obj, strict, password) { - if (typeof strict === "string") { - password = strict; - strict = true; - } else if (strict === void 0) { - strict = true; - } - var capture = {}; - var errors = []; - if (!asn1.validate(obj, pfxValidator, capture, errors)) { - var error3 = new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."); - error3.errors = error3; - throw error3; - } - var pfx = { - version: capture.version.charCodeAt(0), - safeContents: [], - /** - * Gets bags with matching attributes. - * - * @param filter the attributes to filter by: - * [localKeyId] the localKeyId to search for. - * [localKeyIdHex] the localKeyId in hex to search for. - * [friendlyName] the friendly name to search for. - * [bagType] bag type to narrow each attribute search by. - * - * @return a map of attribute type to an array of matching bags or, if no - * attribute was given but a bag type, the map key will be the - * bag type. - */ - getBags: function(filter2) { - var rval = {}; - var localKeyId; - if ("localKeyId" in filter2) { - localKeyId = filter2.localKeyId; - } else if ("localKeyIdHex" in filter2) { - localKeyId = forge.util.hexToBytes(filter2.localKeyIdHex); - } - if (localKeyId === void 0 && !("friendlyName" in filter2) && "bagType" in filter2) { - rval[filter2.bagType] = _getBagsByAttribute( - pfx.safeContents, - null, - null, - filter2.bagType - ); - } - if (localKeyId !== void 0) { - rval.localKeyId = _getBagsByAttribute( - pfx.safeContents, - "localKeyId", - localKeyId, - filter2.bagType - ); - } - if ("friendlyName" in filter2) { - rval.friendlyName = _getBagsByAttribute( - pfx.safeContents, - "friendlyName", - filter2.friendlyName, - filter2.bagType - ); - } - return rval; - }, - /** - * DEPRECATED: use getBags() instead. - * - * Get bags with matching friendlyName attribute. - * - * @param friendlyName the friendly name to search for. - * @param [bagType] bag type to narrow search by. - * - * @return an array of bags with matching friendlyName attribute. - */ - getBagsByFriendlyName: function(friendlyName, bagType) { - return _getBagsByAttribute( - pfx.safeContents, - "friendlyName", - friendlyName, - bagType - ); - }, - /** - * DEPRECATED: use getBags() instead. - * - * Get bags with matching localKeyId attribute. - * - * @param localKeyId the localKeyId to search for. - * @param [bagType] bag type to narrow search by. - * - * @return an array of bags with matching localKeyId attribute. - */ - getBagsByLocalKeyId: function(localKeyId, bagType) { - return _getBagsByAttribute( - pfx.safeContents, - "localKeyId", - localKeyId, - bagType - ); - } - }; - if (capture.version.charCodeAt(0) !== 3) { - var error3 = new Error("PKCS#12 PFX of version other than 3 not supported."); - error3.version = capture.version.charCodeAt(0); - throw error3; - } - if (asn1.derToOid(capture.contentType) !== pki2.oids.data) { - var error3 = new Error("Only PKCS#12 PFX in password integrity mode supported."); - error3.oid = asn1.derToOid(capture.contentType); - throw error3; - } - var data = capture.content.value[0]; - if (data.tagClass !== asn1.Class.UNIVERSAL || data.type !== asn1.Type.OCTETSTRING) { - throw new Error("PKCS#12 authSafe content data is not an OCTET STRING."); - } - data = _decodePkcs7Data(data); - if (capture.mac) { - var md2 = null; - var macKeyBytes = 0; - var macAlgorithm = asn1.derToOid(capture.macAlgorithm); - switch (macAlgorithm) { - case pki2.oids.sha1: - md2 = forge.md.sha1.create(); - macKeyBytes = 20; - break; - case pki2.oids.sha256: - md2 = forge.md.sha256.create(); - macKeyBytes = 32; - break; - case pki2.oids.sha384: - md2 = forge.md.sha384.create(); - macKeyBytes = 48; - break; - case pki2.oids.sha512: - md2 = forge.md.sha512.create(); - macKeyBytes = 64; - break; - case pki2.oids.md5: - md2 = forge.md.md5.create(); - macKeyBytes = 16; - break; - } - if (md2 === null) { - throw new Error("PKCS#12 uses unsupported MAC algorithm: " + macAlgorithm); - } - var macSalt = new forge.util.ByteBuffer(capture.macSalt); - var macIterations = "macIterations" in capture ? parseInt(forge.util.bytesToHex(capture.macIterations), 16) : 1; - var macKey = p12.generateKey( - password, - macSalt, - 3, - macIterations, - macKeyBytes, - md2 - ); - var mac = forge.hmac.create(); - mac.start(md2, macKey); - mac.update(data.value); - var macValue = mac.getMac(); - if (macValue.getBytes() !== capture.macDigest) { - throw new Error("PKCS#12 MAC could not be verified. Invalid password?"); - } - } else if (Array.isArray(obj.value) && obj.value.length > 2) { - throw new Error("Invalid PKCS#12. macData field present but MAC was not validated."); - } - _decodeAuthenticatedSafe(pfx, data.value, strict, password); - return pfx; - }; - function _decodePkcs7Data(data) { - if (data.composed || data.constructed) { - var value = forge.util.createBuffer(); - for (var i = 0; i < data.value.length; ++i) { - value.putBytes(data.value[i].value); - } - data.composed = data.constructed = false; - data.value = value.getBytes(); - } - return data; - } - function _decodeAuthenticatedSafe(pfx, authSafe, strict, password) { - authSafe = asn1.fromDer(authSafe, strict); - if (authSafe.tagClass !== asn1.Class.UNIVERSAL || authSafe.type !== asn1.Type.SEQUENCE || authSafe.constructed !== true) { - throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo"); - } - for (var i = 0; i < authSafe.value.length; i++) { - var contentInfo = authSafe.value[i]; - var capture = {}; - var errors = []; - if (!asn1.validate(contentInfo, contentInfoValidator, capture, errors)) { - var error3 = new Error("Cannot read ContentInfo."); - error3.errors = errors; - throw error3; - } - var obj = { - encrypted: false - }; - var safeContents = null; - var data = capture.content.value[0]; - switch (asn1.derToOid(capture.contentType)) { - case pki2.oids.data: - if (data.tagClass !== asn1.Class.UNIVERSAL || data.type !== asn1.Type.OCTETSTRING) { - throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING."); - } - safeContents = _decodePkcs7Data(data).value; - break; - case pki2.oids.encryptedData: - safeContents = _decryptSafeContents(data, password); - obj.encrypted = true; - break; - default: - var error3 = new Error("Unsupported PKCS#12 contentType."); - error3.contentType = asn1.derToOid(capture.contentType); - throw error3; - } - obj.safeBags = _decodeSafeContents(safeContents, strict, password); - pfx.safeContents.push(obj); - } - } - function _decryptSafeContents(data, password) { - var capture = {}; - var errors = []; - if (!asn1.validate( - data, - forge.pkcs7.asn1.encryptedDataValidator, - capture, - errors - )) { - var error3 = new Error("Cannot read EncryptedContentInfo."); - error3.errors = errors; - throw error3; - } - var oid = asn1.derToOid(capture.contentType); - if (oid !== pki2.oids.data) { - var error3 = new Error( - "PKCS#12 EncryptedContentInfo ContentType is not Data." - ); - error3.oid = oid; - throw error3; - } - oid = asn1.derToOid(capture.encAlgorithm); - var cipher = pki2.pbe.getCipher(oid, capture.encParameter, password); - var encryptedContentAsn1 = _decodePkcs7Data(capture.encryptedContentAsn1); - var encrypted = forge.util.createBuffer(encryptedContentAsn1.value); - cipher.update(encrypted); - if (!cipher.finish()) { - throw new Error("Failed to decrypt PKCS#12 SafeContents."); - } - return cipher.output.getBytes(); - } - function _decodeSafeContents(safeContents, strict, password) { - if (!strict && safeContents.length === 0) { - return []; - } - safeContents = asn1.fromDer(safeContents, strict); - if (safeContents.tagClass !== asn1.Class.UNIVERSAL || safeContents.type !== asn1.Type.SEQUENCE || safeContents.constructed !== true) { - throw new Error( - "PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag." - ); - } - var res = []; - for (var i = 0; i < safeContents.value.length; i++) { - var safeBag = safeContents.value[i]; - var capture = {}; - var errors = []; - if (!asn1.validate(safeBag, safeBagValidator, capture, errors)) { - var error3 = new Error("Cannot read SafeBag."); - error3.errors = errors; - throw error3; - } - var bag = { - type: asn1.derToOid(capture.bagId), - attributes: _decodeBagAttributes(capture.bagAttributes) - }; - res.push(bag); - var validator, decoder; - var bagAsn1 = capture.bagValue.value[0]; - switch (bag.type) { - case pki2.oids.pkcs8ShroudedKeyBag: - bagAsn1 = pki2.decryptPrivateKeyInfo(bagAsn1, password); - if (bagAsn1 === null) { - throw new Error( - "Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?" - ); - } - /* fall through */ - case pki2.oids.keyBag: - try { - bag.key = pki2.privateKeyFromAsn1(bagAsn1); - } catch (e) { - bag.key = null; - bag.asn1 = bagAsn1; - } - continue; - /* Nothing more to do. */ - case pki2.oids.certBag: - validator = certBagValidator; - decoder = function() { - if (asn1.derToOid(capture.certId) !== pki2.oids.x509Certificate) { - var error4 = new Error( - "Unsupported certificate type, only X.509 supported." - ); - error4.oid = asn1.derToOid(capture.certId); - throw error4; - } - var certAsn1 = asn1.fromDer(capture.cert, strict); - try { - bag.cert = pki2.certificateFromAsn1(certAsn1, true); - } catch (e) { - bag.cert = null; - bag.asn1 = certAsn1; - } - }; - break; - default: - var error3 = new Error("Unsupported PKCS#12 SafeBag type."); - error3.oid = bag.type; - throw error3; - } - if (validator !== void 0 && !asn1.validate(bagAsn1, validator, capture, errors)) { - var error3 = new Error("Cannot read PKCS#12 " + validator.name); - error3.errors = errors; - throw error3; - } - decoder(); - } - return res; - } - function _decodeBagAttributes(attributes) { - var decodedAttrs = {}; - if (attributes !== void 0) { - for (var i = 0; i < attributes.length; ++i) { - var capture = {}; - var errors = []; - if (!asn1.validate(attributes[i], attributeValidator, capture, errors)) { - var error3 = new Error("Cannot read PKCS#12 BagAttribute."); - error3.errors = errors; - throw error3; - } - var oid = asn1.derToOid(capture.oid); - if (pki2.oids[oid] === void 0) { - continue; - } - decodedAttrs[pki2.oids[oid]] = []; - for (var j = 0; j < capture.values.length; ++j) { - decodedAttrs[pki2.oids[oid]].push(capture.values[j].value); - } - } - } - return decodedAttrs; - } - p12.toPkcs12Asn1 = function(key, cert, password, options) { - options = options || {}; - options.saltSize = options.saltSize || 8; - options.count = options.count || 2048; - options.algorithm = options.algorithm || options.encAlgorithm || "aes128"; - if (!("useMac" in options)) { - options.useMac = true; - } - if (!("localKeyId" in options)) { - options.localKeyId = null; - } - if (!("generateLocalKeyId" in options)) { - options.generateLocalKeyId = true; - } - var localKeyId = options.localKeyId; - var bagAttrs; - if (localKeyId !== null) { - localKeyId = forge.util.hexToBytes(localKeyId); - } else if (options.generateLocalKeyId) { - if (cert) { - var pairedCert = forge.util.isArray(cert) ? cert[0] : cert; - if (typeof pairedCert === "string") { - pairedCert = pki2.certificateFromPem(pairedCert); - } - var sha1 = forge.md.sha1.create(); - sha1.update(asn1.toDer(pki2.certificateToAsn1(pairedCert)).getBytes()); - localKeyId = sha1.digest().getBytes(); - } else { - localKeyId = forge.random.getBytes(20); - } - } - var attrs = []; - if (localKeyId !== null) { - attrs.push( - // localKeyID - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // attrId - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.localKeyId).getBytes() - ), - // attrValues - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - localKeyId - ) - ]) - ]) - ); - } - if ("friendlyName" in options) { - attrs.push( - // friendlyName - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // attrId - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.friendlyName).getBytes() - ), - // attrValues - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BMPSTRING, - false, - options.friendlyName - ) - ]) - ]) - ); - } - if (attrs.length > 0) { - bagAttrs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, attrs); - } - var contents = []; - var chain = []; - if (cert !== null) { - if (forge.util.isArray(cert)) { - chain = cert; - } else { - chain = [cert]; - } - } - var certSafeBags = []; - for (var i = 0; i < chain.length; ++i) { - cert = chain[i]; - if (typeof cert === "string") { - cert = pki2.certificateFromPem(cert); - } - var certBagAttrs = i === 0 ? bagAttrs : void 0; - var certAsn1 = pki2.certificateToAsn1(cert); - var certSafeBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.certBag).getBytes() - ), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // CertBag - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // certId - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.x509Certificate).getBytes() - ), - // certValue (x509Certificate) - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - asn1.toDer(certAsn1).getBytes() - ) - ]) - ]) - ]), - // bagAttributes (OPTIONAL) - certBagAttrs - ]); - certSafeBags.push(certSafeBag); - } - if (certSafeBags.length > 0) { - var certSafeContents = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - certSafeBags - ); - var certCI = ( - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - // OID for the content type is 'data' - asn1.oidToDer(pki2.oids.data).getBytes() - ), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - asn1.toDer(certSafeContents).getBytes() - ) - ]) - ]) - ); - contents.push(certCI); - } - var keyBag = null; - if (key !== null) { - var pkAsn1 = pki2.wrapRsaPrivateKey(pki2.privateKeyToAsn1(key)); - if (password === null) { - keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.keyBag).getBytes() - ), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // PrivateKeyInfo - pkAsn1 - ]), - // bagAttributes (OPTIONAL) - bagAttrs - ]); - } else { - keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.pkcs8ShroudedKeyBag).getBytes() - ), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // EncryptedPrivateKeyInfo - pki2.encryptPrivateKeyInfo(pkAsn1, password, options) - ]), - // bagAttributes (OPTIONAL) - bagAttrs - ]); - } - var keySafeContents = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [keyBag]); - var keyCI = ( - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - // OID for the content type is 'data' - asn1.oidToDer(pki2.oids.data).getBytes() - ), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - asn1.toDer(keySafeContents).getBytes() - ) - ]) - ]) - ); - contents.push(keyCI); - } - var safe = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - contents - ); - var macData; - if (options.useMac) { - var sha1 = forge.md.sha1.create(); - var macSalt = new forge.util.ByteBuffer( - forge.random.getBytes(options.saltSize) - ); - var count = options.count; - var key = p12.generateKey(password, macSalt, 3, count, 20); - var mac = forge.hmac.create(); - mac.start(sha1, key); - mac.update(asn1.toDer(safe).getBytes()); - var macValue = mac.getMac(); - macData = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // mac DigestInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // digestAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm = SHA-1 - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(pki2.oids.sha1).getBytes() - ), - // parameters = Null - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]), - // digest - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - macValue.getBytes() - ) - ]), - // macSalt OCTET STRING - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - macSalt.getBytes() - ), - // iterations INTEGER (XXX: Only support count < 65536) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(count).getBytes() - ) - ]); - } - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (3) - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(3).getBytes() - ), - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - // OID for the content type is 'data' - asn1.oidToDer(pki2.oids.data).getBytes() - ), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - asn1.toDer(safe).getBytes() - ) - ]) - ]), - macData - ]); - }; - p12.generateKey = forge.pbe.generatePkcs12Key; - } -}); - -// node_modules/node-forge/lib/pki.js -var require_pki = __commonJS({ - "node_modules/node-forge/lib/pki.js"(exports2, module2) { - var forge = require_forge(); - require_asn1(); - require_oids(); - require_pbe(); - require_pem(); - require_pbkdf2(); - require_pkcs12(); - require_pss(); - require_rsa(); - require_util16(); - require_x509(); - var asn1 = forge.asn1; - var pki2 = module2.exports = forge.pki = forge.pki || {}; - pki2.pemToDer = function(pem) { - var msg = forge.pem.decode(pem)[0]; - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert PEM to DER; PEM is encrypted."); - } - return forge.util.createBuffer(msg.body); - }; - pki2.privateKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "PRIVATE KEY" && msg.type !== "RSA PRIVATE KEY") { - var error3 = new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".'); - error3.headerType = msg.type; - throw error3; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert private key from PEM; PEM is encrypted."); - } - var obj = asn1.fromDer(msg.body); - return pki2.privateKeyFromAsn1(obj); - }; - pki2.privateKeyToPem = function(key, maxline) { - var msg = { - type: "RSA PRIVATE KEY", - body: asn1.toDer(pki2.privateKeyToAsn1(key)).getBytes() - }; - return forge.pem.encode(msg, { maxline }); - }; - pki2.privateKeyInfoToPem = function(pki3, maxline) { - var msg = { - type: "PRIVATE KEY", - body: asn1.toDer(pki3).getBytes() - }; - return forge.pem.encode(msg, { maxline }); - }; - } -}); - -// node_modules/node-forge/lib/tls.js -var require_tls = __commonJS({ - "node_modules/node-forge/lib/tls.js"(exports2, module2) { - var forge = require_forge(); - require_asn1(); - require_hmac(); - require_md5(); - require_pem(); - require_pki(); - require_random2(); - require_sha1(); - require_util16(); - var prf_TLS1 = function(secret, label, seed, length) { - var rval = forge.util.createBuffer(); - var idx = secret.length >> 1; - var slen = idx + (secret.length & 1); - var s1 = secret.substr(0, slen); - var s2 = secret.substr(idx, slen); - var ai = forge.util.createBuffer(); - var hmac = forge.hmac.create(); - seed = label + seed; - var md5itr = Math.ceil(length / 16); - var sha1itr = Math.ceil(length / 20); - hmac.start("MD5", s1); - var md5bytes = forge.util.createBuffer(); - ai.putBytes(seed); - for (var i = 0; i < md5itr; ++i) { - hmac.start(null, null); - hmac.update(ai.getBytes()); - ai.putBuffer(hmac.digest()); - hmac.start(null, null); - hmac.update(ai.bytes() + seed); - md5bytes.putBuffer(hmac.digest()); - } - hmac.start("SHA1", s2); - var sha1bytes = forge.util.createBuffer(); - ai.clear(); - ai.putBytes(seed); - for (var i = 0; i < sha1itr; ++i) { - hmac.start(null, null); - hmac.update(ai.getBytes()); - ai.putBuffer(hmac.digest()); - hmac.start(null, null); - hmac.update(ai.bytes() + seed); - sha1bytes.putBuffer(hmac.digest()); - } - rval.putBytes(forge.util.xorBytes( - md5bytes.getBytes(), - sha1bytes.getBytes(), - length - )); - return rval; - }; - var hmac_sha1 = function(key2, seqNum, record) { - var hmac = forge.hmac.create(); - hmac.start("SHA1", key2); - var b = forge.util.createBuffer(); - b.putInt32(seqNum[0]); - b.putInt32(seqNum[1]); - b.putByte(record.type); - b.putByte(record.version.major); - b.putByte(record.version.minor); - b.putInt16(record.length); - b.putBytes(record.fragment.bytes()); - hmac.update(b.getBytes()); - return hmac.digest().getBytes(); - }; - var deflate = function(c, record, s) { - var rval = false; - try { - var bytes = c.deflate(record.fragment.getBytes()); - record.fragment = forge.util.createBuffer(bytes); - record.length = bytes.length; - rval = true; - } catch (ex) { - } - return rval; - }; - var inflate = function(c, record, s) { - var rval = false; - try { - var bytes = c.inflate(record.fragment.getBytes()); - record.fragment = forge.util.createBuffer(bytes); - record.length = bytes.length; - rval = true; - } catch (ex) { - } - return rval; - }; - var readVector = function(b, lenBytes) { - var len = 0; - switch (lenBytes) { - case 1: - len = b.getByte(); - break; - case 2: - len = b.getInt16(); - break; - case 3: - len = b.getInt24(); - break; - case 4: - len = b.getInt32(); - break; - } - return forge.util.createBuffer(b.getBytes(len)); - }; - var writeVector = function(b, lenBytes, v) { - b.putInt(v.length(), lenBytes << 3); - b.putBuffer(v); - }; - var tls = {}; - tls.Versions = { - TLS_1_0: { major: 3, minor: 1 }, - TLS_1_1: { major: 3, minor: 2 }, - TLS_1_2: { major: 3, minor: 3 } - }; - tls.SupportedVersions = [ - tls.Versions.TLS_1_1, - tls.Versions.TLS_1_0 - ]; - tls.Version = tls.SupportedVersions[0]; - tls.MaxFragment = 16384 - 1024; - tls.ConnectionEnd = { - server: 0, - client: 1 - }; - tls.PRFAlgorithm = { - tls_prf_sha256: 0 - }; - tls.BulkCipherAlgorithm = { - none: null, - rc4: 0, - des3: 1, - aes: 2 - }; - tls.CipherType = { - stream: 0, - block: 1, - aead: 2 - }; - tls.MACAlgorithm = { - none: null, - hmac_md5: 0, - hmac_sha1: 1, - hmac_sha256: 2, - hmac_sha384: 3, - hmac_sha512: 4 - }; - tls.CompressionMethod = { - none: 0, - deflate: 1 - }; - tls.ContentType = { - change_cipher_spec: 20, - alert: 21, - handshake: 22, - application_data: 23, - heartbeat: 24 - }; - tls.HandshakeType = { - hello_request: 0, - client_hello: 1, - server_hello: 2, - certificate: 11, - server_key_exchange: 12, - certificate_request: 13, - server_hello_done: 14, - certificate_verify: 15, - client_key_exchange: 16, - finished: 20 - }; - tls.Alert = {}; - tls.Alert.Level = { - warning: 1, - fatal: 2 - }; - tls.Alert.Description = { - close_notify: 0, - unexpected_message: 10, - bad_record_mac: 20, - decryption_failed: 21, - record_overflow: 22, - decompression_failure: 30, - handshake_failure: 40, - bad_certificate: 42, - unsupported_certificate: 43, - certificate_revoked: 44, - certificate_expired: 45, - certificate_unknown: 46, - illegal_parameter: 47, - unknown_ca: 48, - access_denied: 49, - decode_error: 50, - decrypt_error: 51, - export_restriction: 60, - protocol_version: 70, - insufficient_security: 71, - internal_error: 80, - user_canceled: 90, - no_renegotiation: 100 - }; - tls.HeartbeatMessageType = { - heartbeat_request: 1, - heartbeat_response: 2 - }; - tls.CipherSuites = {}; - tls.getCipherSuite = function(twoBytes) { - var rval = null; - for (var key2 in tls.CipherSuites) { - var cs = tls.CipherSuites[key2]; - if (cs.id[0] === twoBytes.charCodeAt(0) && cs.id[1] === twoBytes.charCodeAt(1)) { - rval = cs; - break; - } - } - return rval; - }; - tls.handleUnexpected = function(c, record) { - var ignore = !c.open && c.entity === tls.ConnectionEnd.client; - if (!ignore) { - c.error(c, { - message: "Unexpected message. Received TLS record out of order.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unexpected_message - } - }); - } - }; - tls.handleHelloRequest = function(c, record, length) { - if (!c.handshaking && c.handshakes > 0) { - tls.queue(c, tls.createAlert(c, { - level: tls.Alert.Level.warning, - description: tls.Alert.Description.no_renegotiation - })); - tls.flush(c); - } - c.process(); - }; - tls.parseHelloMessage = function(c, record, length) { - var msg = null; - var client = c.entity === tls.ConnectionEnd.client; - if (length < 38) { - c.error(c, { - message: client ? "Invalid ServerHello message. Message too short." : "Invalid ClientHello message. Message too short.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } else { - var b = record.fragment; - var remaining = b.length(); - msg = { - version: { - major: b.getByte(), - minor: b.getByte() - }, - random: forge.util.createBuffer(b.getBytes(32)), - session_id: readVector(b, 1), - extensions: [] - }; - if (client) { - msg.cipher_suite = b.getBytes(2); - msg.compression_method = b.getByte(); - } else { - msg.cipher_suites = readVector(b, 2); - msg.compression_methods = readVector(b, 1); - } - remaining = length - (remaining - b.length()); - if (remaining > 0) { - var exts = readVector(b, 2); - while (exts.length() > 0) { - msg.extensions.push({ - type: [exts.getByte(), exts.getByte()], - data: readVector(exts, 2) - }); - } - if (!client) { - for (var i = 0; i < msg.extensions.length; ++i) { - var ext2 = msg.extensions[i]; - if (ext2.type[0] === 0 && ext2.type[1] === 0) { - var snl = readVector(ext2.data, 2); - while (snl.length() > 0) { - var snType = snl.getByte(); - if (snType !== 0) { - break; - } - c.session.extensions.server_name.serverNameList.push( - readVector(snl, 2).getBytes() - ); - } - } - } - } - } - if (c.session.version) { - if (msg.version.major !== c.session.version.major || msg.version.minor !== c.session.version.minor) { - return c.error(c, { - message: "TLS version change is disallowed during renegotiation.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - } - if (client) { - c.session.cipherSuite = tls.getCipherSuite(msg.cipher_suite); - } else { - var tmp = forge.util.createBuffer(msg.cipher_suites.bytes()); - while (tmp.length() > 0) { - c.session.cipherSuite = tls.getCipherSuite(tmp.getBytes(2)); - if (c.session.cipherSuite !== null) { - break; - } - } - } - if (c.session.cipherSuite === null) { - return c.error(c, { - message: "No cipher suites in common.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.handshake_failure - }, - cipherSuite: forge.util.bytesToHex(msg.cipher_suite) - }); - } - if (client) { - c.session.compressionMethod = msg.compression_method; - } else { - c.session.compressionMethod = tls.CompressionMethod.none; - } - } - return msg; - }; - tls.createSecurityParameters = function(c, msg) { - var client = c.entity === tls.ConnectionEnd.client; - var msgRandom = msg.random.bytes(); - var cRandom = client ? c.session.sp.client_random : msgRandom; - var sRandom = client ? msgRandom : tls.createRandom().getBytes(); - c.session.sp = { - entity: c.entity, - prf_algorithm: tls.PRFAlgorithm.tls_prf_sha256, - bulk_cipher_algorithm: null, - cipher_type: null, - enc_key_length: null, - block_length: null, - fixed_iv_length: null, - record_iv_length: null, - mac_algorithm: null, - mac_length: null, - mac_key_length: null, - compression_algorithm: c.session.compressionMethod, - pre_master_secret: null, - master_secret: null, - client_random: cRandom, - server_random: sRandom - }; - }; - tls.handleServerHello = function(c, record, length) { - var msg = tls.parseHelloMessage(c, record, length); - if (c.fail) { - return; - } - if (msg.version.minor <= c.version.minor) { - c.version.minor = msg.version.minor; - } else { - return c.error(c, { - message: "Incompatible TLS version.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - c.session.version = c.version; - var sessionId = msg.session_id.bytes(); - if (sessionId.length > 0 && sessionId === c.session.id) { - c.expect = SCC; - c.session.resuming = true; - c.session.sp.server_random = msg.random.bytes(); - } else { - c.expect = SCE; - c.session.resuming = false; - tls.createSecurityParameters(c, msg); - } - c.session.id = sessionId; - c.process(); - }; - tls.handleClientHello = function(c, record, length) { - var msg = tls.parseHelloMessage(c, record, length); - if (c.fail) { - return; - } - var sessionId = msg.session_id.bytes(); - var session = null; - if (c.sessionCache) { - session = c.sessionCache.getSession(sessionId); - if (session === null) { - sessionId = ""; - } else if (session.version.major !== msg.version.major || session.version.minor > msg.version.minor) { - session = null; - sessionId = ""; - } - } - if (sessionId.length === 0) { - sessionId = forge.random.getBytes(32); - } - c.session.id = sessionId; - c.session.clientHelloVersion = msg.version; - c.session.sp = {}; - if (session) { - c.version = c.session.version = session.version; - c.session.sp = session.sp; - } else { - var version; - for (var i = 1; i < tls.SupportedVersions.length; ++i) { - version = tls.SupportedVersions[i]; - if (version.minor <= msg.version.minor) { - break; - } - } - c.version = { major: version.major, minor: version.minor }; - c.session.version = c.version; - } - if (session !== null) { - c.expect = CCC; - c.session.resuming = true; - c.session.sp.client_random = msg.random.bytes(); - } else { - c.expect = c.verifyClient !== false ? CCE : CKE; - c.session.resuming = false; - tls.createSecurityParameters(c, msg); - } - c.open = true; - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerHello(c) - })); - if (c.session.resuming) { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - c.state.pending = tls.createConnectionState(c); - c.state.current.write = c.state.pending.write; - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createFinished(c) - })); - } else { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificate(c) - })); - if (!c.fail) { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerKeyExchange(c) - })); - if (c.verifyClient !== false) { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificateRequest(c) - })); - } - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerHelloDone(c) - })); - } - } - tls.flush(c); - c.process(); - }; - tls.handleCertificate = function(c, record, length) { - if (length < 3) { - return c.error(c, { - message: "Invalid Certificate message. Message too short.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - var b = record.fragment; - var msg = { - certificate_list: readVector(b, 3) - }; - var cert, asn1; - var certs = []; - try { - while (msg.certificate_list.length() > 0) { - cert = readVector(msg.certificate_list, 3); - asn1 = forge.asn1.fromDer(cert); - cert = forge.pki.certificateFromAsn1(asn1, true); - certs.push(cert); - } - } catch (ex) { - return c.error(c, { - message: "Could not parse certificate list.", - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - } - }); - } - var client = c.entity === tls.ConnectionEnd.client; - if ((client || c.verifyClient === true) && certs.length === 0) { - c.error(c, { - message: client ? "No server certificate provided." : "No client certificate provided.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } else if (certs.length === 0) { - c.expect = client ? SKE : CKE; - } else { - if (client) { - c.session.serverCertificate = certs[0]; - } else { - c.session.clientCertificate = certs[0]; - } - if (tls.verifyCertificateChain(c, certs)) { - c.expect = client ? SKE : CKE; - } - } - c.process(); - }; - tls.handleServerKeyExchange = function(c, record, length) { - if (length > 0) { - return c.error(c, { - message: "Invalid key parameters. Only RSA is supported.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unsupported_certificate - } - }); - } - c.expect = SCR; - c.process(); - }; - tls.handleClientKeyExchange = function(c, record, length) { - if (length < 48) { - return c.error(c, { - message: "Invalid key parameters. Only RSA is supported.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unsupported_certificate - } - }); - } - var b = record.fragment; - var msg = { - enc_pre_master_secret: readVector(b, 2).getBytes() - }; - var privateKey = null; - if (c.getPrivateKey) { - try { - privateKey = c.getPrivateKey(c, c.session.serverCertificate); - privateKey = forge.pki.privateKeyFromPem(privateKey); - } catch (ex) { - c.error(c, { - message: "Could not get private key.", - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - } - if (privateKey === null) { - return c.error(c, { - message: "No private key set.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - try { - var sp = c.session.sp; - sp.pre_master_secret = privateKey.decrypt(msg.enc_pre_master_secret); - var version = c.session.clientHelloVersion; - if (version.major !== sp.pre_master_secret.charCodeAt(0) || version.minor !== sp.pre_master_secret.charCodeAt(1)) { - throw new Error("TLS version rollback attack detected."); - } - } catch (ex) { - sp.pre_master_secret = forge.random.getBytes(48); - } - c.expect = CCC; - if (c.session.clientCertificate !== null) { - c.expect = CCV; - } - c.process(); - }; - tls.handleCertificateRequest = function(c, record, length) { - if (length < 3) { - return c.error(c, { - message: "Invalid CertificateRequest. Message too short.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - var b = record.fragment; - var msg = { - certificate_types: readVector(b, 1), - certificate_authorities: readVector(b, 2) - }; - c.session.certificateRequest = msg; - c.expect = SHD; - c.process(); - }; - tls.handleCertificateVerify = function(c, record, length) { - if (length < 2) { - return c.error(c, { - message: "Invalid CertificateVerify. Message too short.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - var b = record.fragment; - b.read -= 4; - var msgBytes = b.bytes(); - b.read += 4; - var msg = { - signature: readVector(b, 2).getBytes() - }; - var verify = forge.util.createBuffer(); - verify.putBuffer(c.session.md5.digest()); - verify.putBuffer(c.session.sha1.digest()); - verify = verify.getBytes(); - try { - var cert = c.session.clientCertificate; - if (!cert.publicKey.verify(verify, msg.signature, "NONE")) { - throw new Error("CertificateVerify signature does not match."); - } - c.session.md5.update(msgBytes); - c.session.sha1.update(msgBytes); - } catch (ex) { - return c.error(c, { - message: "Bad signature in CertificateVerify.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.handshake_failure - } - }); - } - c.expect = CCC; - c.process(); - }; - tls.handleServerHelloDone = function(c, record, length) { - if (length > 0) { - return c.error(c, { - message: "Invalid ServerHelloDone message. Invalid length.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.record_overflow - } - }); - } - if (c.serverCertificate === null) { - var error3 = { - message: "No server certificate provided. Not enough security.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.insufficient_security - } - }; - var depth = 0; - var ret = c.verify(c, error3.alert.description, depth, []); - if (ret !== true) { - if (ret || ret === 0) { - if (typeof ret === "object" && !forge.util.isArray(ret)) { - if (ret.message) { - error3.message = ret.message; - } - if (ret.alert) { - error3.alert.description = ret.alert; - } - } else if (typeof ret === "number") { - error3.alert.description = ret; - } - } - return c.error(c, error3); - } - } - if (c.session.certificateRequest !== null) { - record = tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificate(c) - }); - tls.queue(c, record); - } - record = tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createClientKeyExchange(c) - }); - tls.queue(c, record); - c.expect = SER; - var callback = function(c2, signature) { - if (c2.session.certificateRequest !== null && c2.session.clientCertificate !== null) { - tls.queue(c2, tls.createRecord(c2, { - type: tls.ContentType.handshake, - data: tls.createCertificateVerify(c2, signature) - })); - } - tls.queue(c2, tls.createRecord(c2, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - c2.state.pending = tls.createConnectionState(c2); - c2.state.current.write = c2.state.pending.write; - tls.queue(c2, tls.createRecord(c2, { - type: tls.ContentType.handshake, - data: tls.createFinished(c2) - })); - c2.expect = SCC; - tls.flush(c2); - c2.process(); - }; - if (c.session.certificateRequest === null || c.session.clientCertificate === null) { - return callback(c, null); - } - tls.getClientSignature(c, callback); - }; - tls.handleChangeCipherSpec = function(c, record) { - if (record.fragment.getByte() !== 1) { - return c.error(c, { - message: "Invalid ChangeCipherSpec message received.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - var client = c.entity === tls.ConnectionEnd.client; - if (c.session.resuming && client || !c.session.resuming && !client) { - c.state.pending = tls.createConnectionState(c); - } - c.state.current.read = c.state.pending.read; - if (!c.session.resuming && client || c.session.resuming && !client) { - c.state.pending = null; - } - c.expect = client ? SFI : CFI; - c.process(); - }; - tls.handleFinished = function(c, record, length) { - var b = record.fragment; - b.read -= 4; - var msgBytes = b.bytes(); - b.read += 4; - var vd = record.fragment.getBytes(); - b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - var client = c.entity === tls.ConnectionEnd.client; - var label = client ? "server finished" : "client finished"; - var sp = c.session.sp; - var vdl = 12; - var prf = prf_TLS1; - b = prf(sp.master_secret, label, b.getBytes(), vdl); - if (b.getBytes() !== vd) { - return c.error(c, { - message: "Invalid verify_data in Finished message.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.decrypt_error - } - }); - } - c.session.md5.update(msgBytes); - c.session.sha1.update(msgBytes); - if (c.session.resuming && client || !c.session.resuming && !client) { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - c.state.current.write = c.state.pending.write; - c.state.pending = null; - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createFinished(c) - })); - } - c.expect = client ? SAD : CAD; - c.handshaking = false; - ++c.handshakes; - c.peerCertificate = client ? c.session.serverCertificate : c.session.clientCertificate; - tls.flush(c); - c.isConnected = true; - c.connected(c); - c.process(); - }; - tls.handleAlert = function(c, record) { - var b = record.fragment; - var alert = { - level: b.getByte(), - description: b.getByte() - }; - var msg; - switch (alert.description) { - case tls.Alert.Description.close_notify: - msg = "Connection closed."; - break; - case tls.Alert.Description.unexpected_message: - msg = "Unexpected message."; - break; - case tls.Alert.Description.bad_record_mac: - msg = "Bad record MAC."; - break; - case tls.Alert.Description.decryption_failed: - msg = "Decryption failed."; - break; - case tls.Alert.Description.record_overflow: - msg = "Record overflow."; - break; - case tls.Alert.Description.decompression_failure: - msg = "Decompression failed."; - break; - case tls.Alert.Description.handshake_failure: - msg = "Handshake failure."; - break; - case tls.Alert.Description.bad_certificate: - msg = "Bad certificate."; - break; - case tls.Alert.Description.unsupported_certificate: - msg = "Unsupported certificate."; - break; - case tls.Alert.Description.certificate_revoked: - msg = "Certificate revoked."; - break; - case tls.Alert.Description.certificate_expired: - msg = "Certificate expired."; - break; - case tls.Alert.Description.certificate_unknown: - msg = "Certificate unknown."; - break; - case tls.Alert.Description.illegal_parameter: - msg = "Illegal parameter."; - break; - case tls.Alert.Description.unknown_ca: - msg = "Unknown certificate authority."; - break; - case tls.Alert.Description.access_denied: - msg = "Access denied."; - break; - case tls.Alert.Description.decode_error: - msg = "Decode error."; - break; - case tls.Alert.Description.decrypt_error: - msg = "Decrypt error."; - break; - case tls.Alert.Description.export_restriction: - msg = "Export restriction."; - break; - case tls.Alert.Description.protocol_version: - msg = "Unsupported protocol version."; - break; - case tls.Alert.Description.insufficient_security: - msg = "Insufficient security."; - break; - case tls.Alert.Description.internal_error: - msg = "Internal error."; - break; - case tls.Alert.Description.user_canceled: - msg = "User canceled."; - break; - case tls.Alert.Description.no_renegotiation: - msg = "Renegotiation not supported."; - break; - default: - msg = "Unknown error."; - break; - } - if (alert.description === tls.Alert.Description.close_notify) { - return c.close(); - } - c.error(c, { - message: msg, - send: false, - // origin is the opposite end - origin: c.entity === tls.ConnectionEnd.client ? "server" : "client", - alert - }); - c.process(); - }; - tls.handleHandshake = function(c, record) { - var b = record.fragment; - var type = b.getByte(); - var length = b.getInt24(); - if (length > b.length()) { - c.fragmented = record; - record.fragment = forge.util.createBuffer(); - b.read -= 4; - return c.process(); - } - c.fragmented = null; - b.read -= 4; - var bytes = b.bytes(length + 4); - b.read += 4; - if (type in hsTable[c.entity][c.expect]) { - if (c.entity === tls.ConnectionEnd.server && !c.open && !c.fail) { - c.handshaking = true; - c.session = { - version: null, - extensions: { - server_name: { - serverNameList: [] - } - }, - cipherSuite: null, - compressionMethod: null, - serverCertificate: null, - clientCertificate: null, - md5: forge.md.md5.create(), - sha1: forge.md.sha1.create() - }; - } - if (type !== tls.HandshakeType.hello_request && type !== tls.HandshakeType.certificate_verify && type !== tls.HandshakeType.finished) { - c.session.md5.update(bytes); - c.session.sha1.update(bytes); - } - hsTable[c.entity][c.expect][type](c, record, length); - } else { - tls.handleUnexpected(c, record); - } - }; - tls.handleApplicationData = function(c, record) { - c.data.putBuffer(record.fragment); - c.dataReady(c); - c.process(); - }; - tls.handleHeartbeat = function(c, record) { - var b = record.fragment; - var type = b.getByte(); - var length = b.getInt16(); - var payload = b.getBytes(length); - if (type === tls.HeartbeatMessageType.heartbeat_request) { - if (c.handshaking || length > payload.length) { - return c.process(); - } - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.heartbeat, - data: tls.createHeartbeat( - tls.HeartbeatMessageType.heartbeat_response, - payload - ) - })); - tls.flush(c); - } else if (type === tls.HeartbeatMessageType.heartbeat_response) { - if (payload !== c.expectedHeartbeatPayload) { - return c.process(); - } - if (c.heartbeatReceived) { - c.heartbeatReceived(c, forge.util.createBuffer(payload)); - } - } - c.process(); - }; - var SHE = 0; - var SCE = 1; - var SKE = 2; - var SCR = 3; - var SHD = 4; - var SCC = 5; - var SFI = 6; - var SAD = 7; - var SER = 8; - var CHE = 0; - var CCE = 1; - var CKE = 2; - var CCV = 3; - var CCC = 4; - var CFI = 5; - var CAD = 6; - var __ = tls.handleUnexpected; - var R0 = tls.handleChangeCipherSpec; - var R1 = tls.handleAlert; - var R2 = tls.handleHandshake; - var R3 = tls.handleApplicationData; - var R4 = tls.handleHeartbeat; - var ctTable = []; - ctTable[tls.ConnectionEnd.client] = [ - // CC,AL,HS,AD,HB - /*SHE*/ - [__, R1, R2, __, R4], - /*SCE*/ - [__, R1, R2, __, R4], - /*SKE*/ - [__, R1, R2, __, R4], - /*SCR*/ - [__, R1, R2, __, R4], - /*SHD*/ - [__, R1, R2, __, R4], - /*SCC*/ - [R0, R1, __, __, R4], - /*SFI*/ - [__, R1, R2, __, R4], - /*SAD*/ - [__, R1, R2, R3, R4], - /*SER*/ - [__, R1, R2, __, R4] - ]; - ctTable[tls.ConnectionEnd.server] = [ - // CC,AL,HS,AD - /*CHE*/ - [__, R1, R2, __, R4], - /*CCE*/ - [__, R1, R2, __, R4], - /*CKE*/ - [__, R1, R2, __, R4], - /*CCV*/ - [__, R1, R2, __, R4], - /*CCC*/ - [R0, R1, __, __, R4], - /*CFI*/ - [__, R1, R2, __, R4], - /*CAD*/ - [__, R1, R2, R3, R4], - /*CER*/ - [__, R1, R2, __, R4] - ]; - var H0 = tls.handleHelloRequest; - var H1 = tls.handleServerHello; - var H2 = tls.handleCertificate; - var H3 = tls.handleServerKeyExchange; - var H4 = tls.handleCertificateRequest; - var H5 = tls.handleServerHelloDone; - var H6 = tls.handleFinished; - var hsTable = []; - hsTable[tls.ConnectionEnd.client] = [ - // HR,01,SH,03,04,05,06,07,08,09,10,SC,SK,CR,HD,15,CK,17,18,19,FI - /*SHE*/ - [__, __, H1, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], - /*SCE*/ - [H0, __, __, __, __, __, __, __, __, __, __, H2, H3, H4, H5, __, __, __, __, __, __], - /*SKE*/ - [H0, __, __, __, __, __, __, __, __, __, __, __, H3, H4, H5, __, __, __, __, __, __], - /*SCR*/ - [H0, __, __, __, __, __, __, __, __, __, __, __, __, H4, H5, __, __, __, __, __, __], - /*SHD*/ - [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, H5, __, __, __, __, __, __], - /*SCC*/ - [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], - /*SFI*/ - [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, H6], - /*SAD*/ - [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], - /*SER*/ - [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __] - ]; - var H7 = tls.handleClientHello; - var H8 = tls.handleClientKeyExchange; - var H9 = tls.handleCertificateVerify; - hsTable[tls.ConnectionEnd.server] = [ - // 01,CH,02,03,04,05,06,07,08,09,10,CC,12,13,14,CV,CK,17,18,19,FI - /*CHE*/ - [__, H7, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], - /*CCE*/ - [__, __, __, __, __, __, __, __, __, __, __, H2, __, __, __, __, __, __, __, __, __], - /*CKE*/ - [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, H8, __, __, __, __], - /*CCV*/ - [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, H9, __, __, __, __, __], - /*CCC*/ - [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], - /*CFI*/ - [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, H6], - /*CAD*/ - [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], - /*CER*/ - [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __] - ]; - tls.generateKeys = function(c, sp) { - var prf = prf_TLS1; - var random = sp.client_random + sp.server_random; - if (!c.session.resuming) { - sp.master_secret = prf( - sp.pre_master_secret, - "master secret", - random, - 48 - ).bytes(); - sp.pre_master_secret = null; - } - random = sp.server_random + sp.client_random; - var length = 2 * sp.mac_key_length + 2 * sp.enc_key_length; - var tls10 = c.version.major === tls.Versions.TLS_1_0.major && c.version.minor === tls.Versions.TLS_1_0.minor; - if (tls10) { - length += 2 * sp.fixed_iv_length; - } - var km = prf(sp.master_secret, "key expansion", random, length); - var rval = { - client_write_MAC_key: km.getBytes(sp.mac_key_length), - server_write_MAC_key: km.getBytes(sp.mac_key_length), - client_write_key: km.getBytes(sp.enc_key_length), - server_write_key: km.getBytes(sp.enc_key_length) - }; - if (tls10) { - rval.client_write_IV = km.getBytes(sp.fixed_iv_length); - rval.server_write_IV = km.getBytes(sp.fixed_iv_length); - } - return rval; - }; - tls.createConnectionState = function(c) { - var client = c.entity === tls.ConnectionEnd.client; - var createMode = function() { - var mode = { - // two 32-bit numbers, first is most significant - sequenceNumber: [0, 0], - macKey: null, - macLength: 0, - macFunction: null, - cipherState: null, - cipherFunction: function(record) { - return true; - }, - compressionState: null, - compressFunction: function(record) { - return true; - }, - updateSequenceNumber: function() { - if (mode.sequenceNumber[1] === 4294967295) { - mode.sequenceNumber[1] = 0; - ++mode.sequenceNumber[0]; - } else { - ++mode.sequenceNumber[1]; - } - } - }; - return mode; - }; - var state = { - read: createMode(), - write: createMode() - }; - state.read.update = function(c2, record) { - if (!state.read.cipherFunction(record, state.read)) { - c2.error(c2, { - message: "Could not decrypt record or bad MAC.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - // doesn't matter if decryption failed or MAC was - // invalid, return the same error so as not to reveal - // which one occurred - description: tls.Alert.Description.bad_record_mac - } - }); - } else if (!state.read.compressFunction(c2, record, state.read)) { - c2.error(c2, { - message: "Could not decompress record.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.decompression_failure - } - }); - } - return !c2.fail; - }; - state.write.update = function(c2, record) { - if (!state.write.compressFunction(c2, record, state.write)) { - c2.error(c2, { - message: "Could not compress record.", - send: false, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } else if (!state.write.cipherFunction(record, state.write)) { - c2.error(c2, { - message: "Could not encrypt record.", - send: false, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - return !c2.fail; - }; - if (c.session) { - var sp = c.session.sp; - c.session.cipherSuite.initSecurityParameters(sp); - sp.keys = tls.generateKeys(c, sp); - state.read.macKey = client ? sp.keys.server_write_MAC_key : sp.keys.client_write_MAC_key; - state.write.macKey = client ? sp.keys.client_write_MAC_key : sp.keys.server_write_MAC_key; - c.session.cipherSuite.initConnectionState(state, c, sp); - switch (sp.compression_algorithm) { - case tls.CompressionMethod.none: - break; - case tls.CompressionMethod.deflate: - state.read.compressFunction = inflate; - state.write.compressFunction = deflate; - break; - default: - throw new Error("Unsupported compression algorithm."); - } - } - return state; - }; - tls.createRandom = function() { - var d = /* @__PURE__ */ new Date(); - var utc = +d + d.getTimezoneOffset() * 6e4; - var rval = forge.util.createBuffer(); - rval.putInt32(utc); - rval.putBytes(forge.random.getBytes(28)); - return rval; - }; - tls.createRecord = function(c, options) { - if (!options.data) { - return null; - } - var record = { - type: options.type, - version: { - major: c.version.major, - minor: c.version.minor - }, - length: options.data.length(), - fragment: options.data - }; - return record; - }; - tls.createAlert = function(c, alert) { - var b = forge.util.createBuffer(); - b.putByte(alert.level); - b.putByte(alert.description); - return tls.createRecord(c, { - type: tls.ContentType.alert, - data: b - }); - }; - tls.createClientHello = function(c) { - c.session.clientHelloVersion = { - major: c.version.major, - minor: c.version.minor - }; - var cipherSuites = forge.util.createBuffer(); - for (var i = 0; i < c.cipherSuites.length; ++i) { - var cs = c.cipherSuites[i]; - cipherSuites.putByte(cs.id[0]); - cipherSuites.putByte(cs.id[1]); - } - var cSuites = cipherSuites.length(); - var compressionMethods = forge.util.createBuffer(); - compressionMethods.putByte(tls.CompressionMethod.none); - var cMethods = compressionMethods.length(); - var extensions = forge.util.createBuffer(); - if (c.virtualHost) { - var ext2 = forge.util.createBuffer(); - ext2.putByte(0); - ext2.putByte(0); - var serverName = forge.util.createBuffer(); - serverName.putByte(0); - writeVector(serverName, 2, forge.util.createBuffer(c.virtualHost)); - var snList = forge.util.createBuffer(); - writeVector(snList, 2, serverName); - writeVector(ext2, 2, snList); - extensions.putBuffer(ext2); - } - var extLength = extensions.length(); - if (extLength > 0) { - extLength += 2; - } - var sessionId = c.session.id; - var length = sessionId.length + 1 + // session ID vector - 2 + // version (major + minor) - 4 + 28 + // random time and random bytes - 2 + cSuites + // cipher suites vector - 1 + cMethods + // compression methods vector - extLength; - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.client_hello); - rval.putInt24(length); - rval.putByte(c.version.major); - rval.putByte(c.version.minor); - rval.putBytes(c.session.sp.client_random); - writeVector(rval, 1, forge.util.createBuffer(sessionId)); - writeVector(rval, 2, cipherSuites); - writeVector(rval, 1, compressionMethods); - if (extLength > 0) { - writeVector(rval, 2, extensions); - } - return rval; - }; - tls.createServerHello = function(c) { - var sessionId = c.session.id; - var length = sessionId.length + 1 + // session ID vector - 2 + // version (major + minor) - 4 + 28 + // random time and random bytes - 2 + // chosen cipher suite - 1; - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.server_hello); - rval.putInt24(length); - rval.putByte(c.version.major); - rval.putByte(c.version.minor); - rval.putBytes(c.session.sp.server_random); - writeVector(rval, 1, forge.util.createBuffer(sessionId)); - rval.putByte(c.session.cipherSuite.id[0]); - rval.putByte(c.session.cipherSuite.id[1]); - rval.putByte(c.session.compressionMethod); - return rval; - }; - tls.createCertificate = function(c) { - var client = c.entity === tls.ConnectionEnd.client; - var cert = null; - if (c.getCertificate) { - var hint; - if (client) { - hint = c.session.certificateRequest; - } else { - hint = c.session.extensions.server_name.serverNameList; - } - cert = c.getCertificate(c, hint); - } - var certList = forge.util.createBuffer(); - if (cert !== null) { - try { - if (!forge.util.isArray(cert)) { - cert = [cert]; - } - var asn1 = null; - for (var i = 0; i < cert.length; ++i) { - var msg = forge.pem.decode(cert[i])[0]; - if (msg.type !== "CERTIFICATE" && msg.type !== "X509 CERTIFICATE" && msg.type !== "TRUSTED CERTIFICATE") { - var error3 = new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'); - error3.headerType = msg.type; - throw error3; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert certificate from PEM; PEM is encrypted."); - } - var der = forge.util.createBuffer(msg.body); - if (asn1 === null) { - asn1 = forge.asn1.fromDer(der.bytes(), false); - } - var certBuffer = forge.util.createBuffer(); - writeVector(certBuffer, 3, der); - certList.putBuffer(certBuffer); - } - cert = forge.pki.certificateFromAsn1(asn1); - if (client) { - c.session.clientCertificate = cert; - } else { - c.session.serverCertificate = cert; - } - } catch (ex) { - return c.error(c, { - message: "Could not send certificate list.", - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - } - }); - } - } - var length = 3 + certList.length(); - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate); - rval.putInt24(length); - writeVector(rval, 3, certList); - return rval; - }; - tls.createClientKeyExchange = function(c) { - var b = forge.util.createBuffer(); - b.putByte(c.session.clientHelloVersion.major); - b.putByte(c.session.clientHelloVersion.minor); - b.putBytes(forge.random.getBytes(46)); - var sp = c.session.sp; - sp.pre_master_secret = b.getBytes(); - var key2 = c.session.serverCertificate.publicKey; - b = key2.encrypt(sp.pre_master_secret); - var length = b.length + 2; - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.client_key_exchange); - rval.putInt24(length); - rval.putInt16(b.length); - rval.putBytes(b); - return rval; - }; - tls.createServerKeyExchange = function(c) { - var length = 0; - var rval = forge.util.createBuffer(); - if (length > 0) { - rval.putByte(tls.HandshakeType.server_key_exchange); - rval.putInt24(length); - } - return rval; - }; - tls.getClientSignature = function(c, callback) { - var b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - b = b.getBytes(); - c.getSignature = c.getSignature || function(c2, b2, callback2) { - var privateKey = null; - if (c2.getPrivateKey) { - try { - privateKey = c2.getPrivateKey(c2, c2.session.clientCertificate); - privateKey = forge.pki.privateKeyFromPem(privateKey); - } catch (ex) { - c2.error(c2, { - message: "Could not get private key.", - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - } - if (privateKey === null) { - c2.error(c2, { - message: "No private key set.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } else { - b2 = privateKey.sign(b2, null); - } - callback2(c2, b2); - }; - c.getSignature(c, b, callback); - }; - tls.createCertificateVerify = function(c, signature) { - var length = signature.length + 2; - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate_verify); - rval.putInt24(length); - rval.putInt16(signature.length); - rval.putBytes(signature); - return rval; - }; - tls.createCertificateRequest = function(c) { - var certTypes = forge.util.createBuffer(); - certTypes.putByte(1); - var cAs = forge.util.createBuffer(); - for (var key2 in c.caStore.certs) { - var cert = c.caStore.certs[key2]; - var dn = forge.pki.distinguishedNameToAsn1(cert.subject); - var byteBuffer = forge.asn1.toDer(dn); - cAs.putInt16(byteBuffer.length()); - cAs.putBuffer(byteBuffer); - } - var length = 1 + certTypes.length() + 2 + cAs.length(); - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate_request); - rval.putInt24(length); - writeVector(rval, 1, certTypes); - writeVector(rval, 2, cAs); - return rval; - }; - tls.createServerHelloDone = function(c) { - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.server_hello_done); - rval.putInt24(0); - return rval; - }; - tls.createChangeCipherSpec = function() { - var rval = forge.util.createBuffer(); - rval.putByte(1); - return rval; - }; - tls.createFinished = function(c) { - var b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - var client = c.entity === tls.ConnectionEnd.client; - var sp = c.session.sp; - var vdl = 12; - var prf = prf_TLS1; - var label = client ? "client finished" : "server finished"; - b = prf(sp.master_secret, label, b.getBytes(), vdl); - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.finished); - rval.putInt24(b.length()); - rval.putBuffer(b); - return rval; - }; - tls.createHeartbeat = function(type, payload, payloadLength) { - if (typeof payloadLength === "undefined") { - payloadLength = payload.length; - } - var rval = forge.util.createBuffer(); - rval.putByte(type); - rval.putInt16(payloadLength); - rval.putBytes(payload); - var plaintextLength = rval.length(); - var paddingLength = Math.max(16, plaintextLength - payloadLength - 3); - rval.putBytes(forge.random.getBytes(paddingLength)); - return rval; - }; - tls.queue = function(c, record) { - if (!record) { - return; - } - if (record.fragment.length() === 0) { - if (record.type === tls.ContentType.handshake || record.type === tls.ContentType.alert || record.type === tls.ContentType.change_cipher_spec) { - return; - } - } - if (record.type === tls.ContentType.handshake) { - var bytes = record.fragment.bytes(); - c.session.md5.update(bytes); - c.session.sha1.update(bytes); - bytes = null; - } - var records; - if (record.fragment.length() <= tls.MaxFragment) { - records = [record]; - } else { - records = []; - var data = record.fragment.bytes(); - while (data.length > tls.MaxFragment) { - records.push(tls.createRecord(c, { - type: record.type, - data: forge.util.createBuffer(data.slice(0, tls.MaxFragment)) - })); - data = data.slice(tls.MaxFragment); - } - if (data.length > 0) { - records.push(tls.createRecord(c, { - type: record.type, - data: forge.util.createBuffer(data) - })); - } - } - for (var i = 0; i < records.length && !c.fail; ++i) { - var rec = records[i]; - var s = c.state.current.write; - if (s.update(c, rec)) { - c.records.push(rec); - } - } - }; - tls.flush = function(c) { - for (var i = 0; i < c.records.length; ++i) { - var record = c.records[i]; - c.tlsData.putByte(record.type); - c.tlsData.putByte(record.version.major); - c.tlsData.putByte(record.version.minor); - c.tlsData.putInt16(record.fragment.length()); - c.tlsData.putBuffer(c.records[i].fragment); - } - c.records = []; - return c.tlsDataReady(c); - }; - var _certErrorToAlertDesc = function(error3) { - switch (error3) { - case true: - return true; - case forge.pki.certificateError.bad_certificate: - return tls.Alert.Description.bad_certificate; - case forge.pki.certificateError.unsupported_certificate: - return tls.Alert.Description.unsupported_certificate; - case forge.pki.certificateError.certificate_revoked: - return tls.Alert.Description.certificate_revoked; - case forge.pki.certificateError.certificate_expired: - return tls.Alert.Description.certificate_expired; - case forge.pki.certificateError.certificate_unknown: - return tls.Alert.Description.certificate_unknown; - case forge.pki.certificateError.unknown_ca: - return tls.Alert.Description.unknown_ca; - default: - return tls.Alert.Description.bad_certificate; - } - }; - var _alertDescToCertError = function(desc) { - switch (desc) { - case true: - return true; - case tls.Alert.Description.bad_certificate: - return forge.pki.certificateError.bad_certificate; - case tls.Alert.Description.unsupported_certificate: - return forge.pki.certificateError.unsupported_certificate; - case tls.Alert.Description.certificate_revoked: - return forge.pki.certificateError.certificate_revoked; - case tls.Alert.Description.certificate_expired: - return forge.pki.certificateError.certificate_expired; - case tls.Alert.Description.certificate_unknown: - return forge.pki.certificateError.certificate_unknown; - case tls.Alert.Description.unknown_ca: - return forge.pki.certificateError.unknown_ca; - default: - return forge.pki.certificateError.bad_certificate; - } - }; - tls.verifyCertificateChain = function(c, chain) { - try { - var options = {}; - for (var key2 in c.verifyOptions) { - options[key2] = c.verifyOptions[key2]; - } - options.verify = function(vfd, depth, chain2) { - var desc = _certErrorToAlertDesc(vfd); - var ret = c.verify(c, vfd, depth, chain2); - if (ret !== true) { - if (typeof ret === "object" && !forge.util.isArray(ret)) { - var error3 = new Error("The application rejected the certificate."); - error3.send = true; - error3.alert = { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - }; - if (ret.message) { - error3.message = ret.message; - } - if (ret.alert) { - error3.alert.description = ret.alert; - } - throw error3; - } - if (ret !== vfd) { - ret = _alertDescToCertError(ret); - } - } - return ret; - }; - forge.pki.verifyCertificateChain(c.caStore, chain, options); - } catch (ex) { - var err = ex; - if (typeof err !== "object" || forge.util.isArray(err)) { - err = { - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: _certErrorToAlertDesc(ex) - } - }; - } - if (!("send" in err)) { - err.send = true; - } - if (!("alert" in err)) { - err.alert = { - level: tls.Alert.Level.fatal, - description: _certErrorToAlertDesc(err.error) - }; - } - c.error(c, err); - } - return !c.fail; - }; - tls.createSessionCache = function(cache, capacity) { - var rval = null; - if (cache && cache.getSession && cache.setSession && cache.order) { - rval = cache; - } else { - rval = {}; - rval.cache = cache || {}; - rval.capacity = Math.max(capacity || 100, 1); - rval.order = []; - for (var key2 in cache) { - if (rval.order.length <= capacity) { - rval.order.push(key2); - } else { - delete cache[key2]; - } - } - rval.getSession = function(sessionId) { - var session = null; - var key3 = null; - if (sessionId) { - key3 = forge.util.bytesToHex(sessionId); - } else if (rval.order.length > 0) { - key3 = rval.order[0]; - } - if (key3 !== null && key3 in rval.cache) { - session = rval.cache[key3]; - delete rval.cache[key3]; - for (var i in rval.order) { - if (rval.order[i] === key3) { - rval.order.splice(i, 1); - break; - } - } - } - return session; - }; - rval.setSession = function(sessionId, session) { - if (rval.order.length === rval.capacity) { - var key3 = rval.order.shift(); - delete rval.cache[key3]; - } - var key3 = forge.util.bytesToHex(sessionId); - rval.order.push(key3); - rval.cache[key3] = session; - }; - } - return rval; - }; - tls.createConnection = function(options) { - var caStore = null; - if (options.caStore) { - if (forge.util.isArray(options.caStore)) { - caStore = forge.pki.createCaStore(options.caStore); - } else { - caStore = options.caStore; - } - } else { - caStore = forge.pki.createCaStore(); - } - var cipherSuites = options.cipherSuites || null; - if (cipherSuites === null) { - cipherSuites = []; - for (var key2 in tls.CipherSuites) { - cipherSuites.push(tls.CipherSuites[key2]); - } - } - var entity = options.server || false ? tls.ConnectionEnd.server : tls.ConnectionEnd.client; - var sessionCache = options.sessionCache ? tls.createSessionCache(options.sessionCache) : null; - var c = { - version: { major: tls.Version.major, minor: tls.Version.minor }, - entity, - sessionId: options.sessionId, - caStore, - sessionCache, - cipherSuites, - connected: options.connected, - virtualHost: options.virtualHost || null, - verifyClient: options.verifyClient || false, - verify: options.verify || function(cn, vfd, dpth, cts) { - return vfd; - }, - verifyOptions: options.verifyOptions || {}, - getCertificate: options.getCertificate || null, - getPrivateKey: options.getPrivateKey || null, - getSignature: options.getSignature || null, - input: forge.util.createBuffer(), - tlsData: forge.util.createBuffer(), - data: forge.util.createBuffer(), - tlsDataReady: options.tlsDataReady, - dataReady: options.dataReady, - heartbeatReceived: options.heartbeatReceived, - closed: options.closed, - error: function(c2, ex) { - ex.origin = ex.origin || (c2.entity === tls.ConnectionEnd.client ? "client" : "server"); - if (ex.send) { - tls.queue(c2, tls.createAlert(c2, ex.alert)); - tls.flush(c2); - } - var fatal = ex.fatal !== false; - if (fatal) { - c2.fail = true; - } - options.error(c2, ex); - if (fatal) { - c2.close(false); - } - }, - deflate: options.deflate || null, - inflate: options.inflate || null - }; - c.reset = function(clearFail) { - c.version = { major: tls.Version.major, minor: tls.Version.minor }; - c.record = null; - c.session = null; - c.peerCertificate = null; - c.state = { - pending: null, - current: null - }; - c.expect = c.entity === tls.ConnectionEnd.client ? SHE : CHE; - c.fragmented = null; - c.records = []; - c.open = false; - c.handshakes = 0; - c.handshaking = false; - c.isConnected = false; - c.fail = !(clearFail || typeof clearFail === "undefined"); - c.input.clear(); - c.tlsData.clear(); - c.data.clear(); - c.state.current = tls.createConnectionState(c); - }; - c.reset(); - var _update = function(c2, record) { - var aligned = record.type - tls.ContentType.change_cipher_spec; - var handlers = ctTable[c2.entity][c2.expect]; - if (aligned in handlers) { - handlers[aligned](c2, record); - } else { - tls.handleUnexpected(c2, record); - } - }; - var _readRecordHeader = function(c2) { - var rval = 0; - var b = c2.input; - var len = b.length(); - if (len < 5) { - rval = 5 - len; - } else { - c2.record = { - type: b.getByte(), - version: { - major: b.getByte(), - minor: b.getByte() - }, - length: b.getInt16(), - fragment: forge.util.createBuffer(), - ready: false - }; - var compatibleVersion = c2.record.version.major === c2.version.major; - if (compatibleVersion && c2.session && c2.session.version) { - compatibleVersion = c2.record.version.minor === c2.version.minor; - } - if (!compatibleVersion) { - c2.error(c2, { - message: "Incompatible TLS version.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - } - return rval; - }; - var _readRecord = function(c2) { - var rval = 0; - var b = c2.input; - var len = b.length(); - if (len < c2.record.length) { - rval = c2.record.length - len; - } else { - c2.record.fragment.putBytes(b.getBytes(c2.record.length)); - b.compact(); - var s = c2.state.current.read; - if (s.update(c2, c2.record)) { - if (c2.fragmented !== null) { - if (c2.fragmented.type === c2.record.type) { - c2.fragmented.fragment.putBuffer(c2.record.fragment); - c2.record = c2.fragmented; - } else { - c2.error(c2, { - message: "Invalid fragmented record.", - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unexpected_message - } - }); - } - } - c2.record.ready = true; - } - } - return rval; - }; - c.handshake = function(sessionId) { - if (c.entity !== tls.ConnectionEnd.client) { - c.error(c, { - message: "Cannot initiate handshake as a server.", - fatal: false - }); - } else if (c.handshaking) { - c.error(c, { - message: "Handshake already in progress.", - fatal: false - }); - } else { - if (c.fail && !c.open && c.handshakes === 0) { - c.fail = false; - } - c.handshaking = true; - sessionId = sessionId || ""; - var session = null; - if (sessionId.length > 0) { - if (c.sessionCache) { - session = c.sessionCache.getSession(sessionId); - } - if (session === null) { - sessionId = ""; - } - } - if (sessionId.length === 0 && c.sessionCache) { - session = c.sessionCache.getSession(); - if (session !== null) { - sessionId = session.id; - } - } - c.session = { - id: sessionId, - version: null, - cipherSuite: null, - compressionMethod: null, - serverCertificate: null, - certificateRequest: null, - clientCertificate: null, - sp: {}, - md5: forge.md.md5.create(), - sha1: forge.md.sha1.create() - }; - if (session) { - c.version = session.version; - c.session.sp = session.sp; - } - c.session.sp.client_random = tls.createRandom().getBytes(); - c.open = true; - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createClientHello(c) - })); - tls.flush(c); - } - }; - c.process = function(data) { - var rval = 0; - if (data) { - c.input.putBytes(data); - } - if (!c.fail) { - if (c.record !== null && c.record.ready && c.record.fragment.isEmpty()) { - c.record = null; - } - if (c.record === null) { - rval = _readRecordHeader(c); - } - if (!c.fail && c.record !== null && !c.record.ready) { - rval = _readRecord(c); - } - if (!c.fail && c.record !== null && c.record.ready) { - _update(c, c.record); - } - } - return rval; - }; - c.prepare = function(data) { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.application_data, - data: forge.util.createBuffer(data) - })); - return tls.flush(c); - }; - c.prepareHeartbeatRequest = function(payload, payloadLength) { - if (payload instanceof forge.util.ByteBuffer) { - payload = payload.bytes(); - } - if (typeof payloadLength === "undefined") { - payloadLength = payload.length; - } - c.expectedHeartbeatPayload = payload; - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.heartbeat, - data: tls.createHeartbeat( - tls.HeartbeatMessageType.heartbeat_request, - payload, - payloadLength - ) - })); - return tls.flush(c); - }; - c.close = function(clearFail) { - if (!c.fail && c.sessionCache && c.session) { - var session = { - id: c.session.id, - version: c.session.version, - sp: c.session.sp - }; - session.sp.keys = null; - c.sessionCache.setSession(session.id, session); - } - if (c.open) { - c.open = false; - c.input.clear(); - if (c.isConnected || c.handshaking) { - c.isConnected = c.handshaking = false; - tls.queue(c, tls.createAlert(c, { - level: tls.Alert.Level.warning, - description: tls.Alert.Description.close_notify - })); - tls.flush(c); - } - c.closed(c); - } - c.reset(clearFail); - }; - return c; - }; - module2.exports = forge.tls = forge.tls || {}; - for (key in tls) { - if (typeof tls[key] !== "function") { - forge.tls[key] = tls[key]; - } - } - var key; - forge.tls.prf_tls1 = prf_TLS1; - forge.tls.hmac_sha1 = hmac_sha1; - forge.tls.createSessionCache = tls.createSessionCache; - forge.tls.createConnection = tls.createConnection; - } -}); - -// node_modules/node-forge/lib/aesCipherSuites.js -var require_aesCipherSuites = __commonJS({ - "node_modules/node-forge/lib/aesCipherSuites.js"(exports2, module2) { - var forge = require_forge(); - require_aes(); - require_tls(); - var tls = module2.exports = forge.tls; - tls.CipherSuites["TLS_RSA_WITH_AES_128_CBC_SHA"] = { - id: [0, 47], - name: "TLS_RSA_WITH_AES_128_CBC_SHA", - initSecurityParameters: function(sp) { - sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; - sp.cipher_type = tls.CipherType.block; - sp.enc_key_length = 16; - sp.block_length = 16; - sp.fixed_iv_length = 16; - sp.record_iv_length = 16; - sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; - sp.mac_length = 20; - sp.mac_key_length = 20; - }, - initConnectionState - }; - tls.CipherSuites["TLS_RSA_WITH_AES_256_CBC_SHA"] = { - id: [0, 53], - name: "TLS_RSA_WITH_AES_256_CBC_SHA", - initSecurityParameters: function(sp) { - sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; - sp.cipher_type = tls.CipherType.block; - sp.enc_key_length = 32; - sp.block_length = 16; - sp.fixed_iv_length = 16; - sp.record_iv_length = 16; - sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; - sp.mac_length = 20; - sp.mac_key_length = 20; - }, - initConnectionState - }; - function initConnectionState(state, c, sp) { - var client = c.entity === forge.tls.ConnectionEnd.client; - state.read.cipherState = { - init: false, - cipher: forge.cipher.createDecipher("AES-CBC", client ? sp.keys.server_write_key : sp.keys.client_write_key), - iv: client ? sp.keys.server_write_IV : sp.keys.client_write_IV - }; - state.write.cipherState = { - init: false, - cipher: forge.cipher.createCipher("AES-CBC", client ? sp.keys.client_write_key : sp.keys.server_write_key), - iv: client ? sp.keys.client_write_IV : sp.keys.server_write_IV - }; - state.read.cipherFunction = decrypt_aes_cbc_sha1; - state.write.cipherFunction = encrypt_aes_cbc_sha1; - state.read.macLength = state.write.macLength = sp.mac_length; - state.read.macFunction = state.write.macFunction = tls.hmac_sha1; - } - function encrypt_aes_cbc_sha1(record, s) { - var rval = false; - var mac = s.macFunction(s.macKey, s.sequenceNumber, record); - record.fragment.putBytes(mac); - s.updateSequenceNumber(); - var iv; - if (record.version.minor === tls.Versions.TLS_1_0.minor) { - iv = s.cipherState.init ? null : s.cipherState.iv; - } else { - iv = forge.random.getBytesSync(16); - } - s.cipherState.init = true; - var cipher = s.cipherState.cipher; - cipher.start({ iv }); - if (record.version.minor >= tls.Versions.TLS_1_1.minor) { - cipher.output.putBytes(iv); - } - cipher.update(record.fragment); - if (cipher.finish(encrypt_aes_cbc_sha1_padding)) { - record.fragment = cipher.output; - record.length = record.fragment.length(); - rval = true; - } - return rval; - } - function encrypt_aes_cbc_sha1_padding(blockSize, input, decrypt) { - if (!decrypt) { - var padding = blockSize - input.length() % blockSize; - input.fillWithByte(padding - 1, padding); - } - return true; - } - function decrypt_aes_cbc_sha1_padding(blockSize, output, decrypt) { - var rval = true; - if (decrypt) { - var len = output.length(); - var paddingLength = output.last(); - for (var i = len - 1 - paddingLength; i < len - 1; ++i) { - rval = rval && output.at(i) == paddingLength; - } - if (rval) { - output.truncate(paddingLength + 1); - } - } - return rval; - } - function decrypt_aes_cbc_sha1(record, s) { - var rval = false; - var iv; - if (record.version.minor === tls.Versions.TLS_1_0.minor) { - iv = s.cipherState.init ? null : s.cipherState.iv; - } else { - iv = record.fragment.getBytes(16); - } - s.cipherState.init = true; - var cipher = s.cipherState.cipher; - cipher.start({ iv }); - cipher.update(record.fragment); - rval = cipher.finish(decrypt_aes_cbc_sha1_padding); - var macLen = s.macLength; - var mac = forge.random.getBytesSync(macLen); - var len = cipher.output.length(); - if (len >= macLen) { - record.fragment = cipher.output.getBytes(len - macLen); - mac = cipher.output.getBytes(macLen); - } else { - record.fragment = cipher.output.getBytes(); - } - record.fragment = forge.util.createBuffer(record.fragment); - record.length = record.fragment.length(); - var mac2 = s.macFunction(s.macKey, s.sequenceNumber, record); - s.updateSequenceNumber(); - rval = compareMacs(s.macKey, mac, mac2) && rval; - return rval; - } - function compareMacs(key, mac1, mac2) { - var hmac = forge.hmac.create(); - hmac.start("SHA1", key); - hmac.update(mac1); - mac1 = hmac.digest().getBytes(); - hmac.start(null, null); - hmac.update(mac2); - mac2 = hmac.digest().getBytes(); - return mac1 === mac2; - } - } -}); - -// node_modules/node-forge/lib/sha512.js -var require_sha512 = __commonJS({ - "node_modules/node-forge/lib/sha512.js"(exports2, module2) { - var forge = require_forge(); - require_md(); - require_util16(); - var sha512 = module2.exports = forge.sha512 = forge.sha512 || {}; - forge.md.sha512 = forge.md.algorithms.sha512 = sha512; - var sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {}; - sha384.create = function() { - return sha512.create("SHA-384"); - }; - forge.md.sha384 = forge.md.algorithms.sha384 = sha384; - forge.sha512.sha256 = forge.sha512.sha256 || { - create: function() { - return sha512.create("SHA-512/256"); - } - }; - forge.md["sha512/256"] = forge.md.algorithms["sha512/256"] = forge.sha512.sha256; - forge.sha512.sha224 = forge.sha512.sha224 || { - create: function() { - return sha512.create("SHA-512/224"); - } - }; - forge.md["sha512/224"] = forge.md.algorithms["sha512/224"] = forge.sha512.sha224; - sha512.create = function(algorithm) { - if (!_initialized) { - _init(); - } - if (typeof algorithm === "undefined") { - algorithm = "SHA-512"; - } - if (!(algorithm in _states)) { - throw new Error("Invalid SHA-512 algorithm: " + algorithm); - } - var _state = _states[algorithm]; - var _h = null; - var _input = forge.util.createBuffer(); - var _w = new Array(80); - for (var wi = 0; wi < 80; ++wi) { - _w[wi] = new Array(2); - } - var digestLength = 64; - switch (algorithm) { - case "SHA-384": - digestLength = 48; - break; - case "SHA-512/256": - digestLength = 32; - break; - case "SHA-512/224": - digestLength = 28; - break; - } - var md2 = { - // SHA-512 => sha512 - algorithm: algorithm.replace("-", "").toLowerCase(), - blockLength: 128, - digestLength, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 16 - }; - md2.start = function() { - md2.messageLength = 0; - md2.fullMessageLength = md2.messageLength128 = []; - var int32s = md2.messageLengthSize / 4; - for (var i = 0; i < int32s; ++i) { - md2.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _h = new Array(_state.length); - for (var i = 0; i < _state.length; ++i) { - _h[i] = _state[i].slice(0); - } - return md2; - }; - md2.start(); - md2.update = function(msg, encoding) { - if (encoding === "utf8") { - msg = forge.util.encodeUtf8(msg); - } - var len = msg.length; - md2.messageLength += len; - len = [len / 4294967296 >>> 0, len >>> 0]; - for (var i = md2.fullMessageLength.length - 1; i >= 0; --i) { - md2.fullMessageLength[i] += len[1]; - len[1] = len[0] + (md2.fullMessageLength[i] / 4294967296 >>> 0); - md2.fullMessageLength[i] = md2.fullMessageLength[i] >>> 0; - len[0] = len[1] / 4294967296 >>> 0; - } - _input.putBytes(msg); - _update(_h, _w, _input); - if (_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - return md2; - }; - md2.digest = function() { - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - var remaining = md2.fullMessageLength[md2.fullMessageLength.length - 1] + md2.messageLengthSize; - var overflow = remaining & md2.blockLength - 1; - finalBlock.putBytes(_padding.substr(0, md2.blockLength - overflow)); - var next, carry; - var bits = md2.fullMessageLength[0] * 8; - for (var i = 0; i < md2.fullMessageLength.length - 1; ++i) { - next = md2.fullMessageLength[i + 1] * 8; - carry = next / 4294967296 >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - var h = new Array(_h.length); - for (var i = 0; i < _h.length; ++i) { - h[i] = _h[i].slice(0); - } - _update(h, _w, finalBlock); - var rval = forge.util.createBuffer(); - var hlen; - if (algorithm === "SHA-512") { - hlen = h.length; - } else if (algorithm === "SHA-384") { - hlen = h.length - 2; - } else { - hlen = h.length - 4; - } - for (var i = 0; i < hlen; ++i) { - rval.putInt32(h[i][0]); - if (i !== hlen - 1 || algorithm !== "SHA-512/224") { - rval.putInt32(h[i][1]); - } - } - return rval; - }; - return md2; - }; - var _padding = null; - var _initialized = false; - var _k = null; - var _states = null; - function _init() { - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0), 128); - _k = [ - [1116352408, 3609767458], - [1899447441, 602891725], - [3049323471, 3964484399], - [3921009573, 2173295548], - [961987163, 4081628472], - [1508970993, 3053834265], - [2453635748, 2937671579], - [2870763221, 3664609560], - [3624381080, 2734883394], - [310598401, 1164996542], - [607225278, 1323610764], - [1426881987, 3590304994], - [1925078388, 4068182383], - [2162078206, 991336113], - [2614888103, 633803317], - [3248222580, 3479774868], - [3835390401, 2666613458], - [4022224774, 944711139], - [264347078, 2341262773], - [604807628, 2007800933], - [770255983, 1495990901], - [1249150122, 1856431235], - [1555081692, 3175218132], - [1996064986, 2198950837], - [2554220882, 3999719339], - [2821834349, 766784016], - [2952996808, 2566594879], - [3210313671, 3203337956], - [3336571891, 1034457026], - [3584528711, 2466948901], - [113926993, 3758326383], - [338241895, 168717936], - [666307205, 1188179964], - [773529912, 1546045734], - [1294757372, 1522805485], - [1396182291, 2643833823], - [1695183700, 2343527390], - [1986661051, 1014477480], - [2177026350, 1206759142], - [2456956037, 344077627], - [2730485921, 1290863460], - [2820302411, 3158454273], - [3259730800, 3505952657], - [3345764771, 106217008], - [3516065817, 3606008344], - [3600352804, 1432725776], - [4094571909, 1467031594], - [275423344, 851169720], - [430227734, 3100823752], - [506948616, 1363258195], - [659060556, 3750685593], - [883997877, 3785050280], - [958139571, 3318307427], - [1322822218, 3812723403], - [1537002063, 2003034995], - [1747873779, 3602036899], - [1955562222, 1575990012], - [2024104815, 1125592928], - [2227730452, 2716904306], - [2361852424, 442776044], - [2428436474, 593698344], - [2756734187, 3733110249], - [3204031479, 2999351573], - [3329325298, 3815920427], - [3391569614, 3928383900], - [3515267271, 566280711], - [3940187606, 3454069534], - [4118630271, 4000239992], - [116418474, 1914138554], - [174292421, 2731055270], - [289380356, 3203993006], - [460393269, 320620315], - [685471733, 587496836], - [852142971, 1086792851], - [1017036298, 365543100], - [1126000580, 2618297676], - [1288033470, 3409855158], - [1501505948, 4234509866], - [1607167915, 987167468], - [1816402316, 1246189591] - ]; - _states = {}; - _states["SHA-512"] = [ - [1779033703, 4089235720], - [3144134277, 2227873595], - [1013904242, 4271175723], - [2773480762, 1595750129], - [1359893119, 2917565137], - [2600822924, 725511199], - [528734635, 4215389547], - [1541459225, 327033209] - ]; - _states["SHA-384"] = [ - [3418070365, 3238371032], - [1654270250, 914150663], - [2438529370, 812702999], - [355462360, 4144912697], - [1731405415, 4290775857], - [2394180231, 1750603025], - [3675008525, 1694076839], - [1203062813, 3204075428] - ]; - _states["SHA-512/256"] = [ - [573645204, 4230739756], - [2673172387, 3360449730], - [596883563, 1867755857], - [2520282905, 1497426621], - [2519219938, 2827943907], - [3193839141, 1401305490], - [721525244, 746961066], - [246885852, 2177182882] - ]; - _states["SHA-512/224"] = [ - [2352822216, 424955298], - [1944164710, 2312950998], - [502970286, 855612546], - [1738396948, 1479516111], - [258812777, 2077511080], - [2011393907, 79989058], - [1067287976, 1780299464], - [286451373, 2446758561] - ]; - _initialized = true; - } - function _update(s, w, bytes) { - var t1_hi, t1_lo; - var t2_hi, t2_lo; - var s0_hi, s0_lo; - var s1_hi, s1_lo; - var ch_hi, ch_lo; - var maj_hi, maj_lo; - var a_hi, a_lo; - var b_hi, b_lo; - var c_hi, c_lo; - var d_hi, d_lo; - var e_hi, e_lo; - var f_hi, f_lo; - var g_hi, g_lo; - var h_hi, h_lo; - var i, hi, lo, w2, w7, w15, w16; - var len = bytes.length(); - while (len >= 128) { - for (i = 0; i < 16; ++i) { - w[i][0] = bytes.getInt32() >>> 0; - w[i][1] = bytes.getInt32() >>> 0; - } - for (; i < 80; ++i) { - w2 = w[i - 2]; - hi = w2[0]; - lo = w2[1]; - t1_hi = ((hi >>> 19 | lo << 13) ^ // ROTR 19 - (lo >>> 29 | hi << 3) ^ // ROTR 61/(swap + ROTR 29) - hi >>> 6) >>> 0; - t1_lo = ((hi << 13 | lo >>> 19) ^ // ROTR 19 - (lo << 3 | hi >>> 29) ^ // ROTR 61/(swap + ROTR 29) - (hi << 26 | lo >>> 6)) >>> 0; - w15 = w[i - 15]; - hi = w15[0]; - lo = w15[1]; - t2_hi = ((hi >>> 1 | lo << 31) ^ // ROTR 1 - (hi >>> 8 | lo << 24) ^ // ROTR 8 - hi >>> 7) >>> 0; - t2_lo = ((hi << 31 | lo >>> 1) ^ // ROTR 1 - (hi << 24 | lo >>> 8) ^ // ROTR 8 - (hi << 25 | lo >>> 7)) >>> 0; - w7 = w[i - 7]; - w16 = w[i - 16]; - lo = t1_lo + w7[1] + t2_lo + w16[1]; - w[i][0] = t1_hi + w7[0] + t2_hi + w16[0] + (lo / 4294967296 >>> 0) >>> 0; - w[i][1] = lo >>> 0; - } - a_hi = s[0][0]; - a_lo = s[0][1]; - b_hi = s[1][0]; - b_lo = s[1][1]; - c_hi = s[2][0]; - c_lo = s[2][1]; - d_hi = s[3][0]; - d_lo = s[3][1]; - e_hi = s[4][0]; - e_lo = s[4][1]; - f_hi = s[5][0]; - f_lo = s[5][1]; - g_hi = s[6][0]; - g_lo = s[6][1]; - h_hi = s[7][0]; - h_lo = s[7][1]; - for (i = 0; i < 80; ++i) { - s1_hi = ((e_hi >>> 14 | e_lo << 18) ^ // ROTR 14 - (e_hi >>> 18 | e_lo << 14) ^ // ROTR 18 - (e_lo >>> 9 | e_hi << 23)) >>> 0; - s1_lo = ((e_hi << 18 | e_lo >>> 14) ^ // ROTR 14 - (e_hi << 14 | e_lo >>> 18) ^ // ROTR 18 - (e_lo << 23 | e_hi >>> 9)) >>> 0; - ch_hi = (g_hi ^ e_hi & (f_hi ^ g_hi)) >>> 0; - ch_lo = (g_lo ^ e_lo & (f_lo ^ g_lo)) >>> 0; - s0_hi = ((a_hi >>> 28 | a_lo << 4) ^ // ROTR 28 - (a_lo >>> 2 | a_hi << 30) ^ // ROTR 34/(swap + ROTR 2) - (a_lo >>> 7 | a_hi << 25)) >>> 0; - s0_lo = ((a_hi << 4 | a_lo >>> 28) ^ // ROTR 28 - (a_lo << 30 | a_hi >>> 2) ^ // ROTR 34/(swap + ROTR 2) - (a_lo << 25 | a_hi >>> 7)) >>> 0; - maj_hi = (a_hi & b_hi | c_hi & (a_hi ^ b_hi)) >>> 0; - maj_lo = (a_lo & b_lo | c_lo & (a_lo ^ b_lo)) >>> 0; - lo = h_lo + s1_lo + ch_lo + _k[i][1] + w[i][1]; - t1_hi = h_hi + s1_hi + ch_hi + _k[i][0] + w[i][0] + (lo / 4294967296 >>> 0) >>> 0; - t1_lo = lo >>> 0; - lo = s0_lo + maj_lo; - t2_hi = s0_hi + maj_hi + (lo / 4294967296 >>> 0) >>> 0; - t2_lo = lo >>> 0; - h_hi = g_hi; - h_lo = g_lo; - g_hi = f_hi; - g_lo = f_lo; - f_hi = e_hi; - f_lo = e_lo; - lo = d_lo + t1_lo; - e_hi = d_hi + t1_hi + (lo / 4294967296 >>> 0) >>> 0; - e_lo = lo >>> 0; - d_hi = c_hi; - d_lo = c_lo; - c_hi = b_hi; - c_lo = b_lo; - b_hi = a_hi; - b_lo = a_lo; - lo = t1_lo + t2_lo; - a_hi = t1_hi + t2_hi + (lo / 4294967296 >>> 0) >>> 0; - a_lo = lo >>> 0; - } - lo = s[0][1] + a_lo; - s[0][0] = s[0][0] + a_hi + (lo / 4294967296 >>> 0) >>> 0; - s[0][1] = lo >>> 0; - lo = s[1][1] + b_lo; - s[1][0] = s[1][0] + b_hi + (lo / 4294967296 >>> 0) >>> 0; - s[1][1] = lo >>> 0; - lo = s[2][1] + c_lo; - s[2][0] = s[2][0] + c_hi + (lo / 4294967296 >>> 0) >>> 0; - s[2][1] = lo >>> 0; - lo = s[3][1] + d_lo; - s[3][0] = s[3][0] + d_hi + (lo / 4294967296 >>> 0) >>> 0; - s[3][1] = lo >>> 0; - lo = s[4][1] + e_lo; - s[4][0] = s[4][0] + e_hi + (lo / 4294967296 >>> 0) >>> 0; - s[4][1] = lo >>> 0; - lo = s[5][1] + f_lo; - s[5][0] = s[5][0] + f_hi + (lo / 4294967296 >>> 0) >>> 0; - s[5][1] = lo >>> 0; - lo = s[6][1] + g_lo; - s[6][0] = s[6][0] + g_hi + (lo / 4294967296 >>> 0) >>> 0; - s[6][1] = lo >>> 0; - lo = s[7][1] + h_lo; - s[7][0] = s[7][0] + h_hi + (lo / 4294967296 >>> 0) >>> 0; - s[7][1] = lo >>> 0; - len -= 128; - } - } - } -}); - -// node_modules/node-forge/lib/asn1-validator.js -var require_asn1_validator = __commonJS({ - "node_modules/node-forge/lib/asn1-validator.js"(exports2) { - var forge = require_forge(); - require_asn1(); - var asn1 = forge.asn1; - exports2.privateKeyValidator = { - // PrivateKeyInfo - name: "PrivateKeyInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: "PrivateKeyInfo.version", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: "privateKeyVersion" - }, { - // privateKeyAlgorithm - name: "PrivateKeyInfo.privateKeyAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "AlgorithmIdentifier.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "privateKeyOid" - }] - }, { - // PrivateKey - name: "PrivateKeyInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: "privateKey" - }] - }; - exports2.publicKeyValidator = { - name: "SubjectPublicKeyInfo", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: "subjectPublicKeyInfo", - value: [ - { - name: "SubjectPublicKeyInfo.AlgorithmIdentifier", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: "AlgorithmIdentifier.algorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: "publicKeyOid" - }] - }, - // capture group for ed25519PublicKey - { - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - composed: true, - captureBitStringValue: "ed25519PublicKey" - } - // FIXME: this is capture group for rsaPublicKey, use it in this API or - // discard? - /* { - // subjectPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'rsaPublicKey' - }] - } */ - ] - }; - } -}); - -// node_modules/node-forge/lib/ed25519.js -var require_ed25519 = __commonJS({ - "node_modules/node-forge/lib/ed25519.js"(exports2, module2) { - var forge = require_forge(); - require_jsbn(); - require_random2(); - require_sha512(); - require_util16(); - var asn1Validator = require_asn1_validator(); - var publicKeyValidator = asn1Validator.publicKeyValidator; - var privateKeyValidator = asn1Validator.privateKeyValidator; - if (typeof BigInteger === "undefined") { - BigInteger = forge.jsbn.BigInteger; - } - var BigInteger; - var ByteBuffer = forge.util.ByteBuffer; - var NativeBuffer = typeof Buffer === "undefined" ? Uint8Array : Buffer; - forge.pki = forge.pki || {}; - module2.exports = forge.pki.ed25519 = forge.ed25519 = forge.ed25519 || {}; - var ed25519 = forge.ed25519; - ed25519.constants = {}; - ed25519.constants.PUBLIC_KEY_BYTE_LENGTH = 32; - ed25519.constants.PRIVATE_KEY_BYTE_LENGTH = 64; - ed25519.constants.SEED_BYTE_LENGTH = 32; - ed25519.constants.SIGN_BYTE_LENGTH = 64; - ed25519.constants.HASH_BYTE_LENGTH = 64; - ed25519.generateKeyPair = function(options) { - options = options || {}; - var seed = options.seed; - if (seed === void 0) { - seed = forge.random.getBytesSync(ed25519.constants.SEED_BYTE_LENGTH); - } else if (typeof seed === "string") { - if (seed.length !== ed25519.constants.SEED_BYTE_LENGTH) { - throw new TypeError( - '"seed" must be ' + ed25519.constants.SEED_BYTE_LENGTH + " bytes in length." - ); - } - } else if (!(seed instanceof Uint8Array)) { - throw new TypeError( - '"seed" must be a node.js Buffer, Uint8Array, or a binary string.' - ); - } - seed = messageToNativeBuffer({ message: seed, encoding: "binary" }); - var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); - var sk = new NativeBuffer(ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); - for (var i = 0; i < 32; ++i) { - sk[i] = seed[i]; - } - crypto_sign_keypair(pk, sk); - return { publicKey: pk, privateKey: sk }; - }; - ed25519.privateKeyFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - var valid4 = forge.asn1.validate(obj, privateKeyValidator, capture, errors); - if (!valid4) { - var error3 = new Error("Invalid Key."); - error3.errors = errors; - throw error3; - } - var oid = forge.asn1.derToOid(capture.privateKeyOid); - var ed25519Oid = forge.oids.EdDSA25519; - if (oid !== ed25519Oid) { - throw new Error('Invalid OID "' + oid + '"; OID must be "' + ed25519Oid + '".'); - } - var privateKey = capture.privateKey; - var privateKeyBytes = messageToNativeBuffer({ - message: forge.asn1.fromDer(privateKey).value, - encoding: "binary" - }); - return { privateKeyBytes }; - }; - ed25519.publicKeyFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - var valid4 = forge.asn1.validate(obj, publicKeyValidator, capture, errors); - if (!valid4) { - var error3 = new Error("Invalid Key."); - error3.errors = errors; - throw error3; - } - var oid = forge.asn1.derToOid(capture.publicKeyOid); - var ed25519Oid = forge.oids.EdDSA25519; - if (oid !== ed25519Oid) { - throw new Error('Invalid OID "' + oid + '"; OID must be "' + ed25519Oid + '".'); - } - var publicKeyBytes = capture.ed25519PublicKey; - if (publicKeyBytes.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { - throw new Error("Key length is invalid."); - } - return messageToNativeBuffer({ - message: publicKeyBytes, - encoding: "binary" - }); - }; - ed25519.publicKeyFromPrivateKey = function(options) { - options = options || {}; - var privateKey = messageToNativeBuffer({ - message: options.privateKey, - encoding: "binary" - }); - if (privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.privateKey" must have a byte length of ' + ed25519.constants.PRIVATE_KEY_BYTE_LENGTH - ); - } - var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); - for (var i = 0; i < pk.length; ++i) { - pk[i] = privateKey[32 + i]; - } - return pk; - }; - ed25519.sign = function(options) { - options = options || {}; - var msg = messageToNativeBuffer(options); - var privateKey = messageToNativeBuffer({ - message: options.privateKey, - encoding: "binary" - }); - if (privateKey.length === ed25519.constants.SEED_BYTE_LENGTH) { - var keyPair = ed25519.generateKeyPair({ seed: privateKey }); - privateKey = keyPair.privateKey; - } else if (privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.privateKey" must have a byte length of ' + ed25519.constants.SEED_BYTE_LENGTH + " or " + ed25519.constants.PRIVATE_KEY_BYTE_LENGTH - ); - } - var signedMsg = new NativeBuffer( - ed25519.constants.SIGN_BYTE_LENGTH + msg.length - ); - crypto_sign(signedMsg, msg, msg.length, privateKey); - var sig = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH); - for (var i = 0; i < sig.length; ++i) { - sig[i] = signedMsg[i]; - } - return sig; - }; - ed25519.verify = function(options) { - options = options || {}; - var msg = messageToNativeBuffer(options); - if (options.signature === void 0) { - throw new TypeError( - '"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.' - ); - } - var sig = messageToNativeBuffer({ - message: options.signature, - encoding: "binary" - }); - if (sig.length !== ed25519.constants.SIGN_BYTE_LENGTH) { - throw new TypeError( - '"options.signature" must have a byte length of ' + ed25519.constants.SIGN_BYTE_LENGTH - ); - } - var publicKey = messageToNativeBuffer({ - message: options.publicKey, - encoding: "binary" - }); - if (publicKey.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.publicKey" must have a byte length of ' + ed25519.constants.PUBLIC_KEY_BYTE_LENGTH - ); - } - var sm = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); - var m = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); - var i; - for (i = 0; i < ed25519.constants.SIGN_BYTE_LENGTH; ++i) { - sm[i] = sig[i]; - } - for (i = 0; i < msg.length; ++i) { - sm[i + ed25519.constants.SIGN_BYTE_LENGTH] = msg[i]; - } - return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; - }; - function messageToNativeBuffer(options) { - var message = options.message; - if (message instanceof Uint8Array || message instanceof NativeBuffer) { - return message; - } - var encoding = options.encoding; - if (message === void 0) { - if (options.md) { - message = options.md.digest().getBytes(); - encoding = "binary"; - } else { - throw new TypeError('"options.message" or "options.md" not specified.'); - } - } - if (typeof message === "string" && !encoding) { - throw new TypeError('"options.encoding" must be "binary" or "utf8".'); - } - if (typeof message === "string") { - if (typeof Buffer !== "undefined") { - return Buffer.from(message, encoding); - } - message = new ByteBuffer(message, encoding); - } else if (!(message instanceof ByteBuffer)) { - throw new TypeError( - '"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.' - ); - } - var buffer = new NativeBuffer(message.length()); - for (var i = 0; i < buffer.length; ++i) { - buffer[i] = message.at(i); - } - return buffer; - } - var gf0 = gf(); - var gf1 = gf([1]); - var D = gf([ - 30883, - 4953, - 19914, - 30187, - 55467, - 16705, - 2637, - 112, - 59544, - 30585, - 16505, - 36039, - 65139, - 11119, - 27886, - 20995 - ]); - var D2 = gf([ - 61785, - 9906, - 39828, - 60374, - 45398, - 33411, - 5274, - 224, - 53552, - 61171, - 33010, - 6542, - 64743, - 22239, - 55772, - 9222 - ]); - var X = gf([ - 54554, - 36645, - 11616, - 51542, - 42930, - 38181, - 51040, - 26924, - 56412, - 64982, - 57905, - 49316, - 21502, - 52590, - 14035, - 8553 - ]); - var Y = gf([ - 26200, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214, - 26214 - ]); - var L = new Float64Array([ - 237, - 211, - 245, - 92, - 26, - 99, - 18, - 88, - 214, - 156, - 247, - 162, - 222, - 249, - 222, - 20, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 16 - ]); - var I = gf([ - 41136, - 18958, - 6951, - 50414, - 58488, - 44335, - 6150, - 12099, - 55207, - 15867, - 153, - 11085, - 57099, - 20417, - 9344, - 11139 - ]); - function sha512(msg, msgLen) { - var md2 = forge.md.sha512.create(); - var buffer = new ByteBuffer(msg); - md2.update(buffer.getBytes(msgLen), "binary"); - var hash2 = md2.digest().getBytes(); - if (typeof Buffer !== "undefined") { - return Buffer.from(hash2, "binary"); - } - var out = new NativeBuffer(ed25519.constants.HASH_BYTE_LENGTH); - for (var i = 0; i < 64; ++i) { - out[i] = hash2.charCodeAt(i); - } - return out; - } - function crypto_sign_keypair(pk, sk) { - var p = [gf(), gf(), gf(), gf()]; - var i; - var d = sha512(sk, 32); - d[0] &= 248; - d[31] &= 127; - d[31] |= 64; - scalarbase(p, d); - pack(pk, p); - for (i = 0; i < 32; ++i) { - sk[i + 32] = pk[i]; - } - return 0; - } - function crypto_sign(sm, m, n, sk) { - var i, j, x = new Float64Array(64); - var p = [gf(), gf(), gf(), gf()]; - var d = sha512(sk, 32); - d[0] &= 248; - d[31] &= 127; - d[31] |= 64; - var smlen = n + 64; - for (i = 0; i < n; ++i) { - sm[64 + i] = m[i]; - } - for (i = 0; i < 32; ++i) { - sm[32 + i] = d[32 + i]; - } - var r = sha512(sm.subarray(32), n + 32); - reduce(r); - scalarbase(p, r); - pack(sm, p); - for (i = 32; i < 64; ++i) { - sm[i] = sk[i]; - } - var h = sha512(sm, n + 64); - reduce(h); - for (i = 32; i < 64; ++i) { - x[i] = 0; - } - for (i = 0; i < 32; ++i) { - x[i] = r[i]; - } - for (i = 0; i < 32; ++i) { - for (j = 0; j < 32; j++) { - x[i + j] += h[i] * d[j]; - } - } - modL(sm.subarray(32), x); - return smlen; - } - function crypto_sign_open(m, sm, n, pk) { - var i, mlen; - var t = new NativeBuffer(32); - var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; - mlen = -1; - if (n < 64) { - return -1; - } - if (unpackneg(q, pk)) { - return -1; - } - if (!_isCanonicalSignatureScalar(sm, 32)) { - return -1; - } - for (i = 0; i < n; ++i) { - m[i] = sm[i]; - } - for (i = 0; i < 32; ++i) { - m[i + 32] = pk[i]; - } - var h = sha512(m, n); - reduce(h); - scalarmult(p, q, h); - scalarbase(q, sm.subarray(32)); - add2(p, q); - pack(t, p); - n -= 64; - if (crypto_verify_32(sm, 0, t, 0)) { - for (i = 0; i < n; ++i) { - m[i] = 0; - } - return -1; - } - for (i = 0; i < n; ++i) { - m[i] = sm[i + 64]; - } - mlen = n; - return mlen; - } - function _isCanonicalSignatureScalar(bytes, offset) { - var i; - for (i = 31; i >= 0; --i) { - if (bytes[offset + i] < L[i]) { - return true; - } - if (bytes[offset + i] > L[i]) { - return false; - } - } - return false; - } - function modL(r, x) { - var carry, i, j, k; - for (i = 63; i >= 32; --i) { - carry = 0; - for (j = i - 32, k = i - 12; j < k; ++j) { - x[j] += carry - 16 * x[i] * L[j - (i - 32)]; - carry = x[j] + 128 >> 8; - x[j] -= carry * 256; - } - x[j] += carry; - x[i] = 0; - } - carry = 0; - for (j = 0; j < 32; ++j) { - x[j] += carry - (x[31] >> 4) * L[j]; - carry = x[j] >> 8; - x[j] &= 255; - } - for (j = 0; j < 32; ++j) { - x[j] -= carry * L[j]; - } - for (i = 0; i < 32; ++i) { - x[i + 1] += x[i] >> 8; - r[i] = x[i] & 255; - } - } - function reduce(r) { - var x = new Float64Array(64); - for (var i = 0; i < 64; ++i) { - x[i] = r[i]; - r[i] = 0; - } - modL(r, x); - } - function add2(p, q) { - var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); - Z(a, p[1], p[0]); - Z(t, q[1], q[0]); - M(a, a, t); - A(b, p[0], p[1]); - A(t, q[0], q[1]); - M(b, b, t); - M(c, p[3], q[3]); - M(c, c, D2); - M(d, p[2], q[2]); - A(d, d, d); - Z(e, b, a); - Z(f, d, c); - A(g, d, c); - A(h, b, a); - M(p[0], e, f); - M(p[1], h, g); - M(p[2], g, f); - M(p[3], e, h); - } - function cswap(p, q, b) { - for (var i = 0; i < 4; ++i) { - sel25519(p[i], q[i], b); - } - } - function pack(r, p) { - var tx = gf(), ty = gf(), zi = gf(); - inv25519(zi, p[2]); - M(tx, p[0], zi); - M(ty, p[1], zi); - pack25519(r, ty); - r[31] ^= par25519(tx) << 7; - } - function pack25519(o, n) { - var i, j, b; - var m = gf(), t = gf(); - for (i = 0; i < 16; ++i) { - t[i] = n[i]; - } - car25519(t); - car25519(t); - car25519(t); - for (j = 0; j < 2; ++j) { - m[0] = t[0] - 65517; - for (i = 1; i < 15; ++i) { - m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1); - m[i - 1] &= 65535; - } - m[15] = t[15] - 32767 - (m[14] >> 16 & 1); - b = m[15] >> 16 & 1; - m[14] &= 65535; - sel25519(t, m, 1 - b); - } - for (i = 0; i < 16; i++) { - o[2 * i] = t[i] & 255; - o[2 * i + 1] = t[i] >> 8; - } - } - function unpackneg(r, p) { - var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); - set25519(r[2], gf1); - unpack25519(r[1], p); - S(num, r[1]); - M(den, num, D); - Z(num, num, r[2]); - A(den, r[2], den); - S(den2, den); - S(den4, den2); - M(den6, den4, den2); - M(t, den6, num); - M(t, t, den); - pow2523(t, t); - M(t, t, num); - M(t, t, den); - M(t, t, den); - M(r[0], t, den); - S(chk, r[0]); - M(chk, chk, den); - if (neq25519(chk, num)) { - M(r[0], r[0], I); - } - S(chk, r[0]); - M(chk, chk, den); - if (neq25519(chk, num)) { - return -1; - } - if (par25519(r[0]) === p[31] >> 7) { - Z(r[0], gf0, r[0]); - } - M(r[3], r[0], r[1]); - return 0; - } - function unpack25519(o, n) { - var i; - for (i = 0; i < 16; ++i) { - o[i] = n[2 * i] + (n[2 * i + 1] << 8); - } - o[15] &= 32767; - } - function pow2523(o, i) { - var c = gf(); - var a; - for (a = 0; a < 16; ++a) { - c[a] = i[a]; - } - for (a = 250; a >= 0; --a) { - S(c, c); - if (a !== 1) { - M(c, c, i); - } - } - for (a = 0; a < 16; ++a) { - o[a] = c[a]; - } - } - function neq25519(a, b) { - var c = new NativeBuffer(32); - var d = new NativeBuffer(32); - pack25519(c, a); - pack25519(d, b); - return crypto_verify_32(c, 0, d, 0); - } - function crypto_verify_32(x, xi, y, yi) { - return vn(x, xi, y, yi, 32); - } - function vn(x, xi, y, yi, n) { - var i, d = 0; - for (i = 0; i < n; ++i) { - d |= x[xi + i] ^ y[yi + i]; - } - return (1 & d - 1 >>> 8) - 1; - } - function par25519(a) { - var d = new NativeBuffer(32); - pack25519(d, a); - return d[0] & 1; - } - function scalarmult(p, q, s) { - var b, i; - set25519(p[0], gf0); - set25519(p[1], gf1); - set25519(p[2], gf1); - set25519(p[3], gf0); - for (i = 255; i >= 0; --i) { - b = s[i / 8 | 0] >> (i & 7) & 1; - cswap(p, q, b); - add2(q, p); - add2(p, p); - cswap(p, q, b); - } - } - function scalarbase(p, s) { - var q = [gf(), gf(), gf(), gf()]; - set25519(q[0], X); - set25519(q[1], Y); - set25519(q[2], gf1); - M(q[3], X, Y); - scalarmult(p, q, s); - } - function set25519(r, a) { - var i; - for (i = 0; i < 16; i++) { - r[i] = a[i] | 0; - } - } - function inv25519(o, i) { - var c = gf(); - var a; - for (a = 0; a < 16; ++a) { - c[a] = i[a]; - } - for (a = 253; a >= 0; --a) { - S(c, c); - if (a !== 2 && a !== 4) { - M(c, c, i); - } - } - for (a = 0; a < 16; ++a) { - o[a] = c[a]; - } - } - function car25519(o) { - var i, v, c = 1; - for (i = 0; i < 16; ++i) { - v = o[i] + c + 65535; - c = Math.floor(v / 65536); - o[i] = v - c * 65536; - } - o[0] += c - 1 + 37 * (c - 1); - } - function sel25519(p, q, b) { - var t, c = ~(b - 1); - for (var i = 0; i < 16; ++i) { - t = c & (p[i] ^ q[i]); - p[i] ^= t; - q[i] ^= t; - } - } - function gf(init2) { - var i, r = new Float64Array(16); - if (init2) { - for (i = 0; i < init2.length; ++i) { - r[i] = init2[i]; - } - } - return r; - } - function A(o, a, b) { - for (var i = 0; i < 16; ++i) { - o[i] = a[i] + b[i]; - } - } - function Z(o, a, b) { - for (var i = 0; i < 16; ++i) { - o[i] = a[i] - b[i]; - } - } - function S(o, a) { - M(o, a, a); - } - function M(o, a, b) { - var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; - v = a[0]; - t0 += v * b0; - t1 += v * b1; - t2 += v * b2; - t3 += v * b3; - t4 += v * b4; - t5 += v * b5; - t6 += v * b6; - t7 += v * b7; - t8 += v * b8; - t9 += v * b9; - t10 += v * b10; - t11 += v * b11; - t12 += v * b12; - t13 += v * b13; - t14 += v * b14; - t15 += v * b15; - v = a[1]; - t1 += v * b0; - t2 += v * b1; - t3 += v * b2; - t4 += v * b3; - t5 += v * b4; - t6 += v * b5; - t7 += v * b6; - t8 += v * b7; - t9 += v * b8; - t10 += v * b9; - t11 += v * b10; - t12 += v * b11; - t13 += v * b12; - t14 += v * b13; - t15 += v * b14; - t16 += v * b15; - v = a[2]; - t2 += v * b0; - t3 += v * b1; - t4 += v * b2; - t5 += v * b3; - t6 += v * b4; - t7 += v * b5; - t8 += v * b6; - t9 += v * b7; - t10 += v * b8; - t11 += v * b9; - t12 += v * b10; - t13 += v * b11; - t14 += v * b12; - t15 += v * b13; - t16 += v * b14; - t17 += v * b15; - v = a[3]; - t3 += v * b0; - t4 += v * b1; - t5 += v * b2; - t6 += v * b3; - t7 += v * b4; - t8 += v * b5; - t9 += v * b6; - t10 += v * b7; - t11 += v * b8; - t12 += v * b9; - t13 += v * b10; - t14 += v * b11; - t15 += v * b12; - t16 += v * b13; - t17 += v * b14; - t18 += v * b15; - v = a[4]; - t4 += v * b0; - t5 += v * b1; - t6 += v * b2; - t7 += v * b3; - t8 += v * b4; - t9 += v * b5; - t10 += v * b6; - t11 += v * b7; - t12 += v * b8; - t13 += v * b9; - t14 += v * b10; - t15 += v * b11; - t16 += v * b12; - t17 += v * b13; - t18 += v * b14; - t19 += v * b15; - v = a[5]; - t5 += v * b0; - t6 += v * b1; - t7 += v * b2; - t8 += v * b3; - t9 += v * b4; - t10 += v * b5; - t11 += v * b6; - t12 += v * b7; - t13 += v * b8; - t14 += v * b9; - t15 += v * b10; - t16 += v * b11; - t17 += v * b12; - t18 += v * b13; - t19 += v * b14; - t20 += v * b15; - v = a[6]; - t6 += v * b0; - t7 += v * b1; - t8 += v * b2; - t9 += v * b3; - t10 += v * b4; - t11 += v * b5; - t12 += v * b6; - t13 += v * b7; - t14 += v * b8; - t15 += v * b9; - t16 += v * b10; - t17 += v * b11; - t18 += v * b12; - t19 += v * b13; - t20 += v * b14; - t21 += v * b15; - v = a[7]; - t7 += v * b0; - t8 += v * b1; - t9 += v * b2; - t10 += v * b3; - t11 += v * b4; - t12 += v * b5; - t13 += v * b6; - t14 += v * b7; - t15 += v * b8; - t16 += v * b9; - t17 += v * b10; - t18 += v * b11; - t19 += v * b12; - t20 += v * b13; - t21 += v * b14; - t22 += v * b15; - v = a[8]; - t8 += v * b0; - t9 += v * b1; - t10 += v * b2; - t11 += v * b3; - t12 += v * b4; - t13 += v * b5; - t14 += v * b6; - t15 += v * b7; - t16 += v * b8; - t17 += v * b9; - t18 += v * b10; - t19 += v * b11; - t20 += v * b12; - t21 += v * b13; - t22 += v * b14; - t23 += v * b15; - v = a[9]; - t9 += v * b0; - t10 += v * b1; - t11 += v * b2; - t12 += v * b3; - t13 += v * b4; - t14 += v * b5; - t15 += v * b6; - t16 += v * b7; - t17 += v * b8; - t18 += v * b9; - t19 += v * b10; - t20 += v * b11; - t21 += v * b12; - t22 += v * b13; - t23 += v * b14; - t24 += v * b15; - v = a[10]; - t10 += v * b0; - t11 += v * b1; - t12 += v * b2; - t13 += v * b3; - t14 += v * b4; - t15 += v * b5; - t16 += v * b6; - t17 += v * b7; - t18 += v * b8; - t19 += v * b9; - t20 += v * b10; - t21 += v * b11; - t22 += v * b12; - t23 += v * b13; - t24 += v * b14; - t25 += v * b15; - v = a[11]; - t11 += v * b0; - t12 += v * b1; - t13 += v * b2; - t14 += v * b3; - t15 += v * b4; - t16 += v * b5; - t17 += v * b6; - t18 += v * b7; - t19 += v * b8; - t20 += v * b9; - t21 += v * b10; - t22 += v * b11; - t23 += v * b12; - t24 += v * b13; - t25 += v * b14; - t26 += v * b15; - v = a[12]; - t12 += v * b0; - t13 += v * b1; - t14 += v * b2; - t15 += v * b3; - t16 += v * b4; - t17 += v * b5; - t18 += v * b6; - t19 += v * b7; - t20 += v * b8; - t21 += v * b9; - t22 += v * b10; - t23 += v * b11; - t24 += v * b12; - t25 += v * b13; - t26 += v * b14; - t27 += v * b15; - v = a[13]; - t13 += v * b0; - t14 += v * b1; - t15 += v * b2; - t16 += v * b3; - t17 += v * b4; - t18 += v * b5; - t19 += v * b6; - t20 += v * b7; - t21 += v * b8; - t22 += v * b9; - t23 += v * b10; - t24 += v * b11; - t25 += v * b12; - t26 += v * b13; - t27 += v * b14; - t28 += v * b15; - v = a[14]; - t14 += v * b0; - t15 += v * b1; - t16 += v * b2; - t17 += v * b3; - t18 += v * b4; - t19 += v * b5; - t20 += v * b6; - t21 += v * b7; - t22 += v * b8; - t23 += v * b9; - t24 += v * b10; - t25 += v * b11; - t26 += v * b12; - t27 += v * b13; - t28 += v * b14; - t29 += v * b15; - v = a[15]; - t15 += v * b0; - t16 += v * b1; - t17 += v * b2; - t18 += v * b3; - t19 += v * b4; - t20 += v * b5; - t21 += v * b6; - t22 += v * b7; - t23 += v * b8; - t24 += v * b9; - t25 += v * b10; - t26 += v * b11; - t27 += v * b12; - t28 += v * b13; - t29 += v * b14; - t30 += v * b15; - t0 += 38 * t16; - t1 += 38 * t17; - t2 += 38 * t18; - t3 += 38 * t19; - t4 += 38 * t20; - t5 += 38 * t21; - t6 += 38 * t22; - t7 += 38 * t23; - t8 += 38 * t24; - t9 += 38 * t25; - t10 += 38 * t26; - t11 += 38 * t27; - t12 += 38 * t28; - t13 += 38 * t29; - t14 += 38 * t30; - c = 1; - v = t0 + c + 65535; - c = Math.floor(v / 65536); - t0 = v - c * 65536; - v = t1 + c + 65535; - c = Math.floor(v / 65536); - t1 = v - c * 65536; - v = t2 + c + 65535; - c = Math.floor(v / 65536); - t2 = v - c * 65536; - v = t3 + c + 65535; - c = Math.floor(v / 65536); - t3 = v - c * 65536; - v = t4 + c + 65535; - c = Math.floor(v / 65536); - t4 = v - c * 65536; - v = t5 + c + 65535; - c = Math.floor(v / 65536); - t5 = v - c * 65536; - v = t6 + c + 65535; - c = Math.floor(v / 65536); - t6 = v - c * 65536; - v = t7 + c + 65535; - c = Math.floor(v / 65536); - t7 = v - c * 65536; - v = t8 + c + 65535; - c = Math.floor(v / 65536); - t8 = v - c * 65536; - v = t9 + c + 65535; - c = Math.floor(v / 65536); - t9 = v - c * 65536; - v = t10 + c + 65535; - c = Math.floor(v / 65536); - t10 = v - c * 65536; - v = t11 + c + 65535; - c = Math.floor(v / 65536); - t11 = v - c * 65536; - v = t12 + c + 65535; - c = Math.floor(v / 65536); - t12 = v - c * 65536; - v = t13 + c + 65535; - c = Math.floor(v / 65536); - t13 = v - c * 65536; - v = t14 + c + 65535; - c = Math.floor(v / 65536); - t14 = v - c * 65536; - v = t15 + c + 65535; - c = Math.floor(v / 65536); - t15 = v - c * 65536; - t0 += c - 1 + 37 * (c - 1); - c = 1; - v = t0 + c + 65535; - c = Math.floor(v / 65536); - t0 = v - c * 65536; - v = t1 + c + 65535; - c = Math.floor(v / 65536); - t1 = v - c * 65536; - v = t2 + c + 65535; - c = Math.floor(v / 65536); - t2 = v - c * 65536; - v = t3 + c + 65535; - c = Math.floor(v / 65536); - t3 = v - c * 65536; - v = t4 + c + 65535; - c = Math.floor(v / 65536); - t4 = v - c * 65536; - v = t5 + c + 65535; - c = Math.floor(v / 65536); - t5 = v - c * 65536; - v = t6 + c + 65535; - c = Math.floor(v / 65536); - t6 = v - c * 65536; - v = t7 + c + 65535; - c = Math.floor(v / 65536); - t7 = v - c * 65536; - v = t8 + c + 65535; - c = Math.floor(v / 65536); - t8 = v - c * 65536; - v = t9 + c + 65535; - c = Math.floor(v / 65536); - t9 = v - c * 65536; - v = t10 + c + 65535; - c = Math.floor(v / 65536); - t10 = v - c * 65536; - v = t11 + c + 65535; - c = Math.floor(v / 65536); - t11 = v - c * 65536; - v = t12 + c + 65535; - c = Math.floor(v / 65536); - t12 = v - c * 65536; - v = t13 + c + 65535; - c = Math.floor(v / 65536); - t13 = v - c * 65536; - v = t14 + c + 65535; - c = Math.floor(v / 65536); - t14 = v - c * 65536; - v = t15 + c + 65535; - c = Math.floor(v / 65536); - t15 = v - c * 65536; - t0 += c - 1 + 37 * (c - 1); - o[0] = t0; - o[1] = t1; - o[2] = t2; - o[3] = t3; - o[4] = t4; - o[5] = t5; - o[6] = t6; - o[7] = t7; - o[8] = t8; - o[9] = t9; - o[10] = t10; - o[11] = t11; - o[12] = t12; - o[13] = t13; - o[14] = t14; - o[15] = t15; - } - } -}); - -// node_modules/node-forge/lib/kem.js -var require_kem = __commonJS({ - "node_modules/node-forge/lib/kem.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - require_random2(); - require_jsbn(); - module2.exports = forge.kem = forge.kem || {}; - var BigInteger = forge.jsbn.BigInteger; - forge.kem.rsa = {}; - forge.kem.rsa.create = function(kdf, options) { - options = options || {}; - var prng = options.prng || forge.random; - var kem = {}; - kem.encrypt = function(publicKey, keyLength) { - var byteLength = Math.ceil(publicKey.n.bitLength() / 8); - var r; - do { - r = new BigInteger( - forge.util.bytesToHex(prng.getBytesSync(byteLength)), - 16 - ).mod(publicKey.n); - } while (r.compareTo(BigInteger.ONE) <= 0); - r = forge.util.hexToBytes(r.toString(16)); - var zeros = byteLength - r.length; - if (zeros > 0) { - r = forge.util.fillString(String.fromCharCode(0), zeros) + r; - } - var encapsulation = publicKey.encrypt(r, "NONE"); - var key = kdf.generate(r, keyLength); - return { encapsulation, key }; - }; - kem.decrypt = function(privateKey, encapsulation, keyLength) { - var r = privateKey.decrypt(encapsulation, "NONE"); - return kdf.generate(r, keyLength); - }; - return kem; - }; - forge.kem.kdf1 = function(md2, digestLength) { - _createKDF(this, md2, 0, digestLength || md2.digestLength); - }; - forge.kem.kdf2 = function(md2, digestLength) { - _createKDF(this, md2, 1, digestLength || md2.digestLength); - }; - function _createKDF(kdf, md2, counterStart, digestLength) { - kdf.generate = function(x, length) { - var key = new forge.util.ByteBuffer(); - var k = Math.ceil(length / digestLength) + counterStart; - var c = new forge.util.ByteBuffer(); - for (var i = counterStart; i < k; ++i) { - c.putInt32(i); - md2.start(); - md2.update(x + c.getBytes()); - var hash2 = md2.digest(); - key.putBytes(hash2.getBytes(digestLength)); - } - key.truncate(key.length() - length); - return key.getBytes(); - }; - } - } -}); - -// node_modules/node-forge/lib/log.js -var require_log7 = __commonJS({ - "node_modules/node-forge/lib/log.js"(exports2, module2) { - var forge = require_forge(); - require_util16(); - module2.exports = forge.log = forge.log || {}; - forge.log.levels = [ - "none", - "error", - "warning", - "info", - "debug", - "verbose", - "max" - ]; - var sLevelInfo = {}; - var sLoggers = []; - var sConsoleLogger = null; - forge.log.LEVEL_LOCKED = 1 << 1; - forge.log.NO_LEVEL_CHECK = 1 << 2; - forge.log.INTERPOLATE = 1 << 3; - for (i = 0; i < forge.log.levels.length; ++i) { - level = forge.log.levels[i]; - sLevelInfo[level] = { - index: i, - name: level.toUpperCase() - }; - } - var level; - var i; - forge.log.logMessage = function(message) { - var messageLevelIndex = sLevelInfo[message.level].index; - for (var i2 = 0; i2 < sLoggers.length; ++i2) { - var logger2 = sLoggers[i2]; - if (logger2.flags & forge.log.NO_LEVEL_CHECK) { - logger2.f(message); - } else { - var loggerLevelIndex = sLevelInfo[logger2.level].index; - if (messageLevelIndex <= loggerLevelIndex) { - logger2.f(logger2, message); - } - } - } - }; - forge.log.prepareStandard = function(message) { - if (!("standard" in message)) { - message.standard = sLevelInfo[message.level].name + //' ' + +message.timestamp + - " [" + message.category + "] " + message.message; - } - }; - forge.log.prepareFull = function(message) { - if (!("full" in message)) { - var args = [message.message]; - args = args.concat([]); - message.full = forge.util.format.apply(this, args); - } - }; - forge.log.prepareStandardFull = function(message) { - if (!("standardFull" in message)) { - forge.log.prepareStandard(message); - message.standardFull = message.standard; - } - }; - if (true) { - levels = ["error", "warning", "info", "debug", "verbose"]; - for (i = 0; i < levels.length; ++i) { - (function(level2) { - forge.log[level2] = function(category, message) { - var args = Array.prototype.slice.call(arguments).slice(2); - var msg = { - timestamp: /* @__PURE__ */ new Date(), - level: level2, - category, - message, - "arguments": args - /*standard*/ - /*full*/ - /*fullMessage*/ - }; - forge.log.logMessage(msg); - }; - })(levels[i]); - } - } - var levels; - var i; - forge.log.makeLogger = function(logFunction) { - var logger2 = { - flags: 0, - f: logFunction - }; - forge.log.setLevel(logger2, "none"); - return logger2; - }; - forge.log.setLevel = function(logger2, level2) { - var rval = false; - if (logger2 && !(logger2.flags & forge.log.LEVEL_LOCKED)) { - for (var i2 = 0; i2 < forge.log.levels.length; ++i2) { - var aValidLevel = forge.log.levels[i2]; - if (level2 == aValidLevel) { - logger2.level = level2; - rval = true; - break; - } - } - } - return rval; - }; - forge.log.lock = function(logger2, lock2) { - if (typeof lock2 === "undefined" || lock2) { - logger2.flags |= forge.log.LEVEL_LOCKED; - } else { - logger2.flags &= ~forge.log.LEVEL_LOCKED; - } - }; - forge.log.addLogger = function(logger2) { - sLoggers.push(logger2); - }; - if (typeof console !== "undefined" && "log" in console) { - if (console.error && console.warn && console.info && console.debug) { - levelHandlers = { - error: console.error, - warning: console.warn, - info: console.info, - debug: console.debug, - verbose: console.debug - }; - f = function(logger2, message) { - forge.log.prepareStandard(message); - var handler2 = levelHandlers[message.level]; - var args = [message.standard]; - args = args.concat(message["arguments"].slice()); - handler2.apply(console, args); - }; - logger = forge.log.makeLogger(f); - } else { - f = function(logger2, message) { - forge.log.prepareStandardFull(message); - console.log(message.standardFull); - }; - logger = forge.log.makeLogger(f); - } - forge.log.setLevel(logger, "debug"); - forge.log.addLogger(logger); - sConsoleLogger = logger; - } else { - console = { - log: function() { - } - }; - } - var logger; - var levelHandlers; - var f; - if (sConsoleLogger !== null && typeof window !== "undefined" && window.location) { - query = new URL(window.location.href).searchParams; - if (query.has("console.level")) { - forge.log.setLevel( - sConsoleLogger, - query.get("console.level").slice(-1)[0] - ); - } - if (query.has("console.lock")) { - lock = query.get("console.lock").slice(-1)[0]; - if (lock == "true") { - forge.log.lock(sConsoleLogger); - } - } - } - var query; - var lock; - forge.log.consoleLogger = sConsoleLogger; - } -}); - -// node_modules/node-forge/lib/md.all.js -var require_md_all = __commonJS({ - "node_modules/node-forge/lib/md.all.js"(exports2, module2) { - module2.exports = require_md(); - require_md5(); - require_sha1(); - require_sha2562(); - require_sha512(); - } -}); - -// node_modules/node-forge/lib/pkcs7.js -var require_pkcs7 = __commonJS({ - "node_modules/node-forge/lib/pkcs7.js"(exports2, module2) { - var forge = require_forge(); - require_aes(); - require_asn1(); - require_des(); - require_oids(); - require_pem(); - require_pkcs7asn1(); - require_random2(); - require_util16(); - require_x509(); - var asn1 = forge.asn1; - var p7 = module2.exports = forge.pkcs7 = forge.pkcs7 || {}; - p7.messageFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "PKCS7") { - var error3 = new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".'); - error3.headerType = msg.type; - throw error3; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted."); - } - var obj = asn1.fromDer(msg.body); - return p7.messageFromAsn1(obj); - }; - p7.messageToPem = function(msg, maxline) { - var pemObj = { - type: "PKCS7", - body: asn1.toDer(msg.toAsn1()).getBytes() - }; - return forge.pem.encode(pemObj, { maxline }); - }; - p7.messageFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - if (!asn1.validate(obj, p7.asn1.contentInfoValidator, capture, errors)) { - var error3 = new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo."); - error3.errors = errors; - throw error3; - } - var contentType = asn1.derToOid(capture.contentType); - var msg; - switch (contentType) { - case forge.pki.oids.envelopedData: - msg = p7.createEnvelopedData(); - break; - case forge.pki.oids.encryptedData: - msg = p7.createEncryptedData(); - break; - case forge.pki.oids.signedData: - msg = p7.createSignedData(); - break; - default: - throw new Error("Cannot read PKCS#7 message. ContentType with OID " + contentType + " is not (yet) supported."); - } - msg.fromAsn1(capture.content.value[0]); - return msg; - }; - p7.createSignedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.signedData, - version: 1, - certificates: [], - crls: [], - // TODO: add json-formatted signer stuff here? - signers: [], - // populated during sign() - digestAlgorithmIdentifiers: [], - contentInfo: null, - signerInfos: [], - fromAsn1: function(obj) { - _fromAsn1(msg, obj, p7.asn1.signedDataValidator); - msg.certificates = []; - msg.crls = []; - msg.digestAlgorithmIdentifiers = []; - msg.contentInfo = null; - msg.signerInfos = []; - if (msg.rawCapture.certificates) { - var certs = msg.rawCapture.certificates.value; - for (var i = 0; i < certs.length; ++i) { - msg.certificates.push(forge.pki.certificateFromAsn1(certs[i])); - } - } - }, - toAsn1: function() { - if (!msg.contentInfo) { - msg.sign(); - } - var certs = []; - for (var i = 0; i < msg.certificates.length; ++i) { - certs.push(forge.pki.certificateToAsn1(msg.certificates[i])); - } - var crls = []; - var signedData = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(msg.version).getBytes() - ), - // DigestAlgorithmIdentifiers - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SET, - true, - msg.digestAlgorithmIdentifiers - ), - // ContentInfo - msg.contentInfo - ]) - ]); - if (certs.length > 0) { - signedData.value[0].value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, certs) - ); - } - if (crls.length > 0) { - signedData.value[0].value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, crls) - ); - } - signedData.value[0].value.push( - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SET, - true, - msg.signerInfos - ) - ); - return asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [ - // ContentType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(msg.type).getBytes() - ), - // [0] SignedData - signedData - ] - ); - }, - /** - * Add (another) entity to list of signers. - * - * Note: If authenticatedAttributes are provided, then, per RFC 2315, - * they must include at least two attributes: content type and - * message digest. The message digest attribute value will be - * auto-calculated during signing and will be ignored if provided. - * - * Here's an example of providing these two attributes: - * - * forge.pkcs7.createSignedData(); - * p7.addSigner({ - * issuer: cert.issuer.attributes, - * serialNumber: cert.serialNumber, - * key: privateKey, - * digestAlgorithm: forge.pki.oids.sha1, - * authenticatedAttributes: [{ - * type: forge.pki.oids.contentType, - * value: forge.pki.oids.data - * }, { - * type: forge.pki.oids.messageDigest - * }] - * }); - * - * TODO: Support [subjectKeyIdentifier] as signer's ID. - * - * @param signer the signer information: - * key the signer's private key. - * [certificate] a certificate containing the public key - * associated with the signer's private key; use this option as - * an alternative to specifying signer.issuer and - * signer.serialNumber. - * [issuer] the issuer attributes (eg: cert.issuer.attributes). - * [serialNumber] the signer's certificate's serial number in - * hexadecimal (eg: cert.serialNumber). - * [digestAlgorithm] the message digest OID, as a string, to use - * (eg: forge.pki.oids.sha1). - * [authenticatedAttributes] an optional array of attributes - * to also sign along with the content. - */ - addSigner: function(signer) { - var issuer = signer.issuer; - var serialNumber = signer.serialNumber; - if (signer.certificate) { - var cert = signer.certificate; - if (typeof cert === "string") { - cert = forge.pki.certificateFromPem(cert); - } - issuer = cert.issuer.attributes; - serialNumber = cert.serialNumber; - } - var key = signer.key; - if (!key) { - throw new Error( - "Could not add PKCS#7 signer; no private key specified." - ); - } - if (typeof key === "string") { - key = forge.pki.privateKeyFromPem(key); - } - var digestAlgorithm = signer.digestAlgorithm || forge.pki.oids.sha1; - switch (digestAlgorithm) { - case forge.pki.oids.sha1: - case forge.pki.oids.sha256: - case forge.pki.oids.sha384: - case forge.pki.oids.sha512: - case forge.pki.oids.md5: - break; - default: - throw new Error( - "Could not add PKCS#7 signer; unknown message digest algorithm: " + digestAlgorithm - ); - } - var authenticatedAttributes = signer.authenticatedAttributes || []; - if (authenticatedAttributes.length > 0) { - var contentType = false; - var messageDigest = false; - for (var i = 0; i < authenticatedAttributes.length; ++i) { - var attr = authenticatedAttributes[i]; - if (!contentType && attr.type === forge.pki.oids.contentType) { - contentType = true; - if (messageDigest) { - break; - } - continue; - } - if (!messageDigest && attr.type === forge.pki.oids.messageDigest) { - messageDigest = true; - if (contentType) { - break; - } - continue; - } - } - if (!contentType || !messageDigest) { - throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest."); - } - } - msg.signers.push({ - key, - version: 1, - issuer, - serialNumber, - digestAlgorithm, - signatureAlgorithm: forge.pki.oids.rsaEncryption, - signature: null, - authenticatedAttributes, - unauthenticatedAttributes: [] - }); - }, - /** - * Signs the content. - * @param options Options to apply when signing: - * [detached] boolean. If signing should be done in detached mode. Defaults to false. - */ - sign: function(options) { - options = options || {}; - if (typeof msg.content !== "object" || msg.contentInfo === null) { - msg.contentInfo = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [ - // ContentType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(forge.pki.oids.data).getBytes() - ) - ] - ); - if ("content" in msg) { - var content; - if (msg.content instanceof forge.util.ByteBuffer) { - content = msg.content.bytes(); - } else if (typeof msg.content === "string") { - content = forge.util.encodeUtf8(msg.content); - } - if (options.detached) { - msg.detachedContent = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content); - } else { - msg.contentInfo.value.push( - // [0] EXPLICIT content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - content - ) - ]) - ); - } - } - } - if (msg.signers.length === 0) { - return; - } - var mds = addDigestAlgorithmIds(); - addSignerInfos(mds); - }, - verify: function() { - throw new Error("PKCS#7 signature verification not yet implemented."); - }, - /** - * Add a certificate. - * - * @param cert the certificate to add. - */ - addCertificate: function(cert) { - if (typeof cert === "string") { - cert = forge.pki.certificateFromPem(cert); - } - msg.certificates.push(cert); - }, - /** - * Add a certificate revokation list. - * - * @param crl the certificate revokation list to add. - */ - addCertificateRevokationList: function(crl) { - throw new Error("PKCS#7 CRL support not yet implemented."); - } - }; - return msg; - function addDigestAlgorithmIds() { - var mds = {}; - for (var i = 0; i < msg.signers.length; ++i) { - var signer = msg.signers[i]; - var oid = signer.digestAlgorithm; - if (!(oid in mds)) { - mds[oid] = forge.md[forge.pki.oids[oid]].create(); - } - if (signer.authenticatedAttributes.length === 0) { - signer.md = mds[oid]; - } else { - signer.md = forge.md[forge.pki.oids[oid]].create(); - } - } - msg.digestAlgorithmIdentifiers = []; - for (var oid in mds) { - msg.digestAlgorithmIdentifiers.push( - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(oid).getBytes() - ), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]) - ); - } - return mds; - } - function addSignerInfos(mds) { - var content; - if (msg.detachedContent) { - content = msg.detachedContent; - } else { - content = msg.contentInfo.value[1]; - content = content.value[0]; - } - if (!content) { - throw new Error( - "Could not sign PKCS#7 message; there is no content to sign." - ); - } - var contentType = asn1.derToOid(msg.contentInfo.value[0].value); - var bytes = asn1.toDer(content); - bytes.getByte(); - asn1.getBerValueLength(bytes); - bytes = bytes.getBytes(); - for (var oid in mds) { - mds[oid].start().update(bytes); - } - var signingTime = /* @__PURE__ */ new Date(); - for (var i = 0; i < msg.signers.length; ++i) { - var signer = msg.signers[i]; - if (signer.authenticatedAttributes.length === 0) { - if (contentType !== forge.pki.oids.data) { - throw new Error( - "Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data." - ); - } - } else { - signer.authenticatedAttributesAsn1 = asn1.create( - asn1.Class.CONTEXT_SPECIFIC, - 0, - true, - [] - ); - var attrsAsn1 = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SET, - true, - [] - ); - for (var ai = 0; ai < signer.authenticatedAttributes.length; ++ai) { - var attr = signer.authenticatedAttributes[ai]; - if (attr.type === forge.pki.oids.messageDigest) { - attr.value = mds[signer.digestAlgorithm].digest(); - } else if (attr.type === forge.pki.oids.signingTime) { - if (!attr.value) { - attr.value = signingTime; - } - } - attrsAsn1.value.push(_attributeToAsn1(attr)); - signer.authenticatedAttributesAsn1.value.push(_attributeToAsn1(attr)); - } - bytes = asn1.toDer(attrsAsn1).getBytes(); - signer.md.start().update(bytes); - } - signer.signature = signer.key.sign(signer.md, "RSASSA-PKCS1-V1_5"); - } - msg.signerInfos = _signersToAsn1(msg.signers); - } - }; - p7.createEncryptedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.encryptedData, - version: 0, - encryptedContent: { - algorithm: forge.pki.oids["aes256-CBC"] - }, - /** - * Reads an EncryptedData content block (in ASN.1 format) - * - * @param obj The ASN.1 representation of the EncryptedData content block - */ - fromAsn1: function(obj) { - _fromAsn1(msg, obj, p7.asn1.encryptedDataValidator); - }, - /** - * Decrypt encrypted content - * - * @param key The (symmetric) key as a byte buffer - */ - decrypt: function(key) { - if (key !== void 0) { - msg.encryptedContent.key = key; - } - _decryptContent(msg); - } - }; - return msg; - }; - p7.createEnvelopedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.envelopedData, - version: 0, - recipients: [], - encryptedContent: { - algorithm: forge.pki.oids["aes256-CBC"] - }, - /** - * Reads an EnvelopedData content block (in ASN.1 format) - * - * @param obj the ASN.1 representation of the EnvelopedData content block. - */ - fromAsn1: function(obj) { - var capture = _fromAsn1(msg, obj, p7.asn1.envelopedDataValidator); - msg.recipients = _recipientsFromAsn1(capture.recipientInfos.value); - }, - toAsn1: function() { - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // ContentType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(msg.type).getBytes() - ), - // [0] EnvelopedData - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(msg.version).getBytes() - ), - // RecipientInfos - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SET, - true, - _recipientsToAsn1(msg.recipients) - ), - // EncryptedContentInfo - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - _encryptedContentToAsn1(msg.encryptedContent) - ) - ]) - ]) - ]); - }, - /** - * Find recipient by X.509 certificate's issuer. - * - * @param cert the certificate with the issuer to look for. - * - * @return the recipient object. - */ - findRecipient: function(cert) { - var sAttr = cert.issuer.attributes; - for (var i = 0; i < msg.recipients.length; ++i) { - var r = msg.recipients[i]; - var rAttr = r.issuer; - if (r.serialNumber !== cert.serialNumber) { - continue; - } - if (rAttr.length !== sAttr.length) { - continue; - } - var match2 = true; - for (var j = 0; j < sAttr.length; ++j) { - if (rAttr[j].type !== sAttr[j].type || rAttr[j].value !== sAttr[j].value) { - match2 = false; - break; - } - } - if (match2) { - return r; - } - } - return null; - }, - /** - * Decrypt enveloped content - * - * @param recipient The recipient object related to the private key - * @param privKey The (RSA) private key object - */ - decrypt: function(recipient, privKey) { - if (msg.encryptedContent.key === void 0 && recipient !== void 0 && privKey !== void 0) { - switch (recipient.encryptedContent.algorithm) { - case forge.pki.oids.rsaEncryption: - case forge.pki.oids.desCBC: - var key = privKey.decrypt(recipient.encryptedContent.content); - msg.encryptedContent.key = forge.util.createBuffer(key); - break; - default: - throw new Error("Unsupported asymmetric cipher, OID " + recipient.encryptedContent.algorithm); - } - } - _decryptContent(msg); - }, - /** - * Add (another) entity to list of recipients. - * - * @param cert The certificate of the entity to add. - */ - addRecipient: function(cert) { - msg.recipients.push({ - version: 0, - issuer: cert.issuer.attributes, - serialNumber: cert.serialNumber, - encryptedContent: { - // We simply assume rsaEncryption here, since forge.pki only - // supports RSA so far. If the PKI module supports other - // ciphers one day, we need to modify this one as well. - algorithm: forge.pki.oids.rsaEncryption, - key: cert.publicKey - } - }); - }, - /** - * Encrypt enveloped content. - * - * This function supports two optional arguments, cipher and key, which - * can be used to influence symmetric encryption. Unless cipher is - * provided, the cipher specified in encryptedContent.algorithm is used - * (defaults to AES-256-CBC). If no key is provided, encryptedContent.key - * is (re-)used. If that one's not set, a random key will be generated - * automatically. - * - * @param [key] The key to be used for symmetric encryption. - * @param [cipher] The OID of the symmetric cipher to use. - */ - encrypt: function(key, cipher) { - if (msg.encryptedContent.content === void 0) { - cipher = cipher || msg.encryptedContent.algorithm; - key = key || msg.encryptedContent.key; - var keyLen, ivLen, ciphFn; - switch (cipher) { - case forge.pki.oids["aes128-CBC"]: - keyLen = 16; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - case forge.pki.oids["aes192-CBC"]: - keyLen = 24; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - case forge.pki.oids["aes256-CBC"]: - keyLen = 32; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - case forge.pki.oids["des-EDE3-CBC"]: - keyLen = 24; - ivLen = 8; - ciphFn = forge.des.createEncryptionCipher; - break; - default: - throw new Error("Unsupported symmetric cipher, OID " + cipher); - } - if (key === void 0) { - key = forge.util.createBuffer(forge.random.getBytes(keyLen)); - } else if (key.length() != keyLen) { - throw new Error("Symmetric key has wrong length; got " + key.length() + " bytes, expected " + keyLen + "."); - } - msg.encryptedContent.algorithm = cipher; - msg.encryptedContent.key = key; - msg.encryptedContent.parameter = forge.util.createBuffer( - forge.random.getBytes(ivLen) - ); - var ciph = ciphFn(key); - ciph.start(msg.encryptedContent.parameter.copy()); - ciph.update(msg.content); - if (!ciph.finish()) { - throw new Error("Symmetric encryption failed."); - } - msg.encryptedContent.content = ciph.output; - } - for (var i = 0; i < msg.recipients.length; ++i) { - var recipient = msg.recipients[i]; - if (recipient.encryptedContent.content !== void 0) { - continue; - } - switch (recipient.encryptedContent.algorithm) { - case forge.pki.oids.rsaEncryption: - recipient.encryptedContent.content = recipient.encryptedContent.key.encrypt( - msg.encryptedContent.key.data - ); - break; - default: - throw new Error("Unsupported asymmetric cipher, OID " + recipient.encryptedContent.algorithm); - } - } - } - }; - return msg; - }; - function _recipientFromAsn1(obj) { - var capture = {}; - var errors = []; - if (!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) { - var error3 = new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo."); - error3.errors = errors; - throw error3; - } - return { - version: capture.version.charCodeAt(0), - issuer: forge.pki.RDNAttributesAsArray(capture.issuer), - serialNumber: forge.util.createBuffer(capture.serial).toHex(), - encryptedContent: { - algorithm: asn1.derToOid(capture.encAlgorithm), - parameter: capture.encParameter ? capture.encParameter.value : void 0, - content: capture.encKey - } - }; - } - function _recipientToAsn1(obj) { - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(obj.version).getBytes() - ), - // IssuerAndSerialNumber - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Name - forge.pki.distinguishedNameToAsn1({ attributes: obj.issuer }), - // Serial - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - forge.util.hexToBytes(obj.serialNumber) - ) - ]), - // KeyEncryptionAlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(obj.encryptedContent.algorithm).getBytes() - ), - // Parameter, force NULL, only RSA supported for now. - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]), - // EncryptedKey - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - obj.encryptedContent.content - ) - ]); - } - function _recipientsFromAsn1(infos) { - var ret = []; - for (var i = 0; i < infos.length; ++i) { - ret.push(_recipientFromAsn1(infos[i])); - } - return ret; - } - function _recipientsToAsn1(recipients) { - var ret = []; - for (var i = 0; i < recipients.length; ++i) { - ret.push(_recipientToAsn1(recipients[i])); - } - return ret; - } - function _signerToAsn1(obj) { - var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - asn1.integerToDer(obj.version).getBytes() - ), - // issuerAndSerialNumber - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // name - forge.pki.distinguishedNameToAsn1({ attributes: obj.issuer }), - // serial - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.INTEGER, - false, - forge.util.hexToBytes(obj.serialNumber) - ) - ]), - // digestAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(obj.digestAlgorithm).getBytes() - ), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ]) - ]); - if (obj.authenticatedAttributesAsn1) { - rval.value.push(obj.authenticatedAttributesAsn1); - } - rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(obj.signatureAlgorithm).getBytes() - ), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") - ])); - rval.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - obj.signature - )); - if (obj.unauthenticatedAttributes.length > 0) { - var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []); - for (var i = 0; i < obj.unauthenticatedAttributes.length; ++i) { - var attr = obj.unauthenticatedAttributes[i]; - attrsAsn1.values.push(_attributeToAsn1(attr)); - } - rval.value.push(attrsAsn1); - } - return rval; - } - function _signersToAsn1(signers) { - var ret = []; - for (var i = 0; i < signers.length; ++i) { - ret.push(_signerToAsn1(signers[i])); - } - return ret; - } - function _attributeToAsn1(attr) { - var value; - if (attr.type === forge.pki.oids.contentType) { - value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(attr.value).getBytes() - ); - } else if (attr.type === forge.pki.oids.messageDigest) { - value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - attr.value.bytes() - ); - } else if (attr.type === forge.pki.oids.signingTime) { - var jan_1_1950 = /* @__PURE__ */ new Date("1950-01-01T00:00:00Z"); - var jan_1_2050 = /* @__PURE__ */ new Date("2050-01-01T00:00:00Z"); - var date = attr.value; - if (typeof date === "string") { - var timestamp = Date.parse(date); - if (!isNaN(timestamp)) { - date = new Date(timestamp); - } else if (date.length === 13) { - date = asn1.utcTimeToDate(date); - } else { - date = asn1.generalizedTimeToDate(date); - } - } - if (date >= jan_1_1950 && date < jan_1_2050) { - value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.UTCTIME, - false, - asn1.dateToUtcTime(date) - ); - } else { - value = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.GENERALIZEDTIME, - false, - asn1.dateToGeneralizedTime(date) - ); - } - } - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(attr.type).getBytes() - ), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - // AttributeValue - value - ]) - ]); - } - function _encryptedContentToAsn1(ec) { - return [ - // ContentType, always Data for the moment - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(forge.pki.oids.data).getBytes() - ), - // ContentEncryptionAlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Algorithm - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(ec.algorithm).getBytes() - ), - // Parameters (IV) - !ec.parameter ? void 0 : asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - ec.parameter.getBytes() - ) - ]), - // [0] EncryptedContent - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OCTETSTRING, - false, - ec.content.getBytes() - ) - ]) - ]; - } - function _fromAsn1(msg, obj, validator) { - var capture = {}; - var errors = []; - if (!asn1.validate(obj, validator, capture, errors)) { - var error3 = new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message."); - error3.errors = error3; - throw error3; - } - var contentType = asn1.derToOid(capture.contentType); - if (contentType !== forge.pki.oids.data) { - throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported."); - } - if (capture.encryptedContent) { - var content = ""; - if (forge.util.isArray(capture.encryptedContent)) { - for (var i = 0; i < capture.encryptedContent.length; ++i) { - if (capture.encryptedContent[i].type !== asn1.Type.OCTETSTRING) { - throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects."); - } - content += capture.encryptedContent[i].value; - } - } else { - content = capture.encryptedContent; - } - msg.encryptedContent = { - algorithm: asn1.derToOid(capture.encAlgorithm), - parameter: forge.util.createBuffer(capture.encParameter.value), - content: forge.util.createBuffer(content) - }; - } - if (capture.content) { - var content = ""; - if (forge.util.isArray(capture.content)) { - for (var i = 0; i < capture.content.length; ++i) { - if (capture.content[i].type !== asn1.Type.OCTETSTRING) { - throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects."); - } - content += capture.content[i].value; - } - } else { - content = capture.content; - } - msg.content = forge.util.createBuffer(content); - } - msg.version = capture.version.charCodeAt(0); - msg.rawCapture = capture; - return capture; - } - function _decryptContent(msg) { - if (msg.encryptedContent.key === void 0) { - throw new Error("Symmetric key not available."); - } - if (msg.content === void 0) { - var ciph; - switch (msg.encryptedContent.algorithm) { - case forge.pki.oids["aes128-CBC"]: - case forge.pki.oids["aes192-CBC"]: - case forge.pki.oids["aes256-CBC"]: - ciph = forge.aes.createDecryptionCipher(msg.encryptedContent.key); - break; - case forge.pki.oids["desCBC"]: - case forge.pki.oids["des-EDE3-CBC"]: - ciph = forge.des.createDecryptionCipher(msg.encryptedContent.key); - break; - default: - throw new Error("Unsupported symmetric cipher, OID " + msg.encryptedContent.algorithm); - } - ciph.start(msg.encryptedContent.parameter); - ciph.update(msg.encryptedContent.content); - if (!ciph.finish()) { - throw new Error("Symmetric decryption failed."); - } - msg.content = ciph.output; - } - } - } -}); - -// node_modules/node-forge/lib/ssh.js -var require_ssh = __commonJS({ - "node_modules/node-forge/lib/ssh.js"(exports2, module2) { - var forge = require_forge(); - require_aes(); - require_hmac(); - require_md5(); - require_sha1(); - require_util16(); - var ssh = module2.exports = forge.ssh = forge.ssh || {}; - ssh.privateKeyToPutty = function(privateKey, passphrase, comment) { - comment = comment || ""; - passphrase = passphrase || ""; - var algorithm = "ssh-rsa"; - var encryptionAlgorithm = passphrase === "" ? "none" : "aes256-cbc"; - var ppk = "PuTTY-User-Key-File-2: " + algorithm + "\r\n"; - ppk += "Encryption: " + encryptionAlgorithm + "\r\n"; - ppk += "Comment: " + comment + "\r\n"; - var pubbuffer = forge.util.createBuffer(); - _addStringToBuffer(pubbuffer, algorithm); - _addBigIntegerToBuffer(pubbuffer, privateKey.e); - _addBigIntegerToBuffer(pubbuffer, privateKey.n); - var pub = forge.util.encode64(pubbuffer.bytes(), 64); - var length = Math.floor(pub.length / 66) + 1; - ppk += "Public-Lines: " + length + "\r\n"; - ppk += pub; - var privbuffer = forge.util.createBuffer(); - _addBigIntegerToBuffer(privbuffer, privateKey.d); - _addBigIntegerToBuffer(privbuffer, privateKey.p); - _addBigIntegerToBuffer(privbuffer, privateKey.q); - _addBigIntegerToBuffer(privbuffer, privateKey.qInv); - var priv; - if (!passphrase) { - priv = forge.util.encode64(privbuffer.bytes(), 64); - } else { - var encLen = privbuffer.length() + 16 - 1; - encLen -= encLen % 16; - var padding = _sha1(privbuffer.bytes()); - padding.truncate(padding.length() - encLen + privbuffer.length()); - privbuffer.putBuffer(padding); - var aeskey = forge.util.createBuffer(); - aeskey.putBuffer(_sha1("\0\0\0\0", passphrase)); - aeskey.putBuffer(_sha1("\0\0\0", passphrase)); - var cipher = forge.aes.createEncryptionCipher(aeskey.truncate(8), "CBC"); - cipher.start(forge.util.createBuffer().fillWithByte(0, 16)); - cipher.update(privbuffer.copy()); - cipher.finish(); - var encrypted = cipher.output; - encrypted.truncate(16); - priv = forge.util.encode64(encrypted.bytes(), 64); - } - length = Math.floor(priv.length / 66) + 1; - ppk += "\r\nPrivate-Lines: " + length + "\r\n"; - ppk += priv; - var mackey = _sha1("putty-private-key-file-mac-key", passphrase); - var macbuffer = forge.util.createBuffer(); - _addStringToBuffer(macbuffer, algorithm); - _addStringToBuffer(macbuffer, encryptionAlgorithm); - _addStringToBuffer(macbuffer, comment); - macbuffer.putInt32(pubbuffer.length()); - macbuffer.putBuffer(pubbuffer); - macbuffer.putInt32(privbuffer.length()); - macbuffer.putBuffer(privbuffer); - var hmac = forge.hmac.create(); - hmac.start("sha1", mackey); - hmac.update(macbuffer.bytes()); - ppk += "\r\nPrivate-MAC: " + hmac.digest().toHex() + "\r\n"; - return ppk; - }; - ssh.publicKeyToOpenSSH = function(key, comment) { - var type = "ssh-rsa"; - comment = comment || ""; - var buffer = forge.util.createBuffer(); - _addStringToBuffer(buffer, type); - _addBigIntegerToBuffer(buffer, key.e); - _addBigIntegerToBuffer(buffer, key.n); - return type + " " + forge.util.encode64(buffer.bytes()) + " " + comment; - }; - ssh.privateKeyToOpenSSH = function(privateKey, passphrase) { - if (!passphrase) { - return forge.pki.privateKeyToPem(privateKey); - } - return forge.pki.encryptRsaPrivateKey( - privateKey, - passphrase, - { legacy: true, algorithm: "aes128" } - ); - }; - ssh.getPublicKeyFingerprint = function(key, options) { - options = options || {}; - var md2 = options.md || forge.md.md5.create(); - var type = "ssh-rsa"; - var buffer = forge.util.createBuffer(); - _addStringToBuffer(buffer, type); - _addBigIntegerToBuffer(buffer, key.e); - _addBigIntegerToBuffer(buffer, key.n); - md2.start(); - md2.update(buffer.getBytes()); - var digest = md2.digest(); - if (options.encoding === "hex") { - var hex = digest.toHex(); - if (options.delimiter) { - return hex.match(/.{2}/g).join(options.delimiter); - } - return hex; - } else if (options.encoding === "binary") { - return digest.getBytes(); - } else if (options.encoding) { - throw new Error('Unknown encoding "' + options.encoding + '".'); - } - return digest; - }; - function _addBigIntegerToBuffer(buffer, val) { - var hexVal = val.toString(16); - if (hexVal[0] >= "8") { - hexVal = "00" + hexVal; - } - var bytes = forge.util.hexToBytes(hexVal); - buffer.putInt32(bytes.length); - buffer.putBytes(bytes); - } - function _addStringToBuffer(buffer, val) { - buffer.putInt32(val.length); - buffer.putString(val); - } - function _sha1() { - var sha = forge.md.sha1.create(); - var num = arguments.length; - for (var i = 0; i < num; ++i) { - sha.update(arguments[i]); - } - return sha.digest(); - } - } -}); - -// node_modules/node-forge/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/node-forge/lib/index.js"(exports2, module2) { - module2.exports = require_forge(); - require_aes(); - require_aesCipherSuites(); - require_asn1(); - require_cipher(); - require_des(); - require_ed25519(); - require_hmac(); - require_kem(); - require_log7(); - require_md_all(); - require_mgf1(); - require_pbkdf2(); - require_pem(); - require_pkcs1(); - require_pkcs12(); - require_pkcs7(); - require_pki(); - require_prime(); - require_prng(); - require_pss(); - require_random2(); - require_rc2(); - require_ssh(); - require_tls(); - require_util16(); - } -}); - -// actions:entry-points -var entry_points_exports = {}; -__export(entry_points_exports, { - runAnalyzeAction: () => runAnalyzeAction, - runAnalyzePostAction: () => runAnalyzePostAction, - runAutobuildAction: () => runAutobuildAction, - runInitAction: () => runInitAction, - runInitPostAction: () => runInitPostAction, - runResolveEnvironmentAction: () => runResolveEnvironmentAction, - runSetupCodeqlAction: () => runSetupCodeqlAction, - runStartProxyAction: () => runStartProxyAction, - runStartProxyPostAction: () => runStartProxyPostAction, - runUploadSarifAction: () => runUploadSarifAction, - runUploadSarifPostAction: () => runUploadSarifPostAction, - uploadLib: () => upload_lib_exports -}); -module.exports = __toCommonJS(entry_points_exports); - -// src/analyze-action.ts -var fs23 = __toESM(require("fs")); -var import_path5 = __toESM(require("path")); -var import_perf_hooks4 = require("perf_hooks"); -var core16 = __toESM(require_core()); - -// src/action-common.ts -var core8 = __toESM(require_core()); - -// src/actions-util.ts -var fs2 = __toESM(require("fs")); -var path2 = __toESM(require("path")); -var core3 = __toESM(require_core()); -var toolrunner = __toESM(require_toolrunner()); -var github = __toESM(require_github()); -var io2 = __toESM(require_io()); - -// src/environment.ts -function getRequiredEnvVar(env, paramName) { - const value = env[paramName]; - if (value === void 0 || value.length === 0) { - throw new Error(`${paramName} environment variable must be set`); - } - return value; -} -function getRequiredEnvParam(paramName) { - return getRequiredEnvVar(process.env, paramName); -} -function getOptionalEnvVarFrom(env, paramName) { - const value = env[paramName]; - if (value?.trim().length === 0) { - return void 0; - } - return value; -} -function getOptionalEnvVar(paramName) { - return getOptionalEnvVarFrom(process.env, paramName); -} -var ReadOnlyEnv = class { - constructor(vars) { - this.vars = vars; - } - vars; - /** Clones the object while detaching the underlying environment from the original. */ - clone() { - return Object.create(this, { vars: { value: { ...this.vars } } }); - } - /** Gets a copy of the underlying environment. */ - get() { - return { ...this.vars }; - } - /** Tries to get the value for `name` and throws if there isn't one. */ - getRequired(name) { - return getRequiredEnvVar(this.vars, name); - } - /** Gets the value for `name`, or `undefined` if it isn't set or empty. */ - getOptional(name) { - return getOptionalEnvVarFrom(this.vars, name); - } - /** Gets the entries of the underlying `ProcessEnv`. */ - entries() { - return Object.entries(this.vars); - } -}; -var Env = class extends ReadOnlyEnv { - changed = false; - /** Sets an environment variable. */ - set(name, value) { - this.vars[name] = value; - this.changed = true; - } - /** Gets a value indicating whether `set` was called at least once. */ - hasChanged() { - return this.changed; - } -}; -function getEnv(env = process.env) { - return new Env(env); -} - -// src/util.ts -var fs = __toESM(require("fs")); -var fsPromises = __toESM(require("fs/promises")); -var os = __toESM(require("os")); -var path = __toESM(require("path")); -var core2 = __toESM(require_core()); -var io = __toESM(require_io()); - -// node_modules/get-folder-size/index.js -var import_node_path = require("node:path"); -async function getFolderSize(itemPath, options) { - return await core(itemPath, options, { errors: true }); -} -getFolderSize.loose = async (itemPath, options) => await core(itemPath, options); -getFolderSize.strict = async (itemPath, options) => await core(itemPath, options, { strict: true }); -async function core(rootItemPath, options = {}, returnType = {}) { - const fs32 = options.fs || await import("node:fs/promises"); - let folderSize = 0n; - const foundInos = /* @__PURE__ */ new Set(); - const errors = []; - await processItem(rootItemPath); - async function processItem(itemPath) { - if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs32.lstat(itemPath, { bigint: true }) : await fs32.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); - if (typeof stats !== "object") return; - if (!foundInos.has(stats.ino)) { - foundInos.add(stats.ino); - folderSize += stats.size; - } - if (stats.isDirectory()) { - const directoryItems = returnType.strict ? await fs32.readdir(itemPath) : await fs32.readdir(itemPath).catch((error3) => errors.push(error3)); - if (typeof directoryItems !== "object") return; - await Promise.all( - directoryItems.map( - (directoryItem) => processItem((0, import_node_path.join)(itemPath, directoryItem)) - ) - ); - } - } - if (!options.bigint) { - if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error3 = new RangeError( - "The folder size is too large to return as a Number. You can instruct this package to return a BigInt instead." - ); - if (returnType.strict) { - throw error3; - } - errors.push(error3); - folderSize = Number.MAX_SAFE_INTEGER; - } else { - folderSize = Number(folderSize); - } - } - if (returnType.errors) { - return { - size: folderSize, - errors: errors.length > 0 ? errors : null - }; - } else { - return folderSize; - } -} - -// node_modules/js-yaml/dist/js-yaml.mjs -var NOT_RESOLVED = /* @__PURE__ */ Symbol("NOT_RESOLVED"); -var MERGE_KEY = /* @__PURE__ */ Symbol("MERGE_KEY"); -function defineScalarTag(tagName, options) { - return { - tagName, - nodeKind: "scalar", - implicit: options.implicit ?? false, - matchByTagPrefix: options.matchByTagPrefix ?? false, - implicitFirstChars: options.implicitFirstChars ?? null, - resolve: options.resolve, - identify: options.identify ?? null, - represent: options.represent ?? ((data) => String(data)), - representTagName: options.representTagName ?? null - }; -} -function defineSequenceTag(tagName, options) { - const carrierIsResult = options.finalize === void 0; - return { - tagName, - nodeKind: "sequence", - implicit: false, - matchByTagPrefix: options.matchByTagPrefix ?? false, - create: options.create, - addItem: options.addItem, - finalize: options.finalize ?? ((carrier) => carrier), - carrierIsResult, - identify: options.identify ?? null, - represent: options.represent ?? ((data) => data), - representTagName: options.representTagName ?? null - }; -} -function defineMappingTag(tagName, options) { - const carrierIsResult = options.finalize === void 0; - return { - tagName, - nodeKind: "mapping", - implicit: false, - matchByTagPrefix: options.matchByTagPrefix ?? false, - create: options.create, - addPair: options.addPair, - has: options.has, - keys: options.keys, - get: options.get, - finalize: options.finalize ?? ((carrier) => carrier), - carrierIsResult, - identify: options.identify ?? null, - represent: options.represent ?? ((data) => data), - representTagName: options.representTagName ?? null - }; -} -var strTag = defineScalarTag("tag:yaml.org,2002:str", { - resolve: (source) => source, - identify: (data) => typeof data === "string" -}); -var NULL_VALUES$1 = [ - "", - "~", - "null", - "Null", - "NULL" -]; -var nullCoreTag = defineScalarTag("tag:yaml.org,2002:null", { - implicit: true, - implicitFirstChars: [ - "", - "~", - "n", - "N" - ], - resolve: (source) => { - if (NULL_VALUES$1.indexOf(source) !== -1) return null; - return NOT_RESOLVED; - }, - identify: (object2) => object2 === null, - represent: () => "null" -}); -var nullJsonTag = defineScalarTag("tag:yaml.org,2002:null", { - implicit: true, - implicitFirstChars: ["n"], - resolve: (source, isExplicit) => { - if (source === "null" || isExplicit && source === "") return null; - return NOT_RESOLVED; - }, - identify: (object2) => object2 === null, - represent: () => "null" -}); -var NULL_VALUES = [ - "", - "~", - "null", - "Null", - "NULL" -]; -var nullYaml11Tag = defineScalarTag("tag:yaml.org,2002:null", { - implicit: true, - implicitFirstChars: [ - "", - "~", - "n", - "N" - ], - resolve: (source) => { - if (NULL_VALUES.indexOf(source) !== -1) return null; - return NOT_RESOLVED; - }, - identify: (object2) => object2 === null, - represent: () => "null" -}); -var TRUE_VALUES$2 = [ - "true", - "True", - "TRUE" -]; -var FALSE_VALUES$2 = [ - "false", - "False", - "FALSE" -]; -var boolCoreTag = defineScalarTag("tag:yaml.org,2002:bool", { - implicit: true, - implicitFirstChars: [ - "t", - "T", - "f", - "F" - ], - resolve: (source) => { - if (TRUE_VALUES$2.indexOf(source) !== -1) return true; - if (FALSE_VALUES$2.indexOf(source) !== -1) return false; - return NOT_RESOLVED; - }, - identify: (object2) => Object.prototype.toString.call(object2) === "[object Boolean]", - represent: (object2) => object2 ? "true" : "false" -}); -var TRUE_VALUES$1 = ["true"]; -var FALSE_VALUES$1 = ["false"]; -var boolJsonTag = defineScalarTag("tag:yaml.org,2002:bool", { - implicit: true, - implicitFirstChars: ["t", "f"], - resolve: (source) => { - if (TRUE_VALUES$1.indexOf(source) !== -1) return true; - if (FALSE_VALUES$1.indexOf(source) !== -1) return false; - return NOT_RESOLVED; - }, - identify: (object2) => Object.prototype.toString.call(object2) === "[object Boolean]", - represent: (object2) => object2 ? "true" : "false" -}); -var TRUE_VALUES = [ - "true", - "True", - "TRUE", - "y", - "Y", - "yes", - "Yes", - "YES", - "on", - "On", - "ON" -]; -var FALSE_VALUES = [ - "false", - "False", - "FALSE", - "n", - "N", - "no", - "No", - "NO", - "off", - "Off", - "OFF" -]; -var boolYaml11Tag = defineScalarTag("tag:yaml.org,2002:bool", { - implicit: true, - implicitFirstChars: [ - "y", - "Y", - "n", - "N", - "t", - "T", - "f", - "F", - "o", - "O" - ], - resolve: (source) => { - if (TRUE_VALUES.indexOf(source) !== -1) return true; - if (FALSE_VALUES.indexOf(source) !== -1) return false; - return NOT_RESOLVED; - }, - identify: (object2) => Object.prototype.toString.call(object2) === "[object Boolean]", - represent: (object2) => object2 ? "true" : "false" -}); -var YAML_INTEGER_IMPLICIT_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"); -var YAML_INTEGER_EXPLICIT_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$"); -function parseYamlInteger$2(source) { - let value = source; - let sign = 1; - if (value[0] === "-" || value[0] === "+") { - if (value[0] === "-") sign = -1; - value = value.slice(1); - } - if (value.startsWith("0b")) return sign * parseInt(value.slice(2), 2); - if (value.startsWith("0o")) return sign * parseInt(value.slice(2), 8); - if (value.startsWith("0x")) return sign * parseInt(value.slice(2), 16); - return sign * parseInt(value, 10); -} -function resolveYamlInteger$2(source, isExplicit) { - if (isExplicit) { - if (!YAML_INTEGER_EXPLICIT_PATTERN$1.test(source)) return NOT_RESOLVED; - } else if (!YAML_INTEGER_IMPLICIT_PATTERN$1.test(source)) return NOT_RESOLVED; - const result = parseYamlInteger$2(source); - return Number.isFinite(result) ? result : NOT_RESOLVED; -} -var intCoreTag = defineScalarTag("tag:yaml.org,2002:int", { - implicit: true, - implicitFirstChars: [ - "-", - "+", - ..."0123456789" - ], - resolve: resolveYamlInteger$2, - identify: (object2) => Number.isInteger(object2) && !Object.is(object2, -0) && object2.toString(10).indexOf("e") < 0, - represent: (object2) => object2.toString(10) -}); -var YAML_INTEGER_IMPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)$"); -var YAML_INTEGER_EXPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$"); -function parseYamlInteger$1(source) { - let value = source; - let sign = 1; - if (value[0] === "-" || value[0] === "+") { - if (value[0] === "-") sign = -1; - value = value.slice(1); - } - if (value.startsWith("0b")) return sign * parseInt(value.slice(2), 2); - if (value.startsWith("0o")) return sign * parseInt(value.slice(2), 8); - if (value.startsWith("0x")) return sign * parseInt(value.slice(2), 16); - return sign * parseInt(value, 10); -} -function resolveYamlInteger$1(source, isExplicit) { - if (isExplicit) { - if (!YAML_INTEGER_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED; - } else if (!YAML_INTEGER_IMPLICIT_PATTERN.test(source)) return NOT_RESOLVED; - const result = parseYamlInteger$1(source); - return Number.isFinite(result) ? result : NOT_RESOLVED; -} -var intJsonTag = defineScalarTag("tag:yaml.org,2002:int", { - implicit: true, - implicitFirstChars: ["-", ..."0123456789"], - resolve: resolveYamlInteger$1, - identify: (object2) => Number.isInteger(object2) && !Object.is(object2, -0) && object2.toString(10).indexOf("e") < 0, - represent: (object2) => object2.toString(10) -}); -var YAML_INTEGER_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$"); -function parseYamlInteger(source) { - let value = source.replace(/_/g, ""); - let sign = 1; - if (value[0] === "-" || value[0] === "+") { - if (value[0] === "-") sign = -1; - value = value.slice(1); - } - if (value.startsWith("0b")) return sign * parseInt(value.slice(2), 2); - if (value.startsWith("0x")) return sign * parseInt(value.slice(2), 16); - if (value.includes(":")) { - let result = 0; - for (const part of value.split(":")) result = result * 60 + Number(part); - return sign * result; - } - if (value !== "0" && value[0] === "0") return sign * parseInt(value, 8); - return sign * parseInt(value, 10); -} -function resolveYamlInteger(source) { - if (!YAML_INTEGER_PATTERN.test(source)) return NOT_RESOLVED; - const result = parseYamlInteger(source); - return Number.isFinite(result) ? result : NOT_RESOLVED; -} -var intYaml11Tag = defineScalarTag("tag:yaml.org,2002:int", { - implicit: true, - implicitFirstChars: [ - "-", - "+", - ..."0123456789" - ], - resolve: resolveYamlInteger, - identify: (object2) => Number.isInteger(object2) && !Object.is(object2, -0) && object2.toString(10).indexOf("e") < 0, - represent: (object2) => object2.toString(10) -}); -var YAML_FLOAT_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); -var YAML_FLOAT_SPECIAL_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); -function resolveYamlFloat$2(source) { - if (!YAML_FLOAT_PATTERN$1.test(source)) return NOT_RESOLVED; - let value = source.toLowerCase(); - const sign = value[0] === "-" ? -1 : 1; - if ("+-".includes(value[0])) value = value.slice(1); - if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - if (value === ".nan") return NaN; - const result = sign * parseFloat(value); - if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN$1.test(source)) return result; - return NOT_RESOLVED; -} -function representYamlFloat$2(object2) { - if (isNaN(object2)) return ".nan"; - if (object2 === Number.POSITIVE_INFINITY) return ".inf"; - if (object2 === Number.NEGATIVE_INFINITY) return "-.inf"; - if (Object.is(object2, -0)) return "-0.0"; - const result = object2.toString(10); - return /^[-+]?[0-9]+e/.test(result) ? result.replace("e", ".e") : result; -} -var floatCoreTag = defineScalarTag("tag:yaml.org,2002:float", { - implicit: true, - implicitFirstChars: [ - "-", - "+", - ".", - ..."0123456789" - ], - resolve: resolveYamlFloat$2, - identify: (object2) => typeof object2 === "number" && (!Number.isInteger(object2) || Object.is(object2, -0) || object2.toString(10).indexOf("e") >= 0), - represent: representYamlFloat$2 -}); -var YAML_FLOAT_IMPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"); -var YAML_FLOAT_EXPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); -function resolveYamlFloat$1(source, isExplicit) { - if (isExplicit) { - if (!YAML_FLOAT_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED; - let value = source.toLowerCase(); - const sign = value[0] === "-" ? -1 : 1; - if ("+-".includes(value[0])) value = value.slice(1); - if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - if (value === ".nan") return NaN; - const result2 = sign * parseFloat(value); - return Number.isFinite(result2) ? result2 : NOT_RESOLVED; - } - if (!YAML_FLOAT_IMPLICIT_PATTERN.test(source)) return NOT_RESOLVED; - const result = Number(source); - if (Number.isFinite(result)) return result; - return NOT_RESOLVED; -} -function representYamlFloat$1(object2) { - if (isNaN(object2)) return ".nan"; - if (object2 === Number.POSITIVE_INFINITY) return ".inf"; - if (object2 === Number.NEGATIVE_INFINITY) return "-.inf"; - if (Object.is(object2, -0)) return "-0.0"; - const result = object2.toString(10); - return /^[-+]?[0-9]+e/.test(result) ? result.replace("e", ".e") : result; -} -var floatJsonTag = defineScalarTag("tag:yaml.org,2002:float", { - implicit: true, - implicitFirstChars: ["-", ..."0123456789"], - resolve: resolveYamlFloat$1, - identify: (object2) => typeof object2 === "number" && (!Number.isInteger(object2) || Object.is(object2, -0) || object2.toString(10).indexOf("e") >= 0), - represent: representYamlFloat$1 -}); -var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); -var YAML_FLOAT_SPECIAL_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); -function resolveYamlFloat(source) { - if (!YAML_FLOAT_PATTERN.test(source)) return NOT_RESOLVED; - let value = source.toLowerCase().replace(/_/g, ""); - const sign = value[0] === "-" ? -1 : 1; - if ("+-".includes(value[0])) value = value.slice(1); - if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - if (value === ".nan") return NaN; - let result = 0; - if (value.includes(":")) { - for (const part of value.split(":")) result = result * 60 + Number(part); - result *= sign; - } else result = sign * parseFloat(value); - if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN.test(source)) return result; - return NOT_RESOLVED; -} -function representYamlFloat(object2) { - if (isNaN(object2)) return ".nan"; - if (object2 === Number.POSITIVE_INFINITY) return ".inf"; - if (object2 === Number.NEGATIVE_INFINITY) return "-.inf"; - if (Object.is(object2, -0)) return "-0.0"; - const result = object2.toString(10); - return /^[-+]?[0-9]+e/.test(result) ? result.replace("e", ".e") : result; -} -var floatYaml11Tag = defineScalarTag("tag:yaml.org,2002:float", { - implicit: true, - implicitFirstChars: [ - "-", - "+", - ".", - ..."0123456789" - ], - resolve: resolveYamlFloat, - identify: (object2) => typeof object2 === "number" && (!Number.isInteger(object2) || Object.is(object2, -0) || object2.toString(10).indexOf("e") >= 0), - represent: representYamlFloat -}); -var mergeTag = defineScalarTag("tag:yaml.org,2002:merge", { - implicit: true, - implicitFirstChars: ["<"], - resolve: (source, isExplicit) => { - if (source === "<<" || isExplicit && source === "") return MERGE_KEY; - return NOT_RESOLVED; - } -}); -var BASE64_PATTERN = /^[A-Za-z0-9+/]*={0,2}$/; -function resolveYamlBinary(source) { - const input = source.replace(/\s/g, ""); - if (input.length % 4 !== 0 || !BASE64_PATTERN.test(input)) return NOT_RESOLVED; - const binary = atob(input); - const result = new Uint8Array(binary.length); - for (let index2 = 0; index2 < binary.length; index2++) result[index2] = binary.charCodeAt(index2); - return result; -} -function representYamlBinary(object2) { - let binary = ""; - for (let index2 = 0; index2 < object2.length; index2++) binary += String.fromCharCode(object2[index2]); - return btoa(binary); -} -var binaryTag = defineScalarTag("tag:yaml.org,2002:binary", { - resolve: resolveYamlBinary, - identify: (object2) => Object.prototype.toString.call(object2) === "[object Uint8Array]", - represent: representYamlBinary -}); -var YAML_DATE_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"); -var YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"); -function makeUtcDate(year, month, day, hour = 0, minute = 0, second = 0, fraction = 0) { - const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - date.setUTCFullYear(year, month, day); - return date; -} -function resolveYamlTimestamp(source) { - let match2 = YAML_DATE_REGEXP.exec(source); - if (match2 === null) match2 = YAML_TIMESTAMP_REGEXP.exec(source); - if (match2 === null) return NOT_RESOLVED; - const year = +match2[1]; - const month = +match2[2] - 1; - const day = +match2[3]; - if (!match2[4]) { - const date2 = makeUtcDate(year, month, day); - if (date2.getUTCFullYear() !== year || date2.getUTCMonth() !== month || date2.getUTCDate() !== day) return NOT_RESOLVED; - return date2; - } - const hour = +match2[4]; - const minute = +match2[5]; - const second = +match2[6]; - let fraction = 0; - if (hour > 23 || minute > 59 || second > 59) return NOT_RESOLVED; - if (match2[7]) { - let value = match2[7].slice(0, 3); - while (value.length < 3) value += "0"; - fraction = +value; - } - const date = makeUtcDate(year, month, day, hour, minute, second, fraction); - if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) return NOT_RESOLVED; - if (match2[9]) { - const offsetHour = +match2[10]; - const offsetMinute = +(match2[11] || 0); - if (offsetHour > 23 || offsetMinute > 59) return NOT_RESOLVED; - const offset = (offsetHour * 60 + offsetMinute) * 6e4; - date.setTime(date.getTime() - (match2[9] === "-" ? -offset : offset)); - } - return date; -} -var timestampTag = defineScalarTag("tag:yaml.org,2002:timestamp", { - implicit: true, - implicitFirstChars: [..."0123456789"], - resolve: resolveYamlTimestamp, - identify: (object2) => object2 instanceof Date, - represent: (object2) => object2.toISOString() -}); -var seqTag = defineSequenceTag("tag:yaml.org,2002:seq", { - create: () => [], - addItem: (container, item) => { - container.push(item); - }, - identify: Array.isArray -}); -function isPlainObject3(data) { - if (data === null || typeof data !== "object" || Array.isArray(data)) return false; - const prototype = Object.getPrototypeOf(data); - return prototype === null || prototype === Object.prototype; -} -function pick(object2, keys) { - const result = {}; - for (const key of keys) if (object2[key] !== void 0) result[key] = object2[key]; - return result; -} -var omapTag = defineSequenceTag("tag:yaml.org,2002:omap", { - create: () => ({ - list: [], - seen: /* @__PURE__ */ new Set() - }), - addItem: (carrier, item) => { - let key; - if (item instanceof Map) { - if (item.size !== 1) return "cannot resolve an ordered map item"; - key = item.keys().next().value; - } else if (isPlainObject3(item)) { - const itemKeys = Object.keys(item); - if (itemKeys.length !== 1) return "cannot resolve an ordered map item"; - key = itemKeys[0]; - } else return "cannot resolve an ordered map item"; - if (carrier.seen.has(key)) return "duplicate key in ordered map"; - carrier.seen.add(key); - carrier.list.push(item); - return ""; - }, - finalize: (carrier) => carrier.list -}); -var pairsTag = defineSequenceTag("tag:yaml.org,2002:pairs", { - create: () => [], - addItem: (container, item) => { - if (item instanceof Map) { - if (item.size !== 1) return "cannot resolve a pairs item"; - container.push(item.entries().next().value); - return ""; - } - if (Object.prototype.toString.call(item) !== "[object Object]") return "cannot resolve a pairs item"; - const object2 = item; - const keys = Object.keys(object2); - if (keys.length !== 1) return "cannot resolve a pairs item"; - container.push([keys[0], object2[keys[0]]]); - return ""; - } -}); -var mapTag = defineMappingTag("tag:yaml.org,2002:map", { - create: () => ({}), - identify: isPlainObject3, - represent: (o) => { - const map = /* @__PURE__ */ new Map(); - for (const key of Object.keys(o)) map.set(key, o[key]); - return map; - }, - addPair: (container, key, value) => { - if (key !== null && typeof key === "object") return "object-based map does not support complex keys"; - const normalizedKey = String(key); - if (normalizedKey === "__proto__") Object.defineProperty(container, normalizedKey, { - value, - enumerable: true, - configurable: true, - writable: true - }); - else container[normalizedKey] = value; - return ""; - }, - has: (container, key) => { - if (key !== null && typeof key === "object") return false; - return Object.prototype.hasOwnProperty.call(container, String(key)); - }, - keys: (container) => Object.keys(container), - get: (container, key) => { - const normalizedKey = String(key); - if (!Object.prototype.hasOwnProperty.call(container, normalizedKey)) return null; - return container[normalizedKey]; - } -}); -var setTag = defineMappingTag("tag:yaml.org,2002:set", { - create: () => /* @__PURE__ */ new Set(), - identify: (data) => data instanceof Set, - represent: (data) => { - const map = /* @__PURE__ */ new Map(); - for (const key of data) map.set(key, null); - return map; - }, - addPair: (container, key, value) => { - if (value !== null) return "cannot resolve a set item"; - container.add(key); - return ""; - }, - has: (container, key) => container.has(key), - keys: (container) => container.keys(), - get: () => null -}); -function createTagDefinitionMap() { - return { - scalar: /* @__PURE__ */ Object.create(null), - sequence: /* @__PURE__ */ Object.create(null), - mapping: /* @__PURE__ */ Object.create(null) - }; -} -function createTagDefinitionListMap() { - return { - scalar: [], - sequence: [], - mapping: [] - }; -} -function compileTags(tags) { - const result = []; - for (const tag of tags) { - let index2 = result.length; - for (let previousIndex = 0; previousIndex < result.length; previousIndex++) { - const previous = result[previousIndex]; - if (previous.nodeKind === tag.nodeKind && previous.tagName === tag.tagName && previous.matchByTagPrefix === tag.matchByTagPrefix) { - index2 = previousIndex; - break; - } - } - result[index2] = tag; - } - return result; -} -var Schema = class Schema2 { - tags; - implicitScalarTags; - implicitScalarByFirstChar; - implicitScalarAnyFirstChar; - defaultScalarTag; - defaultSequenceTag; - defaultMappingTag; - exact; - prefix; - constructor(tags) { - const compiledTags = compileTags(tags); - const implicitScalarTags = []; - const exact = createTagDefinitionMap(); - const prefix = createTagDefinitionListMap(); - for (const tag of compiledTags) { - if (tag.nodeKind === "scalar" && tag.implicit) { - if (tag.matchByTagPrefix) throw new Error("Implicit scalar tags cannot match by tag prefix"); - implicitScalarTags.push(tag); - } - switch (tag.nodeKind) { - case "scalar": - if (tag.matchByTagPrefix) prefix.scalar.push(tag); - else exact.scalar[tag.tagName] = tag; - break; - case "sequence": - if (tag.matchByTagPrefix) prefix.sequence.push(tag); - else exact.sequence[tag.tagName] = tag; - break; - case "mapping": - if (tag.matchByTagPrefix) prefix.mapping.push(tag); - else exact.mapping[tag.tagName] = tag; - break; - } - } - const implicitScalarAnyFirstChar = implicitScalarTags.filter((tag) => tag.implicitFirstChars === null); - const keys = /* @__PURE__ */ new Set(); - for (const tag of implicitScalarTags) if (tag.implicitFirstChars !== null) for (const key of tag.implicitFirstChars) keys.add(key); - const implicitScalarByFirstChar = /* @__PURE__ */ new Map(); - for (const key of keys) implicitScalarByFirstChar.set(key, implicitScalarTags.filter((tag) => tag.implicitFirstChars === null || tag.implicitFirstChars.indexOf(key) !== -1)); - const defaultScalarTag = exact.scalar["tag:yaml.org,2002:str"]; - if (!defaultScalarTag) throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)"); - this.tags = compiledTags; - this.implicitScalarTags = implicitScalarTags; - this.implicitScalarByFirstChar = implicitScalarByFirstChar; - this.implicitScalarAnyFirstChar = implicitScalarAnyFirstChar; - this.defaultScalarTag = defaultScalarTag; - this.defaultSequenceTag = exact.sequence["tag:yaml.org,2002:seq"]; - this.defaultMappingTag = exact.mapping["tag:yaml.org,2002:map"]; - this.exact = exact; - this.prefix = prefix; - } - withTags(...tags) { - let flatTags = []; - for (const tag of tags) flatTags = flatTags.concat(tag); - return new Schema2([...this.tags, ...flatTags]); - } -}; -var FAILSAFE_SCHEMA = new Schema([ - strTag, - seqTag, - mapTag -]); -var JSON_SCHEMA = new Schema([ - ...FAILSAFE_SCHEMA.tags, - nullJsonTag, - boolJsonTag, - intJsonTag, - floatJsonTag -]); -var CORE_SCHEMA = new Schema([ - ...FAILSAFE_SCHEMA.tags, - nullCoreTag, - boolCoreTag, - intCoreTag, - floatCoreTag -]); -var YAML11_SCHEMA = new Schema([ - ...FAILSAFE_SCHEMA.tags, - nullYaml11Tag, - boolYaml11Tag, - intYaml11Tag, - floatYaml11Tag, - timestampTag, - mergeTag, - binaryTag, - omapTag, - pairsTag, - setTag -]); -var realMapTag = defineMappingTag("tag:yaml.org,2002:map", { - create: () => /* @__PURE__ */ new Map(), - addPair: (container, key, value) => { - container.set(key, value); - return ""; - }, - has: (container, key) => container.has(key), - keys: (container) => container.keys(), - get: (container, key) => container.get(key), - identify: (data) => data instanceof Map || isPlainObject3(data), - represent: (data) => { - if (data instanceof Map) return data; - const map = /* @__PURE__ */ new Map(); - const obj = data; - for (const key of Object.keys(obj)) map.set(key, obj[key]); - return map; - } -}); -function normalizeKey(key) { - if (Array.isArray(key)) { - const array2 = Array.prototype.slice.call(key); - for (let index2 = 0; index2 < array2.length; index2++) { - if (Array.isArray(array2[index2])) return null; - if (typeof array2[index2] === "object" && Object.prototype.toString.call(array2[index2]) === "[object Object]") array2[index2] = "[object Object]"; - } - return String(array2); - } - if (typeof key === "object" && Object.prototype.toString.call(key) === "[object Object]") return "[object Object]"; - return String(key); -} -var legacyMapTag = defineMappingTag("tag:yaml.org,2002:map", { - create: () => ({}), - identify: isPlainObject3, - represent: (o) => { - const map = /* @__PURE__ */ new Map(); - for (const key of Object.keys(o)) map.set(key, o[key]); - return map; - }, - addPair: (container, key, value) => { - const normalizedKey = normalizeKey(key); - if (normalizedKey === null) return "nested arrays are not supported inside keys"; - if (normalizedKey === "__proto__") Object.defineProperty(container, normalizedKey, { - value, - enumerable: true, - configurable: true, - writable: true - }); - else container[normalizedKey] = value; - return ""; - }, - has: (container, key) => { - const normalizedKey = normalizeKey(key); - return normalizedKey !== null && Object.prototype.hasOwnProperty.call(container, normalizedKey); - }, - keys: (container) => Object.keys(container), - get: (container, key) => { - const normalizedKey = String(key); - if (!Object.prototype.hasOwnProperty.call(container, normalizedKey)) return null; - return container[normalizedKey]; - } -}); -var DEFAULT_SNIPPET_OPTIONS = { - maxLength: 79, - indent: 1, - linesBefore: 3, - linesAfter: 2 -}; -function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { - let head = ""; - let tail = ""; - const maxHalfLength = Math.floor(maxLineLength / 2) - 1; - if (position - lineStart > maxHalfLength) { - head = " ... "; - lineStart = position - maxHalfLength + head.length; - } - if (lineEnd - position > maxHalfLength) { - tail = " ..."; - lineEnd = position + maxHalfLength - tail.length; - } - return { - str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail, - pos: position - lineStart + head.length - }; -} -function padStart(string2, max) { - return " ".repeat(Math.max(max - string2.length, 0)) + string2; -} -function makeSnippet(mark, options) { - if (!mark.buffer) return null; - const opts = { - ...DEFAULT_SNIPPET_OPTIONS, - ...options - }; - const re = /\r?\n|\r|\0/g; - const lineStarts = [0]; - const lineEnds = []; - let match2; - let foundLineNo = -1; - while (match2 = re.exec(mark.buffer)) { - lineEnds.push(match2.index); - lineStarts.push(match2.index + match2[0].length); - if (mark.position <= match2.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2; - } - if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; - let result = ""; - const lineNoLength = Math.min(mark.line + opts.linesAfter, lineEnds.length).toString().length; - const maxLineLength = opts.maxLength - (opts.indent + lineNoLength + 3); - for (let i = 1; i <= opts.linesBefore; i++) { - if (foundLineNo - i < 0) break; - const line2 = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength); - result = `${" ".repeat(opts.indent)}${padStart((mark.line - i + 1).toString(), lineNoLength)} | ${line2.str} -${result}`; - } - const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); - result += `${" ".repeat(opts.indent)}${padStart((mark.line + 1).toString(), lineNoLength)} | ${line.str} -`; - result += `${"-".repeat(opts.indent + lineNoLength + 3 + line.pos)}^ -`; - for (let i = 1; i <= opts.linesAfter; i++) { - if (foundLineNo + i >= lineEnds.length) break; - const line2 = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength); - result += `${" ".repeat(opts.indent)}${padStart((mark.line + i + 1).toString(), lineNoLength)} | ${line2.str} -`; - } - return result.replace(/\n$/, ""); -} -function formatError(exception, compact) { - let where = ""; - if (!exception.mark) return exception.reason; - if (exception.mark.name) where += `in "${exception.mark.name}" `; - where += `(${exception.mark.line + 1}:${exception.mark.column + 1})`; - if (!compact && exception.mark.snippet) where += ` - -${exception.mark.snippet}`; - return `${exception.reason} ${where}`; -} -var YAMLException = class extends Error { - reason; - mark; - constructor(reason, mark) { - super(); - this.name = "YAMLException"; - this.reason = reason; - this.mark = mark; - this.message = formatError(this, false); - if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor); - } - toString(compact) { - return `${this.name}: ${formatError(this, compact)}`; - } -}; -function throwErrorAt(source, position, message, filename = "") { - let line = 0; - let lineStart = 0; - for (let index2 = 0; index2 < position; index2++) { - const ch = source.charCodeAt(index2); - if (ch === 10) { - line++; - lineStart = index2 + 1; - } else if (ch === 13) { - line++; - if (source.charCodeAt(index2 + 1) === 10) index2++; - lineStart = index2 + 1; - } - } - const mark = { - name: filename, - buffer: source, - position, - line, - column: position - lineStart - }; - mark.snippet = makeSnippet(mark); - throw new YAMLException(message, mark); -} -var NO_RANGE$3 = -1; -function simpleEscapeSequence(c) { - switch (c) { - case 48: - return "\0"; - case 97: - return "\x07"; - case 98: - return "\b"; - case 116: - return " "; - case 9: - return " "; - case 110: - return "\n"; - case 118: - return "\v"; - case 102: - return "\f"; - case 114: - return "\r"; - case 101: - return "\x1B"; - case 32: - return " "; - case 34: - return '"'; - case 47: - return "/"; - case 92: - return "\\"; - case 78: - return "\x85"; - case 95: - return "\xA0"; - case 76: - return "\u2028"; - case 80: - return "\u2029"; - default: - return ""; - } -} -var simpleEscapeCheck = new Array(256); -var simpleEscapeMap = new Array(256); -for (let i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} -function charFromCodepoint(c) { - if (c <= 65535) return String.fromCharCode(c); - return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320); -} -function fromHexCode$1(c) { - if (c >= 48 && c <= 57) return c - 48; - return (c | 32) - 97 + 10; -} -function escapedHexLen$1(c) { - if (c === 120) return 2; - if (c === 117) return 4; - return 8; -} -function skipFoldedBreaks(input, position, end) { - let breaks = 0; - while (position < end) { - const ch = input.charCodeAt(position); - if (ch === 10) { - breaks++; - position++; - } else if (ch === 13) { - breaks++; - position++; - if (input.charCodeAt(position) === 10) position++; - } else if (ch === 32 || ch === 9) position++; - else break; - } - return { - position, - breaks - }; -} -function foldedBreaks(count) { - if (count === 1) return " "; - return "\n".repeat(count - 1); -} -function getPlainValue(input, start, end) { - let result = ""; - let position = start; - let captureStart = start; - let captureEnd = start; - while (position < end) { - const ch = input.charCodeAt(position); - if (ch === 10 || ch === 13) { - result += input.slice(captureStart, captureEnd); - const fold = skipFoldedBreaks(input, position, end); - result += foldedBreaks(fold.breaks); - position = captureStart = captureEnd = fold.position; - } else { - position++; - if (ch !== 32 && ch !== 9) captureEnd = position; - } - } - return result + input.slice(captureStart, captureEnd); -} -function getSingleQuotedValue(input, start, end) { - let result = ""; - let position = start; - let captureStart = start; - let captureEnd = start; - while (position < end) { - const ch = input.charCodeAt(position); - if (ch === 39) { - result += input.slice(captureStart, position) + "'"; - position += 2; - captureStart = captureEnd = position; - } else if (ch === 10 || ch === 13) { - result += input.slice(captureStart, captureEnd); - const fold = skipFoldedBreaks(input, position, end); - result += foldedBreaks(fold.breaks); - position = captureStart = captureEnd = fold.position; - } else { - position++; - if (ch !== 32 && ch !== 9) captureEnd = position; - } - } - return result + input.slice(captureStart, end); -} -function getDoubleQuotedValue(input, start, end) { - let result = ""; - let position = start; - let captureStart = start; - let captureEnd = start; - while (position < end) { - const ch = input.charCodeAt(position); - if (ch === 92) { - result += input.slice(captureStart, position); - position++; - const escaped = input.charCodeAt(position); - if (escaped === 10 || escaped === 13) position = skipFoldedBreaks(input, position, end).position; - else if (escaped < 256 && simpleEscapeCheck[escaped]) { - result += simpleEscapeMap[escaped]; - position++; - } else { - let hexLength = escapedHexLen$1(escaped); - let hexResult = 0; - for (; hexLength > 0; hexLength--) { - position++; - const digit = fromHexCode$1(input.charCodeAt(position)); - hexResult = (hexResult << 4) + digit; - } - result += charFromCodepoint(hexResult); - position++; - } - captureStart = captureEnd = position; - } else if (ch === 10 || ch === 13) { - result += input.slice(captureStart, captureEnd); - const fold = skipFoldedBreaks(input, position, end); - result += foldedBreaks(fold.breaks); - position = captureStart = captureEnd = fold.position; - } else { - position++; - if (ch !== 32 && ch !== 9) captureEnd = position; - } - } - return result + input.slice(captureStart, end); -} -function getBlockValue(input, start, end, indent, chomping, folded) { - const textIndent = indent < 0 ? 0 : indent; - const region = input.slice(start, end).replace(/\r\n?/g, "\n"); - const lines = region === "" ? [] : (region.endsWith("\n") ? region.slice(0, -1) : region).split("\n"); - let result = ""; - let didReadContent = false; - let emptyLines = 0; - let atMoreIndented = false; - for (const line of lines) { - let column = 0; - while (column < textIndent && line.charCodeAt(column) === 32) column++; - if (indent < 0 || column >= line.length) { - emptyLines++; - continue; - } - const content = line.slice(textIndent); - const first = content.charCodeAt(0); - if (folded) if (first === 32 || first === 9) { - atMoreIndented = true; - result += "\n".repeat(didReadContent ? 1 + emptyLines : emptyLines); - } else if (atMoreIndented) { - atMoreIndented = false; - result += "\n".repeat(emptyLines + 1); - } else if (emptyLines === 0) { - if (didReadContent) result += " "; - } else result += "\n".repeat(emptyLines); - else result += "\n".repeat(didReadContent ? 1 + emptyLines : emptyLines); - result += content; - didReadContent = true; - emptyLines = 0; - } - if (chomping === 3) result += "\n".repeat(didReadContent ? 1 + emptyLines : emptyLines); - else if (chomping !== 2) { - if (didReadContent) result += "\n"; - } - return result; -} -function getScalarValue(input, scalar) { - if (scalar.valueStart === NO_RANGE$3) return ""; - const { valueStart, valueEnd } = scalar; - if (scalar.fast) return input.slice(valueStart, valueEnd); - switch (scalar.style) { - case 2: - return getSingleQuotedValue(input, valueStart, valueEnd); - case 3: - return getDoubleQuotedValue(input, valueStart, valueEnd); - case 4: - return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, false); - case 5: - return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, true); - default: - return getPlainValue(input, valueStart, valueEnd); - } -} -var DEFAULT_TAG_HANDLERS = Object.assign(/* @__PURE__ */ Object.create(null), { - "!": "!", - "!!": "tag:yaml.org,2002:" -}); -function tagPercentEncode(source) { - return encodeURI(source).replace(/!/g, "%21"); -} -function tagNameFull(rawTag, tagHandlers) { - if (rawTag.startsWith("!<") && rawTag.endsWith(">")) return decodeURIComponent(rawTag.slice(2, -1)); - const handleEnd = rawTag.indexOf("!", 1); - const handle = handleEnd === -1 ? "!" : rawTag.slice(0, handleEnd + 1); - const prefix = tagHandlers?.[handle] ?? DEFAULT_TAG_HANDLERS[handle] ?? handle; - return decodeURIComponent(prefix) + decodeURIComponent(rawTag.slice(handle.length)); -} -function tagNameShort(fullTag) { - let tag = fullTag; - if (tag.charCodeAt(0) === 33) { - tag = tag.slice(1); - return `!${tagPercentEncode(tag)}`; - } - if (tag.slice(0, 18) === "tag:yaml.org,2002:") return `!!${tagPercentEncode(tag.slice(18))}`; - return `!<${tagPercentEncode(tag)}>`; -} -var NO_RANGE$2 = -1; -var DEFAULT_CONSTRUCTOR_OPTIONS = { - filename: "", - schema: CORE_SCHEMA, - json: false, - maxTotalMergeKeys: 1e4, - maxAliases: -1 -}; -function eventPosition$1(event) { - if ("tagStart" in event && event.tagStart !== NO_RANGE$2) return event.tagStart; - if ("anchorStart" in event && event.anchorStart !== NO_RANGE$2) return event.anchorStart; - if ("valueStart" in event && event.valueStart !== NO_RANGE$2) return event.valueStart; - if ("start" in event) return event.start; - return 0; -} -function throwError$1(state, message) { - throwErrorAt(state.source, state.position, message, state.filename); -} -function finalizeCollection(state, position, tag, carrier) { - try { - return tag.finalize(carrier); - } catch (error3) { - if (error3 instanceof YAMLException) throw error3; - throwErrorAt(state.source, position, error3 instanceof Error ? error3.message : String(error3), state.filename); - } -} -function lookupTag(exact, prefix, tagName) { - const exactTag = exact[tagName]; - if (exactTag) return exactTag; - for (const tag of prefix) if (tagName.startsWith(tag.tagName)) return tag; -} -function findExplicitTag(state, exact, prefix, tagName, nodeKind) { - const tag = lookupTag(exact, prefix, tagName); - if (tag) return tag; - throwError$1(state, `unknown ${nodeKind} tag !<${tagName}>`); -} -function constructScalar(state, event) { - const source = getScalarValue(state.source, event); - const rawTag = event.tagStart === NO_RANGE$2 ? "" : state.source.slice(event.tagStart, event.tagEnd); - const strTag2 = state.schema.defaultScalarTag; - if (rawTag !== "") { - if (rawTag === "!") return { - value: source, - tag: strTag2 - }; - const tagName = tagNameFull(rawTag, state.tagHandlers); - const scalarTag = lookupTag(state.schema.exact.scalar, state.schema.prefix.scalar, tagName); - if (scalarTag) { - const result = scalarTag.resolve(source, true, tagName); - if (result === NOT_RESOLVED) throwError$1(state, `cannot resolve a node with !<${tagName}> explicit tag`); - return { - value: result, - tag: scalarTag - }; - } - const collectionTagDef = lookupTag(state.schema.exact.mapping, state.schema.prefix.mapping, tagName) ?? lookupTag(state.schema.exact.sequence, state.schema.prefix.sequence, tagName); - if (collectionTagDef) { - if (source !== "") throwError$1(state, `cannot resolve a node with !<${tagName}> explicit tag`); - const carrier = collectionTagDef.create(tagName); - return { - value: collectionTagDef.carrierIsResult ? carrier : finalizeCollection(state, state.position, collectionTagDef, carrier), - tag: collectionTagDef - }; - } - throwError$1(state, `unknown scalar tag !<${tagName}>`); - } - if (event.style === 1) { - const candidates = state.schema.implicitScalarByFirstChar.get(source.charAt(0)) ?? state.schema.implicitScalarAnyFirstChar; - for (const tag of candidates) { - const result = tag.resolve(source, false, tag.tagName); - if (result !== NOT_RESOLVED) return { - value: result, - tag - }; - } - } - return { - value: strTag2.resolve(source, false, strTag2.tagName), - tag: strTag2 - }; -} -function collectionTag(state, event, exact, prefix, defaultTagName, nodeKind) { - const rawTag = event.tagStart === NO_RANGE$2 ? "" : state.source.slice(event.tagStart, event.tagEnd); - const tagName = rawTag === "" || rawTag === "!" ? defaultTagName : tagNameFull(rawTag, state.tagHandlers); - return { - tagName, - tag: findExplicitTag(state, exact, prefix, tagName, nodeKind) - }; -} -function isMappingTag(tag) { - return tag.nodeKind === "mapping"; -} -function mergeKeys(state, frame, source, sourceTag) { - for (const sourceKey of sourceTag.keys(source)) { - if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) throwError$1(state, `merge keys exceeded maxTotalMergeKeys (${state.maxTotalMergeKeys})`); - if (frame.tag.has(frame.value, sourceKey)) continue; - const err = frame.tag.addPair(frame.value, sourceKey, sourceTag.get(source, sourceKey)); - if (err) throwError$1(state, err); - (frame.overridable ??= /* @__PURE__ */ new Set()).add(sourceKey); - } -} -function mergeSource(state, frame, source, sourceTag) { - state.position = frame.keyPosition; - if (isMappingTag(sourceTag)) mergeKeys(state, frame, source, sourceTag); - else if (sourceTag.nodeKind === "sequence" && Array.isArray(source)) for (const element of source) mergeKeys(state, frame, element, frame.tag); - else throwError$1(state, "cannot merge mappings; the provided source object is unacceptable"); -} -function addMappingValue(state, frame, key, value, tag) { - state.position = frame.keyPosition; - if (key === MERGE_KEY) { - mergeSource(state, frame, value, tag); - return; - } - if (!state.json && frame.tag.has(frame.value, key) && !frame.overridable?.has(key)) throwError$1(state, "duplicated mapping key"); - const err = frame.tag.addPair(frame.value, key, value); - if (err) throwError$1(state, err); - frame.overridable?.delete(key); -} -function addValue(state, value, tag) { - const frame = state.frames[state.frames.length - 1]; - if (frame.kind === "document") { - frame.value = value; - frame.hasValue = true; - } else if (frame.kind === "sequence") { - if (frame.merge) { - if (!isMappingTag(tag)) throwError$1(state, "cannot merge mappings; the provided source object is unacceptable"); - } - const err = frame.tag.addItem(frame.value, value, frame.index++); - if (err) throwError$1(state, err); - } else if (frame.hasKey) { - const key = frame.key; - frame.key = void 0; - frame.hasKey = false; - addMappingValue(state, frame, key, value, tag); - } else { - frame.key = value; - frame.keyPosition = state.position; - frame.hasKey = true; - } -} -function storeAnchor(state, event, value, tag, isValueFinal) { - if (event.anchorStart !== NO_RANGE$2) { - const anchor = { - value, - tag, - isValueFinal - }; - state.anchors.set(state.source.slice(event.anchorStart, event.anchorEnd), anchor); - return anchor; - } - return null; -} -function constructFromEvents(events, options) { - const state = { - ...DEFAULT_CONSTRUCTOR_OPTIONS, - ...options, - events, - documents: [], - eventIndex: 0, - position: 0, - frames: [], - anchors: /* @__PURE__ */ new Map(), - tagHandlers: /* @__PURE__ */ Object.create(null), - totalMergeKeys: 0, - aliasCount: 0 - }; - while (state.eventIndex < state.events.length) { - const event = state.events[state.eventIndex++]; - state.position = eventPosition$1(event); - switch (event.type) { - case 1: - state.anchors = /* @__PURE__ */ new Map(); - state.aliasCount = 0; - state.tagHandlers = /* @__PURE__ */ Object.create(null); - for (const directive of event.directives) if (directive.kind === "tag") state.tagHandlers[directive.handle] = directive.prefix; - state.frames.push({ - kind: "document", - position: state.position, - value: void 0, - hasValue: false - }); - break; - case 4: { - const { value, tag } = constructScalar(state, event); - storeAnchor(state, event, value, tag, true); - addValue(state, value, tag); - break; - } - case 2: { - const definition = collectionTag(state, event, state.schema.exact.sequence, state.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence"); - const value = definition.tag.create(definition.tagName); - const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult); - const parent = state.frames[state.frames.length - 1]; - const merge2 = parent !== void 0 && parent.kind === "mapping" && parent.hasKey && parent.key === MERGE_KEY; - state.frames.push({ - kind: "sequence", - position: state.position, - value, - tag: definition.tag, - anchor, - index: 0, - merge: merge2 - }); - break; - } - case 3: { - const definition = collectionTag(state, event, state.schema.exact.mapping, state.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping"); - const value = definition.tag.create(definition.tagName); - const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult); - state.frames.push({ - kind: "mapping", - position: state.position, - value, - tag: definition.tag, - anchor, - key: void 0, - keyPosition: state.position, - hasKey: false, - overridable: null - }); - break; - } - case 5: { - if (state.maxAliases !== -1 && ++state.aliasCount > state.maxAliases) throwError$1(state, `aliases exceeded maxAliases (${state.maxAliases})`); - const name = state.source.slice(event.anchorStart, event.anchorEnd); - const anchor = state.anchors.get(name); - if (!anchor) throwError$1(state, `unidentified alias "${name}"`); - if (!anchor.isValueFinal) throwError$1(state, `recursive alias "${name}" is not supported for tag ${anchor.tag.tagName} because it uses finalize()`); - addValue(state, anchor.value, anchor.tag); - break; - } - case 6: { - const frame = state.frames.pop(); - if (frame.kind === "mapping" && frame.hasKey) { - state.position = frame.keyPosition; - throwError$1(state, "incomplete mapping pair in event stream"); - } - if (frame.kind === "document") state.documents.push(frame.value); - else { - const value = frame.tag.carrierIsResult ? frame.value : finalizeCollection(state, frame.position, frame.tag, frame.value); - if (frame.anchor) { - frame.anchor.value = value; - frame.anchor.isValueFinal = true; - } - addValue(state, value, frame.tag); - } - break; - } - } - } - return state.documents; -} -var NO_RANGE$1 = -1; -var HAS_OWN = Object.prototype.hasOwnProperty; -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]{}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/; -var NS_URI_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`; -var NS_TAG_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`; -var PATTERN_TAG_URI = new RegExp(`^(?:${NS_URI_CHAR})*$`); -var PATTERN_TAG_SUFFIX = new RegExp(`^(?:${NS_TAG_CHAR})+$`); -var PATTERN_TAG_PREFIX = new RegExp(`^(?:!(?:${NS_URI_CHAR})*|${NS_TAG_CHAR}(?:${NS_URI_CHAR})*)$`); -var DEFAULT_PARSER_OPTIONS = { - filename: "", - maxDepth: 100 -}; -function addDocumentEvent(state, explicitStart, explicitEnd) { - state.events.push({ - type: 1, - explicitStart, - explicitEnd, - directives: state.directives - }); -} -function addSequenceEvent(state, start, anchorStart, anchorEnd, tagStart, tagEnd, style) { - state.events.push({ - type: 2, - start, - anchorStart, - anchorEnd, - tagStart, - tagEnd, - style - }); -} -function addMappingEvent(state, start, anchorStart, anchorEnd, tagStart, tagEnd, style) { - state.events.push({ - type: 3, - start, - anchorStart, - anchorEnd, - tagStart, - tagEnd, - style - }); -} -function insertFlowPairMappingEvent(state, snapshot) { - state.events.splice(snapshot.eventsLength, 0, { - type: 3, - start: snapshot.position, - anchorStart: NO_RANGE$1, - anchorEnd: NO_RANGE$1, - tagStart: NO_RANGE$1, - tagEnd: NO_RANGE$1, - style: 2 - }); -} -function addScalarEvent(state, valueStart, valueEnd, anchorStart, anchorEnd, tagStart, tagEnd, style, chomping = 1, indent = -1, fast = false) { - state.events.push({ - type: 4, - valueStart, - valueEnd, - anchorStart, - anchorEnd, - tagStart, - tagEnd, - style, - chomping, - indent, - fast - }); -} -function addAliasEvent(state, anchorStart, anchorEnd) { - state.events.push({ - type: 5, - anchorStart, - anchorEnd - }); -} -function addPopEvent(state) { - state.events.push({ type: 6 }); -} -function addEmptyScalarEvent(state) { - addScalarEvent(state, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, 1); -} -function emptyProperties() { - return { - anchorStart: NO_RANGE$1, - anchorEnd: NO_RANGE$1, - tagStart: NO_RANGE$1, - tagEnd: NO_RANGE$1 - }; -} -function snapshotState(state) { - return { - position: state.position, - line: state.line, - lineStart: state.lineStart, - lineIndent: state.lineIndent, - firstTabInLine: state.firstTabInLine, - eventsLength: state.events.length - }; -} -function restoreState(state, snapshot) { - state.position = snapshot.position; - state.line = snapshot.line; - state.lineStart = snapshot.lineStart; - state.lineIndent = snapshot.lineIndent; - state.firstTabInLine = snapshot.firstTabInLine; - state.events.length = snapshot.eventsLength; -} -function throwError(state, message) { - throwErrorAt(state.input.slice(0, state.length), state.position, message, state.filename); -} -function isEol(c) { - return c === 10 || c === 13; -} -function isWhiteSpace(c) { - return c === 9 || c === 32; -} -function isWsOrEol(c) { - return isWhiteSpace(c) || isEol(c); -} -function isWsOrEolOrEnd(c) { - return c === 0 || isWsOrEol(c); -} -function isFlowIndicator(c) { - return c === 44 || c === 91 || c === 93 || c === 123 || c === 125; -} -function fromDecimalCode(c) { - return c >= 48 && c <= 57 ? c - 48 : -1; -} -function fromHexCode(c) { - if (c >= 48 && c <= 57) return c - 48; - const lc = c | 32; - if (lc >= 97 && lc <= 102) return lc - 97 + 10; - return -1; -} -function escapedHexLen(c) { - if (c === 120) return 2; - if (c === 117) return 4; - if (c === 85) return 8; - return 0; -} -function isSimpleEscape(c) { - return c === 48 || c === 97 || c === 98 || c === 116 || c === 9 || c === 110 || c === 118 || c === 102 || c === 114 || c === 101 || c === 32 || c === 34 || c === 47 || c === 92 || c === 78 || c === 95 || c === 76 || c === 80; -} -function consumeLineBreak(state) { - if (state.input.charCodeAt(state.position) === 10) state.position++; - else { - state.position++; - if (state.input.charCodeAt(state.position) === 10) state.position++; - } - state.line++; - state.lineStart = state.position; - state.lineIndent = 0; - state.firstTabInLine = -1; -} -function skipSeparationSpace(state, allowComments) { - let lineBreaks = 0; - let ch = state.input.charCodeAt(state.position); - let hasSeparation = state.position === state.lineStart || isWsOrEol(state.input.charCodeAt(state.position - 1)); - while (ch !== 0) { - while (isWhiteSpace(ch)) { - hasSeparation = true; - if (ch === 9 && state.firstTabInLine === -1) state.firstTabInLine = state.position; - ch = state.input.charCodeAt(++state.position); - } - if (allowComments && hasSeparation && ch === 35) do - ch = state.input.charCodeAt(++state.position); - while (!isEol(ch) && ch !== 0); - if (!isEol(ch)) break; - consumeLineBreak(state); - lineBreaks++; - hasSeparation = true; - ch = state.input.charCodeAt(state.position); - while (ch === 32) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } - return lineBreaks; -} -function testDocumentSeparator(state, position = state.position) { - const ch = state.input.charCodeAt(position); - if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(position + 1) && ch === state.input.charCodeAt(position + 2)) { - const following = state.input.charCodeAt(position + 3); - return following === 0 || isWsOrEol(following); - } - return false; -} -function skipUntilLineEnd(state) { - let ch = state.input.charCodeAt(state.position); - while (ch !== 0 && !isEol(ch)) ch = state.input.charCodeAt(++state.position); -} -function checkPrintable(state, start, end) { - if (PATTERN_NON_PRINTABLE.test(state.input.slice(start, end))) throwError(state, "the stream contains non-printable characters"); -} -function readTagProperty(state, props, inFlow) { - if (state.input.charCodeAt(state.position) !== 33) return false; - if (props.tagStart !== NO_RANGE$1) throwError(state, "duplication of a tag property"); - const start = state.position; - let isVerbatim = false; - let isNamed = false; - let tagHandle = "!"; - let ch = state.input.charCodeAt(++state.position); - if (ch === 60) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - } else if (ch === 33) { - isNamed = true; - tagHandle = "!!"; - ch = state.input.charCodeAt(++state.position); - } - let suffixStart = state.position; - let tagName; - if (isVerbatim) { - while (ch !== 0 && ch !== 62) ch = state.input.charCodeAt(++state.position); - if (ch !== 62) throwError(state, "unexpected end of the stream within a verbatim tag"); - tagName = state.input.slice(suffixStart, state.position); - state.position++; - } else { - while (ch !== 0 && !isWsOrEol(ch) && !(inFlow && isFlowIndicator(ch))) { - if (ch === 33) if (!isNamed) { - tagHandle = state.input.slice(suffixStart - 1, state.position + 1); - if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters"); - isNamed = true; - suffixStart = state.position + 1; - } else throwError(state, "tag suffix cannot contain exclamation marks"); - ch = state.input.charCodeAt(++state.position); - } - tagName = state.input.slice(suffixStart, state.position); - if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters"); - } - if (tagName && !(isVerbatim ? PATTERN_TAG_URI.test(tagName) : PATTERN_TAG_SUFFIX.test(tagName))) throwError(state, `tag name cannot contain such characters: ${tagName}`); - if (!isVerbatim && tagHandle !== "!" && tagHandle !== "!!" && !HAS_OWN.call(state.tagHandlers, tagHandle)) throwError(state, `undeclared tag handle "${tagHandle}"`); - props.tagStart = start; - props.tagEnd = state.position; - return true; -} -function readAnchorProperty(state, props) { - if (state.input.charCodeAt(state.position) !== 38) return false; - if (props.anchorStart !== NO_RANGE$1) throwError(state, "duplication of an anchor property"); - state.position++; - const start = state.position; - while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) state.position++; - if (state.position === start) throwError(state, "name of an anchor node must contain at least one character"); - props.anchorStart = start; - props.anchorEnd = state.position; - return true; -} -function readAlias(state, props) { - if (state.input.charCodeAt(state.position) !== 42) return false; - if (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1) throwError(state, "alias node should not have any properties"); - state.position++; - const start = state.position; - while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) state.position++; - if (state.position === start) throwError(state, "name of an alias node must contain at least one character"); - addAliasEvent(state, start, state.position); - return true; -} -function readFlowScalarBreak(state, nodeIndent) { - skipSeparationSpace(state, false); - if (state.lineIndent < nodeIndent) throwError(state, "deficient indentation"); -} -function readSingleQuotedScalar(state, nodeIndent, props) { - if (state.input.charCodeAt(state.position) !== 39) return false; - state.position++; - const start = state.position; - let simple = true; - while (state.input.charCodeAt(state.position) !== 0) { - const ch = state.input.charCodeAt(state.position); - if (ch === 39) { - if (state.input.charCodeAt(state.position + 1) === 39) { - simple = false; - state.position += 2; - continue; - } - const end = state.position; - state.position++; - addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2, 1, -1, simple); - return true; - } - if (isEol(ch)) { - simple = false; - readFlowScalarBreak(state, nodeIndent); - } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar"); - else if (ch !== 9 && ch < 32) throwError(state, "expected valid JSON character"); - else state.position++; - } - throwError(state, "unexpected end of the stream within a single quoted scalar"); -} -function readDoubleQuotedScalar(state, nodeIndent, props) { - if (state.input.charCodeAt(state.position) !== 34) return false; - state.position++; - const start = state.position; - let simple = true; - while (state.input.charCodeAt(state.position) !== 0) { - const ch = state.input.charCodeAt(state.position); - if (ch === 34) { - const end = state.position; - state.position++; - addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 3, 1, -1, simple); - return true; - } - if (ch === 92) { - simple = false; - const escaped = state.input.charCodeAt(++state.position); - if (isEol(escaped)) readFlowScalarBreak(state, nodeIndent); - else if (isSimpleEscape(escaped)) state.position++; - else { - let hexLength = escapedHexLen(escaped); - if (hexLength === 0) throwError(state, "unknown escape sequence"); - while (hexLength-- > 0) { - state.position++; - if (fromHexCode(state.input.charCodeAt(state.position)) < 0) throwError(state, "expected hexadecimal character"); - } - state.position++; - } - } else if (isEol(ch)) { - simple = false; - readFlowScalarBreak(state, nodeIndent); - } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar"); - else if (ch !== 9 && ch < 32) throwError(state, "expected valid JSON character"); - else state.position++; - } - throwError(state, "unexpected end of the stream within a double quoted scalar"); -} -function readBlockScalar(state, parentIndent, props) { - const ch = state.input.charCodeAt(state.position); - let chomping = 1; - let indent = -1; - let detectedIndent = false; - if (ch !== 124 && ch !== 62) return false; - const style = ch === 124 ? 4 : 5; - state.position++; - while (state.input.charCodeAt(state.position) !== 0) { - const current = state.input.charCodeAt(state.position); - const digit = fromDecimalCode(current); - if (current === 43 || current === 45) { - if (chomping !== 1) throwError(state, "repeat of a chomping mode identifier"); - chomping = current === 43 ? 3 : 2; - state.position++; - } else if (digit >= 0) { - if (digit === 0) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); - if (detectedIndent) throwError(state, "repeat of an indentation width identifier"); - indent = parentIndent + digit - 1; - detectedIndent = true; - state.position++; - } else break; - } - let hadWhitespace = false; - while (isWhiteSpace(state.input.charCodeAt(state.position))) { - hadWhitespace = true; - state.position++; - } - if (hadWhitespace && state.input.charCodeAt(state.position) === 35) skipUntilLineEnd(state); - if (isEol(state.input.charCodeAt(state.position))) consumeLineBreak(state); - else if (state.input.charCodeAt(state.position) !== 0) throwError(state, "a line break is expected"); - let contentIndent = detectedIndent ? indent : -1; - let maxLeadingIndent = 0; - const valueStart = state.position; - let valueEnd = state.position; - while (state.input.charCodeAt(state.position) !== 0) { - const linePosition = state.position; - let column = 0; - while (state.input.charCodeAt(linePosition + column) === 32) column++; - const first = state.input.charCodeAt(linePosition + column); - if (first === 0) { - if (contentIndent >= 0) { - if (column > contentIndent) valueEnd = linePosition + column; - } else if (column > 0) valueEnd = linePosition + column; - break; - } - if (linePosition === state.lineStart && testDocumentSeparator(state, linePosition)) break; - if (!detectedIndent && contentIndent === -1 && isEol(first)) maxLeadingIndent = Math.max(maxLeadingIndent, column); - if (!detectedIndent && contentIndent === -1 && !isEol(first)) { - if (first === 9 && column < parentIndent) { - state.position = linePosition + column; - throwError(state, "tab characters must not be used in indentation"); - } - if (column < maxLeadingIndent) { - state.position = linePosition + column; - throwError(state, "bad indentation of a mapping entry"); - } - } - if (contentIndent === -1 && first !== 0 && !isEol(first) && column < parentIndent) { - state.lineIndent = column; - state.position = linePosition + column; - break; - } - if (!detectedIndent && first !== 0 && !isEol(first) && contentIndent === -1) contentIndent = column; - const requiredIndent = contentIndent === -1 ? parentIndent + 1 : contentIndent; - if (first !== 0 && !isEol(first) && column < requiredIndent) { - state.lineIndent = column; - state.position = linePosition + column; - break; - } - skipUntilLineEnd(state); - valueEnd = state.position; - if (isEol(state.input.charCodeAt(state.position))) { - consumeLineBreak(state); - valueEnd = state.position; - } - } - checkPrintable(state, valueStart, valueEnd); - addScalarEvent(state, valueStart, valueEnd, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, style, chomping, contentIndent); - return true; -} -function canStartPlainScalar(state, nodeContext) { - const ch = state.input.charCodeAt(state.position); - const inFlow = nodeContext === CONTEXT_FLOW_IN; - if (ch === 0 || isWsOrEol(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96 || inFlow && isFlowIndicator(ch)) return false; - if (ch === 63 || ch === 45) { - const following = state.input.charCodeAt(state.position + 1); - if (isWsOrEolOrEnd(following) || inFlow && isFlowIndicator(following)) return false; - } - return true; -} -function readPlainScalar(state, nodeIndent, nodeContext, props) { - if (!canStartPlainScalar(state, nodeContext)) return false; - const start = state.position; - let end = state.position; - let ch = state.input.charCodeAt(state.position); - const inFlow = nodeContext === CONTEXT_FLOW_IN; - let multiline = false; - while (ch !== 0) { - if (state.position === state.lineStart && testDocumentSeparator(state)) break; - if (ch === 58) { - const following = state.input.charCodeAt(state.position + 1); - if (isWsOrEolOrEnd(following) || inFlow && isFlowIndicator(following)) break; - } else if (ch === 35) { - if (isWsOrEol(state.input.charCodeAt(state.position - 1))) break; - } else if (inFlow && isFlowIndicator(ch)) break; - else if (isEol(ch)) { - const savedPosition = state.position; - const savedLine = state.line; - const savedLineStart = state.lineStart; - const savedLineIndent = state.lineIndent; - skipSeparationSpace(state, false); - if (state.lineIndent >= nodeIndent) { - multiline = true; - ch = state.input.charCodeAt(state.position); - continue; - } - state.position = savedPosition; - state.line = savedLine; - state.lineStart = savedLineStart; - state.lineIndent = savedLineIndent; - break; - } - if (!isWhiteSpace(ch)) end = state.position + 1; - ch = state.input.charCodeAt(++state.position); - } - if (end === start) return false; - checkPrintable(state, start, end); - addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1, 1, -1, !multiline); - return true; -} -function skipFlowSeparationSpace(state, nodeIndent) { - const startLine = state.line; - skipSeparationSpace(state, true); - if (state.line > startLine && state.lineIndent < nodeIndent || state.firstTabInLine !== -1 && state.lineIndent < nodeIndent) throwError(state, "deficient indentation"); -} -function readFlowCollection(state, nodeIndent, props) { - const ch = state.input.charCodeAt(state.position); - const isMapping = ch === 123; - const start = state.position; - let readNext = true; - if (ch !== 91 && ch !== 123) return false; - const terminator = isMapping ? 125 : 93; - if (isMapping) addMappingEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2); - else addSequenceEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2); - state.position++; - while (state.input.charCodeAt(state.position) !== 0) { - skipFlowSeparationSpace(state, nodeIndent); - let ch2 = state.input.charCodeAt(state.position); - if (ch2 === terminator) { - state.position++; - addPopEvent(state); - return true; - } else if (!readNext) throwError(state, "missed comma between flow collection entries"); - else if (ch2 === 44) throwError(state, "expected the node content, but found ','"); - let isPair = false; - let isExplicitPair = false; - if (ch2 === 63 && isWsOrEol(state.input.charCodeAt(state.position + 1))) { - isPair = isExplicitPair = true; - state.position += 1; - skipFlowSeparationSpace(state, nodeIndent); - } - const entryLine = state.line; - const entryStart = snapshotState(state); - const keyWasRead = parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - skipFlowSeparationSpace(state, nodeIndent); - ch2 = state.input.charCodeAt(state.position); - if ((isMapping || isExplicitPair || state.line === entryLine) && ch2 === 58) { - isPair = true; - state.position++; - skipFlowSeparationSpace(state, nodeIndent); - if (!isMapping) { - insertFlowPairMappingEvent(state, entryStart); - if (!keyWasRead) addEmptyScalarEvent(state); - } else if (!keyWasRead) addEmptyScalarEvent(state); - if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state); - skipFlowSeparationSpace(state, nodeIndent); - if (!isMapping) addPopEvent(state); - } else if (isMapping && isPair) { - if (!keyWasRead) addEmptyScalarEvent(state); - addEmptyScalarEvent(state); - } else if (isMapping) addEmptyScalarEvent(state); - else if (isPair) { - insertFlowPairMappingEvent(state, entryStart); - if (!keyWasRead) addEmptyScalarEvent(state); - addEmptyScalarEvent(state); - addPopEvent(state); - } - ch2 = state.input.charCodeAt(state.position); - if (ch2 === 44) { - readNext = true; - state.position++; - } else readNext = false; - } - throwError(state, "unexpected end of the stream within a flow collection"); -} -function readBlockSequence(state, nodeIndent, props) { - if (state.firstTabInLine !== -1 || state.input.charCodeAt(state.position) !== 45 || !isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) return false; - addSequenceEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1); - while (state.input.charCodeAt(state.position) === 45 && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) { - if (state.firstTabInLine !== -1) { - state.position = state.firstTabInLine; - throwError(state, "tab characters must not be used in indentation"); - } - const entryLine = state.line; - state.position++; - const hadBreak = skipSeparationSpace(state, true) > 0; - if (state.firstTabInLine !== -1 && state.input.charCodeAt(state.position) === 45 && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) throwError(state, "bad indentation of a sequence entry"); - if (hadBreak && state.lineIndent <= nodeIndent) addEmptyScalarEvent(state); - else parseNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - skipSeparationSpace(state, true); - if (state.lineIndent < nodeIndent || state.position >= state.length) break; - if (state.lineIndent > nodeIndent) throwError(state, "bad indentation of a sequence entry"); - if (state.line === entryLine && state.input.charCodeAt(state.position) === 45 && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) throwError(state, "bad indentation of a sequence entry"); - } - addPopEvent(state); - return true; -} -function readBlockMapping(state, nodeIndent, flowIndent, props) { - let atExplicitKey = false; - let detected = false; - let mappingOpened = false; - let pendingExplicitKey = false; - if (state.firstTabInLine !== -1) return false; - let ch = state.input.charCodeAt(state.position); - while (ch !== 0) { - if (!atExplicitKey && state.firstTabInLine !== -1) { - state.position = state.firstTabInLine; - throwError(state, "tab characters must not be used in indentation"); - } - const following = state.input.charCodeAt(state.position + 1); - const entryLine = state.line; - if ((ch === 63 || ch === 58) && isWsOrEolOrEnd(following)) { - if (!mappingOpened) { - addMappingEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1); - mappingOpened = true; - } - if (ch === 63) { - if (atExplicitKey) addEmptyScalarEvent(state); - detected = true; - atExplicitKey = true; - } else if (atExplicitKey) atExplicitKey = false; - else { - addEmptyScalarEvent(state); - detected = true; - atExplicitKey = false; - } - state.position += 1; - pendingExplicitKey = true; - } else { - if (atExplicitKey) { - addEmptyScalarEvent(state); - atExplicitKey = false; - } - const beforeKey = snapshotState(state); - if (!parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break; - if (state.line === entryLine) { - ch = state.input.charCodeAt(state.position); - while (isWhiteSpace(ch)) ch = state.input.charCodeAt(++state.position); - if (ch === 58) { - ch = state.input.charCodeAt(++state.position); - if (!isWsOrEolOrEnd(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping"); - if (!mappingOpened) { - restoreState(state, beforeKey); - addMappingEvent(state, beforeKey.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1); - mappingOpened = true; - parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true); - ch = state.input.charCodeAt(state.position); - while (isWhiteSpace(ch)) ch = state.input.charCodeAt(++state.position); - state.position++; - } - detected = true; - atExplicitKey = false; - pendingExplicitKey = false; - } else if (detected) throwError(state, "expected ':' after a mapping key"); - else { - if (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1) { - restoreState(state, beforeKey); - return false; - } - return true; - } - } else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); - else { - if (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1) { - restoreState(state, beforeKey); - return false; - } - return true; - } - } - if (parseNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, pendingExplicitKey)) pendingExplicitKey = false; - if (!atExplicitKey) { - if (pendingExplicitKey) { - addEmptyScalarEvent(state); - pendingExplicitKey = false; - } - } - skipSeparationSpace(state, true); - ch = state.input.charCodeAt(state.position); - if ((state.line === entryLine || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a mapping entry"); - else if (state.lineIndent < nodeIndent) break; - } - if (!detected) return false; - if (atExplicitKey) addEmptyScalarEvent(state); - if (mappingOpened) addPopEvent(state); - return true; -} -function parseNode(state, parentIndent, nodeContext, allowToSeek, allowCompact, allowPropertyMapping = true) { - if (state.depth >= state.maxDepth) throwError(state, `nesting exceeded maxDepth (${state.maxDepth})`); - state.depth++; - let indentStatus = 1; - let atNewLine = false; - let hasContent = false; - let propertyStart = null; - const props = emptyProperties(); - let allowBlockScalars = nodeContext === CONTEXT_BLOCK_OUT || nodeContext === CONTEXT_BLOCK_IN; - let allowBlockCollections = allowBlockScalars; - const allowBlockStyles = allowBlockScalars; - if (allowToSeek && skipSeparationSpace(state, true)) { - atNewLine = true; - if (state.lineIndent > parentIndent) indentStatus = 1; - else if (state.lineIndent === parentIndent) indentStatus = 0; - else indentStatus = -1; - } - if (indentStatus === 1) while (true) { - const ch = state.input.charCodeAt(state.position); - const propertyState = snapshotState(state); - if (atNewLine && indentStatus !== 1 && (ch === 33 || ch === 38)) break; - if (atNewLine && allowBlockStyles && (props.tagStart !== NO_RANGE$1 || props.anchorStart !== NO_RANGE$1) && (ch === 33 || ch === 38)) { - const fallbackState = snapshotState(state); - const flowIndent = parentIndent + 1; - if (readBlockMapping(state, state.position - state.lineStart, flowIndent, props) && state.events[fallbackState.eventsLength]?.type === 3) { - state.depth--; - return true; - } - restoreState(state, fallbackState); - } - if (atNewLine && (ch === 33 && props.tagStart !== NO_RANGE$1 || ch === 38 && props.anchorStart !== NO_RANGE$1)) break; - if (!readTagProperty(state, props, nodeContext === CONTEXT_FLOW_IN) && !readAnchorProperty(state, props)) break; - if (propertyStart === null) propertyStart = propertyState; - if (skipSeparationSpace(state, true)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - if (state.lineIndent > parentIndent) indentStatus = 1; - else if (state.lineIndent === parentIndent) indentStatus = 0; - else indentStatus = -1; - } else allowBlockCollections = false; - } - if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact; - if (indentStatus === 1 || nodeContext === CONTEXT_BLOCK_OUT) { - const flowIndent = nodeContext === CONTEXT_FLOW_IN || nodeContext === CONTEXT_FLOW_OUT ? parentIndent : parentIndent + 1; - const blockIndent = state.position - state.lineStart; - if (indentStatus === 1) if (allowBlockCollections && (readBlockSequence(state, blockIndent, props) || readBlockMapping(state, blockIndent, flowIndent, props)) || readFlowCollection(state, flowIndent, props)) hasContent = true; - else { - const ch = state.input.charCodeAt(state.position); - if (propertyStart !== null && allowPropertyMapping && allowBlockStyles && !allowBlockCollections && ch !== 124 && ch !== 62) { - const fallbackState = snapshotState(state); - const propertyIndent = propertyStart.position - propertyStart.lineStart; - restoreState(state, propertyStart); - if (readBlockMapping(state, propertyIndent, flowIndent, emptyProperties()) && state.events[fallbackState.eventsLength]?.type === 3) hasContent = true; - else restoreState(state, fallbackState); - } - if (!hasContent && (allowBlockScalars && readBlockScalar(state, flowIndent, props) || readSingleQuotedScalar(state, flowIndent, props) || readDoubleQuotedScalar(state, flowIndent, props) || readAlias(state, props) || readPlainScalar(state, flowIndent, nodeContext, props))) hasContent = true; - } - else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent, props); - } - allowBlockScalars = allowBlockScalars && !hasContent; - if (!hasContent && (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1 || allowBlockScalars)) { - addScalarEvent(state, NO_RANGE$1, NO_RANGE$1, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1); - hasContent = true; - } - state.depth--; - return hasContent || props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1; -} -function readDirective(state) { - if (state.lineIndent > 0 || state.input.charCodeAt(state.position) !== 37) return false; - state.position++; - const nameStart = state.position; - while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++; - const name = state.input.slice(nameStart, state.position); - const args = []; - if (name.length === 0) throwError(state, "directive name must not be less than one character in length"); - while (state.input.charCodeAt(state.position) !== 0 && !isEol(state.input.charCodeAt(state.position))) { - while (isWhiteSpace(state.input.charCodeAt(state.position))) state.position++; - if (state.input.charCodeAt(state.position) === 35 || isEol(state.input.charCodeAt(state.position)) || state.input.charCodeAt(state.position) === 0) break; - const start = state.position; - while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++; - args.push(state.input.slice(start, state.position)); - } - if (isEol(state.input.charCodeAt(state.position))) consumeLineBreak(state); - if (name === "YAML") { - if (state.directives.some((directive) => directive.kind === "yaml")) throwError(state, "duplication of %YAML directive"); - if (args.length !== 1) throwError(state, "YAML directive accepts exactly one argument"); - const match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - if (match2 === null) throwError(state, "ill-formed argument of the YAML directive"); - if (parseInt(match2[1], 10) !== 1) throwError(state, "unacceptable YAML version of the document"); - state.directives.push({ - kind: "yaml", - version: args[0] - }); - } else if (name === "TAG") { - if (args.length !== 2) throwError(state, "TAG directive accepts exactly two arguments"); - const [handle, prefix] = args; - if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive"); - if (HAS_OWN.call(state.tagHandlers, handle)) throwError(state, `there is a previously declared suffix for "${handle}" tag handle`); - if (!PATTERN_TAG_PREFIX.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive"); - state.tagHandlers[handle] = prefix; - state.directives.push({ - kind: "tag", - handle, - prefix - }); - } - return true; -} -function readDocument(state) { - state.directives = []; - state.tagHandlers = /* @__PURE__ */ Object.create(null); - let hasDirectives = false; - skipSeparationSpace(state, true); - while (readDirective(state)) { - hasDirectives = true; - skipSeparationSpace(state, true); - } - let explicitStart = false; - let explicitEnd = false; - let allowCompact = true; - if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45 && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 3))) { - explicitStart = true; - const markerLine = state.line; - state.position += 3; - skipSeparationSpace(state, true); - allowCompact = state.line > markerLine; - } else if (hasDirectives) throwError(state, "directives end mark is expected"); - const documentEventIndex = state.events.length; - if (!explicitStart && state.position === state.lineStart && state.input.charCodeAt(state.position) === 46 && testDocumentSeparator(state)) { - state.position += 3; - skipSeparationSpace(state, true); - return; - } - addDocumentEvent(state, explicitStart, false); - if (!parseNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, allowCompact, allowCompact)) addEmptyScalarEvent(state); - skipSeparationSpace(state, true); - if (state.position === state.lineStart && testDocumentSeparator(state)) { - explicitEnd = state.input.charCodeAt(state.position) === 46; - if (explicitEnd) { - const markerLine = state.line; - state.position += 3; - skipSeparationSpace(state, true); - if (state.line === markerLine && state.position < state.length) throwError(state, "end of the stream or a document separator is expected"); - } - } - const documentEvent = state.events[documentEventIndex]; - if (documentEvent?.type === 1) documentEvent.explicitEnd = explicitEnd; - addPopEvent(state); - if (!explicitEnd && state.position < state.length && !(state.position === state.lineStart && testDocumentSeparator(state))) throwError(state, "end of the stream or a document separator is expected"); -} -function parseEvents(input, options) { - const length = input.length; - const state = { - ...DEFAULT_PARSER_OPTIONS, - ...options, - input: `${input}\0`, - length, - position: 0, - line: 0, - lineStart: 0, - lineIndent: 0, - firstTabInLine: -1, - depth: 0, - directives: [], - tagHandlers: /* @__PURE__ */ Object.create(null), - events: [] - }; - const nullpos = input.indexOf("\0"); - if (nullpos !== -1) throwErrorAt(input, nullpos, "null byte is not allowed in input", state.filename); - if (state.input.charCodeAt(state.position) === 65279) state.position++; - while (state.position < state.length) { - skipSeparationSpace(state, true); - if (state.position >= state.length) break; - const documentStart = state.position; - readDocument(state); - if (state.position === documentStart) - throwError(state, "can not read a document"); - } - return state.events; -} -var DEFAULT_LOAD_OPTIONS = { - ...DEFAULT_PARSER_OPTIONS, - ...DEFAULT_CONSTRUCTOR_OPTIONS -}; -function loadDocuments(input, options = {}) { - const opts = { - ...DEFAULT_LOAD_OPTIONS, - ...options - }; - const source = String(input); - const PARSER_OPT_KEYS = Object.keys(DEFAULT_PARSER_OPTIONS); - const CONSTRUCTOR_OPT_KEYS = Object.keys(DEFAULT_CONSTRUCTOR_OPTIONS); - return constructFromEvents(parseEvents(source, pick(opts, PARSER_OPT_KEYS)), { - ...pick(opts, CONSTRUCTOR_OPT_KEYS), - source - }); -} -function load(input, options) { - const documents = loadDocuments(input, options); - if (documents.length === 0) throw new YAMLException("expected a document, but the input is empty"); - if (documents.length === 1) return documents[0]; - throw new YAMLException("expected a single document in the stream, but found more"); -} -var Style = class { - tagged = false; - flow = false; - singleQuoted = false; - doubleQuoted = false; - literal = false; - folded = false; -}; -var INVALID = /* @__PURE__ */ Symbol("INVALID"); -function buildRepresentTypes(schema) { - const defaultTags = new Set([ - schema.defaultScalarTag, - schema.defaultSequenceTag, - schema.defaultMappingTag - ].filter((t) => t !== void 0)); - const implicitScalars = schema.implicitScalarTags; - const explicitTags = schema.tags.filter((t) => !(t.nodeKind === "scalar" && t.implicit) && !defaultTags.has(t)); - const defaultTagsLast = schema.tags.filter((t) => defaultTags.has(t)); - return [ - ...implicitScalars.map((tag) => ({ - tag, - implicitTag: true - })), - ...explicitTags.map((tag) => ({ - tag, - implicitTag: false - })), - ...defaultTagsLast.map((tag) => ({ - tag, - implicitTag: true - })) - ]; -} -function matchTag(state, object2) { - for (let index2 = 0, length = state.representTypes.length; index2 < length; index2 += 1) { - const { tag, implicitTag } = state.representTypes[index2]; - if (tag.identify && tag.identify(object2)) { - let tagName; - if (tag.matchByTagPrefix && tag.representTagName) tagName = tag.representTagName(object2); - else tagName = tag.tagName; - return { - tag, - tagName, - implicitTag - }; - } - } - return null; -} -function build(state, object2) { - if (!state.noRefs && object2 !== null && typeof object2 === "object") { - const existing = state.refs.get(object2); - if (existing) { - if (existing.anchor === void 0) existing.anchor = `ref_${state.refCounter++}`; - return { - kind: "alias", - tag: "", - style: new Style(), - anchor: existing.anchor - }; - } - } - const matched = matchTag(state, object2); - if (!matched) { - if (object2 === void 0) return INVALID; - if (state.skipInvalid) return INVALID; - throw new YAMLException(`unacceptable kind of an object to dump ${Object.prototype.toString.call(object2)}`); - } - const { tag, tagName, implicitTag } = matched; - const nodeTagName = implicitTag ? tagName : tagNameShort(tagName); - if (tag.nodeKind === "scalar") { - const style2 = new Style(); - style2.tagged = !implicitTag; - return { - kind: "scalar", - tag: nodeTagName, - style: style2, - value: tag.represent(object2) - }; - } - if (tag.nodeKind === "sequence") { - const container = tag.represent(object2); - const style2 = new Style(); - style2.tagged = !implicitTag; - const node2 = { - kind: "sequence", - tag: nodeTagName, - style: style2, - items: [] - }; - if (!state.noRefs) state.refs.set(object2, node2); - for (let index2 = 0, length = container.length; index2 < length; index2 += 1) { - let item = build(state, container[index2]); - if (item === INVALID && container[index2] === void 0) item = build(state, null); - if (item === INVALID) continue; - node2.items.push(item); - } - return node2; - } - const map = tag.represent(object2); - const style = new Style(); - style.tagged = !implicitTag; - const node = { - kind: "mapping", - tag: nodeTagName, - style, - items: [] - }; - if (!state.noRefs) state.refs.set(object2, node); - for (const [objectKey, objectValue] of map) { - const key = build(state, objectKey); - if (key === INVALID) continue; - const value = build(state, objectValue); - if (value === INVALID) continue; - node.items.push({ - key, - value - }); - } - return node; -} -function jsToAst(input, schema, options = {}) { - const root = build({ - representTypes: buildRepresentTypes(schema), - noRefs: options.noRefs ?? false, - skipInvalid: options.skipInvalid ?? false, - refs: /* @__PURE__ */ new Map(), - refCounter: 0 - }, input); - return [{ - contents: root === INVALID ? null : root, - directives: [] - }]; -} -var VISIT_BREAK = /* @__PURE__ */ Symbol("visit:break"); -var VISIT_SKIP = /* @__PURE__ */ Symbol("visit:skip"); -function visitNode(node, visitor, ctx) { - const control = visitor(node, ctx); - if (control === VISIT_BREAK) return true; - if (control === VISIT_SKIP) return false; - const depth = ctx.depth + 1; - switch (node.kind) { - case "sequence": - for (const item of node.items) if (visitNode(item, visitor, { - depth, - parent: node, - isKey: false - })) return true; - break; - case "mapping": - for (const { key, value } of node.items) { - if (visitNode(key, visitor, { - depth, - parent: node, - isKey: true - })) return true; - if (visitNode(value, visitor, { - depth, - parent: node, - isKey: false - })) return true; - } - break; - } - return false; -} -function visit(documents, visitor) { - for (const doc of documents) if (doc.contents && visitNode(doc.contents, visitor, { - depth: 0, - parent: null, - isKey: false - })) return; -} -var CHAR_BOM = 65279; -var CHAR_TAB = 9; -var CHAR_LINE_FEED = 10; -var CHAR_CARRIAGE_RETURN = 13; -var CHAR_SPACE = 32; -var CHAR_EXCLAMATION = 33; -var CHAR_DOUBLE_QUOTE = 34; -var CHAR_SHARP = 35; -var CHAR_PERCENT = 37; -var CHAR_AMPERSAND = 38; -var CHAR_SINGLE_QUOTE = 39; -var CHAR_ASTERISK = 42; -var CHAR_COMMA = 44; -var CHAR_MINUS = 45; -var CHAR_COLON = 58; -var CHAR_EQUALS = 61; -var CHAR_GREATER_THAN = 62; -var CHAR_QUESTION = 63; -var CHAR_COMMERCIAL_AT = 64; -var CHAR_LEFT_SQUARE_BRACKET = 91; -var CHAR_RIGHT_SQUARE_BRACKET = 93; -var CHAR_GRAVE_ACCENT = 96; -var CHAR_LEFT_CURLY_BRACKET = 123; -var CHAR_VERTICAL_LINE = 124; -var CHAR_RIGHT_CURLY_BRACKET = 125; -var ESCAPE_SEQUENCES = {}; -ESCAPE_SEQUENCES[0] = "\\0"; -ESCAPE_SEQUENCES[7] = "\\a"; -ESCAPE_SEQUENCES[8] = "\\b"; -ESCAPE_SEQUENCES[9] = "\\t"; -ESCAPE_SEQUENCES[10] = "\\n"; -ESCAPE_SEQUENCES[11] = "\\v"; -ESCAPE_SEQUENCES[12] = "\\f"; -ESCAPE_SEQUENCES[13] = "\\r"; -ESCAPE_SEQUENCES[27] = "\\e"; -ESCAPE_SEQUENCES[34] = '\\"'; -ESCAPE_SEQUENCES[92] = "\\\\"; -ESCAPE_SEQUENCES[133] = "\\N"; -ESCAPE_SEQUENCES[160] = "\\_"; -ESCAPE_SEQUENCES[8232] = "\\L"; -ESCAPE_SEQUENCES[8233] = "\\P"; -var DEFAULT_PRESENTER_OPTIONS = { - indent: 2, - seqNoIndent: false, - seqInlineFirst: true, - sortKeys: false, - lineWidth: 80, - flowBracketPadding: false, - flowSkipCommaSpace: false, - flowSkipColonSpace: false, - quoteFlowKeys: false, - quoteStyle: "single", - forceQuotes: false, - tagBeforeAnchor: false -}; -function nodeTagShort(node) { - return node.style.tagged ? node.tag : tagNameShort(node.tag); -} -function createPresenterState(options) { - const opts = { - ...DEFAULT_PRESENTER_OPTIONS, - ...options - }; - return { - ...opts, - defaultScalarTagName: opts.schema.defaultScalarTag.tagName, - implicitResolvers: opts.schema.implicitScalarTags - }; -} -function encodeNonPrintable(character) { - const string2 = character.toString(16).toUpperCase(); - const handle = character <= 255 ? "x" : "u"; - const length = character <= 255 ? 2 : 4; - return `\\${handle}${"0".repeat(length - string2.length)}${string2}`; -} -function indentString(string2, spaces) { - const ind = " ".repeat(spaces); - let position = 0; - let result = ""; - const length = string2.length; - while (position < length) { - let line; - const next = string2.indexOf("\n", position); - if (next === -1) { - line = string2.slice(position); - position = length; - } else { - line = string2.slice(position, next + 1); - position = next + 1; - } - if (line.length && line !== "\n") result += ind; - result += line; - } - return result; -} -function generateNextLine(state, level) { - return ` -${" ".repeat(state.indent * level)}`; -} -function scalarLayout(state, level) { - const indent = state.indent * Math.max(1, level); - return { - indent, - blockIndent: level === 0 ? state.indent + 1 : state.indent, - lineWidth: state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent) - }; -} -function resolveImplicitTag(state, str) { - for (let index2 = 0, length = state.implicitResolvers.length; index2 < length; index2 += 1) { - const tagDefinition = state.implicitResolvers[index2]; - if (tagDefinition.resolve(str, false, tagDefinition.tagName) !== NOT_RESOLVED) return tagDefinition.tagName; - } - return state.defaultScalarTagName; -} -function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; -} -function startsWithDocumentSeparator(string2) { - const marker = string2.charCodeAt(0); - if (marker !== CHAR_MINUS && marker !== 46 || string2.charCodeAt(1) !== marker || string2.charCodeAt(2) !== marker) return false; - if (string2.length === 3) return true; - const following = string2.charCodeAt(3); - return isWhitespace(following) || following === CHAR_CARRIAGE_RETURN || following === CHAR_LINE_FEED; -} -function isPrintable(c) { - return c >= 32 && c <= 126 || c >= 161 && c <= 55295 && c !== 8232 && c !== 8233 || c >= 57344 && c <= 65533 && c !== CHAR_BOM || c >= 65536 && c <= 1114111; -} -function isNsCharOrWhitespace(c) { - return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED; -} -function isPlainSafe(c, prev, inblock) { - const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); - const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); - return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar && (inblock || c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET); -} -function isPlainSafeFirst(c) { - return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT; -} -function isPlainSafeAtStart(string2, inblock) { - const first = codePointAt(string2, 0); - if (isPlainSafeFirst(first)) return true; - if (string2.length > 1 && (first === CHAR_MINUS || first === CHAR_QUESTION || first === CHAR_COLON)) { - const second = codePointAt(string2, 1); - return !isWhitespace(second) && isPlainSafe(second, first, inblock); - } - return false; -} -function isPlainSafeLast(c) { - return !isWhitespace(c) && c !== CHAR_COLON; -} -function codePointAt(string2, pos) { - const first = string2.charCodeAt(pos); - let second; - if (first >= 55296 && first <= 56319 && pos + 1 < string2.length) { - second = string2.charCodeAt(pos + 1); - if (second >= 56320 && second <= 57343) return (first - 55296) * 1024 + second - 56320 + 65536; - } - return first; -} -function needIndentIndicator(string2) { - return /^\n* /.test(string2); -} -var STYLE_PLAIN = 1; -var STYLE_SINGLE = 2; -var STYLE_LITERAL = 3; -var STYLE_FOLDED = 4; -var STYLE_DOUBLE = 5; -function chooseScalarStyle(state, string2, layout, singleLineOnly, forceQuote, inblock) { - const { blockIndent, lineWidth } = layout; - let i; - let char = 0; - let prevChar = -1; - let hasLineBreak = false; - let hasFoldableLine = false; - const shouldTrackWidth = lineWidth !== -1; - let previousLineBreak = -1; - let plain = !startsWithDocumentSeparator(string2) && isPlainSafeAtStart(string2, inblock) && isPlainSafeLast(codePointAt(string2, string2.length - 1)); - if (singleLineOnly || forceQuote) for (i = 0; i < string2.length; char >= 65536 ? i += 2 : i++) { - char = codePointAt(string2, i); - if (!isPrintable(char)) return STYLE_DOUBLE; - plain = plain && isPlainSafe(char, prevChar, inblock); - prevChar = char; - } - else { - for (i = 0; i < string2.length; char >= 65536 ? i += 2 : i++) { - char = codePointAt(string2, i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && !isMoreIndented(string2[previousLineBreak + 1]); - previousLineBreak = i; - } - } else if (!isPrintable(char)) return STYLE_DOUBLE; - plain = plain && isPlainSafe(char, prevChar, inblock); - prevChar = char; - } - hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && !isMoreIndented(string2[previousLineBreak + 1]); - } - if (!hasLineBreak && !hasFoldableLine) { - if (plain && !forceQuote) return STYLE_PLAIN; - return state.quoteStyle === "double" ? STYLE_DOUBLE : STYLE_SINGLE; - } - if (blockIndent > 9 && needIndentIndicator(string2)) return STYLE_DOUBLE; - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; -} -function renderScalarStyle(string2, style, layout) { - const { indent, blockIndent, lineWidth } = layout; - switch (style) { - case STYLE_PLAIN: - return encodeFlowBreaks(string2, indent); - case STYLE_SINGLE: - return `'${encodeFlowBreaks(string2, indent).replace(/'/g, "''")}'`; - case STYLE_LITERAL: - return "|" + blockHeader(string2, blockIndent) + dropEndingNewline(indentString(string2, indent)); - case STYLE_FOLDED: - return ">" + blockHeader(string2, blockIndent) + dropEndingNewline(indentString(foldBlockScalar(string2, lineWidth), indent)); - case STYLE_DOUBLE: - return `"${escapeString(string2)}"`; - } -} -function resolveScalarStyle(state, node, layout, iskey, inblock) { - const singleLineOnly = iskey || !inblock; - if (node.style.singleQuoted) return STYLE_SINGLE; - if (node.style.doubleQuoted) return STYLE_DOUBLE; - if (!singleLineOnly) { - if (node.style.literal) return STYLE_LITERAL; - if (node.style.folded) return STYLE_FOLDED; - } - const string2 = node.value; - if (string2.length === 0) { - if (node.style.tagged || resolveImplicitTag(state, string2) === node.tag) return STYLE_PLAIN; - return state.quoteStyle === "double" ? STYLE_DOUBLE : STYLE_SINGLE; - } - const style = chooseScalarStyle(state, string2, layout, singleLineOnly, state.forceQuotes && !iskey, inblock); - if (style === STYLE_PLAIN && !node.style.tagged && resolveImplicitTag(state, string2) !== node.tag) return state.quoteStyle === "double" ? STYLE_DOUBLE : STYLE_SINGLE; - return style; -} -function blockHeader(string2, indentPerLevel) { - const indentIndicator = needIndentIndicator(string2) ? String(indentPerLevel) : ""; - const clip = string2[string2.length - 1] === "\n"; - return `${indentIndicator}${clip && (string2[string2.length - 2] === "\n" || string2 === "\n") ? "+" : clip ? "" : "-"} -`; -} -function encodeFlowBreaks(string2, indent) { - let nextLF = string2.indexOf("\n"); - if (nextLF === -1) return string2; - const pad = " ".repeat(indent); - let result = string2.slice(0, nextLF); - const lineRe = /(\n+)([^\n]*)/g; - lineRe.lastIndex = nextLF; - let match2; - while (match2 = lineRe.exec(string2)) { - const breaks = match2[1].length; - const line = match2[2]; - result += "\n".repeat(breaks + 1) + pad + line; - } - return result; -} -function dropEndingNewline(string2) { - return string2[string2.length - 1] === "\n" ? string2.slice(0, -1) : string2; -} -function isMoreIndented(char) { - return char === " " || char === " "; -} -function foldBlockScalar(string2, width) { - const lineRe = /(\n+)([^\n]*)/g; - let nextLF = string2.indexOf("\n"); - if (nextLF === -1) nextLF = string2.length; - lineRe.lastIndex = nextLF; - let result = foldLine(string2.slice(0, nextLF), width); - let prevMoreIndented = string2[0] === "\n" || isMoreIndented(string2[0]); - let moreIndented; - let match2; - while (match2 = lineRe.exec(string2)) { - const prefix = match2[1]; - const line = match2[2]; - moreIndented = line !== "" && isMoreIndented(line[0]); - result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width); - prevMoreIndented = moreIndented; - } - return result; -} -function foldLine(line, width) { - if (line === "" || isMoreIndented(line[0])) return line; - const breakRe = / [^ \t]/g; - let match2; - let start = 0; - let end; - let curr = 0; - let next = 0; - let result = ""; - while (match2 = breakRe.exec(line)) { - next = match2.index; - if (next - start > width) { - end = curr > start ? curr : next; - result += ` -${line.slice(start, end)}`; - start = end + 1; - } - curr = next; - } - result += "\n"; - if (line.length - start > width && curr > start) result += `${line.slice(start, curr)} -${line.slice(curr + 1)}`; - else result += line.slice(start); - return result.slice(1); -} -function escapeString(string2) { - let result = ""; - let char = 0; - for (let i = 0; i < string2.length; char >= 65536 ? i += 2 : i++) { - char = codePointAt(string2, i); - const escapeSeq = ESCAPE_SEQUENCES[char]; - if (escapeSeq) { - result += escapeSeq; - continue; - } - if (isPrintable(char)) { - result += string2[i]; - if (char >= 65536) result += string2[i + 1]; - continue; - } - result += encodeNonPrintable(char); - } - return result; -} -function writeFlowSequence(state, level, node) { - let result = ""; - for (let index2 = 0, length = node.items.length; index2 < length; index2 += 1) { - const item = writeNode(state, level, node.items[index2], {}); - if (result !== "") result += `,${!state.flowSkipCommaSpace ? " " : ""}`; - result += item; - } - const pad = state.flowBracketPadding && result !== "" ? " " : ""; - return `[${pad}${result}${pad}]`; -} -function writeBlockSequence(state, level, node, compact) { - let result = ""; - for (let index2 = 0, length = node.items.length; index2 < length; index2 += 1) { - const item = writeNode(state, level + 1, node.items[index2], { - block: true, - compact: state.seqInlineFirst, - isblockseq: true - }); - if (!compact || result !== "") result += generateNextLine(state, level); - if (item === "" || CHAR_LINE_FEED === item.charCodeAt(0)) result += "-"; - else result += "- "; - result += item; - } - return result; -} -function writeFlowMapping(state, level, node) { - let result = ""; - const items = sortMappingItems(state, node.items); - for (const { key, value } of items) { - let pairBuffer = ""; - if (result !== "") pairBuffer += `,${!state.flowSkipCommaSpace ? " " : ""}`; - const keyText = writeNode(state, level, key, { iskey: true }); - const explicitPair = keyText.length > 1024; - if (explicitPair) pairBuffer += "? "; - else if (state.quoteFlowKeys) pairBuffer += '"'; - const valueText = writeNode(state, level, value, {}); - const sep7 = state.flowSkipColonSpace || valueText === "" ? "" : " "; - pairBuffer += `${keyText}${state.quoteFlowKeys && !explicitPair ? '"' : ""}:${sep7}${valueText}`; - result += pairBuffer; - } - const pad = state.flowBracketPadding && result !== "" ? " " : ""; - return `{${pad}${result}${pad}}`; -} -function sortKeyValue(key) { - return key.kind === "scalar" ? key.value : key; -} -function sortMappingItems(state, items) { - if (!state.sortKeys) return items; - const copy = items.slice(); - if (state.sortKeys === true) copy.sort((a, b) => { - const x = sortKeyValue(a.key); - const y = sortKeyValue(b.key); - if (x < y) return -1; - if (x > y) return 1; - return 0; - }); - else { - const fn = state.sortKeys; - copy.sort((a, b) => fn(sortKeyValue(a.key), sortKeyValue(b.key))); - } - return copy; -} -function writeBlockMapping(state, level, node, compact) { - let result = ""; - const items = sortMappingItems(state, node.items); - for (let index2 = 0, length = items.length; index2 < length; index2 += 1) { - let pairBuffer = ""; - if (!compact || result !== "") pairBuffer += generateNextLine(state, level); - const { key, value } = items[index2]; - const keyIsBlock = (key.kind === "mapping" || key.kind === "sequence") && !key.style.flow && key.items.length !== 0 || key.kind === "scalar" && (key.style.literal || key.style.folded); - const keyText = keyIsBlock ? writeNode(state, level + 1, key, { - block: true, - compact: true, - isblockseq: !cannotBeCompact(state, key, level + 1) - }) : writeNode(state, level + 1, key, { - block: true, - compact: true, - iskey: true - }); - const keyHasLineBreak = key.kind === "scalar" && key.value.indexOf("\n") !== -1; - const explicitPair = keyIsBlock || keyHasLineBreak || keyText.length > 1024; - if (explicitPair) if (keyText && CHAR_LINE_FEED === keyText.charCodeAt(0)) pairBuffer += "?"; - else pairBuffer += "? "; - pairBuffer += keyText; - if (explicitPair) pairBuffer += generateNextLine(state, level); - const valueText = writeNode(state, level + 1, value, { - block: true, - compact: explicitPair, - isblockseq: explicitPair && !cannotBeCompact(state, value, level + 1) - }); - const keyIsBareProps = key.kind === "scalar" && key.value === "" && keyText !== "" && keyText.charCodeAt(keyText.length - 1) !== CHAR_SINGLE_QUOTE && keyText.charCodeAt(keyText.length - 1) !== CHAR_DOUBLE_QUOTE; - const keyColonSep = !explicitPair && (key.kind === "alias" || keyIsBareProps) ? " " : ""; - if (valueText === "" || CHAR_LINE_FEED === valueText.charCodeAt(0)) pairBuffer += `${keyColonSep}:`; - else pairBuffer += `${keyColonSep}: `; - pairBuffer += valueText; - result += pairBuffer; - } - return result; -} -function cannotBeCompact(state, node, level) { - return node.style.tagged || node.anchor !== void 0 || state.indent < 2 && level > 0; -} -function writeNode(state, level, node, ctx) { - if (node.kind === "alias") return `*${node.anchor}`; - const { block = false, iskey = false, isblockseq = false } = ctx; - let compact = ctx.compact ?? false; - const hasAnchor = node.anchor !== void 0; - if (cannotBeCompact(state, node, level)) compact = false; - let body; - let shouldPrintTag = node.style.tagged; - const useBlockCollection = block && (node.kind === "mapping" || node.kind === "sequence") && !node.style.flow && node.items.length !== 0; - if (node.kind === "mapping") if (useBlockCollection) body = writeBlockMapping(state, level, node, compact); - else body = writeFlowMapping(state, level, node); - else if (node.kind === "sequence") if (useBlockCollection) if (state.seqNoIndent && !isblockseq && level > 0) body = writeBlockSequence(state, level - 1, node, compact); - else body = writeBlockSequence(state, level, node, compact); - else body = writeFlowSequence(state, level, node); - else { - const layout = scalarLayout(state, level); - const style = resolveScalarStyle(state, node, layout, iskey, block); - body = renderScalarStyle(node.value, style, layout); - shouldPrintTag = node.style.tagged || style !== STYLE_PLAIN && node.tag !== state.defaultScalarTagName; - } - if (useBlockCollection && compact && level > 0 && state.indent > 2) body = `${" ".repeat(state.indent - 2)}${body}`; - if (shouldPrintTag || hasAnchor) { - const props = []; - const tag = shouldPrintTag ? nodeTagShort(node) : null; - const anchor = hasAnchor ? `&${node.anchor}` : null; - if (state.tagBeforeAnchor) { - if (tag !== null) props.push(tag); - if (anchor !== null) props.push(anchor); - } else { - if (anchor !== null) props.push(anchor); - if (tag !== null) props.push(tag); - } - const sep7 = body === "" || body.charCodeAt(0) === CHAR_LINE_FEED ? "" : " "; - body = `${props.join(" ")}${sep7}${body}`; - } - return body; -} -function rootStartsOwnLine(node) { - return (node.kind === "sequence" || node.kind === "mapping") && !node.style.flow && node.items.length !== 0 && !node.style.tagged && node.anchor === void 0; -} -function isOpenEnded(node) { - let leaf = node; - while ((leaf.kind === "sequence" || leaf.kind === "mapping") && !leaf.style.flow && leaf.items.length !== 0) leaf = leaf.kind === "sequence" ? leaf.items[leaf.items.length - 1] : leaf.items[leaf.items.length - 1].value; - if (leaf.kind !== "scalar" || !(leaf.style.literal || leaf.style.folded)) return false; - const { value } = leaf; - return value.endsWith("\n\n") || value === "\n"; -} -function writeDocumentDirectives(doc) { - let result = ""; - for (const directive of doc.directives) { - if (directive.kind === "yaml") { - result += `%YAML ${directive.version} -`; - continue; - } - const { handle, prefix } = directive; - result += `%TAG ${handle} ${prefix} -`; - } - return result; -} -function present(documents, options) { - const state = createPresenterState(options); - let result = ""; - let previousEnded = false; - for (let index2 = 0; index2 < documents.length; index2 += 1) { - const doc = documents[index2]; - const directives = writeDocumentDirectives(doc); - const hasDirectives = directives !== ""; - const marker = doc.explicitStart || hasDirectives || index2 > 0 && !previousEnded; - result += directives; - if (doc.contents === null) { - if (marker) result += "---\n"; - } else if (marker) { - const body = writeNode(state, 0, doc.contents, { - block: true, - compact: true - }); - const sep7 = body === "" ? "" : hasDirectives || rootStartsOwnLine(doc.contents) ? "\n" : " "; - result += `---${sep7}${body} -`; - } else result += writeNode(state, 0, doc.contents, { - block: true, - compact: true - }) + "\n"; - previousEnded = doc.explicitEnd || doc.contents !== null && isOpenEnded(doc.contents); - if (previousEnded) result += "...\n"; - } - return result; -} -var DEFAULT_DUMP_SCHEMA = YAML11_SCHEMA.withTags({ - ...intYaml11Tag, - resolve: (source, isExplicit, tagName) => { - const result = intYaml11Tag.resolve(source, isExplicit, tagName); - return result === NOT_RESOLVED ? intCoreTag.resolve(source, isExplicit, tagName) : result; - } -}, { - ...floatYaml11Tag, - resolve: (source, isExplicit, tagName) => { - const result = floatYaml11Tag.resolve(source, isExplicit, tagName); - return result === NOT_RESOLVED ? floatCoreTag.resolve(source, isExplicit, tagName) : result; - } -}); -var DEFAULT_DUMP_OPTIONS = { - ...DEFAULT_PRESENTER_OPTIONS, - schema: DEFAULT_DUMP_SCHEMA, - skipInvalid: false, - noRefs: false, - flowLevel: -1, - transform: () => { - } -}; -function dump(input, options = {}) { - const opts = { - ...DEFAULT_DUMP_OPTIONS, - ...options - }; - const documents = jsToAst(input, opts.schema, { - noRefs: opts.noRefs, - skipInvalid: opts.skipInvalid - }); - if (opts.flowLevel >= 0) visit(documents, (node, ctx) => { - if (ctx.depth < opts.flowLevel) return; - node.style.flow = true; - return VISIT_SKIP; - }); - opts.transform(documents); - return present(documents, { - ...pick(opts, Object.keys(DEFAULT_PRESENTER_OPTIONS)), - schema: opts.schema - }); -} - -// src/util.ts -var semver = __toESM(require_semver2()); - -// src/api-compatibility.json -var maximumVersion = "3.22"; -var minimumVersion = "3.17"; - -// src/json/index.ts -function parseString(data) { - return JSON.parse(data); -} -function isObject(value) { - return typeof value === "object" && value !== null && !Array.isArray(value); -} -function isArray(value) { - return Array.isArray(value); -} -function isString(value) { - return typeof value === "string"; -} -function isNumber(value) { - return typeof value === "number"; -} -function isBoolean(value) { - return typeof value === "boolean"; -} -function isStringOrUndefined(value) { - return value === void 0 || isString(value); -} -function defaultCheck(validate2) { - return (arg) => ({ unknownKeys: [], invalidKeys: [], valid: validate2(arg) }); -} -function makeValidator(validate2) { - return { - validate: validate2, - check: defaultCheck(validate2), - required: true - }; -} -var string = makeValidator(isString); -var number = makeValidator(isNumber); -var boolean = makeValidator(isBoolean); -function array(validator) { - const validate2 = (val) => { - return isArray(val) && val.every((e) => validator.validate(e)); - }; - return { - validate: validate2, - check: (val, opts, path30) => { - const result = successfulCheckSchema(); - if (!isArray(val)) { - result.valid = false; - return result; - } - let index2 = 0; - for (const e of val) { - const elementPath = `${path30}[${index2}]`; - const eResult = validator.check(e, opts, `${elementPath}`); - result.invalidKeys.push(...eResult.invalidKeys); - result.unknownKeys.push(...eResult.unknownKeys); - index2++; - if (!eResult.valid) { - result.valid = false; - if (eResult.invalidKeys.length === 0) { - result.invalidKeys.push(elementPath); - } - if (opts.failFast) { - return result; - } - continue; - } - } - return result; - }, - required: true - }; -} -function object(schema) { - return { - validate: (val) => { - return isObject(val) && validateSchema(schema, val); - }, - check: (val, opts, path30) => { - if (!isObject(val)) { - return invalidCheckSchema(); - } - return checkSchema(schema, val, opts, path30); - }, - required: true - }; -} -function optionalOrNull(validator) { - return { - validate: (val) => { - return val === void 0 || val === null || validator.validate(val); - }, - check: (val, opts, path30) => { - if (val === void 0 || val === null) { - return successfulCheckSchema(); - } - return validator.check(val, opts, path30); - }, - required: false - }; -} -function optional(validator) { - return { - validate: (val) => { - return val === void 0 || validator.validate(val); - }, - check: (val, opts, path30) => { - if (val === void 0) { - return successfulCheckSchema(); - } - return validator.check(val, opts, path30); - }, - required: false - }; -} -function validateSchema(schema, obj) { - const result = checkSchema(schema, obj, { failFast: true }); - return result.valid; -} -function validateArray(elementSchema, arr) { - const elementValidator = object(elementSchema); - return array(elementValidator).validate(arr); -} -function successfulCheckSchema() { - return { - valid: true, - unknownKeys: [], - invalidKeys: [] - }; -} -function invalidCheckSchema() { - return { - valid: false, - unknownKeys: [], - invalidKeys: [] - }; -} -function checkSchema(schema, obj, options = {}, path30 = "") { - const result = successfulCheckSchema(); - const inputKeys = new Set(Object.keys(obj)); - const invalidKeys = /* @__PURE__ */ new Set(); - for (const [key, validator] of Object.entries(schema)) { - const hasKey = key in obj; - inputKeys.delete(key); - invalidKeys.add(key); - if (validator.required && !hasKey) { - result.valid = false; - if (options.failFast) { - break; - } - continue; - } - if (validator.required && (obj[key] === void 0 || obj[key] === null)) { - result.valid = false; - if (options.failFast) { - break; - } - continue; - } - if (hasKey) { - const checkResult = validator.check(obj[key], options, `${path30}.${key}`); - result.unknownKeys.push(...checkResult.unknownKeys); - result.invalidKeys.push(...checkResult.invalidKeys); - if (checkResult.invalidKeys.length > 0) { - invalidKeys.delete(key); - } - if (!checkResult.valid) { - result.valid = false; - if (options.failFast) { - break; - } - continue; - } - } - invalidKeys.delete(key); - } - for (const remainingKey of inputKeys) { - result.unknownKeys.push(`${path30}.${remainingKey}`); - } - for (const invalidKey of invalidKeys) { - result.invalidKeys.push(`${path30}.${invalidKey}`); - } - return result; -} - -// src/util.ts -var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; -var BROKEN_VERSIONS = ["0.0.0-20211207"]; -var GITHUB_DOTCOM_URL = "https://github.com"; -var DEFAULT_DEBUG_ARTIFACT_NAME = "debug-artifacts"; -var DEFAULT_DEBUG_DATABASE_NAME = "db"; -var DEFAULT_RESERVED_RAM_SCALING_FACTOR = 0.05; -var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024; -function getExtraOptionsEnvParam() { - const varName = "CODEQL_ACTION_EXTRA_OPTIONS"; - const raw = process.env[varName]; - if (raw === void 0 || raw.length === 0) { - return {}; - } - try { - return load(raw); - } catch (unwrappedError) { - const error3 = wrapError(unwrappedError); - throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` - ); - } -} -function getSystemReservedMemoryMegaBytes(totalMemoryMegaBytes, platform2) { - const fixedAmount = 1024 * (platform2 === "win32" ? 1.5 : 1); - const scaledAmount = getReservedRamScaleFactor() * Math.max(totalMemoryMegaBytes - 8 * 1024, 0); - return fixedAmount + scaledAmount; -} -function getReservedRamScaleFactor() { - const envVar = Number.parseInt( - process.env["CODEQL_ACTION_SCALING_RESERVED_RAM_PERCENTAGE" /* SCALING_RESERVED_RAM_PERCENTAGE */] || "", - 10 - ); - if (envVar < 0 || envVar > 100 || Number.isNaN(envVar)) { - return DEFAULT_RESERVED_RAM_SCALING_FACTOR; - } - return envVar / 100; -} -function getMemoryFlagValueForPlatform(userInput, totalMemoryBytes, platform2) { - let memoryToUseMegaBytes; - if (userInput) { - memoryToUseMegaBytes = Number(userInput); - if (Number.isNaN(memoryToUseMegaBytes) || memoryToUseMegaBytes <= 0) { - throw new ConfigurationError( - `Invalid RAM setting "${userInput}", specified.` - ); - } - } else { - const totalMemoryMegaBytes = totalMemoryBytes / (1024 * 1024); - const reservedMemoryMegaBytes = getSystemReservedMemoryMegaBytes( - totalMemoryMegaBytes, - platform2 - ); - memoryToUseMegaBytes = totalMemoryMegaBytes - reservedMemoryMegaBytes; - } - return Math.floor(memoryToUseMegaBytes); -} -function getTotalMemoryBytes(logger) { - const limits = [os.totalmem()]; - if (os.platform() === "linux") { - limits.push( - ...[ - "/sys/fs/cgroup/memory/memory.limit_in_bytes", - "/sys/fs/cgroup/memory.max" - ].map((file) => getCgroupMemoryLimitBytes(file, logger)).filter((limit2) => limit2 !== void 0).map((limit2) => limit2) - ); - } - const limit = Math.min(...limits); - logger.debug( - `While resolving RAM, determined that the total memory available to the Action is ${limit / (1024 * 1024)} MiB.` - ); - return limit; -} -function getCgroupMemoryLimitBytes(limitFile, logger) { - if (!fs.existsSync(limitFile)) { - logger.debug( - `While resolving RAM, did not find a cgroup memory limit at ${limitFile}.` - ); - return void 0; - } - const limit = Number(fs.readFileSync(limitFile, "utf8")); - if (!Number.isInteger(limit)) { - logger.debug( - `While resolving RAM, ignored the file ${limitFile} that may contain a cgroup memory limit as this file did not contain an integer.` - ); - return void 0; - } - const displayLimit = `${Math.floor(limit / (1024 * 1024))} MiB`; - if (limit > os.totalmem()) { - logger.debug( - `While resolving RAM, ignored the file ${limitFile} that may contain a cgroup memory limit as its contents ${displayLimit} were greater than the total amount of system memory.` - ); - return void 0; - } - if (limit < MINIMUM_CGROUP_MEMORY_LIMIT_BYTES) { - logger.info( - `While resolving RAM, ignored a cgroup limit of ${displayLimit} in ${limitFile} as it was below ${MINIMUM_CGROUP_MEMORY_LIMIT_BYTES / (1024 * 1024)} MiB.` - ); - return void 0; - } - logger.info( - `While resolving RAM, found a cgroup limit of ${displayLimit} in ${limitFile}.` - ); - return limit; -} -function getCodeQLMemoryLimit(userInput, logger) { - return getMemoryFlagValueForPlatform( - userInput, - getTotalMemoryBytes(logger), - process.platform - ); -} -function getMemoryFlag(userInput, logger) { - const megabytes = getCodeQLMemoryLimit(userInput, logger); - return `--ram=${megabytes}`; -} -function getThreadsFlagValue(userInput, logger) { - let numThreads; - const maxThreadsCandidates = [os.cpus().length]; - if (os.platform() === "linux") { - maxThreadsCandidates.push( - ...["/sys/fs/cgroup/cpuset.cpus.effective", "/sys/fs/cgroup/cpuset.cpus"].map((file) => getCgroupCpuCountFromCpus(file, logger)).filter((count) => count !== void 0 && count > 0).map((count) => count) - ); - maxThreadsCandidates.push( - ...["/sys/fs/cgroup/cpu.max"].map((file) => getCgroupCpuCountFromCpuMax(file, logger)).filter((count) => count !== void 0 && count > 0).map((count) => count) - ); - } - const maxThreads = Math.min(...maxThreadsCandidates); - if (userInput) { - numThreads = Number(userInput); - if (Number.isNaN(numThreads)) { - throw new ConfigurationError( - `Invalid threads setting "${userInput}", specified.` - ); - } - if (numThreads > maxThreads) { - logger.info( - `Clamping desired number of threads (${numThreads}) to max available (${maxThreads}).` - ); - numThreads = maxThreads; - } - const minThreads = -maxThreads; - if (numThreads < minThreads) { - logger.info( - `Clamping desired number of free threads (${numThreads}) to max available (${minThreads}).` - ); - numThreads = minThreads; - } - } else { - numThreads = maxThreads; - } - return numThreads; -} -function getCgroupCpuCountFromCpuMax(cpuMaxFile, logger) { - if (!fs.existsSync(cpuMaxFile)) { - logger.debug( - `While resolving threads, did not find a cgroup CPU file at ${cpuMaxFile}.` - ); - return void 0; - } - const cpuMaxString = fs.readFileSync(cpuMaxFile, "utf-8"); - const cpuMaxStringSplit = cpuMaxString.split(" "); - if (cpuMaxStringSplit.length !== 2) { - logger.debug( - `While resolving threads, did not use cgroup CPU file at ${cpuMaxFile} because it contained ${cpuMaxStringSplit.length} value(s) rather than the two expected.` - ); - return void 0; - } - const cpuLimit = cpuMaxStringSplit[0]; - if (cpuLimit === "max") { - return void 0; - } - const duration = cpuMaxStringSplit[1]; - const cpuCount = Math.floor(parseInt(cpuLimit) / parseInt(duration)); - logger.info( - `While resolving threads, found a cgroup CPU file with ${cpuCount} CPUs in ${cpuMaxFile}.` - ); - return cpuCount; -} -function getCgroupCpuCountFromCpus(cpusFile, logger) { - if (!fs.existsSync(cpusFile)) { - logger.debug( - `While resolving threads, did not find a cgroup CPUs file at ${cpusFile}.` - ); - return void 0; - } - let cpuCount = 0; - const cpusString = fs.readFileSync(cpusFile, "utf-8").trim(); - if (cpusString.length === 0) { - return void 0; - } - for (const token of cpusString.split(",")) { - if (!token.includes("-")) { - ++cpuCount; - } else { - const cpuStartIndex = parseInt(token.split("-")[0]); - const cpuEndIndex = parseInt(token.split("-")[1]); - cpuCount += cpuEndIndex - cpuStartIndex + 1; - } - } - logger.info( - `While resolving threads, found a cgroup CPUs file with ${cpuCount} CPUs in ${cpusFile}.` - ); - return cpuCount; -} -function getThreadsFlag(userInput, logger) { - return `--threads=${getThreadsFlagValue(userInput, logger)}`; -} -function getCodeQLDatabasePath(config, language) { - return path.resolve(config.dbLocation, language); -} -function getGeneratedSuitePath(config, language) { - return path.resolve( - config.dbLocation, - language, - "temp", - "config-queries.qls" - ); -} -function parseGitHubUrl(inputUrl) { - const originalUrl = inputUrl; - if (inputUrl.indexOf("://") === -1) { - inputUrl = `https://${inputUrl}`; - } - if (!inputUrl.startsWith("http://") && !inputUrl.startsWith("https://")) { - throw new ConfigurationError(`"${originalUrl}" is not a http or https URL`); - } - let url2; - try { - url2 = new URL(inputUrl); - } catch { - throw new ConfigurationError(`"${originalUrl}" is not a valid URL`); - } - if (url2.hostname === "github.com" || url2.hostname === "api.github.com") { - return GITHUB_DOTCOM_URL; - } - if (url2.pathname.indexOf("/api/v3") !== -1) { - url2.pathname = url2.pathname.substring(0, url2.pathname.indexOf("/api/v3")); - } - if (url2.hostname.startsWith("api.")) { - url2.hostname = url2.hostname.substring(4); - } - if (!url2.pathname.endsWith("/")) { - url2.pathname = `${url2.pathname}/`; - } - return url2.toString(); -} -var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; -var hasBeenWarnedAboutVersion = false; -function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { - return; - } - const disallowedAPIVersionReason = apiVersionInRange( - version.version, - minimumVersion, - maximumVersion - ); - if (disallowedAPIVersionReason === 0 /* ACTION_TOO_OLD */) { - logger.warning( - `The CodeQL Action version you are using is too old to be compatible with GitHub Enterprise ${version.version}. If you experience issues, please upgrade to a more recent version of the CodeQL Action.` - ); - } - if (disallowedAPIVersionReason === 1 /* ACTION_TOO_NEW */) { - logger.warning( - `GitHub Enterprise ${version.version} is too old to be compatible with this version of the CodeQL Action. If you experience issues, please upgrade to a more recent version of GitHub Enterprise or use an older version of the CodeQL Action.` - ); - } - hasBeenWarnedAboutVersion = true; - core2.exportVariable(CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR, true); -} -function apiVersionInRange(version, minimumVersion2, maximumVersion2) { - if (!semver.satisfies(version, `>=${minimumVersion2}`)) { - return 1 /* ACTION_TOO_NEW */; - } - if (!semver.satisfies(version, `<=${maximumVersion2}`)) { - return 0 /* ACTION_TOO_OLD */; - } - return void 0; -} -var ExhaustivityCheckingError = class extends Error { - constructor(expectedExhaustiveValue) { - super("Internal error: exhaustivity checking failure"); - this.expectedExhaustiveValue = expectedExhaustiveValue; - } - expectedExhaustiveValue; -}; -function assertNever(value) { - throw new ExhaustivityCheckingError(value); -} -function initializeEnvironment(version) { - core2.exportVariable("CODEQL_ACTION_FEATURE_MULTI_LANGUAGE" /* FEATURE_MULTI_LANGUAGE */, "false"); - core2.exportVariable("CODEQL_ACTION_FEATURE_SANDWICH" /* FEATURE_SANDWICH */, "false"); - core2.exportVariable("CODEQL_ACTION_FEATURE_SARIF_COMBINE" /* FEATURE_SARIF_COMBINE */, "true"); - core2.exportVariable("CODEQL_ACTION_FEATURE_WILL_UPLOAD" /* FEATURE_WILL_UPLOAD */, "true"); - core2.exportVariable("CODEQL_ACTION_VERSION" /* VERSION */, version); -} -var HTTPError = class extends Error { - status; - constructor(message, status) { - super(message); - this.status = status; - } -}; -var ConfigurationError = class extends Error { -}; -function asHTTPError(arg) { - if (!isObject(arg) || !isString(arg.message)) { - return void 0; - } - if (Number.isInteger(arg.status)) { - return new HTTPError(arg.message, arg.status); - } - if (Number.isInteger(arg.httpStatusCode)) { - return new HTTPError(arg.message, arg.httpStatusCode); - } - return void 0; -} -async function codeQlVersionAtLeast(codeql, requiredVersion) { - return semver.gte((await codeql.getVersion()).version, requiredVersion); -} -function getBaseDatabaseOidsFilePath(config) { - return path.join(config.dbLocation, BASE_DATABASE_OIDS_FILE_NAME); -} -async function bundleDb(config, language, codeql, dbName, { includeDiagnostics }) { - const databasePath = getCodeQLDatabasePath(config, language); - const databaseBundlePath = path.resolve(config.dbLocation, `${dbName}.zip`); - if (fs.existsSync(databaseBundlePath)) { - await fs.promises.rm(databaseBundlePath, { force: true }); - } - const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); - const additionalFiles = []; - if (fs.existsSync(baseDatabaseOidsFilePath)) { - await fsPromises.copyFile( - baseDatabaseOidsFilePath, - path.join(databasePath, BASE_DATABASE_OIDS_FILE_NAME) - ); - additionalFiles.push(BASE_DATABASE_OIDS_FILE_NAME); - } - await codeql.databaseBundle( - databasePath, - databaseBundlePath, - dbName, - includeDiagnostics, - additionalFiles - ); - return databaseBundlePath; -} -async function delay(milliseconds, opts) { - const { allowProcessExit } = opts || {}; - return new Promise((resolve14) => { - const timer = setTimeout(resolve14, milliseconds); - if (allowProcessExit) { - timer.unref(); - } - }); -} -function isGoodVersion(versionSpec) { - return !BROKEN_VERSIONS.includes(versionSpec); -} -function isInTestMode() { - return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; -} -function shouldSkipSarifUpload() { - return isInTestMode() || process.env["CODEQL_ACTION_SKIP_SARIF_UPLOAD" /* SKIP_SARIF_UPLOAD */] === "true"; -} -function getTestingEnvironment() { - const testingEnvironment = process.env["CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */] || ""; - if (testingEnvironment === "") { - return void 0; - } - return testingEnvironment; -} -function doesDirectoryExist(dirPath) { - try { - const stats = fs.lstatSync(dirPath); - return stats.isDirectory(); - } catch { - return false; - } -} -function listFolder(dir) { - if (!doesDirectoryExist(dir)) { - return []; - } - const entries = fs.readdirSync(dir, { withFileTypes: true }); - let files = []; - for (const entry of entries) { - if (entry.isFile()) { - files.push(path.resolve(dir, entry.name)); - } else if (entry.isDirectory()) { - files = files.concat(listFolder(path.resolve(dir, entry.name))); - } - } - return files; -} -async function tryGetFolderBytes(cacheDir2, logger, quiet = false) { - try { - return await getFolderSize.loose(cacheDir2); - } catch (e) { - if (!quiet || logger.isDebug()) { - logger.warning( - `Encountered an error while getting size of '${cacheDir2}': ${e}` - ); - } - return void 0; - } -} -var hadTimeout = false; -async function waitForResultWithTimeLimit(timeoutMs, promise, onTimeout) { - let finished = false; - const mainTask = async () => { - const result = await promise; - finished = true; - return result; - }; - const timeoutTask = async () => { - await delay(timeoutMs, { allowProcessExit: true }); - if (!finished) { - hadTimeout = true; - onTimeout(); - } - return void 0; - }; - return await Promise.race([mainTask(), timeoutTask()]); -} -async function checkForTimeout() { - if (hadTimeout === true) { - core2.info( - "A timeout occurred, force exiting the process after 30 seconds to prevent hanging." - ); - await delay(3e4, { allowProcessExit: true }); - process.exit(); - } -} -function isHostedRunner() { - return ( - // Name of the runner on hosted Windows runners - process.env["RUNNER_NAME"]?.includes("Hosted Agent") || // Name of the runner on hosted POSIX runners - process.env["RUNNER_NAME"]?.includes("GitHub Actions") || // Segment of the path to the tool cache on all hosted runners - process.env["RUNNER_TOOL_CACHE"]?.includes("hostedtoolcache") - ); -} -function parseMatrixInput(matrixInput) { - if (matrixInput === void 0 || matrixInput === "null") { - return void 0; - } - return JSON.parse(matrixInput); -} -function wrapError(error3) { - return error3 instanceof Error ? error3 : new Error(String(error3)); -} -function getErrorMessage(error3) { - return error3 instanceof Error ? error3.message : String(error3); -} -function prettyPrintPack(pack) { - return `${pack.name}${pack.version ? `@${pack.version}` : ""}${pack.path ? `:${pack.path}` : ""}`; -} -async function checkDiskUsage(logger) { - try { - const diskUsage = await fsPromises.statfs( - getRequiredEnvParam("GITHUB_WORKSPACE") - ); - const blockSizeInBytes = diskUsage.bsize; - const numBlocksPerMb = 1024 * 1024 / blockSizeInBytes; - const numBlocksPerGb = 1024 * 1024 * 1024 / blockSizeInBytes; - if (diskUsage.bavail < 2 * numBlocksPerGb) { - const message = `The Actions runner is running low on disk space (${(diskUsage.bavail / numBlocksPerMb).toPrecision(4)} MB available).`; - if (process.env["CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE" /* HAS_WARNED_ABOUT_DISK_SPACE */] !== "true") { - logger.warning(message); - } else { - logger.debug(message); - } - core2.exportVariable("CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE" /* HAS_WARNED_ABOUT_DISK_SPACE */, "true"); - } - return { - numAvailableBytes: diskUsage.bavail * blockSizeInBytes, - numTotalBytes: diskUsage.blocks * blockSizeInBytes - }; - } catch (error3) { - logger.warning( - `Failed to check available disk space: ${getErrorMessage(error3)}` - ); - return void 0; - } -} -function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4 - !process.env["CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */]) { - if (githubVersion.type === "GitHub.com" /* DOTCOM */ || githubVersion.type === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ || githubVersion.type === "GitHub Enterprise Server" /* GHES */ && semver.satisfies( - semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.20" - )) { - core2.warning( - "CodeQL Action v3 will be deprecated in December 2026. Please update all occurrences of the CodeQL Action in your workflow files to v4. For more information, see https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/" - ); - core2.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); - } - } -} -function satisfiesGHESVersion(ghesVersion, range2, defaultIfInvalid) { - const semverVersion = semver.coerce(ghesVersion); - if (semverVersion === null) { - return defaultIfInvalid; - } - semverVersion.prerelease = []; - return semver.satisfies(semverVersion, range2); -} -var BuildMode = /* @__PURE__ */ ((BuildMode3) => { - BuildMode3["None"] = "none"; - BuildMode3["Autobuild"] = "autobuild"; - BuildMode3["Manual"] = "manual"; - return BuildMode3; -})(BuildMode || {}); -function cloneObject(obj) { - return JSON.parse(JSON.stringify(obj)); -} -async function cleanUpPath(file, name, logger) { - logger.debug(`Cleaning up ${name}.`); - try { - await fs.promises.rm(file, { - force: true, - recursive: true - }); - } catch (e) { - logger.warning(`Failed to clean up ${name}: ${e}.`); - } -} -async function isBinaryAccessible(binary, logger) { - try { - await io.which(binary, true); - logger.debug(`Found ${binary}.`); - return true; - } catch (e) { - logger.debug(`Could not find ${binary}: ${e}`); - return false; - } -} -async function asyncFilter(array2, predicate) { - const results = await Promise.all(array2.map(predicate)); - return array2.filter((_2, index2) => results[index2]); -} -async function asyncSome(array2, predicate) { - const results = await Promise.all(array2.map(predicate)); - return results.some((result) => result); -} -function isDefined2(value) { - return value !== void 0 && value !== null; -} -function unsafeEntriesInvariant(object2) { - return Object.entries(object2).filter( - ([_2, val]) => val !== void 0 - ); -} -function joinAtMost(array2, separator, limit) { - if (limit > 0 && array2.length > limit) { - array2 = array2.slice(0, limit); - array2.push("..."); - } - return array2.join(separator); -} -var Success = class { - constructor(value) { - this.value = value; - } - value; - isSuccess() { - return true; - } - isFailure() { - return false; - } - orElse(_defaultValue) { - return this.value; - } -}; -var Failure = class { - constructor(value) { - this.value = value; - } - value; - isSuccess() { - return false; - } - isFailure() { - return true; - } - orElse(defaultValue) { - return defaultValue; - } -}; - -// src/actions-util.ts -function getActionsEnv() { - return { - getRequiredInput, - getOptionalInput, - exportVariable: core3.exportVariable - }; -} -var getRequiredInput = function(name) { - const value = core3.getInput(name); - if (!value) { - throw new ConfigurationError(`Input required and not supplied: ${name}`); - } - return value; -}; -var getOptionalInput = function(name) { - const value = core3.getInput(name); - return value.length > 0 ? value : void 0; -}; -function getTemporaryDirectory(env = getEnv()) { - return env.getOptional("CODEQL_ACTION_TEMP" /* TEMP */) ?? env.getRequired("RUNNER_TEMP" /* RUNNER_TEMP */); -} -var PR_DIFF_RANGE_JSON_FILENAME = "pr-diff-range.json"; -function getDiffRangesJsonFilePath(env = getEnv()) { - return path2.join(getTemporaryDirectory(env), PR_DIFF_RANGE_JSON_FILENAME); -} -function getActionVersion() { - return "4.37.8"; -} -function getWorkflowEventName(env = getEnv()) { - return env.getRequired("GITHUB_EVENT_NAME" /* GITHUB_EVENT_NAME */); -} -function isRunningLocalAction(env = getEnv()) { - const relativeScriptPath = getRelativeScriptPath(env); - return relativeScriptPath.startsWith("..") || path2.isAbsolute(relativeScriptPath); -} -function getRelativeScriptPath(env) { - const runnerTemp = env.getRequired("RUNNER_TEMP" /* RUNNER_TEMP */); - const actionsDirectory = path2.join(path2.dirname(runnerTemp), "_actions"); - return path2.relative(actionsDirectory, __filename); -} -function getWorkflowEvent(env = getEnv()) { - const eventJsonFile = env.getRequired("GITHUB_EVENT_PATH" /* GITHUB_EVENT_PATH */); - try { - return JSON.parse(fs2.readFileSync(eventJsonFile, "utf-8")); - } catch (e) { - throw new Error( - `Unable to read workflow event JSON from ${eventJsonFile}: ${e}` - ); - } -} -async function printDebugLogs(config) { - for (const language of config.languages) { - const databaseDirectory = getCodeQLDatabasePath(config, language); - const logsDirectory = path2.join(databaseDirectory, "log"); - if (!doesDirectoryExist(logsDirectory)) { - core3.info(`Directory ${logsDirectory} does not exist.`); - continue; - } - const walkLogFiles = (dir) => { - const entries = fs2.readdirSync(dir, { withFileTypes: true }); - if (entries.length === 0) { - core3.info(`No debug logs found at directory ${logsDirectory}.`); - } - for (const entry of entries) { - if (entry.isFile()) { - const absolutePath = path2.resolve(dir, entry.name); - core3.startGroup( - `CodeQL Debug Logs - ${language} - ${entry.name} from file at path ${absolutePath}` - ); - process.stdout.write(fs2.readFileSync(absolutePath)); - core3.endGroup(); - } else if (entry.isDirectory()) { - walkLogFiles(path2.resolve(dir, entry.name)); - } - } - }; - walkLogFiles(logsDirectory); - } -} -function getUploadValue(input) { - switch (input) { - case void 0: - case "true": - case "always": - return "always"; - case "false": - case "failure-only": - return "failure-only"; - case "never": - return "never"; - default: - core3.warning( - `Unrecognized 'upload' input to 'analyze' Action: ${input}. Defaulting to 'always'.` - ); - return "always"; - } -} -function getWorkflowRunID(env = getEnv()) { - const workflowRunIdString = env.getRequired("GITHUB_RUN_ID" /* GITHUB_RUN_ID */); - const workflowRunID = parseInt(workflowRunIdString, 10); - if (Number.isNaN(workflowRunID)) { - throw new Error( - `${"GITHUB_RUN_ID" /* GITHUB_RUN_ID */} must define a non NaN workflow run ID. Current value is ${workflowRunIdString}` - ); - } - if (workflowRunID < 0) { - throw new Error( - `${"GITHUB_RUN_ID" /* GITHUB_RUN_ID */} must be a non-negative integer. Current value is ${workflowRunIdString}` - ); - } - return workflowRunID; -} -function getWorkflowRunAttempt(env = getEnv()) { - const workflowRunAttemptString = env.getRequired( - "GITHUB_RUN_ATTEMPT" /* GITHUB_RUN_ATTEMPT */ - ); - const workflowRunAttempt = parseInt(workflowRunAttemptString, 10); - if (Number.isNaN(workflowRunAttempt)) { - throw new Error( - `${"GITHUB_RUN_ATTEMPT" /* GITHUB_RUN_ATTEMPT */} must define a non NaN workflow run attempt. Current value is ${workflowRunAttemptString}` - ); - } - if (workflowRunAttempt <= 0) { - throw new Error( - `${"GITHUB_RUN_ATTEMPT" /* GITHUB_RUN_ATTEMPT */} must be a positive integer. Current value is ${workflowRunAttemptString}` - ); - } - return workflowRunAttempt; -} -var FileCmdNotFoundError = class extends Error { - constructor(msg) { - super(msg); - this.name = "FileCmdNotFoundError"; - } -}; -var getFileType = async (filePath) => { - let stderr = ""; - let stdout = ""; - let fileCmdPath; - try { - fileCmdPath = await io2.which("file", true); - } catch (e) { - throw new FileCmdNotFoundError( - `The \`file\` program is required, but does not appear to be installed. Please install it: ${e}` - ); - } - try { - await new toolrunner.ToolRunner(fileCmdPath, ["-L", filePath], { - silent: true, - listeners: { - stdout: (data) => { - stdout += data.toString(); - }, - stderr: (data) => { - stderr += data.toString(); - } - } - }).exec(); - return stdout.trim(); - } catch (e) { - core3.info( - `Could not determine type of ${filePath} from ${stdout}. ${stderr}` - ); - throw e; - } -}; -function isSelfHostedRunner(env = getEnv()) { - return env.getOptional("RUNNER_ENVIRONMENT" /* RUNNER_ENVIRONMENT */) === "self-hosted"; -} -function isDynamicWorkflow(env = getEnv()) { - return getWorkflowEventName(env) === "dynamic"; -} -function isDefaultSetup(env = getEnv()) { - return isDynamicWorkflow(env); -} -function prettyPrintInvocation(cmd, args) { - return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); -} -var CommandInvocationError = class extends Error { - constructor(cmd, args, exitCode, stderr, stdout = "") { - const prettyCommand = prettyPrintInvocation(cmd, args); - const lastLine = ensureEndsInPeriod( - stderr.trim().split("\n").pop()?.trim() || "n/a" - ); - super( - `Failed to run "${prettyCommand}". Exit code was ${exitCode} and last log line was: ${lastLine} See the logs for more details.` - ); - this.cmd = cmd; - this.args = args; - this.exitCode = exitCode; - this.stderr = stderr; - this.stdout = stdout; - } - cmd; - args; - exitCode; - stderr; - stdout; -}; -function ensureEndsInPeriod(text) { - return text[text.length - 1] === "." ? text : `${text}.`; -} -var MAX_STDERR_BUFFER_SIZE = 2e4; -async function runTool(cmd, args = [], opts = {}) { - let stdout = ""; - let stderr = ""; - if (!opts.noStreamStdout) { - process.stdout.write(`[command]${cmd} ${args.join(" ")} -`); - } - const exitCode = await new toolrunner.ToolRunner(cmd, args, { - ignoreReturnCode: true, - listeners: { - stdout: (data) => { - stdout += data.toString("utf8"); - if (!opts.noStreamStdout) { - process.stdout.write(data); - } - }, - stderr: (data) => { - let readStartIndex = 0; - if (data.length - MAX_STDERR_BUFFER_SIZE > 0) { - readStartIndex = data.length - MAX_STDERR_BUFFER_SIZE + 1; - } - stderr += data.toString("utf8", readStartIndex); - process.stdout.write(data); - } - }, - silent: true, - ...opts.stdin ? { input: Buffer.from(opts.stdin || "") } : {} - }).exec(); - if (exitCode !== 0) { - throw new CommandInvocationError(cmd, args, exitCode, stderr, stdout); - } - return stdout; -} -var persistedInputsKey = "persisted_inputs"; -var persistInputs = function(env = getEnv()) { - const entries = env.entries(); - const inputEnvironmentVariables = entries.filter( - ([name]) => name.startsWith("INPUT_") - ); - core3.saveState(persistedInputsKey, JSON.stringify(inputEnvironmentVariables)); -}; -var restoreInputs = function() { - const persistedInputs = core3.getState(persistedInputsKey); - if (persistedInputs) { - for (const [name, value] of JSON.parse(persistedInputs)) { - process.env[name] = value; - } - } -}; -function getPullRequestBranches(env = getEnv()) { - const pullRequest = github.context.payload.pull_request; - if (pullRequest) { - return { - base: pullRequest.base.ref, - // We use the head label instead of the head ref here, because the head - // ref lacks owner information and by itself does not uniquely identify - // the head branch (which may be in a forked repository). - head: pullRequest.head.label - }; - } - const codeScanningRef = env.getOptional("CODE_SCANNING_REF" /* CODE_SCANNING_REF */); - const codeScanningBaseBranch = env.getOptional( - "CODE_SCANNING_BASE_BRANCH" /* CODE_SCANNING_BASE_BRANCH */ - ); - if (codeScanningRef && codeScanningBaseBranch) { - return { - base: codeScanningBaseBranch, - // PR analysis under Default Setup analyzes the PR head commit instead of - // the merge commit, so we can use the provided ref directly. - head: codeScanningRef - }; - } - return void 0; -} -function isAnalyzingPullRequest(env = getEnv()) { - return getPullRequestBranches(env) !== void 0; -} -var qualityCategoryMapping = { - "c#": "csharp", - cpp: "c-cpp", - c: "c-cpp", - "c++": "c-cpp", - java: "java-kotlin", - javascript: "javascript-typescript", - typescript: "javascript-typescript", - kotlin: "java-kotlin" -}; -function fixCodeQualityCategory(logger, category, env = getEnv()) { - if (category !== void 0 && isDefaultSetup(env) && category.startsWith("/language:")) { - const language = category.substring("/language:".length); - const mappedLanguage = qualityCategoryMapping[language]; - if (mappedLanguage) { - const newCategory = `/language:${mappedLanguage}`; - logger.info( - `Adjusted category for Code Quality from '${category}' to '${newCategory}'.` - ); - return newCategory; - } - } - return category; -} - -// src/logging.ts -var core4 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core4.debug, - info: core4.info, - warning: core4.warning, - error: core4.error, - isDebug: core4.isDebug, - startGroup: core4.startGroup, - endGroup: core4.endGroup - }; -} -function withGroup(groupName, f) { - core4.startGroup(groupName); - try { - return f(); - } finally { - core4.endGroup(); - } -} -async function withGroupAsync(groupName, f) { - core4.startGroup(groupName); - try { - return await f(); - } finally { - core4.endGroup(); - } -} -function formatDuration(durationMs) { - if (durationMs < 1e3) { - return `${durationMs}ms`; - } - if (durationMs < 60 * 1e3) { - return `${(durationMs / 1e3).toFixed(1)}s`; - } - const minutes = Math.floor(durationMs / (60 * 1e3)); - const seconds = Math.floor(durationMs % (60 * 1e3) / 1e3); - return `${minutes}m${seconds}s`; -} - -// src/status-report.ts -var os3 = __toESM(require("os")); -var core7 = __toESM(require_core()); - -// node_modules/uuid/dist-node/regex.js -var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; - -// node_modules/uuid/dist-node/validate.js -function validate(uuid) { - return typeof uuid === "string" && regex_default.test(uuid); -} -var validate_default = validate; - -// node_modules/uuid/dist-node/stringify.js -var byteToHex = []; -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).slice(1)); -} -function unsafeStringify(arr, offset = 0) { - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); -} - -// node_modules/uuid/dist-node/rng.js -var rnds8 = new Uint8Array(16); -function rng() { - return crypto.getRandomValues(rnds8); -} - -// node_modules/uuid/dist-node/v4.js -function v4(options, buf, offset) { - if (!buf && !options && crypto.randomUUID) { - return crypto.randomUUID(); - } - return _v4(options, buf, offset); -} -function _v4(options, buf, offset) { - options = options || {}; - const rnds = options.random ?? options.rng?.() ?? rng(); - if (rnds.length < 16) { - throw new Error("Random bytes length must be >= 16"); - } - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - if (offset < 0 || offset + 16 > buf.length) { - throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); - } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return unsafeStringify(rnds); -} -var v4_default = v4; - -// src/api-client.ts -var core5 = __toESM(require_core()); -var githubUtils = __toESM(require_utils4()); - -// node_modules/@octokit/plugin-retry/dist-bundle/index.js -var import_light = __toESM(require_light(), 1); -init_dist_src(); -var VERSION7 = "0.0.0-development"; -function isRequestError(error3) { - return error3.request !== void 0; -} -async function errorRequest(state, octokit, error3, options) { - if (!isRequestError(error3) || !error3?.request.request) { - throw error3; - } - if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { - const retries = options.request.retries != null ? options.request.retries : state.retries; - const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2); - throw octokit.retry.retryRequest(error3, retries, retryAfter); - } - throw error3; -} -async function wrapRequest(state, octokit, request3, options) { - const limiter = new import_light.default(); - limiter.on("failed", function(error3, info8) { - const maxRetries = ~~error3.request.request?.retries; - const after = ~~error3.request.request?.retryAfter; - options.request.retryCount = info8.retryCount + 1; - if (maxRetries > info8.retryCount) { - return after * state.retryAfterBaseValue; - } - }); - return limiter.schedule( - requestWithGraphqlErrorHandling.bind(null, state, octokit, request3), - options - ); -} -async function requestWithGraphqlErrorHandling(state, octokit, request3, options) { - const response = await request3(options); - if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( - response.data.errors[0].message - )) { - const error3 = new RequestError(response.data.errors[0].message, 500, { - request: options, - response - }); - return errorRequest(state, octokit, error3, options); - } - return response; -} -function retry(octokit, octokitOptions) { - const state = Object.assign( - { - enabled: true, - retryAfterBaseValue: 1e3, - doNotRetry: [400, 401, 403, 404, 410, 422, 451], - retries: 3 - }, - octokitOptions.retry - ); - const retryPlugin = { - retry: { - retryRequest: (error3, retries, retryAfter) => { - error3.request.request = Object.assign({}, error3.request.request, { - retries, - retryAfter - }); - return error3; - } - } - }; - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); - } - return retryPlugin; -} -retry.VERSION = VERSION7; - -// src/api-client.ts -var import_undici = __toESM(require_undici()); - -// src/repository.ts -function getRepositoryNwo() { - return getRepositoryNwoFromEnv("GITHUB_REPOSITORY"); -} -function getRepositoryNwoFromEnv(...envVarNames) { - const envVarName = envVarNames.find((name) => process.env[name]); - if (!envVarName) { - throw new ConfigurationError( - `None of the env vars ${envVarNames.join(", ")} are set` - ); - } - return parseRepositoryNwo(getRequiredEnvParam(envVarName)); -} -function parseRepositoryNwo(input) { - const parts = input.split("/"); - if (parts.length !== 2) { - throw new ConfigurationError(`"${input}" is not a valid repository name`); - } - return { - owner: parts[0], - repo: parts[1] - }; -} - -// src/api-client.ts -var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; -var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; -function getRegistryProxyConfig(action) { - return { - host: action.env.getOptional("CODEQL_PROXY_HOST" /* PROXY_HOST */), - port: action.env.getOptional("CODEQL_PROXY_PORT" /* PROXY_PORT */), - ca: action.env.getOptional("CODEQL_PROXY_CA_CERTIFICATE" /* PROXY_CA_CERTIFICATE */) - }; -} -function getRegistryProxy(action) { - const { host, port, ca } = getRegistryProxyConfig(action); - if (host && port) { - const uri = `http://${host}:${port}`; - action.logger.debug( - `Using private registry proxy at '${uri}' for API client.` - ); - return new import_undici.ProxyAgent({ - uri, - keepAliveTimeout: 10, - keepAliveMaxTimeout: 10, - requestTls: ca ? { ca } : void 0 - }); - } - return void 0; -} -function makeProxyRequestOptions(dispatcher) { - if (dispatcher === void 0) { - return githubUtils.defaults.request; - } - return { - ...githubUtils.defaults.request, - fetch: (req, init2) => { - return (0, import_undici.fetch)(req, { ...init2, dispatcher }); - } - }; -} -function createApiClientWithDetails(apiDetails, { allowExternal = false, proxy = void 0 } = {}) { - const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; - const retryingOctokit = githubUtils.GitHub.plugin(retry); - const requestOptions = makeProxyRequestOptions(proxy); - return new retryingOctokit( - githubUtils.getOctokitOptions(auth2, { - baseUrl: apiDetails.apiURL, - userAgent: `CodeQL-Action/${getActionVersion()}`, - log: { - debug: core5.debug, - info: core5.info, - warn: core5.warning, - error: core5.error - }, - request: requestOptions, - retry: { - doNotRetry: DO_NOT_RETRY_STATUSES - } - }) - ); -} -function getApiDetails(env = getEnv()) { - return { - auth: getRequiredInput("token"), - url: env.getRequired("GITHUB_SERVER_URL" /* GITHUB_SERVER_URL */), - apiURL: env.getRequired("GITHUB_API_URL" /* GITHUB_API_URL */) - }; -} -function getApiClient(env = getEnv()) { - return createApiClientWithDetails(getApiDetails(env)); -} -function getApiClientWithExternalAuth(apiDetails, proxy) { - return createApiClientWithDetails(apiDetails, { allowExternal: true, proxy }); -} -function getAuthorizationHeaderFor(logger, apiDetails, url2) { - if (url2.startsWith(`${apiDetails.url}/`) || apiDetails.apiURL && url2.startsWith(`${apiDetails.apiURL}/`)) { - logger.debug(`Providing an authorization token.`); - return `token ${apiDetails.auth}`; - } - logger.debug(`Not using an authorization token.`); - return void 0; -} -var cachedGitHubVersion = void 0; -async function getGitHubVersionFromApi(apiClient, apiDetails) { - if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: "GitHub.com" /* DOTCOM */ }; - } - const response = await apiClient.rest.meta.get(); - if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: "GitHub.com" /* DOTCOM */ }; - } - if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; - } - const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: "GitHub Enterprise Server" /* GHES */, version }; -} -async function getGitHubVersion() { - if (cachedGitHubVersion === void 0) { - cachedGitHubVersion = await getGitHubVersionFromApi( - getApiClient(), - getApiDetails() - ); - } - return cachedGitHubVersion; -} -async function getWorkflowRelativePath() { - const repo_nwo = getRepositoryNwo(); - const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID")); - const apiClient = getApiClient(); - const runsResponse = await apiClient.request( - "GET /repos/:owner/:repo/actions/runs/:run_id?exclude_pull_requests=true", - { - owner: repo_nwo.owner, - repo: repo_nwo.repo, - run_id - } - ); - const workflowUrl = runsResponse.data.workflow_url; - const requiredWorkflowRegex = /\/repos\/[^/]+\/[^/]+\/actions\/required_workflows\/[^/]+/; - if (!workflowUrl || requiredWorkflowRegex.test(workflowUrl)) { - return runsResponse.data.path; - } - const workflowResponse = await apiClient.request(`GET ${workflowUrl}`); - return workflowResponse.data.path; -} -async function getAnalysisKey() { - let analysisKey = process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]; - if (analysisKey !== void 0) { - return analysisKey; - } - const workflowPath = await getWorkflowRelativePath(); - const jobName = getRequiredEnvParam("GITHUB_JOB"); - analysisKey = `${workflowPath}:${jobName}`; - core5.exportVariable("CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */, analysisKey); - return analysisKey; -} -async function getAutomationID() { - const analysis_key = await getAnalysisKey(); - const environment = getRequiredInput("matrix"); - return computeAutomationID(analysis_key, environment); -} -function computeAutomationID(analysis_key, environment) { - let automationID = `${analysis_key}/`; - const matrix = parseMatrixInput(environment); - if (matrix !== void 0) { - for (const entry of Object.entries(matrix).sort()) { - if (typeof entry[1] === "string") { - automationID += `${entry[0]}:${entry[1]}/`; - } else { - automationID += `${entry[0]}:/`; - } - } - } - return automationID; -} -async function listActionsCaches(keyPrefix, ref) { - const repositoryNwo = getRepositoryNwo(); - return await getApiClient().paginate( - "GET /repos/{owner}/{repo}/actions/caches", - { - owner: repositoryNwo.owner, - repo: repositoryNwo.repo, - key: keyPrefix, - ref - } - ); -} -async function deleteActionsCache(id) { - const repositoryNwo = getRepositoryNwo(); - await getApiClient().rest.actions.deleteActionsCacheById({ - owner: repositoryNwo.owner, - repo: repositoryNwo.repo, - cache_id: id - }); -} -async function getRepositoryProperties(repositoryNwo) { - return getApiClient().request("GET /repos/:owner/:repo/properties/values", { - owner: repositoryNwo.owner, - repo: repositoryNwo.repo - }); -} -function isEnablementError(msg) { - return [ - /Code Security must be enabled/i, - /Advanced Security must be enabled/i, - /Code Scanning is not enabled/i, - /Code Quality is not enabled/i - ].some((pattern) => pattern.test(msg)); -} -function getFeatureEnablementError(message) { - return `Please verify that the necessary features are enabled: ${message}`; -} -function wrapApiConfigurationError(e) { - const httpError = asHTTPError(e); - if (httpError !== void 0) { - if ([ - /API rate limit exceeded/, - /commit not found/, - /Resource not accessible by integration/, - /ref .* not found in this repository/ - ].some((pattern) => pattern.test(httpError.message))) { - return new ConfigurationError(httpError.message); - } - if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found") || httpError.message.includes("Requires authentication")) { - return new ConfigurationError( - "Please check that your token is valid and has the required permissions: contents: read, security-events: write" - ); - } - if (httpError.status === 403 && isEnablementError(httpError.message)) { - return new ConfigurationError( - getFeatureEnablementError(httpError.message) - ); - } - if (httpError.status === 429) { - return new ConfigurationError("API rate limit exceeded"); - } - } - return e; -} - -// src/cli/output-cache.ts -var fs3 = __toESM(require("fs")); -var import_path = __toESM(require("path")); -var COMMAND_CACHE_FILENAME = "codeql-action-command-cache.json"; -var cachedCodeQlVersion = void 0; -function getCommandCacheFilePath(env) { - return import_path.default.join(getTemporaryDirectory(env), COMMAND_CACHE_FILENAME); -} -function cacheCodeQlVersion(env, cmd, version) { - if (cachedCodeQlVersion !== void 0) { - throw new Error("cacheCodeQlVersion() should be called only once"); - } - cachedCodeQlVersion = version; - const outputCache = { - cmd, - entries: { version } - }; - fs3.writeFileSync( - getCommandCacheFilePath(env), - JSON.stringify(outputCache), - "utf8" - ); -} -function getCachedCodeQlVersion(logger, env, cmd) { - if (cachedCodeQlVersion !== void 0) { - return cachedCodeQlVersion; - } - let serialized; - try { - serialized = fs3.readFileSync(getCommandCacheFilePath(env), "utf8"); - } catch (e) { - logger.debug( - `Cannot read CLI-cache file ${getCommandCacheFilePath(env)}: ${e}` - ); - return void 0; - } - let persisted; - try { - persisted = JSON.parse(serialized); - } catch (e) { - logger.debug(`Cannot parse CLI-cache data as JSON: ${e}`); - return void 0; - } - if (!isOutputCache(persisted) || cmd !== void 0 && persisted.cmd !== cmd) { - return void 0; - } - cachedCodeQlVersion = persisted.entries.version; - return cachedCodeQlVersion; -} -function isVersionInfo(x) { - const candidate = x; - return typeof candidate === "object" && candidate !== null && typeof candidate.version === "string" && (candidate.features === void 0 || typeof candidate.features === "object" && candidate.features !== null) && (candidate.overlayVersion === void 0 || typeof candidate.overlayVersion === "number"); -} -function isOutputCache(x) { - const candidate = x; - return typeof candidate === "object" && candidate !== null && typeof candidate.cmd === "string" && candidate.entries !== void 0 && isVersionInfo(candidate.entries.version); -} - -// src/config/pack-registries.ts -function parseRegistries(registriesInput) { - try { - return registriesInput ? load(registriesInput) : void 0; - } catch { - throw new ConfigurationError( - "Invalid registries input. Must be a YAML string." - ); - } -} -function parseRegistriesWithoutCredentials(registriesInput) { - return parseRegistries(registriesInput)?.map((r) => { - const { url: url2, packages, kind } = r; - return { url: url2, packages, kind }; - }); -} - -// src/git-utils.ts -var fs4 = __toESM(require("fs")); -var os2 = __toESM(require("os")); -var path4 = __toESM(require("path")); -var core6 = __toESM(require_core()); -var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io()); -var semver2 = __toESM(require_semver2()); -var GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES = "2.36.0"; -var GitVersionInfo = class { - constructor(truncatedVersion, fullVersion) { - this.truncatedVersion = truncatedVersion; - this.fullVersion = fullVersion; - } - truncatedVersion; - fullVersion; - isAtLeast(minVersion) { - return semver2.gte(this.truncatedVersion, minVersion); - } -}; -async function getGitVersionOrThrow() { - const stdout = await runGitCommand( - void 0, - ["--version"], - "Failed to get git version." - ); - const match2 = stdout.trim().match(/^git version ((\d+\.\d+\.\d+).*)$/); - if (match2?.[1] && match2?.[2]) { - return new GitVersionInfo(match2[2], match2[1]); - } - throw new Error(`Could not parse Git version from output: ${stdout.trim()}`); -} -var runGitCommand = async function(workingDirectory, args, customErrorMessage, options) { - let stdout = ""; - let stderr = ""; - core6.debug(`Running git command: git ${args.join(" ")}`); - try { - await new toolrunner2.ToolRunner(await io3.which("git", true), args, { - silent: true, - listeners: { - stdout: (data) => { - stdout += data.toString(); - }, - stderr: (data) => { - stderr += data.toString(); - } - }, - cwd: workingDirectory, - ...options - }).exec(); - return stdout; - } catch (error3) { - let reason = stderr; - if (stderr.includes("not a git repository")) { - reason = "The checkout path provided to the action does not appear to be a git repository."; - } - core6.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error3; - } -}; -var getCommitOid = async function(checkoutPath, ref = "HEAD") { - try { - const stdout = await runGitCommand( - checkoutPath, - ["rev-parse", ref], - "Continuing with commit SHA from user input or environment." - ); - return stdout.trim(); - } catch { - return getOptionalInput("sha") || getRequiredEnvParam("GITHUB_SHA"); - } -}; -var determineBaseBranchHeadCommitOid = async function(checkoutPathOverride) { - if (getWorkflowEventName() !== "pull_request") { - return void 0; - } - const mergeSha = getRequiredEnvParam("GITHUB_SHA"); - const checkoutPath = checkoutPathOverride ?? getOptionalInput("checkout_path"); - try { - let commitOid = ""; - let baseOid = ""; - let headOid = ""; - const stdout = await runGitCommand( - checkoutPath, - ["show", "-s", "--format=raw", mergeSha], - "Will calculate the base branch SHA on the server." - ); - for (const data of stdout.split("\n")) { - if (data.startsWith("commit ") && commitOid === "") { - commitOid = data.substring(7); - } else if (data.startsWith("parent ")) { - if (baseOid === "") { - baseOid = data.substring(7); - } else if (headOid === "") { - headOid = data.substring(7); - } - } - } - if (commitOid === mergeSha && (headOid.length === 40 || headOid.length === 64) && (baseOid.length === 40 || baseOid.length === 64)) { - return baseOid; - } - return void 0; - } catch { - return void 0; - } -}; -var decodeGitFilePath = function(filePath) { - if (filePath.startsWith('"') && filePath.endsWith('"')) { - filePath = filePath.substring(1, filePath.length - 1); - return filePath.replace( - /\\([abfnrtv\\"]|[0-7]{1,3})/g, - (_match, seq) => { - switch (seq[0]) { - case "a": - return "\x07"; - case "b": - return "\b"; - case "f": - return "\f"; - case "n": - return "\n"; - case "r": - return "\r"; - case "t": - return " "; - case "v": - return "\v"; - case "\\": - return "\\"; - case '"': - return '"'; - default: - return String.fromCharCode(parseInt(seq, 8)); - } - } - ); - } - return filePath; -}; -var getGitRoot = async function(sourceRoot) { - try { - const stdout = await runGitCommand( - sourceRoot, - ["rev-parse", "--show-toplevel"], - `Cannot find Git repository root from the source root ${sourceRoot}.` - ); - return stdout.trim(); - } catch { - return void 0; - } -}; -function hasSubmodules(gitRoot) { - return fs4.existsSync(path4.join(gitRoot, ".gitmodules")); -} -var getFileOidsUnderPath = async function(basePath) { - const gitRoot = await getGitRoot(basePath); - const mayHaveSubmodules = gitRoot === void 0 ? true : hasSubmodules(gitRoot); - const args = mayHaveSubmodules ? ["ls-files", "--recurse-submodules", "--stage"] : ["ls-files", "--stage"]; - const stdout = await runGitCommand( - basePath, - args, - "Cannot list Git OIDs of tracked files." - ); - const fileOidMap = {}; - const regex = /^[0-9]+ ([0-9a-f]{40}|[0-9a-f]{64}) [0-9]+\t(.+)$/; - for (const line of stdout.split("\n")) { - if (line) { - const match2 = line.match(regex); - if (match2) { - const oid = match2[1]; - const filePath = decodeGitFilePath(match2[2]); - fileOidMap[filePath] = oid; - } else { - throw new Error(`Unexpected "git ls-files" output: ${line}`); - } - } - } - return fileOidMap; -}; -function getRefFromEnv() { - let refEnv; - try { - refEnv = getRequiredEnvParam("GITHUB_REF"); - } catch (e) { - const maybeRef = process.env["CODE_SCANNING_REF"]; - if (maybeRef === void 0 || maybeRef.length === 0) { - throw e; - } - refEnv = maybeRef; - } - return refEnv; -} -async function getRef() { - const refInput = getOptionalInput("ref"); - const shaInput = getOptionalInput("sha"); - const checkoutPath = getOptionalInput("checkout_path") || getOptionalInput("source-root") || getRequiredEnvParam("GITHUB_WORKSPACE"); - const hasRefInput = !!refInput; - const hasShaInput = !!shaInput; - if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) { - throw new ConfigurationError( - "Both 'ref' and 'sha' are required if one of them is provided." - ); - } - const ref = refInput || getRefFromEnv(); - const sha = shaInput || getRequiredEnvParam("GITHUB_SHA"); - if (refInput) { - return refInput; - } - const pull_ref_regex = /refs\/pull\/(\d+)\/merge/; - if (!pull_ref_regex.test(ref)) { - return ref; - } - const head = await getCommitOid(checkoutPath, "HEAD"); - const hasChangedRef = sha !== head && await getCommitOid( - checkoutPath, - ref.replace(/^refs\/pull\//, "refs/remotes/pull/") - ) !== head; - if (hasChangedRef) { - const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core6.debug( - `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` - ); - return newRef; - } else { - return ref; - } -} -function removeRefsHeadsPrefix(ref) { - return ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref; -} -async function isAnalyzingDefaultBranch() { - if (process.env.CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH === "true") { - return true; - } - let currentRef = await getRef(); - currentRef = removeRefsHeadsPrefix(currentRef); - const event = getWorkflowEvent(); - let defaultBranch = event?.repository?.default_branch; - if (getWorkflowEventName() === "schedule") { - defaultBranch = removeRefsHeadsPrefix(getRefFromEnv()); - } - return currentRef === defaultBranch; -} -async function listFiles(workingDirectory) { - const stdout = await runGitCommand( - workingDirectory, - ["ls-files"], - "Unable to list tracked files." - ); - return stdout.split(os2.EOL).filter((line) => line.trim().length > 0); -} -async function getGeneratedFiles(workingDirectory) { - const files = await listFiles(workingDirectory); - const stdout = await runGitCommand( - workingDirectory, - ["check-attr", "linguist-generated", "--stdin"], - "Unable to check attributes of files.", - { input: Buffer.from(files.join(os2.EOL)) } - ); - const generatedFiles = []; - const regex = /^([^:]+): linguist-generated: true$/; - for (const result of stdout.split(os2.EOL)) { - const match2 = result.match(regex); - if (match2 && match2[1].trim().length > 0) { - generatedFiles.push(match2[1].trim()); - } - } - return generatedFiles; -} - -// src/start-proxy/types.ts -var usernameSchema = { - /** The username needed to authenticate to the package registry, if any. */ - username: optionalOrNull(string) -}; -function hasUsername(config) { - return "username" in config; -} -var usernamePasswordSchema = { - /** The password needed to authenticate to the package registry, if any. */ - password: optionalOrNull(string), - ...usernameSchema -}; -function hasUsernameAndPassword(config) { - return hasUsername(config) && "password" in config; -} -var tokenSchema = { - /** The token needed to authenticate to the package registry, if any. */ - token: optionalOrNull(string), - ...usernameSchema -}; -function hasToken(config) { - return "token" in config; -} -function isToken(config) { - return "token" in config && validateSchema(tokenSchema, config); -} -var azureConfigSchema = { - "tenant-id": string, - "client-id": string -}; -function isAzureConfig(config) { - return validateSchema(azureConfigSchema, config); -} -var awsConfigSchema = { - "aws-region": string, - "account-id": string, - "role-name": string, - domain: string, - "domain-owner": string, - audience: optionalOrNull(string) -}; -function isAWSConfig(config) { - return validateSchema(awsConfigSchema, config); -} -var jfrogConfigSchema = { - "jfrog-oidc-provider-name": string, - audience: optionalOrNull(string), - "identity-mapping-name": optionalOrNull(string) -}; -function isJFrogConfig(config) { - return validateSchema(jfrogConfigSchema, config); -} -var cloudsmithConfigSchema = { - namespace: string, - "service-slug": string, - "api-host": string -}; -function isCloudsmithConfig(config) { - return validateSchema(cloudsmithConfigSchema, config); -} -var gcpConfigSchema = { - "workload-identity-provider": string, - "service-account": optionalOrNull(string), - audience: optionalOrNull(string) -}; -function isGCPConfig(config) { - return validateSchema(gcpConfigSchema, config); -} -var oidcSchemas = [ - { schema: azureConfigSchema, name: "Azure" }, - { schema: awsConfigSchema, name: "AWS" }, - { schema: jfrogConfigSchema, name: "JFrog" }, - { schema: cloudsmithConfigSchema, name: "Cloudsmith" }, - { schema: gcpConfigSchema, name: "GCP" } -]; -function credentialToStr(credential) { - let result = `Type: ${credential.type};`; - const appendIfDefined = (name, val) => { - if (isDefined2(val)) { - result += ` ${name}: ${val};`; - } - }; - appendIfDefined("Url", credential.url); - appendIfDefined("Host", credential.host); - if (hasUsername(credential)) { - appendIfDefined("Username", credential.username); - } - if ("password" in credential) { - appendIfDefined( - "Password", - isDefined2(credential.password) ? "***" : void 0 - ); - } - if (hasToken(credential)) { - appendIfDefined("Token", isDefined2(credential.token) ? "***" : void 0); - } - if (isAzureConfig(credential)) { - appendIfDefined("Tenant", credential["tenant-id"]); - appendIfDefined("Client", credential["client-id"]); - } else if (isAWSConfig(credential)) { - appendIfDefined("AWS Region", credential["aws-region"]); - appendIfDefined("AWS Account", credential["account-id"]); - appendIfDefined("AWS Role", credential["role-name"]); - appendIfDefined("AWS Domain", credential.domain); - appendIfDefined("AWS Domain Owner", credential["domain-owner"]); - appendIfDefined("AWS Audience", credential.audience); - } else if (isJFrogConfig(credential)) { - appendIfDefined("JFrog Provider", credential["jfrog-oidc-provider-name"]); - appendIfDefined( - "JFrog Identity Mapping", - credential["identity-mapping-name"] - ); - appendIfDefined("JFrog Audience", credential.audience); - } else if (isCloudsmithConfig(credential)) { - appendIfDefined("Cloudsmith Namespace", credential.namespace); - appendIfDefined("Cloudsmith Service Slug", credential["service-slug"]); - appendIfDefined("Cloudsmith API Host", credential["api-host"]); - } else if (isGCPConfig(credential)) { - appendIfDefined( - "GCP Workload Identity Provider", - credential["workload-identity-provider"] - ); - appendIfDefined("GCP Service Account", credential["service-account"]); - appendIfDefined("GCP Audience", credential.audience); - } - return result; -} -var registryBaseSchema = { - /** The type of the package registry. */ - type: string, - /** Whether the registry replaces the base registry for the ecosystem. */ - "replaces-base": optional(boolean) -}; -function getAddressString(address) { - if (address.url === void 0) { - return address.host; - } else { - return address.url; - } -} - -// src/status-report.ts -function getDisplayActionName(actionName) { - if (actionName === "finish" /* Analyze */) { - return "analyze"; - } - return actionName; -} -function getJobUUID(action) { - const existingJobRunUuid = action.env.getOptional("CODEQL_ACTION_JOB_RUN_UUID" /* JOB_RUN_UUID */); - if (existingJobRunUuid !== void 0 && validate_default(existingJobRunUuid)) { - action.logger.info(`Existing job run UUID is ${existingJobRunUuid}.`); - return existingJobRunUuid; - } - const jobRunUuid = v4_default(); - action.logger.info(`Job run UUID is ${jobRunUuid}.`); - action.actions.exportVariable("CODEQL_ACTION_JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); - return jobRunUuid; -} -function isFirstPartyAnalysis(actionName) { - if (actionName !== "upload-sarif" /* UploadSarif */) { - return true; - } - return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; -} -function isThirdPartyAnalysis(actionName) { - return !isFirstPartyAnalysis(actionName); -} -var JobStatus = /* @__PURE__ */ ((JobStatus2) => { - JobStatus2["UnknownStatus"] = "JOB_STATUS_UNKNOWN"; - JobStatus2["SuccessStatus"] = "JOB_STATUS_SUCCESS"; - JobStatus2["FailureStatus"] = "JOB_STATUS_FAILURE"; - JobStatus2["ConfigErrorStatus"] = "JOB_STATUS_CONFIGURATION_ERROR"; - return JobStatus2; -})(JobStatus || {}); -function getActionsStatus(error3, otherFailureCause) { - if (error3 || otherFailureCause) { - return error3 instanceof ConfigurationError ? "user-error" : "failure"; - } else { - return "success"; - } -} -function getJobStatusDisplayName(status) { - switch (status) { - case "JOB_STATUS_SUCCESS" /* SuccessStatus */: - return "success"; - case "JOB_STATUS_FAILURE" /* FailureStatus */: - return "failure"; - case "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */: - return "configuration error"; - case "JOB_STATUS_UNKNOWN" /* UnknownStatus */: - return "unknown"; - default: - assertNever(status); - } -} -function setJobStatusIfUnsuccessful(actionStatus) { - if (actionStatus === "user-error") { - core7.exportVariable( - "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, - process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */ - ); - } else if (actionStatus === "failure" || actionStatus === "aborted") { - core7.exportVariable( - "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, - process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_FAILURE" /* FailureStatus */ - ); - } -} -function getRegistryTypesFromEnv(logger, env = getEnv()) { - const value = env.getOptional("CODEQL_PROXY_URLS" /* PROXY_URLS */); - if (value === void 0) { - return void 0; - } - try { - const data = JSON.parse(value); - if (!isArray(data)) { - logger.debug( - `Expected '${"CODEQL_PROXY_URLS" /* PROXY_URLS */}' to contain a JSON array, but got '${typeof data}'.` - ); - return void 0; - } - if (!validateArray(registryBaseSchema, data)) { - logger.debug( - `Expected '${"CODEQL_PROXY_URLS" /* PROXY_URLS */}' to contain a JSON array of registry objects, but got something else.` - ); - return void 0; - } - const types2 = new Set(data.map((r) => r.type)); - return Array.from(types2).sort().join(","); - } catch (err) { - logger.debug( - `Failed to parse '${"CODEQL_PROXY_URLS" /* PROXY_URLS */}': ${getErrorMessage(err)}.` - ); - return void 0; - } -} -async function createStatusReportBase(actionName, status, actionStartedAt, config, diskInfo, logger, cause, exception) { - try { - const commitOid = getOptionalInput("sha") || process.env["GITHUB_SHA"] || ""; - const ref = await getRef(); - const jobRunUUID = process.env["CODEQL_ACTION_JOB_RUN_UUID" /* JOB_RUN_UUID */] || ""; - const workflowRunID = getWorkflowRunID(); - const workflowRunAttempt = getWorkflowRunAttempt(); - const workflowName = process.env["GITHUB_WORKFLOW"] || ""; - const jobName = process.env["GITHUB_JOB"] || ""; - const analysis_key = await getAnalysisKey(); - let workflowStartedAt = process.env["CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */]; - if (workflowStartedAt === void 0) { - workflowStartedAt = actionStartedAt.toISOString(); - core7.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); - } - const runnerOs = getRequiredEnvParam("RUNNER_OS"); - const codeQlCliVersion = getCachedCodeQlVersion(logger, getEnv()); - const actionRef = process.env["GITHUB_ACTION_REF"] || ""; - const testingEnvironment = getTestingEnvironment(); - if (testingEnvironment) { - core7.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); - } - const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true"; - const statusReport = { - action_name: actionName, - action_oid: "unknown", - // TODO decide if it's possible to fill this in - action_ref: actionRef, - action_started_at: actionStartedAt.toISOString(), - action_version: getActionVersion(), - analysis_kinds: config?.analysisKinds?.join(","), - analysis_key, - build_mode: config?.buildMode, - commit_oid: commitOid, - computed_inputs: {}, - first_party_analysis: isFirstPartyAnalysis(actionName), - job_name: jobName, - job_run_uuid: jobRunUUID, - ref, - registry_types: getRegistryTypesFromEnv(logger), - runner_os: runnerOs, - started_at: workflowStartedAt, - status, - steady_state_default_setup: isSteadyStateDefaultSetupRun, - testing_environment: testingEnvironment || "", - workflow_name: workflowName, - workflow_run_attempt: workflowRunAttempt, - workflow_run_id: workflowRunID - }; - try { - statusReport.actions_event_name = getWorkflowEventName(); - } catch (e) { - logger.warning( - `Could not determine the workflow event name: ${getErrorMessage(e)}.` - ); - } - if (config) { - statusReport.languages = config.languages?.join(","); - } - if (diskInfo) { - statusReport.runner_available_disk_space_bytes = diskInfo.numAvailableBytes; - statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes; - } - if (cause) { - statusReport.cause = cause; - } - if (exception) { - statusReport.exception = exception; - } - if (status === "success" || status === "failure" || status === "aborted" || status === "user-error") { - statusReport.completed_at = (/* @__PURE__ */ new Date()).toISOString(); - } - const matrix = getRequiredInput("matrix"); - if (matrix) { - statusReport.matrix_vars = matrix; - } - if ("RUNNER_ARCH" in process.env) { - statusReport.runner_arch = process.env["RUNNER_ARCH"]; - } - if (!(runnerOs === "Linux" && isSelfHostedRunner())) { - statusReport.runner_os_release = os3.release(); - } - if (codeQlCliVersion !== void 0) { - statusReport.codeql_version = codeQlCliVersion.version; - } - const imageVersion = process.env["ImageVersion"]; - if (imageVersion) { - statusReport.runner_image_version = imageVersion; - } - return statusReport; - } catch (e) { - logger.warning( - `Failed to gather information for telemetry: ${getErrorMessage(e)}. Will skip sending status report.` - ); - if (isInTestMode()) { - throw e; - } - return void 0; - } -} -var OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of `codeql-action`."; -var INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the API endpoint. Please update to a compatible version of `codeql-action`."; -async function sendStatusReport(statusReport) { - setJobStatusIfUnsuccessful(statusReport.status); - const statusReportJSON = JSON.stringify(statusReport); - core7.debug(`Sending status report: ${statusReportJSON}`); - if (isInTestMode()) { - core7.debug("In test mode. Status reports are not uploaded."); - return; - } - const nwo = getRepositoryNwo(); - const client = getApiClient(); - try { - await client.request( - "PUT /repos/:owner/:repo/code-scanning/analysis/status", - { - owner: nwo.owner, - repo: nwo.repo, - data: statusReportJSON - } - ); - } catch (e) { - const httpError = asHTTPError(e); - if (httpError !== void 0) { - switch (httpError.status) { - case 403: - if (getWorkflowEventName() === "push" && process.env["GITHUB_ACTOR"] === "dependabot[bot]") { - core7.warning( - `Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading CodeQL results requires write access. To use CodeQL with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push" /* SCANNING_ON_PUSH */} for more information on how to configure these events.` - ); - } else { - core7.warning( - `This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}` - ); - } - return; - case 404: - core7.warning(httpError.message); - return; - case 422: - if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) { - core7.debug(INCOMPATIBLE_MSG); - } else { - core7.debug(OUT_OF_DATE_MSG); - } - return; - } - } - core7.warning( - `An unexpected error occurred when sending a status report: ${getErrorMessage( - e - )}` - ); - } -} -async function createInitWithConfigStatusReport(config, initStatusReport, configFile, totalCacheSize, overlayBaseDatabaseStats, dependencyCachingResults) { - const languages = config.languages.join(","); - const paths = (config.originalUserInput.paths || []).join(","); - const pathsIgnore = (config.originalUserInput["paths-ignore"] || []).join( - "," - ); - const disableDefaultQueries = config.originalUserInput["disable-default-queries"] ? languages : ""; - const queries = []; - let queriesInput = getOptionalInput("queries")?.trim(); - if (queriesInput === void 0 || queriesInput.startsWith("+")) { - queries.push( - ...(config.originalUserInput.queries || []).map((q) => q.uses) - ); - } - if (queriesInput !== void 0) { - queriesInput = queriesInput.startsWith("+") ? queriesInput.slice(1) : queriesInput; - queries.push(...queriesInput.split(",")); - } - let packs = {}; - if (Array.isArray(config.computedConfig.packs)) { - packs[config.languages[0]] = config.computedConfig.packs; - } else if (config.computedConfig.packs !== void 0) { - packs = config.computedConfig.packs; - } - return { - ...initStatusReport, - config_file: configFile ?? "", - disable_default_queries: disableDefaultQueries, - paths, - paths_ignore: pathsIgnore, - queries: queries.join(","), - packs: JSON.stringify(packs), - trap_cache_languages: Object.keys(config.trapCaches).join(","), - trap_cache_download_size_bytes: totalCacheSize, - trap_cache_download_duration_ms: Math.round(config.trapCacheDownloadTime), - overlay_base_database_download_size_bytes: overlayBaseDatabaseStats?.databaseSizeBytes, - overlay_base_database_download_duration_ms: overlayBaseDatabaseStats?.databaseDownloadDurationMs, - dependency_caching_restore_results: dependencyCachingResults, - query_filters: JSON.stringify( - config.originalUserInput["query-filters"] ?? [] - ), - registries: JSON.stringify( - parseRegistriesWithoutCredentials(getOptionalInput("registries")) ?? [] - ) - }; -} -async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error3, logger) { - try { - const statusReport = await createStatusReportBase( - actionName, - "failure", - actionStartedAt, - void 0, - void 0, - logger, - `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, - error3 instanceof Error ? error3.stack : void 0 - ); - if (statusReport !== void 0) { - await sendStatusReport(statusReport); - } - } catch (e) { - logger.warning( - `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` - ); - if (isInTestMode()) { - throw e; - } - } -} - -// src/action-common.ts -async function runInActions(action) { - const startedAt = /* @__PURE__ */ new Date(); - const logger = getActionsLogger(); - const env = getEnv(); - const actionsEnv = getActionsEnv(); - try { - const actionState = { - name: action.name, - startedAt, - logger, - env, - actions: actionsEnv - }; - getJobUUID(actionState); - await action.run(actionState); - } catch (error3) { - core8.setFailed( - `${getDisplayActionName(action.name)} action failed: ${getErrorMessage(error3)}` - ); - const statusReportError = action.transformTelemetryError !== void 0 ? action.transformTelemetryError(wrapError(error3)) : error3; - await sendUnhandledErrorStatusReport( - action.name, - startedAt, - statusReportError, - logger - ); - } -} - -// src/feature-flags.ts -var fs6 = __toESM(require("fs")); -var path6 = __toESM(require("path")); -var semver4 = __toESM(require_semver2()); - -// src/defaults.json -var bundleVersion = "codeql-bundle-v2.26.3"; -var cliVersion = "2.26.3"; - -// src/overlay/index.ts -var fs5 = __toESM(require("fs")); -var path5 = __toESM(require("path")); -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; -var CODEQL_OVERLAY_MINIMUM_VERSION_CPP = "2.25.0"; -var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; -var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; -var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; -var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; -var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; -var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; -async function writeBaseDatabaseOidsFile(config, sourceRoot) { - const gitFileOids = await getFileOidsUnderPath(sourceRoot); - const gitFileOidsJson = JSON.stringify(gitFileOids); - const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); - await fs5.promises.writeFile(baseDatabaseOidsFilePath, gitFileOidsJson); -} -async function readBaseDatabaseOidsFile(config, logger) { - const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); - try { - const contents = await fs5.promises.readFile( - baseDatabaseOidsFilePath, - "utf-8" - ); - return JSON.parse(contents); - } catch (e) { - logger.error( - `Failed to read overlay-base file OIDs from ${baseDatabaseOidsFilePath}: ${e.message || e}` - ); - throw e; - } -} -async function writeOverlayChangesFile(config, sourceRoot, logger) { - const baseFileOids = await readBaseDatabaseOidsFile(config, logger); - const overlayFileOids = await getFileOidsUnderPath(sourceRoot); - const oidChangedFiles = computeChangedFiles(baseFileOids, overlayFileOids); - logger.info( - `Found ${oidChangedFiles.length} changed file(s) under ${sourceRoot} from OID comparison.` - ); - const diffRangeFiles = await getDiffRangeFilePaths(sourceRoot, logger); - const changedFiles = [.../* @__PURE__ */ new Set([...oidChangedFiles, ...diffRangeFiles])]; - const changedFilesJson = JSON.stringify({ changes: changedFiles }); - const overlayChangesFile = path5.join( - getTemporaryDirectory(), - "overlay-changes.json" - ); - logger.debug( - `Writing overlay changed files to ${overlayChangesFile}: ${changedFilesJson}` - ); - await fs5.promises.writeFile(overlayChangesFile, changedFilesJson); - return overlayChangesFile; -} -function computeChangedFiles(baseFileOids, overlayFileOids) { - const changes = []; - for (const [file, oid] of Object.entries(overlayFileOids)) { - if (!(file in baseFileOids) || baseFileOids[file] !== oid) { - changes.push(file); - } - } - for (const file of Object.keys(baseFileOids)) { - if (!(file in overlayFileOids)) { - changes.push(file); - } - } - return changes; -} -async function getDiffRangeFilePaths(sourceRoot, logger) { - const jsonFilePath = getDiffRangesJsonFilePath(); - if (!fs5.existsSync(jsonFilePath)) { - logger.debug( - `No diff ranges JSON file found at ${jsonFilePath}; skipping.` - ); - return []; - } - let contents; - try { - contents = await fs5.promises.readFile(jsonFilePath, "utf8"); - } catch (e) { - logger.warning( - `Failed to read diff ranges JSON file at ${jsonFilePath}: ${e}` - ); - return []; - } - let diffRanges; - try { - diffRanges = JSON.parse(contents); - } catch (e) { - logger.warning( - `Failed to parse diff ranges JSON file at ${jsonFilePath}: ${e}` - ); - return []; - } - logger.debug( - `Read ${diffRanges.length} diff range(s) from ${jsonFilePath} for overlay changes.` - ); - const repoRoot = await getGitRoot(sourceRoot); - if (repoRoot === void 0) { - if (getOptionalInput("source-root")) { - throw new Error( - "Cannot determine git root to convert diff range paths relative to source-root. Failing to avoid omitting files from the analysis." - ); - } - logger.warning( - "Cannot determine git root; returning diff range paths as-is." - ); - return [...new Set(diffRanges.map((r) => r.path))]; - } - const relativePaths = diffRanges.map( - (r) => path5.relative(sourceRoot, path5.join(repoRoot, r.path)).replaceAll(path5.sep, "/") - ).filter((rel) => !rel.startsWith("..")); - return [...new Set(relativePaths)]; -} - -// src/tools-features.ts -var semver3 = __toESM(require_semver2()); -function isSupportedToolsFeature(versionInfo, feature) { - return !!versionInfo.features && versionInfo.features[feature]; -} -var SafeArtifactUploadVersion = "2.20.3"; -function isSafeArtifactUpload(codeQlVersion) { - return !codeQlVersion ? true : semver3.gte(codeQlVersion, SafeArtifactUploadVersion); -} - -// src/feature-flags.ts -var DEFAULT_VERSION_FEATURE_FLAG_PREFIX = "default_codeql_version_"; -var DEFAULT_VERSION_FEATURE_FLAG_SUFFIX = "_enabled"; -var CODEQL_VERSION_ZSTD_BUNDLE = "2.19.0"; -var LINKED_CODEQL_VERSION = { - cliVersion, - tagName: bundleVersion -}; -var featureConfig = { - ["allow_merge_config_files" /* AllowMergeConfigFiles */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ALLOW_MERGE_CONFIG_FILES", - minimumVersion: void 0 - }, - ["allow_multiple_analysis_kinds" /* AllowMultipleAnalysisKinds */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ALLOW_MULTIPLE_ANALYSIS_KINDS", - minimumVersion: void 0 - }, - ["cleanup_trap_caches" /* CleanupTrapCaches */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", - minimumVersion: void 0 - }, - ["config_file_repository_property" /* ConfigFileRepositoryProperty */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_CONFIG_FILE_REPOSITORY_PROPERTY", - minimumVersion: void 0 - }, - ["cpp_dependency_installation_enabled" /* CppDependencyInstallation */]: { - defaultValue: false, - envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES", - legacyApi: true, - minimumVersion: "2.15.0" - }, - ["csharp_cache_bmn" /* CsharpCacheBuildModeNone */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_CSHARP_CACHE_BMN", - minimumVersion: void 0 - }, - ["csharp_new_cache_key" /* CsharpNewCacheKey */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_CSHARP_NEW_CACHE_KEY", - minimumVersion: void 0 - }, - ["diff_informed_queries" /* DiffInformedQueries */]: { - defaultValue: true, - envVar: "CODEQL_ACTION_DIFF_INFORMED_QUERIES", - minimumVersion: "2.21.0" - }, - ["disable_csharp_buildless" /* DisableCsharpBuildless */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_DISABLE_CSHARP_BUILDLESS", - minimumVersion: void 0 - }, - ["disable_java_buildless_enabled" /* DisableJavaBuildlessEnabled */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_DISABLE_JAVA_BUILDLESS", - legacyApi: true, - minimumVersion: void 0 - }, - ["disable_kotlin_analysis_enabled" /* DisableKotlinAnalysisEnabled */]: { - defaultValue: false, - envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS", - legacyApi: true, - minimumVersion: void 0 - }, - ["export_diagnostics_enabled" /* ExportDiagnosticsEnabled */]: { - defaultValue: true, - envVar: "CODEQL_ACTION_EXPORT_DIAGNOSTICS", - legacyApi: true, - minimumVersion: void 0 - }, - ["force_jgit" /* ForceJGit */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_FORCE_JGIT", - minimumVersion: void 0 - }, - ["force_nightly" /* ForceNightly */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_FORCE_NIGHTLY", - minimumVersion: void 0 - }, - ["ignore_generated_files" /* IgnoreGeneratedFiles */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", - minimumVersion: void 0 - }, - ["java_network_debugging" /* JavaNetworkDebugging */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", - minimumVersion: void 0 - }, - ["overlay_analysis" /* OverlayAnalysis */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION - }, - // Per-language overlay feature flags. Each has minimumVersion set to the - // minimum CLI version that supports overlay analysis for that language. - // Only languages that are GA or in staff-ship should have feature flags here. - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CPP - }, - ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP - }, - ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO - }, - ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA - }, - ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT - }, - ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON - }, - ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CPP - }, - ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP - }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO - }, - ["overlay_analysis_java" /* OverlayAnalysisJava */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA - }, - ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT - }, - ["overlay_analysis_python" /* OverlayAnalysisPython */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON - }, - ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY - }, - // Other overlay-related feature flags - ["overlay_analysis_disable_trap_caching" /* OverlayAnalysisDisableTrapCaching */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_DISABLE_TRAP_CACHING", - minimumVersion: void 0 - }, - ["overlay_analysis_match_codeql_version" /* OverlayAnalysisMatchCodeqlVersion */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MATCH_CODEQL_VERSION", - minimumVersion: void 0 - }, - ["overlay_analysis_match_codeql_version_dry_run" /* OverlayAnalysisMatchCodeqlVersionDryRun */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MATCH_CODEQL_VERSION_DRY_RUN", - minimumVersion: void 0 - }, - ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", - minimumVersion: void 0 - }, - ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", - minimumVersion: void 0 - }, - ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", - minimumVersion: void 0 - }, - ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_QA_TELEMETRY", - legacyApi: true, - minimumVersion: void 0 - }, - ["proxy_api_requests" /* ProxyApiRequests */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_PROXY_API_REQUESTS", - minimumVersion: void 0 - }, - ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - minimumVersion: void 0, - toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ - }, - ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", - minimumVersion: void 0 - }, - ["tools_repository_property" /* ToolsRepositoryProperty */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_TOOLS_REPOSITORY_PROPERTY", - minimumVersion: void 0 - }, - ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", - minimumVersion: void 0, - toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ - }, - ["validate_db_config" /* ValidateDbConfig */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", - minimumVersion: void 0 - } -}; -var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; -var OfflineFeatures = class { - constructor(logger) { - this.logger = logger; - } - logger; - async getEnabledDefaultCliVersions(_variant) { - return { - enabledVersions: [LINKED_CODEQL_VERSION] - }; - } - /** - * Gets the `FeatureConfig` for `feature`. - */ - getFeatureConfig(feature) { - return featureConfig[feature]; - } - /** - * Determines whether `feature` is enabled without consulting the GitHub API. - * - * @param feature The feature to check. - * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the - * feature, the version of the CodeQL CLI will be checked against the minimum version. - * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, then - * this function will throw. - * @returns true if the feature is enabled, false otherwise. - * - * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. - */ - async getValue(feature, codeql) { - const offlineValue = await this.getOfflineValue(feature, codeql); - if (offlineValue !== void 0) { - return offlineValue; - } - return this.getDefaultValue(feature); - } - /** - * Determines whether `feature` is enabled using the CLI and environment variables. - */ - async getOfflineValue(feature, codeql) { - const config = this.getFeatureConfig(feature); - if (!codeql && config.minimumVersion) { - throw new Error( - `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` - ); - } - if (!codeql && config.toolsFeature) { - throw new Error( - `Internal error: A required tools feature is specified for feature ${feature}, but no instance of CodeQL was provided.` - ); - } - const envVar = (process.env[config.envVar] || "").toLocaleLowerCase(); - if (envVar === "false") { - this.logger.debug( - `Feature ${feature} is disabled via the environment variable ${config.envVar}.` - ); - return false; - } - const minimumVersion2 = config.minimumVersion; - if (codeql && minimumVersion2) { - if (!await codeQlVersionAtLeast(codeql, minimumVersion2)) { - this.logger.debug( - `Feature ${feature} is disabled because the CodeQL CLI version is older than the minimum version ${minimumVersion2}.` - ); - return false; - } else { - this.logger.debug( - `CodeQL CLI version ${(await codeql.getVersion()).version} is newer than the minimum version ${minimumVersion2} for feature ${feature}.` - ); - } - } - const toolsFeature = config.toolsFeature; - if (codeql && toolsFeature) { - if (!await codeql.supportsFeature(toolsFeature)) { - this.logger.debug( - `Feature ${feature} is disabled because the CodeQL CLI version does not support the required tools feature ${toolsFeature}.` - ); - return false; - } else { - this.logger.debug( - `CodeQL CLI version ${(await codeql.getVersion()).version} supports the required tools feature ${toolsFeature} for feature ${feature}.` - ); - } - } - if (envVar === "true") { - this.logger.debug( - `Feature ${feature} is enabled via the environment variable ${config.envVar}.` - ); - return true; - } - return void 0; - } - /** Gets the default value of `feature`. */ - async getDefaultValue(feature) { - const config = this.getFeatureConfig(feature); - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` - ); - return defaultValue; - } -}; -var Features = class extends OfflineFeatures { - gitHubFeatureFlags; - constructor(repositoryNwo, tempDir, logger) { - super(logger); - this.gitHubFeatureFlags = new GitHubFeatureFlags( - repositoryNwo, - path6.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger - ); - } - async getEnabledDefaultCliVersions(variant) { - if (supportsFeatureFlags(variant)) { - return await this.gitHubFeatureFlags.getEnabledDefaultCliVersionsFromFlags(); - } - return super.getEnabledDefaultCliVersions(variant); - } - /** - * - * @param feature The feature to check. - * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the - * feature, the version of the CodeQL CLI will be checked against the minimum version. - * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, then - * this function will throw. - * @returns true if the feature is enabled, false otherwise. - * - * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. - */ - async getValue(feature, codeql) { - const offlineValue = await this.getOfflineValue(feature, codeql); - if (offlineValue !== void 0) { - return offlineValue; - } - const apiValue = await this.gitHubFeatureFlags.getValue(feature); - if (apiValue !== void 0) { - this.logger.debug( - `Feature ${feature} is ${apiValue ? "enabled" : "disabled"} via the GitHub API.` - ); - return apiValue; - } - return this.getDefaultValue(feature); - } -}; -var GitHubFeatureFlags = class { - constructor(repositoryNwo, featureFlagsFile, logger) { - this.repositoryNwo = repositoryNwo; - this.featureFlagsFile = featureFlagsFile; - this.logger = logger; - this.hasAccessedRemoteFeatureFlags = false; - } - repositoryNwo; - featureFlagsFile; - logger; - cachedApiResponse; - // We cache whether the feature flags were accessed or not in order to accurately report whether flags were - // incorrectly configured vs. inaccessible in our telemetry. - hasAccessedRemoteFeatureFlags; - getCliVersionFromFeatureFlag(f) { - if (!f.startsWith(DEFAULT_VERSION_FEATURE_FLAG_PREFIX) || !f.endsWith(DEFAULT_VERSION_FEATURE_FLAG_SUFFIX)) { - return void 0; - } - const version = f.substring( - DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length, - f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length - ).replace(/_/g, "."); - if (!semver4.valid(version)) { - this.logger.warning( - `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.` - ); - return void 0; - } - return version; - } - /** - * Returns CLI versions enabled by `default_codeql_version_*_enabled` feature - * flags, sorted from highest to lowest. Falls back to the version pinned in - * `defaults.json` if no such flags are enabled. - */ - async getEnabledDefaultCliVersionsFromFlags() { - const response = await this.getAllFeatures(); - const sortedCliVersions = Object.entries(response).map( - ([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : void 0 - ).filter((f) => f !== void 0).sort(semver4.rcompare); - if (sortedCliVersions.length === 0) { - this.logger.warning( - `Feature flags do not specify a default CLI version. Falling back to the CLI version shipped with the Action. This is ${cliVersion}.` - ); - const result = { - enabledVersions: [LINKED_CODEQL_VERSION] - }; - if (this.hasAccessedRemoteFeatureFlags) { - result.toolsFeatureFlagsValid = false; - } - return result; - } - this.logger.debug( - `Derived default CLI version of ${sortedCliVersions[0]} from feature flags.` - ); - return { - enabledVersions: sortedCliVersions.map((cliVersion2) => ({ - cliVersion: cliVersion2, - tagName: `codeql-bundle-v${cliVersion2}` - })), - toolsFeatureFlagsValid: true - }; - } - async getValue(feature) { - const response = await this.getAllFeatures(); - if (response === void 0) { - this.logger.debug(`No feature flags API response for ${feature}.`); - return void 0; - } - const features = response[feature]; - if (features === void 0) { - this.logger.debug(`Feature '${feature}' undefined in API response.`); - return void 0; - } - return !!features; - } - async getAllFeatures() { - if (this.cachedApiResponse !== void 0) { - return this.cachedApiResponse; - } - const fileFlags = await this.readLocalFlags(); - if (fileFlags !== void 0) { - this.cachedApiResponse = fileFlags; - return fileFlags; - } - let remoteFlags = await this.loadApiResponse(); - if (remoteFlags === void 0) { - remoteFlags = {}; - } - this.cachedApiResponse = remoteFlags; - await this.writeLocalFlags(remoteFlags); - return remoteFlags; - } - async readLocalFlags() { - try { - if (fs6.existsSync(this.featureFlagsFile)) { - this.logger.debug( - `Loading feature flags from ${this.featureFlagsFile}` - ); - return JSON.parse( - fs6.readFileSync(this.featureFlagsFile, "utf8") - ); - } - } catch (e) { - this.logger.warning( - `Error reading cached feature flags file ${this.featureFlagsFile}: ${e}. Requesting from GitHub instead.` - ); - } - return void 0; - } - async writeLocalFlags(flags) { - try { - this.logger.debug(`Writing feature flags to ${this.featureFlagsFile}`); - fs6.writeFileSync(this.featureFlagsFile, JSON.stringify(flags)); - } catch (e) { - this.logger.warning( - `Error writing cached feature flags file ${this.featureFlagsFile}: ${e}.` - ); - } - } - async loadApiResponse() { - try { - const featuresToRequest = Object.entries(featureConfig).filter( - ([, config]) => !config.legacyApi - ).map(([f]) => f); - const FEATURES_PER_REQUEST = 25; - const featureChunks = []; - while (featuresToRequest.length > 0) { - featureChunks.push(featuresToRequest.splice(0, FEATURES_PER_REQUEST)); - } - let remoteFlags = {}; - for (const chunk of featureChunks) { - const response = await getApiClient().request( - "GET /repos/:owner/:repo/code-scanning/codeql-action/features", - { - owner: this.repositoryNwo.owner, - repo: this.repositoryNwo.repo, - features: chunk.join(",") - } - ); - const chunkFlags = response.data; - remoteFlags = { ...remoteFlags, ...chunkFlags }; - } - this.logger.debug( - "Loaded the following default values for the feature flags from the CodeQL Action API:" - ); - for (const [feature, value] of Object.entries(remoteFlags).sort( - ([nameA], [nameB]) => nameA.localeCompare(nameB) - )) { - this.logger.debug(` ${feature}: ${value}`); - } - this.hasAccessedRemoteFeatureFlags = true; - return remoteFlags; - } catch (e) { - const httpError = asHTTPError(e); - if (httpError?.status === 403) { - this.logger.warning( - `This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. As a result, it will not be opted into any experimental features. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}` - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } else { - throw new Error( - `Encountered an error while trying to determine feature enablement: ${e}` - ); - } - } - } -}; -function supportsFeatureFlags(githubVariant) { - return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; -} -function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { - if (!supportsFeatureFlags(gitHubVersion.type)) { - logger.debug( - "Not running against github.com. Using default values for all features." - ); - return new OfflineFeatures(logger); - } else { - return new Features(repositoryNwo, tempDir, logger); - } -} - -// src/analyses.ts -var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { - AnalysisKind2["CodeScanning"] = "code-scanning"; - AnalysisKind2["CodeQuality"] = "code-quality"; - AnalysisKind2["RiskAssessment"] = "risk-assessment"; - return AnalysisKind2; -})(AnalysisKind || {}); -var compatibilityMatrix = { - ["code-scanning" /* CodeScanning */]: /* @__PURE__ */ new Set(["code-quality" /* CodeQuality */]), - ["code-quality" /* CodeQuality */]: /* @__PURE__ */ new Set(["code-scanning" /* CodeScanning */]), - ["risk-assessment" /* RiskAssessment */]: /* @__PURE__ */ new Set() -}; -var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); -async function parseAnalysisKinds(input) { - const components = input.split(","); - if (components.length < 1) { - throw new ConfigurationError( - "At least one analysis kind must be configured." - ); - } - for (const component of components) { - if (!supportedAnalysisKinds.has(component)) { - throw new ConfigurationError(`Unknown analysis kind: ${component}`); - } - } - return Array.from( - new Set(components.map((component) => component)) - ); -} -var cachedAnalysisKinds; -function isOnlyCodeScanningEnabled(analysisKinds) { - return analysisKinds.length === 1 && analysisKinds[0] === "code-scanning" /* CodeScanning */; -} -function makeAnalysisKindUsageError(message) { - return `The \`analysis-kinds\` input is experimental and for GitHub-internal use only. Its behaviour may change at any time or be removed entirely. ${message}`; -} -async function getAnalysisKinds(logger, features, skipCache = false) { - if (!skipCache && cachedAnalysisKinds !== void 0) { - return cachedAnalysisKinds; - } - const analysisKinds = await parseAnalysisKinds( - getRequiredInput("analysis-kinds") - ); - if (!isInTestMode() && !isDynamicWorkflow() && !isOnlyCodeScanningEnabled(analysisKinds)) { - const codeQualityHint = analysisKinds.includes("code-quality" /* CodeQuality */) ? " If your intention is to use quality queries outside of Code Quality, use the `queries` input with `code-quality` instead." : ""; - logger.error( - makeAnalysisKindUsageError( - `An analysis kind other than \`code-scanning\` was specified in a custom workflow. This is not supported and will become a fatal error in a future version of the CodeQL Action.${codeQualityHint}` - ) - ); - } - const qualityQueriesInput = getOptionalInput("quality-queries"); - if (qualityQueriesInput !== void 0) { - logger.warning( - "The `quality-queries` input is deprecated and will be removed in a future version of the CodeQL Action. Use the `analysis-kinds` input to configure different analysis kinds instead." - ); - } - if (!analysisKinds.includes("code-quality" /* CodeQuality */) && qualityQueriesInput !== void 0) { - analysisKinds.push("code-quality" /* CodeQuality */); - } - for (const analysisKind of analysisKinds) { - for (const otherAnalysisKind of analysisKinds) { - if (analysisKind === otherAnalysisKind) continue; - if (!compatibilityMatrix[analysisKind].has(otherAnalysisKind)) { - throw new ConfigurationError( - `${analysisKind} and ${otherAnalysisKind} cannot be enabled at the same time` - ); - } - } - } - if (!isInTestMode() && analysisKinds.length > 1 && !await features.getValue("allow_multiple_analysis_kinds" /* AllowMultipleAnalysisKinds */)) { - logger.error( - makeAnalysisKindUsageError( - "Specifying multiple values as input is no longer supported. Continuing with only `analysis-kinds: code-scanning`." - ) - ); - cachedAnalysisKinds = ["code-scanning" /* CodeScanning */]; - return cachedAnalysisKinds; - } - cachedAnalysisKinds = analysisKinds; - return cachedAnalysisKinds; -} -var codeQualityQueries = ["code-quality"]; -var CodeScanning = { - kind: "code-scanning" /* CodeScanning */, - name: "code scanning", - target: "PUT /repos/:owner/:repo/code-scanning/analysis" /* CODE_SCANNING */, - sarifExtension: ".sarif", - sarifPredicate: (name) => name.endsWith(CodeScanning.sarifExtension) && !CodeQuality.sarifPredicate(name) && !RiskAssessment.sarifPredicate(name), - fixCategory: (_2, category) => category, - sentinelPrefix: "CODEQL_UPLOAD_SARIF_", - transformPayload: (payload) => payload -}; -var CodeQuality = { - kind: "code-quality" /* CodeQuality */, - name: "code quality", - target: "PUT /repos/:owner/:repo/code-quality/analysis" /* CODE_QUALITY */, - sarifExtension: ".quality.sarif", - sarifPredicate: (name) => name.endsWith(CodeQuality.sarifExtension), - fixCategory: fixCodeQualityCategory, - sentinelPrefix: "CODEQL_UPLOAD_QUALITY_SARIF_", - transformPayload: (payload) => payload -}; -function addAssessmentId(payload) { - const rawAssessmentId = getRequiredEnvParam("CODEQL_ACTION_RISK_ASSESSMENT_ID" /* RISK_ASSESSMENT_ID */); - const assessmentId = parseInt(rawAssessmentId, 10); - if (Number.isNaN(assessmentId)) { - throw new Error( - `${"CODEQL_ACTION_RISK_ASSESSMENT_ID" /* RISK_ASSESSMENT_ID */} must not be NaN: ${rawAssessmentId}` - ); - } - if (assessmentId < 0) { - throw new Error( - `${"CODEQL_ACTION_RISK_ASSESSMENT_ID" /* RISK_ASSESSMENT_ID */} must not be negative: ${rawAssessmentId}` - ); - } - return { sarif: payload.sarif, assessment_id: assessmentId }; -} -var RiskAssessment = { - kind: "risk-assessment" /* RiskAssessment */, - name: "code scanning risk assessment", - target: "PUT /repos/:owner/:repo/code-scanning/risk-assessment" /* RISK_ASSESSMENT */, - sarifExtension: ".csra.sarif", - sarifPredicate: (name) => name.endsWith(RiskAssessment.sarifExtension), - fixCategory: (_2, category) => category, - sentinelPrefix: "CODEQL_UPLOAD_CSRA_SARIF_", - transformPayload: addAssessmentId -}; -function getAnalysisConfig(kind) { - switch (kind) { - case "code-scanning" /* CodeScanning */: - return CodeScanning; - case "code-quality" /* CodeQuality */: - return CodeQuality; - case "risk-assessment" /* RiskAssessment */: - return RiskAssessment; - } -} -var SarifScanOrder = [ - RiskAssessment, - CodeQuality, - CodeScanning -]; - -// src/analyze.ts -var fs17 = __toESM(require("fs")); -var path16 = __toESM(require("path")); -var import_perf_hooks3 = require("perf_hooks"); -var io5 = __toESM(require_io()); - -// src/autobuild.ts -var core13 = __toESM(require_core()); - -// src/codeql.ts -var fs16 = __toESM(require("fs")); -var path15 = __toESM(require("path")); -var core12 = __toESM(require_core()); -var toolrunner3 = __toESM(require_toolrunner()); - -// src/cli-errors.ts -var SUPPORTED_PLATFORMS = [ - ["linux", "x64"], - ["win32", "x64"], - ["darwin", "x64"], - ["darwin", "arm64"] -]; -var CliError = class extends Error { - exitCode; - stderr; - constructor({ cmd, args, exitCode, stderr }) { - const prettyCommand = prettyPrintInvocation(cmd, args); - const fatalErrors = extractFatalErrors(stderr); - const autobuildErrors = extractAutobuildErrors(stderr); - let message; - if (fatalErrors) { - message = `Encountered a fatal error while running "${prettyCommand}". Exit code was ${exitCode} and error was: ${ensureEndsInPeriod( - fatalErrors.trim() - )} See the logs for more details.`; - } else if (autobuildErrors) { - message = `We were unable to automatically build your code. Please provide manual build steps. See ${"https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed" /* AUTOMATIC_BUILD_FAILED */} for more information. Encountered the following error: ${autobuildErrors}`; - } else { - const lastLine = ensureEndsInPeriod( - stderr.trim().split("\n").pop()?.trim() || "n/a" - ); - message = `Encountered a fatal error while running "${prettyCommand}". Exit code was ${exitCode} and last log line was: ${lastLine} See the logs for more details.`; - } - super(message); - this.exitCode = exitCode; - this.stderr = stderr; - } -}; -function extractFatalErrors(error3) { - const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; - let fatalErrors = []; - let lastFatalErrorIndex; - let match2; - while ((match2 = fatalErrorRegex.exec(error3)) !== null) { - if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error3.slice(lastFatalErrorIndex, match2.index).trim()); - } - lastFatalErrorIndex = match2.index; - } - if (lastFatalErrorIndex !== void 0) { - const lastError = error3.slice(lastFatalErrorIndex).trim(); - if (fatalErrors.length === 0) { - return lastError; - } - const isOneLiner = !fatalErrors.some((e) => e.includes("\n")); - if (isOneLiner) { - fatalErrors = fatalErrors.map(ensureEndsInPeriod); - } - return [ - ensureEndsInPeriod(lastError), - "Context:", - ...fatalErrors.reverse() - ].join(isOneLiner ? " " : "\n"); - } - return void 0; -} -function extractAutobuildErrors(error3) { - const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error3.matchAll(pattern)].map((match2) => match2[1]); - if (errorLines.length > 10) { - errorLines = errorLines.slice(0, 10); - errorLines.push("(truncated)"); - } - return errorLines.join("\n") || void 0; -} -var cliErrorsConfig = { - ["AutobuildError" /* AutobuildError */]: { - cliErrorMessageCandidates: [ - new RegExp("We were unable to automatically build your code") - ] - }, - ["CouldNotCreateTempDir" /* CouldNotCreateTempDir */]: { - cliErrorMessageCandidates: [new RegExp("Could not create temp directory")] - }, - ["ExternalRepositoryCloneFailed" /* ExternalRepositoryCloneFailed */]: { - cliErrorMessageCandidates: [ - new RegExp("Failed to clone external Git repository") - ] - }, - ["GradleBuildFailed" /* GradleBuildFailed */]: { - cliErrorMessageCandidates: [ - new RegExp("\\[autobuild\\] FAILURE: Build failed with an exception.") - ] - }, - // Version of CodeQL CLI is incompatible with this version of the CodeQL Action - ["IncompatibleWithActionVersion" /* IncompatibleWithActionVersion */]: { - cliErrorMessageCandidates: [ - new RegExp("is not compatible with this CodeQL CLI") - ] - }, - ["InitCalledTwice" /* InitCalledTwice */]: { - cliErrorMessageCandidates: [ - new RegExp( - "Refusing to create databases .* but could not process any of it" - ) - ], - additionalErrorMessageToAppend: `Is the "init" action called twice in the same job?` - }, - ["InvalidConfigFile" /* InvalidConfigFile */]: { - cliErrorMessageCandidates: [ - new RegExp("Config file .* is not valid"), - new RegExp("The supplied config file is empty") - ] - }, - ["InvalidExternalRepoSpecifier" /* InvalidExternalRepoSpecifier */]: { - cliErrorMessageCandidates: [ - new RegExp("Specifier for external repository is invalid") - ] - }, - // Expected source location for database creation does not exist - ["InvalidSourceRoot" /* InvalidSourceRoot */]: { - cliErrorMessageCandidates: [new RegExp("Invalid source root")] - }, - ["MavenBuildFailed" /* MavenBuildFailed */]: { - cliErrorMessageCandidates: [ - new RegExp("\\[autobuild\\] \\[ERROR\\] Failed to execute goal") - ] - }, - ["NoBuildCommandAutodetected" /* NoBuildCommandAutodetected */]: { - cliErrorMessageCandidates: [ - new RegExp("Could not auto-detect a suitable build method") - ] - }, - ["NoBuildMethodAutodetected" /* NoBuildMethodAutodetected */]: { - cliErrorMessageCandidates: [ - new RegExp( - "Could not detect a suitable build command for the source checkout" - ) - ] - }, - // Usually when a manual build script has failed, or if an autodetected language - // was unintended to have CodeQL analysis run on it. - ["NoSourceCodeSeen" /* NoSourceCodeSeen */]: { - exitCode: 32, - cliErrorMessageCandidates: [ - new RegExp( - "CodeQL detected code written in .* but could not process any of it" - ), - new RegExp( - "CodeQL did not detect any code written in languages supported by CodeQL" - ) - ] - }, - ["NoSupportedBuildCommandSucceeded" /* NoSupportedBuildCommandSucceeded */]: { - cliErrorMessageCandidates: [ - new RegExp("No supported build command succeeded") - ] - }, - ["NoSupportedBuildSystemDetected" /* NoSupportedBuildSystemDetected */]: { - cliErrorMessageCandidates: [ - new RegExp("No supported build system detected") - ] - }, - ["OutOfMemoryOrDisk" /* OutOfMemoryOrDisk */]: { - cliErrorMessageCandidates: [ - new RegExp("CodeQL is out of memory."), - new RegExp("out of disk"), - new RegExp("No space left on device") - ], - additionalErrorMessageToAppend: "For more information, see https://gh.io/troubleshooting-code-scanning/out-of-disk-or-memory" - }, - ["PackCannotBeFound" /* PackCannotBeFound */]: { - cliErrorMessageCandidates: [ - new RegExp( - "Query pack .* cannot be found\\. Check the spelling of the pack\\." - ), - new RegExp( - "is not a .ql file, .qls file, a directory, or a query pack specification." - ) - ] - }, - ["PackMissingAuth" /* PackMissingAuth */]: { - cliErrorMessageCandidates: [ - new RegExp("GitHub Container registry .* 403 Forbidden"), - new RegExp( - "Do you need to specify a token to authenticate to the registry?" - ) - ] - }, - ["SwiftBuildFailed" /* SwiftBuildFailed */]: { - cliErrorMessageCandidates: [ - new RegExp( - "\\[autobuilder/build\\] \\[build-command-failed\\] `autobuild` failed to run the build command" - ) - ] - }, - ["SwiftIncompatibleOs" /* SwiftIncompatibleOs */]: { - cliErrorMessageCandidates: [ - new RegExp("\\[incompatible-os\\]"), - new RegExp("Swift analysis is only supported on macOS") - ] - }, - ["UnsupportedBuildMode" /* UnsupportedBuildMode */]: { - cliErrorMessageCandidates: [ - new RegExp( - "does not support the .* build mode. Please try using one of the following build modes instead" - ) - ] - }, - ["NotFoundInRegistry" /* NotFoundInRegistry */]: { - cliErrorMessageCandidates: [ - new RegExp("'.*' not found in the registry '.*'") - ] - } -}; -function getCliConfigCategoryIfExists(cliError) { - for (const [category, configuration] of Object.entries(cliErrorsConfig)) { - if (cliError.exitCode !== void 0 && configuration.exitCode !== void 0 && cliError.exitCode === configuration.exitCode) { - return category; - } - for (const e of configuration.cliErrorMessageCandidates) { - if (cliError.message.match(e) || cliError.stderr.match(e)) { - return category; - } - } - } - return void 0; -} -function isUnsupportedPlatform() { - return !SUPPORTED_PLATFORMS.some( - ([platform2, arch2]) => platform2 === process.platform && arch2 === process.arch - ); -} -function getUnsupportedPlatformError(cliError) { - return new ConfigurationError( - `The CodeQL CLI does not support the platform/architecture combination of ${process.platform}/${process.arch} (see ${"https://codeql.github.com/docs/codeql-overview/system-requirements/" /* SYSTEM_REQUIREMENTS */}). The underlying error was: ${cliError.message}` - ); -} -function wrapCliConfigurationError(cliError) { - if (isUnsupportedPlatform()) { - return getUnsupportedPlatformError(cliError); - } - const cliConfigErrorCategory = getCliConfigCategoryIfExists(cliError); - if (cliConfigErrorCategory === void 0) { - return cliError; - } - let errorMessageBuilder = cliError.message; - const additionalErrorMessageToAppend = cliErrorsConfig[cliConfigErrorCategory].additionalErrorMessageToAppend; - if (additionalErrorMessageToAppend !== void 0) { - errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`; - } - return new ConfigurationError(errorMessageBuilder); -} - -// src/config-utils.ts -var fs10 = __toESM(require("fs")); -var path11 = __toESM(require("path")); -var import_perf_hooks = require("perf_hooks"); -var core10 = __toESM(require_core()); - -// src/caching-utils.ts -var crypto2 = __toESM(require("crypto")); -var core9 = __toESM(require_core()); -async function getTotalCacheSize(paths, logger, quiet = false) { - const sizes = await Promise.all( - paths.map((cacheDir2) => tryGetFolderBytes(cacheDir2, logger, quiet)) - ); - return sizes.map((a) => a || 0).reduce((a, b) => a + b, 0); -} -function shouldStoreCache(kind) { - return kind === "full" /* Full */ || kind === "store" /* Store */; -} -function shouldRestoreCache(kind) { - return kind === "full" /* Full */ || kind === "restore" /* Restore */; -} -function getCachingKind(input) { - switch (input) { - case void 0: - case "none": - case "off": - case "false": - return "none" /* None */; - case "full": - case "on": - case "true": - return "full" /* Full */; - case "store": - return "store" /* Store */; - case "restore": - return "restore" /* Restore */; - default: - core9.warning( - `Unrecognized 'dependency-caching' input: ${input}. Defaulting to 'none'.` - ); - return "none" /* None */; - } -} -var cacheKeyHashLength = 16; -function createCacheKeyHash(components) { - const componentsJson = JSON.stringify(components); - return crypto2.createHash("sha256").update(componentsJson).digest("hex").substring(0, cacheKeyHashLength); -} -function getDependencyCachingEnabled() { - const dependencyCaching = getOptionalInput("dependency-caching") || process.env["CODEQL_ACTION_DEPENDENCY_CACHING" /* DEPENDENCY_CACHING */]; - if (dependencyCaching !== void 0) return getCachingKind(dependencyCaching); - if (!isHostedRunner()) return "none" /* None */; - if (!isDefaultSetup()) return "none" /* None */; - return "none" /* None */; -} - -// src/config/db-config.ts -var path8 = __toESM(require("path")); -var jsonschema = __toESM(require_lib2()); -var semver5 = __toESM(require_semver2()); - -// src/diagnostics.ts -var import_fs = require("fs"); -var import_path2 = __toESM(require("path")); -var unwrittenDiagnostics = []; -var unwrittenDefaultLanguageDiagnostics = []; -var diagnosticCounter = 0; -function makeDiagnostic(id, name, data = void 0) { - return { - ...data, - timestamp: data?.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(), - source: { ...data?.source, id, name } - }; -} -function addDiagnostic(config, language, diagnostic) { - const logger = getActionsLogger(); - const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; - if ((0, import_fs.existsSync)(databasePath)) { - writeDiagnostic(config, language, diagnostic); - } else { - logger.debug( - `Writing a diagnostic for ${language}, but the database at ${databasePath} does not exist yet.` - ); - unwrittenDiagnostics.push({ diagnostic, language }); - } -} -function addNoLanguageDiagnostic(config, diagnostic) { - if (config !== void 0) { - addDiagnostic( - config, - // Arbitrarily choose the first language. We could also choose all languages, but that - // increases the risk of misinterpreting the data. - config.languages[0], - diagnostic - ); - } else { - unwrittenDefaultLanguageDiagnostics.push(diagnostic); - } -} -function writeDiagnostic(config, language, diagnostic) { - const logger = getActionsLogger(); - const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; - const diagnosticsPath = import_path2.default.resolve( - databasePath, - "diagnostic", - "codeql-action" - ); - try { - (0, import_fs.mkdirSync)(diagnosticsPath, { recursive: true }); - const uniqueSuffix = (diagnosticCounter++).toString(); - const sanitizedTimestamp = diagnostic.timestamp.replace( - /[^a-zA-Z0-9.-]/g, - "" - ); - const jsonPath = import_path2.default.resolve( - diagnosticsPath, - `codeql-action-${sanitizedTimestamp}-${uniqueSuffix}.json` - ); - (0, import_fs.writeFileSync)(jsonPath, JSON.stringify(diagnostic)); - } catch (err) { - logger.warning(`Unable to write diagnostic message to database: ${err}`); - logger.debug(JSON.stringify(diagnostic)); - } -} -function logUnwrittenDiagnostics() { - const logger = getActionsLogger(); - const num = unwrittenDiagnostics.length; - if (num > 0) { - logger.warning( - `${num} diagnostic(s) could not be written to the database and will not appear on the Tool Status Page.` - ); - for (const unwritten of unwrittenDiagnostics) { - logger.debug(JSON.stringify(unwritten.diagnostic)); - } - } -} -function flushDiagnostics(config) { - const logger = getActionsLogger(); - const diagnosticsCount = unwrittenDiagnostics.length + unwrittenDefaultLanguageDiagnostics.length; - logger.debug(`Writing ${diagnosticsCount} diagnostic(s) to database.`); - for (const unwritten of unwrittenDiagnostics) { - writeDiagnostic(config, unwritten.language, unwritten.diagnostic); - } - for (const unwritten of unwrittenDefaultLanguageDiagnostics) { - addNoLanguageDiagnostic(config, unwritten); - } - unwrittenDiagnostics = []; - unwrittenDefaultLanguageDiagnostics = []; -} -function makeTelemetryDiagnostic(id, name, attributes, tags) { - return makeDiagnostic(id, name, { - attributes, - visibility: { - cliSummaryTable: false, - statusPage: false, - telemetry: true - }, - source: { - tags - } - }); -} - -// src/error-messages.ts -var PACKS_PROPERTY = "packs"; -function getConfigFileOutsideWorkspaceErrorMessage(configFile) { - return `The configuration file "${configFile}" is outside of the workspace`; -} -function getConfigFileDoesNotExistErrorMessage(configFile) { - return `The configuration file "${configFile}" does not exist`; -} -function getConfigFileParseErrorMessage(configFile, message) { - return `Cannot parse "${configFile}": ${message}`; -} -function getInvalidConfigFileMessage(configFile, messages) { - const andMore = messages.length > 10 ? `, and ${messages.length - 10} more.` : "."; - return `The configuration file "${configFile}" is invalid: ${messages.slice(0, 10).join(", ")}${andMore}`; -} -function getConfigFileRepoFormatInvalidMessage(configFile) { - let error3 = `The configuration file "${configFile}" is not a supported remote file reference.`; - error3 += " Expected format [/][@][:]"; - return error3; -} -function getConfigFileFormatInvalidMessage(configFile) { - return `The configuration file "${configFile}" could not be read`; -} -function getConfigFileDirectoryGivenMessage(configFile) { - return `The configuration file "${configFile}" looks like a directory, not a file`; -} -function getEmptyCombinesError() { - return `A '+' was used to specify that you want to add extra arguments to the configuration, but no extra arguments were specified. Please either remove the '+' or specify some extra arguments.`; -} -function getConfigFilePropertyError(configFile, property, error3) { - if (configFile === void 0) { - return `The workflow property "${property}" is invalid: ${error3}`; - } else { - return `The configuration file "${configFile}" is invalid: property "${property}" ${error3}`; - } -} -function getRepoPropertyError(propertyName, error3) { - return `The repository property "${propertyName}" is invalid: ${error3}`; -} -function getPacksStrInvalid(packStr, configFile) { - return configFile ? getConfigFilePropertyError( - configFile, - PACKS_PROPERTY, - `"${packStr}" is not a valid pack` - ) : `"${packStr}" is not a valid pack`; -} -function getNoLanguagesError() { - return "Did not detect any languages to analyze. Please update input in workflow or check that GitHub detects the correct languages in your repository."; -} -function getUnknownLanguagesError(languages) { - return `Did not recognize the following languages: ${languages.join(", ")}`; -} - -// src/feature-flags/properties.ts -var github2 = __toESM(require_github()); -var GITHUB_CODEQL_PROPERTY_PREFIX = "github-codeql-"; -var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { - RepositoryPropertyName2["CONFIG_FILE"] = "github-codeql-config-file"; - RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; - RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; - RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; - RepositoryPropertyName2["TOOLS"] = "github-codeql-tools"; - return RepositoryPropertyName2; -})(RepositoryPropertyName || {}); -function isString2(value) { - return typeof value === "string"; -} -var stringProperty = { - validate: isString2, - parse: parseStringRepositoryProperty -}; -var booleanProperty = { - // The value from the API should come as a string, which we then parse into a boolean. - validate: isString2, - parse: parseBooleanRepositoryProperty -}; -var repositoryPropertyParsers = { - ["github-codeql-config-file" /* CONFIG_FILE */]: stringProperty, - ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: booleanProperty, - ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: stringProperty, - ["github-codeql-file-coverage-on-prs" /* FILE_COVERAGE_ON_PRS */]: booleanProperty, - ["github-codeql-tools" /* TOOLS */]: stringProperty -}; -async function loadPropertiesFromApi(logger, repositoryNwo) { - try { - const response = await getRepositoryProperties(repositoryNwo); - const remoteProperties = response.data; - if (!Array.isArray(remoteProperties)) { - throw new Error( - `Expected repository properties API to return an array, but got: ${JSON.stringify(response.data)}` - ); - } - logger.debug( - `Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}` - ); - const properties = {}; - const unrecognisedProperties = []; - for (const property of remoteProperties) { - if (property.property_name === void 0) { - throw new Error( - `Expected repository property object to have a 'property_name', but got: ${JSON.stringify(property)}` - ); - } - if (isKnownPropertyName(property.property_name)) { - setProperty(properties, property.property_name, property.value, logger); - } else if (property.property_name.startsWith(GITHUB_CODEQL_PROPERTY_PREFIX) && !isDynamicWorkflow()) { - unrecognisedProperties.push(property.property_name); - } - } - if (Object.keys(properties).length === 0) { - logger.debug("No known repository properties were found."); - } else { - logger.debug( - "Loaded the following values for the repository properties:" - ); - for (const [property, value] of Object.entries(properties).sort( - ([nameA], [nameB]) => nameA.localeCompare(nameB) - )) { - logger.debug(` ${property}: ${value}`); - } - } - if (unrecognisedProperties.length > 0) { - const unrecognisedPropertyList = unrecognisedProperties.map((name) => `'${name}'`).join(", "); - logger.warning( - `Found repository properties (${unrecognisedPropertyList}), which look like CodeQL Action repository properties, but which are not understood by this version of the CodeQL Action. Do you need to update to a newer version?` - ); - } - return properties; - } catch (e) { - throw new Error( - `Encountered an error while trying to determine repository properties: ${e}` - ); - } -} -function setProperty(properties, name, value, logger) { - const propertyOptions = repositoryPropertyParsers[name]; - if (propertyOptions.validate(value)) { - properties[name] = propertyOptions.parse(name, value, logger); - } else { - throw new Error( - `Unexpected value for repository property '${name}' (${typeof value}), got: ${JSON.stringify(value)}` - ); - } -} -function parseBooleanRepositoryProperty(name, value, logger) { - if (value !== "true" && value !== "false") { - logger.warning( - `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.` - ); - } - return value === "true"; -} -function parseStringRepositoryProperty(_name, value) { - return value; -} -var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( - Object.values(RepositoryPropertyName) -); -function isKnownPropertyName(name) { - return KNOWN_REPOSITORY_PROPERTY_NAMES.has(name); -} -async function loadRepositoryProperties(repositoryNwo, logger) { - const repositoryOwnerType = github2.context.payload.repository?.owner.type; - logger.debug( - `Repository owner type is '${repositoryOwnerType ?? "unknown"}'.` - ); - if (repositoryOwnerType === "User") { - logger.debug( - "Skipping loading repository properties because the repository is owned by a user and therefore cannot have repository properties." - ); - return new Success({}); - } - try { - return new Success(await loadPropertiesFromApi(logger, repositoryNwo)); - } catch (error3) { - logger.warning( - `Failed to load repository properties: ${getErrorMessage(error3)}` - ); - return new Failure(error3); - } -} - -// src/config/db-config.ts -var ORG_SCHEMA = { - /** An array of model pack names. */ - "model-packs": optional(array(string)) -}; -var DEFAULT_SETUP_SCHEMA = { - org: optional(object(ORG_SCHEMA)) -}; -var DEFAULT_SETUP_CONFIG_SCHEMA = { - "threat-models": optional(array(string)), - "default-setup": optional( - object(DEFAULT_SETUP_SCHEMA) - ) -}; -function mergeDefaultSetupAndUserConfigs(logger, fromConfigInput, fromConfigFile) { - logger.debug( - "Combining configuration files from 'config' and 'config-file' inputs" - ); - const schemaCheckResult = checkSchema( - DEFAULT_SETUP_CONFIG_SCHEMA, - fromConfigInput - ); - if (schemaCheckResult.invalidKeys.length > 0) { - logger.warning( - `Invalid keys in Default Setup configuration: ${schemaCheckResult.invalidKeys.join(", ")}` - ); - addNoLanguageDiagnostic( - void 0, - makeTelemetryDiagnostic( - "codeql-action/invalid-default-setup-config-keys", - "Invalid Default Setup configuration keys", - { - invalidKeys: schemaCheckResult.invalidKeys - }, - ["internal-error"] - ) - ); - } - if (schemaCheckResult.unknownKeys.length > 0) { - logger.warning( - `Unrecognised keys in Default Setup configuration: ${schemaCheckResult.unknownKeys.join(", ")}` - ); - addNoLanguageDiagnostic( - void 0, - makeTelemetryDiagnostic( - "codeql-action/unrecognised-default-setup-config-keys", - "Unrecognised Default Setup configuration keys", - { - unrecognisedKeys: schemaCheckResult.unknownKeys - }, - ["internal-error"] - ) - ); - } - const threatModels = new Set(fromConfigInput["threat-models"] || []); - for (const configFileThreatModel of fromConfigFile["threat-models"] || []) { - threatModels.add(configFileThreatModel); - } - if (fromConfigFile["default-setup"]) { - logger.warning( - `The 'default-setup' configuration key is not supported in user-supplied configuration files and will be ignored.` - ); - } - const result = { ...fromConfigFile }; - delete result["threat-models"]; - delete result["default-setup"]; - if (fromConfigInput["default-setup"]?.org?.["model-packs"]) { - result["default-setup"] = { - org: { - "model-packs": fromConfigInput["default-setup"].org["model-packs"] - } - }; - } - if (threatModels.size > 0) { - result["threat-models"] = Array.from(threatModels); - } - return result; -} -function shouldCombine(inputValue) { - return !!inputValue?.trim().startsWith("+"); -} -var PACK_IDENTIFIER_PATTERN = (function() { - const alphaNumeric = "[a-z0-9]"; - const alphaNumericDash = "[a-z0-9-]"; - const component = `${alphaNumeric}(${alphaNumericDash}*${alphaNumeric})?`; - return new RegExp(`^${component}/${component}$`); -})(); -function parsePacksSpecification(packStr) { - if (typeof packStr !== "string") { - throw new ConfigurationError(getPacksStrInvalid(packStr)); - } - packStr = packStr.trim(); - const atIndex = packStr.indexOf("@"); - const colonIndex = packStr.indexOf(":", atIndex); - const packStart = 0; - const versionStart = atIndex + 1 || void 0; - const pathStart = colonIndex + 1 || void 0; - const packEnd = Math.min( - atIndex > 0 ? atIndex : Infinity, - colonIndex > 0 ? colonIndex : Infinity, - packStr.length - ); - const versionEnd = versionStart ? Math.min(colonIndex > 0 ? colonIndex : Infinity, packStr.length) : void 0; - const pathEnd = pathStart ? packStr.length : void 0; - const packName = packStr.slice(packStart, packEnd).trim(); - const version = versionStart ? packStr.slice(versionStart, versionEnd).trim() : void 0; - const packPath = pathStart ? packStr.slice(pathStart, pathEnd).trim() : void 0; - if (!PACK_IDENTIFIER_PATTERN.test(packName)) { - throw new ConfigurationError(getPacksStrInvalid(packStr)); - } - if (version) { - try { - new semver5.Range(version); - } catch { - throw new ConfigurationError(getPacksStrInvalid(packStr)); - } - } - if (packPath && (path8.isAbsolute(packPath) || // Permit using "/" instead of "\" on Windows - // Use `x.split(y).join(z)` as a polyfill for `x.replaceAll(y, z)` since - // if we used a regex we'd need to escape the path separator on Windows - // which seems more awkward. - path8.normalize(packPath).split(path8.sep).join("/") !== packPath.split(path8.sep).join("/"))) { - throw new ConfigurationError(getPacksStrInvalid(packStr)); - } - if (!packPath && pathStart) { - throw new ConfigurationError(getPacksStrInvalid(packStr)); - } - return { - name: packName, - version, - path: packPath - }; -} -function validatePackSpecification(pack) { - return prettyPrintPack(parsePacksSpecification(pack)); -} -function parsePacksFromInput(rawPacksInput, languages, packsInputCombines) { - if (!rawPacksInput?.trim()) { - return void 0; - } - if (languages.length > 1) { - throw new ConfigurationError( - "Cannot specify a 'packs' input in a multi-language analysis. Use a codeql-config.yml file instead and specify packs by language." - ); - } else if (languages.length === 0) { - throw new ConfigurationError( - "No languages specified. Cannot process the packs input." - ); - } - rawPacksInput = rawPacksInput.trim(); - if (packsInputCombines) { - rawPacksInput = rawPacksInput.trim().substring(1).trim(); - if (!rawPacksInput) { - throw new ConfigurationError( - getConfigFilePropertyError( - void 0, - "packs", - "A '+' was used in the 'packs' input to specify that you wished to add some packs to your CodeQL analysis. However, no packs were specified. Please either remove the '+' or specify some packs." - ) - ); - } - } - return { - [languages[0]]: rawPacksInput.split(",").reduce((packs, pack) => { - packs.push(validatePackSpecification(pack)); - return packs; - }, []) - }; -} -async function calculateAugmentation(rawPacksInput, rawQueriesInput, repositoryProperties, languages) { - const packsInputCombines = shouldCombine(rawPacksInput); - const packsInput = parsePacksFromInput( - rawPacksInput, - languages, - packsInputCombines - ); - const queriesInputCombines = shouldCombine(rawQueriesInput); - const queriesInput = parseQueriesFromInput( - rawQueriesInput, - queriesInputCombines - ); - const repoExtraQueries = repositoryProperties["github-codeql-extra-queries" /* EXTRA_QUERIES */]; - const repoExtraQueriesCombines = shouldCombine(repoExtraQueries); - const repoPropertyQueries = { - combines: repoExtraQueriesCombines, - input: parseQueriesFromInput( - repoExtraQueries, - repoExtraQueriesCombines, - new ConfigurationError( - getRepoPropertyError( - "github-codeql-extra-queries" /* EXTRA_QUERIES */, - getEmptyCombinesError() - ) - ) - ) - }; - return { - packsInputCombines, - packsInput: packsInput?.[languages[0]], - queriesInput, - queriesInputCombines, - repoPropertyQueries - }; -} -function parseQueriesFromInput(rawQueriesInput, queriesInputCombines, errorToThrow) { - if (!rawQueriesInput) { - return void 0; - } - const trimmedInput = queriesInputCombines ? rawQueriesInput.trim().slice(1).trim() : rawQueriesInput?.trim() ?? ""; - if (queriesInputCombines && trimmedInput.length === 0) { - if (errorToThrow) { - throw errorToThrow; - } - throw new ConfigurationError( - getConfigFilePropertyError( - void 0, - "queries", - "A '+' was used in the 'queries' input to specify that you wished to add some packs to your CodeQL analysis. However, no packs were specified. Please either remove the '+' or specify some packs." - ) - ); - } - return trimmedInput.split(",").map((query) => ({ uses: query.trim() })); -} -function combineQueries(logger, config, augmentationProperties) { - const result = []; - if (augmentationProperties.repoPropertyQueries?.input) { - logger.info( - `Found query configuration in the repository properties (${"github-codeql-extra-queries" /* EXTRA_QUERIES */}): ${augmentationProperties.repoPropertyQueries.input.map((q) => q.uses).join(", ")}` - ); - if (!augmentationProperties.repoPropertyQueries.combines) { - logger.info( - `The queries configured in the repository properties don't allow combining with other query settings. Any queries configured elsewhere will be ignored.` - ); - return augmentationProperties.repoPropertyQueries.input; - } else { - result.push(...augmentationProperties.repoPropertyQueries.input); - } - } - if (augmentationProperties.queriesInput) { - if (!augmentationProperties.queriesInputCombines) { - return result.concat(augmentationProperties.queriesInput); - } else { - result.push(...augmentationProperties.queriesInput); - } - } - if (config.queries) { - result.push(...config.queries); - } - return result; -} -function generateCodeScanningConfig(logger, originalUserInput, augmentationProperties) { - const augmentedConfig = cloneObject(originalUserInput); - augmentedConfig.queries = combineQueries( - logger, - augmentedConfig, - augmentationProperties - ); - logger.debug( - `Combined queries: ${augmentedConfig.queries?.map((q) => q.uses).join(",")}` - ); - if (augmentedConfig.queries?.length === 0) { - delete augmentedConfig.queries; - } - if (augmentationProperties.packsInput) { - if (augmentationProperties.packsInputCombines) { - if (Array.isArray(augmentedConfig.packs)) { - augmentedConfig.packs = (augmentedConfig.packs || []).concat( - augmentationProperties.packsInput - ); - } else if (!augmentedConfig.packs) { - augmentedConfig.packs = augmentationProperties.packsInput; - } else { - const language = Object.keys(augmentedConfig.packs)[0]; - augmentedConfig.packs[language] = augmentedConfig.packs[language].concat(augmentationProperties.packsInput); - } - } else { - augmentedConfig.packs = augmentationProperties.packsInput; - } - } - if (Array.isArray(augmentedConfig.packs) && !augmentedConfig.packs.length) { - delete augmentedConfig.packs; - } - return augmentedConfig; -} -function parseUserConfig(logger, pathInput, contents, validateConfig) { - try { - const schema = ( - // eslint-disable-next-line @typescript-eslint/no-require-imports - require_db_config_schema() - ); - const doc = load(contents); - if (validateConfig) { - const result = new jsonschema.Validator().validate(doc, schema); - if (result.errors.length > 0) { - for (const error3 of result.errors) { - logger.error(error3.stack); - } - throw new ConfigurationError( - getInvalidConfigFileMessage( - pathInput, - result.errors.map((e) => e.stack) - ) - ); - } - } - return doc; - } catch (error3) { - if (error3 instanceof YAMLException) { - throw new ConfigurationError( - getConfigFileParseErrorMessage(pathInput, error3.message) - ); - } - throw error3; - } -} - -// src/config/remote-file.ts -var DEFAULT_CONFIG_FILE_NAME = ".github/codeql-config.yml"; -var DEFAULT_CONFIG_FILE_REF = "main"; -function getDefaultOwner(env) { - const currentRepoNwo = env.getRequired("GITHUB_REPOSITORY" /* GITHUB_REPOSITORY */); - const nwoParts = currentRepoNwo.split("/"); - if (nwoParts.length !== 2 || nwoParts[0].trim().length === 0) { - throw new Error( - `Expected ${"GITHUB_REPOSITORY" /* GITHUB_REPOSITORY */} to contain a name with owner, but got '${currentRepoNwo}'.` - ); - } - return nwoParts[0].trim(); -} -var OLD_REMOTE_ADDRESS_FORMAT = new RegExp( - "(?[^/]+)/(?[^/]+)/(?[^@]+)@(?.*)" -); -function parseOldRemoteFileAddress(input) { - const pieces = OLD_REMOTE_ADDRESS_FORMAT.exec(input); - if (pieces?.groups === void 0 || pieces.length < 5) { - return new Failure(void 0); - } - return new Success({ - owner: pieces.groups.owner.trim(), - repo: pieces.groups.repo.trim(), - path: pieces.groups.path.trim(), - ref: pieces.groups.ref.trim() - }); -} -function parseNewRemoteFileAddress(env, configFile) { - const format = new RegExp( - "^((?[^:@/]+)/)?(?[^:@/]+)(@(?[^:]+))?(:(?.+))?$" - ); - const pieces = format.exec(configFile.trim()); - const repo = pieces?.groups?.repo?.trim(); - if (!pieces?.groups || !repo || repo.length === 0) { - return new Failure(void 0); - } - const owner = pieces.groups.owner?.trim(); - const path30 = pieces.groups.path?.trim(); - const ref = pieces.groups.ref?.trim(); - return new Success({ - owner: owner || getDefaultOwner(env), - repo, - path: path30 || DEFAULT_CONFIG_FILE_NAME, - ref: ref || DEFAULT_CONFIG_FILE_REF - }); -} -async function parseRemoteFileAddress(actionState, configFile) { - const oldFormatAddressResult = parseOldRemoteFileAddress(configFile); - if (oldFormatAddressResult.isSuccess()) { - return oldFormatAddressResult.value; - } - const newFormatAddressResult = parseNewRemoteFileAddress( - actionState.env, - configFile - ); - if (newFormatAddressResult.isFailure()) { - throw new ConfigurationError( - getConfigFileRepoFormatInvalidMessage(configFile) - ); - } - const address = newFormatAddressResult.value; - if (address.path.startsWith("/")) { - throw new ConfigurationError( - `The path component of '${configFile}' cannot be an absolute path.` - ); - } - return address; -} - -// src/config/file.ts -var LOCAL_PATH_PREFIX = "./"; -var REMOTE_PATH_PREFIX = "remote="; -async function getConfigFileInput({ - logger, - actions, - features -}, repositoryProperties, analysisKinds) { - const input = actions.getOptionalInput("config-file"); - if (input !== void 0) { - logger.info(`Using configuration file input from workflow: ${input}`); - return input; - } - const propertyValue = repositoryProperties["github-codeql-config-file" /* CONFIG_FILE */]; - const analysisKindSupported = analysisKinds === void 0 || analysisKinds.includes("code-scanning" /* CodeScanning */) && analysisKinds.length === 1; - if (propertyValue !== void 0 && propertyValue.trim().length > 0) { - const useRepositoryProperty = await features.getValue( - "config_file_repository_property" /* ConfigFileRepositoryProperty */ - ); - if (analysisKindSupported && useRepositoryProperty) { - logger.info( - `Using configuration file input from repository property: ${propertyValue}` - ); - return propertyValue; - } else if (!analysisKindSupported) { - logger.info( - "Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind." - ); - } else { - logger.info( - "Ignoring configuration file input from repository property, because the corresponding feature flag is disabled." - ); - } - } - return void 0; -} -async function getRemoteConfig(actionState, configFile, apiDetails) { - const address = await parseRemoteFileAddress(actionState, configFile); - const shouldProxyRequest = await actionState.features.getValue( - "proxy_api_requests" /* ProxyApiRequests */ - ); - const proxy = shouldProxyRequest ? getRegistryProxy(actionState) : void 0; - const response = await getApiClientWithExternalAuth(apiDetails, proxy).rest.repos.getContent({ - owner: address.owner, - repo: address.repo, - path: address.path, - ref: address.ref - }); - let fileContents; - if ("content" in response.data && response.data.content !== void 0) { - fileContents = response.data.content; - } else if (Array.isArray(response.data)) { - throw new ConfigurationError( - getConfigFileDirectoryGivenMessage(configFile) - ); - } else { - throw new ConfigurationError( - getConfigFileFormatInvalidMessage(configFile) - ); - } - const validateConfig = await actionState.features.getValue( - "validate_db_config" /* ValidateDbConfig */ - ); - return parseUserConfig( - actionState.logger, - configFile, - Buffer.from(fileContents, "base64").toString("binary"), - validateConfig - ); -} - -// src/diff-informed-analysis-utils.ts -var fs7 = __toESM(require("fs")); -async function getDiffInformedAnalysisBranches(codeql, features, logger) { - if (!await features.getValue("diff_informed_queries" /* DiffInformedQueries */, codeql)) { - return void 0; - } - const gitHubVersion = await getGitHubVersion(); - if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)) { - return void 0; - } - const branches = getPullRequestBranches(); - if (!branches) { - logger.info( - "Not performing diff-informed analysis because we are not analyzing a pull request." - ); - } - return branches; -} -async function prepareDiffInformedAnalysis(codeql, features, logger) { - let branches; - try { - branches = await getDiffInformedAnalysisBranches(codeql, features, logger); - } catch (e) { - logger.warning( - `Failed to determine branch information for diff-informed analysis: ${getErrorMessage(e)}` - ); - return false; - } - if (!branches) { - return false; - } - try { - return await computeAndPersistDiffRanges(branches, logger); - } catch (e) { - logger.warning( - `Failed to compute diff-informed analysis ranges: ${getErrorMessage(e)}` - ); - return false; - } -} -function writeDiffRangesJsonFile(logger, ranges) { - const jsonContents = JSON.stringify(ranges, null, 2); - const jsonFilePath = getDiffRangesJsonFilePath(); - fs7.writeFileSync(jsonFilePath, jsonContents); - logger.debug( - `Wrote pr-diff-range JSON file to ${jsonFilePath}: -${jsonContents}` - ); -} -function readDiffRangesJsonFile(logger) { - const jsonFilePath = getDiffRangesJsonFilePath(); - if (!fs7.existsSync(jsonFilePath)) { - logger.debug(`Diff ranges JSON file does not exist at ${jsonFilePath}`); - return void 0; - } - const jsonContents = fs7.readFileSync(jsonFilePath, "utf8"); - logger.debug( - `Read pr-diff-range JSON file from ${jsonFilePath}: -${jsonContents}` - ); - try { - return JSON.parse(jsonContents); - } catch (e) { - logger.warning( - `Failed to parse diff ranges JSON file at ${jsonFilePath}: ${e}` - ); - return void 0; - } -} -async function getPullRequestEditedDiffRanges(branches, logger) { - const fileDiffs = await getFileDiffsWithBasehead(branches, logger); - if (fileDiffs === void 0) { - return void 0; - } - if (fileDiffs.length >= 300) { - logger.warning( - `Cannot retrieve the full diff because there are too many (${fileDiffs.length}) changed files in the pull request.` - ); - return void 0; - } - const results = []; - for (const filediff of fileDiffs) { - const diffRanges = getDiffRanges(filediff, logger); - if (diffRanges === void 0) { - return void 0; - } - results.push(...diffRanges); - } - return results; -} -async function computeAndPersistDiffRanges(branches, logger) { - logger.info("Computing PR diff ranges..."); - const ranges = await getPullRequestEditedDiffRanges(branches, logger); - if (ranges === void 0) { - return false; - } - writeDiffRangesJsonFile(logger, ranges); - const distinctFiles = new Set(ranges.map((r) => r.path)).size; - logger.info( - `Persisted ${ranges.length} diff range(s) across ${distinctFiles} file(s).` - ); - return true; -} -async function getFileDiffsWithBasehead(branches, logger) { - const repositoryNwo = getRepositoryNwoFromEnv( - "CODE_SCANNING_REPOSITORY", - "GITHUB_REPOSITORY" - ); - const basehead = `${branches.base}...${branches.head}`; - try { - const response = await getApiClient().rest.repos.compareCommitsWithBasehead( - { - owner: repositoryNwo.owner, - repo: repositoryNwo.repo, - basehead, - per_page: 1 - } - ); - logger.debug( - `Response from compareCommitsWithBasehead(${basehead}): -${JSON.stringify(response, null, 2)}` - ); - return response.data.files; - } catch (error3) { - if (error3.status) { - logger.warning(`Error retrieving diff ${basehead}: ${error3.message}`); - logger.debug( - `Error running compareCommitsWithBasehead(${basehead}): -Request: ${JSON.stringify(error3.request, null, 2)} -Error Response: ${JSON.stringify(error3.response, null, 2)}` - ); - return void 0; - } else { - throw error3; - } - } -} -function getDiffRanges(fileDiff, logger) { - if (fileDiff.patch === void 0) { - if (fileDiff.changes === 0) { - return []; - } - return [ - { - path: fileDiff.filename, - startLine: 0, - endLine: 0 - } - ]; - } - let currentLine = 0; - let additionRangeStartLine = void 0; - const diffRanges = []; - const diffLines = fileDiff.patch.split("\n"); - diffLines.push(" "); - for (const diffLine of diffLines) { - if (diffLine.startsWith("-")) { - continue; - } - if (diffLine.startsWith("+")) { - if (additionRangeStartLine === void 0) { - additionRangeStartLine = currentLine; - } - currentLine++; - continue; - } - if (additionRangeStartLine !== void 0) { - diffRanges.push({ - path: fileDiff.filename, - startLine: additionRangeStartLine, - endLine: currentLine - 1 - }); - additionRangeStartLine = void 0; - } - if (diffLine.startsWith("@@ ")) { - const match2 = diffLine.match(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/); - if (match2 === null) { - logger.warning( - `Cannot parse diff hunk header for ${fileDiff.filename}: ${diffLine}` - ); - return void 0; - } - currentLine = parseInt(match2[1], 10); - continue; - } - if (diffLine.startsWith(" ")) { - currentLine++; - continue; - } - } - return diffRanges; -} - -// src/languages/builtin.json -var builtin_default = { - languages: [ - "actions", - "cpp", - "csharp", - "go", - "java", - "javascript", - "python", - "ruby", - "rust", - "swift" - ], - aliases: { - c: "cpp", - "c-c++": "cpp", - "c-cpp": "cpp", - "c#": "csharp", - "c++": "cpp", - "java-kotlin": "java", - "javascript-typescript": "javascript", - kotlin: "java", - typescript: "javascript" - } -}; - -// src/languages/index.ts -var BuiltInLanguage = /* @__PURE__ */ ((BuiltInLanguage3) => { - BuiltInLanguage3["actions"] = "actions"; - BuiltInLanguage3["cpp"] = "cpp"; - BuiltInLanguage3["csharp"] = "csharp"; - BuiltInLanguage3["go"] = "go"; - BuiltInLanguage3["java"] = "java"; - BuiltInLanguage3["javascript"] = "javascript"; - BuiltInLanguage3["python"] = "python"; - BuiltInLanguage3["ruby"] = "ruby"; - BuiltInLanguage3["rust"] = "rust"; - BuiltInLanguage3["swift"] = "swift"; - return BuiltInLanguage3; -})(BuiltInLanguage || {}); -var builtInLanguageSet = new Set(builtin_default.languages); -function isBuiltInLanguage(language) { - return builtInLanguageSet.has(language); -} -function parseBuiltInLanguage(language) { - language = language.trim().toLowerCase(); - language = builtin_default.aliases[language] ?? language; - if (isBuiltInLanguage(language)) { - return language; - } - return void 0; -} - -// src/overlay/diagnostics.ts -async function addOverlayDisablementDiagnostics(config, codeql, overlayDisabledReason) { - addNoLanguageDiagnostic( - config, - makeTelemetryDiagnostic( - "codeql-action/overlay-disabled", - "Overlay analysis disabled", - { - reason: overlayDisabledReason - } - ) - ); - if (overlayDisabledReason === "skipped-due-to-cached-status" /* SkippedDueToCachedStatus */) { - addNoLanguageDiagnostic( - config, - makeDiagnostic( - "codeql-action/overlay-disabled-due-to-cached-status", - "Skipped improved incremental analysis because it failed previously with similar hardware resources", - { - attributes: { - languages: config.languages - }, - markdownMessage: `Improved incremental analysis was skipped because it previously failed for this repository with CodeQL version ${(await codeql.getVersion()).version} on a runner with similar hardware resources. One possible reason for this is that improved incremental analysis can require a significant amount of disk space for some repositories. If you want to try re-enabling improved incremental analysis, increase the disk space available to the runner. If that doesn't help, contact GitHub Support for further assistance. - -Improved incremental analysis will be automatically retried when the next version of CodeQL is released. You can also manually trigger a retry by [removing](${"https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#deleting-cache-entries" /* DELETE_ACTIONS_CACHE_ENTRIES */}) \`codeql-overlay-status-*\` entries from the Actions cache.`, - severity: "note", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: false - } - } - ) - ); - } - if (overlayDisabledReason === "disabled-by-repository-property" /* DisabledByRepositoryProperty */) { - addNoLanguageDiagnostic( - config, - makeDiagnostic( - "codeql-action/overlay-disabled-by-repository-property", - "Improved incremental analysis disabled by repository property", - { - attributes: { - languages: config.languages - }, - markdownMessage: `Improved incremental analysis has been disabled because the \`${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */}\` repository property is set to \`true\`. To re-enable improved incremental analysis, set this property to \`false\` or remove it.`, - severity: "note", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: false - } - } - ) - ); - } -} - -// src/overlay/status.ts -var fs8 = __toESM(require("fs")); -var path9 = __toESM(require("path")); -var actionsCache = __toESM(require_cache4()); -var MAX_CACHE_OPERATION_MS = 3e4; -var STATUS_FILE_NAME = "overlay-status.json"; -function getStatusFilePath(languages) { - return path9.join( - getTemporaryDirectory(), - "overlay-status", - [...languages].sort().join("+"), - STATUS_FILE_NAME - ); -} -function createOverlayStatus(attributes, checkRunId) { - const job = { - workflowRunId: getWorkflowRunID(), - workflowRunAttempt: getWorkflowRunAttempt(), - name: getRequiredEnvParam("GITHUB_JOB"), - checkRunId - }; - return { - ...attributes, - job - }; -} -async function shouldSkipOverlayAnalysis(codeql, languages, diskUsage, logger) { - const status = await getOverlayStatus(codeql, languages, diskUsage, logger); - if (status === void 0) { - return false; - } - if (status.attemptedToBuildOverlayBaseDatabase && !status.builtOverlayBaseDatabase) { - logger.debug( - "Cached overlay status indicates that building an overlay base database was unsuccessful." - ); - return true; - } - logger.debug( - "Cached overlay status does not indicate a previous unsuccessful attempt to build an overlay base database." - ); - return false; -} -async function getOverlayStatus(codeql, languages, diskUsage, logger) { - const cacheKey3 = await getCacheKey(codeql, languages, diskUsage); - const statusFile = getStatusFilePath(languages); - try { - await fs8.promises.mkdir(path9.dirname(statusFile), { recursive: true }); - const foundKey = await waitForResultWithTimeLimit( - MAX_CACHE_OPERATION_MS, - actionsCache.restoreCache([statusFile], cacheKey3), - () => { - logger.warning("Timed out restoring overlay status from cache."); - } - ); - if (foundKey === void 0) { - logger.debug("No overlay status found in Actions cache."); - return void 0; - } - if (!fs8.existsSync(statusFile)) { - logger.debug( - "Overlay status cache entry found but status file is missing." - ); - return void 0; - } - const contents = await fs8.promises.readFile(statusFile, "utf-8"); - const parsed = JSON.parse(contents); - if (!isObject(parsed) || typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || typeof parsed["builtOverlayBaseDatabase"] !== "boolean") { - logger.debug( - "Ignoring overlay status cache entry with unexpected format." - ); - return void 0; - } - return parsed; - } catch (error3) { - logger.warning( - `Failed to restore overlay status from cache: ${getErrorMessage(error3)}` - ); - return void 0; - } -} -async function saveOverlayStatus(codeql, languages, diskUsage, status, logger) { - const cacheKey3 = await getCacheKey(codeql, languages, diskUsage); - const statusFile = getStatusFilePath(languages); - try { - await fs8.promises.mkdir(path9.dirname(statusFile), { recursive: true }); - await fs8.promises.writeFile(statusFile, JSON.stringify(status)); - const cacheId = await waitForResultWithTimeLimit( - MAX_CACHE_OPERATION_MS, - actionsCache.saveCache([statusFile], cacheKey3), - () => { - logger.warning("Timed out saving overlay status to cache."); - } - ); - if (cacheId === void 0) { - return false; - } - logger.debug(`Saved overlay status to Actions cache with key ${cacheKey3}`); - return true; - } catch (error3) { - logger.warning( - `Failed to save overlay status to cache: ${getErrorMessage(error3)}` - ); - return false; - } -} -async function getCacheKey(codeql, languages, diskUsage) { - const diskSpaceToNearest10Gb = `${10 * Math.floor(diskUsage.numTotalBytes / (10 * 1024 * 1024 * 1024))}GB`; - return `codeql-overlay-status-${[...languages].sort().join("+")}-${(await codeql.getVersion()).version}-runner-${diskSpaceToNearest10Gb}`; -} - -// src/trap-caching.ts -var fs9 = __toESM(require("fs")); -var path10 = __toESM(require("path")); -var actionsCache2 = __toESM(require_cache4()); -var CACHE_VERSION = 1; -var CODEQL_TRAP_CACHE_PREFIX = "codeql-trap"; -var MINIMUM_CACHE_MB_TO_UPLOAD = 10; -var MAX_CACHE_OPERATION_MS2 = 12e4; -async function downloadTrapCaches(codeql, languages, logger) { - const result = {}; - const languagesSupportingCaching = await getLanguagesSupportingCaching( - codeql, - languages, - logger - ); - logger.info( - `Found ${languagesSupportingCaching.length} languages that support TRAP caching` - ); - if (languagesSupportingCaching.length === 0) return result; - const cachesDir = path10.join( - getTemporaryDirectory(), - "trapCaches" - ); - for (const language of languagesSupportingCaching) { - const cacheDir2 = path10.join(cachesDir, language); - fs9.mkdirSync(cacheDir2, { recursive: true }); - result[language] = cacheDir2; - } - if (await isAnalyzingDefaultBranch()) { - logger.info( - "Analyzing default branch. Skipping downloading of TRAP caches." - ); - return result; - } - let baseSha = "unknown"; - const eventPath = process.env.GITHUB_EVENT_PATH; - if (getWorkflowEventName() === "pull_request" && eventPath !== void 0) { - const event = JSON.parse(fs9.readFileSync(path10.resolve(eventPath), "utf-8")); - baseSha = event.pull_request?.base?.sha || baseSha; - } - for (const language of languages) { - const cacheDir2 = result[language]; - if (cacheDir2 === void 0) continue; - const preferredKey = await cacheKey(codeql, language, baseSha); - logger.info( - `Looking in Actions cache for TRAP cache with key ${preferredKey}` - ); - const found = await waitForResultWithTimeLimit( - MAX_CACHE_OPERATION_MS2, - actionsCache2.restoreCache([cacheDir2], preferredKey, [ - // Fall back to any cache with the right key prefix - await cachePrefix(codeql, language) - ]), - () => { - logger.info( - `Timed out downloading cache for ${language}, will continue without it` - ); - } - ); - if (found === void 0) { - logger.info(`No TRAP cache found in Actions cache for ${language}`); - delete result[language]; - } - } - return result; -} -async function uploadTrapCaches(codeql, config, logger) { - if (!await isAnalyzingDefaultBranch()) return false; - for (const language of config.languages) { - const cacheDir2 = config.trapCaches[language]; - if (cacheDir2 === void 0) continue; - const trapFolderSize = await tryGetFolderBytes(cacheDir2, logger); - if (trapFolderSize === void 0) { - logger.info( - `Skipping upload of TRAP cache for ${language} as we couldn't determine its size` - ); - continue; - } - if (trapFolderSize < MINIMUM_CACHE_MB_TO_UPLOAD * 1048576) { - logger.info( - `Skipping upload of TRAP cache for ${language} as it is too small` - ); - continue; - } - const key = await cacheKey( - codeql, - language, - process.env.GITHUB_SHA || "unknown" - ); - logger.info(`Uploading TRAP cache to Actions cache with key ${key}`); - await waitForResultWithTimeLimit( - MAX_CACHE_OPERATION_MS2, - actionsCache2.saveCache([cacheDir2], key), - () => { - logger.info( - `Timed out waiting for TRAP cache for ${language} to upload, will continue without uploading` - ); - } - ); - } - return true; -} -async function cleanupTrapCaches(config, features, logger) { - if (!await features.getValue("cleanup_trap_caches" /* CleanupTrapCaches */)) { - return { - trap_cache_cleanup_skipped_because: "feature disabled" - }; - } - logger.warning( - "TRAP cache cleanup is deprecated and will be removed in May 2026. We recommend instead disabling TRAP caching by passing the `trap-caching: false` input to the `init` Action." - ); - if (!await isAnalyzingDefaultBranch()) { - return { - trap_cache_cleanup_skipped_because: "not analyzing default branch" - }; - } - try { - let totalBytesCleanedUp = 0; - const allCaches = await listActionsCaches( - CODEQL_TRAP_CACHE_PREFIX, - await getRef() - ); - for (const language of config.languages) { - if (config.trapCaches[language]) { - const cachesToRemove = await getTrapCachesForLanguage( - allCaches, - language, - logger - ); - cachesToRemove.sort((a, b) => a.created_at.localeCompare(b.created_at)); - const mostRecentCache = cachesToRemove.pop(); - logger.debug( - `Keeping most recent TRAP cache (${JSON.stringify(mostRecentCache)})` - ); - if (cachesToRemove.length === 0) { - logger.info(`No TRAP caches to clean up for ${language}.`); - continue; - } - for (const cache of cachesToRemove) { - logger.debug(`Cleaning up TRAP cache (${JSON.stringify(cache)})`); - await deleteActionsCache(cache.id); - } - const bytesCleanedUp = cachesToRemove.reduce( - (acc, item) => acc + item.size_in_bytes, - 0 - ); - totalBytesCleanedUp += bytesCleanedUp; - const megabytesCleanedUp = (bytesCleanedUp / (1024 * 1024)).toFixed(2); - logger.info( - `Cleaned up ${megabytesCleanedUp} MiB of old TRAP caches for ${language}.` - ); - } - } - return { trap_cache_cleanup_size_bytes: totalBytesCleanedUp }; - } catch (e) { - if (asHTTPError(e)?.status === 403) { - logger.warning( - `Could not cleanup TRAP caches as the token did not have the required permissions. To clean up TRAP caches, ensure the token has the "actions:write" permission. See ${"https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs" /* ASSIGNING_PERMISSIONS_TO_JOBS */} for more information.` - ); - } else { - logger.info(`Failed to cleanup TRAP caches, continuing. Details: ${e}`); - } - return { trap_cache_cleanup_error: getErrorMessage(e) }; - } -} -async function getTrapCachesForLanguage(allCaches, language, logger) { - logger.debug(`Listing TRAP caches for ${language}`); - for (const cache of allCaches) { - if (!cache.created_at || !cache.id || !cache.key || !cache.size_in_bytes) { - throw new Error( - `An unexpected cache item was returned from the API that was missing one or more required fields: ${JSON.stringify(cache)}` - ); - } - } - return allCaches.filter((cache) => { - return cache.key?.includes(`-${language}-`); - }); -} -async function getLanguagesSupportingCaching(codeql, languages, logger) { - const result = []; - const resolveResult = await codeql.resolveLanguages(); - outer: for (const lang of languages) { - const extractorsForLanguage = resolveResult.extractors[lang]; - if (extractorsForLanguage === void 0) { - logger.info( - `${lang} does not support TRAP caching (couldn't find an extractor)` - ); - continue; - } - if (extractorsForLanguage.length !== 1) { - logger.info( - `${lang} does not support TRAP caching (found multiple extractors)` - ); - continue; - } - const extractor = extractorsForLanguage[0]; - const trapCacheOptions = extractor.extractor_options?.trap?.properties?.cache?.properties; - if (trapCacheOptions === void 0) { - logger.info( - `${lang} does not support TRAP caching (missing option group)` - ); - continue; - } - for (const requiredOpt of ["dir", "bound", "write"]) { - if (!(requiredOpt in trapCacheOptions)) { - logger.info( - `${lang} does not support TRAP caching (missing ${requiredOpt} option)` - ); - continue outer; - } - } - result.push(lang); - } - return result; -} -async function cacheKey(codeql, language, baseSha) { - return `${await cachePrefix(codeql, language)}${baseSha}`; -} -async function cachePrefix(codeql, language) { - return `${CODEQL_TRAP_CACHE_PREFIX}-${CACHE_VERSION}-${(await codeql.getVersion()).version}-${language}-`; -} - -// src/config-utils.ts -var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 14e3; -var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; -var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; -var CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE = "2.24.3"; -async function getSupportedLanguageMap(codeql, logger) { - const resolveSupportedLanguagesUsingCli = await codeql.supportsFeature( - "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - ); - const resolveResult = await codeql.resolveLanguages({ - filterToLanguagesWithQueries: resolveSupportedLanguagesUsingCli - }); - if (resolveSupportedLanguagesUsingCli) { - logger.debug( - `The CodeQL CLI supports the following languages: ${Object.keys(resolveResult.extractors).join(", ")}` - ); - } - const supportedLanguages = {}; - for (const extractor of Object.keys(resolveResult.extractors)) { - if (resolveSupportedLanguagesUsingCli || BuiltInLanguage[extractor] !== void 0) { - supportedLanguages[extractor] = extractor; - } - } - if (resolveResult.aliases) { - for (const [alias, extractor] of Object.entries(resolveResult.aliases)) { - supportedLanguages[alias] = extractor; - } - } - return supportedLanguages; -} -var baseWorkflowsPath = ".github/workflows"; -function hasActionsWorkflows(sourceRoot) { - const workflowsPath = path11.resolve(sourceRoot, baseWorkflowsPath); - const stats = fs10.lstatSync(workflowsPath, { throwIfNoEntry: false }); - return stats !== void 0 && stats.isDirectory() && fs10.readdirSync(workflowsPath).length > 0; -} -async function getRawLanguagesInRepo(repository, sourceRoot, logger) { - logger.debug( - `Automatically detecting languages (${repository.owner}/${repository.repo})` - ); - const response = await getApiClient().rest.repos.listLanguages({ - owner: repository.owner, - repo: repository.repo - }); - logger.debug(`Languages API response: ${JSON.stringify(response)}`); - const result = Object.keys(response.data).map( - (language) => language.trim().toLowerCase() - ); - if (hasActionsWorkflows(sourceRoot)) { - logger.debug(`Found a .github/workflows directory`); - result.push("actions"); - } - logger.debug(`Raw languages in repository: ${result.join(", ")}`); - return result; -} -async function getLanguages(codeql, languagesInput, repository, sourceRoot, logger) { - const { rawLanguages, autodetected } = await getRawLanguages( - languagesInput, - repository, - sourceRoot, - logger - ); - const languageMap = await getSupportedLanguageMap(codeql, logger); - const languagesSet = /* @__PURE__ */ new Set(); - const unknownLanguages = []; - for (const language of rawLanguages) { - const extractorName = languageMap[language]; - if (extractorName === void 0) { - unknownLanguages.push(language); - } else { - languagesSet.add(extractorName); - } - } - const languages = Array.from(languagesSet); - if (!autodetected && unknownLanguages.length > 0) { - throw new ConfigurationError( - getUnknownLanguagesError(unknownLanguages) - ); - } - if (languages.length === 0) { - throw new ConfigurationError(getNoLanguagesError()); - } - if (autodetected) { - logger.info(`Autodetected languages: ${languages.join(", ")}`); - } else { - logger.info(`Languages from configuration: ${languages.join(", ")}`); - } - return languages; -} -function getRawLanguagesNoAutodetect(languagesInput) { - return (languagesInput || "").split(",").map((x) => x.trim().toLowerCase()).filter((x) => x.length > 0); -} -async function getRawLanguages(languagesInput, repository, sourceRoot, logger) { - const languagesFromInput = getRawLanguagesNoAutodetect(languagesInput); - if (languagesFromInput.length > 0) { - return { rawLanguages: languagesFromInput, autodetected: false }; - } - return { - rawLanguages: await getRawLanguagesInRepo(repository, sourceRoot, logger), - autodetected: true - }; -} -async function initActionState({ - languagesInput, - queriesInput, - packsInput, - buildModeInput, - dbLocation, - dependencyCachingEnabled, - debugMode, - debugArtifactName, - debugDatabaseName, - repository, - tempDir, - codeql, - sourceRoot, - githubVersion, - features, - repositoryProperties, - analysisKinds, - logger, - enableFileCoverageInformation -}, userConfig) { - const languages = await getLanguages( - codeql, - languagesInput, - repository, - sourceRoot, - logger - ); - const buildMode = await parseBuildModeInput( - buildModeInput, - languages, - features, - logger - ); - const augmentationProperties = await calculateAugmentation( - packsInput, - queriesInput, - repositoryProperties, - languages - ); - if (analysisKinds.length === 1 && analysisKinds.includes("code-quality" /* CodeQuality */) && augmentationProperties.repoPropertyQueries.input) { - logger.info( - `Ignoring queries configured in the repository properties, because query customisations are not supported for Code Quality analyses.` - ); - augmentationProperties.repoPropertyQueries = { - combines: false, - input: void 0 - }; - } - const computedConfig = generateCodeScanningConfig( - logger, - userConfig, - augmentationProperties - ); - return { - version: getActionVersion(), - analysisKinds, - languages, - buildMode, - originalUserInput: userConfig, - computedConfig, - tempDir, - codeQLCmd: codeql.getPath(), - gitHubVersion: githubVersion, - dbLocation: dbLocationOrDefault(dbLocation, tempDir), - debugMode, - debugArtifactName, - debugDatabaseName, - trapCaches: {}, - trapCacheDownloadTime: 0, - dependencyCachingEnabled: getCachingKind(dependencyCachingEnabled), - dependencyCachingRestoredKeys: [], - extraQueryExclusions: [], - overlayDatabaseMode: "none" /* None */, - useOverlayDatabaseCaching: false, - overlayModeSetExplicitly: false, - repositoryProperties, - enableFileCoverageInformation - }; -} -async function downloadCacheWithTime(codeQL, languages, logger) { - const start = import_perf_hooks.performance.now(); - const trapCaches = await downloadTrapCaches(codeQL, languages, logger); - const trapCacheDownloadTime = import_perf_hooks.performance.now() - start; - return { trapCaches, trapCacheDownloadTime }; -} -async function loadUserConfig(actionState, configFile, workspacePath, apiDetails, tempDir) { - if (isLocal(configFile)) { - if (configFile !== userConfigFromActionPath(tempDir)) { - configFile = path11.resolve(workspacePath, configFile); - if (!(configFile + path11.sep).startsWith(workspacePath + path11.sep)) { - throw new ConfigurationError( - getConfigFileOutsideWorkspaceErrorMessage(configFile) - ); - } - } - const validateConfig = await actionState.features.getValue( - "validate_db_config" /* ValidateDbConfig */ - ); - return getLocalConfig(actionState.logger, configFile, validateConfig); - } else { - if (isExplicitRemotePath(configFile)) { - configFile = configFile.substring(REMOTE_PATH_PREFIX.length); - } - return await getRemoteConfig(actionState, configFile, apiDetails); - } -} -var OVERLAY_ANALYSIS_FEATURES = { - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, - csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, - go: "overlay_analysis_go" /* OverlayAnalysisGo */, - java: "overlay_analysis_java" /* OverlayAnalysisJava */, - javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, - python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ -}; -var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, - csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, - go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, - java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, - javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, - python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ -}; -async function checkOverlayAnalysisFeatureEnabled(features, codeql, languages, codeScanningConfig) { - if (!await features.getValue("overlay_analysis" /* OverlayAnalysis */, codeql)) { - return new Failure("overall-feature-not-enabled" /* OverallFeatureNotEnabled */); - } - let enableForCodeScanningOnly = false; - for (const language of languages) { - const feature = OVERLAY_ANALYSIS_FEATURES[language]; - if (feature && await features.getValue(feature, codeql)) { - continue; - } - const codeScanningFeature = OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES[language]; - if (codeScanningFeature && await features.getValue(codeScanningFeature, codeql)) { - enableForCodeScanningOnly = true; - continue; - } - return new Failure("language-not-enabled" /* LanguageNotEnabled */); - } - if (enableForCodeScanningOnly) { - const usesDefaultQueriesOnly = codeScanningConfig["disable-default-queries"] !== true && codeScanningConfig.packs === void 0 && codeScanningConfig.queries === void 0 && codeScanningConfig["query-filters"] === void 0; - if (!usesDefaultQueriesOnly) { - return new Failure("non-default-queries" /* NonDefaultQueries */); - } - } - return new Success(void 0); -} -function runnerHasSufficientDiskSpace(diskUsage, logger) { - const minimumDiskSpaceBytes = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES; - if (diskUsage.numAvailableBytes < minimumDiskSpaceBytes) { - const diskSpaceMb = Math.round(diskUsage.numAvailableBytes / 1e6); - const minimumDiskSpaceMb = Math.round(minimumDiskSpaceBytes / 1e6); - logger.info( - `Setting overlay database mode to ${"none" /* None */} due to insufficient disk space (${diskSpaceMb} MB, needed ${minimumDiskSpaceMb} MB).` - ); - return false; - } - return true; -} -async function runnerHasSufficientMemory(codeql, ramInput, logger) { - if (await codeQlVersionAtLeast( - codeql, - CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE - )) { - logger.debug( - `Skipping memory check for overlay analysis because CodeQL version is at least ${CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE}.` - ); - return true; - } - const memoryFlagValue = getCodeQLMemoryLimit(ramInput, logger); - if (memoryFlagValue < OVERLAY_MINIMUM_MEMORY_MB) { - logger.info( - `Setting overlay database mode to ${"none" /* None */} due to insufficient memory for CodeQL analysis (${memoryFlagValue} MB, needed ${OVERLAY_MINIMUM_MEMORY_MB} MB).` - ); - return false; - } - logger.debug( - `Memory available for CodeQL analysis is ${memoryFlagValue} MB, which is above the minimum of ${OVERLAY_MINIMUM_MEMORY_MB} MB.` - ); - return true; -} -async function checkRunnerResources(codeql, diskUsage, ramInput, logger) { - if (!runnerHasSufficientDiskSpace(diskUsage, logger)) { - return new Failure("insufficient-disk-space" /* InsufficientDiskSpace */); - } - if (!await runnerHasSufficientMemory(codeql, ramInput, logger)) { - return new Failure("insufficient-memory" /* InsufficientMemory */); - } - return new Success(void 0); -} -async function checkOverlayEnablement(codeql, features, languages, sourceRoot, buildMode, ramInput, codeScanningConfig, repositoryProperties, gitVersion, logger) { - const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE; - if (modeEnv === "overlay" /* Overlay */ || modeEnv === "overlay-base" /* OverlayBase */ || modeEnv === "none" /* None */) { - logger.info( - `Setting overlay database mode to ${modeEnv} from the CODEQL_OVERLAY_DATABASE_MODE environment variable.` - ); - if (modeEnv === "none" /* None */) { - return new Failure("disabled-by-environment-variable" /* DisabledByEnvironmentVariable */); - } - return validateOverlayDatabaseMode( - modeEnv, - false, - true, - codeql, - languages, - sourceRoot, - buildMode, - gitVersion, - logger - ); - } - if (repositoryProperties["github-codeql-disable-overlay" /* DISABLE_OVERLAY */] === true) { - logger.info( - `Setting overlay database mode to ${"none" /* None */} because the ${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */} repository property is set to true.` - ); - return new Failure("disabled-by-repository-property" /* DisabledByRepositoryProperty */); - } - const featureResult = await checkOverlayAnalysisFeatureEnabled( - features, - codeql, - languages, - codeScanningConfig - ); - if (featureResult.isFailure()) { - return featureResult; - } - const performResourceChecks = !await features.getValue( - "overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */, - codeql - ); - const checkOverlayStatus = await features.getValue( - "overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */ - ); - const needDiskUsage = performResourceChecks || checkOverlayStatus; - const diskUsage = needDiskUsage ? await checkDiskUsage(logger) : void 0; - if (needDiskUsage && diskUsage === void 0) { - logger.warning( - `Unable to determine disk usage, therefore setting overlay database mode to ${"none" /* None */}.` - ); - return new Failure("unable-to-determine-disk-usage" /* UnableToDetermineDiskUsage */); - } - const resourceResult = performResourceChecks && diskUsage !== void 0 ? await checkRunnerResources(codeql, diskUsage, ramInput, logger) : new Success(void 0); - if (resourceResult.isFailure()) { - return resourceResult; - } - if (checkOverlayStatus && diskUsage !== void 0 && await shouldSkipOverlayAnalysis(codeql, languages, diskUsage, logger)) { - logger.info( - `Setting overlay database mode to ${"none" /* None */} because overlay analysis previously failed with this combination of languages, disk space, and CodeQL version.` - ); - return new Failure("skipped-due-to-cached-status" /* SkippedDueToCachedStatus */); - } - let overlayDatabaseMode; - if (isAnalyzingPullRequest()) { - overlayDatabaseMode = "overlay" /* Overlay */; - logger.info( - `Setting overlay database mode to ${overlayDatabaseMode} with caching because we are analyzing a pull request.` - ); - } else if (await isAnalyzingDefaultBranch()) { - overlayDatabaseMode = "overlay-base" /* OverlayBase */; - logger.info( - `Setting overlay database mode to ${overlayDatabaseMode} with caching because we are analyzing the default branch.` - ); - } else { - return new Failure("not-pull-request-or-default-branch" /* NotPullRequestOrDefaultBranch */); - } - return validateOverlayDatabaseMode( - overlayDatabaseMode, - true, - false, - codeql, - languages, - sourceRoot, - buildMode, - gitVersion, - logger - ); -} -async function validateOverlayDatabaseMode(overlayDatabaseMode, useOverlayDatabaseCaching, overlayModeSetExplicitly, codeql, languages, sourceRoot, buildMode, gitVersion, logger) { - if (buildMode !== "none" /* None */ && (await Promise.all( - languages.map( - async (l) => l !== "go" /* go */ && // Workaround to allow overlay analysis for Go with any build - // mode, since it does not yet support BMN. The Go autobuilder and/or extractor will - // ensure that overlay-base databases are only created for supported Go build setups, - // and that we'll fall back to full databases in other cases. - await codeql.isTracedLanguage(l) - ) - )).some(Boolean)) { - logger.warning( - `Cannot build an ${overlayDatabaseMode} database because build-mode is set to "${buildMode}" instead of "none". Falling back to creating a normal full database instead.` - ); - return new Failure("incompatible-build-mode" /* IncompatibleBuildMode */); - } - if (!await codeQlVersionAtLeast(codeql, CODEQL_OVERLAY_MINIMUM_VERSION)) { - logger.warning( - `Cannot build an ${overlayDatabaseMode} database because the CodeQL CLI is older than ${CODEQL_OVERLAY_MINIMUM_VERSION}. Falling back to creating a normal full database instead.` - ); - return new Failure("incompatible-codeql" /* IncompatibleCodeQl */); - } - const gitRoot = await getGitRoot(sourceRoot); - if (gitRoot === void 0) { - logger.warning( - `Cannot build an ${overlayDatabaseMode} database because the source root "${sourceRoot}" is not inside a git repository. Falling back to creating a normal full database instead.` - ); - return new Failure("no-git-root" /* NoGitRoot */); - } - if (hasSubmodules(gitRoot)) { - if (gitVersion === void 0) { - logger.warning( - `Cannot build an ${overlayDatabaseMode} database because the repository has submodules and the Git version could not be determined. Falling back to creating a normal full database instead.` - ); - return new Failure("incompatible-git" /* IncompatibleGit */); - } - if (!gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES)) { - logger.warning( - `Cannot build an ${overlayDatabaseMode} database because the repository has submodules and the installed Git version is older than ${GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES}. Falling back to creating a normal full database instead.` - ); - return new Failure("incompatible-git" /* IncompatibleGit */); - } - } - return new Success({ - overlayDatabaseMode, - useOverlayDatabaseCaching, - overlayModeSetExplicitly - }); -} -async function isTrapCachingEnabled(features, overlayDatabaseMode) { - const trapCaching = getOptionalInput("trap-caching"); - if (trapCaching !== void 0) return trapCaching === "true"; - if (!isHostedRunner()) return false; - if (overlayDatabaseMode !== "none" /* None */ && await features.getValue("overlay_analysis_disable_trap_caching" /* OverlayAnalysisDisableTrapCaching */)) { - return false; - } - return true; -} -async function setCppTrapCachingEnvironmentVariables(config, logger) { - if (config.languages.includes("cpp" /* cpp */)) { - const envVar = "CODEQL_EXTRACTOR_CPP_TRAP_CACHING"; - if (process.env[envVar]) { - logger.info( - `Environment variable ${envVar} already set, leaving it unchanged.` - ); - } else if (config.trapCaches["cpp" /* cpp */]) { - logger.info("Enabling TRAP caching for C/C++."); - core10.exportVariable(envVar, "true"); - } else { - logger.debug(`Disabling TRAP caching for C/C++.`); - core10.exportVariable(envVar, "false"); - } - } -} -function dbLocationOrDefault(dbLocation, tempDir) { - return dbLocation || path11.resolve(tempDir, "codeql_databases"); -} -function userConfigFromActionPath(tempDir) { - return path11.resolve(tempDir, "user-config-from-action.yml"); -} -function hasQueryCustomisation(userConfig) { - return isDefined2(userConfig["disable-default-queries"]) || isDefined2(userConfig.queries) || isDefined2(userConfig["query-filters"]); -} -async function applyIncrementalAnalysisSettings(config, hasDiffRanges, codeql, logger) { - if (config.overlayDatabaseMode === "overlay" /* Overlay */ && !hasDiffRanges && !config.overlayModeSetExplicitly) { - logger.info( - `Reverting overlay database mode to ${"none" /* None */} because the PR diff ranges could not be computed.` - ); - config.overlayDatabaseMode = "none" /* None */; - config.useOverlayDatabaseCaching = false; - await addOverlayDisablementDiagnostics( - config, - codeql, - "diff-informed-analysis-not-enabled" /* DiffInformedAnalysisNotEnabled */ - ); - } - if (hasDiffRanges) { - config.extraQueryExclusions.push({ - exclude: { tags: "exclude-from-incremental" } - }); - } -} -async function determineUserConfig(action, tempDir, inputs) { - const validateConfig = await action.features.getValue( - "validate_db_config" /* ValidateDbConfig */ - ); - if (inputs.configInput) { - const computedConfigPath = userConfigFromActionPath(tempDir); - const allowMergeConfigs = () => action.features.getValue("allow_merge_config_files" /* AllowMergeConfigFiles */); - if (inputs.configFile && isDefaultSetup(action.env) && await allowMergeConfigs()) { - const fromConfigInput = parseUserConfig( - action.logger, - "`config` input", - inputs.configInput, - validateConfig - ); - const fromConfigFile = await loadUserConfig( - action, - inputs.configFile, - inputs.workspacePath, - inputs.apiDetails, - tempDir - ); - const mergedConfig = mergeDefaultSetupAndUserConfigs( - action.logger, - fromConfigInput, - fromConfigFile - ); - fs10.writeFileSync(computedConfigPath, dump(mergedConfig)); - action.logger.debug( - `Using merged configurations from 'config' input with configuration from '${inputs.configFile}': ${computedConfigPath}` - ); - inputs.configFile = computedConfigPath; - return mergedConfig; - } else { - if (inputs.configFile) { - action.logger.warning( - `Both a config file and config input were provided. Ignoring config file.` - ); - } - fs10.writeFileSync(computedConfigPath, inputs.configInput); - inputs.configFile = computedConfigPath; - action.logger.debug( - `Using config from action input: ${inputs.configFile}` - ); - } - } - if (!inputs.configFile) { - action.logger.debug("No configuration file was provided"); - return {}; - } else { - action.logger.debug(`Using configuration file: ${inputs.configFile}`); - return await loadUserConfig( - action, - inputs.configFile, - inputs.workspacePath, - inputs.apiDetails, - tempDir - ); - } -} -async function initConfig(actionState, inputs) { - const { logger, features } = actionState; - const { tempDir } = inputs; - const userConfig = await determineUserConfig(actionState, tempDir, inputs); - const config = await initActionState(inputs, userConfig); - if (config.analysisKinds.length === 1 && isCodeQualityEnabled(config)) { - if (hasQueryCustomisation(config.computedConfig)) { - throw new ConfigurationError( - "Query customizations are unsupported, because only `code-quality` analysis is enabled." - ); - } - const queries = codeQualityQueries.map((v) => ({ uses: v })); - config.computedConfig["disable-default-queries"] = true; - config.computedConfig.queries = queries; - config.computedConfig["query-filters"] = []; - } - let gitVersion = void 0; - try { - gitVersion = await getGitVersionOrThrow(); - logger.info(`Using Git version ${gitVersion.fullVersion}`); - } catch (e) { - logger.warning(`Could not determine Git version: ${getErrorMessage(e)}`); - if (isInTestMode() && process.env["CODEQL_ACTION_TOLERATE_MISSING_GIT_VERSION" /* TOLERATE_MISSING_GIT_VERSION */] !== "true") { - throw e; - } - } - if (await features.getValue("ignore_generated_files" /* IgnoreGeneratedFiles */) && isDynamicWorkflow()) { - try { - const generatedFilesCheckStartedAt = import_perf_hooks.performance.now(); - const generatedFiles = await getGeneratedFiles(inputs.sourceRoot); - const generatedFilesDuration = Math.round( - import_perf_hooks.performance.now() - generatedFilesCheckStartedAt - ); - if (generatedFiles.length > 0) { - config.computedConfig["paths-ignore"] ??= []; - config.computedConfig["paths-ignore"].push(...generatedFiles); - logger.info( - `Detected ${generatedFiles.length} generated file(s), which will be excluded from analysis: ${joinAtMost(generatedFiles, ", ", 10)}` - ); - } else { - logger.info(`Found no generated files.`); - } - await logGeneratedFilesTelemetry( - config, - generatedFilesDuration, - generatedFiles.length - ); - } catch (error3) { - logger.info(`Cannot ignore generated files: ${getErrorMessage(error3)}`); - } - } else { - logger.debug(`Skipping check for generated files.`); - } - const overlayDatabaseModeResult = await checkOverlayEnablement( - inputs.codeql, - inputs.features, - config.languages, - inputs.sourceRoot, - config.buildMode, - inputs.ramInput, - config.computedConfig, - config.repositoryProperties, - gitVersion, - logger - ); - if (overlayDatabaseModeResult.isSuccess()) { - const { - overlayDatabaseMode, - useOverlayDatabaseCaching, - overlayModeSetExplicitly - } = overlayDatabaseModeResult.value; - logger.info( - `Using overlay database mode: ${overlayDatabaseMode} ${useOverlayDatabaseCaching ? "with" : "without"} caching.` - ); - config.overlayDatabaseMode = overlayDatabaseMode; - config.useOverlayDatabaseCaching = useOverlayDatabaseCaching; - config.overlayModeSetExplicitly = overlayModeSetExplicitly; - } else { - const overlayDisabledReason = overlayDatabaseModeResult.value; - logger.info( - `Using overlay database mode: ${"none" /* None */} without caching.` - ); - config.overlayDatabaseMode = "none" /* None */; - config.useOverlayDatabaseCaching = false; - await addOverlayDisablementDiagnostics( - config, - inputs.codeql, - overlayDisabledReason - ); - } - const hasDiffRanges = await prepareDiffInformedAnalysis( - inputs.codeql, - inputs.features, - logger - ); - await applyIncrementalAnalysisSettings( - config, - hasDiffRanges, - inputs.codeql, - logger - ); - if (await isTrapCachingEnabled(features, config.overlayDatabaseMode)) { - const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime( - inputs.codeql, - config.languages, - logger - ); - config.trapCaches = trapCaches; - config.trapCacheDownloadTime = trapCacheDownloadTime; - } - await setCppTrapCachingEnvironmentVariables(config, logger); - return config; -} -function isExplicitLocalPath(configPath) { - return configPath.startsWith(LOCAL_PATH_PREFIX); -} -function isExplicitRemotePath(configPath) { - return configPath.startsWith(REMOTE_PATH_PREFIX); -} -function containsAtRef(configPath) { - return configPath.includes("@"); -} -function isLocal(configPath) { - if (isExplicitLocalPath(configPath)) { - return true; - } - if (isExplicitRemotePath(configPath)) { - return false; - } - return !containsAtRef(configPath); -} -function getLocalConfig(logger, configFile, validateConfig) { - if (!fs10.existsSync(configFile)) { - throw new ConfigurationError( - getConfigFileDoesNotExistErrorMessage(configFile) - ); - } - return parseUserConfig( - logger, - configFile, - fs10.readFileSync(configFile, "utf-8"), - validateConfig - ); -} -function getPathToParsedConfigFile(tempDir) { - return path11.join(tempDir, "config"); -} -async function saveConfig(config, logger) { - const configString = JSON.stringify(config); - const configFile = getPathToParsedConfigFile(config.tempDir); - fs10.mkdirSync(path11.dirname(configFile), { recursive: true }); - fs10.writeFileSync(configFile, configString, "utf8"); - logger.debug("Saved config:"); - logger.debug(configString); -} -async function getConfig(tempDir, logger) { - const configFile = getPathToParsedConfigFile(tempDir); - if (!fs10.existsSync(configFile)) { - return void 0; - } - const configString = fs10.readFileSync(configFile, "utf8"); - logger.debug("Loaded config:"); - logger.debug(configString); - const config = JSON.parse(configString); - if (config.version === void 0) { - throw new ConfigurationError( - `Loaded configuration file, but it does not contain the expected 'version' field.` - ); - } - if (config.version !== getActionVersion()) { - throw new ConfigurationError( - `Loaded a configuration file for version '${config.version}', but running version '${getActionVersion()}'` - ); - } - return config; -} -async function generateRegistries(registriesInput, tempDir, logger) { - const registries = parseRegistries(registriesInput); - let registriesAuthTokens; - let qlconfigFile; - if (registries) { - const qlconfig = createRegistriesBlock(registries); - qlconfigFile = path11.join(tempDir, "qlconfig.yml"); - const qlconfigContents = dump(qlconfig); - fs10.writeFileSync(qlconfigFile, qlconfigContents, "utf8"); - logger.debug("Generated qlconfig.yml:"); - logger.debug(qlconfigContents); - registriesAuthTokens = registries.map((registry) => `${registry.url}=${registry.token}`).join(","); - } - if (typeof process.env.CODEQL_REGISTRIES_AUTH === "string") { - logger.debug( - "Using CODEQL_REGISTRIES_AUTH environment variable to authenticate with registries." - ); - } - return { - registriesAuthTokens: ( - // if the user has explicitly set the CODEQL_REGISTRIES_AUTH env var then use that - process.env.CODEQL_REGISTRIES_AUTH ?? registriesAuthTokens - ), - qlconfigFile - }; -} -function createRegistriesBlock(registries) { - if (!Array.isArray(registries) || registries.some((r) => !r.url || !r.packages)) { - throw new ConfigurationError( - "Invalid 'registries' input. Must be an array of objects with 'url' and 'packages' properties." - ); - } - const safeRegistries = registries.map((registry) => ({ - // ensure the url ends with a slash to avoid a bug in the CLI 2.10.4 - url: !registry?.url.endsWith("/") ? `${registry.url}/` : registry.url, - packages: registry.packages, - kind: registry.kind - })); - const qlconfig = { - registries: safeRegistries - }; - return qlconfig; -} -async function wrapEnvironment(env, operation) { - const oldEnv = { ...process.env }; - for (const [key, value] of Object.entries(env)) { - if (value !== void 0) { - process.env[key] = value; - } - } - try { - await operation(); - } finally { - for (const [key, value] of Object.entries(oldEnv)) { - process.env[key] = value; - } - } -} -async function parseBuildModeInput(input, languages, features, logger) { - if (input === void 0) { - return void 0; - } - if (!Object.values(BuildMode).includes(input)) { - throw new ConfigurationError( - `Invalid build mode: '${input}'. Supported build modes are: ${Object.values( - BuildMode - ).join(", ")}.` - ); - } - if (languages.includes("csharp" /* csharp */) && await features.getValue("disable_csharp_buildless" /* DisableCsharpBuildless */)) { - logger.warning( - "Scanning C# code without a build is temporarily unavailable. Falling back to 'autobuild' build mode." - ); - return "autobuild" /* Autobuild */; - } - if (languages.includes("java" /* java */) && await features.getValue("disable_java_buildless_enabled" /* DisableJavaBuildlessEnabled */)) { - logger.warning( - "Scanning Java code without a build is temporarily unavailable. Falling back to 'autobuild' build mode." - ); - return "autobuild" /* Autobuild */; - } - return input; -} -function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { - const augmentedConfig = cloneObject(cliConfig); - if (extraQueryExclusions.length === 0) { - return augmentedConfig; - } - augmentedConfig["query-filters"] = [ - // Ordering matters. If the first filter is an inclusion, it implicitly - // excludes all queries that are not included. If it is an exclusion, - // it implicitly includes all queries that are not excluded. So user - // filters (if any) should always be first to preserve intent. - ...augmentedConfig["query-filters"] || [], - ...extraQueryExclusions - ]; - if (augmentedConfig["query-filters"]?.length === 0) { - delete augmentedConfig["query-filters"]; - } - return augmentedConfig; -} -function isCodeScanningEnabled(config) { - return config.analysisKinds.includes("code-scanning" /* CodeScanning */); -} -function isCodeQualityEnabled(config) { - return config.analysisKinds.includes("code-quality" /* CodeQuality */); -} -function isRiskAssessmentEnabled(config) { - return config.analysisKinds.includes("risk-assessment" /* RiskAssessment */); -} -function getPrimaryAnalysisKind(config) { - if (config.analysisKinds.length === 1) { - return config.analysisKinds[0]; - } - return isCodeScanningEnabled(config) ? "code-scanning" /* CodeScanning */ : "code-quality" /* CodeQuality */; -} -function getPrimaryAnalysisConfig(config) { - return getAnalysisConfig(getPrimaryAnalysisKind(config)); -} -async function logGeneratedFilesTelemetry(config, duration, generatedFilesCount) { - if (config.languages.length < 1) { - return; - } - addNoLanguageDiagnostic( - config, - makeTelemetryDiagnostic( - "codeql-action/generated-files-telemetry", - "Generated files telemetry", - { - duration, - generatedFilesCount - } - ) - ); -} - -// src/setup-codeql.ts -var fs14 = __toESM(require("fs")); -var path13 = __toESM(require("path")); -var toolcache3 = __toESM(require_tool_cache()); -var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver9 = __toESM(require_semver2()); - -// src/overlay/caching.ts -var fs11 = __toESM(require("fs")); -var actionsCache3 = __toESM(require_cache4()); -var semver6 = __toESM(require_semver2()); -var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; -var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; -var CACHE_VERSION2 = 1; -var CACHE_PREFIX = "codeql-overlay-base-database"; -var MAX_CACHE_OPERATION_MS3 = 6e5; -async function checkOverlayBaseDatabase(codeql, config, logger, warningPrefix) { - const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); - if (!fs11.existsSync(baseDatabaseOidsFilePath)) { - logger.warning( - `${warningPrefix}: ${baseDatabaseOidsFilePath} does not exist` - ); - return false; - } - for (const language of config.languages) { - const dbPath = getCodeQLDatabasePath(config, language); - try { - const resolveDatabaseOutput = await codeql.resolveDatabase(dbPath); - if (resolveDatabaseOutput === void 0 || !("overlayBaseSpecifier" in resolveDatabaseOutput)) { - logger.info(`${warningPrefix}: no overlayBaseSpecifier defined`); - return false; - } else { - logger.debug( - `Overlay base specifier for ${language} overlay-base database found: ${resolveDatabaseOutput.overlayBaseSpecifier}` - ); - } - } catch (e) { - logger.warning(`${warningPrefix}: failed to resolve database: ${e}`); - return false; - } - } - return true; -} -async function cleanupAndUploadOverlayBaseDatabaseToCache(codeql, config, logger) { - const overlayDatabaseMode = config.overlayDatabaseMode; - if (overlayDatabaseMode !== "overlay-base" /* OverlayBase */) { - logger.debug( - `Overlay database mode is ${overlayDatabaseMode}. Skip uploading overlay-base database to cache.` - ); - return false; - } - if (!config.useOverlayDatabaseCaching) { - logger.debug( - "Overlay database caching is disabled. Skip uploading overlay-base database to cache." - ); - return false; - } - if (isInTestMode()) { - logger.debug( - "In test mode. Skip uploading overlay-base database to cache." - ); - return false; - } - const databaseIsValid = await checkOverlayBaseDatabase( - codeql, - config, - logger, - "Abort uploading overlay-base database to cache" - ); - if (!databaseIsValid) { - return false; - } - await withGroupAsync("Cleaning up databases", async () => { - await codeql.databaseCleanupCluster(config, "overlay" /* Overlay */); - }); - const dbLocation = config.dbLocation; - const databaseSizeBytes = await tryGetFolderBytes(dbLocation, logger); - if (databaseSizeBytes === void 0) { - logger.warning( - "Failed to determine database size. Skip uploading overlay-base database to cache." - ); - return false; - } - if (databaseSizeBytes > OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES) { - const databaseSizeMB = Math.round(databaseSizeBytes / 1e6); - logger.warning( - `Database size (${databaseSizeMB} MB) exceeds maximum upload size (${OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB} MB). Skip uploading overlay-base database to cache.` - ); - return false; - } - const codeQlVersion = (await codeql.getVersion()).version; - const checkoutPath = getRequiredInput("checkout_path"); - const cacheSaveKey = await getCacheSaveKey( - config, - codeQlVersion, - checkoutPath, - logger - ); - logger.info( - `Uploading overlay-base database to Actions cache with key ${cacheSaveKey}` - ); - try { - const cacheId = await waitForResultWithTimeLimit( - MAX_CACHE_OPERATION_MS3, - actionsCache3.saveCache([dbLocation], cacheSaveKey), - () => { - } - ); - if (cacheId === void 0) { - logger.warning("Timed out while uploading overlay-base database"); - return false; - } - } catch (error3) { - logger.warning( - `Failed to upload overlay-base database to cache: ${error3 instanceof Error ? error3.message : String(error3)}` - ); - return false; - } - logger.info(`Successfully uploaded overlay-base database from ${dbLocation}`); - return true; -} -async function downloadOverlayBaseDatabaseFromCache(codeql, config, logger) { - const overlayDatabaseMode = config.overlayDatabaseMode; - if (overlayDatabaseMode !== "overlay" /* Overlay */) { - logger.debug( - `Overlay database mode is ${overlayDatabaseMode}. Skip downloading overlay-base database from cache.` - ); - return void 0; - } - if (!config.useOverlayDatabaseCaching) { - logger.debug( - "Overlay database caching is disabled. Skip downloading overlay-base database from cache." - ); - return void 0; - } - if (isInTestMode()) { - logger.debug( - "In test mode. Skip downloading overlay-base database from cache." - ); - return void 0; - } - const dbLocation = config.dbLocation; - const codeQlVersion = (await codeql.getVersion()).version; - const cacheRestoreKeyPrefix = await getCacheRestoreKeyPrefix( - config, - codeQlVersion - ); - logger.info( - `Looking in Actions cache for overlay-base database with restore key ${cacheRestoreKeyPrefix}` - ); - let databaseDownloadDurationMs = 0; - try { - const databaseDownloadStart = performance.now(); - const foundKey = await waitForResultWithTimeLimit( - // This ten-minute limit for the cache restore operation is mainly to - // guard against the possibility that the cache service is unresponsive - // and hangs outside the data download. - // - // Data download (which is normally the most time-consuming part of the - // restore operation) should not run long enough to hit this limit. Even - // for an extremely large 10GB database, at a download speed of 40MB/s - // (see below), the download should complete within five minutes. If we - // do hit this limit, there are likely more serious problems other than - // mere slow download speed. - // - // This is important because we don't want any ongoing file operations - // on the database directory when we do hit this limit. Hitting this - // time limit takes us to a fallback path where we re-initialize the - // database from scratch at dbLocation, and having the cache restore - // operation continue to write into dbLocation in the background would - // really mess things up. We want to hit this limit only in the case - // of a hung cache service, not just slow download speed. - MAX_CACHE_OPERATION_MS3, - actionsCache3.restoreCache( - [dbLocation], - cacheRestoreKeyPrefix, - void 0, - { - // Azure SDK download (which is the default) uses 128MB segments; see - // https://github.com/actions/toolkit/blob/main/packages/cache/README.md. - // Setting segmentTimeoutInMs to 3000 translates to segment download - // speed of about 40 MB/s, which should be achievable unless the - // download is unreliable (in which case we do want to abort). - segmentTimeoutInMs: 3e3 - } - ), - () => { - logger.info("Timed out downloading overlay-base database from cache"); - } - ); - databaseDownloadDurationMs = Math.round( - performance.now() - databaseDownloadStart - ); - if (foundKey === void 0) { - logger.info("No overlay-base database found in Actions cache"); - return void 0; - } - logger.info( - `Downloaded overlay-base database in cache with key ${foundKey}` - ); - } catch (error3) { - logger.warning( - `Failed to download overlay-base database from cache: ${error3 instanceof Error ? error3.message : String(error3)}` - ); - return void 0; - } - const databaseIsValid = await checkOverlayBaseDatabase( - codeql, - config, - logger, - "Downloaded overlay-base database is invalid" - ); - if (!databaseIsValid) { - logger.warning("Downloaded overlay-base database failed validation"); - return void 0; - } - const databaseSizeBytes = await tryGetFolderBytes(dbLocation, logger); - if (databaseSizeBytes === void 0) { - logger.info( - "Filesystem error while accessing downloaded overlay-base database" - ); - return void 0; - } - logger.info(`Successfully downloaded overlay-base database to ${dbLocation}`); - return { - databaseSizeBytes: Math.round(databaseSizeBytes), - databaseDownloadDurationMs - }; -} -async function getCacheSaveKey(config, codeQlVersion, checkoutPath, logger) { - let runId = 1; - let attemptId = 1; - try { - runId = getWorkflowRunID(); - attemptId = getWorkflowRunAttempt(); - } catch (e) { - logger.warning( - `Failed to get workflow run ID or attempt ID. Reason: ${getErrorMessage(e)}` - ); - } - const sha = await getCommitOid(checkoutPath); - const restoreKeyPrefix = await getCacheRestoreKeyPrefix( - config, - codeQlVersion - ); - return `${restoreKeyPrefix}${sha}-${runId}-${attemptId}`; -} -async function getCacheRestoreKeyPrefix(config, codeQlVersion) { - return `${await getCacheKeyPrefixBase(config.languages)}${codeQlVersion}-`; -} -async function getCacheKeyPrefixBase(parsedLanguages) { - const languagesComponent = [...parsedLanguages].sort().join("_"); - const cacheKeyComponents = { - automationID: await getAutomationID() - // Add more components here as needed in the future - }; - const componentsHash = createCacheKeyHash(cacheKeyComponents); - return `${CACHE_PREFIX}-${CACHE_VERSION2}-${componentsHash}-${languagesComponent}-`; -} -async function getCodeQlVersionsForOverlayBaseDatabases(rawLanguages, logger) { - const languages = rawLanguages.map(parseBuiltInLanguage); - if (languages.includes(void 0)) { - logger.warning( - "One or more provided languages are not recognized as built-in languages. Skipping searching for overlay-base databases in cache." - ); - return void 0; - } - const dedupedLanguages = [ - ...new Set(languages.filter((l) => l !== void 0)) - ]; - const cacheKeyPrefix = await getCacheKeyPrefixBase(dedupedLanguages); - logger.debug( - `Searching for overlay-base databases in Actions cache with prefix ${cacheKeyPrefix}` - ); - const caches = await listActionsCaches(cacheKeyPrefix); - if (caches.length === 0) { - logger.info("No overlay-base databases found in Actions cache."); - return []; - } - logger.info( - `Found ${caches.length} overlay-base ${caches.length === 1 ? "database" : "databases"} in the Actions cache.` - ); - const versionRegex = /^([\d.]+)-/; - const versionSet = /* @__PURE__ */ new Set(); - for (const cache of caches) { - if (!cache.key) continue; - const suffix = cache.key.substring(cacheKeyPrefix.length); - const match2 = suffix.match(versionRegex); - if (match2 && semver6.valid(match2[1])) { - versionSet.add(match2[1]); - } - } - if (versionSet.size === 0) { - logger.info( - "Could not parse any CodeQL versions from overlay-base database cache keys." - ); - return []; - } - const versions = [...versionSet].sort(semver6.rcompare); - logger.info( - `Found overlay databases for the following CodeQL versions in the Actions cache: ${versions.join(", ")}` - ); - return versions; -} - -// src/tar.ts -var import_child_process = require("child_process"); -var fs12 = __toESM(require("fs")); -var stream = __toESM(require("stream")); -var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io()); -var toolcache = __toESM(require_tool_cache()); -var semver7 = __toESM(require_semver2()); -var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; -var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; -async function getTarVersion() { - const tar = await io4.which("tar", true); - let stdout = ""; - const exitCode = await new import_toolrunner.ToolRunner(tar, ["--version"], { - listeners: { - stdout: (data) => { - stdout += data.toString(); - } - } - }).exec(); - if (exitCode !== 0) { - throw new Error("Failed to call tar --version"); - } - if (stdout.includes("GNU tar")) { - const match2 = stdout.match(/tar \(GNU tar\) ([0-9.]+)/); - if (!match2?.[1]) { - throw new Error("Failed to parse output of tar --version."); - } - return { type: "gnu", version: match2[1] }; - } else if (stdout.includes("bsdtar")) { - const match2 = stdout.match(/bsdtar ([0-9.]+)/); - if (!match2?.[1]) { - throw new Error("Failed to parse output of tar --version."); - } - return { type: "bsd", version: match2[1] }; - } else { - throw new Error("Unknown tar version"); - } -} -async function isZstdAvailable(logger) { - const foundZstdBinary = await isBinaryAccessible("zstd", logger); - try { - const tarVersion = await getTarVersion(); - const { type, version } = tarVersion; - logger.info(`Found ${type} tar version ${version}.`); - switch (type) { - case "gnu": - return { - available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver7.gte( - semver7.coerce(version), - semver7.coerce(MIN_REQUIRED_GNU_TAR_VERSION) - ), - foundZstdBinary, - version: tarVersion - }; - case "bsd": - return { - available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain - // a patch version number. - semver7.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), - foundZstdBinary, - version: tarVersion - }; - default: - assertNever(type); - } - } catch (e) { - logger.warning( - `Failed to determine tar version, therefore will assume zstd is not available. The underlying error was: ${e}` - ); - return { available: false, foundZstdBinary }; - } -} -async function extract(tarPath, dest, compressionMethod, tarVersion, logger) { - fs12.mkdirSync(dest, { recursive: true }); - switch (compressionMethod) { - case "gzip": - return await toolcache.extractTar(tarPath, dest); - case "zstd": { - if (!tarVersion) { - throw new Error( - "Could not determine tar version, which is required to extract a Zstandard archive." - ); - } - await extractTarZst(tarPath, dest, tarVersion, logger); - return dest; - } - } -} -async function extractTarZst(tar, dest, tarVersion, logger) { - logger.debug( - `Extracting to ${dest}.${tar instanceof stream.Readable ? ` Input stream has high water mark ${tar.readableHighWaterMark}.` : ""}` - ); - try { - const args = ["-x", "--zstd", "--ignore-zeros"]; - if (tarVersion.type === "gnu") { - args.push("--warning=no-unknown-keyword"); - args.push("--overwrite"); - } - args.push("-f", tar instanceof stream.Readable ? "-" : tar, "-C", dest); - process.stdout.write(`[command]tar ${args.join(" ")} -`); - await new Promise((resolve14, reject) => { - const tarProcess = (0, import_child_process.spawn)("tar", args, { stdio: "pipe" }); - let stdout = ""; - tarProcess.stdout?.on("data", (data) => { - stdout += data.toString(); - process.stdout.write(data); - }); - let stderr = ""; - tarProcess.stderr?.on("data", (data) => { - stderr += data.toString(); - process.stdout.write(data); - }); - tarProcess.on("error", (err) => { - reject(new Error(`Error while extracting tar: ${err}`)); - }); - if (tar instanceof stream.Readable) { - stream.pipeline(tar, tarProcess.stdin, (err) => { - if (err) { - reject( - new Error(`Error while downloading and extracting tar: ${err}`) - ); - } - }); - } - tarProcess.on("exit", (code) => { - if (code !== 0) { - reject( - new CommandInvocationError( - "tar", - args, - code ?? void 0, - stdout, - stderr - ) - ); - } - resolve14(); - }); - }); - } catch (e) { - await cleanUpPath(dest, "extraction destination directory", logger); - throw e; - } -} -var KNOWN_EXTENSIONS = { - "tar.gz": "gzip", - "tar.zst": "zstd" -}; -function inferCompressionMethod(tarPath) { - for (const [ext2, method] of Object.entries(KNOWN_EXTENSIONS)) { - if (tarPath.endsWith(`.${ext2}`)) { - return method; - } - } - return void 0; -} - -// src/tools-download.ts -var fs13 = __toESM(require("fs")); -var os4 = __toESM(require("os")); -var path12 = __toESM(require("path")); -var import_perf_hooks2 = require("perf_hooks"); -var core11 = __toESM(require_core()); -var import_http_client = __toESM(require_lib()); -var toolcache2 = __toESM(require_tool_cache()); -var import_follow_redirects = __toESM(require_follow_redirects()); -var semver8 = __toESM(require_semver2()); -var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; -var STREAMING_STALL_TIMEOUT_MS = 5 * 60 * 1e3; -var TOOLCACHE_TOOL_NAME = "CodeQL"; -async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorization, headers, tarVersion, logger) { - logger.info( - `Downloading CodeQL tools from ${codeqlURL} . This may take a while.` - ); - try { - if (compressionMethod === "zstd" && process.platform === "linux") { - logger.info(`Streaming the extraction of the CodeQL bundle.`); - const toolsInstallStart = import_perf_hooks2.performance.now(); - await downloadAndExtractZstdWithStreaming( - codeqlURL, - dest, - authorization, - headers, - tarVersion, - logger - ); - const combinedDurationMs = Math.round( - import_perf_hooks2.performance.now() - toolsInstallStart - ); - logger.info( - `Finished downloading and extracting CodeQL bundle to ${dest} (${formatDuration( - combinedDurationMs - )}).` - ); - return {}; - } - } catch (e) { - core11.warning( - `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` - ); - core11.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpPath(dest, "CodeQL bundle", logger); - } - const toolsDownloadStart = import_perf_hooks2.performance.now(); - const archivedBundlePath = await toolcache2.downloadTool( - codeqlURL, - void 0, - authorization, - headers - ); - const downloadDurationMs = Math.round(import_perf_hooks2.performance.now() - toolsDownloadStart); - logger.info( - `Finished downloading CodeQL bundle to ${archivedBundlePath} (${formatDuration( - downloadDurationMs - )}).` - ); - let extractionDurationMs; - try { - logger.info("Extracting CodeQL bundle."); - const extractionStart = import_perf_hooks2.performance.now(); - await extract( - archivedBundlePath, - dest, - compressionMethod, - tarVersion, - logger - ); - extractionDurationMs = Math.round(import_perf_hooks2.performance.now() - extractionStart); - logger.info( - `Finished extracting CodeQL bundle to ${dest} (${formatDuration( - extractionDurationMs - )}).` - ); - } finally { - await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); - } - return { downloadDurationMs }; -} -async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorization, headers, tarVersion, logger) { - fs13.mkdirSync(dest, { recursive: true }); - const agent = new import_http_client.HttpClient().getAgent(codeqlURL); - headers = Object.assign( - { "User-Agent": "CodeQL Action" }, - authorization ? { authorization } : {}, - headers - ); - const response = await new Promise((resolve14, reject) => { - const request3 = import_follow_redirects.https.get( - codeqlURL, - { - headers, - // Increase the high water mark to improve performance. - highWaterMark: STREAMING_HIGH_WATERMARK_BYTES, - // Use the agent to respect proxy settings. - agent - }, - (r) => resolve14(r) - ); - request3.on("error", reject); - request3.setTimeout(STREAMING_STALL_TIMEOUT_MS, () => { - request3.destroy( - new Error( - `No data received for ${formatDuration(STREAMING_STALL_TIMEOUT_MS)}.` - ) - ); - }); - }); - if (response.statusCode !== 200) { - response.resume(); - throw new Error( - `Failed to download CodeQL bundle from ${codeqlURL}. HTTP status code: ${response.statusCode}.` - ); - } - await extractTarZst(response, dest, tarVersion, logger); -} -function getToolcacheDirectory(version) { - return path12.join( - getRequiredEnvParam("RUNNER_TOOL_CACHE"), - TOOLCACHE_TOOL_NAME, - semver8.clean(version) || version, - os4.arch() || "" - ); -} -function writeToolcacheMarkerFile(extractedPath, logger) { - const markerFilePath = `${extractedPath}.complete`; - fs13.writeFileSync(markerFilePath, ""); - logger.info(`Created toolcache marker file ${markerFilePath}`); -} - -// src/setup-codeql.ts -var CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; -var CODEQL_NIGHTLIES_REPOSITORY_OWNER = "dsp-testing"; -var CODEQL_NIGHTLIES_REPOSITORY_NAME = "codeql-cli-nightlies"; -var CODEQL_BUNDLE_VERSION_ALIAS = ["linked", "latest"]; -var CODEQL_NIGHTLY_TOOLS_INPUTS = ["nightly", "nightly-latest"]; -var CODEQL_TOOLCACHE_INPUT = "toolcache"; -function getCodeQLBundleExtension(compressionMethod) { - switch (compressionMethod) { - case "gzip": - return ".tar.gz"; - case "zstd": - return ".tar.zst"; - default: - assertNever(compressionMethod); - } -} -function getCodeQLBundleName(compressionMethod) { - const extension = getCodeQLBundleExtension(compressionMethod); - let platform2; - if (process.platform === "win32") { - platform2 = "win64"; - } else if (process.platform === "linux") { - platform2 = "linux64"; - } else if (process.platform === "darwin") { - platform2 = "osx64"; - } else { - return `codeql-bundle${extension}`; - } - return `codeql-bundle-${platform2}${extension}`; -} -function getCodeQLActionRepository(logger) { - if (isRunningLocalAction()) { - logger.info( - "The CodeQL Action is checked out locally. Using the default CodeQL Action repository." - ); - return CODEQL_DEFAULT_ACTION_REPOSITORY; - } - return getRequiredEnvParam("GITHUB_ACTION_REPOSITORY"); -} -async function getCodeQLBundleDownloadURL(tagName, apiDetails, compressionMethod, logger) { - const codeQLActionRepository = getCodeQLActionRepository(logger); - const potentialDownloadSources = [ - // This GitHub instance, and this Action. - [apiDetails.url, codeQLActionRepository], - // This GitHub instance, and the canonical Action. - [apiDetails.url, CODEQL_DEFAULT_ACTION_REPOSITORY], - // GitHub.com, and the canonical Action. - [GITHUB_DOTCOM_URL, CODEQL_DEFAULT_ACTION_REPOSITORY] - ]; - const uniqueDownloadSources = potentialDownloadSources.filter( - (source, index2, self2) => { - return !self2.slice(0, index2).some((other) => (0, import_fast_deep_equal.default)(source, other)); - } - ); - const codeQLBundleName = getCodeQLBundleName(compressionMethod); - for (const downloadSource of uniqueDownloadSources) { - const [apiURL, repository] = downloadSource; - if (apiURL === GITHUB_DOTCOM_URL && repository === CODEQL_DEFAULT_ACTION_REPOSITORY) { - break; - } - const [repositoryOwner, repositoryName] = repository.split("/"); - try { - const release2 = await getApiClient().rest.repos.getReleaseByTag({ - owner: repositoryOwner, - repo: repositoryName, - tag: tagName - }); - for (const asset of release2.data.assets) { - if (asset.name === codeQLBundleName) { - logger.info( - `Found CodeQL bundle ${codeQLBundleName} in ${repository} on ${apiURL} with URL ${asset.url}.` - ); - return asset.url; - } - } - } catch (e) { - logger.info( - `Looked for CodeQL bundle ${codeQLBundleName} in ${repository} on ${apiURL} but got error ${e}.` - ); - } - } - return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${tagName}/${codeQLBundleName}`; -} -function tryGetBundleVersionFromTagName(tagName, logger) { - const match2 = tagName.match(/^codeql-bundle-(.*)$/); - if (match2 === null || match2.length < 2) { - logger.debug(`Could not determine bundle version from tag ${tagName}.`); - return void 0; - } - return match2[1]; -} -function tryGetTagNameFromUrl(url2, logger) { - const matches = [...url2.matchAll(/\/(codeql-bundle-[^/]*)\//g)]; - if (matches.length === 0) { - logger.debug(`Could not determine tag name for URL ${url2}.`); - return void 0; - } - const match2 = matches[matches.length - 1]; - if (match2?.length !== 2) { - logger.debug( - `Could not determine tag name for URL ${url2}. Matched ${JSON.stringify( - match2 - )}.` - ); - return void 0; - } - return match2[1]; -} -function convertToSemVer(version, logger) { - if (!semver9.valid(version)) { - logger.debug( - `Bundle version ${version} is not in SemVer format. Will treat it as pre-release 0.0.0-${version}.` - ); - version = `0.0.0-${version}`; - } - const s = semver9.clean(version); - if (!s) { - throw new Error(`Bundle version ${version} is not in SemVer format.`); - } - return s; -} -async function findOverridingToolsInCache(humanReadableVersion, logger) { - const candidates = toolcache3.findAllVersions("CodeQL").filter(isGoodVersion).map((version) => ({ - folder: toolcache3.find("CodeQL", version), - version - })).filter(({ folder }) => fs14.existsSync(path13.join(folder, "pinned-version"))); - if (candidates.length === 1) { - const candidate = candidates[0]; - logger.debug( - `CodeQL tools version ${candidate.version} in toolcache overriding version ${humanReadableVersion}.` - ); - return { - codeqlFolder: candidate.folder, - sourceType: "toolcache", - toolsVersion: candidate.version - }; - } else if (candidates.length === 0) { - logger.debug( - "Did not find any candidate pinned versions of the CodeQL tools in the toolcache." - ); - } else { - logger.debug( - "Could not use CodeQL tools from the toolcache since more than one candidate pinned version was found in the toolcache." - ); - } - return void 0; -} -async function getEnabledVersionsWithOverlayBaseDatabases(defaultCliVersion, rawLanguages, features, logger) { - if (rawLanguages === void 0 || rawLanguages.length === 0) { - return []; - } - const isEnabled = await features.getValue( - "overlay_analysis_match_codeql_version" /* OverlayAnalysisMatchCodeqlVersion */ - ); - const isDryRun = !isEnabled && await features.getValue("overlay_analysis_match_codeql_version_dry_run" /* OverlayAnalysisMatchCodeqlVersionDryRun */); - if (!isEnabled && !isDryRun) { - return []; - } - let cachedVersions; - try { - cachedVersions = await getCodeQlVersionsForOverlayBaseDatabases( - rawLanguages, - logger - ); - } catch (e) { - logger.warning( - `Could not list overlay-base databases in the Actions cache while choosing a default CodeQL CLI version, falling back to the highest enabled version. Details: ${getErrorMessage(e)}` - ); - return []; - } - if (cachedVersions === void 0 || cachedVersions.length === 0) { - return []; - } - const cachedVersionsSet = new Set(cachedVersions); - const overlayVersions = defaultCliVersion.enabledVersions.filter( - (v) => cachedVersionsSet.has(v.cliVersion) - ); - if (overlayVersions.length === 0) { - return []; - } - const isCachedVersionDifferent = overlayVersions[0].cliVersion !== defaultCliVersion.enabledVersions[0].cliVersion; - if (isCachedVersionDifferent) { - addNoLanguageDiagnostic( - void 0, - makeTelemetryDiagnostic( - "codeql-action/overlay-aware-default-codeql-version", - "Overlay-aware default CodeQL version selection", - { - cachedVersions, - enabledVersions: defaultCliVersion.enabledVersions.map( - (v) => v.cliVersion - ), - isDryRun, - overlayAwareVersion: overlayVersions[0].cliVersion - } - ) - ); - } - if (isDryRun) { - logger.debug( - `Overlay-aware default CodeQL version selection is running in dry-run mode. Would have used version ${overlayVersions[0].cliVersion}.` - ); - return []; - } - return overlayVersions; -} -async function resolveDefaultCliVersion(defaultCliVersion, rawLanguages, useOverlayAwareDefaultCliVersion, features, logger) { - if (!useOverlayAwareDefaultCliVersion || !isAnalyzingPullRequest()) { - return defaultCliVersion.enabledVersions[0]; - } - const overlayVersions = await getEnabledVersionsWithOverlayBaseDatabases( - defaultCliVersion, - rawLanguages, - features, - logger - ); - if (overlayVersions.length > 0) { - logger.info( - `Using CodeQL version ${overlayVersions[0].cliVersion} since this is the highest enabled version that has a cached overlay-base database.` - ); - return overlayVersions[0]; - } - return defaultCliVersion.enabledVersions[0]; -} -async function getCodeQLSource(toolsInput, defaultCliVersion, rawLanguages, useOverlayAwareDefaultCliVersion, apiDetails, variant, tarSupportsZstd, features, logger) { - if (toolsInput && !isReservedToolsValue(toolsInput) && !toolsInput.startsWith("http")) { - logger.info(`Using CodeQL CLI from local path ${toolsInput}`); - const compressionMethod2 = inferCompressionMethod(toolsInput); - if (compressionMethod2 === void 0) { - throw new ConfigurationError( - `Could not infer compression method from path ${toolsInput}. Please specify a path ending in '.tar.gz' or '.tar.zst'.` - ); - } - return { - codeqlTarPath: toolsInput, - compressionMethod: compressionMethod2, - sourceType: "local", - toolsVersion: "local" - }; - } - let cliVersion2; - let tagName; - let url2; - const canForceNightlyWithFF = isDynamicWorkflow() || isInTestMode(); - const forceNightlyValueFF = await features.getValue("force_nightly" /* ForceNightly */); - const forceNightly = forceNightlyValueFF && canForceNightlyWithFF; - const nightlyRequestedByToolsInput = toolsInput !== void 0 && CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput); - if (forceNightly || nightlyRequestedByToolsInput) { - if (forceNightly) { - logger.info( - `Using the latest CodeQL CLI nightly, as forced by the ${"force_nightly" /* ForceNightly */} feature flag.` - ); - addNoLanguageDiagnostic( - void 0, - makeDiagnostic( - "codeql-action/forced-nightly-cli", - "A nightly release of CodeQL was used", - { - markdownMessage: "GitHub configured this analysis to use a nightly release of CodeQL to allow you to preview changes from an upcoming release.\n\nNightly releases do not undergo the same validation as regular releases and may lead to analysis instability.\n\nIf use of a nightly CodeQL release for this analysis is unexpected, please contact GitHub support.", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: true - }, - severity: "note" - } - ) - ); - } else { - logger.info( - `Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.` - ); - } - toolsInput = await getNightlyToolsUrl(logger); - } - const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - cliVersion2 = cliVersion; - tagName = bundleVersion; - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion2}, the version shipped with the Action.` - ); - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." - ); - } - } else if (toolsInput !== void 0 && toolsInput === CODEQL_TOOLCACHE_INPUT) { - let latestToolcacheVersion; - const allowToolcacheValue = isDynamicWorkflow() || isInTestMode(); - if (allowToolcacheValue) { - logger.info( - `Attempting to use the latest CodeQL CLI version in the toolcache, as requested by 'tools: ${toolsInput}'.` - ); - latestToolcacheVersion = getLatestToolcacheVersion(logger); - if (latestToolcacheVersion) { - cliVersion2 = latestToolcacheVersion; - } - } - if (latestToolcacheVersion === void 0) { - if (allowToolcacheValue) { - logger.info( - `Found no CodeQL CLI in the toolcache, ignoring 'tools: ${toolsInput}'...` - ); - } else { - logger.warning( - `Ignoring 'tools: ${toolsInput}' because the workflow was not triggered dynamically.` - ); - } - const version = await resolveDefaultCliVersion( - defaultCliVersion, - rawLanguages, - useOverlayAwareDefaultCliVersion, - features, - logger - ); - cliVersion2 = version.cliVersion; - tagName = version.tagName; - } - } else if (toolsInput !== void 0) { - tagName = tryGetTagNameFromUrl(toolsInput, logger); - url2 = toolsInput; - if (tagName) { - const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver9.valid(bundleVersion3)) { - cliVersion2 = convertToSemVer(bundleVersion3, logger); - } - } - } else { - const version = await resolveDefaultCliVersion( - defaultCliVersion, - rawLanguages, - useOverlayAwareDefaultCliVersion, - features, - logger - ); - cliVersion2 = version.cliVersion; - tagName = version.tagName; - } - const bundleVersion2 = tagName && tryGetBundleVersionFromTagName(tagName, logger); - const humanReadableVersion = cliVersion2 ?? (bundleVersion2 && convertToSemVer(bundleVersion2, logger)) ?? tagName ?? url2 ?? "unknown"; - logger.debug( - `Attempting to obtain CodeQL tools. CLI version: ${cliVersion2 ?? "unknown"}, bundle tag name: ${tagName ?? "unknown"}, URL: ${url2 ?? "unspecified"}.` - ); - let codeqlFolder; - if (cliVersion2) { - codeqlFolder = toolcache3.find("CodeQL", cliVersion2); - if (!codeqlFolder) { - logger.debug( - `Didn't find a version of the CodeQL tools in the toolcache with a version number exactly matching ${cliVersion2}.` - ); - const allVersions = toolcache3.findAllVersions("CodeQL"); - logger.debug( - `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( - allVersions - )}.` - ); - const candidateVersions = allVersions.filter( - (version) => version.startsWith(`${cliVersion2}-`) - ); - if (candidateVersions.length === 1) { - logger.debug( - `Exactly one version of the CodeQL tools starting with ${cliVersion2} found in the toolcache, using that.` - ); - codeqlFolder = toolcache3.find("CodeQL", candidateVersions[0]); - } else if (candidateVersions.length === 0) { - logger.debug( - `Didn't find any versions of the CodeQL tools starting with ${cliVersion2} in the toolcache. Trying next fallback method.` - ); - } else { - logger.warning( - `Found ${candidateVersions.length} versions of the CodeQL tools starting with ${cliVersion2} in the toolcache, but at most one was expected.` - ); - logger.debug("Trying next fallback method."); - } - } - } - if (!codeqlFolder && tagName) { - const fallbackVersion = await tryGetFallbackToolcacheVersion( - cliVersion2, - tagName, - logger - ); - if (fallbackVersion) { - codeqlFolder = toolcache3.find("CodeQL", fallbackVersion); - } else { - logger.debug( - `Could not determine a fallback toolcache version number for CodeQL tools version ${humanReadableVersion}.` - ); - } - } - if (codeqlFolder) { - logger.info( - `Found CodeQL tools version ${humanReadableVersion} in the toolcache.` - ); - } else { - logger.info( - `Did not find CodeQL tools version ${humanReadableVersion} in the toolcache.` - ); - } - if (codeqlFolder) { - if (cliVersion2) { - logger.info( - `Using CodeQL CLI version ${cliVersion2} from toolcache at ${codeqlFolder}` - ); - } else { - logger.info(`Using CodeQL CLI from toolcache at ${codeqlFolder}`); - } - return { - codeqlFolder, - sourceType: "toolcache", - toolsVersion: cliVersion2 ?? humanReadableVersion - }; - } - if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { - const result = await findOverridingToolsInCache( - humanReadableVersion, - logger - ); - if (result !== void 0) { - return result; - } - } - let compressionMethod; - if (!url2) { - compressionMethod = cliVersion2 !== void 0 && await useZstdBundle(cliVersion2, tarSupportsZstd) ? "zstd" : "gzip"; - url2 = await getCodeQLBundleDownloadURL( - tagName, - apiDetails, - compressionMethod, - logger - ); - } else { - const method = inferCompressionMethod(url2); - if (method === void 0) { - throw new ConfigurationError( - `Could not infer compression method from URL ${url2}. Please specify a URL ending in '.tar.gz' or '.tar.zst'.` - ); - } - compressionMethod = method; - } - if (cliVersion2) { - logger.info(`Using CodeQL CLI version ${cliVersion2} sourced from ${url2} .`); - } else { - logger.info(`Using CodeQL CLI sourced from ${url2} .`); - } - return { - bundleVersion: tagName && tryGetBundleVersionFromTagName(tagName, logger), - cliVersion: cliVersion2, - codeqlURL: url2, - compressionMethod, - sourceType: "download", - toolsVersion: cliVersion2 ?? humanReadableVersion - }; -} -async function tryGetFallbackToolcacheVersion(cliVersion2, tagName, logger) { - const bundleVersion2 = tryGetBundleVersionFromTagName(tagName, logger); - if (!bundleVersion2) { - return void 0; - } - const fallbackVersion = convertToSemVer(bundleVersion2, logger); - logger.debug( - `Computed a fallback toolcache version number of ${fallbackVersion} for CodeQL version ${cliVersion2 ?? tagName}.` - ); - return fallbackVersion; -} -var downloadCodeQL = async function(codeqlURL, compressionMethod, maybeBundleVersion, maybeCliVersion, apiDetails, tarVersion, tempDir, logger) { - const parsedCodeQLURL = new URL(codeqlURL); - const searchParams = new URLSearchParams(parsedCodeQLURL.search); - const headers = { - accept: "application/octet-stream" - }; - let authorization = void 0; - if (searchParams.has("token")) { - logger.debug("CodeQL tools URL contains an authorization token."); - } else { - authorization = getAuthorizationHeaderFor( - logger, - apiDetails, - codeqlURL - ); - } - const toolcacheInfo = getToolcacheDestinationInfo( - maybeBundleVersion, - maybeCliVersion, - logger - ); - const extractedBundlePath = toolcacheInfo?.path ?? getTempExtractionDir(tempDir); - const statusReport = await downloadAndExtract( - codeqlURL, - compressionMethod, - extractedBundlePath, - authorization, - { "User-Agent": "CodeQL Action", ...headers }, - tarVersion, - logger - ); - if (!toolcacheInfo) { - logger.debug( - `Could not cache CodeQL tools because we could not determine the bundle version from the URL ${codeqlURL}.` - ); - return { - codeqlFolder: extractedBundlePath, - statusReport, - toolsVersion: maybeCliVersion ?? "unknown" - }; - } - writeToolcacheMarkerFile(toolcacheInfo.path, logger); - return { - codeqlFolder: extractedBundlePath, - statusReport, - toolsVersion: maybeCliVersion ?? toolcacheInfo.version - }; -}; -function getToolcacheDestinationInfo(maybeBundleVersion, maybeCliVersion, logger) { - if (maybeBundleVersion) { - const version = getCanonicalToolcacheVersion( - maybeCliVersion, - maybeBundleVersion, - logger - ); - return { - path: getToolcacheDirectory(version), - version - }; - } - return void 0; -} -function getCanonicalToolcacheVersion(cliVersion2, bundleVersion2, logger) { - if (!cliVersion2?.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) { - return convertToSemVer(bundleVersion2, logger); - } - return cliVersion2; -} -async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, rawLanguages, useOverlayAwareDefaultCliVersion, features, logger) { - if (!await isBinaryAccessible("tar", logger)) { - throw new ConfigurationError( - "Could not find tar in PATH, so unable to extract CodeQL bundle." - ); - } - const zstdAvailability = await isZstdAvailable(logger); - const source = await getCodeQLSource( - toolsInput, - defaultCliVersion, - rawLanguages, - useOverlayAwareDefaultCliVersion, - apiDetails, - variant, - zstdAvailability.available, - features, - logger - ); - let codeqlFolder; - let toolsVersion = source.toolsVersion; - let toolsDownloadStatusReport; - let toolsSource; - switch (source.sourceType) { - case "local": { - codeqlFolder = await extract( - source.codeqlTarPath, - getTempExtractionDir(tempDir), - source.compressionMethod, - zstdAvailability.version, - logger - ); - toolsSource = "LOCAL" /* Local */; - break; - } - case "toolcache": - codeqlFolder = source.codeqlFolder; - logger.debug(`CodeQL found in cache ${codeqlFolder}`); - toolsSource = "TOOLCACHE" /* Toolcache */; - break; - case "download": { - const result = await downloadCodeQL( - source.codeqlURL, - source.compressionMethod, - source.bundleVersion, - source.cliVersion, - apiDetails, - zstdAvailability.version, - tempDir, - logger - ); - toolsVersion = result.toolsVersion; - codeqlFolder = result.codeqlFolder; - toolsDownloadStatusReport = result.statusReport; - toolsSource = "DOWNLOAD" /* Download */; - break; - } - default: - assertNever(source); - } - return { - codeqlFolder, - toolsDownloadStatusReport, - toolsSource, - toolsVersion - }; -} -async function useZstdBundle(cliVersion2, tarSupportsZstd) { - return ( - // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver9.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) - ); -} -function getTempExtractionDir(tempDir) { - return path13.join(tempDir, v4_default()); -} -async function getNightlyToolsUrl(logger) { - const zstdAvailability = await isZstdAvailable(logger); - const compressionMethod = await useZstdBundle( - CODEQL_VERSION_ZSTD_BUNDLE, - zstdAvailability.available - ) ? "zstd" : "gzip"; - try { - const release2 = await getApiClient().rest.repos.listReleases({ - owner: CODEQL_NIGHTLIES_REPOSITORY_OWNER, - repo: CODEQL_NIGHTLIES_REPOSITORY_NAME, - per_page: 1, - page: 1, - prerelease: true - }); - const latestRelease = release2.data[0]; - if (!latestRelease) { - throw new Error("Could not find the latest nightly release."); - } - return `https://github.com/${CODEQL_NIGHTLIES_REPOSITORY_OWNER}/${CODEQL_NIGHTLIES_REPOSITORY_NAME}/releases/download/${latestRelease.tag_name}/${getCodeQLBundleName(compressionMethod)}`; - } catch (e) { - throw new Error( - `Failed to retrieve the latest nightly release: ${wrapError(e)}` - ); - } -} -function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver9.compare(b, a)); - logger.debug( - `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( - allVersions - )}.` - ); - if (allVersions.length > 0) { - const latestToolcacheVersion = allVersions[0]; - logger.info( - `CLI version ${latestToolcacheVersion} is the latest version in the toolcache.` - ); - return latestToolcacheVersion; - } - return void 0; -} -function isReservedToolsValue(tools) { - return CODEQL_BUNDLE_VERSION_ALIAS.includes(tools) || CODEQL_NIGHTLY_TOOLS_INPUTS.includes(tools) || tools === CODEQL_TOOLCACHE_INPUT; -} - -// src/tracer-config.ts -var fs15 = __toESM(require("fs")); -var path14 = __toESM(require("path")); -async function shouldEnableIndirectTracing(codeql, config) { - if (config.buildMode === "none" /* None */) { - return false; - } - if (config.buildMode === "autobuild" /* Autobuild */) { - return false; - } - return asyncSome(config.languages, (l) => codeql.isTracedLanguage(l)); -} -async function endTracingForCluster(codeql, config, logger) { - if (!await shouldEnableIndirectTracing(codeql, config)) return; - logger.info( - "Unsetting build tracing environment variables. Subsequent steps of this job will not be traced." - ); - const envVariablesFile = path14.resolve( - config.dbLocation, - "temp/tracingEnvironment/end-tracing.json" - ); - if (!fs15.existsSync(envVariablesFile)) { - throw new Error( - `Environment file for ending tracing not found: ${envVariablesFile}` - ); - } - try { - const endTracingEnvVariables = JSON.parse( - fs15.readFileSync(envVariablesFile, "utf8") - ); - for (const [key, value] of Object.entries(endTracingEnvVariables)) { - if (value !== null) { - process.env[key] = value; - } else { - delete process.env[key]; - } - } - } catch (e) { - throw new Error( - `Failed to parse file containing end tracing environment variables: ${e}` - ); - } -} -async function getTracerConfigForCluster(config) { - const tracingEnvVariables = JSON.parse( - fs15.readFileSync( - path14.resolve( - config.dbLocation, - "temp/tracingEnvironment/start-tracing.json" - ), - "utf8" - ) - ); - return { - env: tracingEnvVariables - }; -} -async function getCombinedTracerConfig(codeql, config) { - if (!await shouldEnableIndirectTracing(codeql, config)) { - return void 0; - } - return await getTracerConfigForCluster(config); -} - -// src/codeql.ts -var cachedCodeQL = void 0; -var CODEQL_MINIMUM_VERSION = "2.19.4"; -var CODEQL_NEXT_MINIMUM_VERSION = "2.20.7"; -var GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.16"; -var GHES_MOST_RECENT_DEPRECATION_DATE = "2026-07-01"; -var EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++"; -function isDiskConfigurationError(e) { - if (!(e instanceof Error)) { - return false; - } - return ( - // out of disk space - e.message.includes("ENOSPC") || // access denied - e.message.includes("EACCES") - ); -} -async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, rawLanguages, useOverlayAwareDefaultCliVersion, features, logger, checkVersion) { - try { - const { - codeqlFolder, - toolsDownloadStatusReport, - toolsSource, - toolsVersion - } = await setupCodeQLBundle( - toolsInput, - apiDetails, - tempDir, - variant, - defaultCliVersion, - rawLanguages, - useOverlayAwareDefaultCliVersion, - features, - logger - ); - let codeqlCmd = path15.join(codeqlFolder, "codeql", "codeql"); - if (process.platform === "win32") { - codeqlCmd += ".exe"; - } else if (process.platform !== "linux" && process.platform !== "darwin") { - throw new ConfigurationError( - `Unsupported platform: ${process.platform}` - ); - } - cachedCodeQL = await getCodeQLForCmd(logger, codeqlCmd, checkVersion); - return { - codeql: cachedCodeQL, - toolsDownloadStatusReport, - toolsSource, - toolsVersion - }; - } catch (rawError) { - const e = wrapApiConfigurationError(rawError); - const ErrorClass = e instanceof ConfigurationError || isDiskConfigurationError(e) ? ConfigurationError : Error; - throw new ErrorClass( - `Unable to download and extract CodeQL CLI: ${getErrorMessage(e)}${e instanceof Error && e.stack ? ` - -Details: ${e.stack}` : ""}` - ); - } -} -async function getCodeQL(logger, cmd) { - if (cachedCodeQL === void 0) { - cachedCodeQL = await getCodeQLForCmd(logger, cmd, true); - } - return cachedCodeQL; -} -async function getCodeQLForCmd(logger, cmd, checkVersion) { - const codeql = { - getPath() { - return cmd; - }, - async getVersion() { - let result = getCachedCodeQlVersion(logger, getEnv(), cmd); - if (result === void 0) { - result = await runCliJson( - cmd, - ["version", "--format=json"], - { - noStreamStdout: true - } - ); - cacheCodeQlVersion(getEnv(), cmd, result); - } - return result; - }, - async printVersion() { - core12.info(JSON.stringify(await this.getVersion(), null, 2)); - }, - async supportsFeature(feature) { - return isSupportedToolsFeature(await this.getVersion(), feature); - }, - async isTracedLanguage(language) { - const extractorPath = await this.resolveExtractor(language); - const tracingConfigPath = path15.join( - extractorPath, - "tools", - "tracing-config.lua" - ); - return fs16.existsSync(tracingConfigPath); - }, - async isScannedLanguage(language) { - return !await this.isTracedLanguage(language); - }, - async databaseInitCluster(config, sourceRoot, processName, qlconfigFile) { - const extraArgs = config.languages.map( - (language) => `--language=${language}` - ); - if (await shouldEnableIndirectTracing(codeql, config)) { - extraArgs.push("--begin-tracing"); - extraArgs.push(...await getTrapCachingExtractorConfigArgs(config)); - extraArgs.push(`--trace-process-name=${processName}`); - } - const codeScanningConfigFile = await writeCodeScanningConfigFile( - config, - logger - ); - const externalRepositoryToken = getOptionalInput( - "external-repository-token" - ); - extraArgs.push(`--codescanning-config=${codeScanningConfigFile}`); - if (externalRepositoryToken) { - extraArgs.push("--external-repository-token-stdin"); - } - if (config.buildMode !== void 0) { - extraArgs.push(`--build-mode=${config.buildMode}`); - } - if (qlconfigFile !== void 0) { - extraArgs.push(`--qlconfig-file=${qlconfigFile}`); - } - const overlayDatabaseMode = config.overlayDatabaseMode; - if (overlayDatabaseMode === "overlay" /* Overlay */) { - const overlayChangesFile = await writeOverlayChangesFile( - config, - sourceRoot, - logger - ); - extraArgs.push(`--overlay-changes=${overlayChangesFile}`); - } else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) { - extraArgs.push("--overlay-base"); - } - const baselineFilesOptions = config.enableFileCoverageInformation ? [ - "--calculate-language-specific-baseline", - "--sublanguage-file-coverage" - ] : ["--no-calculate-baseline"]; - await runCli( - cmd, - [ - "database", - "init", - ...overlayDatabaseMode === "overlay" /* Overlay */ ? [] : ["--force-overwrite"], - "--db-cluster", - config.dbLocation, - `--source-root=${sourceRoot}`, - ...baselineFilesOptions, - "--extractor-include-aliases", - ...extraArgs, - ...getExtraOptionsFromEnv(["database", "init"], { - // Some user configs specify `--no-calculate-baseline` as an additional - // argument to `codeql database init`. Therefore ignore the baseline file - // options here to avoid specifying the same argument twice and erroring. - // - // Ignore `--overwrite` to avoid passing both `--force-overwrite` and `--overwrite` if - // the user has configured `--overwrite`. - ignoringOptions: [ - "--force-overwrite", - "--overwrite", - ...baselineFilesOptions - ] - }) - ], - { stdin: externalRepositoryToken } - ); - if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) { - await writeBaseDatabaseOidsFile(config, sourceRoot); - } - }, - async runAutobuild(config, language) { - applyAutobuildAzurePipelinesTimeoutFix(); - const autobuildCmd = path15.join( - await this.resolveExtractor(language), - "tools", - process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh" - ); - if (config.debugMode) { - process.env["CODEQL_VERBOSITY" /* CLI_VERBOSITY */] = process.env["CODEQL_VERBOSITY" /* CLI_VERBOSITY */] || EXTRACTION_DEBUG_MODE_VERBOSITY; - } - await runCli(autobuildCmd); - }, - async extractScannedLanguage(config, language) { - await runCli(cmd, [ - "database", - "trace-command", - "--index-traceless-dbs", - ...await getTrapCachingExtractorConfigArgsForLang(config, language), - ...getExtractionVerbosityArguments(config.debugMode), - ...getExtraOptionsFromEnv(["database", "trace-command"]), - getCodeQLDatabasePath(config, language) - ]); - }, - async extractUsingBuildMode(config, language) { - if (config.buildMode === "autobuild" /* Autobuild */) { - applyAutobuildAzurePipelinesTimeoutFix(); - } - try { - await runCli(cmd, [ - "database", - "trace-command", - "--use-build-mode", - "--working-dir", - process.cwd(), - ...await getTrapCachingExtractorConfigArgsForLang(config, language), - ...getExtractionVerbosityArguments(config.debugMode), - ...getExtraOptionsFromEnv(["database", "trace-command"]), - getCodeQLDatabasePath(config, language) - ]); - } catch (e) { - if (config.buildMode === "autobuild" /* Autobuild */) { - const prefix = `We were unable to automatically build your code. Please change the build mode for this language to manual and specify build steps for your project. See ${"https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed" /* AUTOMATIC_BUILD_FAILED */} for more information.`; - throw new ConfigurationError(`${prefix} ${getErrorMessage(e)}`); - } else { - throw e; - } - } - }, - async finalizeDatabase(databasePath, threadsFlag, memoryFlag, enableDebugLogging) { - const args = [ - "database", - "finalize", - "--finalize-dataset", - threadsFlag, - memoryFlag, - ...getExtractionVerbosityArguments(enableDebugLogging), - ...getExtraOptionsFromEnv(["database", "finalize"]), - databasePath - ]; - await runCli(cmd, args); - }, - async resolveLanguages({ - filterToLanguagesWithQueries - } = { filterToLanguagesWithQueries: false }) { - return runCliJson(cmd, [ - "resolve", - "languages", - "--format=betterjson", - "--extractor-options-verbosity=4", - "--extractor-include-aliases", - // TODO: Unconditionally include `--filter-to-languages-with-queries` - // once CODEQL_MINIMUM_VERSION is at least v2.23.0 - // — the first version to support this flag. - ...filterToLanguagesWithQueries ? ["--filter-to-languages-with-queries"] : [], - ...getExtraOptionsFromEnv(["resolve", "languages"]) - ]); - }, - async resolveBuildEnvironment(workingDir, language) { - const codeqlArgs = [ - "resolve", - "build-environment", - `--language=${language}`, - "--extractor-include-aliases", - ...getExtraOptionsFromEnv(["resolve", "build-environment"]) - ]; - if (workingDir !== void 0) { - codeqlArgs.push("--working-dir", workingDir); - } - return await runCliJson(cmd, codeqlArgs); - }, - async databaseRunQueries(databasePath, flags, queries = []) { - const codeqlArgs = [ - "database", - "run-queries", - ...flags, - databasePath, - "--min-disk-free=1024", - // Try to leave at least 1GB free - "-v", - ...queries, - ...getExtraOptionsFromEnv(["database", "run-queries"], { - ignoringOptions: ["--expect-discarded-cache"] - }) - ]; - await runCli(cmd, codeqlArgs); - }, - async databaseInterpretResults(databasePath, querySuitePaths, sarifFile, threadsFlag, verbosityFlag, sarifRunPropertyFlag, automationDetailsId, config, features) { - const shouldExportDiagnostics = await features.getValue( - "export_diagnostics_enabled" /* ExportDiagnosticsEnabled */, - this - ); - const codeqlArgs = [ - "database", - "interpret-results", - threadsFlag, - "--format=sarif-latest", - verbosityFlag, - `--output=${sarifFile}`, - "--print-diagnostics-summary", - "--print-metrics-summary", - "--sarif-add-baseline-file-info", - `--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath( - config - )}`, - "--sarif-group-rules-by-pack", - "--sarif-include-query-help=always", - "--sublanguage-file-coverage", - ...await getJobRunUuidSarifOptions(), - ...getExtraOptionsFromEnv(["database", "interpret-results"]) - ]; - if (sarifRunPropertyFlag !== void 0) { - codeqlArgs.push(sarifRunPropertyFlag); - } - if (automationDetailsId !== void 0) { - codeqlArgs.push("--sarif-category", automationDetailsId); - } - if (shouldExportDiagnostics) { - codeqlArgs.push("--sarif-include-diagnostics"); - } else { - codeqlArgs.push("--no-sarif-include-diagnostics"); - } - codeqlArgs.push(databasePath); - if (querySuitePaths) { - codeqlArgs.push(...querySuitePaths); - } - return await runCli(cmd, codeqlArgs, { - noStreamStdout: true - }); - }, - async databaseCleanupCluster(config, cleanupLevel) { - for (const language of config.languages) { - const databasePath = getCodeQLDatabasePath(config, language); - const codeqlArgs = [ - "database", - "cleanup", - databasePath, - `--cache-cleanup=${cleanupLevel}`, - ...getExtraOptionsFromEnv(["database", "cleanup"]) - ]; - await runCli(cmd, codeqlArgs); - } - }, - async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { - const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; - const args = [ - "database", - "bundle", - databasePath, - `--output=${outputFilePath}`, - `--name=${databaseName}`, - ...includeDiagnosticsArgs, - ...getExtraOptionsFromEnv(["database", "bundle"], { - ignoringOptions: includeDiagnosticsArgs - }) - ]; - if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { - args.push( - ...alsoIncludeRelativePaths.flatMap((relativePath2) => [ - "--include", - relativePath2 - ]) - ); - } - await new toolrunner3.ToolRunner(cmd, args).exec(); - }, - async databaseExportDiagnostics(databasePath, sarifFile, automationDetailsId) { - const args = [ - "database", - "export-diagnostics", - `${databasePath}`, - "--db-cluster", - // Database is always a cluster for CodeQL versions that support diagnostics. - "--format=sarif-latest", - `--output=${sarifFile}`, - "--sarif-include-diagnostics", - // ExportDiagnosticsEnabled is always true if this command is run. - "-vvv", - ...getExtraOptionsFromEnv(["diagnostics", "export"]) - ]; - if (automationDetailsId !== void 0) { - args.push("--sarif-category", automationDetailsId); - } - await new toolrunner3.ToolRunner(cmd, args).exec(); - }, - async diagnosticsExport(sarifFile, automationDetailsId, config) { - const args = [ - "diagnostics", - "export", - "--format=sarif-latest", - `--output=${sarifFile}`, - `--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath( - config - )}`, - ...getExtraOptionsFromEnv(["diagnostics", "export"]) - ]; - if (automationDetailsId !== void 0) { - args.push("--sarif-category", automationDetailsId); - } - await new toolrunner3.ToolRunner(cmd, args).exec(); - }, - async resolveExtractor(language) { - let extractorPath = ""; - await new toolrunner3.ToolRunner( - cmd, - [ - "resolve", - "extractor", - "--format=json", - `--language=${language}`, - "--extractor-include-aliases", - ...getExtraOptionsFromEnv(["resolve", "extractor"]) - ], - { - silent: true, - listeners: { - stdout: (data) => { - extractorPath += data.toString(); - }, - stderr: (data) => { - process.stderr.write(data); - } - } - } - ).exec(); - return JSON.parse(extractorPath); - }, - async resolveQueriesStartingPacks(queries) { - const codeqlArgs = [ - "resolve", - "queries", - "--format=startingpacks", - ...getExtraOptionsFromEnv(["resolve", "queries"]), - ...queries - ]; - return await runCliJson(cmd, codeqlArgs, { - noStreamStdout: true - }); - }, - async resolveDatabase(databasePath) { - const codeqlArgs = [ - "resolve", - "database", - databasePath, - "--format=json", - ...getExtraOptionsFromEnv(["resolve", "database"]) - ]; - return await runCliJson(cmd, codeqlArgs, { - noStreamStdout: true - }); - }, - async mergeResults(sarifFiles, outputFile, { - mergeRunsFromEqualCategory = false - }) { - const args = [ - "github", - "merge-results", - "--output", - outputFile, - ...getExtraOptionsFromEnv(["github", "merge-results"]) - ]; - for (const sarifFile of sarifFiles) { - args.push("--sarif", sarifFile); - } - if (mergeRunsFromEqualCategory) { - args.push("--sarif-merge-runs-from-equal-category"); - } - await runCli(cmd, args); - } - }; - if (checkVersion && !await codeQlVersionAtLeast(codeql, CODEQL_MINIMUM_VERSION)) { - throw new ConfigurationError( - `Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${(await codeql.getVersion()).version}` - ); - } else if (checkVersion && process.env["CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING" /* SUPPRESS_DEPRECATED_SOON_WARNING */] !== "true" && !await codeQlVersionAtLeast(codeql, CODEQL_NEXT_MINIMUM_VERSION)) { - const result = await codeql.getVersion(); - core12.warning( - `CodeQL CLI version ${result.version} was discontinued on ${GHES_MOST_RECENT_DEPRECATION_DATE} alongside GitHub Enterprise Server ${GHES_VERSION_MOST_RECENTLY_DEPRECATED} and will not be supported by the next minor release of the CodeQL Action. Please update to CodeQL CLI version ${CODEQL_NEXT_MINIMUM_VERSION} or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version. - -Alternatively, if you want to continue using CodeQL CLI version ${result.version}, you can replace 'github/codeql-action/*@v${getActionVersion().split(".")[0]}' by 'github/codeql-action/*@v${getActionVersion()}' in your code scanning workflow to continue using this version of the CodeQL Action.` - ); - core12.exportVariable("CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING" /* SUPPRESS_DEPRECATED_SOON_WARNING */, "true"); - } - return codeql; -} -function getExtraOptionsFromEnv(paths, { ignoringOptions } = {}) { - const options = getExtraOptionsEnvParam(); - return getExtraOptions(options, paths, []).filter( - (option) => !ignoringOptions?.includes(option) - ); -} -function asExtraOptions(options, pathInfo) { - if (options === void 0) { - return []; - } - if (!Array.isArray(options)) { - const msg = `The extra options for '${pathInfo.join( - "." - )}' ('${JSON.stringify(options)}') are not in an array.`; - throw new Error(msg); - } - return options.map((o) => { - const t = typeof o; - if (t !== "string" && t !== "number" && t !== "boolean") { - const msg = `The extra option for '${pathInfo.join( - "." - )}' ('${JSON.stringify(o)}') is not a primitive value.`; - throw new Error(msg); - } - return `${o}`; - }); -} -function getExtraOptions(options, paths, pathInfo) { - const all = asExtraOptions(options?.["*"], pathInfo.concat("*")); - const specific = paths.length === 0 ? asExtraOptions(options, pathInfo) : getExtraOptions( - options?.[paths[0]], - paths?.slice(1), - pathInfo.concat(paths[0]) - ); - return all.concat(specific); -} -async function runCli(cmd, args = [], opts = {}) { - try { - return await runTool(cmd, args, opts); - } catch (e) { - if (e instanceof CommandInvocationError) { - throw wrapCliConfigurationError(new CliError(e)); - } - throw e; - } -} -async function runCliJson(cmd, args = [], opts = {}) { - const output = await runCli(cmd, args, opts); - try { - return JSON.parse(output); - } catch (e) { - throw Error( - `Unexpected output from codeql ${args.join(" ")}: ${getErrorMessage(e)}` - ); - } -} -async function writeCodeScanningConfigFile(config, logger) { - const codeScanningConfigFile = getGeneratedCodeScanningConfigPath(config); - const augmentedConfig = appendExtraQueryExclusions( - config.extraQueryExclusions, - config.computedConfig - ); - logger.info( - `Writing augmented user configuration file to ${codeScanningConfigFile}` - ); - logger.startGroup("Augmented user configuration file contents"); - logger.info(dump(augmentedConfig)); - logger.endGroup(); - fs16.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); - return codeScanningConfigFile; -} -var TRAP_CACHE_SIZE_MB = 1024; -async function getTrapCachingExtractorConfigArgs(config) { - const result = []; - for (const language of config.languages) - result.push( - await getTrapCachingExtractorConfigArgsForLang(config, language) - ); - return result.flat(); -} -async function getTrapCachingExtractorConfigArgsForLang(config, language) { - const cacheDir2 = config.trapCaches[language]; - if (cacheDir2 === void 0) return []; - const write = await isAnalyzingDefaultBranch(); - return [ - `-O=${language}.trap.cache.dir=${cacheDir2}`, - `-O=${language}.trap.cache.bound=${TRAP_CACHE_SIZE_MB}`, - `-O=${language}.trap.cache.write=${write}` - ]; -} -function getGeneratedCodeScanningConfigPath(config) { - return path15.resolve(config.tempDir, "user-config.yaml"); -} -function getExtractionVerbosityArguments(enableDebugLogging) { - return enableDebugLogging ? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`] : []; -} -function applyAutobuildAzurePipelinesTimeoutFix() { - const javaToolOptions = process.env["JAVA_TOOL_OPTIONS"] || ""; - process.env["JAVA_TOOL_OPTIONS"] = [ - ...javaToolOptions.split(/\s+/), - "-Dhttp.keepAlive=false", - "-Dmaven.wagon.http.pool=false" - ].join(" "); -} -async function getJobRunUuidSarifOptions() { - const jobRunUuid = process.env["CODEQL_ACTION_JOB_RUN_UUID" /* JOB_RUN_UUID */]; - return jobRunUuid ? [`--sarif-run-property=jobRunUuid=${jobRunUuid}`] : []; -} - -// src/autobuild.ts -async function determineAutobuildLanguages(codeql, config, logger) { - if (config.buildMode === "none" /* None */ || config.buildMode === "manual" /* Manual */) { - logger.info( - `Using build mode "${config.buildMode}", nothing to autobuild. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes" /* CODEQL_BUILD_MODES */} for more information.` - ); - return void 0; - } - const autobuildLanguages = await asyncFilter( - config.languages, - async (language) => await codeql.isTracedLanguage(language) - ); - if (autobuildLanguages.length === 0) { - logger.info( - "None of the languages in this project require extra build steps" - ); - return void 0; - } - const autobuildLanguagesWithoutGo = autobuildLanguages.filter( - (l) => l !== "go" /* go */ - ); - const languages = []; - if (autobuildLanguagesWithoutGo[0] !== void 0) { - languages.push(autobuildLanguagesWithoutGo[0]); - } - if (autobuildLanguages.length !== autobuildLanguagesWithoutGo.length) { - languages.push("go" /* go */); - } - logger.debug(`Will autobuild ${languages.join(" and ")}.`); - if (autobuildLanguagesWithoutGo.length > 1) { - logger.warning( - `We will only automatically build ${languages.join( - " and " - )} code. If you wish to scan ${autobuildLanguagesWithoutGo.slice(1).join( - " and " - )}, you must replace the autobuild step of your workflow with custom build steps. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually" /* SPECIFY_BUILD_STEPS_MANUALLY */} for more information.` - ); - } - return languages; -} -async function setupCppAutobuild(codeql, logger) { - const envVar = featureConfig["cpp_dependency_installation_enabled" /* CppDependencyInstallation */].envVar; - const featureName = "C++ automatic installation of dependencies"; - const gitHubVersion = await getGitHubVersion(); - const repositoryNwo = getRepositoryNwo(); - const features = initFeatures( - gitHubVersion, - repositoryNwo, - getTemporaryDirectory(), - logger - ); - if (await features.getValue("cpp_dependency_installation_enabled" /* CppDependencyInstallation */, codeql)) { - if (process.env["RUNNER_ENVIRONMENT" /* RUNNER_ENVIRONMENT */] === "self-hosted" && process.env[envVar] !== "true") { - logger.info( - `Disabling ${featureName} as we are on a self-hosted runner.${getWorkflowEventName() !== "dynamic" ? ` To override this, set the ${envVar} environment variable to 'true' in your workflow. See ${"https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow" /* DEFINE_ENV_VARIABLES */} for more information.` : ""}` - ); - core13.exportVariable(envVar, "false"); - } else { - logger.info( - `Enabling ${featureName}. This can be disabled by setting the ${envVar} environment variable to 'false'. See ${"https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow" /* DEFINE_ENV_VARIABLES */} for more information.` - ); - core13.exportVariable(envVar, "true"); - } - } else { - logger.info(`Disabling ${featureName}.`); - core13.exportVariable(envVar, "false"); - } -} -async function runAutobuild(config, language, logger) { - logger.startGroup(`Attempting to automatically build ${language} code`); - const codeQL = await getCodeQL(logger, config.codeQLCmd); - if (language === "cpp" /* cpp */) { - await setupCppAutobuild(codeQL, logger); - } - if (config.buildMode) { - await codeQL.extractUsingBuildMode(config, language); - } else { - await codeQL.runAutobuild(config, language); - } - if (language === "go" /* go */) { - core13.exportVariable("CODEQL_ACTION_DID_AUTOBUILD_GOLANG" /* DID_AUTOBUILD_GOLANG */, "true"); - } - logger.endGroup(); -} - -// src/dependency-caching.ts -var os5 = __toESM(require("os")); -var import_path3 = require("path"); -var actionsCache4 = __toESM(require_cache4()); -var glob = __toESM(require_glob()); -var CODEQL_DEPENDENCY_CACHE_PREFIX = "codeql-dependencies"; -var CODEQL_DEPENDENCY_CACHE_VERSION = 1; -function getJavaTempDependencyDir() { - return (0, import_path3.join)(getTemporaryDirectory(), "codeql_java", "repository"); -} -async function getJavaDependencyDirs() { - return [ - // Maven - (0, import_path3.join)(os5.homedir(), ".m2", "repository"), - // Gradle - (0, import_path3.join)(os5.homedir(), ".gradle", "caches"), - // CodeQL Java build-mode: none - getJavaTempDependencyDir() - ]; -} -function getCsharpTempDependencyDir() { - return (0, import_path3.join)(getTemporaryDirectory(), "codeql_csharp", "repository"); -} -async function getCsharpDependencyDirs(codeql, features) { - const dirs = [ - // Nuget - (0, import_path3.join)(os5.homedir(), ".nuget", "packages") - ]; - if (await features.getValue("csharp_cache_bmn" /* CsharpCacheBuildModeNone */, codeql)) { - dirs.push(getCsharpTempDependencyDir()); - } - return dirs; -} -async function makePatternCheck(patterns) { - const globber = await makeGlobber(patterns); - if ((await globber.glob()).length === 0) { - return void 0; - } - return patterns; -} -var CSHARP_BASE_PATTERNS = [ - // NuGet - "**/packages.lock.json", - // Paket - "**/paket.lock" -]; -var CSHARP_EXTRA_PATTERNS = [ - "**/*.csproj", - "**/packages.config", - "**/nuget.config" -]; -async function getCsharpHashPatterns(codeql, features) { - const basePatterns = await internal.makePatternCheck(CSHARP_BASE_PATTERNS); - if (basePatterns !== void 0) { - return basePatterns; - } - if (await features.getValue("csharp_new_cache_key" /* CsharpNewCacheKey */, codeql)) { - return internal.makePatternCheck(CSHARP_EXTRA_PATTERNS); - } - return void 0; -} -var defaultCacheConfigs = { - java: { - getDependencyPaths: getJavaDependencyDirs, - getHashPatterns: async () => internal.makePatternCheck([ - // Maven - "**/pom.xml", - // Gradle - "**/*.gradle*", - "**/gradle-wrapper.properties", - "buildSrc/**/Versions.kt", - "buildSrc/**/Dependencies.kt", - "gradle/*.versions.toml", - "**/versions.properties" - ]) - }, - csharp: { - getDependencyPaths: getCsharpDependencyDirs, - getHashPatterns: getCsharpHashPatterns - }, - go: { - getDependencyPaths: async () => [(0, import_path3.join)(os5.homedir(), "go", "pkg", "mod")], - getHashPatterns: async () => internal.makePatternCheck(["**/go.sum"]) - } -}; -async function makeGlobber(patterns) { - return glob.create(patterns.join("\n")); -} -async function checkHashPatterns(codeql, features, language, cacheConfig, checkType, logger) { - const patterns = await cacheConfig.getHashPatterns(codeql, features); - if (patterns === void 0) { - logger.info( - `Skipping ${checkType} of dependency cache for ${language} as we cannot calculate a hash for the cache key.` - ); - } - return patterns; -} -async function downloadDependencyCaches(codeql, features, languages, logger) { - const status = []; - const restoredKeys = []; - for (const language of languages) { - const cacheConfig = defaultCacheConfigs[language]; - if (cacheConfig === void 0) { - logger.info( - `Skipping download of dependency cache for ${language} as we have no caching configuration for it.` - ); - continue; - } - const patterns = await checkHashPatterns( - codeql, - features, - language, - cacheConfig, - "download", - logger - ); - if (patterns === void 0) { - status.push({ language, hit_kind: "no-hash" /* NoHash */ }); - continue; - } - const primaryKey = await cacheKey2(codeql, features, language, patterns); - const restoreKeys = [ - await cachePrefix2(codeql, features, language) - ]; - logger.info( - `Downloading cache for ${language} with key ${primaryKey} and restore keys ${restoreKeys.join( - ", " - )}` - ); - const start = performance.now(); - const hitKey = await actionsCache4.restoreCache( - await cacheConfig.getDependencyPaths(codeql, features), - primaryKey, - restoreKeys - ); - const download_duration_ms = Math.round(performance.now() - start); - if (hitKey !== void 0) { - logger.info(`Cache hit on key ${hitKey} for ${language}.`); - let hit_kind = "partial" /* Partial */; - if (hitKey === primaryKey) { - hit_kind = "exact" /* Exact */; - } - status.push({ - language, - hit_kind, - download_duration_ms - }); - restoredKeys.push(hitKey); - } else { - status.push({ language, hit_kind: "miss" /* Miss */ }); - logger.info(`No suitable cache found for ${language}.`); - } - } - return { statusReport: status, restoredKeys }; -} -async function uploadDependencyCaches(codeql, features, config, logger) { - const status = []; - for (const language of config.languages) { - const cacheConfig = defaultCacheConfigs[language]; - if (cacheConfig === void 0) { - logger.info( - `Skipping upload of dependency cache for ${language} as we have no caching configuration for it.` - ); - continue; - } - const patterns = await checkHashPatterns( - codeql, - features, - language, - cacheConfig, - "upload", - logger - ); - if (patterns === void 0) { - status.push({ language, result: "no-hash" /* NoHash */ }); - continue; - } - const key = await cacheKey2(codeql, features, language, patterns); - if (config.dependencyCachingRestoredKeys.includes(key)) { - status.push({ language, result: "duplicate" /* Duplicate */ }); - continue; - } - const size = await getTotalCacheSize( - await cacheConfig.getDependencyPaths(codeql, features), - logger, - true - ); - if (size === 0) { - status.push({ language, result: "empty" /* Empty */ }); - logger.info( - `Skipping upload of dependency cache for ${language} since it is empty.` - ); - continue; - } - logger.info( - `Uploading cache of size ${size} for ${language} with key ${key}...` - ); - try { - const start = performance.now(); - await actionsCache4.saveCache( - await cacheConfig.getDependencyPaths(codeql, features), - key - ); - const upload_duration_ms = Math.round(performance.now() - start); - status.push({ - language, - result: "stored" /* Stored */, - upload_size_bytes: Math.round(size), - upload_duration_ms - }); - } catch (error3) { - if (error3 instanceof actionsCache4.ReserveCacheError) { - logger.info( - `Not uploading cache for ${language}, because ${key} is already in use.` - ); - logger.debug(error3.message); - status.push({ language, result: "duplicate" /* Duplicate */ }); - } else { - throw error3; - } - } - } - return status; -} -async function cacheKey2(codeql, features, language, patterns) { - const hash2 = await glob.hashFiles(patterns.join("\n")); - return `${await cachePrefix2(codeql, features, language)}${hash2}`; -} -async function getFeaturePrefix(codeql, features, language) { - const enabledFeatures = []; - const addFeatureIfEnabled = async (feature) => { - if (await features.getValue(feature, codeql)) { - enabledFeatures.push(feature); - } - }; - if (language === "csharp" /* csharp */) { - await addFeatureIfEnabled("csharp_new_cache_key" /* CsharpNewCacheKey */); - await addFeatureIfEnabled("csharp_cache_bmn" /* CsharpCacheBuildModeNone */); - } - if (enabledFeatures.length > 0) { - return `${createCacheKeyHash(enabledFeatures)}-`; - } - return ""; -} -async function cachePrefix2(codeql, features, language) { - const runnerOs = getRequiredEnvParam("RUNNER_OS"); - const customPrefix = process.env["CODEQL_ACTION_DEPENDENCY_CACHE_PREFIX" /* DEPENDENCY_CACHING_PREFIX */]; - let prefix = CODEQL_DEPENDENCY_CACHE_PREFIX; - if (customPrefix !== void 0 && customPrefix.length > 0) { - prefix = `${prefix}-${customPrefix}`; - } - const featurePrefix = await getFeaturePrefix(codeql, features, language); - return `${prefix}-${featurePrefix}${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`; -} -async function getDependencyCacheUsage(logger) { - try { - const caches = await listActionsCaches(CODEQL_DEPENDENCY_CACHE_PREFIX); - const totalSize = caches.reduce( - (acc, cache) => acc + (cache.size_in_bytes ?? 0), - 0 - ); - return { count: caches.length, size_bytes: totalSize }; - } catch (err) { - logger.warning( - `Unable to retrieve information about dependency cache usage: ${getErrorMessage(err)}` - ); - } - return void 0; -} -var internal = { - makePatternCheck -}; - -// src/analyze.ts -var CodeQLAnalysisError = class extends Error { - constructor(queriesStatusReport, message, error3) { - super(message); - this.queriesStatusReport = queriesStatusReport; - this.message = message; - this.error = error3; - this.name = "CodeQLAnalysisError"; - } - queriesStatusReport; - message; - error; -}; -async function setupPythonExtractor(logger) { - const codeqlPython = process.env["CODEQL_PYTHON"]; - if (codeqlPython === void 0 || codeqlPython.length === 0) { - return; - } - logger.warning( - "The CODEQL_PYTHON environment variable is no longer supported. Please remove it from your workflow. This environment variable was originally used to specify a Python executable that included the dependencies of your Python code, however Python analysis no longer uses these dependencies.\nIf you used CODEQL_PYTHON to force the version of Python to analyze as, please use CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION instead, such as 'CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION=2.7' or 'CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION=3.11'." - ); - return; -} -async function runExtraction(codeql, features, config, logger) { - for (const language of config.languages) { - if (dbIsFinalized(config, language, logger)) { - logger.debug( - `Database for ${language} has already been finalized, skipping extraction.` - ); - continue; - } - if (await shouldExtractLanguage(codeql, config, language)) { - logger.startGroup(`Extracting ${language}`); - if (language === "python" /* python */) { - await setupPythonExtractor(logger); - } - if (config.buildMode) { - if (language === "cpp" /* cpp */ && config.buildMode === "autobuild" /* Autobuild */) { - await setupCppAutobuild(codeql, logger); - } - if (language === "java" /* java */ && config.buildMode === "none" /* None */) { - process.env["CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS_DEPENDENCY_DIR"] = getJavaTempDependencyDir(); - } - if (language === "csharp" /* csharp */ && config.buildMode === "none" /* None */ && await features.getValue("csharp_cache_bmn" /* CsharpCacheBuildModeNone */)) { - process.env["CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR"] = getCsharpTempDependencyDir(); - } - await codeql.extractUsingBuildMode(config, language); - } else { - await codeql.extractScannedLanguage(config, language); - } - logger.endGroup(); - } - } -} -async function shouldExtractLanguage(codeql, config, language) { - return config.buildMode === "none" /* None */ || config.buildMode === "autobuild" /* Autobuild */ && process.env["CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY" /* AUTOBUILD_DID_COMPLETE_SUCCESSFULLY */] !== "true" || !config.buildMode && await codeql.isScannedLanguage(language); -} -function dbIsFinalized(config, language, logger) { - const dbPath = getCodeQLDatabasePath(config, language); - try { - const dbInfo = load( - fs17.readFileSync(path16.resolve(dbPath, "codeql-database.yml"), "utf8") - ); - return !("inProgress" in dbInfo); - } catch { - logger.warning( - `Could not check whether database for ${language} was finalized. Assuming it is not.` - ); - return false; - } -} -async function finalizeDatabaseCreation(codeql, features, config, threadsFlag, memoryFlag, logger) { - const extractionStart = import_perf_hooks3.performance.now(); - await runExtraction(codeql, features, config, logger); - const extractionTime = import_perf_hooks3.performance.now() - extractionStart; - const trapImportStart = import_perf_hooks3.performance.now(); - for (const language of config.languages) { - if (dbIsFinalized(config, language, logger)) { - logger.info( - `There is already a finalized database for ${language} at the location where the CodeQL Action places databases, so we did not create one.` - ); - } else { - logger.startGroup(`Finalizing ${language}`); - await codeql.finalizeDatabase( - getCodeQLDatabasePath(config, language), - threadsFlag, - memoryFlag, - config.debugMode - ); - logger.endGroup(); - } - } - const trapImportTime = import_perf_hooks3.performance.now() - trapImportStart; - return { - scanned_language_extraction_duration_ms: Math.round(extractionTime), - trap_import_duration_ms: Math.round(trapImportTime) - }; -} -async function setupDiffInformedQueryRun(logger) { - return await withGroupAsync( - "Generating diff range extension pack", - async () => { - const diffRanges = readDiffRangesJsonFile(logger); - if (diffRanges === void 0) { - logger.info( - "No precomputed diff ranges found; skipping diff-informed analysis stage." - ); - return void 0; - } - const checkoutPath = getRequiredInput("checkout_path"); - const packDir = writeDiffRangeDataExtensionPack( - logger, - diffRanges, - checkoutPath - ); - logger.info( - `Successfully created diff range extension pack at ${packDir}.` - ); - return packDir; - } - ); -} -function diffRangeExtensionPackContents(ranges, checkoutPath) { - const header = ` -extensions: - - addsTo: - pack: codeql/util - extensible: restrictAlertsTo - checkPresence: false - data: -`; - let data = ranges.map((range2) => { - const filename = path16.join(checkoutPath, range2.path).replaceAll(path16.sep, "/"); - return ` - [${dump(filename, { forceQuotes: true, quoteStyle: "single" }).trim()}, ${range2.startLine}, ${range2.endLine}] -`; - }).join(""); - if (!data) { - data = ' - ["", 0, 0]\n'; - } - return header + data; -} -function writeDiffRangeDataExtensionPack(logger, ranges, checkoutPath) { - if (ranges.length === 0) { - ranges = [{ path: "", startLine: 0, endLine: 0 }]; - } - const diffRangeDir = path16.join(getTemporaryDirectory(), "pr-diff-range"); - fs17.mkdirSync(diffRangeDir, { recursive: true }); - fs17.writeFileSync( - path16.join(diffRangeDir, "qlpack.yml"), - ` -name: codeql-action/pr-diff-range -version: 0.0.0 -library: true -extensionTargets: - codeql/util: '*' -dataExtensions: - - pr-diff-range.yml -` - ); - const extensionContents = diffRangeExtensionPackContents( - ranges, - checkoutPath - ); - const extensionFilePath = path16.join(diffRangeDir, "pr-diff-range.yml"); - fs17.writeFileSync(extensionFilePath, extensionContents); - logger.debug( - `Wrote pr-diff-range extension pack to ${extensionFilePath}: -${extensionContents}` - ); - return diffRangeDir; -} -var defaultSuites = /* @__PURE__ */ new Set([ - "security-experimental", - "security-extended", - "security-and-quality", - "code-quality", - "code-scanning" -]); -function resolveQuerySuiteAlias(language, maybeSuite) { - if (defaultSuites.has(maybeSuite)) { - return `${language}-${maybeSuite}.qls`; - } - return maybeSuite; -} -function addSarifExtension(analysis, base) { - return `${base}${analysis.sarifExtension}`; -} -async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir, automationDetailsId, codeql, config, logger, features) { - const statusReport = {}; - const queryFlags = [memoryFlag, threadsFlag]; - const incrementalMode = []; - if (config.overlayDatabaseMode !== "overlay-base" /* OverlayBase */) { - queryFlags.push("--expect-discarded-cache"); - } - statusReport.analysis_is_diff_informed = diffRangePackDir !== void 0; - if (diffRangePackDir) { - queryFlags.push(`--additional-packs=${diffRangePackDir}`); - queryFlags.push("--extension-packs=codeql-action/pr-diff-range"); - incrementalMode.push("diff-informed"); - } - statusReport.analysis_is_overlay = config.overlayDatabaseMode === "overlay" /* Overlay */; - statusReport.analysis_builds_overlay_base_database = config.overlayDatabaseMode === "overlay-base" /* OverlayBase */; - if (config.overlayDatabaseMode === "overlay" /* Overlay */) { - incrementalMode.push("overlay"); - } - const sarifRunPropertyFlag = incrementalMode.length > 0 ? `--sarif-run-property=incrementalMode=${incrementalMode.join(",")}` : void 0; - const dbAnalysisConfig = getPrimaryAnalysisConfig(config); - for (const language of config.languages) { - try { - const queries = []; - if (config.analysisKinds.length > 1) { - queries.push(getGeneratedSuitePath(config, language)); - if (isCodeQualityEnabled(config)) { - for (const qualityQuery of codeQualityQueries) { - queries.push(resolveQuerySuiteAlias(language, qualityQuery)); - } - } - } - logger.startGroup(`Running queries for ${language}`); - const startTimeRunQueries = (/* @__PURE__ */ new Date()).getTime(); - const databasePath = getCodeQLDatabasePath(config, language); - await codeql.databaseRunQueries(databasePath, queryFlags, queries); - logger.debug(`Finished running queries for ${language}.`); - statusReport[`analyze_builtin_queries_${language}_duration_ms`] = (/* @__PURE__ */ new Date()).getTime() - startTimeRunQueries; - const startTimeInterpretResults = /* @__PURE__ */ new Date(); - const { summary: analysisSummary, sarifFile } = await runInterpretResultsFor( - dbAnalysisConfig, - language, - void 0, - config.debugMode - ); - let qualityAnalysisSummary; - if (config.analysisKinds.length > 1 && isCodeQualityEnabled(config)) { - const qualityResult = await runInterpretResultsFor( - CodeQuality, - language, - codeQualityQueries.map( - (i) => resolveQuerySuiteAlias(language, i) - ), - config.debugMode - ); - qualityAnalysisSummary = qualityResult.summary; - } - const endTimeInterpretResults = /* @__PURE__ */ new Date(); - statusReport[`interpret_results_${language}_duration_ms`] = endTimeInterpretResults.getTime() - startTimeInterpretResults.getTime(); - logger.endGroup(); - if (analysisSummary.trim()) { - logger.info(analysisSummary); - } - if (qualityAnalysisSummary?.trim()) { - logger.info(qualityAnalysisSummary); - } - if (!config.enableFileCoverageInformation) { - logger.info( - "To speed up pull request analysis, file coverage information is only enabled when analyzing the default branch and protected branches." - ); - } - if (await features.getValue("qa_telemetry_enabled" /* QaTelemetryEnabled */)) { - const perQueryAlertCounts = getPerQueryAlertCounts(sarifFile); - const perQueryAlertCountEventReport = { - event: "codeql database interpret-results", - started_at: startTimeInterpretResults.toISOString(), - completed_at: endTimeInterpretResults.toISOString(), - exit_status: "success", - language, - properties: { - alertCounts: perQueryAlertCounts - } - }; - if (statusReport["event_reports"] === void 0) { - statusReport["event_reports"] = []; - } - statusReport["event_reports"].push(perQueryAlertCountEventReport); - } - } catch (e) { - statusReport.analyze_failure_language = language; - throw new CodeQLAnalysisError( - statusReport, - `Error running analysis for ${language}: ${getErrorMessage(e)}`, - wrapError(e) - ); - } - } - return statusReport; - async function runInterpretResultsFor(analysis, language, queries, enableDebugLogging) { - logger.info(`Interpreting ${analysis.name} results for ${language}`); - const category = analysis.fixCategory(logger, automationDetailsId); - const sarifFile = path16.join( - sarifFolder, - addSarifExtension(analysis, language) - ); - const summary = await runInterpretResults( - language, - queries, - sarifFile, - enableDebugLogging, - category - ); - return { summary, sarifFile }; - } - async function runInterpretResults(language, queries, sarifFile, enableDebugLogging, category) { - const databasePath = getCodeQLDatabasePath(config, language); - return await codeql.databaseInterpretResults( - databasePath, - queries, - sarifFile, - threadsFlag, - enableDebugLogging ? "-vv" : "-v", - sarifRunPropertyFlag, - category, - config, - features - ); - } - function getPerQueryAlertCounts(sarifPath) { - const sarifObject = JSON.parse( - fs17.readFileSync(sarifPath, "utf8") - ); - const perQueryAlertCounts = {}; - for (const sarifRun of sarifObject.runs) { - if (sarifRun.results) { - for (const result of sarifRun.results) { - const query = result.rule?.id || result.ruleId; - if (query) { - perQueryAlertCounts[query] = (perQueryAlertCounts[query] || 0) + 1; - } - } - } - } - return perQueryAlertCounts; - } -} -async function runFinalize(features, outputDir, threadsFlag, memoryFlag, codeql, config, logger) { - try { - await fs17.promises.rm(outputDir, { force: true, recursive: true }); - } catch (error3) { - if (error3?.code !== "ENOENT") { - throw error3; - } - } - await fs17.promises.mkdir(outputDir, { recursive: true }); - const timings = await finalizeDatabaseCreation( - codeql, - features, - config, - threadsFlag, - memoryFlag, - logger - ); - if (process.env["CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY" /* AUTOBUILD_DID_COMPLETE_SUCCESSFULLY */] !== "true") { - await endTracingForCluster(codeql, config, logger); - } - return timings; -} -async function warnIfGoInstalledAfterInit(config, logger) { - const goInitPath = process.env["CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */]; - if (process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG" /* DID_AUTOBUILD_GOLANG */] !== "true" && goInitPath !== void 0) { - const goBinaryPath = await io5.which("go", true); - if (goInitPath !== goBinaryPath) { - logger.warning( - `Expected \`which go\` to return ${goInitPath}, but got ${goBinaryPath}: please ensure that the correct version of Go is installed before the \`codeql-action/init\` Action is used.` - ); - addDiagnostic( - config, - "go" /* go */, - makeDiagnostic( - "go/workflow/go-installed-after-codeql-init", - "Go was installed after the `codeql-action/init` Action was run", - { - markdownMessage: "To avoid interfering with the CodeQL analysis, perform all installation steps before calling the `github/codeql-action/init` Action.", - visibility: { - statusPage: true, - telemetry: true, - cliSummaryTable: true - }, - severity: "warning" - } - ) - ); - } - } -} - -// src/database-upload.ts -var fs18 = __toESM(require("fs")); -async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetails, features, logger) { - if (getRequiredInput("upload-database") !== "true") { - logger.debug("Database upload disabled in workflow. Skipping upload."); - return []; - } - if (!config.analysisKinds.includes("code-scanning" /* CodeScanning */)) { - logger.debug( - `Not uploading database because 'analysis-kinds: ${"code-scanning" /* CodeScanning */}' is not enabled.` - ); - return []; - } - if (isInTestMode()) { - logger.debug("In test mode. Skipping database upload."); - return []; - } - if (config.gitHubVersion.type !== "GitHub.com" /* DOTCOM */ && config.gitHubVersion.type !== "GitHub Enterprise Cloud with data residency" /* GHEC_DR */) { - logger.debug("Not running against github.com or GHEC-DR. Skipping upload."); - return []; - } - if (!await isAnalyzingDefaultBranch()) { - logger.debug("Not analyzing default branch. Skipping upload."); - return []; - } - const shouldUploadOverlayBase = config.overlayDatabaseMode === "overlay-base" /* OverlayBase */ && await features.getValue("upload_overlay_db_to_api" /* UploadOverlayDbToApi */, codeql); - const cleanupLevel = shouldUploadOverlayBase ? "overlay" /* Overlay */ : "clear" /* Clear */; - await withGroupAsync("Cleaning up databases", async () => { - await codeql.databaseCleanupCluster(config, cleanupLevel); - }); - const reports = []; - for (const language of config.languages) { - let bundledDbSize = void 0; - try { - const bundledDb = await bundleDb(config, language, codeql, language, { - includeDiagnostics: false - }); - bundledDbSize = fs18.statSync(bundledDb).size; - const commitOid = await getCommitOid( - getRequiredInput("checkout_path") - ); - const maxAttempts = 4; - let uploadDurationMs; - for (let attempt = 1; attempt <= maxAttempts; attempt++) { - try { - uploadDurationMs = await uploadBundledDatabase( - repositoryNwo, - language, - commitOid, - bundledDb, - bundledDbSize, - apiDetails - ); - break; - } catch (e) { - const httpError = asHTTPError(e); - const isRetryable = !httpError || !DO_NOT_RETRY_STATUSES.includes(httpError.status); - if (!isRetryable) { - throw e; - } else if (attempt === maxAttempts) { - logger.error( - `Maximum retry attempts exhausted (${attempt}), aborting database upload` - ); - throw e; - } - const backoffMs = 15e3 * Math.pow(2, attempt - 1); - logger.debug( - `Database upload attempt ${attempt} of ${maxAttempts} failed for ${language}: ${getErrorMessage(e)}. Retrying in ${backoffMs / 1e3}s...` - ); - await new Promise((resolve14) => setTimeout(resolve14, backoffMs)); - } - } - reports.push({ - language, - zipped_upload_size_bytes: bundledDbSize, - is_overlay_base: shouldUploadOverlayBase, - upload_duration_ms: uploadDurationMs - }); - logger.debug(`Successfully uploaded database for ${language}`); - } catch (e) { - logger.warning( - `Failed to upload database for ${language}: ${getErrorMessage(e)}` - ); - reports.push({ - language, - error: getErrorMessage(e), - ...bundledDbSize !== void 0 ? { zipped_upload_size_bytes: bundledDbSize } : {} - }); - } - } - if (shouldUploadOverlayBase && !config.debugMode) { - await withGroupAsync( - "Measuring database size at the clear cleanup level", - () => recordClearCleanupSizes(codeql, config, reports, logger) - ); - } - return reports; -} -async function recordClearCleanupSizes(codeql, config, reports, logger) { - const startTime = performance.now(); - try { - await codeql.databaseCleanupCluster(config, "clear" /* Clear */); - } catch (e) { - logger.warning( - `Failed to clean up databases at the '${"clear" /* Clear */}' level for size measurement: ${getErrorMessage(e)}` - ); - return; - } - for (const language of config.languages) { - const report = reports.find((r) => r.language === language); - if (report === void 0) { - continue; - } - try { - const bundledDb = await bundleDb(config, language, codeql, language, { - includeDiagnostics: false - }); - report.clear_cleanup_zipped_size_bytes = fs18.statSync(bundledDb).size; - logger.debug( - `Database for ${language} is ${report.clear_cleanup_zipped_size_bytes} bytes zipped at the '${"clear" /* Clear */}' cleanup level (vs. ${report.zipped_upload_size_bytes ?? "unknown"} bytes at the '${"overlay" /* Overlay */}' level).` - ); - } catch (e) { - logger.warning( - `Failed to measure the '${"clear" /* Clear */}' cleanup database size for ${language}: ${getErrorMessage(e)}` - ); - } - } - const durationMs = performance.now() - startTime; - for (const report of reports) { - report.clear_cleanup_measurement_duration_ms = durationMs; - } -} -async function uploadBundledDatabase(repositoryNwo, language, commitOid, bundledDb, bundledDbSize, apiDetails) { - const client = getApiClient(); - const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url)); - uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`; - let uploadsBaseUrl = uploadsUrl.toString(); - if (uploadsBaseUrl.endsWith("/")) { - uploadsBaseUrl = uploadsBaseUrl.slice(0, -1); - } - const bundledDbReadStream = fs18.createReadStream(bundledDb); - try { - const startTime = performance.now(); - await client.request( - `POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, - { - baseUrl: uploadsBaseUrl, - owner: repositoryNwo.owner, - repo: repositoryNwo.repo, - language, - name: `${language}-database`, - commit_oid: commitOid, - data: bundledDbReadStream, - headers: { - authorization: `token ${apiDetails.auth}`, - "Content-Type": "application/zip", - "Content-Length": bundledDbSize - }, - // Disable `octokit/plugin-retry.js`, since the request body is a ReadStream which can only be consumed once. - request: { - retries: 0 - } - } - ); - return performance.now() - startTime; - } finally { - bundledDbReadStream.close(); - } -} - -// src/upload-lib.ts -var upload_lib_exports = {}; -__export(upload_lib_exports, { - buildPayload: () => buildPayload, - filterAlertsByDiffRange: () => filterAlertsByDiffRange, - findSarifFilesInDir: () => findSarifFilesInDir, - getGroupedSarifFilePaths: () => getGroupedSarifFilePaths, - populateRunAutomationDetails: () => populateRunAutomationDetails, - postProcessSarifFiles: () => postProcessSarifFiles, - readSarifFileOrThrow: () => readSarifFileOrThrow, - shouldConsiderConfigurationError: () => shouldConsiderConfigurationError, - shouldConsiderInvalidRequest: () => shouldConsiderInvalidRequest, - shouldShowCombineSarifFilesDeprecationWarning: () => shouldShowCombineSarifFilesDeprecationWarning, - throwIfCombineSarifFilesDisabled: () => throwIfCombineSarifFilesDisabled, - uploadFiles: () => uploadFiles, - uploadPayload: () => uploadPayload, - uploadPostProcessedFiles: () => uploadPostProcessedFiles, - validateSarifFileSchema: () => validateSarifFileSchema, - validateUniqueCategory: () => validateUniqueCategory, - waitForProcessing: () => waitForProcessing, - writePostProcessedFiles: () => writePostProcessedFiles -}); -var fs22 = __toESM(require("fs")); -var path19 = __toESM(require("path")); -var url = __toESM(require("url")); -var import_zlib = __toESM(require("zlib")); -var core15 = __toESM(require_core()); -var jsonschema2 = __toESM(require_lib2()); - -// src/fingerprints.ts -var fs19 = __toESM(require("fs")); -var import_path4 = __toESM(require("path")); - -// node_modules/long/index.js -var wasm = null; -try { - wasm = new WebAssembly.Instance( - new WebAssembly.Module( - new Uint8Array([ - // \0asm - 0, - 97, - 115, - 109, - // version 1 - 1, - 0, - 0, - 0, - // section "type" - 1, - 13, - 2, - // 0, () => i32 - 96, - 0, - 1, - 127, - // 1, (i32, i32, i32, i32) => i32 - 96, - 4, - 127, - 127, - 127, - 127, - 1, - 127, - // section "function" - 3, - 7, - 6, - // 0, type 0 - 0, - // 1, type 1 - 1, - // 2, type 1 - 1, - // 3, type 1 - 1, - // 4, type 1 - 1, - // 5, type 1 - 1, - // section "global" - 6, - 6, - 1, - // 0, "high", mutable i32 - 127, - 1, - 65, - 0, - 11, - // section "export" - 7, - 50, - 6, - // 0, "mul" - 3, - 109, - 117, - 108, - 0, - 1, - // 1, "div_s" - 5, - 100, - 105, - 118, - 95, - 115, - 0, - 2, - // 2, "div_u" - 5, - 100, - 105, - 118, - 95, - 117, - 0, - 3, - // 3, "rem_s" - 5, - 114, - 101, - 109, - 95, - 115, - 0, - 4, - // 4, "rem_u" - 5, - 114, - 101, - 109, - 95, - 117, - 0, - 5, - // 5, "get_high" - 8, - 103, - 101, - 116, - 95, - 104, - 105, - 103, - 104, - 0, - 0, - // section "code" - 10, - 191, - 1, - 6, - // 0, "get_high" - 4, - 0, - 35, - 0, - 11, - // 1, "mul" - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 126, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - // 2, "div_s" - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 127, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - // 3, "div_u" - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 128, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - // 4, "rem_s" - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 129, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - // 5, "rem_u" - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 130, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11 - ]) - ), - {} - ).exports; -} catch { -} -function Long(low, high, unsigned) { - this.low = low | 0; - this.high = high | 0; - this.unsigned = !!unsigned; -} -Long.prototype.__isLong__; -Object.defineProperty(Long.prototype, "__isLong__", { value: true }); -function isLong(obj) { - return (obj && obj["__isLong__"]) === true; -} -function ctz32(value) { - var c = Math.clz32(value & -value); - return value ? 31 - c : c; -} -Long.isLong = isLong; -var INT_CACHE = {}; -var UINT_CACHE = {}; -function fromInt(value, unsigned) { - var obj, cachedObj, cache; - if (unsigned) { - value >>>= 0; - if (cache = 0 <= value && value < 256) { - cachedObj = UINT_CACHE[value]; - if (cachedObj) return cachedObj; - } - obj = fromBits(value, 0, true); - if (cache) UINT_CACHE[value] = obj; - return obj; - } else { - value |= 0; - if (cache = -128 <= value && value < 128) { - cachedObj = INT_CACHE[value]; - if (cachedObj) return cachedObj; - } - obj = fromBits(value, value < 0 ? -1 : 0, false); - if (cache) INT_CACHE[value] = obj; - return obj; - } -} -Long.fromInt = fromInt; -function fromNumber(value, unsigned) { - if (isNaN(value)) return unsigned ? UZERO : ZERO; - if (unsigned) { - if (value < 0) return UZERO; - if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; - } else { - if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; - if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; - } - if (value < 0) return fromNumber(-value, unsigned).neg(); - return fromBits( - value % TWO_PWR_32_DBL | 0, - value / TWO_PWR_32_DBL | 0, - unsigned - ); -} -Long.fromNumber = fromNumber; -function fromBits(lowBits, highBits, unsigned) { - return new Long(lowBits, highBits, unsigned); -} -Long.fromBits = fromBits; -var pow_dbl = Math.pow; -function fromString(str, unsigned, radix) { - if (str.length === 0) throw Error("empty string"); - if (typeof unsigned === "number") { - radix = unsigned; - unsigned = false; - } else { - unsigned = !!unsigned; - } - if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") - return unsigned ? UZERO : ZERO; - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError("radix"); - var p; - if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen"); - else if (p === 0) { - return fromString(str.substring(1), unsigned, radix).neg(); - } - var radixToPower = fromNumber(pow_dbl(radix, 8)); - var result = ZERO; - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); - if (size < 8) { - var power = fromNumber(pow_dbl(radix, size)); - result = result.mul(power).add(fromNumber(value)); - } else { - result = result.mul(radixToPower); - result = result.add(fromNumber(value)); - } - } - result.unsigned = unsigned; - return result; -} -Long.fromString = fromString; -function fromValue(val, unsigned) { - if (typeof val === "number") return fromNumber(val, unsigned); - if (typeof val === "string") return fromString(val, unsigned); - return fromBits( - val.low, - val.high, - typeof unsigned === "boolean" ? unsigned : val.unsigned - ); -} -Long.fromValue = fromValue; -var TWO_PWR_16_DBL = 1 << 16; -var TWO_PWR_24_DBL = 1 << 24; -var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; -var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; -var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; -var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); -var ZERO = fromInt(0); -Long.ZERO = ZERO; -var UZERO = fromInt(0, true); -Long.UZERO = UZERO; -var ONE = fromInt(1); -Long.ONE = ONE; -var UONE = fromInt(1, true); -Long.UONE = UONE; -var NEG_ONE = fromInt(-1); -Long.NEG_ONE = NEG_ONE; -var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false); -Long.MAX_VALUE = MAX_VALUE; -var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true); -Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; -var MIN_VALUE = fromBits(0, 2147483648 | 0, false); -Long.MIN_VALUE = MIN_VALUE; -var LongPrototype = Long.prototype; -LongPrototype.toInt = function toInt() { - return this.unsigned ? this.low >>> 0 : this.low; -}; -LongPrototype.toNumber = function toNumber() { - if (this.unsigned) - return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); - return this.high * TWO_PWR_32_DBL + (this.low >>> 0); -}; -LongPrototype.toString = function toString(radix) { - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError("radix"); - if (this.isZero()) return "0"; - if (this.isNegative()) { - if (this.eq(MIN_VALUE)) { - var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); - return div.toString(radix) + rem1.toInt().toString(radix); - } else return "-" + this.neg().toString(radix); - } - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; - var result = ""; - while (true) { - var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix); - rem = remDiv; - if (rem.isZero()) return digits + result; - else { - while (digits.length < 6) digits = "0" + digits; - result = "" + digits + result; - } - } -}; -LongPrototype.getHighBits = function getHighBits() { - return this.high; -}; -LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; -}; -LongPrototype.getLowBits = function getLowBits() { - return this.low; -}; -LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { - return this.low >>> 0; -}; -LongPrototype.getNumBitsAbs = function getNumBitsAbs() { - if (this.isNegative()) - return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break; - return this.high != 0 ? bit + 33 : bit + 1; -}; -LongPrototype.isSafeInteger = function isSafeInteger() { - var top11Bits = this.high >> 21; - if (!top11Bits) return true; - if (this.unsigned) return false; - return top11Bits === -1 && !(this.low === 0 && this.high === -2097152); -}; -LongPrototype.isZero = function isZero() { - return this.high === 0 && this.low === 0; -}; -LongPrototype.eqz = LongPrototype.isZero; -LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; -}; -LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; -}; -LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; -}; -LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; -}; -LongPrototype.equals = function equals(other) { - if (!isLong(other)) other = fromValue(other); - if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) - return false; - return this.high === other.high && this.low === other.low; -}; -LongPrototype.eq = LongPrototype.equals; -LongPrototype.notEquals = function notEquals(other) { - return !this.eq( - /* validates */ - other - ); -}; -LongPrototype.neq = LongPrototype.notEquals; -LongPrototype.ne = LongPrototype.notEquals; -LongPrototype.lessThan = function lessThan(other) { - return this.comp( - /* validates */ - other - ) < 0; -}; -LongPrototype.lt = LongPrototype.lessThan; -LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { - return this.comp( - /* validates */ - other - ) <= 0; -}; -LongPrototype.lte = LongPrototype.lessThanOrEqual; -LongPrototype.le = LongPrototype.lessThanOrEqual; -LongPrototype.greaterThan = function greaterThan(other) { - return this.comp( - /* validates */ - other - ) > 0; -}; -LongPrototype.gt = LongPrototype.greaterThan; -LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { - return this.comp( - /* validates */ - other - ) >= 0; -}; -LongPrototype.gte = LongPrototype.greaterThanOrEqual; -LongPrototype.ge = LongPrototype.greaterThanOrEqual; -LongPrototype.compare = function compare2(other) { - if (!isLong(other)) other = fromValue(other); - if (this.eq(other)) return 0; - var thisNeg = this.isNegative(), otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) return -1; - if (!thisNeg && otherNeg) return 1; - if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; - return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; -}; -LongPrototype.comp = LongPrototype.compare; -LongPrototype.negate = function negate() { - if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; - return this.not().add(ONE); -}; -LongPrototype.neg = LongPrototype.negate; -LongPrototype.add = function add(addend) { - if (!isLong(addend)) addend = fromValue(addend); - var a48 = this.high >>> 16; - var a32 = this.high & 65535; - var a16 = this.low >>> 16; - var a00 = this.low & 65535; - var b48 = addend.high >>> 16; - var b32 = addend.high & 65535; - var b16 = addend.low >>> 16; - var b00 = addend.low & 65535; - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 65535; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 65535; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 65535; - c48 += a48 + b48; - c48 &= 65535; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); -}; -LongPrototype.subtract = function subtract(subtrahend) { - if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); - return this.add(subtrahend.neg()); -}; -LongPrototype.sub = LongPrototype.subtract; -LongPrototype.multiply = function multiply(multiplier) { - if (this.isZero()) return this; - if (!isLong(multiplier)) multiplier = fromValue(multiplier); - if (wasm) { - var low = wasm["mul"](this.low, this.high, multiplier.low, multiplier.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; - if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; - if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; - if (this.isNegative()) { - if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); - else return this.neg().mul(multiplier).neg(); - } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); - if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) - return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); - var a48 = this.high >>> 16; - var a32 = this.high & 65535; - var a16 = this.low >>> 16; - var a00 = this.low & 65535; - var b48 = multiplier.high >>> 16; - var b32 = multiplier.high & 65535; - var b16 = multiplier.low >>> 16; - var b00 = multiplier.low & 65535; - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 65535; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 65535; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 65535; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 65535; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 65535; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 65535; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 65535; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); -}; -LongPrototype.mul = LongPrototype.multiply; -LongPrototype.divide = function divide(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (divisor.isZero()) throw Error("division by zero"); - if (wasm) { - if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) { - return this; - } - var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])( - this.low, - this.high, - divisor.low, - divisor.high - ); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - if (this.isZero()) return this.unsigned ? UZERO : ZERO; - var approx, rem, res; - if (!this.unsigned) { - if (this.eq(MIN_VALUE)) { - if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) - return MIN_VALUE; - else if (divisor.eq(MIN_VALUE)) return ONE; - else { - var halfThis = this.shr(1); - approx = halfThis.div(divisor).shl(1); - if (approx.eq(ZERO)) { - return divisor.isNegative() ? ONE : NEG_ONE; - } else { - rem = this.sub(divisor.mul(approx)); - res = approx.add(rem.div(divisor)); - return res; - } - } - } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; - if (this.isNegative()) { - if (divisor.isNegative()) return this.neg().div(divisor.neg()); - return this.neg().div(divisor).neg(); - } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); - res = ZERO; - } else { - if (!divisor.unsigned) divisor = divisor.toUnsigned(); - if (divisor.gt(this)) return UZERO; - if (divisor.gt(this.shru(1))) - return UONE; - res = UZERO; - } - rem = this; - while (rem.gte(divisor)) { - approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); - var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); - while (approxRem.isNegative() || approxRem.gt(rem)) { - approx -= delta; - approxRes = fromNumber(approx, this.unsigned); - approxRem = approxRes.mul(divisor); - } - if (approxRes.isZero()) approxRes = ONE; - res = res.add(approxRes); - rem = rem.sub(approxRem); - } - return res; -}; -LongPrototype.div = LongPrototype.divide; -LongPrototype.modulo = function modulo(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (wasm) { - var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])( - this.low, - this.high, - divisor.low, - divisor.high - ); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - return this.sub(this.div(divisor).mul(divisor)); -}; -LongPrototype.mod = LongPrototype.modulo; -LongPrototype.rem = LongPrototype.modulo; -LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); -}; -LongPrototype.countLeadingZeros = function countLeadingZeros() { - return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; -}; -LongPrototype.clz = LongPrototype.countLeadingZeros; -LongPrototype.countTrailingZeros = function countTrailingZeros() { - return this.low ? ctz32(this.low) : ctz32(this.high) + 32; -}; -LongPrototype.ctz = LongPrototype.countTrailingZeros; -LongPrototype.and = function and(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low & other.low, this.high & other.high, this.unsigned); -}; -LongPrototype.or = function or(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low | other.low, this.high | other.high, this.unsigned); -}; -LongPrototype.xor = function xor(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); -}; -LongPrototype.shiftLeft = function shiftLeft(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - else if (numBits < 32) - return fromBits( - this.low << numBits, - this.high << numBits | this.low >>> 32 - numBits, - this.unsigned - ); - else return fromBits(0, this.low << numBits - 32, this.unsigned); -}; -LongPrototype.shl = LongPrototype.shiftLeft; -LongPrototype.shiftRight = function shiftRight(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - else if (numBits < 32) - return fromBits( - this.low >>> numBits | this.high << 32 - numBits, - this.high >> numBits, - this.unsigned - ); - else - return fromBits( - this.high >> numBits - 32, - this.high >= 0 ? 0 : -1, - this.unsigned - ); -}; -LongPrototype.shr = LongPrototype.shiftRight; -LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits < 32) - return fromBits( - this.low >>> numBits | this.high << 32 - numBits, - this.high >>> numBits, - this.unsigned - ); - if (numBits === 32) return fromBits(this.high, 0, this.unsigned); - return fromBits(this.high >>> numBits - 32, 0, this.unsigned); -}; -LongPrototype.shru = LongPrototype.shiftRightUnsigned; -LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; -LongPrototype.rotateLeft = function rotateLeft(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = 32 - numBits; - return fromBits( - this.low << numBits | this.high >>> b, - this.high << numBits | this.low >>> b, - this.unsigned - ); - } - numBits -= 32; - b = 32 - numBits; - return fromBits( - this.high << numBits | this.low >>> b, - this.low << numBits | this.high >>> b, - this.unsigned - ); -}; -LongPrototype.rotl = LongPrototype.rotateLeft; -LongPrototype.rotateRight = function rotateRight(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = 32 - numBits; - return fromBits( - this.high << b | this.low >>> numBits, - this.low << b | this.high >>> numBits, - this.unsigned - ); - } - numBits -= 32; - b = 32 - numBits; - return fromBits( - this.low << b | this.high >>> numBits, - this.high << b | this.low >>> numBits, - this.unsigned - ); -}; -LongPrototype.rotr = LongPrototype.rotateRight; -LongPrototype.toSigned = function toSigned() { - if (!this.unsigned) return this; - return fromBits(this.low, this.high, false); -}; -LongPrototype.toUnsigned = function toUnsigned() { - if (this.unsigned) return this; - return fromBits(this.low, this.high, true); -}; -LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); -}; -LongPrototype.toBytesLE = function toBytesLE() { - var hi = this.high, lo = this.low; - return [ - lo & 255, - lo >>> 8 & 255, - lo >>> 16 & 255, - lo >>> 24, - hi & 255, - hi >>> 8 & 255, - hi >>> 16 & 255, - hi >>> 24 - ]; -}; -LongPrototype.toBytesBE = function toBytesBE() { - var hi = this.high, lo = this.low; - return [ - hi >>> 24, - hi >>> 16 & 255, - hi >>> 8 & 255, - hi & 255, - lo >>> 24, - lo >>> 16 & 255, - lo >>> 8 & 255, - lo & 255 - ]; -}; -Long.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); -}; -Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { - return new Long( - bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, - bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, - unsigned - ); -}; -Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { - return new Long( - bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], - bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], - unsigned - ); -}; -if (typeof BigInt === "function") { - Long.fromBigInt = function fromBigInt(value, unsigned) { - var lowBits = Number(BigInt.asIntN(32, value)); - var highBits = Number(BigInt.asIntN(32, value >> BigInt(32))); - return fromBits(lowBits, highBits, unsigned); - }; - Long.fromValue = function fromValueWithBigInt(value, unsigned) { - if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); - return fromValue(value, unsigned); - }; - LongPrototype.toBigInt = function toBigInt() { - var lowBigInt = BigInt(this.low >>> 0); - var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high); - return highBigInt << BigInt(32) | lowBigInt; - }; -} -var long_default = Long; - -// src/fingerprints.ts -var tab = " ".charCodeAt(0); -var space = " ".charCodeAt(0); -var lf = "\n".charCodeAt(0); -var cr = "\r".charCodeAt(0); -var EOF = 65535; -var BLOCK_SIZE = 100; -var MOD = long_default.fromInt(37); -function computeFirstMod() { - let firstMod = long_default.ONE; - for (let i = 0; i < BLOCK_SIZE; i++) { - firstMod = firstMod.multiply(MOD); - } - return firstMod; -} -async function hash(callback, filepath) { - const window2 = Array(BLOCK_SIZE).fill(0); - const lineNumbers = Array(BLOCK_SIZE).fill(-1); - let hashRaw = long_default.ZERO; - const firstMod = computeFirstMod(); - let index2 = 0; - let lineNumber = 0; - let lineStart = true; - let prevCR = false; - const hashCounts = {}; - const outputHash = function() { - const hashValue = hashRaw.toUnsigned().toString(16); - if (!hashCounts[hashValue]) { - hashCounts[hashValue] = 0; - } - hashCounts[hashValue]++; - callback(lineNumbers[index2], `${hashValue}:${hashCounts[hashValue]}`); - lineNumbers[index2] = -1; - }; - const updateHash = function(current) { - const begin = window2[index2]; - window2[index2] = current; - hashRaw = MOD.multiply(hashRaw).add(long_default.fromInt(current)).subtract(firstMod.multiply(long_default.fromInt(begin))); - index2 = (index2 + 1) % BLOCK_SIZE; - }; - const processCharacter = function(current) { - if (current === space || current === tab || prevCR && current === lf) { - prevCR = false; - return; - } - if (current === cr) { - current = lf; - prevCR = true; - } else { - prevCR = false; - } - if (lineNumbers[index2] !== -1) { - outputHash(); - } - if (lineStart) { - lineStart = false; - lineNumber++; - lineNumbers[index2] = lineNumber; - } - if (current === lf) { - lineStart = true; - } - updateHash(current); - }; - const readStream = fs19.createReadStream(filepath, "utf8"); - for await (const data of readStream) { - for (let i = 0; i < data.length; ++i) { - processCharacter(data.charCodeAt(i)); - } - } - processCharacter(EOF); - for (let i = 0; i < BLOCK_SIZE; i++) { - if (lineNumbers[index2] !== -1) { - outputHash(); - } - updateHash(0); - } -} -function locationUpdateCallback(result, location, logger) { - let locationStartLine = location.physicalLocation?.region?.startLine; - if (locationStartLine === void 0) { - locationStartLine = 1; - } - return function(lineNumber, hashValue) { - if (locationStartLine !== lineNumber) { - return; - } - if (!result.partialFingerprints) { - result.partialFingerprints = {}; - } - const existingFingerprint = result.partialFingerprints.primaryLocationLineHash; - if (!existingFingerprint) { - result.partialFingerprints.primaryLocationLineHash = hashValue; - } else if (existingFingerprint !== hashValue) { - logger.warning( - `Calculated fingerprint of ${hashValue} for file ${location.physicalLocation.artifactLocation.uri} line ${lineNumber}, but found existing inconsistent fingerprint value ${existingFingerprint}` - ); - } - }; -} -function resolveUriToFile(location, artifacts, sourceRoot, logger) { - if (!location.uri && location.index !== void 0) { - if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject(artifacts[location.index].location)) { - logger.debug(`Ignoring location as index "${location.index}" is invalid`); - return void 0; - } - location = artifacts[location.index].location; - } - if (typeof location.uri !== "string") { - logger.debug(`Ignoring location as URI "${location.uri}" is invalid`); - return void 0; - } - let uri; - try { - uri = decodeURIComponent(location.uri); - } catch { - logger.debug(`Ignoring location as URI "${location.uri}" is invalid`); - return void 0; - } - const fileUriPrefix = "file://"; - if (uri.startsWith(fileUriPrefix)) { - uri = uri.substring(fileUriPrefix.length); - } - if (uri.indexOf("://") !== -1) { - logger.debug( - `Ignoring location URI "${uri}" as the scheme is not recognised` - ); - return void 0; - } - const srcRootPrefix = `${sourceRoot}/`; - if (uri.startsWith("/") && !uri.startsWith(srcRootPrefix)) { - logger.debug( - `Ignoring location URI "${uri}" as it is outside of the src root` - ); - return void 0; - } - if (!import_path4.default.isAbsolute(uri)) { - uri = srcRootPrefix + uri; - } - if (!fs19.existsSync(uri)) { - logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); - return void 0; - } - if (fs19.statSync(uri).isDirectory()) { - logger.debug(`Unable to compute fingerprint for directory: ${uri}`); - return void 0; - } - return uri; -} -async function addFingerprints(sarifLog, sourceRoot, logger) { - logger.info( - `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` - ); - const callbacksByFile = {}; - for (const run9 of sarifLog.runs || []) { - const artifacts = run9.artifacts || []; - for (const result of run9.results || []) { - const primaryLocation = (result.locations || [])[0]; - if (!primaryLocation?.physicalLocation?.artifactLocation) { - logger.debug( - `Unable to compute fingerprint for invalid location: ${JSON.stringify( - primaryLocation - )}` - ); - continue; - } - if (primaryLocation?.physicalLocation?.region?.startLine === void 0) { - continue; - } - const filepath = resolveUriToFile( - primaryLocation.physicalLocation.artifactLocation, - artifacts, - sourceRoot, - logger - ); - if (!filepath) { - continue; - } - if (!callbacksByFile[filepath]) { - callbacksByFile[filepath] = []; - } - callbacksByFile[filepath].push( - locationUpdateCallback(result, primaryLocation, logger) - ); - } - } - for (const [filepath, callbacks] of Object.entries(callbacksByFile)) { - const teeCallback = function(lineNumber, hashValue) { - for (const c of Object.values(callbacks)) { - c(lineNumber, hashValue); - } - }; - await hash(teeCallback, filepath); - } - return sarifLog; -} - -// src/init.ts -var fs20 = __toESM(require("fs")); -var path18 = __toESM(require("path")); -var core14 = __toESM(require_core()); -var toolrunner4 = __toESM(require_toolrunner()); -var github3 = __toESM(require_github()); -var io6 = __toESM(require_io()); -async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, rawLanguages, useOverlayAwareDefaultCliVersion, features, logger) { - logger.startGroup("Setup CodeQL tools"); - const { codeql, toolsDownloadStatusReport, toolsSource, toolsVersion } = await setupCodeQL( - toolsInput, - apiDetails, - tempDir, - variant, - defaultCliVersion, - rawLanguages, - useOverlayAwareDefaultCliVersion, - features, - logger, - true - ); - await codeql.printVersion(); - logger.endGroup(); - return { - codeql, - toolsDownloadStatusReport, - toolsSource, - toolsVersion - }; -} -async function initConfig2(actionState, inputs) { - return await withGroupAsync("Load language configuration", async () => { - return await initConfig(actionState, inputs); - }); -} -async function runDatabaseInitCluster(databaseInitEnvironment, codeql, config, sourceRoot, processName, qlconfigFile) { - fs20.mkdirSync(config.dbLocation, { recursive: true }); - await wrapEnvironment( - databaseInitEnvironment, - async () => await codeql.databaseInitCluster( - config, - sourceRoot, - processName, - qlconfigFile - ) - ); -} -async function checkPacksForOverlayCompatibility(codeql, config, logger) { - const codeQlOverlayVersion = (await codeql.getVersion()).overlayVersion; - if (codeQlOverlayVersion === void 0) { - logger.warning("The CodeQL CLI does not support overlay analysis."); - return false; - } - for (const language of config.languages) { - const suitePath = getGeneratedSuitePath(config, language); - const packDirs = await codeql.resolveQueriesStartingPacks([suitePath]); - if (packDirs.some( - (packDir) => !checkPackForOverlayCompatibility( - packDir, - codeQlOverlayVersion, - logger - ) - )) { - return false; - } - } - return true; -} -function checkPackForOverlayCompatibility(packDir, codeQlOverlayVersion, logger) { - try { - let qlpackPath = path18.join(packDir, "qlpack.yml"); - if (!fs20.existsSync(qlpackPath)) { - qlpackPath = path18.join(packDir, "codeql-pack.yml"); - } - const qlpackContents = load( - fs20.readFileSync(qlpackPath, "utf8") - ); - if (!qlpackContents.buildMetadata) { - return true; - } - const packInfoPath = path18.join(packDir, ".packinfo"); - if (!fs20.existsSync(packInfoPath)) { - logger.warning( - `The query pack at ${packDir} does not have a .packinfo file, so it cannot support overlay analysis. Recompiling the query pack with the latest CodeQL CLI should solve this problem.` - ); - return false; - } - const packInfoFileContents = JSON.parse( - fs20.readFileSync(packInfoPath, "utf8") - ); - const packOverlayVersion = packInfoFileContents.overlayVersion; - if (typeof packOverlayVersion !== "number") { - logger.warning( - `The .packinfo file for the query pack at ${packDir} does not have the overlayVersion field, which indicates that the pack is not compatible with overlay analysis.` - ); - return false; - } - if (packOverlayVersion !== codeQlOverlayVersion) { - logger.warning( - `The query pack at ${packDir} was compiled with overlay version ${packOverlayVersion}, but the CodeQL CLI supports overlay version ${codeQlOverlayVersion}. The query pack needs to be recompiled to support overlay analysis.` - ); - return false; - } - } catch (e) { - logger.warning( - `Error while checking pack at ${packDir} for overlay compatibility: ${getErrorMessage(e)}` - ); - return false; - } - return true; -} -async function checkInstallPython311(languages, codeql) { - if (languages.includes("python" /* python */) && process.platform === "win32" && !(await codeql.getVersion()).features?.supportsPython312) { - const script = path18.resolve( - __dirname, - "../python-setup", - "check_python12.ps1" - ); - await new toolrunner4.ToolRunner(await io6.which("powershell", true), [ - script - ]).exec(); - } -} -function cleanupDatabaseClusterDirectory(config, logger, options = {}, rmSync5 = fs20.rmSync) { - if (fs20.existsSync(config.dbLocation) && (fs20.statSync(config.dbLocation).isFile() || fs20.readdirSync(config.dbLocation).length > 0)) { - if (!options.disableExistingDirectoryWarning) { - logger.warning( - `The database cluster directory ${config.dbLocation} must be empty. Attempting to clean it up.` - ); - } - try { - rmSync5(config.dbLocation, { - force: true, - maxRetries: 3, - recursive: true - }); - logger.info( - `Cleaned up database cluster directory ${config.dbLocation}.` - ); - } catch (e) { - const blurb = `The CodeQL Action requires an empty database cluster directory. ${getOptionalInput("db-location") ? `This is currently configured to be ${config.dbLocation}. ` : `By default, this is located at ${config.dbLocation}. You can customize it using the 'db-location' input to the init Action. `}An attempt was made to clean up the directory, but this failed.`; - if (isSelfHostedRunner()) { - throw new ConfigurationError( - `${blurb} This can happen if another process is using the directory or the directory is owned by a different user. Please clean up the directory manually and rerun the job. Details: ${getErrorMessage( - e - )}` - ); - } else { - throw new Error( - `${blurb} This shouldn't typically happen on hosted runners. If you are using an advanced setup, please check your workflow, otherwise we recommend rerunning the job. Details: ${getErrorMessage(e)}` - ); - } - } - } -} -async function getFileCoverageInformationEnabled(debugMode, codeql, features, repositoryProperties) { - if (debugMode) { - return { - enabled: true, - enabledByRepositoryProperty: false, - showDeprecationWarning: false - }; - } - if (!isAnalyzingPullRequest()) { - return { - enabled: true, - enabledByRepositoryProperty: false, - showDeprecationWarning: false - }; - } - if ((process.env["CODEQL_ACTION_FILE_COVERAGE_ON_PRS" /* FILE_COVERAGE_ON_PRS */] || "").toLocaleLowerCase() === "true") { - return { - enabled: true, - enabledByRepositoryProperty: false, - showDeprecationWarning: false - }; - } - if (repositoryProperties["github-codeql-file-coverage-on-prs" /* FILE_COVERAGE_ON_PRS */] === true) { - return { - enabled: true, - enabledByRepositoryProperty: true, - showDeprecationWarning: false - }; - } - if (!await features.getValue("skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */, codeql)) { - return { - enabled: true, - enabledByRepositoryProperty: false, - showDeprecationWarning: true - }; - } - return { - enabled: false, - enabledByRepositoryProperty: false, - showDeprecationWarning: false - }; -} -function logFileCoverageOnPrsDeprecationWarning(logger) { - if (process.env["CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION" /* DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION */]) { - return; - } - const repositoryOwnerType = github3.context.payload.repository?.owner.type; - let message = "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses."; - const envVarOptOut = "set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`."; - const repoPropertyOptOut = 'create a custom repository property with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to `true` in the repository\'s settings.'; - if (repositoryOwnerType === "Organization") { - if (isDefaultSetup()) { - message += ` - -To opt out of this change, ${repoPropertyOptOut}`; - } else { - message += ` - -To opt out of this change, ${envVarOptOut} Alternatively, ${repoPropertyOptOut}`; - } - } else if (isDefaultSetup()) { - message += ` - -To opt out of this change, switch to an advanced setup workflow and ${envVarOptOut}`; - } else { - message += ` - -To opt out of this change, ${envVarOptOut}`; - } - logger.warning(message); - core14.exportVariable("CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION" /* DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION */, "true"); -} - -// src/sarif/index.ts -var fs21 = __toESM(require("fs")); -var InvalidSarifUploadError = class extends Error { -}; -function getToolNames(sarifFile) { - const toolNames = {}; - for (const run9 of sarifFile.runs || []) { - const tool = run9.tool || {}; - const driver = tool.driver || {}; - if (typeof driver.name === "string" && driver.name.length > 0) { - toolNames[driver.name] = true; - } - } - return Object.keys(toolNames); -} -function readSarifFile(sarifFilePath) { - return JSON.parse(fs21.readFileSync(sarifFilePath, "utf8")); -} -function combineSarifFiles(sarifFiles, logger) { - logger.info(`Loading SARIF file(s)`); - const runs = []; - let version = void 0; - for (const sarifFile of sarifFiles) { - logger.debug(`Loading SARIF file: ${sarifFile}`); - const sarifLog = readSarifFile(sarifFile); - if (version === void 0) { - version = sarifLog.version; - } else if (version !== sarifLog.version) { - throw new InvalidSarifUploadError( - `Different SARIF versions encountered: ${version} and ${sarifLog.version}` - ); - } - runs.push(...sarifLog?.runs || []); - } - if (version === void 0) { - version = "2.1.0"; - } - return { version, runs }; -} -function areAllRunsProducedByCodeQL(sarifLogs) { - return sarifLogs.every((sarifLog) => { - return sarifLog.runs?.every((run9) => run9.tool?.driver?.name === "CodeQL"); - }); -} -function createRunKey(run9) { - return { - name: run9.tool?.driver?.name, - fullName: run9.tool?.driver?.fullName, - version: run9.tool?.driver?.version, - semanticVersion: run9.tool?.driver?.semanticVersion, - guid: run9.tool?.driver?.guid, - automationId: run9.automationDetails?.id - }; -} -function areAllRunsUnique(sarifLogs) { - const keys = /* @__PURE__ */ new Set(); - for (const sarifLog of sarifLogs) { - if (sarifLog.runs === void 0) { - continue; - } - for (const run9 of sarifLog.runs) { - const key = JSON.stringify(createRunKey(run9)); - if (keys.has(key)) { - return false; - } - keys.add(key); - } - } - return true; -} - -// src/upload-lib.ts -var GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning."; -var GENERIC_404_MSG = "The CodeQL code scanning feature is forbidden on this repository."; -async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects) { - return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; -} -async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { - if (!await shouldDisableCombineSarifFiles(sarifObjects, githubVersion)) { - return; - } - const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2025-07-21-code-scanning-will-stop-combining-multiple-sarif-runs-uploaded-in-the-same-sarif-file/"; - throw new ConfigurationError( - `The CodeQL Action does not support uploading multiple SARIF runs with the same category. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}` - ); -} -async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) { - if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) { - if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) { - return false; - } - } - if (areAllRunsUnique(sarifObjects)) { - return false; - } - return true; -} -async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger) { - logger.info("Combining SARIF files using the CodeQL CLI"); - const sarifObjects = sarifFiles.map(readSarifFile); - const deprecationWarningMessage = gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025"; - const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload"; - if (!areAllRunsProducedByCodeQL(sarifObjects)) { - await throwIfCombineSarifFilesDisabled(sarifObjects, gitHubVersion); - logger.debug( - "Not all SARIF files were produced by CodeQL. Merging files in the action." - ); - if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects)) { - logger.warning( - `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}` - ); - core15.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); - } - return combineSarifFiles(sarifFiles, logger); - } - let codeQL; - let tempDir = getTemporaryDirectory(); - const config = await getConfig(tempDir, logger); - if (config !== void 0) { - codeQL = await getCodeQL(logger, config.codeQLCmd); - tempDir = config.tempDir; - } else { - logger.info( - "Initializing CodeQL since the 'init' Action was not called before this step." - ); - const apiDetails = { - auth: getRequiredInput("token"), - externalRepoAuth: getOptionalInput( - "external-repository-token" - ), - url: getRequiredEnvParam("GITHUB_SERVER_URL"), - apiURL: getRequiredEnvParam("GITHUB_API_URL") - }; - const codeQLDefaultVersionInfo = await features.getEnabledDefaultCliVersions(gitHubVersion.type); - const initCodeQLResult = await initCodeQL( - void 0, - // There is no tools input on the upload action - apiDetails, - tempDir, - gitHubVersion.type, - codeQLDefaultVersionInfo, - void 0, - // rawLanguages: upload-lib does not run analysis - false, - // useOverlayAwareDefaultCliVersion: upload-lib does not run analysis - features, - logger - ); - codeQL = initCodeQLResult.codeql; - } - const baseTempDir = path19.resolve(tempDir, "combined-sarif"); - fs22.mkdirSync(baseTempDir, { recursive: true }); - const outputDirectory = fs22.mkdtempSync(path19.resolve(baseTempDir, "output-")); - const outputFile = path19.resolve(outputDirectory, "combined-sarif.sarif"); - await codeQL.mergeResults(sarifFiles, outputFile, { - mergeRunsFromEqualCategory: true - }); - return readSarifFile(outputFile); -} -function populateRunAutomationDetails(sarifFile, category, analysis_key, environment) { - const automationID = getAutomationID2(category, analysis_key, environment); - if (automationID !== void 0) { - for (const run9 of sarifFile.runs || []) { - if (run9.automationDetails === void 0) { - run9.automationDetails = { - id: automationID - }; - } - } - return sarifFile; - } - return sarifFile; -} -function getAutomationID2(category, analysis_key, environment) { - if (category !== void 0) { - let automationID = category; - if (!automationID.endsWith("/")) { - automationID += "/"; - } - return automationID; - } - return computeAutomationID(analysis_key, environment); -} -async function uploadPayload(payload, repositoryNwo, logger, analysis) { - logger.info("Uploading results"); - if (shouldSkipSarifUpload()) { - const payloadSaveFile = path19.join( - getTemporaryDirectory(), - `payload-${analysis.kind}.json` - ); - logger.info( - `SARIF upload disabled by an environment variable. Saving to ${payloadSaveFile}` - ); - logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`); - fs22.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); - return "dummy-sarif-id"; - } - const client = getApiClient(); - try { - const response = await client.request(analysis.target, { - owner: repositoryNwo.owner, - repo: repositoryNwo.repo, - data: payload - }); - logger.debug(`response status: ${response.status}`); - logger.info("Successfully uploaded results"); - return response.data.id; - } catch (e) { - const httpError = asHTTPError(e); - if (httpError !== void 0) { - switch (httpError.status) { - case 403: - core15.warning(httpError.message || GENERIC_403_MSG); - break; - case 404: - core15.warning(httpError.message || GENERIC_404_MSG); - break; - default: - core15.warning(httpError.message); - break; - } - } - throw wrapApiConfigurationError(e); - } -} -function findSarifFilesInDir(sarifPath, isSarif) { - const sarifFiles = []; - const walkSarifFiles = (dir) => { - const entries = fs22.readdirSync(dir, { withFileTypes: true }); - for (const entry of entries) { - if (entry.isFile() && isSarif(entry.name)) { - sarifFiles.push(path19.resolve(dir, entry.name)); - } else if (entry.isDirectory()) { - walkSarifFiles(path19.resolve(dir, entry.name)); - } - } - }; - walkSarifFiles(sarifPath); - return sarifFiles; -} -function getSarifFilePaths(sarifPath, isSarif) { - if (!fs22.existsSync(sarifPath)) { - throw new ConfigurationError(`Path does not exist: ${sarifPath}`); - } - let sarifFiles; - if (fs22.lstatSync(sarifPath).isDirectory()) { - sarifFiles = findSarifFilesInDir(sarifPath, isSarif); - if (sarifFiles.length === 0) { - throw new ConfigurationError( - `No SARIF files found to upload in "${sarifPath}".` - ); - } - } else { - sarifFiles = [sarifPath]; - } - return sarifFiles; -} -async function getGroupedSarifFilePaths(logger, sarifPath) { - const stats = fs22.statSync(sarifPath, { throwIfNoEntry: false }); - if (stats === void 0) { - throw new ConfigurationError(`Path does not exist: ${sarifPath}`); - } - const results = {}; - if (stats.isDirectory()) { - let unassignedSarifFiles = findSarifFilesInDir( - sarifPath, - (name) => path19.extname(name) === ".sarif" - ); - logger.debug( - `Found the following .sarif files in ${sarifPath}: ${unassignedSarifFiles.join(", ")}` - ); - for (const analysisConfig of SarifScanOrder) { - const filesForCurrentAnalysis = unassignedSarifFiles.filter( - analysisConfig.sarifPredicate - ); - if (filesForCurrentAnalysis.length > 0) { - logger.debug( - `The following SARIF files are for ${analysisConfig.name}: ${filesForCurrentAnalysis.join(", ")}` - ); - unassignedSarifFiles = unassignedSarifFiles.filter( - (name) => !analysisConfig.sarifPredicate(name) - ); - results[analysisConfig.kind] = filesForCurrentAnalysis; - } else { - logger.debug(`Found no SARIF files for ${analysisConfig.name}`); - } - } - if (unassignedSarifFiles.length !== 0) { - logger.warning( - `Found files in ${sarifPath} which do not belong to any analysis: ${unassignedSarifFiles.join(", ")}` - ); - } - } else { - for (const analysisConfig of SarifScanOrder) { - if (analysisConfig.kind === "code-scanning" /* CodeScanning */ || analysisConfig.sarifPredicate(sarifPath)) { - logger.debug( - `Using '${sarifPath}' as a SARIF file for ${analysisConfig.name}.` - ); - results[analysisConfig.kind] = [sarifPath]; - break; - } - } - } - return results; -} -function countResultsInSarif(sarifLog) { - let numResults = 0; - const parsedSarif = JSON.parse(sarifLog); - if (!Array.isArray(parsedSarif.runs)) { - throw new InvalidSarifUploadError("Invalid SARIF. Missing 'runs' array."); - } - for (const run9 of parsedSarif.runs) { - if (!Array.isArray(run9.results)) { - throw new InvalidSarifUploadError( - "Invalid SARIF. Missing 'results' array in run." - ); - } - numResults += run9.results.length; - } - return numResults; -} -function readSarifFileOrThrow(sarifFilePath) { - try { - return readSarifFile(sarifFilePath); - } catch (e) { - throw new InvalidSarifUploadError( - `Invalid SARIF. JSON syntax error: ${getErrorMessage(e)}` - ); - } -} -function validateSarifFileSchema(sarifLog, sarifFilePath, logger) { - if (areAllRunsProducedByCodeQL([sarifLog]) && // We want to validate CodeQL SARIF in testing environments. - !getTestingEnvironment()) { - logger.debug( - `Skipping SARIF schema validation for ${sarifFilePath} as all runs are produced by CodeQL.` - ); - return true; - } - logger.info(`Validating ${sarifFilePath}`); - const schema = require_sarif_schema_2_1_0(); - const result = new jsonschema2.Validator().validate(sarifLog, schema); - const warningAttributes = ["uri-reference", "uri"]; - const errors = (result.errors ?? []).filter( - (err) => !(err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument)) - ); - const warnings = (result.errors ?? []).filter( - (err) => err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument) - ); - for (const warning14 of warnings) { - logger.info( - `Warning: '${warning14.instance}' is not a valid URI in '${warning14.property}'.` - ); - } - if (errors.length > 0) { - for (const error3 of errors) { - logger.startGroup(`Error details: ${error3.stack}`); - logger.info(JSON.stringify(error3, null, 2)); - logger.endGroup(); - } - const sarifErrors = errors.map((e) => `- ${e.stack}`); - throw new InvalidSarifUploadError( - `Unable to upload "${sarifFilePath}" as it is not valid SARIF: -${sarifErrors.join( - "\n" - )}` - ); - } - return true; -} -function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, mergeBaseCommitOid) { - const payloadObj = { - commit_oid: commitOid, - ref, - analysis_key: analysisKey, - analysis_name: analysisName, - sarif: zippedSarif, - workflow_run_id: workflowRunID, - workflow_run_attempt: workflowRunAttempt, - checkout_uri: checkoutURI, - environment, - started_at: process.env["CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */], - tool_names: toolNames, - base_ref: void 0, - base_sha: void 0 - }; - if (getWorkflowEventName() === "pull_request") { - if (commitOid === getRequiredEnvParam("GITHUB_SHA") && mergeBaseCommitOid) { - payloadObj.base_ref = `refs/heads/${getRequiredEnvParam( - "GITHUB_BASE_REF" - )}`; - payloadObj.base_sha = mergeBaseCommitOid; - } else if (process.env.GITHUB_EVENT_PATH) { - const githubEvent = JSON.parse( - fs22.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") - ); - payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`; - payloadObj.base_sha = githubEvent.pull_request.base.sha; - } - } - return payloadObj; -} -async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) { - logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`); - const gitHubVersion = await getGitHubVersion(); - let sarifLog; - category = analysis.fixCategory(logger, category); - if (sarifPaths.length > 1) { - for (const sarifPath of sarifPaths) { - const parsedSarif = readSarifFileOrThrow(sarifPath); - validateSarifFileSchema(parsedSarif, sarifPath, logger); - } - sarifLog = await combineSarifFilesUsingCLI( - sarifPaths, - gitHubVersion, - features, - logger - ); - } else { - const sarifPath = sarifPaths[0]; - sarifLog = readSarifFileOrThrow(sarifPath); - validateSarifFileSchema(sarifLog, sarifPath, logger); - await throwIfCombineSarifFilesDisabled([sarifLog], gitHubVersion); - } - sarifLog = filterAlertsByDiffRange(logger, sarifLog); - sarifLog = await addFingerprints(sarifLog, checkoutPath, logger); - const analysisKey = await getAnalysisKey(); - const environment = getRequiredInput("matrix"); - sarifLog = populateRunAutomationDetails( - sarifLog, - category, - analysisKey, - environment - ); - return { sarif: sarifLog, analysisKey, environment }; -} -async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProcessingResults) { - const outputPath = pathInput || getOptionalEnvVar("CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */); - if (outputPath !== void 0) { - dumpSarifFile( - JSON.stringify(postProcessingResults.sarif), - outputPath, - logger, - uploadTarget - ); - } else { - logger.debug(`Not writing post-processed SARIF files.`); - } -} -async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget) { - const sarifPaths = getSarifFilePaths( - inputSarifPath, - uploadTarget.sarifPredicate - ); - return uploadSpecifiedFiles( - sarifPaths, - checkoutPath, - category, - features, - logger, - uploadTarget - ); -} -async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) { - const processingResults = await postProcessSarifFiles( - logger, - features, - checkoutPath, - sarifPaths, - category, - uploadTarget - ); - return uploadPostProcessedFiles( - logger, - checkoutPath, - uploadTarget, - processingResults - ); -} -async function uploadPostProcessedFiles(logger, checkoutPath, uploadTarget, postProcessingResults) { - logger.startGroup(`Uploading ${uploadTarget.name} results`); - const sarifLog = postProcessingResults.sarif; - const toolNames = getToolNames(sarifLog); - logger.debug(`Validating that each SARIF run has a unique category`); - validateUniqueCategory(sarifLog, uploadTarget.sentinelPrefix); - logger.debug(`Serializing SARIF for upload`); - const sarifPayload = JSON.stringify(sarifLog); - logger.debug(`Compressing serialized SARIF`); - const zippedSarif = import_zlib.default.gzipSync(sarifPayload).toString("base64"); - const checkoutURI = url.pathToFileURL(checkoutPath).href; - const payload = uploadTarget.transformPayload( - buildPayload( - await getCommitOid(checkoutPath), - await getRef(), - postProcessingResults.analysisKey, - getRequiredEnvParam("GITHUB_WORKFLOW"), - zippedSarif, - getWorkflowRunID(), - getWorkflowRunAttempt(), - checkoutURI, - postProcessingResults.environment, - toolNames, - await determineBaseBranchHeadCommitOid() - ) - ); - const rawUploadSizeBytes = sarifPayload.length; - logger.debug(`Raw upload size: ${rawUploadSizeBytes} bytes`); - const zippedUploadSizeBytes = zippedSarif.length; - logger.debug(`Base64 zipped upload size: ${zippedUploadSizeBytes} bytes`); - const numResultInSarif = countResultsInSarif(sarifPayload); - logger.debug(`Number of results in upload: ${numResultInSarif}`); - const sarifID = await uploadPayload( - payload, - getRepositoryNwo(), - logger, - uploadTarget - ); - logger.endGroup(); - return { - statusReport: { - raw_upload_size_bytes: rawUploadSizeBytes, - zipped_upload_size_bytes: zippedUploadSizeBytes, - num_results_in_sarif: numResultInSarif - }, - sarifID - }; -} -function dumpSarifFile(sarifPayload, outputDir, logger, uploadTarget) { - if (!fs22.existsSync(outputDir)) { - fs22.mkdirSync(outputDir, { recursive: true }); - } else if (!fs22.lstatSync(outputDir).isDirectory()) { - throw new ConfigurationError( - `The path that processed SARIF files should be written to exists, but is not a directory: ${outputDir}` - ); - } - const outputFile = path19.resolve( - outputDir, - `upload${uploadTarget.sarifExtension}` - ); - logger.info(`Writing processed SARIF file to ${outputFile}`); - fs22.writeFileSync(outputFile, sarifPayload); -} -var STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS = 5 * 1e3; -var STATUS_CHECK_BACKOFF_MULTIPLIER = 2; -var STATUS_CHECK_MAX_TRIES = 5; -async function waitForProcessing(repositoryNwo, sarifID, logger, options = { - isUnsuccessfulExecution: false -}) { - logger.startGroup("Waiting for processing to finish"); - try { - const client = getApiClient(); - let statusCheckBackoff = STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS; - if (process.env["NODE_ENV"] !== "test") { - await delay(statusCheckBackoff, { allowProcessExit: false }); - } - for (let statusCheckCount = 1; statusCheckCount <= STATUS_CHECK_MAX_TRIES; statusCheckCount++) { - let response = void 0; - try { - response = await client.request( - "GET /repos/:owner/:repo/code-scanning/sarifs/:sarif_id", - { - owner: repositoryNwo.owner, - repo: repositoryNwo.repo, - sarif_id: sarifID - } - ); - } catch (e) { - logger.warning( - `An error occurred checking the status of the delivery. ${e} It should still be processed in the background, but errors that occur during processing may not be reported.` - ); - break; - } - const status = response.data.processing_status; - logger.info(`Analysis upload status is ${status}.`); - if (status === "pending") { - logger.debug("Analysis processing is still pending..."); - } else if (options.isUnsuccessfulExecution) { - handleProcessingResultForUnsuccessfulExecution( - response, - status, - logger - ); - break; - } else if (status === "complete") { - break; - } else if (status === "failed") { - const message = `Code Scanning could not process the submitted SARIF file: -${response.data.errors}`; - const processingErrors = response.data.errors; - throw shouldConsiderConfigurationError(processingErrors) ? new ConfigurationError(message) : shouldConsiderInvalidRequest(processingErrors) ? new InvalidSarifUploadError(message) : new Error(message); - } else { - assertNever(status); - } - if (statusCheckCount === STATUS_CHECK_MAX_TRIES) { - logger.warning( - "Timed out waiting for analysis to finish processing. Continuing." - ); - break; - } else { - statusCheckBackoff *= STATUS_CHECK_BACKOFF_MULTIPLIER; - await delay(statusCheckBackoff, { allowProcessExit: false }); - } - } - } finally { - logger.endGroup(); - } -} -function shouldConsiderConfigurationError(processingErrors) { - const expectedConfigErrors = [ - "CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled", - "rejecting delivery as the repository has too many logical alerts", - "A delivery cannot contain multiple runs with the same category" - ]; - return processingErrors.length === 1 && expectedConfigErrors.some((msg) => processingErrors[0].includes(msg)); -} -function shouldConsiderInvalidRequest(processingErrors) { - return processingErrors.every( - (error3) => error3.startsWith("rejecting SARIF") || error3.startsWith("an invalid URI was provided as a SARIF location") || error3.startsWith("locationFromSarifResult: expected artifact location") || error3.startsWith( - "could not convert rules: invalid security severity value, is not a number" - ) || /^SARIF URI scheme [^\s]* did not match the checkout URI scheme [^\s]*/.test( - error3 - ) - ); -} -function handleProcessingResultForUnsuccessfulExecution(response, status, logger) { - if (status === "failed" && Array.isArray(response.data.errors) && response.data.errors.length === 1 && // eslint-disable-next-line @typescript-eslint/no-unsafe-call - response.data.errors[0].toString().startsWith("unsuccessful execution")) { - logger.info( - 'Successfully uploaded a SARIF file for the unsuccessful execution. Received expected "unsuccessful execution" processing error, and no other errors.' - ); - } else if (status === "failed") { - logger.warning( - `Failed to upload a SARIF file for the unsuccessful execution. Code scanning status information for the repository may be out of date as a result. Processing errors: ${response.data.errors}` - ); - } else if (status === "complete") { - logger.debug( - 'Uploaded a SARIF file for the unsuccessful execution, but did not receive the expected "unsuccessful execution" processing error. This is a known transient issue with the code scanning API, and does not cause out of date code scanning status information.' - ); - } else { - assertNever(status); - } -} -function validateUniqueCategory(sarifLog, sentinelPrefix) { - const categories = {}; - for (const run9 of sarifLog.runs || []) { - const id = run9?.automationDetails?.id; - const tool = run9.tool?.driver?.name; - const category = `${sanitize(id)}_${sanitize(tool)}`; - categories[category] = { id, tool }; - } - for (const [category, { id, tool }] of Object.entries(categories)) { - const sentinelEnvVar = `${sentinelPrefix}${category}`; - if (process.env[sentinelEnvVar]) { - throw new ConfigurationError( - `Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. The easiest fix is to specify a unique value for the \`category\` input. If .runs[].automationDetails.id is specified in the sarif file, that will take precedence over your configured \`category\`. Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})` - ); - } - core15.exportVariable(sentinelEnvVar, sentinelEnvVar); - } -} -function sanitize(str) { - return (str ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase(); -} -function filterAlertsByDiffRange(logger, sarifLog) { - const diffRanges = readDiffRangesJsonFile(logger); - if (!diffRanges?.length) { - return sarifLog; - } - if (sarifLog.runs === void 0) { - return sarifLog; - } - for (const run9 of sarifLog.runs) { - if (run9.results) { - run9.results = run9.results.filter((result) => { - const locations = [ - ...(result.locations || []).map((loc) => loc.physicalLocation), - ...(result.relatedLocations || []).map((loc) => loc.physicalLocation) - ]; - return locations.some((physicalLocation) => { - const locationUri = physicalLocation?.artifactLocation?.uri; - const locationStartLine = physicalLocation?.region?.startLine; - if (!locationUri || locationStartLine === void 0) { - return false; - } - return diffRanges.some( - (range2) => range2.path === locationUri && (range2.startLine <= locationStartLine && range2.endLine >= locationStartLine || range2.startLine === 0 && range2.endLine === 0) - ); - }); - }); - } - } - return sarifLog; -} - -// src/upload-sarif.ts -async function postProcessAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, postProcessedOutputPath) { - const sarifGroups = await getGroupedSarifFilePaths( - logger, - sarifPath - ); - const uploadResults = {}; - for (const [analysisKind, sarifFiles] of unsafeEntriesInvariant( - sarifGroups - )) { - const analysisConfig = getAnalysisConfig(analysisKind); - const postProcessingResults = await postProcessSarifFiles( - logger, - features, - checkoutPath, - sarifFiles, - category, - analysisConfig - ); - await writePostProcessedFiles( - logger, - postProcessedOutputPath, - analysisConfig, - postProcessingResults - ); - if (uploadKind === "always") { - uploadResults[analysisKind] = await uploadPostProcessedFiles( - logger, - checkoutPath, - analysisConfig, - postProcessingResults - ); - } - } - return uploadResults; -} - -// src/analyze-action.ts -async function sendStatusReport2(startedAt, config, stats, error3, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanup, dependencyCacheResults, databaseUploadResults, logger) { - const status = getActionsStatus(error3, stats?.analyze_failure_language); - const statusReportBase = await createStatusReportBase( - "finish" /* Analyze */, - status, - startedAt, - config, - await checkDiskUsage(logger), - logger, - error3?.message, - error3?.stack - ); - if (statusReportBase !== void 0) { - const report = { - ...statusReportBase, - ...stats || {}, - ...dbCreationTimings || {}, - ...trapCacheCleanup || {}, - dependency_caching_upload_results: dependencyCacheResults, - database_upload_results: databaseUploadResults - }; - if (config && didUploadTrapCaches) { - const trapCacheUploadStatusReport = { - ...report, - trap_cache_upload_duration_ms: Math.round(trapCacheUploadTime || 0), - trap_cache_upload_size_bytes: Math.round( - await getTotalCacheSize(Object.values(config.trapCaches), logger) - ) - }; - await sendStatusReport(trapCacheUploadStatusReport); - } else { - await sendStatusReport(report); - } - } -} -function hasBadExpectErrorInput() { - return getOptionalInput("expect-error") !== "false" && !isInTestMode(); -} -function doesGoExtractionOutputExist(config) { - const golangDbDirectory = getCodeQLDatabasePath( - config, - "go" /* go */ - ); - const trapDirectory = import_path5.default.join( - golangDbDirectory, - "trap", - "go" /* go */ - ); - return fs23.existsSync(trapDirectory) && fs23.readdirSync(trapDirectory).some( - (fileName) => [ - ".trap", - ".trap.gz", - ".trap.br", - ".trap.tar.gz", - ".trap.tar.br", - ".trap.tar" - ].some((ext2) => fileName.endsWith(ext2)) - ); -} -async function runAutobuildIfLegacyGoWorkflow(config, logger) { - if (!config.languages.includes("go" /* go */)) { - return; - } - if (config.buildMode) { - logger.debug( - "Skipping legacy Go autobuild since a build mode has been specified." - ); - return; - } - if (process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG" /* DID_AUTOBUILD_GOLANG */] === "true") { - logger.debug("Won't run Go autobuild since it has already been run."); - return; - } - if (dbIsFinalized(config, "go" /* go */, logger)) { - logger.debug( - "Won't run Go autobuild since there is already a finalized database for Go." - ); - return; - } - if (doesGoExtractionOutputExist(config)) { - logger.debug( - "Won't run Go autobuild since at least one file of Go code has already been extracted." - ); - if ("CODEQL_EXTRACTOR_GO_BUILD_TRACING" in process.env) { - logger.warning( - `The CODEQL_EXTRACTOR_GO_BUILD_TRACING environment variable has no effect on workflows with manual build steps, so we recommend that you remove it from your workflow.` - ); - } - return; - } - logger.debug( - "Running Go autobuild because extraction output (TRAP files) for Go code has not been found." - ); - await runAutobuild(config, "go" /* go */, logger); -} -async function run({ startedAt, logger }) { - let uploadResults = void 0; - let runStats = void 0; - let config = void 0; - let trapCacheCleanupTelemetry = void 0; - let trapCacheUploadTime = void 0; - let dbCreationTimings = void 0; - let didUploadTrapCaches = false; - let dependencyCacheResults; - let databaseUploadResults = []; - try { - initializeEnvironment(getActionVersion()); - persistInputs(); - const statusReportBase = await createStatusReportBase( - "finish" /* Analyze */, - "starting", - startedAt, - config, - await checkDiskUsage(logger), - logger - ); - if (statusReportBase !== void 0) { - await sendStatusReport(statusReportBase); - } - config = await getConfig(getTemporaryDirectory(), logger); - if (config === void 0) { - throw new ConfigurationError( - "Config file could not be found at expected location. Has the 'init' action been called?" - ); - } - const codeql = await getCodeQL(logger, config.codeQLCmd); - if (hasBadExpectErrorInput()) { - throw new ConfigurationError( - "`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork." - ); - } - if (process.env.CODEQL_PROXY_HOST === "" && !await codeQlVersionAtLeast(codeql, "2.20.7")) { - delete process.env.CODEQL_PROXY_HOST; - delete process.env.CODEQL_PROXY_PORT; - delete process.env.CODEQL_PROXY_CA_CERTIFICATE; - } - if (getOptionalInput("cleanup-level")) { - logger.info( - "The 'cleanup-level' input is ignored since the CodeQL Action now automatically manages database cleanup. This input can safely be removed from your workflow." - ); - } - const apiDetails = getApiDetails(); - const outputDir = getRequiredInput("output"); - core16.exportVariable("CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */, outputDir); - const threads = getThreadsFlag( - getOptionalInput("threads") || process.env["CODEQL_THREADS"], - logger - ); - const repositoryNwo = getRepositoryNwo(); - const gitHubVersion = await getGitHubVersion(); - checkActionVersion(getActionVersion(), gitHubVersion); - const features = initFeatures( - gitHubVersion, - repositoryNwo, - getTemporaryDirectory(), - logger - ); - const memory = getMemoryFlag( - getOptionalInput("ram") || process.env["CODEQL_RAM"], - logger - ); - const diffRangePackDir = await setupDiffInformedQueryRun(logger); - await warnIfGoInstalledAfterInit(config, logger); - await runAutobuildIfLegacyGoWorkflow(config, logger); - dbCreationTimings = await runFinalize( - features, - outputDir, - threads, - memory, - codeql, - config, - logger - ); - if (getRequiredInput("skip-queries") !== "true") { - if (getOptionalInput("add-snippets") !== void 0) { - logger.warning( - "The `add-snippets` input has been removed and no longer has any effect." - ); - } - runStats = await runQueries( - outputDir, - memory, - threads, - diffRangePackDir, - getOptionalInput("category"), - codeql, - config, - logger, - features - ); - } - const dbLocations = {}; - for (const language of config.languages) { - dbLocations[language] = getCodeQLDatabasePath(config, language); - } - core16.setOutput("db-locations", dbLocations); - core16.setOutput("sarif-output", import_path5.default.resolve(outputDir)); - const uploadKind = getUploadValue( - getOptionalInput("upload") - ); - if (runStats) { - const checkoutPath = getRequiredInput("checkout_path"); - const category = getOptionalInput("category"); - uploadResults = await postProcessAndUploadSarif( - logger, - features, - uploadKind, - checkoutPath, - outputDir, - category, - getOptionalInput("post-processed-sarif-path") - ); - if (uploadResults["code-scanning" /* CodeScanning */] !== void 0) { - core16.setOutput( - "sarif-id", - uploadResults["code-scanning" /* CodeScanning */].sarifID - ); - } - if (uploadResults["code-quality" /* CodeQuality */] !== void 0) { - core16.setOutput( - "quality-sarif-id", - uploadResults["code-quality" /* CodeQuality */].sarifID - ); - } - } else { - logger.info("Not uploading results"); - } - await cleanupAndUploadOverlayBaseDatabaseToCache(codeql, config, logger); - databaseUploadResults = await cleanupAndUploadDatabases( - repositoryNwo, - codeql, - config, - apiDetails, - features, - logger - ); - const trapCacheUploadStartTime = import_perf_hooks4.performance.now(); - didUploadTrapCaches = await uploadTrapCaches(codeql, config, logger); - trapCacheUploadTime = import_perf_hooks4.performance.now() - trapCacheUploadStartTime; - trapCacheCleanupTelemetry = await cleanupTrapCaches( - config, - features, - logger - ); - if (shouldStoreCache(config.dependencyCachingEnabled)) { - dependencyCacheResults = await uploadDependencyCaches( - codeql, - features, - config, - logger - ); - } - if (isInTestMode()) { - logger.debug("In test mode. Waiting for processing is disabled."); - } else if (uploadResults?.["code-scanning" /* CodeScanning */] !== void 0 && getRequiredInput("wait-for-processing") === "true") { - await waitForProcessing( - getRepositoryNwo(), - uploadResults["code-scanning" /* CodeScanning */].sarifID, - getActionsLogger() - ); - } - if (getOptionalInput("expect-error") === "true") { - core16.setFailed( - `expect-error input was set to true but no error was thrown.` - ); - } - core16.exportVariable("CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */, "true"); - } catch (unwrappedError) { - const error3 = wrapError(unwrappedError); - if (getOptionalInput("expect-error") !== "true" || hasBadExpectErrorInput()) { - core16.setFailed(error3.message); - } - await sendStatusReport2( - startedAt, - config, - error3 instanceof CodeQLAnalysisError ? error3.queriesStatusReport : void 0, - error3 instanceof CodeQLAnalysisError ? error3.error : error3, - trapCacheUploadTime, - dbCreationTimings, - didUploadTrapCaches, - trapCacheCleanupTelemetry, - dependencyCacheResults, - databaseUploadResults, - logger - ); - return; - } - if (runStats !== void 0 && uploadResults?.["code-scanning" /* CodeScanning */] !== void 0) { - await sendStatusReport2( - startedAt, - config, - { - ...runStats, - ...uploadResults["code-scanning" /* CodeScanning */].statusReport - }, - void 0, - trapCacheUploadTime, - dbCreationTimings, - didUploadTrapCaches, - trapCacheCleanupTelemetry, - dependencyCacheResults, - databaseUploadResults, - logger - ); - } else if (runStats !== void 0) { - await sendStatusReport2( - startedAt, - config, - { ...runStats }, - void 0, - trapCacheUploadTime, - dbCreationTimings, - didUploadTrapCaches, - trapCacheCleanupTelemetry, - dependencyCacheResults, - databaseUploadResults, - logger - ); - } else { - await sendStatusReport2( - startedAt, - config, - void 0, - void 0, - trapCacheUploadTime, - dbCreationTimings, - didUploadTrapCaches, - trapCacheCleanupTelemetry, - dependencyCacheResults, - databaseUploadResults, - logger - ); - } -} -var analyze = { - name: "finish" /* Analyze */, - run -}; -async function runWrapper() { - await runInActions(analyze); - await checkForTimeout(); -} - -// src/analyze-action-post.ts -var fs27 = __toESM(require("fs")); -var core18 = __toESM(require_core()); - -// src/debug-artifacts.ts -var fs26 = __toESM(require("fs")); -var path23 = __toESM(require("path")); -var artifact = __toESM(require_artifact2()); -var artifactLegacy = __toESM(require_artifact_client2()); -var core17 = __toESM(require_core()); - -// node_modules/archiver/lib/core.js -var import_fs2 = require("fs"); - -// node_modules/is-stream/index.js -function isStream(stream2, { checkOpen = true } = {}) { - return stream2 !== null && typeof stream2 === "object" && (stream2.writable || stream2.readable || !checkOpen || stream2.writable === void 0 && stream2.readable === void 0) && typeof stream2.pipe === "function"; -} - -// node_modules/readdir-glob/dist/index.mjs -var fs24 = __toESM(require("fs"), 1); -var import_events = require("events"); - -// node_modules/readdir-glob/node_modules/balanced-match/dist/esm/index.js -var balanced = (a, b, str) => { - const ma = a instanceof RegExp ? maybeMatch(a, str) : a; - const mb = b instanceof RegExp ? maybeMatch(b, str) : b; - const r = ma !== null && mb != null && range(ma, mb, str); - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + ma.length, r[1]), - post: str.slice(r[1] + mb.length) - }; -}; -var maybeMatch = (reg, str) => { - const m = str.match(reg); - return m ? m[0] : null; -}; -var range = (a, b, str) => { - let begs, beg, left, right = void 0, result; - let ai = str.indexOf(a); - let bi = str.indexOf(b, ai + 1); - let i = ai; - if (ai >= 0 && bi > 0) { - if (a === b) { - return [ai, bi]; - } - begs = []; - left = str.length; - while (i >= 0 && !result) { - if (i === ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length === 1) { - const r = begs.pop(); - if (r !== void 0) - result = [r, bi]; - } else { - beg = begs.pop(); - if (beg !== void 0 && beg < left) { - left = beg; - right = bi; - } - bi = str.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length && right !== void 0) { - result = [left, right]; - } - } - return result; -}; - -// node_modules/readdir-glob/node_modules/brace-expansion/dist/esm/index.js -var escSlash = "\0SLASH" + Math.random() + "\0"; -var escOpen = "\0OPEN" + Math.random() + "\0"; -var escClose = "\0CLOSE" + Math.random() + "\0"; -var escComma = "\0COMMA" + Math.random() + "\0"; -var escPeriod = "\0PERIOD" + Math.random() + "\0"; -var escSlashPattern = new RegExp(escSlash, "g"); -var escOpenPattern = new RegExp(escOpen, "g"); -var escClosePattern = new RegExp(escClose, "g"); -var escCommaPattern = new RegExp(escComma, "g"); -var escPeriodPattern = new RegExp(escPeriod, "g"); -var slashPattern = /\\\\/g; -var openPattern = /\\{/g; -var closePattern = /\\}/g; -var commaPattern = /\\,/g; -var periodPattern = /\\\./g; -var EXPANSION_MAX = 1e5; -var EXPANSION_MAX_LENGTH = 4e6; -function numeric(str) { - return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); -} -function escapeBraces(str) { - return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod); -} -function unescapeBraces(str) { - return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, "."); -} -function parseCommaParts(str) { - if (!str) { - return [""]; - } - const parts = []; - const m = balanced("{", "}", str); - if (!m) { - return str.split(","); - } - const { pre, body, post } = m; - const p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - const postParts = parseCommaParts(post); - if (post.length) { - ; - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); - } - parts.push.apply(parts, p); - return parts; -} -function expand2(str, options = {}) { - if (!str) { - return []; - } - const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options; - if (str.slice(0, 2) === "{}") { - str = "\\{\\}" + str.slice(2); - } - return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); -} -function embrace(str) { - return "{" + str + "}"; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} -function lte(i, y) { - return i <= y; -} -function gte6(i, y) { - return i >= y; -} -function combine(acc, pre, values, max, maxLength, dropEmpties) { - const out = []; - let length = 0; - for (let a = 0; a < acc.length; a++) { - for (let v = 0; v < values.length; v++) { - if (out.length >= max) - return out; - const expansion = acc[a] + pre + values[v]; - if (dropEmpties && !expansion) - continue; - if (length + expansion.length > maxLength) - return out; - out.push(expansion); - length += expansion.length; - } - } - return out; -} -function expandSequence(body, isAlphaSequence, max, maxLength) { - const n = body.split(/\.\./); - const N = []; - if (n[0] === void 0 || n[1] === void 0) { - return N; - } - const x = numeric(n[0]); - const y = numeric(n[1]); - const width = Math.max(n[0].length, n[1].length); - let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1; - let test = lte; - const reverse = y < x; - if (reverse) { - incr *= -1; - test = gte6; - } - const pad = n.some(isPadded); - let length = 0; - for (let i = x; test(i, y) && N.length < max; i += incr) { - let c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === "\\") { - c = ""; - } - } else { - c = String(i); - if (pad) { - const need = width - c.length; - if (need > 0) { - const z = new Array(need + 1).join("0"); - if (i < 0) { - c = "-" + z + c.slice(1); - } else { - c = z + c; - } - } - } - } - if (length + c.length > maxLength) - break; - N.push(c); - length += c.length; - } - return N; -} -function expand_(str, max, maxLength, isTop) { - let acc = [""]; - let dropEmpties = false; - let firstGroup = true; - for (; ; ) { - const m = balanced("{", "}", str); - if (!m) { - return combine(acc, str, [""], max, maxLength, dropEmpties); - } - const pre = m.pre; - if (/\$$/.test(pre)) { - acc = combine(acc, pre + "{" + m.body + "}", [""], max, maxLength, dropEmpties && !m.post.length); - firstGroup = false; - if (!m.post.length) - break; - str = m.post; - continue; - } - const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - const isSequence = isNumericSequence || isAlphaSequence; - const isOptions = m.body.indexOf(",") >= 0; - if (!isSequence && !isOptions) { - if (m.post.match(/,(?!,).*\}/)) { - str = m.pre + "{" + m.body + escClose + m.post; - isTop = true; - continue; - } - return combine(acc, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties); - } - if (firstGroup) { - dropEmpties = isTop && !isSequence; - firstGroup = false; - } - let values; - if (isSequence) { - values = expandSequence(m.body, isAlphaSequence, max, maxLength); - } else { - let n = parseCommaParts(m.body); - if (n.length === 1 && n[0] !== void 0) { - n = expand_(n[0], max, maxLength, false).map(embrace); - if (n.length === 1) { - acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length); - if (!m.post.length) - break; - str = m.post; - continue; - } - } - let dropsEmpties = dropEmpties && !m.post.length && !pre; - for (let d = 0; dropsEmpties && d < acc.length; d++) { - if (acc[d]) { - dropsEmpties = false; - } - } - values = []; - let valuesLength = 0; - outer: for (let j = 0; j < n.length; j++) { - const expanded = expand_(n[j], max, maxLength, false); - for (let k = 0; k < expanded.length; k++) { - const v = expanded[k]; - if (dropsEmpties && !v) - continue; - if (values.length >= max || valuesLength + v.length > maxLength) { - break outer; - } - values.push(v); - valuesLength += v.length; - } - } - } - acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); - if (!m.post.length) - break; - str = m.post; - } - return acc; -} - -// node_modules/readdir-glob/node_modules/minimatch/dist/esm/assert-valid-pattern.js -var MAX_PATTERN_LENGTH = 1024 * 64; -var assertValidPattern = (pattern) => { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); - } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); - } -}; - -// node_modules/readdir-glob/node_modules/minimatch/dist/esm/brace-expressions.js -var posixClasses = { - "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true], - "[:alpha:]": ["\\p{L}\\p{Nl}", true], - "[:ascii:]": ["\\x00-\\x7f", false], - "[:blank:]": ["\\p{Zs}\\t", true], - "[:cntrl:]": ["\\p{Cc}", true], - "[:digit:]": ["\\p{Nd}", true], - "[:graph:]": ["\\p{Z}\\p{C}", true, true], - "[:lower:]": ["\\p{Ll}", true], - "[:print:]": ["\\p{C}", true], - "[:punct:]": ["\\p{P}", true], - "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true], - "[:upper:]": ["\\p{Lu}", true], - "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true], - "[:xdigit:]": ["A-Fa-f0-9", false] -}; -var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"); -var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); -var rangesToString = (ranges) => ranges.join(""); -var parseClass = (glob2, position) => { - const pos = position; - if (glob2.charAt(pos) !== "[") { - throw new Error("not in a brace expression"); - } - const ranges = []; - const negs = []; - let i = pos + 1; - let sawStart = false; - let uflag = false; - let escaping = false; - let negate2 = false; - let endPos = pos; - let rangeStart = ""; - WHILE: while (i < glob2.length) { - const c = glob2.charAt(i); - if ((c === "!" || c === "^") && i === pos + 1) { - negate2 = true; - i++; - continue; - } - if (c === "]" && sawStart && !escaping) { - endPos = i + 1; - break; - } - sawStart = true; - if (c === "\\") { - if (!escaping) { - escaping = true; - i++; - continue; - } - } - if (c === "[" && !escaping) { - for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { - if (glob2.startsWith(cls, i)) { - if (rangeStart) { - return ["$.", false, glob2.length - pos, true]; - } - i += cls.length; - if (neg) - negs.push(unip); - else - ranges.push(unip); - uflag = uflag || u; - continue WHILE; - } - } - } - escaping = false; - if (rangeStart) { - if (c > rangeStart) { - ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c)); - } else if (c === rangeStart) { - ranges.push(braceEscape(c)); - } - rangeStart = ""; - i++; - continue; - } - if (glob2.startsWith("-]", i + 1)) { - ranges.push(braceEscape(c + "-")); - i += 2; - continue; - } - if (glob2.startsWith("-", i + 1)) { - rangeStart = c; - i += 2; - continue; - } - ranges.push(braceEscape(c)); - i++; - } - if (endPos < i) { - return ["", false, 0, false]; - } - if (!ranges.length && !negs.length) { - return ["$.", false, glob2.length - pos, true]; - } - if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate2) { - const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; - return [regexpEscape(r), false, endPos - pos, false]; - } - const sranges = "[" + (negate2 ? "^" : "") + rangesToString(ranges) + "]"; - const snegs = "[" + (negate2 ? "" : "^") + rangesToString(negs) + "]"; - const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs; - return [comb, uflag, endPos - pos, true]; -}; - -// node_modules/readdir-glob/node_modules/minimatch/dist/esm/unescape.js -var unescape2 = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => { - if (magicalBraces) { - return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1"); - } - return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1"); -}; - -// node_modules/readdir-glob/node_modules/minimatch/dist/esm/ast.js -var _a; -var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]); -var isExtglobType = (c) => types.has(c); -var isExtglobAST = (c) => isExtglobType(c.type); -var adoptionMap = /* @__PURE__ */ new Map([ - ["!", ["@"]], - ["?", ["?", "@"]], - ["@", ["@"]], - ["*", ["*", "+", "?", "@"]], - ["+", ["+", "@"]] -]); -var adoptionWithSpaceMap = /* @__PURE__ */ new Map([ - ["!", ["?"]], - ["@", ["?"]], - ["+", ["?", "*"]] -]); -var adoptionAnyMap = /* @__PURE__ */ new Map([ - ["!", ["?", "@"]], - ["?", ["?", "@"]], - ["@", ["?", "@"]], - ["*", ["*", "+", "?", "@"]], - ["+", ["+", "@", "?", "*"]] -]); -var usurpMap = /* @__PURE__ */ new Map([ - ["!", /* @__PURE__ */ new Map([["!", "@"]])], - [ - "?", - /* @__PURE__ */ new Map([ - ["*", "*"], - ["+", "*"] - ]) - ], - [ - "@", - /* @__PURE__ */ new Map([ - ["!", "!"], - ["?", "?"], - ["@", "@"], - ["*", "*"], - ["+", "+"] - ]) - ], - [ - "+", - /* @__PURE__ */ new Map([ - ["?", "*"], - ["*", "*"] - ]) - ] -]); -var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))"; -var startNoDot = "(?!\\.)"; -var addPatternStart = /* @__PURE__ */ new Set(["[", "."]); -var justDots = /* @__PURE__ */ new Set(["..", "."]); -var reSpecials = new Set("().*{}+?[]^$\\!"); -var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); -var qmark = "[^/]"; -var star = qmark + "*?"; -var starNoEmpty = qmark + "+?"; -var ID = 0; -var AST = class { - type; - #root; - #hasMagic; - #uflag = false; - #parts = []; - #parent; - #parentIndex; - #negs; - #filledNegs = false; - #options; - #toString; - // set to true if it's an extglob with no children - // (which really means one child of '') - #emptyExt = false; - id = ++ID; - get depth() { - return (this.#parent?.depth ?? -1) + 1; - } - [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { - return { - "@@type": "AST", - id: this.id, - type: this.type, - root: this.#root.id, - parent: this.#parent?.id, - depth: this.depth, - partsLength: this.#parts.length, - parts: this.#parts - }; - } - constructor(type, parent, options = {}) { - this.type = type; - if (type) - this.#hasMagic = true; - this.#parent = parent; - this.#root = this.#parent ? this.#parent.#root : this; - this.#options = this.#root === this ? options : this.#root.#options; - this.#negs = this.#root === this ? [] : this.#root.#negs; - if (type === "!" && !this.#root.#filledNegs) - this.#negs.push(this); - this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; - } - get hasMagic() { - if (this.#hasMagic !== void 0) - return this.#hasMagic; - for (const p of this.#parts) { - if (typeof p === "string") - continue; - if (p.type || p.hasMagic) - return this.#hasMagic = true; - } - return this.#hasMagic; - } - // reconstructs the pattern - toString() { - return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p) => String(p)).join("") : this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")"; - } - #fillNegs() { - if (this !== this.#root) - throw new Error("should only call on root"); - if (this.#filledNegs) - return this; - this.toString(); - this.#filledNegs = true; - let n; - while (n = this.#negs.pop()) { - if (n.type !== "!") - continue; - let p = n; - let pp = p.#parent; - while (pp) { - for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { - for (const part of n.#parts) { - if (typeof part === "string") { - throw new Error("string part in extglob AST??"); - } - part.copyIn(pp.#parts[i]); - } - } - p = pp; - pp = p.#parent; - } - } - return this; - } - push(...parts) { - for (const p of parts) { - if (p === "") - continue; - if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) { - throw new Error("invalid part: " + p); - } - this.#parts.push(p); - } - } - toJSON() { - const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())]; - if (this.isStart() && !this.type) - ret.unshift([]); - if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) { - ret.push({}); - } - return ret; - } - isStart() { - if (this.#root === this) - return true; - if (!this.#parent?.isStart()) - return false; - if (this.#parentIndex === 0) - return true; - const p = this.#parent; - for (let i = 0; i < this.#parentIndex; i++) { - const pp = p.#parts[i]; - if (!(pp instanceof _a && pp.type === "!")) { - return false; - } - } - return true; - } - isEnd() { - if (this.#root === this) - return true; - if (this.#parent?.type === "!") - return true; - if (!this.#parent?.isEnd()) - return false; - if (!this.type) - return this.#parent?.isEnd(); - const pl = this.#parent ? this.#parent.#parts.length : 0; - return this.#parentIndex === pl - 1; - } - copyIn(part) { - if (typeof part === "string") - this.push(part); - else - this.push(part.clone(this)); - } - clone(parent) { - const c = new _a(this.type, parent); - for (const p of this.#parts) { - c.copyIn(p); - } - return c; - } - static #parseAST(str, ast, pos, opt, extDepth) { - const maxDepth = opt.maxExtglobRecursion ?? 2; - let escaping = false; - let inBrace = false; - let braceStart = -1; - let braceNeg = false; - if (ast.type === null) { - let i2 = pos; - let acc2 = ""; - while (i2 < str.length) { - const c = str.charAt(i2++); - if (escaping || c === "\\") { - escaping = !escaping; - acc2 += c; - continue; - } - if (inBrace) { - if (i2 === braceStart + 1) { - if (c === "^" || c === "!") { - braceNeg = true; - } - } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) { - inBrace = false; - } - acc2 += c; - continue; - } else if (c === "[") { - inBrace = true; - braceStart = i2; - braceNeg = false; - acc2 += c; - continue; - } - const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth; - if (doRecurse) { - ast.push(acc2); - acc2 = ""; - const ext2 = new _a(c, ast); - i2 = _a.#parseAST(str, ext2, i2, opt, extDepth + 1); - ast.push(ext2); - continue; - } - acc2 += c; - } - ast.push(acc2); - return i2; - } - let i = pos + 1; - let part = new _a(null, ast); - const parts = []; - let acc = ""; - while (i < str.length) { - const c = str.charAt(i++); - if (escaping || c === "\\") { - escaping = !escaping; - acc += c; - continue; - } - if (inBrace) { - if (i === braceStart + 1) { - if (c === "^" || c === "!") { - braceNeg = true; - } - } else if (c === "]" && !(i === braceStart + 2 && braceNeg)) { - inBrace = false; - } - acc += c; - continue; - } else if (c === "[") { - inBrace = true; - braceStart = i; - braceNeg = false; - acc += c; - continue; - } - const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */ - (extDepth <= maxDepth || ast && ast.#canAdoptType(c)); - if (doRecurse) { - const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; - part.push(acc); - acc = ""; - const ext2 = new _a(c, part); - part.push(ext2); - i = _a.#parseAST(str, ext2, i, opt, extDepth + depthAdd); - continue; - } - if (c === "|") { - part.push(acc); - acc = ""; - parts.push(part); - part = new _a(null, ast); - continue; - } - if (c === ")") { - if (acc === "" && ast.#parts.length === 0) { - ast.#emptyExt = true; - } - part.push(acc); - acc = ""; - ast.push(...parts, part); - return i; - } - acc += c; - } - ast.type = null; - ast.#hasMagic = void 0; - ast.#parts = [str.substring(pos - 1)]; - return i; - } - #canAdoptWithSpace(child) { - return this.#canAdopt(child, adoptionWithSpaceMap); - } - #canAdopt(child, map = adoptionMap) { - if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) { - return false; - } - const gc = child.#parts[0]; - if (!gc || typeof gc !== "object" || gc.type === null) { - return false; - } - return this.#canAdoptType(gc.type, map); - } - #canAdoptType(c, map = adoptionAnyMap) { - return !!map.get(this.type)?.includes(c); - } - #adoptWithSpace(child, index2) { - const gc = child.#parts[0]; - const blank = new _a(null, gc, this.options); - blank.#parts.push(""); - gc.push(blank); - this.#adopt(child, index2); - } - #adopt(child, index2) { - const gc = child.#parts[0]; - this.#parts.splice(index2, 1, ...gc.#parts); - for (const p of gc.#parts) { - if (typeof p === "object") - p.#parent = this; - } - this.#toString = void 0; - } - #canUsurpType(c) { - const m = usurpMap.get(this.type); - return !!m?.has(c); - } - #canUsurp(child) { - if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) { - return false; - } - const gc = child.#parts[0]; - if (!gc || typeof gc !== "object" || gc.type === null) { - return false; - } - return this.#canUsurpType(gc.type); - } - #usurp(child) { - const m = usurpMap.get(this.type); - const gc = child.#parts[0]; - const nt = m?.get(gc.type); - if (!nt) - return false; - this.#parts = gc.#parts; - for (const p of this.#parts) { - if (typeof p === "object") { - p.#parent = this; - } - } - this.type = nt; - this.#toString = void 0; - this.#emptyExt = false; - } - static fromGlob(pattern, options = {}) { - const ast = new _a(null, void 0, options); - _a.#parseAST(pattern, ast, 0, options, 0); - return ast; - } - // returns the regular expression if there's magic, or the unescaped - // string if not. - toMMPattern() { - if (this !== this.#root) - return this.#root.toMMPattern(); - const glob2 = this.toString(); - const [re, body, hasMagic, uflag] = this.toRegExpSource(); - const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob2.toUpperCase() !== glob2.toLowerCase(); - if (!anyMagic) { - return body; - } - const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : ""); - return Object.assign(new RegExp(`^${re}$`, flags), { - _src: re, - _glob: glob2 - }); - } - get options() { - return this.#options; - } - // returns the string match, the regexp source, whether there's magic - // in the regexp (so a regular expression is required) and whether or - // not the uflag is needed for the regular expression (for posix classes) - // TODO: instead of injecting the start/end at this point, just return - // the BODY of the regexp, along with the start/end portions suitable - // for binding the start/end in either a joined full-path makeRe context - // (where we bind to (^|/), or a standalone matchPart context (where - // we bind to ^, and not /). Otherwise slashes get duped! - // - // In part-matching mode, the start is: - // - if not isStart: nothing - // - if traversal possible, but not allowed: ^(?!\.\.?$) - // - if dots allowed or not possible: ^ - // - if dots possible and not allowed: ^(?!\.) - // end is: - // - if not isEnd(): nothing - // - else: $ - // - // In full-path matching mode, we put the slash at the START of the - // pattern, so start is: - // - if first pattern: same as part-matching mode - // - if not isStart(): nothing - // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) - // - if dots allowed or not possible: / - // - if dots possible and not allowed: /(?!\.) - // end is: - // - if last pattern, same as part-matching mode - // - else nothing - // - // Always put the (?:$|/) on negated tails, though, because that has to be - // there to bind the end of the negated pattern portion, and it's easier to - // just stick it in now rather than try to inject it later in the middle of - // the pattern. - // - // We can just always return the same end, and leave it up to the caller - // to know whether it's going to be used joined or in parts. - // And, if the start is adjusted slightly, can do the same there: - // - if not isStart: nothing - // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) - // - if dots allowed or not possible: (?:/|^) - // - if dots possible and not allowed: (?:/|^)(?!\.) - // - // But it's better to have a simpler binding without a conditional, for - // performance, so probably better to return both start options. - // - // Then the caller just ignores the end if it's not the first pattern, - // and the start always gets applied. - // - // But that's always going to be $ if it's the ending pattern, or nothing, - // so the caller can just attach $ at the end of the pattern when building. - // - // So the todo is: - // - better detect what kind of start is needed - // - return both flavors of starting pattern - // - attach $ at the end of the pattern when creating the actual RegExp - // - // Ah, but wait, no, that all only applies to the root when the first pattern - // is not an extglob. If the first pattern IS an extglob, then we need all - // that dot prevention biz to live in the extglob portions, because eg - // +(*|.x*) can match .xy but not .yx. - // - // So, return the two flavors if it's #root and the first child is not an - // AST, otherwise leave it to the child AST to handle it, and there, - // use the (?:^|/) style of start binding. - // - // Even simplified further: - // - Since the start for a join is eg /(?!\.) and the start for a part - // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root - // or start or whatever) and prepend ^ or / at the Regexp construction. - toRegExpSource(allowDot) { - const dot = allowDot ?? !!this.#options.dot; - if (this.#root === this) { - this.#flatten(); - this.#fillNegs(); - } - if (!isExtglobAST(this)) { - const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string"); - const src = this.#parts.map((p) => { - const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); - this.#hasMagic = this.#hasMagic || hasMagic; - this.#uflag = this.#uflag || uflag; - return re; - }).join(""); - let start2 = ""; - if (this.isStart()) { - if (typeof this.#parts[0] === "string") { - const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); - if (!dotTravAllowed) { - const aps = addPatternStart; - const needNoTrav = ( - // dots are allowed, and the pattern starts with [ or . - dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or . - src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or . - src.startsWith("\\.\\.") && aps.has(src.charAt(4)) - ); - const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); - start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ""; - } - } - } - let end = ""; - if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") { - end = "(?:$|\\/)"; - } - const final2 = start2 + src + end; - return [ - final2, - unescape2(src), - this.#hasMagic = !!this.#hasMagic, - this.#uflag - ]; - } - const repeated = this.type === "*" || this.type === "+"; - const start = this.type === "!" ? "(?:(?!(?:" : "(?:"; - let body = this.#partsToRegExp(dot); - if (this.isStart() && this.isEnd() && !body && this.type !== "!") { - const s = this.toString(); - const me = this; - me.#parts = [s]; - me.type = null; - me.#hasMagic = void 0; - return [s, unescape2(this.toString()), false, false]; - } - let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true); - if (bodyDotAllowed === body) { - bodyDotAllowed = ""; - } - if (bodyDotAllowed) { - body = `(?:${body})(?:${bodyDotAllowed})*?`; - } - let final = ""; - if (this.type === "!" && this.#emptyExt) { - final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty; - } else { - const close = this.type === "!" ? ( - // !() must match something,but !(x) can match '' - "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")" - ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`; - final = start + body + close; - } - return [ - final, - unescape2(body), - this.#hasMagic = !!this.#hasMagic, - this.#uflag - ]; - } - #flatten() { - if (!isExtglobAST(this)) { - for (const p of this.#parts) { - if (typeof p === "object") { - p.#flatten(); - } - } - } else { - let iterations = 0; - let done = false; - do { - done = true; - for (let i = 0; i < this.#parts.length; i++) { - const c = this.#parts[i]; - if (typeof c === "object") { - c.#flatten(); - if (this.#canAdopt(c)) { - done = false; - this.#adopt(c, i); - } else if (this.#canAdoptWithSpace(c)) { - done = false; - this.#adoptWithSpace(c, i); - } else if (this.#canUsurp(c)) { - done = false; - this.#usurp(c); - } - } - } - } while (!done && ++iterations < 10); - } - this.#toString = void 0; - } - #partsToRegExp(dot) { - return this.#parts.map((p) => { - if (typeof p === "string") { - throw new Error("string type in extglob ast??"); - } - const [re, _2, _hasMagic, uflag] = p.toRegExpSource(dot); - this.#uflag = this.#uflag || uflag; - return re; - }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|"); - } - static #parseGlob(glob2, hasMagic, noEmpty = false) { - let escaping = false; - let re = ""; - let uflag = false; - let inStar = false; - for (let i = 0; i < glob2.length; i++) { - const c = glob2.charAt(i); - if (escaping) { - escaping = false; - re += (reSpecials.has(c) ? "\\" : "") + c; - continue; - } - if (c === "*") { - if (inStar) - continue; - inStar = true; - re += noEmpty && /^[*]+$/.test(glob2) ? starNoEmpty : star; - hasMagic = true; - continue; - } else { - inStar = false; - } - if (c === "\\") { - if (i === glob2.length - 1) { - re += "\\\\"; - } else { - escaping = true; - } - continue; - } - if (c === "[") { - const [src, needUflag, consumed, magic] = parseClass(glob2, i); - if (consumed) { - re += src; - uflag = uflag || needUflag; - i += consumed - 1; - hasMagic = hasMagic || magic; - continue; - } - } - if (c === "?") { - re += qmark; - hasMagic = true; - continue; - } - re += regExpEscape(c); - } - return [re, unescape2(glob2), !!hasMagic, uflag]; - } -}; -_a = AST; - -// node_modules/readdir-glob/node_modules/minimatch/dist/esm/escape.js -var escape2 = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { - if (magicalBraces) { - return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&"); - } - return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); -}; - -// node_modules/readdir-glob/node_modules/minimatch/dist/esm/index.js -var minimatch = (p, pattern, options = {}) => { - assertValidPattern(pattern); - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; - } - return new Minimatch(pattern, options).match(p); -}; -var starDotExtRE = /^\*+([^+@!?*[(]*)$/; -var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2); -var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2); -var starDotExtTestNocase = (ext2) => { - ext2 = ext2.toLowerCase(); - return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2); -}; -var starDotExtTestNocaseDot = (ext2) => { - ext2 = ext2.toLowerCase(); - return (f) => f.toLowerCase().endsWith(ext2); -}; -var starDotStarRE = /^\*+\.\*+$/; -var starDotStarTest = (f) => !f.startsWith(".") && f.includes("."); -var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes("."); -var dotStarRE = /^\.\*+$/; -var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith("."); -var starRE = /^\*+$/; -var starTest = (f) => f.length !== 0 && !f.startsWith("."); -var starTestDot = (f) => f.length !== 0 && f !== "." && f !== ".."; -var qmarksRE = /^\?+([^+@!?*[(]*)?$/; -var qmarksTestNocase = ([$0, ext2 = ""]) => { - const noext = qmarksTestNoExt([$0]); - if (!ext2) - return noext; - ext2 = ext2.toLowerCase(); - return (f) => noext(f) && f.toLowerCase().endsWith(ext2); -}; -var qmarksTestNocaseDot = ([$0, ext2 = ""]) => { - const noext = qmarksTestNoExtDot([$0]); - if (!ext2) - return noext; - ext2 = ext2.toLowerCase(); - return (f) => noext(f) && f.toLowerCase().endsWith(ext2); -}; -var qmarksTestDot = ([$0, ext2 = ""]) => { - const noext = qmarksTestNoExtDot([$0]); - return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2); -}; -var qmarksTest = ([$0, ext2 = ""]) => { - const noext = qmarksTestNoExt([$0]); - return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2); -}; -var qmarksTestNoExt = ([$0]) => { - const len = $0.length; - return (f) => f.length === len && !f.startsWith("."); -}; -var qmarksTestNoExtDot = ([$0]) => { - const len = $0.length; - return (f) => f.length === len && f !== "." && f !== ".."; -}; -var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix"; -var path21 = { - win32: { sep: "\\" }, - posix: { sep: "/" } -}; -var sep6 = defaultPlatform === "win32" ? path21.win32.sep : path21.posix.sep; -minimatch.sep = sep6; -var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); -minimatch.GLOBSTAR = GLOBSTAR; -var qmark2 = "[^/]"; -var star2 = qmark2 + "*?"; -var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; -var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; -var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options); -minimatch.filter = filter; -var ext = (a, b = {}) => Object.assign({}, a, b); -var defaults2 = (def) => { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; - } - const orig = minimatch; - const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); - return Object.assign(m, { - Minimatch: class Minimatch extends orig.Minimatch { - constructor(pattern, options = {}) { - super(pattern, ext(def, options)); - } - static defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - } - }, - AST: class AST extends orig.AST { - /* c8 ignore start */ - constructor(type, parent, options = {}) { - super(type, parent, ext(def, options)); - } - /* c8 ignore stop */ - static fromGlob(pattern, options = {}) { - return orig.AST.fromGlob(pattern, ext(def, options)); - } - }, - unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), - escape: (s, options = {}) => orig.escape(s, ext(def, options)), - filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), - defaults: (options) => orig.defaults(ext(def, options)), - makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), - braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), - match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), - sep: orig.sep, - GLOBSTAR - }); -}; -minimatch.defaults = defaults2; -var braceExpand = (pattern, options = {}) => { - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; - } - return expand2(pattern, { max: options.braceExpandMax }); -}; -minimatch.braceExpand = braceExpand; -var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); -minimatch.makeRe = makeRe; -var match = (list, pattern, options = {}) => { - const mm = new Minimatch(pattern, options); - list = list.filter((f) => mm.match(f)); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; -}; -minimatch.match = match; -var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; -var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); -var Minimatch = class { - options; - set; - pattern; - windowsPathsNoEscape; - nonegate; - negate; - comment; - empty; - preserveMultipleSlashes; - partial; - globSet; - globParts; - nocase; - isWindows; - platform; - windowsNoMagicRoot; - maxGlobstarRecursion; - regexp; - constructor(pattern, options = {}) { - assertValidPattern(pattern); - options = options || {}; - this.options = options; - this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; - this.pattern = pattern; - this.platform = options.platform || defaultPlatform; - this.isWindows = this.platform === "win32"; - const awe = "allowWindowsEscape"; - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false; - if (this.windowsPathsNoEscape) { - this.pattern = this.pattern.replace(/\\/g, "/"); - } - this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; - this.regexp = null; - this.negate = false; - this.nonegate = !!options.nonegate; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.nocase = !!this.options.nocase; - this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase); - this.globSet = []; - this.globParts = []; - this.set = []; - this.make(); - } - hasMagic() { - if (this.options.magicalBraces && this.set.length > 1) { - return true; - } - for (const pattern of this.set) { - for (const part of pattern) { - if (typeof part !== "string") - return true; - } - } - return false; - } - debug(..._2) { - } - make() { - const pattern = this.pattern; - const options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; - } - if (!pattern) { - this.empty = true; - return; - } - this.parseNegate(); - this.globSet = [...new Set(this.braceExpand())]; - if (options.debug) { - this.debug = (...args) => console.error(...args); - } - this.debug(this.pattern, this.globSet); - const rawGlobParts = this.globSet.map((s) => this.slashSplit(s)); - this.globParts = this.preprocess(rawGlobParts); - this.debug(this.pattern, this.globParts); - let set = this.globParts.map((s, _2, __) => { - if (this.isWindows && this.windowsNoMagicRoot) { - const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]); - const isDrive = /^[a-z]:/i.test(s[0]); - if (isUNC) { - return [ - ...s.slice(0, 4), - ...s.slice(4).map((ss) => this.parse(ss)) - ]; - } else if (isDrive) { - return [s[0], ...s.slice(1).map((ss) => this.parse(ss))]; - } - } - return s.map((ss) => this.parse(ss)); - }); - this.debug(this.pattern, set); - this.set = set.filter((s) => s.indexOf(false) === -1); - if (this.isWindows) { - for (let i = 0; i < this.set.length; i++) { - const p = this.set[i]; - if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) { - p[2] = "?"; - } - } - } - this.debug(this.pattern, this.set); - } - // various transforms to equivalent pattern sets that are - // faster to process in a filesystem walk. The goal is to - // eliminate what we can, and push all ** patterns as far - // to the right as possible, even if it increases the number - // of patterns that we have to process. - preprocess(globParts) { - if (this.options.noglobstar) { - for (const partset of globParts) { - for (let j = 0; j < partset.length; j++) { - if (partset[j] === "**") { - partset[j] = "*"; - } - } - } - } - const { optimizationLevel = 1 } = this.options; - if (optimizationLevel >= 2) { - globParts = this.firstPhasePreProcess(globParts); - globParts = this.secondPhasePreProcess(globParts); - } else if (optimizationLevel >= 1) { - globParts = this.levelOneOptimize(globParts); - } else { - globParts = this.adjascentGlobstarOptimize(globParts); - } - return globParts; - } - // just get rid of adjascent ** portions - adjascentGlobstarOptimize(globParts) { - return globParts.map((parts) => { - let gs = -1; - while (-1 !== (gs = parts.indexOf("**", gs + 1))) { - let i = gs; - while (parts[i + 1] === "**") { - i++; - } - if (i !== gs) { - parts.splice(gs, i - gs); - } - } - return parts; - }); - } - // get rid of adjascent ** and resolve .. portions - levelOneOptimize(globParts) { - return globParts.map((parts) => { - parts = parts.reduce((set, part) => { - const prev = set[set.length - 1]; - if (part === "**" && prev === "**") { - return set; - } - if (part === "..") { - if (prev && prev !== ".." && prev !== "." && prev !== "**") { - set.pop(); - return set; - } - } - set.push(part); - return set; - }, []); - return parts.length === 0 ? [""] : parts; - }); - } - levelTwoFileOptimize(parts) { - if (!Array.isArray(parts)) { - parts = this.slashSplit(parts); - } - let didSomething = false; - do { - didSomething = false; - if (!this.preserveMultipleSlashes) { - for (let i = 1; i < parts.length - 1; i++) { - const p = parts[i]; - if (i === 1 && p === "" && parts[0] === "") - continue; - if (p === "." || p === "") { - didSomething = true; - parts.splice(i, 1); - i--; - } - } - if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) { - didSomething = true; - parts.pop(); - } - } - let dd = 0; - while (-1 !== (dd = parts.indexOf("..", dd + 1))) { - const p = parts[dd - 1]; - if (p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p))) { - didSomething = true; - parts.splice(dd - 1, 2); - dd -= 2; - } - } - } while (didSomething); - return parts.length === 0 ? [""] : parts; - } - // First phase: single-pattern processing - //
 is 1 or more portions
-  //  is 1 or more portions
-  // 

is any portion other than ., .., '', or ** - // is . or '' - // - // **/.. is *brutal* for filesystem walking performance, because - // it effectively resets the recursive walk each time it occurs, - // and ** cannot be reduced out by a .. pattern part like a regexp - // or most strings (other than .., ., and '') can be. - // - //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - //

// -> 
/
-  // 
/

/../ ->

/
-  // **/**/ -> **/
-  //
-  // **/*/ -> */**/ <== not valid because ** doesn't follow
-  // this WOULD be allowed if ** did follow symlinks, or * didn't
-  firstPhasePreProcess(globParts) {
-    let didSomething = false;
-    do {
-      didSomething = false;
-      for (let parts of globParts) {
-        let gs = -1;
-        while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
-          let gss = gs;
-          while (parts[gss + 1] === "**") {
-            gss++;
-          }
-          if (gss > gs) {
-            parts.splice(gs + 1, gss - gs);
-          }
-          let next = parts[gs + 1];
-          const p = parts[gs + 2];
-          const p2 = parts[gs + 3];
-          if (next !== "..")
-            continue;
-          if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
-            continue;
-          }
-          didSomething = true;
-          parts.splice(gs, 1);
-          const other = parts.slice(0);
-          other[gs] = "**";
-          globParts.push(other);
-          gs--;
-        }
-        if (!this.preserveMultipleSlashes) {
-          for (let i = 1; i < parts.length - 1; i++) {
-            const p = parts[i];
-            if (i === 1 && p === "" && parts[0] === "")
-              continue;
-            if (p === "." || p === "") {
-              didSomething = true;
-              parts.splice(i, 1);
-              i--;
-            }
-          }
-          if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
-            didSomething = true;
-            parts.pop();
-          }
-        }
-        let dd = 0;
-        while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
-          const p = parts[dd - 1];
-          if (p && p !== "." && p !== ".." && p !== "**") {
-            didSomething = true;
-            const needDot = dd === 1 && parts[dd + 1] === "**";
-            const splin = needDot ? ["."] : [];
-            parts.splice(dd - 1, 2, ...splin);
-            if (parts.length === 0)
-              parts.push("");
-            dd -= 2;
-          }
-        }
-      }
-    } while (didSomething);
-    return globParts;
-  }
-  // second phase: multi-pattern dedupes
-  // {
/*/,
/

/} ->

/*/
-  // {
/,
/} -> 
/
-  // {
/**/,
/} -> 
/**/
-  //
-  // {
/**/,
/**/

/} ->

/**/
-  // ^-- not valid because ** doens't follow symlinks
-  secondPhasePreProcess(globParts) {
-    for (let i = 0; i < globParts.length - 1; i++) {
-      for (let j = i + 1; j < globParts.length; j++) {
-        const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
-        if (matched) {
-          globParts[i] = [];
-          globParts[j] = matched;
-          break;
-        }
-      }
-    }
-    return globParts.filter((gs) => gs.length);
-  }
-  partsMatch(a, b, emptyGSMatch = false) {
-    let ai = 0;
-    let bi = 0;
-    let result = [];
-    let which9 = "";
-    while (ai < a.length && bi < b.length) {
-      if (a[ai] === b[bi]) {
-        result.push(which9 === "b" ? b[bi] : a[ai]);
-        ai++;
-        bi++;
-      } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
-        result.push(a[ai]);
-        ai++;
-      } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
-        result.push(b[bi]);
-        bi++;
-      } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
-        if (which9 === "b")
-          return false;
-        which9 = "a";
-        result.push(a[ai]);
-        ai++;
-        bi++;
-      } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
-        if (which9 === "a")
-          return false;
-        which9 = "b";
-        result.push(b[bi]);
-        ai++;
-        bi++;
-      } else {
-        return false;
-      }
-    }
-    return a.length === b.length && result;
-  }
-  parseNegate() {
-    if (this.nonegate)
-      return;
-    const pattern = this.pattern;
-    let negate2 = false;
-    let negateOffset = 0;
-    for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
-      negate2 = !negate2;
-      negateOffset++;
-    }
-    if (negateOffset)
-      this.pattern = pattern.slice(negateOffset);
-    this.negate = negate2;
-  }
-  // set partial to true to test if, for example,
-  // "/a/b" matches the start of "/*/b/*/d"
-  // Partial means, if you run out of file before you run
-  // out of pattern, then that's fine, as long as all
-  // the parts match.
-  matchOne(file, pattern, partial = false) {
-    let fileStartIndex = 0;
-    let patternStartIndex = 0;
-    if (this.isWindows) {
-      const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
-      const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
-      const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
-      const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
-      const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
-      const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
-      if (typeof fdi === "number" && typeof pdi === "number") {
-        const [fd, pd] = [
-          file[fdi],
-          pattern[pdi]
-        ];
-        if (fd.toLowerCase() === pd.toLowerCase()) {
-          pattern[pdi] = fd;
-          patternStartIndex = pdi;
-          fileStartIndex = fdi;
-        }
-      }
-    }
-    const { optimizationLevel = 1 } = this.options;
-    if (optimizationLevel >= 2) {
-      file = this.levelTwoFileOptimize(file);
-    }
-    if (pattern.includes(GLOBSTAR)) {
-      return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
-    }
-    return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
-  }
-  #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
-    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
-    const lastgs = pattern.lastIndexOf(GLOBSTAR);
-    const [head, body, tail] = partial ? [
-      pattern.slice(patternIndex, firstgs),
-      pattern.slice(firstgs + 1),
-      []
-    ] : [
-      pattern.slice(patternIndex, firstgs),
-      pattern.slice(firstgs + 1, lastgs),
-      pattern.slice(lastgs + 1)
-    ];
-    if (head.length) {
-      const fileHead = file.slice(fileIndex, fileIndex + head.length);
-      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
-        return false;
-      }
-      fileIndex += head.length;
-      patternIndex += head.length;
-    }
-    let fileTailMatch = 0;
-    if (tail.length) {
-      if (tail.length + fileIndex > file.length)
-        return false;
-      let tailStart = file.length - tail.length;
-      if (this.#matchOne(file, tail, partial, tailStart, 0)) {
-        fileTailMatch = tail.length;
-      } else {
-        if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
-          return false;
-        }
-        tailStart--;
-        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
-          return false;
-        }
-        fileTailMatch = tail.length + 1;
-      }
-    }
-    if (!body.length) {
-      let sawSome = !!fileTailMatch;
-      for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
-        const f = String(file[i2]);
-        sawSome = true;
-        if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
-          return false;
-        }
-      }
-      return partial || sawSome;
-    }
-    const bodySegments = [[[], 0]];
-    let currentBody = bodySegments[0];
-    let nonGsParts = 0;
-    const nonGsPartsSums = [0];
-    for (const b of body) {
-      if (b === GLOBSTAR) {
-        nonGsPartsSums.push(nonGsParts);
-        currentBody = [[], 0];
-        bodySegments.push(currentBody);
-      } else {
-        currentBody[0].push(b);
-        nonGsParts++;
-      }
-    }
-    let i = bodySegments.length - 1;
-    const fileLength = file.length - fileTailMatch;
-    for (const b of bodySegments) {
-      b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
-    }
-    return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
-  }
-  // return false for "nope, not matching"
-  // return null for "not matching, cannot keep trying"
-  #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
-    const bs = bodySegments[bodyIndex];
-    if (!bs) {
-      for (let i = fileIndex; i < file.length; i++) {
-        sawTail = true;
-        const f = file[i];
-        if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
-          return false;
-        }
-      }
-      return sawTail;
-    }
-    const [body, after] = bs;
-    while (fileIndex <= after) {
-      const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
-      if (m && globStarDepth < this.maxGlobstarRecursion) {
-        const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
-        if (sub !== false) {
-          return sub;
-        }
-      }
-      const f = file[fileIndex];
-      if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
-        return false;
-      }
-      fileIndex++;
-    }
-    return partial || null;
-  }
-  #matchOne(file, pattern, partial, fileIndex, patternIndex) {
-    let fi;
-    let pi;
-    let pl;
-    let fl;
-    for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
-      this.debug("matchOne loop");
-      let p = pattern[pi];
-      let f = file[fi];
-      this.debug(pattern, p, f);
-      if (p === false || p === GLOBSTAR) {
-        return false;
-      }
-      let hit;
-      if (typeof p === "string") {
-        hit = f === p;
-        this.debug("string match", p, f, hit);
-      } else {
-        hit = p.test(f);
-        this.debug("pattern match", p, f, hit);
-      }
-      if (!hit)
-        return false;
-    }
-    if (fi === fl && pi === pl) {
-      return true;
-    } else if (fi === fl) {
-      return partial;
-    } else if (pi === pl) {
-      return fi === fl - 1 && file[fi] === "";
-    } else {
-      throw new Error("wtf?");
-    }
-  }
-  braceExpand() {
-    return braceExpand(this.pattern, this.options);
-  }
-  parse(pattern) {
-    assertValidPattern(pattern);
-    const options = this.options;
-    if (pattern === "**")
-      return GLOBSTAR;
-    if (pattern === "")
-      return "";
-    let m;
-    let fastTest = null;
-    if (m = pattern.match(starRE)) {
-      fastTest = options.dot ? starTestDot : starTest;
-    } else if (m = pattern.match(starDotExtRE)) {
-      fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
-    } else if (m = pattern.match(qmarksRE)) {
-      fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
-    } else if (m = pattern.match(starDotStarRE)) {
-      fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
-    } else if (m = pattern.match(dotStarRE)) {
-      fastTest = dotStarTest;
-    }
-    const re = AST.fromGlob(pattern, this.options).toMMPattern();
-    if (fastTest && typeof re === "object") {
-      Reflect.defineProperty(re, "test", { value: fastTest });
-    }
-    return re;
-  }
-  makeRe() {
-    if (this.regexp || this.regexp === false)
-      return this.regexp;
-    const set = this.set;
-    if (!set.length) {
-      this.regexp = false;
-      return this.regexp;
-    }
-    const options = this.options;
-    const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
-    const flags = new Set(options.nocase ? ["i"] : []);
-    let re = set.map((pattern) => {
-      const pp = pattern.map((p) => {
-        if (p instanceof RegExp) {
-          for (const f of p.flags.split(""))
-            flags.add(f);
-        }
-        return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
-      });
-      pp.forEach((p, i) => {
-        const next = pp[i + 1];
-        const prev = pp[i - 1];
-        if (p !== GLOBSTAR || prev === GLOBSTAR) {
-          return;
-        }
-        if (prev === void 0) {
-          if (next !== void 0 && next !== GLOBSTAR) {
-            pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
-          } else {
-            pp[i] = twoStar;
-          }
-        } else if (next === void 0) {
-          pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
-        } else if (next !== GLOBSTAR) {
-          pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
-          pp[i + 1] = GLOBSTAR;
-        }
-      });
-      const filtered = pp.filter((p) => p !== GLOBSTAR);
-      if (this.partial && filtered.length >= 1) {
-        const prefixes = [];
-        for (let i = 1; i <= filtered.length; i++) {
-          prefixes.push(filtered.slice(0, i).join("/"));
-        }
-        return "(?:" + prefixes.join("|") + ")";
-      }
-      return filtered.join("/");
-    }).join("|");
-    const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
-    re = "^" + open + re + close + "$";
-    if (this.partial) {
-      re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$";
-    }
-    if (this.negate)
-      re = "^(?!" + re + ").+$";
-    try {
-      this.regexp = new RegExp(re, [...flags].join(""));
-    } catch {
-      this.regexp = false;
-    }
-    return this.regexp;
-  }
-  slashSplit(p) {
-    if (this.preserveMultipleSlashes) {
-      return p.split("/");
-    } else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
-      return ["", ...p.split(/\/+/)];
-    } else {
-      return p.split(/\/+/);
-    }
-  }
-  match(f, partial = this.partial) {
-    this.debug("match", f, this.pattern);
-    if (this.comment) {
-      return false;
-    }
-    if (this.empty) {
-      return f === "";
-    }
-    if (f === "/" && partial) {
-      return true;
-    }
-    const options = this.options;
-    if (this.isWindows) {
-      f = f.split("\\").join("/");
-    }
-    const ff = this.slashSplit(f);
-    this.debug(this.pattern, "split", ff);
-    const set = this.set;
-    this.debug(this.pattern, "set", set);
-    let filename = ff[ff.length - 1];
-    if (!filename) {
-      for (let i = ff.length - 2; !filename && i >= 0; i--) {
-        filename = ff[i];
-      }
-    }
-    for (const pattern of set) {
-      let file = ff;
-      if (options.matchBase && pattern.length === 1) {
-        file = [filename];
-      }
-      const hit = this.matchOne(file, pattern, partial);
-      if (hit) {
-        if (options.flipNegate) {
-          return true;
-        }
-        return !this.negate;
-      }
-    }
-    if (options.flipNegate) {
-      return false;
-    }
-    return this.negate;
-  }
-  static defaults(def) {
-    return minimatch.defaults(def).Minimatch;
-  }
-};
-minimatch.AST = AST;
-minimatch.Minimatch = Minimatch;
-minimatch.escape = escape2;
-minimatch.unescape = unescape2;
-
-// node_modules/readdir-glob/dist/index.mjs
-var import_path6 = require("path");
-function readdir2(dir, strict) {
-  return new Promise((resolve$1, reject) => {
-    fs24.readdir(dir, { withFileTypes: true }, (err, files) => {
-      if (err) switch (err.code) {
-        case "ENOTDIR":
-          if (strict) reject(err);
-          else resolve$1([]);
-          break;
-        case "ENOTSUP":
-        case "ENOENT":
-        case "ENAMETOOLONG":
-        case "UNKNOWN":
-          resolve$1([]);
-          break;
-        case "ELOOP":
-        default:
-          reject(err);
-          break;
-      }
-      else resolve$1(files);
-    });
-  });
-}
-function getStat(file, followSymlinks) {
-  return new Promise((resolve$1) => {
-    const statFunc = followSymlinks ? fs24.stat : fs24.lstat;
-    statFunc(file, (err, stats) => {
-      if (err) switch (err.code) {
-        case "ENOENT":
-          if (followSymlinks) resolve$1(getStat(file, false));
-          else resolve$1(null);
-          break;
-        default:
-          resolve$1(null);
-          break;
-      }
-      else resolve$1(stats);
-    });
-  });
-}
-async function* exploreWalkAsync(dir, path30, followSymlinks, useStat, shouldSkip, strict) {
-  let files = await readdir2(path30 + dir, strict);
-  for (const file of files) {
-    let name = file.name;
-    const filename = dir + "/" + name;
-    const relative3 = filename.slice(1);
-    const absolute = path30 + "/" + relative3;
-    let stat2 = file;
-    if (useStat || followSymlinks) stat2 = await getStat(absolute, followSymlinks) ?? stat2;
-    if (stat2.isDirectory()) {
-      if (!shouldSkip(relative3)) {
-        yield {
-          relative: relative3,
-          absolute,
-          stat: stat2
-        };
-        yield* exploreWalkAsync(filename, path30, followSymlinks, useStat, shouldSkip, false);
-      }
-    } else yield {
-      relative: relative3,
-      absolute,
-      stat: stat2
-    };
-  }
-}
-async function* explore(path30, followSymlinks, useStat, shouldSkip) {
-  yield* exploreWalkAsync("", path30, followSymlinks, useStat, shouldSkip, true);
-}
-function readOptions(options) {
-  return {
-    pattern: options.pattern,
-    dot: !!options.dot,
-    noglobstar: !!options.noglobstar,
-    matchBase: !!options.matchBase,
-    nocase: !!options.nocase,
-    ignore: options.ignore,
-    skip: options.skip,
-    follow: !!options.follow,
-    stat: !!options.stat,
-    nodir: !!options.nodir,
-    mark: !!options.mark,
-    silent: !!options.silent,
-    absolute: !!options.absolute
-  };
-}
-var ReaddirGlob = class extends import_events.EventEmitter {
-  options;
-  matchers;
-  ignoreMatchers;
-  skipMatchers;
-  paused;
-  aborted;
-  inactive;
-  iterator;
-  constructor(cwd, options, cb) {
-    super();
-    if (typeof options === "function") {
-      cb = options;
-      options = void 0;
-    }
-    this.options = readOptions(options || {});
-    this.matchers = [];
-    if (this.options.pattern) {
-      const matchers = Array.isArray(this.options.pattern) ? this.options.pattern : [this.options.pattern];
-      this.matchers = matchers.map((m) => new Minimatch(m, {
-        dot: this.options.dot,
-        noglobstar: this.options.noglobstar,
-        matchBase: this.options.matchBase,
-        nocase: this.options.nocase
-      }));
-    }
-    this.ignoreMatchers = [];
-    if (this.options.ignore) {
-      const ignorePatterns = Array.isArray(this.options.ignore) ? this.options.ignore : [this.options.ignore];
-      this.ignoreMatchers = ignorePatterns.map((ignore) => new Minimatch(ignore, { dot: true }));
-    }
-    this.skipMatchers = [];
-    if (this.options.skip) {
-      const skipPatterns = Array.isArray(this.options.skip) ? this.options.skip : [this.options.skip];
-      this.skipMatchers = skipPatterns.map((skip) => new Minimatch(skip, { dot: true }));
-    }
-    this.iterator = explore((0, import_path6.resolve)(cwd || "."), this.options.follow, this.options.stat, this._shouldSkipDirectory.bind(this));
-    this.paused = false;
-    this.inactive = false;
-    this.aborted = false;
-    if (cb) {
-      const nonNullCb = cb;
-      const matches = [];
-      this.on("match", (match2) => matches.push(this.options.absolute ? match2.absolute : match2.relative));
-      this.on("error", (err) => nonNullCb(err));
-      this.on("end", () => nonNullCb(null, matches));
-    }
-    setTimeout(() => this._next());
-  }
-  _shouldSkipDirectory(relative3) {
-    return this.skipMatchers.some((m) => m.match(relative3));
-  }
-  _fileMatches(relative3, isDirectory) {
-    const file = relative3 + (isDirectory ? "/" : "");
-    return (this.matchers.length === 0 || this.matchers.some((m) => m.match(file))) && !this.ignoreMatchers.some((m) => m.match(file)) && (!this.options.nodir || !isDirectory);
-  }
-  _next() {
-    if (!this.paused && !this.aborted) this.iterator.next().then((obj) => {
-      if (!obj.done) {
-        const isDirectory = obj.value.stat.isDirectory();
-        if (this._fileMatches(obj.value.relative, isDirectory)) {
-          let relative3 = obj.value.relative;
-          let absolute = obj.value.absolute;
-          if (this.options.mark && isDirectory) {
-            relative3 += "/";
-            absolute += "/";
-          }
-          if (this.options.stat) this.emit("match", {
-            relative: relative3,
-            absolute,
-            stat: obj.value.stat
-          });
-          else this.emit("match", {
-            relative: relative3,
-            absolute
-          });
-        }
-        this._next();
-      } else this.emit("end");
-    }).catch((err) => {
-      this.abort();
-      this.emit("error", err);
-      if (!err.code && !this.options.silent) console.error(err);
-    });
-    else this.inactive = true;
-  }
-  abort() {
-    this.aborted = true;
-  }
-  pause() {
-    this.paused = true;
-  }
-  resume() {
-    this.paused = false;
-    if (this.inactive) {
-      this.inactive = false;
-      this._next();
-    }
-  }
-};
-var readdirGlob = (pattern, options, cb) => new ReaddirGlob(pattern, options, cb);
-readdirGlob.ReaddirGlob = ReaddirGlob;
-var src_default = readdirGlob;
-
-// node_modules/archiver/lib/core.js
-var import_lazystream = __toESM(require_lazystream(), 1);
-var import_async = __toESM(require_async(), 1);
-var import_path7 = require("path");
-
-// node_modules/archiver/lib/error.js
-var import_util34 = __toESM(require("util"), 1);
-var ERROR_CODES = {
-  ABORTED: "archive was aborted",
-  DIRECTORYDIRPATHREQUIRED: "diretory dirpath argument must be a non-empty string value",
-  DIRECTORYFUNCTIONINVALIDDATA: "invalid data returned by directory custom data function",
-  ENTRYNAMEREQUIRED: "entry name must be a non-empty string value",
-  FILEFILEPATHREQUIRED: "file filepath argument must be a non-empty string value",
-  FINALIZING: "archive already finalizing",
-  QUEUECLOSED: "queue closed",
-  NOENDMETHOD: "no suitable finalize/end method defined by module",
-  DIRECTORYNOTSUPPORTED: "support for directory entries not defined by module",
-  FORMATSET: "archive format already set",
-  INPUTSTEAMBUFFERREQUIRED: "input source must be valid Stream or Buffer instance",
-  MODULESET: "module already set",
-  SYMLINKNOTSUPPORTED: "support for symlink entries not defined by module",
-  SYMLINKFILEPATHREQUIRED: "symlink filepath argument must be a non-empty string value",
-  SYMLINKTARGETREQUIRED: "symlink target argument must be a non-empty string value",
-  ENTRYNOTSUPPORTED: "entry not supported"
-};
-function ArchiverError(code, data) {
-  Error.captureStackTrace(this, this.constructor);
-  this.message = ERROR_CODES[code] || code;
-  this.code = code;
-  this.data = data;
-}
-import_util34.default.inherits(ArchiverError, Error);
-
-// node_modules/archiver/lib/core.js
-var import_readable_stream2 = __toESM(require_ours(), 1);
-
-// node_modules/archiver/lib/utils.js
-var import_normalize_path = __toESM(require_normalize_path(), 1);
-var import_readable_stream = __toESM(require_ours(), 1);
-function dateify(dateish) {
-  dateish = dateish || /* @__PURE__ */ new Date();
-  if (dateish instanceof Date) {
-    dateish = dateish;
-  } else if (typeof dateish === "string") {
-    dateish = new Date(dateish);
-  } else {
-    dateish = /* @__PURE__ */ new Date();
-  }
-  return dateish;
-}
-function normalizeInputSource(source) {
-  if (source === null) {
-    return Buffer.alloc(0);
-  } else if (typeof source === "string") {
-    return Buffer.from(source);
-  } else if (isStream(source)) {
-    return source.pipe(new import_readable_stream.PassThrough());
-  }
-  return source;
-}
-function sanitizePath(filepath) {
-  return (0, import_normalize_path.default)(filepath, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
-}
-function trailingSlashIt(str) {
-  return str.slice(-1) !== "/" ? str + "/" : str;
-}
-
-// node_modules/archiver/lib/core.js
-var { ReaddirGlob: ReaddirGlob2 } = src_default;
-var win32 = process.platform === "win32";
-var Archiver = class extends import_readable_stream2.Transform {
-  _supportsDirectory = false;
-  _supportsSymlink = false;
-  /**
-   * @constructor
-   * @param {String} format The archive format to use.
-   * @param {(CoreOptions|TransformOptions)} options See also {@link ZipOptions} and {@link TarOptions}.
-   */
-  constructor(options) {
-    options = {
-      highWaterMark: 1024 * 1024,
-      statConcurrency: 4,
-      ...options
-    };
-    super(options);
-    this.options = options;
-    this._format = false;
-    this._module = false;
-    this._pending = 0;
-    this._pointer = 0;
-    this._entriesCount = 0;
-    this._entriesProcessedCount = 0;
-    this._fsEntriesTotalBytes = 0;
-    this._fsEntriesProcessedBytes = 0;
-    this._queue = (0, import_async.queue)(this._onQueueTask.bind(this), 1);
-    this._queue.drain(this._onQueueDrain.bind(this));
-    this._statQueue = (0, import_async.queue)(
-      this._onStatQueueTask.bind(this),
-      options.statConcurrency
-    );
-    this._statQueue.drain(this._onQueueDrain.bind(this));
-    this._state = {
-      aborted: false,
-      finalize: false,
-      finalizing: false,
-      finalized: false,
-      modulePiped: false
-    };
-    this._streams = [];
-  }
-  /**
-   * Internal logic for `abort`.
-   *
-   * @private
-   * @return void
-   */
-  _abort() {
-    this._state.aborted = true;
-    this._queue.kill();
-    this._statQueue.kill();
-    if (this._queue.idle()) {
-      this._shutdown();
-    }
-  }
-  /**
-   * Internal helper for appending files.
-   *
-   * @private
-   * @param  {String} filepath The source filepath.
-   * @param  {EntryData} data The entry data.
-   * @return void
-   */
-  _append(filepath, data) {
-    data = data || {};
-    let task = {
-      source: null,
-      filepath
-    };
-    if (!data.name) {
-      data.name = filepath;
-    }
-    data.sourcePath = filepath;
-    task.data = data;
-    this._entriesCount++;
-    if (data.stats && data.stats instanceof import_fs2.Stats) {
-      task = this._updateQueueTaskWithStats(task, data.stats);
-      if (task) {
-        if (data.stats.size) {
-          this._fsEntriesTotalBytes += data.stats.size;
-        }
-        this._queue.push(task);
-      }
-    } else {
-      this._statQueue.push(task);
-    }
-  }
-  /**
-   * Internal logic for `finalize`.
-   *
-   * @private
-   * @return void
-   */
-  _finalize() {
-    if (this._state.finalizing || this._state.finalized || this._state.aborted) {
-      return;
-    }
-    this._state.finalizing = true;
-    this._moduleFinalize();
-    this._state.finalizing = false;
-    this._state.finalized = true;
-  }
-  /**
-   * Checks the various state variables to determine if we can `finalize`.
-   *
-   * @private
-   * @return {Boolean}
-   */
-  _maybeFinalize() {
-    if (this._state.finalizing || this._state.finalized || this._state.aborted) {
-      return false;
-    }
-    if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
-      this._finalize();
-      return true;
-    }
-    return false;
-  }
-  /**
-   * Appends an entry to the module.
-   *
-   * @private
-   * @fires  Archiver#entry
-   * @param  {(Buffer|Stream)} source
-   * @param  {EntryData} data
-   * @param  {Function} callback
-   * @return void
-   */
-  _moduleAppend(source, data, callback) {
-    if (this._state.aborted) {
-      callback();
-      return;
-    }
-    this._module.append(
-      source,
-      data,
-      function(err) {
-        this._task = null;
-        if (this._state.aborted) {
-          this._shutdown();
-          return;
-        }
-        if (err) {
-          this.emit("error", err);
-          setImmediate(callback);
-          return;
-        }
-        this.emit("entry", data);
-        this._entriesProcessedCount++;
-        if (data.stats && data.stats.size) {
-          this._fsEntriesProcessedBytes += data.stats.size;
-        }
-        this.emit("progress", {
-          entries: {
-            total: this._entriesCount,
-            processed: this._entriesProcessedCount
-          },
-          fs: {
-            totalBytes: this._fsEntriesTotalBytes,
-            processedBytes: this._fsEntriesProcessedBytes
-          }
-        });
-        setImmediate(callback);
-      }.bind(this)
-    );
-  }
-  /**
-   * Finalizes the module.
-   *
-   * @private
-   * @return void
-   */
-  _moduleFinalize() {
-    if (typeof this._module.finalize === "function") {
-      this._module.finalize();
-    } else if (typeof this._module.end === "function") {
-      this._module.end();
-    } else {
-      this.emit("error", new ArchiverError("NOENDMETHOD"));
-    }
-  }
-  /**
-   * Pipes the module to our internal stream with error bubbling.
-   *
-   * @private
-   * @return void
-   */
-  _modulePipe() {
-    this._module.on("error", this._onModuleError.bind(this));
-    this._module.pipe(this);
-    this._state.modulePiped = true;
-  }
-  /**
-   * Unpipes the module from our internal stream.
-   *
-   * @private
-   * @return void
-   */
-  _moduleUnpipe() {
-    this._module.unpipe(this);
-    this._state.modulePiped = false;
-  }
-  /**
-   * Normalizes entry data with fallbacks for key properties.
-   *
-   * @private
-   * @param  {Object} data
-   * @param  {fs.Stats} stats
-   * @return {Object}
-   */
-  _normalizeEntryData(data, stats) {
-    data = {
-      type: "file",
-      name: null,
-      date: null,
-      mode: null,
-      prefix: null,
-      sourcePath: null,
-      stats: false,
-      ...data
-    };
-    if (stats && data.stats === false) {
-      data.stats = stats;
-    }
-    let isDir = data.type === "directory";
-    if (data.name) {
-      if (typeof data.prefix === "string" && "" !== data.prefix) {
-        data.name = data.prefix + "/" + data.name;
-        data.prefix = null;
-      }
-      data.name = sanitizePath(data.name);
-      if (data.type !== "symlink" && data.name.slice(-1) === "/") {
-        isDir = true;
-        data.type = "directory";
-      } else if (isDir) {
-        data.name += "/";
-      }
-    }
-    if (typeof data.mode === "number") {
-      if (win32) {
-        data.mode &= 511;
-      } else {
-        data.mode &= 4095;
-      }
-    } else if (data.stats && data.mode === null) {
-      if (win32) {
-        data.mode = data.stats.mode & 511;
-      } else {
-        data.mode = data.stats.mode & 4095;
-      }
-      if (win32 && isDir) {
-        data.mode = 493;
-      }
-    } else if (data.mode === null) {
-      data.mode = isDir ? 493 : 420;
-    }
-    if (data.stats && data.date === null) {
-      data.date = data.stats.mtime;
-    } else {
-      data.date = dateify(data.date);
-    }
-    return data;
-  }
-  /**
-   * Error listener that re-emits error on to our internal stream.
-   *
-   * @private
-   * @param  {Error} err
-   * @return void
-   */
-  _onModuleError(err) {
-    this.emit("error", err);
-  }
-  /**
-   * Checks the various state variables after queue has drained to determine if
-   * we need to `finalize`.
-   *
-   * @private
-   * @return void
-   */
-  _onQueueDrain() {
-    if (this._state.finalizing || this._state.finalized || this._state.aborted) {
-      return;
-    }
-    if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
-      this._finalize();
-    }
-  }
-  /**
-   * Appends each queue task to the module.
-   *
-   * @private
-   * @param  {Object} task
-   * @param  {Function} callback
-   * @return void
-   */
-  _onQueueTask(task, callback) {
-    const fullCallback = () => {
-      if (task.data.callback) {
-        task.data.callback();
-      }
-      callback();
-    };
-    if (this._state.finalizing || this._state.finalized || this._state.aborted) {
-      fullCallback();
-      return;
-    }
-    this._task = task;
-    this._moduleAppend(task.source, task.data, fullCallback);
-  }
-  /**
-   * Performs a file stat and reinjects the task back into the queue.
-   *
-   * @private
-   * @param  {Object} task
-   * @param  {Function} callback
-   * @return void
-   */
-  _onStatQueueTask(task, callback) {
-    if (this._state.finalizing || this._state.finalized || this._state.aborted) {
-      callback();
-      return;
-    }
-    (0, import_fs2.lstat)(
-      task.filepath,
-      function(err, stats) {
-        if (this._state.aborted) {
-          setImmediate(callback);
-          return;
-        }
-        if (err) {
-          this._entriesCount--;
-          this.emit("warning", err);
-          setImmediate(callback);
-          return;
-        }
-        task = this._updateQueueTaskWithStats(task, stats);
-        if (task) {
-          if (stats.size) {
-            this._fsEntriesTotalBytes += stats.size;
-          }
-          this._queue.push(task);
-        }
-        setImmediate(callback);
-      }.bind(this)
-    );
-  }
-  /**
-   * Unpipes the module and ends our internal stream.
-   *
-   * @private
-   * @return void
-   */
-  _shutdown() {
-    this._moduleUnpipe();
-    this.end();
-  }
-  /**
-   * Tracks the bytes emitted by our internal stream.
-   *
-   * @private
-   * @param  {Buffer} chunk
-   * @param  {String} encoding
-   * @param  {Function} callback
-   * @return void
-   */
-  _transform(chunk, encoding, callback) {
-    if (chunk) {
-      this._pointer += chunk.length;
-    }
-    callback(null, chunk);
-  }
-  /**
-   * Updates and normalizes a queue task using stats data.
-   *
-   * @private
-   * @param  {Object} task
-   * @param  {Stats} stats
-   * @return {Object}
-   */
-  _updateQueueTaskWithStats(task, stats) {
-    if (stats.isFile()) {
-      task.data.type = "file";
-      task.data.sourceType = "stream";
-      task.source = new import_lazystream.Readable(function() {
-        return (0, import_fs2.createReadStream)(task.filepath);
-      });
-    } else if (stats.isDirectory() && this._supportsDirectory) {
-      task.data.name = trailingSlashIt(task.data.name);
-      task.data.type = "directory";
-      task.data.sourcePath = trailingSlashIt(task.filepath);
-      task.data.sourceType = "buffer";
-      task.source = Buffer.concat([]);
-    } else if (stats.isSymbolicLink() && this._supportsSymlink) {
-      const linkPath = (0, import_fs2.readlinkSync)(task.filepath);
-      const dirName = (0, import_path7.dirname)(task.filepath);
-      task.data.type = "symlink";
-      task.data.linkname = (0, import_path7.relative)(
-        dirName,
-        (0, import_path7.resolve)(dirName, linkPath)
-      );
-      task.data.sourceType = "buffer";
-      task.source = Buffer.concat([]);
-    } else {
-      if (stats.isDirectory()) {
-        this.emit(
-          "warning",
-          new ArchiverError("DIRECTORYNOTSUPPORTED", task.data)
-        );
-      } else if (stats.isSymbolicLink()) {
-        this.emit(
-          "warning",
-          new ArchiverError("SYMLINKNOTSUPPORTED", task.data)
-        );
-      } else {
-        this.emit("warning", new ArchiverError("ENTRYNOTSUPPORTED", task.data));
-      }
-      return null;
-    }
-    task.data = this._normalizeEntryData(task.data, stats);
-    return task;
-  }
-  /**
-   * Aborts the archiving process, taking a best-effort approach, by:
-   *
-   * - removing any pending queue tasks
-   * - allowing any active queue workers to finish
-   * - detaching internal module pipes
-   * - ending both sides of the Transform stream
-   *
-   * It will NOT drain any remaining sources.
-   *
-   * @return {this}
-   */
-  abort() {
-    if (this._state.aborted || this._state.finalized) {
-      return this;
-    }
-    this._abort();
-    return this;
-  }
-  /**
-   * Appends an input source (text string, buffer, or stream) to the instance.
-   *
-   * When the instance has received, processed, and emitted the input, the `entry`
-   * event is fired.
-   *
-   * @fires  Archiver#entry
-   * @param  {(Buffer|Stream|String)} source The input source.
-   * @param  {EntryData} data See also {@link ZipEntryData} and {@link TarEntryData}.
-   * @return {this}
-   */
-  append(source, data) {
-    if (this._state.finalize || this._state.aborted) {
-      this.emit("error", new ArchiverError("QUEUECLOSED"));
-      return this;
-    }
-    data = this._normalizeEntryData(data);
-    if (typeof data.name !== "string" || data.name.length === 0) {
-      this.emit("error", new ArchiverError("ENTRYNAMEREQUIRED"));
-      return this;
-    }
-    if (data.type === "directory" && !this._supportsDirectory) {
-      this.emit(
-        "error",
-        new ArchiverError("DIRECTORYNOTSUPPORTED", { name: data.name })
-      );
-      return this;
-    }
-    source = normalizeInputSource(source);
-    if (Buffer.isBuffer(source)) {
-      data.sourceType = "buffer";
-    } else if (isStream(source)) {
-      data.sourceType = "stream";
-    } else {
-      this.emit(
-        "error",
-        new ArchiverError("INPUTSTEAMBUFFERREQUIRED", { name: data.name })
-      );
-      return this;
-    }
-    this._entriesCount++;
-    this._queue.push({
-      data,
-      source
-    });
-    return this;
-  }
-  /**
-   * Appends a directory and its files, recursively, given its dirpath.
-   *
-   * @param  {String} dirpath The source directory path.
-   * @param  {String} destpath The destination path within the archive.
-   * @param  {(EntryData|Function)} data See also [ZipEntryData]{@link ZipEntryData} and
-   * [TarEntryData]{@link TarEntryData}.
-   * @return {this}
-   */
-  directory(dirpath, destpath, data) {
-    if (this._state.finalize || this._state.aborted) {
-      this.emit("error", new ArchiverError("QUEUECLOSED"));
-      return this;
-    }
-    if (typeof dirpath !== "string" || dirpath.length === 0) {
-      this.emit("error", new ArchiverError("DIRECTORYDIRPATHREQUIRED"));
-      return this;
-    }
-    this._pending++;
-    if (destpath === false) {
-      destpath = "";
-    } else if (typeof destpath !== "string") {
-      destpath = dirpath;
-    }
-    var dataFunction = false;
-    if (typeof data === "function") {
-      dataFunction = data;
-      data = {};
-    } else if (typeof data !== "object") {
-      data = {};
-    }
-    var globOptions = {
-      stat: true,
-      dot: true
-    };
-    function onGlobEnd() {
-      this._pending--;
-      this._maybeFinalize();
-    }
-    function onGlobError(err) {
-      this.emit("error", err);
-    }
-    function onGlobMatch(match2) {
-      globber.pause();
-      let ignoreMatch = false;
-      let entryData = Object.assign({}, data);
-      entryData.name = match2.relative;
-      entryData.prefix = destpath;
-      entryData.stats = match2.stat;
-      entryData.callback = globber.resume.bind(globber);
-      try {
-        if (dataFunction) {
-          entryData = dataFunction(entryData);
-          if (entryData === false) {
-            ignoreMatch = true;
-          } else if (typeof entryData !== "object") {
-            throw new ArchiverError("DIRECTORYFUNCTIONINVALIDDATA", {
-              dirpath
-            });
-          }
-        }
-      } catch (e) {
-        this.emit("error", e);
-        return;
-      }
-      if (ignoreMatch) {
-        globber.resume();
-        return;
-      }
-      this._append(match2.absolute, entryData);
-    }
-    const globber = src_default(dirpath, globOptions);
-    globber.on("error", onGlobError.bind(this));
-    globber.on("match", onGlobMatch.bind(this));
-    globber.on("end", onGlobEnd.bind(this));
-    return this;
-  }
-  /**
-   * Appends a file given its filepath using a
-   * [lazystream]{@link https://github.com/jpommerening/node-lazystream} wrapper to
-   * prevent issues with open file limits.
-   *
-   * When the instance has received, processed, and emitted the file, the `entry`
-   * event is fired.
-   *
-   * @param  {String} filepath The source filepath.
-   * @param  {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and
-   * [TarEntryData]{@link TarEntryData}.
-   * @return {this}
-   */
-  file(filepath, data) {
-    if (this._state.finalize || this._state.aborted) {
-      this.emit("error", new ArchiverError("QUEUECLOSED"));
-      return this;
-    }
-    if (typeof filepath !== "string" || filepath.length === 0) {
-      this.emit("error", new ArchiverError("FILEFILEPATHREQUIRED"));
-      return this;
-    }
-    this._append(filepath, data);
-    return this;
-  }
-  /**
-   * Appends multiple files that match a glob pattern.
-   *
-   * @param  {String} pattern The [glob pattern]{@link https://github.com/isaacs/minimatch} to match.
-   * @param  {Object} options See [node-readdir-glob]{@link https://github.com/yqnn/node-readdir-glob#options}.
-   * @param  {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and
-   * [TarEntryData]{@link TarEntryData}.
-   * @return {this}
-   */
-  glob(pattern, options, data) {
-    this._pending++;
-    options = {
-      stat: true,
-      pattern,
-      ...options
-    };
-    function onGlobEnd() {
-      this._pending--;
-      this._maybeFinalize();
-    }
-    function onGlobError(err) {
-      this.emit("error", err);
-    }
-    function onGlobMatch(match2) {
-      globber.pause();
-      const entryData = Object.assign({}, data);
-      entryData.callback = globber.resume.bind(globber);
-      entryData.stats = match2.stat;
-      entryData.name = match2.relative;
-      this._append(match2.absolute, entryData);
-    }
-    const globber = new ReaddirGlob2(options.cwd || ".", options);
-    globber.on("error", onGlobError.bind(this));
-    globber.on("match", onGlobMatch.bind(this));
-    globber.on("end", onGlobEnd.bind(this));
-    return this;
-  }
-  /**
-   * Finalizes the instance and prevents further appending to the archive
-   * structure (queue will continue til drained).
-   *
-   * The `end`, `close` or `finish` events on the destination stream may fire
-   * right after calling this method so you should set listeners beforehand to
-   * properly detect stream completion.
-   *
-   * @return {Promise}
-   */
-  finalize() {
-    if (this._state.aborted) {
-      var abortedError = new ArchiverError("ABORTED");
-      this.emit("error", abortedError);
-      return Promise.reject(abortedError);
-    }
-    if (this._state.finalize) {
-      var finalizingError = new ArchiverError("FINALIZING");
-      this.emit("error", finalizingError);
-      return Promise.reject(finalizingError);
-    }
-    this._state.finalize = true;
-    if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
-      this._finalize();
-    }
-    var self2 = this;
-    return new Promise(function(resolve14, reject) {
-      var errored;
-      self2._module.on("end", function() {
-        if (!errored) {
-          resolve14();
-        }
-      });
-      self2._module.on("error", function(err) {
-        errored = true;
-        reject(err);
-      });
-    });
-  }
-  /**
-   * Appends a symlink to the instance.
-   *
-   * This does NOT interact with filesystem and is used for programmatically creating symlinks.
-   *
-   * @param  {String} filepath The symlink path (within archive).
-   * @param  {String} target The target path (within archive).
-   * @param  {Number} mode Sets the entry permissions.
-   * @return {this}
-   */
-  symlink(filepath, target, mode) {
-    if (this._state.finalize || this._state.aborted) {
-      this.emit("error", new ArchiverError("QUEUECLOSED"));
-      return this;
-    }
-    if (typeof filepath !== "string" || filepath.length === 0) {
-      this.emit("error", new ArchiverError("SYMLINKFILEPATHREQUIRED"));
-      return this;
-    }
-    if (typeof target !== "string" || target.length === 0) {
-      this.emit(
-        "error",
-        new ArchiverError("SYMLINKTARGETREQUIRED", { filepath })
-      );
-      return this;
-    }
-    if (!this._supportsSymlink) {
-      this.emit(
-        "error",
-        new ArchiverError("SYMLINKNOTSUPPORTED", { filepath })
-      );
-      return this;
-    }
-    var data = {};
-    data.type = "symlink";
-    data.name = filepath.replace(/\\/g, "/");
-    data.linkname = target.replace(/\\/g, "/");
-    data.sourceType = "buffer";
-    if (typeof mode === "number") {
-      data.mode = mode;
-    }
-    this._entriesCount++;
-    this._queue.push({
-      data,
-      source: Buffer.concat([])
-    });
-    return this;
-  }
-  /**
-   * Returns the current length (in bytes) that has been emitted.
-   *
-   * @return {Number}
-   */
-  pointer() {
-    return this._pointer;
-  }
-};
-
-// node_modules/compress-commons/lib/archivers/archive-entry.js
-var ArchiveEntry = class {
-  getName() {
-  }
-  getSize() {
-  }
-  getLastModifiedDate() {
-  }
-  isDirectory() {
-  }
-};
-
-// node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js
-var import_normalize_path2 = __toESM(require_normalize_path(), 1);
-
-// node_modules/compress-commons/lib/archivers/zip/util.js
-function dateToDos(d, forceLocalTime) {
-  forceLocalTime = forceLocalTime || false;
-  var year = forceLocalTime ? d.getFullYear() : d.getUTCFullYear();
-  if (year < 1980) {
-    return 2162688;
-  } else if (year >= 2044) {
-    return 2141175677;
-  }
-  var val = {
-    year,
-    month: forceLocalTime ? d.getMonth() : d.getUTCMonth(),
-    date: forceLocalTime ? d.getDate() : d.getUTCDate(),
-    hours: forceLocalTime ? d.getHours() : d.getUTCHours(),
-    minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(),
-    seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds()
-  };
-  return val.year - 1980 << 25 | val.month + 1 << 21 | val.date << 16 | val.hours << 11 | val.minutes << 5 | val.seconds / 2;
-}
-function dosToDate(dos) {
-  return new Date(
-    (dos >> 25 & 127) + 1980,
-    (dos >> 21 & 15) - 1,
-    dos >> 16 & 31,
-    dos >> 11 & 31,
-    dos >> 5 & 63,
-    (dos & 31) << 1
-  );
-}
-function getEightBytes(v) {
-  var buf = Buffer.alloc(8);
-  buf.writeUInt32LE(v % 4294967296, 0);
-  buf.writeUInt32LE(v / 4294967296 | 0, 4);
-  return buf;
-}
-function getShortBytes(v) {
-  var buf = Buffer.alloc(2);
-  buf.writeUInt16LE((v & 65535) >>> 0, 0);
-  return buf;
-}
-function getShortBytesValue(buf, offset) {
-  return buf.readUInt16LE(offset);
-}
-function getLongBytes(v) {
-  var buf = Buffer.alloc(4);
-  buf.writeUInt32LE((v & 4294967295) >>> 0, 0);
-  return buf;
-}
-
-// node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js
-var DATA_DESCRIPTOR_FLAG = 1 << 3;
-var ENCRYPTION_FLAG = 1 << 0;
-var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2;
-var SLIDING_DICTIONARY_SIZE_FLAG = 1 << 1;
-var STRONG_ENCRYPTION_FLAG = 1 << 6;
-var UFT8_NAMES_FLAG = 1 << 11;
-var GeneralPurposeBit = class _GeneralPurposeBit {
-  constructor() {
-    this.descriptor = false;
-    this.encryption = false;
-    this.utf8 = false;
-    this.numberOfShannonFanoTrees = 0;
-    this.strongEncryption = false;
-    this.slidingDictionarySize = 0;
-    return this;
-  }
-  encode() {
-    return getShortBytes(
-      (this.descriptor ? DATA_DESCRIPTOR_FLAG : 0) | (this.utf8 ? UFT8_NAMES_FLAG : 0) | (this.encryption ? ENCRYPTION_FLAG : 0) | (this.strongEncryption ? STRONG_ENCRYPTION_FLAG : 0)
-    );
-  }
-  static parse(buf, offset) {
-    var flag = getShortBytesValue(buf, offset);
-    var gbp = new _GeneralPurposeBit();
-    gbp.useDataDescriptor((flag & DATA_DESCRIPTOR_FLAG) !== 0);
-    gbp.useUTF8ForNames((flag & UFT8_NAMES_FLAG) !== 0);
-    gbp.useStrongEncryption((flag & STRONG_ENCRYPTION_FLAG) !== 0);
-    gbp.useEncryption((flag & ENCRYPTION_FLAG) !== 0);
-    gbp.setSlidingDictionarySize(
-      (flag & SLIDING_DICTIONARY_SIZE_FLAG) !== 0 ? 8192 : 4096
-    );
-    gbp.setNumberOfShannonFanoTrees(
-      (flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG) !== 0 ? 3 : 2
-    );
-    return gbp;
-  }
-  setNumberOfShannonFanoTrees(n) {
-    this.numberOfShannonFanoTrees = n;
-  }
-  getNumberOfShannonFanoTrees() {
-    return this.numberOfShannonFanoTrees;
-  }
-  setSlidingDictionarySize(n) {
-    this.slidingDictionarySize = n;
-  }
-  getSlidingDictionarySize() {
-    return this.slidingDictionarySize;
-  }
-  useDataDescriptor(b) {
-    this.descriptor = b;
-  }
-  usesDataDescriptor() {
-    return this.descriptor;
-  }
-  useEncryption(b) {
-    this.encryption = b;
-  }
-  usesEncryption() {
-    return this.encryption;
-  }
-  useStrongEncryption(b) {
-    this.strongEncryption = b;
-  }
-  usesStrongEncryption() {
-    return this.strongEncryption;
-  }
-  useUTF8ForNames(b) {
-    this.utf8 = b;
-  }
-  usesUTF8ForNames() {
-    return this.utf8;
-  }
-};
-
-// node_modules/compress-commons/lib/archivers/zip/unix-stat.js
-var PERM_MASK = 4095;
-var FILE_TYPE_FLAG = 61440;
-var LINK_FLAG = 40960;
-var FILE_FLAG = 32768;
-var DIR_FLAG = 16384;
-var DEFAULT_LINK_PERM = 511;
-var DEFAULT_DIR_PERM = 493;
-var DEFAULT_FILE_PERM = 420;
-var unix_stat_default = {
-  PERM_MASK,
-  FILE_TYPE_FLAG,
-  LINK_FLAG,
-  FILE_FLAG,
-  DIR_FLAG,
-  DEFAULT_LINK_PERM,
-  DEFAULT_DIR_PERM,
-  DEFAULT_FILE_PERM
-};
-
-// node_modules/compress-commons/lib/archivers/zip/constants.js
-var EMPTY = Buffer.alloc(0);
-var SHORT_MASK = 65535;
-var SHORT_SHIFT = 16;
-var SHORT_ZERO = Buffer.from(Array(2));
-var LONG_ZERO = Buffer.from(Array(4));
-var MIN_VERSION_INITIAL = 10;
-var MIN_VERSION_DATA_DESCRIPTOR = 20;
-var MIN_VERSION_ZIP64 = 45;
-var VERSION_MADEBY = 45;
-var METHOD_STORED = 0;
-var METHOD_DEFLATED = 8;
-var PLATFORM_UNIX = 3;
-var PLATFORM_FAT = 0;
-var SIG_LFH = 67324752;
-var SIG_DD = 134695760;
-var SIG_CFH = 33639248;
-var SIG_EOCD = 101010256;
-var SIG_ZIP64_EOCD = 101075792;
-var SIG_ZIP64_EOCD_LOC = 117853008;
-var ZIP64_MAGIC_SHORT = 65535;
-var ZIP64_MAGIC = 4294967295;
-var ZIP64_EXTRA_ID = 1;
-var ZLIB_BEST_SPEED = 1;
-var MODE_MASK = 4095;
-var S_IFDIR = 16384;
-var S_IFREG = 32768;
-var S_DOS_A = 32;
-var S_DOS_D = 16;
-
-// node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js
-var ZipArchiveEntry = class extends ArchiveEntry {
-  constructor(name) {
-    super();
-    this.platform = PLATFORM_FAT;
-    this.method = -1;
-    this.name = null;
-    this.size = 0;
-    this.csize = 0;
-    this.gpb = new GeneralPurposeBit();
-    this.crc = 0;
-    this.time = -1;
-    this.minver = MIN_VERSION_INITIAL;
-    this.mode = -1;
-    this.extra = null;
-    this.exattr = 0;
-    this.inattr = 0;
-    this.comment = null;
-    if (name) {
-      this.setName(name);
-    }
-  }
-  /**
-   * Returns the extra fields related to the entry.
-   *
-   * @returns {Buffer}
-   */
-  getCentralDirectoryExtra() {
-    return this.getExtra();
-  }
-  /**
-   * Returns the comment set for the entry.
-   *
-   * @returns {string}
-   */
-  getComment() {
-    return this.comment !== null ? this.comment : "";
-  }
-  /**
-   * Returns the compressed size of the entry.
-   *
-   * @returns {number}
-   */
-  getCompressedSize() {
-    return this.csize;
-  }
-  /**
-   * Returns the CRC32 digest for the entry.
-   *
-   * @returns {number}
-   */
-  getCrc() {
-    return this.crc;
-  }
-  /**
-   * Returns the external file attributes for the entry.
-   *
-   * @returns {number}
-   */
-  getExternalAttributes = function() {
-    return this.exattr;
-  };
-  /**
-   * Returns the extra fields related to the entry.
-   *
-   * @returns {Buffer}
-   */
-  getExtra() {
-    return this.extra !== null ? this.extra : EMPTY;
-  }
-  /**
-   * Returns the general purpose bits related to the entry.
-   *
-   * @returns {GeneralPurposeBit}
-   */
-  getGeneralPurposeBit() {
-    return this.gpb;
-  }
-  /**
-   * Returns the internal file attributes for the entry.
-   *
-   * @returns {number}
-   */
-  getInternalAttributes() {
-    return this.inattr;
-  }
-  /**
-   * Returns the last modified date of the entry.
-   *
-   * @returns {number}
-   */
-  getLastModifiedDate() {
-    return this.getTime();
-  }
-  /**
-   * Returns the extra fields related to the entry.
-   *
-   * @returns {Buffer}
-   */
-  getLocalFileDataExtra() {
-    return this.getExtra();
-  }
-  /**
-   * Returns the compression method used on the entry.
-   *
-   * @returns {number}
-   */
-  getMethod() {
-    return this.method;
-  }
-  /**
-   * Returns the filename of the entry.
-   *
-   * @returns {string}
-   */
-  getName() {
-    return this.name;
-  }
-  /**
-   * Returns the platform on which the entry was made.
-   *
-   * @returns {number}
-   */
-  getPlatform() {
-    return this.platform;
-  }
-  /**
-   * Returns the size of the entry.
-   *
-   * @returns {number}
-   */
-  getSize() {
-    return this.size;
-  }
-  /**
-   * Returns a date object representing the last modified date of the entry.
-   *
-   * @returns {number|Date}
-   */
-  getTime() {
-    return this.time !== -1 ? dosToDate(this.time) : -1;
-  }
-  /**
-   * Returns the DOS timestamp for the entry.
-   *
-   * @returns {number}
-   */
-  getTimeDos() {
-    return this.time !== -1 ? this.time : 0;
-  }
-  /**
-   * Returns the UNIX file permissions for the entry.
-   *
-   * @returns {number}
-   */
-  getUnixMode() {
-    return this.platform !== PLATFORM_UNIX ? 0 : this.getExternalAttributes() >> SHORT_SHIFT & SHORT_MASK;
-  }
-  /**
-   * Returns the version of ZIP needed to extract the entry.
-   *
-   * @returns {number}
-   */
-  getVersionNeededToExtract() {
-    return this.minver;
-  }
-  /**
-   * Sets the comment of the entry.
-   *
-   * @param comment
-   */
-  setComment(comment) {
-    if (Buffer.byteLength(comment) !== comment.length) {
-      this.getGeneralPurposeBit().useUTF8ForNames(true);
-    }
-    this.comment = comment;
-  }
-  /**
-   * Sets the compressed size of the entry.
-   *
-   * @param size
-   */
-  setCompressedSize(size) {
-    if (size < 0) {
-      throw new Error("invalid entry compressed size");
-    }
-    this.csize = size;
-  }
-  /**
-   * Sets the checksum of the entry.
-   *
-   * @param crc
-   */
-  setCrc(crc) {
-    if (crc < 0) {
-      throw new Error("invalid entry crc32");
-    }
-    this.crc = crc;
-  }
-  /**
-   * Sets the external file attributes of the entry.
-   *
-   * @param attr
-   */
-  setExternalAttributes(attr) {
-    this.exattr = attr >>> 0;
-  }
-  /**
-   * Sets the extra fields related to the entry.
-   *
-   * @param extra
-   */
-  setExtra(extra) {
-    this.extra = extra;
-  }
-  /**
-   * Sets the general purpose bits related to the entry.
-   *
-   * @param gpb
-   */
-  setGeneralPurposeBit(gpb) {
-    if (!(gpb instanceof GeneralPurposeBit)) {
-      throw new Error("invalid entry GeneralPurposeBit");
-    }
-    this.gpb = gpb;
-  }
-  /**
-   * Sets the internal file attributes of the entry.
-   *
-   * @param attr
-   */
-  setInternalAttributes(attr) {
-    this.inattr = attr;
-  }
-  /**
-   * Sets the compression method of the entry.
-   *
-   * @param method
-   */
-  setMethod(method) {
-    if (method < 0) {
-      throw new Error("invalid entry compression method");
-    }
-    this.method = method;
-  }
-  /**
-   * Sets the name of the entry.
-   *
-   * @param name
-   * @param prependSlash
-   */
-  setName(name, prependSlash = false) {
-    name = (0, import_normalize_path2.default)(name, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
-    if (prependSlash) {
-      name = `/${name}`;
-    }
-    if (Buffer.byteLength(name) !== name.length) {
-      this.getGeneralPurposeBit().useUTF8ForNames(true);
-    }
-    this.name = name;
-  }
-  /**
-   * Sets the platform on which the entry was made.
-   *
-   * @param platform
-   */
-  setPlatform(platform2) {
-    this.platform = platform2;
-  }
-  /**
-   * Sets the size of the entry.
-   *
-   * @param size
-   */
-  setSize(size) {
-    if (size < 0) {
-      throw new Error("invalid entry size");
-    }
-    this.size = size;
-  }
-  /**
-   * Sets the time of the entry.
-   *
-   * @param time
-   * @param forceLocalTime
-   */
-  setTime(time, forceLocalTime) {
-    if (!(time instanceof Date)) {
-      throw new Error("invalid entry time");
-    }
-    this.time = dateToDos(time, forceLocalTime);
-  }
-  /**
-   * Sets the UNIX file permissions for the entry.
-   *
-   * @param mode
-   */
-  setUnixMode(mode) {
-    mode |= this.isDirectory() ? S_IFDIR : S_IFREG;
-    var extattr = 0;
-    extattr |= mode << SHORT_SHIFT | (this.isDirectory() ? S_DOS_D : S_DOS_A);
-    this.setExternalAttributes(extattr);
-    this.mode = mode & MODE_MASK;
-    this.platform = PLATFORM_UNIX;
-  }
-  /**
-   * Sets the version of ZIP needed to extract this entry.
-   *
-   * @param minver
-   */
-  setVersionNeededToExtract(minver) {
-    this.minver = minver;
-  }
-  /**
-   * Returns true if this entry represents a directory.
-   *
-   * @returns {boolean}
-   */
-  isDirectory() {
-    return this.getName().slice(-1) === "/";
-  }
-  /**
-   * Returns true if this entry represents a unix symlink,
-   * in which case the entry's content contains the target path
-   * for the symlink.
-   *
-   * @returns {boolean}
-   */
-  isUnixSymlink() {
-    return (this.getUnixMode() & unix_stat_default.FILE_TYPE_FLAG) === unix_stat_default.LINK_FLAG;
-  }
-  /**
-   * Returns true if this entry is using the ZIP64 extension of ZIP.
-   *
-   * @returns {boolean}
-   */
-  isZip64() {
-    return this.csize > ZIP64_MAGIC || this.size > ZIP64_MAGIC;
-  }
-};
-
-// node_modules/compress-commons/lib/archivers/archive-output-stream.js
-var import_readable_stream4 = __toESM(require_ours(), 1);
-
-// node_modules/compress-commons/lib/util/index.js
-var import_readable_stream3 = __toESM(require_ours(), 1);
-function normalizeInputSource2(source) {
-  if (source === null) {
-    return Buffer.alloc(0);
-  } else if (typeof source === "string") {
-    return Buffer.from(source);
-  } else if (isStream(source) && !source._readableState) {
-    var normalized = new import_readable_stream3.PassThrough();
-    source.pipe(normalized);
-    return normalized;
-  }
-  return source;
-}
-
-// node_modules/compress-commons/lib/archivers/archive-output-stream.js
-var ArchiveOutputStream = class extends import_readable_stream4.Transform {
-  constructor(options) {
-    super(options);
-    this.offset = 0;
-    this._archive = {
-      finish: false,
-      finished: false,
-      processing: false
-    };
-  }
-  _appendBuffer(zae, source, callback) {
-  }
-  _appendStream(zae, source, callback) {
-  }
-  _emitErrorCallback = function(err) {
-    if (err) {
-      this.emit("error", err);
-    }
-  };
-  _finish(ae) {
-  }
-  _normalizeEntry(ae) {
-  }
-  _transform(chunk, encoding, callback) {
-    callback(null, chunk);
-  }
-  entry(ae, source, callback) {
-    source = source || null;
-    if (typeof callback !== "function") {
-      callback = this._emitErrorCallback.bind(this);
-    }
-    if (!(ae instanceof ArchiveEntry)) {
-      callback(new Error("not a valid instance of ArchiveEntry"));
-      return;
-    }
-    if (this._archive.finish || this._archive.finished) {
-      callback(new Error("unacceptable entry after finish"));
-      return;
-    }
-    if (this._archive.processing) {
-      callback(new Error("already processing an entry"));
-      return;
-    }
-    this._archive.processing = true;
-    this._normalizeEntry(ae);
-    this._entry = ae;
-    source = normalizeInputSource2(source);
-    if (Buffer.isBuffer(source)) {
-      this._appendBuffer(ae, source, callback);
-    } else if (isStream(source)) {
-      this._appendStream(ae, source, callback);
-    } else {
-      this._archive.processing = false;
-      callback(
-        new Error("input source must be valid Stream or Buffer instance")
-      );
-      return;
-    }
-    return this;
-  }
-  finish() {
-    if (this._archive.processing) {
-      this._archive.finish = true;
-      return;
-    }
-    this._finish();
-  }
-  getBytesWritten() {
-    return this.offset;
-  }
-  write(chunk, cb) {
-    if (chunk) {
-      this.offset += chunk.length;
-    }
-    return super.write(chunk, cb);
-  }
-};
-
-// node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js
-var import_crc_323 = __toESM(require_crc32(), 1);
-
-// node_modules/crc32-stream/lib/crc32-stream.js
-var import_readable_stream5 = __toESM(require_ours(), 1);
-var import_crc_32 = __toESM(require_crc32(), 1);
-var CRC32Stream = class extends import_readable_stream5.Transform {
-  constructor(options) {
-    super(options);
-    this.checksum = Buffer.allocUnsafe(4);
-    this.checksum.writeInt32BE(0, 0);
-    this.rawSize = 0;
-  }
-  _transform(chunk, encoding, callback) {
-    if (chunk) {
-      this.checksum = import_crc_32.default.buf(chunk, this.checksum) >>> 0;
-      this.rawSize += chunk.length;
-    }
-    callback(null, chunk);
-  }
-  digest(encoding) {
-    const checksum = Buffer.allocUnsafe(4);
-    checksum.writeUInt32BE(this.checksum >>> 0, 0);
-    return encoding ? checksum.toString(encoding) : checksum;
-  }
-  hex() {
-    return this.digest("hex").toUpperCase();
-  }
-  size() {
-    return this.rawSize;
-  }
-};
-
-// node_modules/crc32-stream/lib/deflate-crc32-stream.js
-var import_zlib2 = require("zlib");
-var import_crc_322 = __toESM(require_crc32(), 1);
-var DeflateCRC32Stream = class extends import_zlib2.DeflateRaw {
-  constructor(options) {
-    super(options);
-    this.checksum = Buffer.allocUnsafe(4);
-    this.checksum.writeInt32BE(0, 0);
-    this.rawSize = 0;
-    this.compressedSize = 0;
-  }
-  push(chunk, encoding) {
-    if (chunk) {
-      this.compressedSize += chunk.length;
-    }
-    return super.push(chunk, encoding);
-  }
-  _transform(chunk, encoding, callback) {
-    if (chunk) {
-      this.checksum = import_crc_322.default.buf(chunk, this.checksum) >>> 0;
-      this.rawSize += chunk.length;
-    }
-    super._transform(chunk, encoding, callback);
-  }
-  digest(encoding) {
-    const checksum = Buffer.allocUnsafe(4);
-    checksum.writeUInt32BE(this.checksum >>> 0, 0);
-    return encoding ? checksum.toString(encoding) : checksum;
-  }
-  hex() {
-    return this.digest("hex").toUpperCase();
-  }
-  size(compressed = false) {
-    if (compressed) {
-      return this.compressedSize;
-    } else {
-      return this.rawSize;
-    }
-  }
-};
-
-// node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js
-function _defaults(o) {
-  if (typeof o !== "object") {
-    o = {};
-  }
-  if (typeof o.zlib !== "object") {
-    o.zlib = {};
-  }
-  if (typeof o.zlib.level !== "number") {
-    o.zlib.level = ZLIB_BEST_SPEED;
-  }
-  o.forceZip64 = !!o.forceZip64;
-  o.forceLocalTime = !!o.forceLocalTime;
-  return o;
-}
-var ZipArchiveOutputStream = class extends ArchiveOutputStream {
-  constructor(options) {
-    const _options = _defaults(options);
-    super(_options);
-    this.options = _options;
-    this._entry = null;
-    this._entries = [];
-    this._archive = {
-      centralLength: 0,
-      centralOffset: 0,
-      comment: "",
-      finish: false,
-      finished: false,
-      processing: false,
-      forceZip64: _options.forceZip64,
-      forceLocalTime: _options.forceLocalTime
-    };
-  }
-  _afterAppend(ae) {
-    this._entries.push(ae);
-    if (ae.getGeneralPurposeBit().usesDataDescriptor()) {
-      this._writeDataDescriptor(ae);
-    }
-    this._archive.processing = false;
-    this._entry = null;
-    if (this._archive.finish && !this._archive.finished) {
-      this._finish();
-    }
-  }
-  _appendBuffer(ae, source, callback) {
-    if (source.length === 0) {
-      ae.setMethod(METHOD_STORED);
-    }
-    var method = ae.getMethod();
-    if (method === METHOD_STORED) {
-      ae.setSize(source.length);
-      ae.setCompressedSize(source.length);
-      ae.setCrc(import_crc_323.default.buf(source) >>> 0);
-    }
-    this._writeLocalFileHeader(ae);
-    if (method === METHOD_STORED) {
-      this.write(source);
-      this._afterAppend(ae);
-      callback(null, ae);
-      return;
-    } else if (method === METHOD_DEFLATED) {
-      this._smartStream(ae, callback).end(source);
-      return;
-    } else {
-      callback(new Error("compression method " + method + " not implemented"));
-      return;
-    }
-  }
-  _appendStream(ae, source, callback) {
-    ae.getGeneralPurposeBit().useDataDescriptor(true);
-    ae.setVersionNeededToExtract(MIN_VERSION_DATA_DESCRIPTOR);
-    this._writeLocalFileHeader(ae);
-    var smart = this._smartStream(ae, callback);
-    source.once("error", function(err) {
-      smart.emit("error", err);
-      smart.end();
-    });
-    source.pipe(smart);
-  }
-  _finish() {
-    this._archive.centralOffset = this.offset;
-    this._entries.forEach(
-      function(ae) {
-        this._writeCentralFileHeader(ae);
-      }.bind(this)
-    );
-    this._archive.centralLength = this.offset - this._archive.centralOffset;
-    if (this.isZip64()) {
-      this._writeCentralDirectoryZip64();
-    }
-    this._writeCentralDirectoryEnd();
-    this._archive.processing = false;
-    this._archive.finish = true;
-    this._archive.finished = true;
-    this.end();
-  }
-  _normalizeEntry(ae) {
-    if (ae.getMethod() === -1) {
-      ae.setMethod(METHOD_DEFLATED);
-    }
-    if (ae.getMethod() === METHOD_DEFLATED) {
-      ae.getGeneralPurposeBit().useDataDescriptor(true);
-      ae.setVersionNeededToExtract(MIN_VERSION_DATA_DESCRIPTOR);
-    }
-    if (ae.getTime() === -1) {
-      ae.setTime(/* @__PURE__ */ new Date(), this._archive.forceLocalTime);
-    }
-    ae._offsets = {
-      file: 0,
-      data: 0,
-      contents: 0
-    };
-  }
-  _smartStream(ae, callback) {
-    var deflate = ae.getMethod() === METHOD_DEFLATED;
-    var process2 = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream();
-    var error3 = null;
-    function handleStuff() {
-      var digest = process2.digest().readUInt32BE(0);
-      ae.setCrc(digest);
-      ae.setSize(process2.size());
-      ae.setCompressedSize(process2.size(true));
-      this._afterAppend(ae);
-      callback(error3, ae);
-    }
-    process2.once("end", handleStuff.bind(this));
-    process2.once("error", function(err) {
-      error3 = err;
-    });
-    process2.pipe(this, { end: false });
-    return process2;
-  }
-  _writeCentralDirectoryEnd() {
-    var records = this._entries.length;
-    var size = this._archive.centralLength;
-    var offset = this._archive.centralOffset;
-    if (this.isZip64()) {
-      records = ZIP64_MAGIC_SHORT;
-      size = ZIP64_MAGIC;
-      offset = ZIP64_MAGIC;
-    }
-    this.write(getLongBytes(SIG_EOCD));
-    this.write(SHORT_ZERO);
-    this.write(SHORT_ZERO);
-    this.write(getShortBytes(records));
-    this.write(getShortBytes(records));
-    this.write(getLongBytes(size));
-    this.write(getLongBytes(offset));
-    var comment = this.getComment();
-    var commentLength = Buffer.byteLength(comment);
-    this.write(getShortBytes(commentLength));
-    this.write(comment);
-  }
-  _writeCentralDirectoryZip64() {
-    this.write(getLongBytes(SIG_ZIP64_EOCD));
-    this.write(getEightBytes(44));
-    this.write(getShortBytes(MIN_VERSION_ZIP64));
-    this.write(getShortBytes(MIN_VERSION_ZIP64));
-    this.write(LONG_ZERO);
-    this.write(LONG_ZERO);
-    this.write(getEightBytes(this._entries.length));
-    this.write(getEightBytes(this._entries.length));
-    this.write(getEightBytes(this._archive.centralLength));
-    this.write(getEightBytes(this._archive.centralOffset));
-    this.write(getLongBytes(SIG_ZIP64_EOCD_LOC));
-    this.write(LONG_ZERO);
-    this.write(
-      getEightBytes(this._archive.centralOffset + this._archive.centralLength)
-    );
-    this.write(getLongBytes(1));
-  }
-  _writeCentralFileHeader(ae) {
-    var gpb = ae.getGeneralPurposeBit();
-    var method = ae.getMethod();
-    var fileOffset = ae._offsets.file;
-    var size = ae.getSize();
-    var compressedSize = ae.getCompressedSize();
-    if (ae.isZip64() || fileOffset > ZIP64_MAGIC) {
-      size = ZIP64_MAGIC;
-      compressedSize = ZIP64_MAGIC;
-      fileOffset = ZIP64_MAGIC;
-      ae.setVersionNeededToExtract(MIN_VERSION_ZIP64);
-      var extraBuf = Buffer.concat(
-        [
-          getShortBytes(ZIP64_EXTRA_ID),
-          getShortBytes(24),
-          getEightBytes(ae.getSize()),
-          getEightBytes(ae.getCompressedSize()),
-          getEightBytes(ae._offsets.file)
-        ],
-        28
-      );
-      ae.setExtra(extraBuf);
-    }
-    this.write(getLongBytes(SIG_CFH));
-    this.write(getShortBytes(ae.getPlatform() << 8 | VERSION_MADEBY));
-    this.write(getShortBytes(ae.getVersionNeededToExtract()));
-    this.write(gpb.encode());
-    this.write(getShortBytes(method));
-    this.write(getLongBytes(ae.getTimeDos()));
-    this.write(getLongBytes(ae.getCrc()));
-    this.write(getLongBytes(compressedSize));
-    this.write(getLongBytes(size));
-    var name = ae.getName();
-    var comment = ae.getComment();
-    var extra = ae.getCentralDirectoryExtra();
-    if (gpb.usesUTF8ForNames()) {
-      name = Buffer.from(name);
-      comment = Buffer.from(comment);
-    }
-    this.write(getShortBytes(name.length));
-    this.write(getShortBytes(extra.length));
-    this.write(getShortBytes(comment.length));
-    this.write(SHORT_ZERO);
-    this.write(getShortBytes(ae.getInternalAttributes()));
-    this.write(getLongBytes(ae.getExternalAttributes()));
-    this.write(getLongBytes(fileOffset));
-    this.write(name);
-    this.write(extra);
-    this.write(comment);
-  }
-  _writeDataDescriptor(ae) {
-    this.write(getLongBytes(SIG_DD));
-    this.write(getLongBytes(ae.getCrc()));
-    if (ae.isZip64()) {
-      this.write(getEightBytes(ae.getCompressedSize()));
-      this.write(getEightBytes(ae.getSize()));
-    } else {
-      this.write(getLongBytes(ae.getCompressedSize()));
-      this.write(getLongBytes(ae.getSize()));
-    }
-  }
-  _writeLocalFileHeader(ae) {
-    var gpb = ae.getGeneralPurposeBit();
-    var method = ae.getMethod();
-    var name = ae.getName();
-    var extra = ae.getLocalFileDataExtra();
-    if (ae.isZip64()) {
-      gpb.useDataDescriptor(true);
-      ae.setVersionNeededToExtract(MIN_VERSION_ZIP64);
-    }
-    if (gpb.usesUTF8ForNames()) {
-      name = Buffer.from(name);
-    }
-    ae._offsets.file = this.offset;
-    this.write(getLongBytes(SIG_LFH));
-    this.write(getShortBytes(ae.getVersionNeededToExtract()));
-    this.write(gpb.encode());
-    this.write(getShortBytes(method));
-    this.write(getLongBytes(ae.getTimeDos()));
-    ae._offsets.data = this.offset;
-    if (gpb.usesDataDescriptor()) {
-      this.write(LONG_ZERO);
-      this.write(LONG_ZERO);
-      this.write(LONG_ZERO);
-    } else {
-      this.write(getLongBytes(ae.getCrc()));
-      this.write(getLongBytes(ae.getCompressedSize()));
-      this.write(getLongBytes(ae.getSize()));
-    }
-    this.write(getShortBytes(name.length));
-    this.write(getShortBytes(extra.length));
-    this.write(name);
-    this.write(extra);
-    ae._offsets.contents = this.offset;
-  }
-  getComment(comment) {
-    return this._archive.comment !== null ? this._archive.comment : "";
-  }
-  isZip64() {
-    return this._archive.forceZip64 || this._entries.length > ZIP64_MAGIC_SHORT || this._archive.centralLength > ZIP64_MAGIC || this._archive.centralOffset > ZIP64_MAGIC;
-  }
-  setComment(comment) {
-    this._archive.comment = comment;
-  }
-};
-
-// node_modules/zip-stream/utils.js
-var import_normalize_path3 = __toESM(require_normalize_path(), 1);
-function dateify2(dateish) {
-  dateish = dateish || /* @__PURE__ */ new Date();
-  if (dateish instanceof Date) {
-    dateish = dateish;
-  } else if (typeof dateish === "string") {
-    dateish = new Date(dateish);
-  } else {
-    dateish = /* @__PURE__ */ new Date();
-  }
-  return dateish;
-}
-function sanitizePath2(filepath) {
-  return (0, import_normalize_path3.default)(filepath, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
-}
-
-// node_modules/zip-stream/index.js
-var ZipStream = class extends ZipArchiveOutputStream {
-  /**
-   * @constructor
-   * @extends external:ZipArchiveOutputStream
-   * @param {Object} [options]
-   * @param {String} [options.comment] Sets the zip archive comment.
-   * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
-   * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
-   * @param {Boolean} [options.store=false] Sets the compression method to STORE.
-   * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
-   * to control compression.
-   */
-  constructor(options) {
-    options = options || {};
-    options.zlib = options.zlib || {};
-    if (typeof options.level === "number" && options.level >= 0) {
-      options.zlib.level = options.level;
-      delete options.level;
-    }
-    if (!options.forceZip64 && typeof options.zlib.level === "number" && options.zlib.level === 0) {
-      options.store = true;
-    }
-    options.namePrependSlash = options.namePrependSlash || false;
-    super(options);
-    if (options.comment && options.comment.length > 0) {
-      this.setComment(options.comment);
-    }
-  }
-  /**
-   * Normalizes entry data with fallbacks for key properties.
-   *
-   * @private
-   * @param  {Object} data
-   * @return {Object}
-   */
-  _normalizeFileData(data) {
-    data = {
-      type: "file",
-      name: null,
-      namePrependSlash: this.options.namePrependSlash,
-      linkname: null,
-      date: null,
-      mode: null,
-      store: this.options.store,
-      comment: "",
-      ...data
-    };
-    let isDir = data.type === "directory";
-    const isSymlink = data.type === "symlink";
-    if (data.name) {
-      data.name = sanitizePath2(data.name);
-      if (!isSymlink && data.name.slice(-1) === "/") {
-        isDir = true;
-        data.type = "directory";
-      } else if (isDir) {
-        data.name += "/";
-      }
-    }
-    if (isDir || isSymlink) {
-      data.store = true;
-    }
-    data.date = dateify2(data.date);
-    return data;
-  }
-  /**
-   * Appends an entry given an input source (text string, buffer, or stream).
-   *
-   * @param  {(Buffer|Stream|String)} source The input source.
-   * @param  {Object} data
-   * @param  {String} data.name Sets the entry name including internal path.
-   * @param  {String} [data.comment] Sets the entry comment.
-   * @param  {(String|Date)} [data.date=NOW()] Sets the entry date.
-   * @param  {Number} [data.mode=D:0755/F:0644] Sets the entry permissions.
-   * @param  {Boolean} [data.store=options.store] Sets the compression method to STORE.
-   * @param  {String} [data.type=file] Sets the entry type. Defaults to `directory`
-   * if name ends with trailing slash.
-   * @param  {Function} callback
-   * @return this
-   */
-  entry(source, data, callback) {
-    if (typeof callback !== "function") {
-      callback = this._emitErrorCallback.bind(this);
-    }
-    data = this._normalizeFileData(data);
-    if (data.type !== "file" && data.type !== "directory" && data.type !== "symlink") {
-      callback(new Error(data.type + " entries not currently supported"));
-      return;
-    }
-    if (typeof data.name !== "string" || data.name.length === 0) {
-      callback(new Error("entry name must be a non-empty string value"));
-      return;
-    }
-    if (data.type === "symlink" && typeof data.linkname !== "string") {
-      callback(
-        new Error(
-          "entry linkname must be a non-empty string value when type equals symlink"
-        )
-      );
-      return;
-    }
-    const entry = new ZipArchiveEntry(data.name);
-    entry.setTime(data.date, this.options.forceLocalTime);
-    if (data.namePrependSlash) {
-      entry.setName(data.name, true);
-    }
-    if (data.store) {
-      entry.setMethod(0);
-    }
-    if (data.comment.length > 0) {
-      entry.setComment(data.comment);
-    }
-    if (data.type === "symlink" && typeof data.mode !== "number") {
-      data.mode = 40960;
-    }
-    if (typeof data.mode === "number") {
-      if (data.type === "symlink") {
-        data.mode |= 40960;
-      }
-      entry.setUnixMode(data.mode);
-    }
-    if (data.type === "symlink" && typeof data.linkname === "string") {
-      source = Buffer.from(data.linkname);
-    }
-    return super.entry(entry, source, callback);
-  }
-  /**
-   * Finalizes the instance and prevents further appending to the archive
-   * structure (queue will continue til drained).
-   *
-   * @return void
-   */
-  finalize() {
-    this.finish();
-  }
-};
-
-// node_modules/archiver/lib/plugins/zip.js
-var Zip = class {
-  /**
-   * @constructor
-   * @param {ZipOptions} [options]
-   * @param {String} [options.comment] Sets the zip archive comment.
-   * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
-   * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
-   * @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths.
-   * @param {Boolean} [options.store=false] Sets the compression method to STORE.
-   * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
-   */
-  constructor(options) {
-    options = this.options = {
-      comment: "",
-      forceUTC: false,
-      namePrependSlash: false,
-      store: false,
-      ...options
-    };
-    this.engine = new ZipStream(options);
-  }
-  /**
-   * @param  {(Buffer|Stream)} source
-   * @param  {ZipEntryData} data
-   * @param  {String} data.name Sets the entry name including internal path.
-   * @param  {(String|Date)} [data.date=NOW()] Sets the entry date.
-   * @param  {Number} [data.mode=D:0755/F:0644] Sets the entry permissions.
-   * @param  {String} [data.prefix] Sets a path prefix for the entry name. Useful
-   * when working with methods like `directory` or `glob`.
-   * @param  {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing
-   * for reduction of fs stat calls when stat data is already known.
-   * @param  {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE.
-   * @param  {Function} callback
-   * @return void
-   */
-  append(source, data, callback) {
-    this.engine.entry(source, data, callback);
-  }
-  /**
-   * @return void
-   */
-  finalize() {
-    this.engine.finalize();
-  }
-  /**
-   * @return this.engine
-   */
-  on() {
-    return this.engine.on.apply(this.engine, arguments);
-  }
-  /**
-   * @return this.engine
-   */
-  pipe() {
-    return this.engine.pipe.apply(this.engine, arguments);
-  }
-  /**
-   * @return this.engine
-   */
-  unpipe() {
-    return this.engine.unpipe.apply(this.engine, arguments);
-  }
-};
-
-// node_modules/archiver/lib/plugins/tar.js
-var import_tar_stream = __toESM(require_tar_stream(), 1);
-
-// node_modules/archiver/lib/plugins/json.js
-var import_readable_stream6 = __toESM(require_ours(), 1);
-
-// node_modules/buffer-crc32/dist/index.mjs
-var CRC_TABLE = new Int32Array([
-  0,
-  1996959894,
-  3993919788,
-  2567524794,
-  124634137,
-  1886057615,
-  3915621685,
-  2657392035,
-  249268274,
-  2044508324,
-  3772115230,
-  2547177864,
-  162941995,
-  2125561021,
-  3887607047,
-  2428444049,
-  498536548,
-  1789927666,
-  4089016648,
-  2227061214,
-  450548861,
-  1843258603,
-  4107580753,
-  2211677639,
-  325883990,
-  1684777152,
-  4251122042,
-  2321926636,
-  335633487,
-  1661365465,
-  4195302755,
-  2366115317,
-  997073096,
-  1281953886,
-  3579855332,
-  2724688242,
-  1006888145,
-  1258607687,
-  3524101629,
-  2768942443,
-  901097722,
-  1119000684,
-  3686517206,
-  2898065728,
-  853044451,
-  1172266101,
-  3705015759,
-  2882616665,
-  651767980,
-  1373503546,
-  3369554304,
-  3218104598,
-  565507253,
-  1454621731,
-  3485111705,
-  3099436303,
-  671266974,
-  1594198024,
-  3322730930,
-  2970347812,
-  795835527,
-  1483230225,
-  3244367275,
-  3060149565,
-  1994146192,
-  31158534,
-  2563907772,
-  4023717930,
-  1907459465,
-  112637215,
-  2680153253,
-  3904427059,
-  2013776290,
-  251722036,
-  2517215374,
-  3775830040,
-  2137656763,
-  141376813,
-  2439277719,
-  3865271297,
-  1802195444,
-  476864866,
-  2238001368,
-  4066508878,
-  1812370925,
-  453092731,
-  2181625025,
-  4111451223,
-  1706088902,
-  314042704,
-  2344532202,
-  4240017532,
-  1658658271,
-  366619977,
-  2362670323,
-  4224994405,
-  1303535960,
-  984961486,
-  2747007092,
-  3569037538,
-  1256170817,
-  1037604311,
-  2765210733,
-  3554079995,
-  1131014506,
-  879679996,
-  2909243462,
-  3663771856,
-  1141124467,
-  855842277,
-  2852801631,
-  3708648649,
-  1342533948,
-  654459306,
-  3188396048,
-  3373015174,
-  1466479909,
-  544179635,
-  3110523913,
-  3462522015,
-  1591671054,
-  702138776,
-  2966460450,
-  3352799412,
-  1504918807,
-  783551873,
-  3082640443,
-  3233442989,
-  3988292384,
-  2596254646,
-  62317068,
-  1957810842,
-  3939845945,
-  2647816111,
-  81470997,
-  1943803523,
-  3814918930,
-  2489596804,
-  225274430,
-  2053790376,
-  3826175755,
-  2466906013,
-  167816743,
-  2097651377,
-  4027552580,
-  2265490386,
-  503444072,
-  1762050814,
-  4150417245,
-  2154129355,
-  426522225,
-  1852507879,
-  4275313526,
-  2312317920,
-  282753626,
-  1742555852,
-  4189708143,
-  2394877945,
-  397917763,
-  1622183637,
-  3604390888,
-  2714866558,
-  953729732,
-  1340076626,
-  3518719985,
-  2797360999,
-  1068828381,
-  1219638859,
-  3624741850,
-  2936675148,
-  906185462,
-  1090812512,
-  3747672003,
-  2825379669,
-  829329135,
-  1181335161,
-  3412177804,
-  3160834842,
-  628085408,
-  1382605366,
-  3423369109,
-  3138078467,
-  570562233,
-  1426400815,
-  3317316542,
-  2998733608,
-  733239954,
-  1555261956,
-  3268935591,
-  3050360625,
-  752459403,
-  1541320221,
-  2607071920,
-  3965973030,
-  1969922972,
-  40735498,
-  2617837225,
-  3943577151,
-  1913087877,
-  83908371,
-  2512341634,
-  3803740692,
-  2075208622,
-  213261112,
-  2463272603,
-  3855990285,
-  2094854071,
-  198958881,
-  2262029012,
-  4057260610,
-  1759359992,
-  534414190,
-  2176718541,
-  4139329115,
-  1873836001,
-  414664567,
-  2282248934,
-  4279200368,
-  1711684554,
-  285281116,
-  2405801727,
-  4167216745,
-  1634467795,
-  376229701,
-  2685067896,
-  3608007406,
-  1308918612,
-  956543938,
-  2808555105,
-  3495958263,
-  1231636301,
-  1047427035,
-  2932959818,
-  3654703836,
-  1088359270,
-  936918e3,
-  2847714899,
-  3736837829,
-  1202900863,
-  817233897,
-  3183342108,
-  3401237130,
-  1404277552,
-  615818150,
-  3134207493,
-  3453421203,
-  1423857449,
-  601450431,
-  3009837614,
-  3294710456,
-  1567103746,
-  711928724,
-  3020668471,
-  3272380065,
-  1510334235,
-  755167117
-]);
-function ensureBuffer(input) {
-  if (Buffer.isBuffer(input)) {
-    return input;
-  }
-  if (typeof input === "number") {
-    return Buffer.alloc(input);
-  } else if (typeof input === "string") {
-    return Buffer.from(input);
-  } else {
-    throw new Error("input must be buffer, number, or string, received " + typeof input);
-  }
-}
-function bufferizeInt(num) {
-  const tmp = ensureBuffer(4);
-  tmp.writeInt32BE(num, 0);
-  return tmp;
-}
-function _crc32(buf, previous) {
-  buf = ensureBuffer(buf);
-  if (Buffer.isBuffer(previous)) {
-    previous = previous.readUInt32BE(0);
-  }
-  let crc = ~~previous ^ -1;
-  for (var n = 0; n < buf.length; n++) {
-    crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
-  }
-  return crc ^ -1;
-}
-function crc324() {
-  return bufferizeInt(_crc32.apply(null, arguments));
-}
-crc324.signed = function() {
-  return _crc32.apply(null, arguments);
-};
-crc324.unsigned = function() {
-  return _crc32.apply(null, arguments) >>> 0;
-};
-
-// node_modules/archiver/index.js
-var ZipArchive = class extends Archiver {
-  constructor(options) {
-    super(options);
-    this._format = "zip";
-    this._module = new Zip(options);
-    this._supportsDirectory = true;
-    this._supportsSymlink = true;
-    this._modulePipe();
-  }
-};
-
-// src/artifact-scanner.ts
-var fs25 = __toESM(require("fs"));
-var os6 = __toESM(require("os"));
-var path22 = __toESM(require("path"));
-var exec = __toESM(require_exec());
-var GITHUB_PAT_CLASSIC_PATTERN = {
-  type: "Personal Access Token (Classic)" /* PersonalAccessClassic */,
-  pattern: /\bghp_[a-zA-Z0-9]{36}\b/g
-};
-var GITHUB_PAT_FINE_GRAINED_PATTERN = {
-  type: "Personal Access Token (Fine-grained)" /* PersonalAccessFineGrained */,
-  pattern: /\bgithub_pat_[a-zA-Z0-9_]+\b/g
-};
-var GITHUB_TOKEN_PATTERNS = [
-  GITHUB_PAT_CLASSIC_PATTERN,
-  GITHUB_PAT_FINE_GRAINED_PATTERN,
-  {
-    type: "OAuth Access Token" /* OAuth */,
-    pattern: /\bgho_[a-zA-Z0-9]{36}\b/g
-  },
-  {
-    type: "User-to-Server Token" /* UserToServer */,
-    pattern: /\bghu_[a-zA-Z0-9]{36}\b/g
-  },
-  {
-    type: "Server-to-Server Token" /* ServerToServer */,
-    pattern: /\bghs_[a-zA-Z0-9]{36}\b/g
-  },
-  {
-    type: "Refresh Token" /* Refresh */,
-    pattern: /\bghr_[a-zA-Z0-9]{36}\b/g
-  },
-  {
-    type: "App Installation Access Token" /* AppInstallationAccess */,
-    pattern: /\bghs_[a-zA-Z0-9]{255}\b/g
-  }
-];
-function isAuthToken(value, patterns = GITHUB_TOKEN_PATTERNS) {
-  for (const { type, pattern } of patterns) {
-    if (value.match(pattern)) {
-      return type;
-    }
-  }
-  return void 0;
-}
-function scanFileForTokens(filePath, relativePath2, logger) {
-  const findings = [];
-  try {
-    const content = fs25.readFileSync(filePath, "utf8");
-    for (const { type, pattern } of GITHUB_TOKEN_PATTERNS) {
-      const matches = content.match(pattern);
-      if (matches) {
-        for (let i = 0; i < matches.length; i++) {
-          findings.push({ tokenType: type, filePath: relativePath2 });
-        }
-        logger.debug(`Found ${matches.length} ${type}(s) in ${relativePath2}`);
-      }
-    }
-    return findings;
-  } catch (e) {
-    logger.debug(
-      `Could not scan file ${filePath} for tokens: ${getErrorMessage(e)}`
-    );
-    return [];
-  }
-}
-async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, logger, depth = 0) {
-  const MAX_DEPTH = 10;
-  if (depth > MAX_DEPTH) {
-    throw new Error(
-      `Maximum archive extraction depth (${MAX_DEPTH}) reached for ${archivePath}`
-    );
-  }
-  if (process.platform === "win32") {
-    throw new Error("Scanning archives is not supported on Windows.");
-  }
-  const result = {
-    scannedFiles: 0,
-    findings: []
-  };
-  try {
-    const tempExtractDir = fs25.mkdtempSync(
-      path22.join(extractDir, `extract-${depth}-`)
-    );
-    const fileName = path22.basename(archivePath).toLowerCase();
-    if (fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz")) {
-      logger.debug(`Extracting tar.gz file: ${archivePath}`);
-      await exec.exec("tar", ["-xzf", archivePath, "-C", tempExtractDir], {
-        silent: true
-      });
-    } else if (fileName.endsWith(".tar.zst")) {
-      logger.debug(`Extracting tar.zst file: ${archivePath}`);
-      await exec.exec(
-        "tar",
-        ["--zstd", "-xf", archivePath, "-C", tempExtractDir],
-        {
-          silent: true
-        }
-      );
-    } else if (fileName.endsWith(".zst")) {
-      logger.debug(`Extracting zst file: ${archivePath}`);
-      const outputFile = path22.join(
-        tempExtractDir,
-        path22.basename(archivePath, ".zst")
-      );
-      await exec.exec("zstd", ["-d", archivePath, "-o", outputFile], {
-        silent: true
-      });
-    } else if (fileName.endsWith(".gz")) {
-      logger.debug(`Extracting gz file: ${archivePath}`);
-      const outputFile = path22.join(
-        tempExtractDir,
-        path22.basename(archivePath, ".gz")
-      );
-      await exec.exec("gunzip", ["-c", archivePath], {
-        outStream: fs25.createWriteStream(outputFile),
-        silent: true
-      });
-    } else if (fileName.endsWith(".zip")) {
-      logger.debug(`Extracting zip file: ${archivePath}`);
-      await exec.exec(
-        "unzip",
-        ["-q", "-o", archivePath, "-d", tempExtractDir],
-        {
-          silent: true
-        }
-      );
-    }
-    const scanResult = await scanDirectory(
-      tempExtractDir,
-      relativeArchivePath,
-      logger,
-      depth + 1
-    );
-    result.scannedFiles += scanResult.scannedFiles;
-    result.findings.push(...scanResult.findings);
-    fs25.rmSync(tempExtractDir, { recursive: true, force: true });
-  } catch (e) {
-    logger.debug(
-      `Could not extract or scan archive file ${archivePath}: ${getErrorMessage(e)}`
-    );
-  }
-  return result;
-}
-async function scanFile(fullPath, relativePath2, extractDir, logger, depth = 0) {
-  const result = {
-    scannedFiles: 1,
-    findings: []
-  };
-  const fileName = path22.basename(fullPath).toLowerCase();
-  const isArchive = fileName.endsWith(".zip") || fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz") || fileName.endsWith(".tar.zst") || fileName.endsWith(".zst") || fileName.endsWith(".gz");
-  if (isArchive) {
-    const archiveResult = await scanArchiveFile(
-      fullPath,
-      relativePath2,
-      extractDir,
-      logger,
-      depth
-    );
-    result.scannedFiles += archiveResult.scannedFiles;
-    result.findings.push(...archiveResult.findings);
-  }
-  const fileFindings = scanFileForTokens(fullPath, relativePath2, logger);
-  result.findings.push(...fileFindings);
-  return result;
-}
-async function scanDirectory(dirPath, baseRelativePath, logger, depth = 0) {
-  const result = {
-    scannedFiles: 0,
-    findings: []
-  };
-  const entries = fs25.readdirSync(dirPath, { withFileTypes: true });
-  for (const entry of entries) {
-    const fullPath = path22.join(dirPath, entry.name);
-    const relativePath2 = path22.join(baseRelativePath, entry.name);
-    if (entry.isDirectory()) {
-      const subResult = await scanDirectory(
-        fullPath,
-        relativePath2,
-        logger,
-        depth
-      );
-      result.scannedFiles += subResult.scannedFiles;
-      result.findings.push(...subResult.findings);
-    } else if (entry.isFile()) {
-      const fileResult = await scanFile(
-        fullPath,
-        relativePath2,
-        path22.dirname(fullPath),
-        logger,
-        depth
-      );
-      result.scannedFiles += fileResult.scannedFiles;
-      result.findings.push(...fileResult.findings);
-    }
-  }
-  return result;
-}
-async function scanArtifactsForTokens(filesToScan, logger) {
-  logger.info(
-    "Starting best-effort check for potential GitHub tokens in debug artifacts (for testing purposes only)..."
-  );
-  const result = {
-    scannedFiles: 0,
-    findings: []
-  };
-  const tempScanDir = fs25.mkdtempSync(path22.join(os6.tmpdir(), "artifact-scan-"));
-  try {
-    for (const filePath of filesToScan) {
-      const stats = fs25.statSync(filePath);
-      const fileName = path22.basename(filePath);
-      if (stats.isDirectory()) {
-        const dirResult = await scanDirectory(filePath, fileName, logger);
-        result.scannedFiles += dirResult.scannedFiles;
-        result.findings.push(...dirResult.findings);
-      } else if (stats.isFile()) {
-        const fileResult = await scanFile(
-          filePath,
-          fileName,
-          tempScanDir,
-          logger
-        );
-        result.scannedFiles += fileResult.scannedFiles;
-        result.findings.push(...fileResult.findings);
-      }
-    }
-    const tokenTypesCounts = /* @__PURE__ */ new Map();
-    const filesWithTokens = /* @__PURE__ */ new Set();
-    for (const finding of result.findings) {
-      tokenTypesCounts.set(
-        finding.tokenType,
-        (tokenTypesCounts.get(finding.tokenType) || 0) + 1
-      );
-      filesWithTokens.add(finding.filePath);
-    }
-    const tokenTypesSummary = Array.from(tokenTypesCounts.entries()).map(([type, count]) => `${count} ${type}${count > 1 ? "s" : ""}`).join(", ");
-    const baseSummary = `scanned ${result.scannedFiles} files, found ${result.findings.length} potential token(s) in ${filesWithTokens.size} file(s)`;
-    const summaryWithTypes = tokenTypesSummary ? `${baseSummary} (${tokenTypesSummary})` : baseSummary;
-    logger.info(`Artifact check complete: ${summaryWithTypes}`);
-    if (result.findings.length > 0) {
-      const fileList = Array.from(filesWithTokens).join(", ");
-      throw new Error(
-        `Found ${result.findings.length} potential GitHub token(s) (${tokenTypesSummary}) in debug artifacts at: ${fileList}. This is a best-effort check for testing purposes only.`
-      );
-    }
-  } finally {
-    try {
-      fs25.rmSync(tempScanDir, { recursive: true, force: true });
-    } catch (e) {
-      logger.debug(
-        `Could not clean up temporary scan directory: ${getErrorMessage(e)}`
-      );
-    }
-  }
-}
-
-// src/debug-artifacts.ts
-function sanitizeArtifactName(name) {
-  return name.replace(/[^a-zA-Z0-9_-]+/g, "");
-}
-async function uploadCombinedSarifArtifacts(logger, gitHubVariant, codeQlVersion) {
-  const tempDir = getTemporaryDirectory();
-  if (process.env["CODEQL_ACTION_DEBUG_COMBINED_SARIF"] === "true") {
-    await withGroup("Uploading combined SARIF debug artifact", async () => {
-      logger.info(
-        "Uploading available combined SARIF files as Actions debugging artifact..."
-      );
-      const baseTempDir = path23.resolve(tempDir, "combined-sarif");
-      const toUpload = [];
-      if (fs26.existsSync(baseTempDir)) {
-        const outputDirs = fs26.readdirSync(baseTempDir);
-        for (const outputDir of outputDirs) {
-          const sarifFiles = fs26.readdirSync(path23.resolve(baseTempDir, outputDir)).filter((f) => path23.extname(f) === ".sarif");
-          for (const sarifFile of sarifFiles) {
-            toUpload.push(path23.resolve(baseTempDir, outputDir, sarifFile));
-          }
-        }
-      }
-      try {
-        await uploadDebugArtifacts(
-          logger,
-          toUpload,
-          baseTempDir,
-          "combined-sarif-artifacts",
-          gitHubVariant,
-          codeQlVersion
-        );
-      } catch (e) {
-        logger.warning(
-          `Failed to upload combined SARIF files as Actions debugging artifact. Reason: ${getErrorMessage(
-            e
-          )}`
-        );
-      }
-    });
-  }
-}
-function tryPrepareSarifDebugArtifact(config, language, logger) {
-  try {
-    const analyzeActionOutputDir = process.env["CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */];
-    if (analyzeActionOutputDir !== void 0 && fs26.existsSync(analyzeActionOutputDir) && fs26.lstatSync(analyzeActionOutputDir).isDirectory()) {
-      const sarifFile = path23.resolve(
-        analyzeActionOutputDir,
-        `${language}.sarif`
-      );
-      if (fs26.existsSync(sarifFile)) {
-        const sarifInDbLocation = path23.resolve(
-          config.dbLocation,
-          `${language}.sarif`
-        );
-        fs26.copyFileSync(sarifFile, sarifInDbLocation);
-        return sarifInDbLocation;
-      }
-    }
-  } catch (e) {
-    logger.warning(
-      `Failed to find SARIF results path for ${language}. Reason: ${getErrorMessage(
-        e
-      )}`
-    );
-  }
-  return void 0;
-}
-async function tryBundleDatabase(codeql, config, language, logger) {
-  try {
-    if (dbIsFinalized(config, language, logger)) {
-      try {
-        return await createDatabaseBundleCli(codeql, config, language);
-      } catch (e) {
-        logger.warning(
-          `Failed to bundle database for ${language} using the CLI. Falling back to a partial bundle. Reason: ${getErrorMessage(e)}`
-        );
-      }
-    }
-    return await createPartialDatabaseBundle(config, language);
-  } catch (e) {
-    logger.warning(
-      `Failed to bundle database for ${language}. Reason: ${getErrorMessage(
-        e
-      )}`
-    );
-    return void 0;
-  }
-}
-async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger, codeQlVersion) {
-  const filesToUpload = [];
-  try {
-    for (const language of config.languages) {
-      await withGroup(`Uploading debug artifacts for ${language}`, async () => {
-        logger.info("Preparing SARIF result debug artifact...");
-        const sarifResultDebugArtifact = tryPrepareSarifDebugArtifact(
-          config,
-          language,
-          logger
-        );
-        if (sarifResultDebugArtifact) {
-          filesToUpload.push(sarifResultDebugArtifact);
-          logger.info("SARIF result debug artifact ready for upload.");
-        }
-        logger.info("Preparing database logs debug artifact...");
-        const databaseDirectory = getCodeQLDatabasePath(config, language);
-        const logsDirectory = path23.resolve(databaseDirectory, "log");
-        if (doesDirectoryExist(logsDirectory)) {
-          filesToUpload.push(...listFolder(logsDirectory));
-          logger.info("Database logs debug artifact ready for upload.");
-        }
-        logger.info("Preparing database cluster logs debug artifact...");
-        const multiLanguageTracingLogsDirectory = path23.resolve(
-          config.dbLocation,
-          "log"
-        );
-        if (doesDirectoryExist(multiLanguageTracingLogsDirectory)) {
-          filesToUpload.push(...listFolder(multiLanguageTracingLogsDirectory));
-          logger.info("Database cluster logs debug artifact ready for upload.");
-        }
-        logger.info("Preparing database bundle debug artifact...");
-        const databaseBundle = await tryBundleDatabase(
-          codeql,
-          config,
-          language,
-          logger
-        );
-        if (databaseBundle) {
-          filesToUpload.push(databaseBundle);
-          logger.info("Database bundle debug artifact ready for upload.");
-        }
-      });
-    }
-  } catch (e) {
-    logger.warning(
-      `Failed to prepare debug artifacts. Reason: ${getErrorMessage(e)}`
-    );
-    return;
-  }
-  try {
-    await withGroup(
-      "Uploading debug artifacts",
-      async () => uploadDebugArtifacts(
-        logger,
-        filesToUpload,
-        config.dbLocation,
-        config.debugArtifactName,
-        config.gitHubVersion.type,
-        codeQlVersion
-      )
-    );
-  } catch (e) {
-    logger.warning(
-      `Failed to upload debug artifacts. Reason: ${getErrorMessage(e)}`
-    );
-  }
-}
-function getArtifactSuffix(matrix) {
-  let suffix = "";
-  if (matrix) {
-    try {
-      const matrixObject = JSON.parse(matrix);
-      if (isObject(matrixObject)) {
-        for (const matrixKey of Object.keys(matrixObject).sort())
-          suffix += `-${matrixObject[matrixKey]}`;
-      } else {
-        core17.warning("User-specified `matrix` input is not an object.");
-      }
-    } catch {
-      core17.warning(
-        "Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input."
-      );
-    }
-  }
-  return suffix;
-}
-async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) {
-  const uploadSupported = isSafeArtifactUpload(codeQlVersion);
-  if (!uploadSupported) {
-    core17.info(
-      `Skipping debug artifact upload because the current CLI does not support safe upload. Please upgrade to CLI v${SafeArtifactUploadVersion} or later.`
-    );
-    return "upload-not-supported";
-  }
-  return uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant);
-}
-async function uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant) {
-  if (toUpload.length === 0) {
-    return "no-artifacts-to-upload";
-  }
-  if (isInTestMode()) {
-    await scanArtifactsForTokens(toUpload, logger);
-    core17.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true");
-  }
-  const suffix = getArtifactSuffix(getOptionalInput("matrix"));
-  const artifactUploader = await getArtifactUploaderClient(logger, ghVariant);
-  try {
-    await artifactUploader.uploadArtifact(
-      sanitizeArtifactName(`${artifactName}${suffix}`),
-      toUpload.map((file) => path23.normalize(file)),
-      path23.normalize(rootDir),
-      {
-        // ensure we don't keep the debug artifacts around for too long since they can be large.
-        retentionDays: 7
-      }
-    );
-    return "upload-successful";
-  } catch (e) {
-    core17.warning(`Failed to upload debug artifacts: ${e}`);
-    return "upload-failed";
-  }
-}
-async function getArtifactUploaderClient(logger, ghVariant) {
-  if (ghVariant === "GitHub Enterprise Server" /* GHES */) {
-    logger.info(
-      "Debug artifacts can be consumed with `actions/download-artifact@v3` because the `v4` version is not yet compatible on GHES."
-    );
-    return artifactLegacy.create();
-  } else {
-    logger.info(
-      "Debug artifacts can be consumed with `actions/download-artifact@v4`."
-    );
-    return new artifact.DefaultArtifactClient();
-  }
-}
-async function createPartialDatabaseBundle(config, language) {
-  const databasePath = getCodeQLDatabasePath(config, language);
-  const databaseBundlePath = path23.resolve(
-    config.dbLocation,
-    `${config.debugDatabaseName}-${language}-partial.zip`
-  );
-  core17.info(
-    `${config.debugDatabaseName}-${language} is not finalized. Uploading partial database bundle at ${databaseBundlePath}...`
-  );
-  if (fs26.existsSync(databaseBundlePath)) {
-    await fs26.promises.rm(databaseBundlePath, { force: true });
-  }
-  const output = fs26.createWriteStream(databaseBundlePath);
-  const zip = new ZipArchive();
-  zip.on("error", (err) => {
-    throw err;
-  });
-  zip.on("warning", (err) => {
-    if (err.code !== "ENOENT") {
-      throw err;
-    }
-  });
-  zip.pipe(output);
-  zip.directory(databasePath, false);
-  await zip.finalize();
-  return databaseBundlePath;
-}
-async function createDatabaseBundleCli(codeql, config, language) {
-  const databaseBundlePath = await bundleDb(
-    config,
-    language,
-    codeql,
-    `${config.debugDatabaseName}-${language}`,
-    { includeDiagnostics: true }
-  );
-  return databaseBundlePath;
-}
-
-// src/analyze-action-post.ts
-async function runWrapper2() {
-  try {
-    restoreInputs();
-    const logger = getActionsLogger();
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    if (process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true") {
-      const config = await getConfig(
-        getTemporaryDirectory(),
-        logger
-      );
-      if (config !== void 0) {
-        const codeql = await getCodeQL(logger, config.codeQLCmd);
-        const version = await codeql.getVersion();
-        await uploadCombinedSarifArtifacts(
-          logger,
-          config.gitHubVersion.type,
-          version.version
-        );
-      }
-    }
-    const tempDependencyDirs = [
-      getJavaTempDependencyDir(),
-      getCsharpTempDependencyDir()
-    ];
-    for (const tempDependencyDir of tempDependencyDirs) {
-      if (fs27.existsSync(tempDependencyDir)) {
-        try {
-          fs27.rmSync(tempDependencyDir, { recursive: true });
-        } catch (error3) {
-          logger.info(
-            `Failed to remove temporary dependencies directory: ${getErrorMessage(error3)}`
-          );
-        }
-      }
-    }
-  } catch (error3) {
-    core18.setFailed(
-      `analyze post-action step failed: ${getErrorMessage(error3)}`
-    );
-  }
-}
-
-// src/autobuild-action.ts
-var core19 = __toESM(require_core());
-async function sendCompletedStatusReport(config, logger, startedAt, allLanguages, failingLanguage, cause) {
-  initializeEnvironment(getActionVersion());
-  const status = getActionsStatus(cause, failingLanguage);
-  const statusReportBase = await createStatusReportBase(
-    "autobuild" /* Autobuild */,
-    status,
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger,
-    cause?.message,
-    cause?.stack
-  );
-  if (statusReportBase !== void 0) {
-    const statusReport = {
-      ...statusReportBase,
-      autobuild_languages: allLanguages.join(","),
-      autobuild_failure: failingLanguage
-    };
-    await sendStatusReport(statusReport);
-  }
-}
-async function run2({ startedAt, logger }) {
-  let config;
-  let currentLanguage;
-  let languages;
-  try {
-    const statusReportBase = await createStatusReportBase(
-      "autobuild" /* Autobuild */,
-      "starting",
-      startedAt,
-      config,
-      await checkDiskUsage(logger),
-      logger
-    );
-    if (statusReportBase !== void 0) {
-      await sendStatusReport(statusReportBase);
-    }
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    checkActionVersion(getActionVersion(), gitHubVersion);
-    config = await getConfig(getTemporaryDirectory(), logger);
-    if (config === void 0) {
-      throw new ConfigurationError(
-        "Config file could not be found at expected location. Has the 'init' action been called?"
-      );
-    }
-    const codeql = await getCodeQL(logger, config.codeQLCmd);
-    languages = await determineAutobuildLanguages(codeql, config, logger);
-    if (languages !== void 0) {
-      const workingDirectory = getOptionalInput("working-directory");
-      if (workingDirectory) {
-        logger.info(
-          `Changing autobuilder working directory to ${workingDirectory}`
-        );
-        process.chdir(workingDirectory);
-      }
-      for (const language of languages) {
-        currentLanguage = language;
-        await runAutobuild(config, language, logger);
-      }
-    }
-    await endTracingForCluster(codeql, config, logger);
-  } catch (unwrappedError) {
-    const error3 = wrapError(unwrappedError);
-    core19.setFailed(
-      `We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. ${error3.message}`
-    );
-    await sendCompletedStatusReport(
-      config,
-      logger,
-      startedAt,
-      languages ?? [],
-      currentLanguage,
-      error3
-    );
-    return;
-  }
-  core19.exportVariable("CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY" /* AUTOBUILD_DID_COMPLETE_SUCCESSFULLY */, "true");
-  await sendCompletedStatusReport(config, logger, startedAt, languages ?? []);
-}
-var autobuild = {
-  name: "autobuild" /* Autobuild */,
-  run: run2
-};
-async function runWrapper3() {
-  await runInActions(autobuild);
-}
-
-// src/init-action.ts
-var fs29 = __toESM(require("fs"));
-var path25 = __toESM(require("path"));
-var core21 = __toESM(require_core());
-var io7 = __toESM(require_io());
-var semver10 = __toESM(require_semver2());
-
-// src/config/inputs.ts
-async function getToolsInput(action, repositoryProperties) {
-  const name = "tools" /* Tools */;
-  const input = action.actions.getOptionalInput(name);
-  const propertyValue = repositoryProperties["github-codeql-tools" /* TOOLS */];
-  const allowRepositoryProperty = await action.features.getValue(
-    "tools_repository_property" /* ToolsRepositoryProperty */
-  );
-  if (allowRepositoryProperty && propertyValue?.startsWith("!")) {
-    action.logger.info(
-      `Using ${name} input from repository property (enforced): ${propertyValue}`
-    );
-    return {
-      // Drop the '!' from the value.
-      value: propertyValue.substring(1),
-      source: "repository-property" /* RepositoryProperty */
-    };
-  }
-  if (input !== void 0) {
-    action.logger.info(`Using ${name} input from workflow: ${input}`);
-    return { value: input, source: "workflow" /* Workflow */ };
-  }
-  if (allowRepositoryProperty && propertyValue !== void 0) {
-    action.logger.info(
-      `Using ${name} input from repository property: ${propertyValue}`
-    );
-    return {
-      value: propertyValue,
-      source: "repository-property" /* RepositoryProperty */
-    };
-  }
-  return void 0;
-}
-
-// src/workflow.ts
-var fs28 = __toESM(require("fs"));
-var path24 = __toESM(require("path"));
-var import_zlib3 = __toESM(require("zlib"));
-var core20 = __toESM(require_core());
-function toCodedErrors(errors) {
-  return Object.entries(errors).reduce(
-    (acc, [code, message]) => {
-      acc[code] = { message, code };
-      return acc;
-    },
-    {}
-  );
-}
-var WorkflowErrors = toCodedErrors({
-  MissingPushHook: `Please specify an on.push hook to analyze and see code scanning alerts from the default branch on the Security tab.`,
-  CheckoutWrongHead: `git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.`,
-  InconsistentActionVersion: `Not all workflow steps that use \`github/codeql-action\` actions use the same version. Please ensure that all such steps use the same version to avoid compatibility issues.`
-});
-async function groupLanguagesByExtractor(languages, codeql) {
-  const resolveResult = await codeql.resolveLanguages();
-  if (!resolveResult.aliases) {
-    return void 0;
-  }
-  const aliases = resolveResult.aliases;
-  const languagesByExtractor = {};
-  for (const language of languages) {
-    const extractorName = aliases[language] || language;
-    if (!languagesByExtractor[extractorName]) {
-      languagesByExtractor[extractorName] = [];
-    }
-    languagesByExtractor[extractorName].push(language);
-  }
-  return languagesByExtractor;
-}
-async function getWorkflowErrors(doc, codeql) {
-  const errors = [];
-  const jobName = process.env.GITHUB_JOB;
-  if (jobName) {
-    const job = doc?.jobs?.[jobName];
-    if (job?.strategy?.matrix?.language) {
-      const matrixLanguages = job.strategy.matrix.language;
-      if (Array.isArray(matrixLanguages)) {
-        const matrixLanguagesByExtractor = await groupLanguagesByExtractor(
-          matrixLanguages,
-          codeql
-        );
-        if (matrixLanguagesByExtractor !== void 0) {
-          for (const [extractor, languages] of Object.entries(
-            matrixLanguagesByExtractor
-          )) {
-            if (languages.length > 1) {
-              errors.push({
-                message: `CodeQL language '${extractor}' is referenced by more than one entry in the 'language' matrix parameter for job '${jobName}'. This may result in duplicate alerts. Please edit the 'language' matrix parameter to keep only one of the following: ${languages.map((language) => `'${language}'`).join(", ")}.`,
-                code: "DuplicateLanguageInMatrix"
-              });
-            }
-          }
-        }
-      }
-    }
-    const steps = job?.steps;
-    if (Array.isArray(steps)) {
-      for (const step of steps) {
-        if (step?.run === "git checkout HEAD^2") {
-          errors.push(WorkflowErrors.CheckoutWrongHead);
-          break;
-        }
-      }
-    }
-  }
-  const codeqlStepRefs = [];
-  for (const job of Object.values(doc?.jobs || {})) {
-    if (Array.isArray(job.steps)) {
-      for (const step of job.steps) {
-        if (step.uses?.startsWith("github/codeql-action/")) {
-          const parts = step.uses.split("@");
-          if (parts.length >= 2) {
-            codeqlStepRefs.push(parts[parts.length - 1]);
-          }
-        }
-      }
-    }
-  }
-  if (codeqlStepRefs.length > 0 && !codeqlStepRefs.every((ref) => ref === codeqlStepRefs[0])) {
-    errors.push(WorkflowErrors.InconsistentActionVersion);
-  }
-  const hasPushTrigger = hasWorkflowTrigger("push", doc);
-  const hasPullRequestTrigger = hasWorkflowTrigger("pull_request", doc);
-  const hasWorkflowCallTrigger = hasWorkflowTrigger("workflow_call", doc);
-  if (hasPullRequestTrigger && !hasPushTrigger && !hasWorkflowCallTrigger) {
-    errors.push(WorkflowErrors.MissingPushHook);
-  }
-  return errors;
-}
-function hasWorkflowTrigger(triggerName, doc) {
-  if (!doc.on) {
-    return false;
-  }
-  if (typeof doc.on === "string") {
-    return doc.on === triggerName;
-  }
-  if (Array.isArray(doc.on)) {
-    return doc.on.includes(triggerName);
-  }
-  return Object.prototype.hasOwnProperty.call(doc.on, triggerName);
-}
-async function validateWorkflow(codeql, logger) {
-  let workflow;
-  try {
-    workflow = await getWorkflow(logger);
-  } catch (e) {
-    return `error: getWorkflow() failed: ${String(e)}`;
-  }
-  let workflowErrors;
-  try {
-    workflowErrors = await getWorkflowErrors(workflow, codeql);
-  } catch (e) {
-    return `error: getWorkflowErrors() failed: ${String(e)}`;
-  }
-  if (workflowErrors.length > 0) {
-    let message;
-    try {
-      message = formatWorkflowErrors(workflowErrors);
-    } catch (e) {
-      return `error: formatWorkflowErrors() failed: ${String(e)}`;
-    }
-    core20.warning(message);
-  }
-  return formatWorkflowCause(workflowErrors);
-}
-function formatWorkflowErrors(errors) {
-  const issuesWere = errors.length === 1 ? "issue was" : "issues were";
-  const errorsList = errors.map((e) => e.message).join(" ");
-  return `${errors.length} ${issuesWere} detected with this workflow: ${errorsList}`;
-}
-function formatWorkflowCause(errors) {
-  if (errors.length === 0) {
-    return void 0;
-  }
-  return errors.map((e) => e.code).join(",");
-}
-async function getWorkflow(logger) {
-  const maybeWorkflow = process.env["CODE_SCANNING_WORKFLOW_FILE"];
-  if (maybeWorkflow) {
-    logger.debug(
-      "Using the workflow specified by the CODE_SCANNING_WORKFLOW_FILE environment variable."
-    );
-    return load(
-      import_zlib3.default.gunzipSync(Buffer.from(maybeWorkflow, "base64")).toString()
-    );
-  }
-  const workflowPath = await getWorkflowAbsolutePath(logger);
-  return load(fs28.readFileSync(workflowPath, "utf-8"));
-}
-async function getWorkflowAbsolutePath(logger) {
-  const relativePath2 = await getWorkflowRelativePath();
-  const absolutePath = path24.join(
-    getRequiredEnvParam("GITHUB_WORKSPACE"),
-    relativePath2
-  );
-  if (fs28.existsSync(absolutePath)) {
-    logger.debug(
-      `Derived the following absolute path for the currently executing workflow: ${absolutePath}.`
-    );
-    return absolutePath;
-  }
-  throw new Error(
-    `Expected to find a code scanning workflow file at ${absolutePath}, but no such file existed. This can happen if the currently running workflow checks out a branch that doesn't contain the corresponding workflow file.`
-  );
-}
-function getStepsCallingAction(job, actionName) {
-  if (job.uses) {
-    throw new Error(
-      `Could not get steps calling ${actionName} since the job calls a reusable workflow.`
-    );
-  }
-  const steps = job.steps;
-  if (!Array.isArray(steps)) {
-    throw new Error(
-      `Could not get steps calling ${actionName} since job.steps was not an array.`
-    );
-  }
-  return steps.filter((step) => step.uses?.includes(actionName));
-}
-function getInputOrThrow(workflow, jobName, actionName, inputName, matrixVars) {
-  const preamble = `Could not get ${inputName} input to ${actionName} since`;
-  if (!workflow.jobs) {
-    throw new Error(`${preamble} the workflow has no jobs.`);
-  }
-  if (!workflow.jobs[jobName]) {
-    throw new Error(`${preamble} the workflow has no job named ${jobName}.`);
-  }
-  const stepsCallingAction = getStepsCallingAction(
-    workflow.jobs[jobName],
-    actionName
-  );
-  if (stepsCallingAction.length === 0) {
-    throw new Error(
-      `${preamble} the ${jobName} job does not call ${actionName}.`
-    );
-  } else if (stepsCallingAction.length > 1) {
-    throw new Error(
-      `${preamble} the ${jobName} job calls ${actionName} multiple times.`
-    );
-  }
-  let input = stepsCallingAction[0].with?.[inputName]?.toString();
-  if (input !== void 0 && matrixVars !== void 0) {
-    input = input.replace(/\${{\s+/, "${{").replace(/\s+}}/, "}}");
-    for (const [key, value] of Object.entries(matrixVars)) {
-      input = input.replace(`\${{matrix.${key}}}`, value);
-    }
-  }
-  if (input?.includes("${{")) {
-    throw new Error(
-      `Could not get ${inputName} input to ${actionName} since it contained an unrecognized dynamic value.`
-    );
-  }
-  return input;
-}
-function getAnalyzeActionName() {
-  if (isInTestMode() || getTestingEnvironment() === "codeql-action-pr-checks") {
-    return "./analyze";
-  } else {
-    return "github/codeql-action/analyze";
-  }
-}
-function getCategoryInputOrThrow(workflow, jobName, matrixVars) {
-  return getInputOrThrow(
-    workflow,
-    jobName,
-    getAnalyzeActionName(),
-    "category",
-    matrixVars
-  );
-}
-function getUploadInputOrThrow(workflow, jobName, matrixVars) {
-  return getInputOrThrow(
-    workflow,
-    jobName,
-    getAnalyzeActionName(),
-    "upload",
-    matrixVars
-  );
-}
-function getCheckoutPathInputOrThrow(workflow, jobName, matrixVars) {
-  return getInputOrThrow(
-    workflow,
-    jobName,
-    getAnalyzeActionName(),
-    "checkout_path",
-    matrixVars
-  ) || getRequiredEnvParam("GITHUB_WORKSPACE");
-}
-async function checkWorkflow(logger, codeql) {
-  if (!isDynamicWorkflow() && process.env["CODEQL_ACTION_SKIP_WORKFLOW_VALIDATION" /* SKIP_WORKFLOW_VALIDATION */] !== "true") {
-    core20.startGroup("Validating workflow");
-    const validateWorkflowResult = await internal2.validateWorkflow(
-      codeql,
-      logger
-    );
-    if (validateWorkflowResult === void 0) {
-      logger.info("Detected no issues with the code scanning workflow.");
-    } else {
-      logger.debug(
-        `Unable to validate code scanning workflow: ${validateWorkflowResult}`
-      );
-    }
-    core20.endGroup();
-  }
-}
-var internal2 = {
-  validateWorkflow
-};
-
-// src/init-action.ts
-var CODEQL_VERSION_JAR_MINIMIZATION = "2.23.0";
-async function sendStartingStatusReport(startedAt, config, logger) {
-  const statusReportBase = await createStatusReportBase(
-    "init" /* Init */,
-    "starting",
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger
-  );
-  if (statusReportBase !== void 0) {
-    await sendStatusReport(statusReportBase);
-  }
-}
-async function sendCompletedStatusReport2(startedAt, config, configFile, toolsInput, toolsDownloadStatusReport, toolsFeatureFlagsValid, toolsSource, toolsVersion, overlayBaseDatabaseStats, dependencyCachingResults, logger, error3) {
-  const statusReportBase = await createStatusReportBase(
-    "init" /* Init */,
-    getActionsStatus(error3),
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger,
-    error3?.message,
-    error3?.stack
-  );
-  if (statusReportBase === void 0) {
-    return;
-  }
-  const workflowLanguages = getOptionalInput("languages");
-  const initStatusReport = {
-    ...statusReportBase,
-    tools_input: toolsInput?.value || "",
-    tools_resolved_version: toolsVersion,
-    tools_source: toolsSource || "UNKNOWN" /* Unknown */,
-    workflow_languages: workflowLanguages || ""
-  };
-  if (toolsInput !== void 0) {
-    initStatusReport.computed_inputs.tools = toolsInput;
-  }
-  const initToolsDownloadFields = {};
-  if (toolsDownloadStatusReport?.downloadDurationMs !== void 0) {
-    initToolsDownloadFields.tools_download_duration_ms = toolsDownloadStatusReport.downloadDurationMs;
-  }
-  if (toolsFeatureFlagsValid !== void 0) {
-    initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
-  }
-  if (config !== void 0) {
-    const initWithConfigStatusReport = await createInitWithConfigStatusReport(
-      config,
-      initStatusReport,
-      configFile,
-      Math.round(
-        await getTotalCacheSize(Object.values(config.trapCaches), logger)
-      ),
-      overlayBaseDatabaseStats,
-      dependencyCachingResults
-    );
-    await sendStatusReport({
-      ...initWithConfigStatusReport,
-      ...initToolsDownloadFields
-    });
-  } else {
-    await sendStatusReport({ ...initStatusReport, ...initToolsDownloadFields });
-  }
-}
-async function run3(actionState) {
-  const startedAt = actionState.startedAt;
-  const logger = actionState.logger;
-  let apiDetails;
-  let config;
-  let configFile;
-  let codeql;
-  let features;
-  let sourceRoot;
-  let toolsInput;
-  let toolsDownloadStatusReport;
-  let toolsFeatureFlagsValid;
-  let toolsSource;
-  let toolsVersion;
-  try {
-    initializeEnvironment(getActionVersion());
-    persistInputs();
-    apiDetails = {
-      auth: getRequiredInput("token"),
-      externalRepoAuth: getOptionalInput("external-repository-token"),
-      url: getRequiredEnvParam("GITHUB_SERVER_URL"),
-      apiURL: getRequiredEnvParam("GITHUB_API_URL")
-    };
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    checkActionVersion(getActionVersion(), gitHubVersion);
-    const repositoryNwo = getRepositoryNwo();
-    features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger
-    );
-    const repositoryPropertiesResult = await loadRepositoryProperties(
-      repositoryNwo,
-      logger
-    );
-    const repositoryProperties = repositoryPropertiesResult.orElse({});
-    core21.exportVariable("CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */, "true");
-    sourceRoot = path25.resolve(
-      getRequiredEnvParam("GITHUB_WORKSPACE"),
-      getOptionalInput("source-root") || ""
-    );
-    let analysisKinds;
-    try {
-      analysisKinds = await getAnalysisKinds(logger, features);
-    } catch (err) {
-      logger.debug(
-        `Failed to parse analysis kinds for 'starting' status report: ${getErrorMessage(err)}`
-      );
-    }
-    const actionStateWithFeatures = { ...actionState, features };
-    configFile = await getConfigFileInput(
-      actionStateWithFeatures,
-      repositoryProperties,
-      analysisKinds
-    );
-    await sendStartingStatusReport(startedAt, { analysisKinds }, logger);
-    if (process.env["CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */] === "true") {
-      throw new ConfigurationError(
-        `The 'init' action should not be run in the same workflow as 'setup-codeql'.`
-      );
-    }
-    toolsInput = await getToolsInput(
-      actionStateWithFeatures,
-      repositoryProperties
-    );
-    const codeQLDefaultVersionInfo = await features.getEnabledDefaultCliVersions(gitHubVersion.type);
-    toolsFeatureFlagsValid = codeQLDefaultVersionInfo.toolsFeatureFlagsValid;
-    const rawLanguages = getRawLanguagesNoAutodetect(
-      getOptionalInput("languages")
-    );
-    const useOverlayAwareDefaultCliVersion = analysisKinds?.length === 1 && analysisKinds[0] === "code-scanning" /* CodeScanning */;
-    const initCodeQLResult = await initCodeQL(
-      toolsInput?.value,
-      apiDetails,
-      getTemporaryDirectory(),
-      gitHubVersion.type,
-      codeQLDefaultVersionInfo,
-      rawLanguages,
-      useOverlayAwareDefaultCliVersion,
-      features,
-      logger
-    );
-    codeql = initCodeQLResult.codeql;
-    toolsDownloadStatusReport = initCodeQLResult.toolsDownloadStatusReport;
-    toolsVersion = initCodeQLResult.toolsVersion;
-    toolsSource = initCodeQLResult.toolsSource;
-    await checkWorkflow(logger, codeql);
-    if (
-      // Only enable the experimental features env variable for Rust analysis if the user has explicitly
-      // requested rust - don't enable it via language autodetection.
-      getRawLanguagesNoAutodetect(getOptionalInput("languages")).includes("rust" /* rust */)
-    ) {
-      const experimental = "2.19.3";
-      const publicPreview = "2.22.1";
-      const actualVer = (await codeql.getVersion()).version;
-      if (semver10.lt(actualVer, experimental)) {
-        throw new ConfigurationError(
-          `Rust analysis is supported by CodeQL CLI version ${experimental} or higher, but found version ${actualVer}`
-        );
-      }
-      if (semver10.lt(actualVer, publicPreview)) {
-        core21.exportVariable("CODEQL_ENABLE_EXPERIMENTAL_FEATURES" /* EXPERIMENTAL_FEATURES */, "true");
-        logger.info("Experimental Rust analysis enabled");
-      }
-    }
-    analysisKinds = await getAnalysisKinds(logger, features);
-    const debugMode = getOptionalInput("debug") === "true" || core21.isDebug();
-    const fileCoverageResult = await getFileCoverageInformationEnabled(
-      debugMode,
-      codeql,
-      features,
-      repositoryProperties
-    );
-    config = await initConfig2(actionStateWithFeatures, {
-      analysisKinds,
-      languagesInput: getOptionalInput("languages"),
-      queriesInput: getOptionalInput("queries"),
-      packsInput: getOptionalInput("packs"),
-      buildModeInput: getOptionalInput("build-mode"),
-      ramInput: getOptionalInput("ram"),
-      configFile,
-      dbLocation: getOptionalInput("db-location"),
-      configInput: getOptionalInput("config"),
-      dependencyCachingEnabled: getDependencyCachingEnabled(),
-      // Debug mode is enabled if:
-      // - The `init` Action is passed `debug: true`.
-      // - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
-      //   or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
-      debugMode,
-      debugArtifactName: getOptionalInput("debug-artifact-name") || DEFAULT_DEBUG_ARTIFACT_NAME,
-      debugDatabaseName: getOptionalInput("debug-database-name") || DEFAULT_DEBUG_DATABASE_NAME,
-      repository: repositoryNwo,
-      tempDir: getTemporaryDirectory(),
-      codeql,
-      workspacePath: getRequiredEnvParam("GITHUB_WORKSPACE"),
-      sourceRoot,
-      githubVersion: gitHubVersion,
-      apiDetails,
-      features,
-      repositoryProperties,
-      enableFileCoverageInformation: fileCoverageResult.enabled,
-      logger
-    });
-    if (config.languages.includes("swift" /* swift */) && process.platform !== "darwin") {
-      throw new ConfigurationError(
-        `Swift analysis is only supported on macOS runner images. Please migrate to a macOS runner.`
-      );
-    }
-    if (repositoryPropertiesResult.isFailure()) {
-      addNoLanguageDiagnostic(
-        config,
-        makeTelemetryDiagnostic(
-          "codeql-action/repository-properties-load-failure",
-          "Failed to load repository properties",
-          {
-            error: getErrorMessage(repositoryPropertiesResult.value)
-          }
-        )
-      );
-    }
-    if (fileCoverageResult.enabledByRepositoryProperty) {
-      addNoLanguageDiagnostic(
-        config,
-        makeTelemetryDiagnostic(
-          "codeql-action/file-coverage-on-prs-enabled-by-repository-property",
-          "File coverage on PRs enabled by repository property",
-          {}
-        )
-      );
-    }
-    if (fileCoverageResult.showDeprecationWarning) {
-      logFileCoverageOnPrsDeprecationWarning(logger);
-    }
-    await checkInstallPython311(config.languages, codeql);
-  } catch (unwrappedError) {
-    const error3 = wrapError(unwrappedError);
-    core21.setFailed(error3.message);
-    const statusReportBase = await createStatusReportBase(
-      "init" /* Init */,
-      error3 instanceof ConfigurationError ? "user-error" : "aborted",
-      startedAt,
-      config,
-      await checkDiskUsage(logger),
-      logger,
-      error3.message,
-      error3.stack
-    );
-    if (statusReportBase !== void 0) {
-      await sendStatusReport(statusReportBase);
-    }
-    return;
-  }
-  let overlayBaseDatabaseStats;
-  let dependencyCachingStatus;
-  try {
-    if (config.overlayDatabaseMode === "overlay" /* Overlay */ && config.useOverlayDatabaseCaching) {
-      await withGroupAsync(
-        "Checking cache for overlay-base database",
-        async () => {
-          overlayBaseDatabaseStats = await downloadOverlayBaseDatabaseFromCache(
-            codeql,
-            config,
-            logger
-          );
-          if (!overlayBaseDatabaseStats) {
-            config.overlayDatabaseMode = "none" /* None */;
-            logger.info(
-              `No overlay-base database found in cache, reverting overlay database mode to ${"none" /* None */}.`
-            );
-          }
-        }
-      );
-    }
-    if (config.overlayDatabaseMode !== "overlay" /* Overlay */) {
-      cleanupDatabaseClusterDirectory(config, logger);
-    }
-    const goFlags = process.env["GOFLAGS"];
-    if (goFlags) {
-      core21.exportVariable("GOFLAGS", goFlags);
-      core21.warning(
-        "Passing the GOFLAGS env parameter to the init action is deprecated. Please move this to the analyze action."
-      );
-    }
-    if (config.languages.includes("go" /* go */) && process.platform === "linux") {
-      try {
-        const goBinaryPath = await io7.which("go", true);
-        const fileOutput = await getFileType(goBinaryPath);
-        if (fileOutput.includes("statically linked") && !await codeql.supportsFeature(
-          "indirectTracingSupportsStaticBinaries" /* IndirectTracingSupportsStaticBinaries */
-        )) {
-          try {
-            logger.debug(`Applying static binary workaround for Go`);
-            const tempBinPath = path25.resolve(
-              getTemporaryDirectory(),
-              "codeql-action-go-tracing",
-              "bin"
-            );
-            fs29.mkdirSync(tempBinPath, { recursive: true });
-            core21.addPath(tempBinPath);
-            const goWrapperPath = path25.resolve(tempBinPath, "go");
-            fs29.writeFileSync(
-              goWrapperPath,
-              `#!/bin/bash
-
-exec ${goBinaryPath} "$@"`
-            );
-            fs29.chmodSync(goWrapperPath, "755");
-            core21.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goWrapperPath);
-          } catch (e) {
-            logger.warning(
-              `Analyzing Go on Linux, but failed to install wrapper script. Tracing custom builds may fail: ${e}`
-            );
-          }
-        } else {
-          core21.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goBinaryPath);
-        }
-      } catch (e) {
-        logger.warning(
-          `Failed to determine the location of the Go binary: ${e}`
-        );
-        if (e instanceof FileCmdNotFoundError) {
-          addDiagnostic(
-            config,
-            "go" /* go */,
-            makeDiagnostic(
-              "go/workflow/file-program-unavailable",
-              "The `file` program is required on Linux, but does not appear to be installed",
-              {
-                markdownMessage: "CodeQL was unable to find the `file` program on this system. Ensure that the `file` program is installed on Linux runners and accessible.",
-                visibility: {
-                  statusPage: true,
-                  telemetry: true,
-                  cliSummaryTable: true
-                },
-                severity: "warning"
-              }
-            )
-          );
-        }
-      }
-    }
-    core21.exportVariable(
-      "CODEQL_RAM",
-      process.env["CODEQL_RAM"] || getCodeQLMemoryLimit(getOptionalInput("ram"), logger).toString()
-    );
-    core21.exportVariable(
-      "CODEQL_THREADS",
-      process.env["CODEQL_THREADS"] || getThreadsFlagValue(getOptionalInput("threads"), logger).toString()
-    );
-    if (await features.getValue("disable_kotlin_analysis_enabled" /* DisableKotlinAnalysisEnabled */)) {
-      core21.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true");
-    }
-    if (await features.getValue("force_jgit" /* ForceJGit */)) {
-      core21.exportVariable("CODEQL_GIT_BACKEND", "jgit");
-    }
-    const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT";
-    if (await codeQlVersionAtLeast(codeql, "2.20.3") && !await codeQlVersionAtLeast(codeql, "2.20.4")) {
-      core21.exportVariable(kotlinLimitVar, "2.1.20");
-    }
-    if (shouldRestoreCache(config.dependencyCachingEnabled)) {
-      const dependencyCachingResult = await downloadDependencyCaches(
-        codeql,
-        features,
-        config.languages,
-        logger
-      );
-      dependencyCachingStatus = dependencyCachingResult.statusReport;
-      config.dependencyCachingRestoredKeys = dependencyCachingResult.restoredKeys;
-    }
-    if (getOptionalInput("setup-python-dependencies") !== void 0) {
-      logger.warning(
-        "The setup-python-dependencies input is deprecated and no longer has any effect. We recommend removing any references from your workflows. See https://github.blog/changelog/2024-01-23-codeql-2-16-python-dependency-installation-disabled-new-queries-and-bug-fixes/ for more information."
-      );
-    }
-    if (process.env["CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION"] !== void 0) {
-      logger.warning(
-        "The CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION environment variable is deprecated and no longer has any effect. We recommend removing any references from your workflows. See https://github.blog/changelog/2024-01-23-codeql-2-16-python-dependency-installation-disabled-new-queries-and-bug-fixes/ for more information."
-      );
-    }
-    if (process.env["CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */]) {
-      logger.debug(
-        `${"CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */} is already set to '${process.env["CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */]}', so the Action will not override it.`
-      );
-    } else if (await codeQlVersionAtLeast(codeql, CODEQL_VERSION_JAR_MINIMIZATION) && config.dependencyCachingEnabled && config.buildMode === "none" /* None */ && config.languages.includes("java" /* java */)) {
-      core21.exportVariable(
-        "CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */,
-        "true"
-      );
-    }
-    const { registriesAuthTokens, qlconfigFile } = await generateRegistries(
-      getOptionalInput("registries"),
-      config.tempDir,
-      logger
-    );
-    const databaseInitEnvironment = {
-      GITHUB_TOKEN: apiDetails.auth,
-      CODEQL_REGISTRIES_AUTH: registriesAuthTokens
-    };
-    await runDatabaseInitCluster(
-      databaseInitEnvironment,
-      codeql,
-      config,
-      sourceRoot,
-      "Runner.Worker.exe",
-      qlconfigFile
-    );
-    if (config.overlayDatabaseMode !== "none" /* None */ && !await checkPacksForOverlayCompatibility(codeql, config, logger)) {
-      logger.info(
-        "Reverting overlay database mode to None due to incompatible packs."
-      );
-      config.overlayDatabaseMode = "none" /* None */;
-      cleanupDatabaseClusterDirectory(config, logger, {
-        disableExistingDirectoryWarning: true
-      });
-      await runDatabaseInitCluster(
-        databaseInitEnvironment,
-        codeql,
-        config,
-        sourceRoot,
-        "Runner.Worker.exe",
-        qlconfigFile
-      );
-    }
-    const tracerConfig = await getCombinedTracerConfig(codeql, config);
-    if (tracerConfig !== void 0) {
-      for (const [key, value] of Object.entries(tracerConfig.env)) {
-        core21.exportVariable(key, value);
-      }
-    }
-    if (await features.getValue("java_network_debugging" /* JavaNetworkDebugging */)) {
-      const existingJavaToolOptions = getOptionalEnvVar("JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */) || "";
-      core21.exportVariable(
-        "JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */,
-        `${existingJavaToolOptions} -Djavax.net.debug=all`
-      );
-    }
-    flushDiagnostics(config);
-    await saveConfig(config, logger);
-    core21.setOutput("codeql-path", config.codeQLCmd);
-    core21.setOutput("codeql-version", (await codeql.getVersion()).version);
-  } catch (unwrappedError) {
-    const error3 = wrapError(unwrappedError);
-    core21.setFailed(error3.message);
-    await sendCompletedStatusReport2(
-      startedAt,
-      config,
-      void 0,
-      // We only report config info on success.
-      toolsInput,
-      toolsDownloadStatusReport,
-      toolsFeatureFlagsValid,
-      toolsSource,
-      toolsVersion,
-      overlayBaseDatabaseStats,
-      dependencyCachingStatus,
-      logger,
-      error3
-    );
-    return;
-  } finally {
-    logUnwrittenDiagnostics();
-  }
-  await sendCompletedStatusReport2(
-    startedAt,
-    config,
-    configFile,
-    toolsInput,
-    toolsDownloadStatusReport,
-    toolsFeatureFlagsValid,
-    toolsSource,
-    toolsVersion,
-    overlayBaseDatabaseStats,
-    dependencyCachingStatus,
-    logger
-  );
-}
-var init = {
-  name: "init" /* Init */,
-  run: run3
-};
-async function runWrapper4() {
-  await runInActions(init);
-  await checkForTimeout();
-}
-
-// src/init-action-post.ts
-var core22 = __toESM(require_core());
-
-// src/init-action-post-helper.ts
-var fs30 = __toESM(require("fs"));
-var import_path8 = __toESM(require("path"));
-var github4 = __toESM(require_github());
-function createFailedUploadFailedSarifResult(error3) {
-  const wrappedError = wrapError(error3);
-  return {
-    upload_failed_run_error: wrappedError.message,
-    upload_failed_run_stack_trace: wrappedError.stack
-  };
-}
-async function prepareFailedSarif(logger, features, config) {
-  if (!config.codeQLCmd) {
-    return new Failure({
-      upload_failed_run_skipped_because: "CodeQL command not found"
-    });
-  }
-  const jobName = getRequiredEnvParam("GITHUB_JOB");
-  const matrix = parseMatrixInput(getRequiredInput("matrix"));
-  if (shouldSkipSarifUpload()) {
-    return new Failure({
-      upload_failed_run_skipped_because: "SARIF upload is disabled"
-    });
-  }
-  if (isRiskAssessmentEnabled(config)) {
-    if (config.languages.length !== 1) {
-      return new Failure({
-        upload_failed_run_skipped_because: "Unexpectedly, the configuration is not for a single language."
-      });
-    }
-    const language = config.languages[0];
-    const category = `/language:${language}`;
-    const checkoutPath = ".";
-    const result = await generateFailedSarif(
-      logger,
-      features,
-      config,
-      category,
-      checkoutPath,
-      `../codeql-failed-sarif-${language}${RiskAssessment.sarifExtension}`
-    );
-    return new Success(result);
-  } else {
-    const workflow = await getWorkflow(logger);
-    const shouldUpload = getUploadInputOrThrow(workflow, jobName, matrix);
-    if (!["always", "failure-only"].includes(
-      getUploadValue(shouldUpload)
-    )) {
-      return new Failure({
-        upload_failed_run_skipped_because: "SARIF upload is disabled"
-      });
-    }
-    const category = getCategoryInputOrThrow(workflow, jobName, matrix);
-    const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix);
-    const result = await generateFailedSarif(
-      logger,
-      features,
-      config,
-      category,
-      checkoutPath
-    );
-    return new Success(result);
-  }
-}
-async function generateFailedSarif(logger, features, config, category, checkoutPath, sarifFile) {
-  const databasePath = config.dbLocation;
-  const codeql = await getCodeQL(logger, config.codeQLCmd);
-  if (sarifFile === void 0) {
-    sarifFile = "../codeql-failed-run.sarif";
-  }
-  if (databasePath === void 0 || !await features.getValue("export_diagnostics_enabled" /* ExportDiagnosticsEnabled */, codeql)) {
-    await codeql.diagnosticsExport(sarifFile, category, config);
-  } else {
-    await codeql.databaseExportDiagnostics(databasePath, sarifFile, category);
-  }
-  return { sarifFile, category, checkoutPath };
-}
-async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) {
-  const failedSarifResult = await prepareFailedSarif(logger, features, config);
-  if (failedSarifResult.isFailure()) {
-    return failedSarifResult.value;
-  }
-  const failedSarif = failedSarifResult.value;
-  logger.info(`Uploading failed SARIF file ${failedSarif.sarifFile}`);
-  const uploadResult = await uploadFiles(
-    failedSarif.sarifFile,
-    failedSarif.checkoutPath,
-    failedSarif.category,
-    features,
-    logger,
-    CodeScanning
-  );
-  await waitForProcessing(
-    repositoryNwo,
-    uploadResult.sarifID,
-    logger,
-    { isUnsuccessfulExecution: true }
-  );
-  return uploadResult ? { ...uploadResult.statusReport, sarifID: uploadResult.sarifID } : {};
-}
-async function maybeUploadFailedSarifArtifact(config, features, logger) {
-  const failedSarifResult = await prepareFailedSarif(logger, features, config);
-  if (failedSarifResult.isFailure()) {
-    return failedSarifResult.value;
-  }
-  const failedSarif = failedSarifResult.value;
-  logger.info(
-    `Uploading failed SARIF file ${failedSarif.sarifFile} as artifact`
-  );
-  const gitHubVersion = await getGitHubVersion();
-  const client = await getArtifactUploaderClient(logger, gitHubVersion.type);
-  const suffix = getArtifactSuffix(getOptionalInput("matrix"));
-  const name = sanitizeArtifactName(`sarif-artifact-${suffix}`);
-  await client.uploadArtifact(
-    name,
-    [import_path8.default.normalize(failedSarif.sarifFile)],
-    import_path8.default.normalize("..")
-  );
-  return { sarifID: name };
-}
-async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger) {
-  if (process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true") {
-    return {
-      upload_failed_run_skipped_because: "Analyze Action completed successfully"
-    };
-  }
-  try {
-    if (isCodeScanningEnabled(config)) {
-      return await maybeUploadFailedSarif(
-        config,
-        repositoryNwo,
-        features,
-        logger
-      );
-    } else if (isRiskAssessmentEnabled(config)) {
-      return await maybeUploadFailedSarifArtifact(config, features, logger);
-    } else {
-      return {
-        upload_failed_run_skipped_because: "No analysis kind that supports failed SARIF uploads is enabled."
-      };
-    }
-  } catch (e) {
-    logger.debug(
-      `Failed to upload a SARIF file for this failed CodeQL code scanning run. ${e}`
-    );
-    return createFailedUploadFailedSarifResult(e);
-  }
-}
-async function uploadFailureInfo(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, config, repositoryNwo, features, logger) {
-  await recordOverlayStatus(codeql, config, features, logger);
-  const uploadFailedSarifResult = await tryUploadSarifIfRunFailed(
-    config,
-    repositoryNwo,
-    features,
-    logger
-  );
-  if (uploadFailedSarifResult.upload_failed_run_skipped_because) {
-    logger.debug(
-      `Won't upload a failed SARIF file for this CodeQL analysis because: ${uploadFailedSarifResult.upload_failed_run_skipped_because}.`
-    );
-  }
-  if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" && !uploadFailedSarifResult.raw_upload_size_bytes) {
-    const error3 = JSON.stringify(uploadFailedSarifResult);
-    throw new Error(
-      `Expected to upload a failed SARIF file for this CodeQL code scanning run, but the result was instead ${error3}.`
-    );
-  }
-  if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
-    if (!github4.context.payload.pull_request?.head.repo.fork) {
-      await removeUploadedSarif(uploadFailedSarifResult, logger);
-    } else {
-      logger.info(
-        "Skipping deletion of failed SARIF because the workflow was triggered from a fork of codeql-action and doesn't have the appropriate permissions for deletion."
-      );
-    }
-  }
-  if (config.debugMode) {
-    logger.info(
-      "Debug mode is on. Uploading available database bundles and logs as Actions debugging artifacts..."
-    );
-    const version = await codeql.getVersion();
-    await uploadAllAvailableDebugArtifacts(
-      codeql,
-      config,
-      logger,
-      version.version
-    );
-    await printDebugLogs2(config);
-  }
-  if (isSelfHostedRunner()) {
-    try {
-      fs30.rmSync(config.dbLocation, {
-        recursive: true,
-        force: true,
-        maxRetries: 3
-      });
-      logger.info(
-        `Cleaned up database cluster directory ${config.dbLocation}.`
-      );
-    } catch (e) {
-      logger.warning(
-        `Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`
-      );
-    }
-  } else {
-    logger.debug(
-      "Skipping cleanup of database cluster directory since we are running on a GitHub-hosted runner which will be automatically cleaned up."
-    );
-  }
-  return uploadFailedSarifResult;
-}
-async function recordOverlayStatus(codeql, config, features, logger) {
-  if (config.overlayDatabaseMode !== "overlay-base" /* OverlayBase */ || process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true" || !await features.getValue("overlay_analysis_status_save" /* OverlayAnalysisStatusSave */)) {
-    return;
-  }
-  const checkRunIdInput = getOptionalInput("check-run-id");
-  const checkRunId = checkRunIdInput !== void 0 ? parseInt(checkRunIdInput, 10) : void 0;
-  const overlayStatus = createOverlayStatus(
-    {
-      attemptedToBuildOverlayBaseDatabase: true,
-      builtOverlayBaseDatabase: false
-    },
-    checkRunId !== void 0 && checkRunId >= 0 ? checkRunId : void 0
-  );
-  const diskUsage = await checkDiskUsage(logger);
-  if (diskUsage === void 0) {
-    logger.warning(
-      "Unable to save overlay status to the Actions cache because the available disk space could not be determined."
-    );
-    return;
-  }
-  const saved = await saveOverlayStatus(
-    codeql,
-    config.languages,
-    diskUsage,
-    overlayStatus,
-    logger
-  );
-  const blurb = "This job attempted to run with improved incremental analysis but it did not complete successfully. One possible reason for this is disk space constraints, since improved incremental analysis can require a significant amount of disk space for some repositories.";
-  if (saved) {
-    logger.error(
-      `${blurb} This failure has been recorded in the Actions cache, so the next CodeQL analysis will run without improved incremental analysis. If you want to enable improved incremental analysis, try increasing the disk space available to the runner. If that doesn't help, contact GitHub Support for further assistance.`
-    );
-  } else {
-    logger.error(
-      `${blurb} The attempt to save this failure status to the Actions cache failed. The Action will attempt to run with improved incremental analysis again.`
-    );
-  }
-}
-async function removeUploadedSarif(uploadFailedSarifResult, logger) {
-  const sarifID = uploadFailedSarifResult.sarifID;
-  if (sarifID) {
-    logger.startGroup("Deleting failed SARIF upload");
-    logger.info(
-      `In test mode, therefore deleting the failed analysis to avoid impacting tool status for the Action repository. SARIF ID to delete: ${sarifID}.`
-    );
-    const client = getApiClient();
-    try {
-      const repositoryNwo = getRepositoryNwo();
-      await delay(5e3);
-      const analysisInfo = await client.request(
-        "GET /repos/:owner/:repo/code-scanning/analyses?sarif_id=:sarif_id",
-        {
-          owner: repositoryNwo.owner,
-          repo: repositoryNwo.repo,
-          sarif_id: sarifID
-        }
-      );
-      if (analysisInfo.data.length === 1) {
-        const analysis = analysisInfo.data[0];
-        logger.info(`Analysis ID to delete: ${analysis.id}.`);
-        try {
-          await client.request(
-            "DELETE /repos/:owner/:repo/code-scanning/analyses/:analysis_id?confirm_delete",
-            {
-              owner: repositoryNwo.owner,
-              repo: repositoryNwo.repo,
-              analysis_id: analysis.id
-            }
-          );
-          logger.info(`Analysis deleted.`);
-        } catch (e) {
-          const origMessage = getErrorMessage(e);
-          const newMessage = origMessage.includes(
-            "No analysis found for analysis ID"
-          ) ? `Analysis ${analysis.id} does not exist. It was likely already deleted.` : origMessage;
-          throw new Error(newMessage);
-        }
-      } else {
-        throw new Error(
-          `Expected to find exactly one analysis with sarif_id ${sarifID}. Found ${analysisInfo.data.length}.`
-        );
-      }
-    } catch (e) {
-      throw new Error(
-        `Failed to delete uploaded SARIF analysis. Reason: ${getErrorMessage(
-          e
-        )}`
-      );
-    } finally {
-      logger.endGroup();
-    }
-  } else {
-    logger.warning(
-      "Could not delete the uploaded SARIF analysis because a SARIF ID wasn't provided by the API when uploading the SARIF file."
-    );
-  }
-}
-
-// src/init-action-post.ts
-async function run4(startedAt) {
-  const logger = getActionsLogger();
-  let config;
-  let uploadFailedSarifResult;
-  let dependencyCachingUsage;
-  try {
-    restoreInputs();
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    const repositoryNwo = getRepositoryNwo();
-    const features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger
-    );
-    config = await getConfig(getTemporaryDirectory(), logger);
-    if (config === void 0) {
-      logger.warning(
-        "Debugging artifacts are unavailable since the 'init' Action failed before it could produce any."
-      );
-    } else {
-      const codeql = await getCodeQL(logger, config.codeQLCmd);
-      uploadFailedSarifResult = await uploadFailureInfo(
-        tryUploadAllAvailableDebugArtifacts,
-        printDebugLogs,
-        codeql,
-        config,
-        repositoryNwo,
-        features,
-        logger
-      );
-      if (await isAnalyzingDefaultBranch() && config.dependencyCachingEnabled !== "none" /* None */) {
-        dependencyCachingUsage = await getDependencyCacheUsage(logger);
-      }
-    }
-  } catch (unwrappedError) {
-    const error3 = wrapError(unwrappedError);
-    core22.setFailed(error3.message);
-    const statusReportBase2 = await createStatusReportBase(
-      "init-post" /* InitPost */,
-      getActionsStatus(error3),
-      startedAt,
-      config,
-      await checkDiskUsage(logger),
-      logger,
-      error3.message,
-      error3.stack
-    );
-    if (statusReportBase2 !== void 0) {
-      await sendStatusReport(statusReportBase2);
-    }
-    return;
-  }
-  const jobStatus = getFinalJobStatus(config);
-  logger.info(`CodeQL job status was ${getJobStatusDisplayName(jobStatus)}.`);
-  const statusReportBase = await createStatusReportBase(
-    "init-post" /* InitPost */,
-    "success",
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger
-  );
-  if (statusReportBase !== void 0) {
-    const statusReport = {
-      ...statusReportBase,
-      ...uploadFailedSarifResult,
-      job_status: jobStatus,
-      dependency_caching_usage: dependencyCachingUsage
-    };
-    logger.info("Sending status report for init-post step.");
-    await sendStatusReport(statusReport);
-    logger.info("Status report sent for init-post step.");
-  }
-}
-function getFinalJobStatus(config) {
-  const existingJobStatus = getJobStatusFromEnvironment();
-  if (existingJobStatus !== void 0) {
-    return existingJobStatus;
-  }
-  let jobStatus;
-  if (process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true") {
-    core22.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, "JOB_STATUS_SUCCESS" /* SuccessStatus */);
-    jobStatus = "JOB_STATUS_SUCCESS" /* SuccessStatus */;
-  } else if (config !== void 0) {
-    jobStatus = "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */;
-  } else {
-    jobStatus = "JOB_STATUS_UNKNOWN" /* UnknownStatus */;
-  }
-  core22.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, jobStatus);
-  return jobStatus;
-}
-function getJobStatusFromEnvironment() {
-  const jobStatusFromEnvironment = process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */];
-  if (jobStatusFromEnvironment !== void 0) {
-    if (Object.values(JobStatus).includes(jobStatusFromEnvironment)) {
-      return jobStatusFromEnvironment;
-    }
-    return "JOB_STATUS_UNKNOWN" /* UnknownStatus */;
-  }
-  return void 0;
-}
-async function runWrapper5() {
-  const startedAt = /* @__PURE__ */ new Date();
-  const logger = getActionsLogger();
-  try {
-    await run4(startedAt);
-  } catch (error3) {
-    core22.setFailed(`init post action failed: ${wrapError(error3).message}`);
-    await sendUnhandledErrorStatusReport(
-      "init-post" /* InitPost */,
-      startedAt,
-      error3,
-      logger
-    );
-  }
-}
-
-// src/resolve-environment-action.ts
-var core23 = __toESM(require_core());
-
-// src/resolve-environment.ts
-async function runResolveBuildEnvironment(cmd, logger, workingDir, language) {
-  logger.startGroup(`Attempting to resolve build environment for ${language}`);
-  const codeql = await getCodeQL(logger, cmd);
-  if (workingDir !== void 0) {
-    logger.info(`Using ${workingDir} as the working directory.`);
-  }
-  const result = await codeql.resolveBuildEnvironment(workingDir, language);
-  logger.endGroup();
-  return result;
-}
-
-// src/resolve-environment-action.ts
-var ENVIRONMENT_OUTPUT_NAME = "environment";
-async function run5(startedAt) {
-  const logger = getActionsLogger();
-  let config;
-  try {
-    const statusReportBase2 = await createStatusReportBase(
-      "resolve-environment" /* ResolveEnvironment */,
-      "starting",
-      startedAt,
-      config,
-      await checkDiskUsage(logger),
-      logger
-    );
-    if (statusReportBase2 !== void 0) {
-      await sendStatusReport(statusReportBase2);
-    }
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    checkActionVersion(getActionVersion(), gitHubVersion);
-    config = await getConfig(getTemporaryDirectory(), logger);
-    if (config === void 0) {
-      throw new ConfigurationError(
-        "Config file could not be found at expected location. Has the 'init' action been called?"
-      );
-    }
-    const workingDirectory = getOptionalInput("working-directory");
-    const result = await runResolveBuildEnvironment(
-      config.codeQLCmd,
-      logger,
-      workingDirectory,
-      getRequiredInput("language")
-    );
-    core23.setOutput(ENVIRONMENT_OUTPUT_NAME, result);
-  } catch (unwrappedError) {
-    const error3 = wrapError(unwrappedError);
-    if (error3 instanceof CliError) {
-      core23.setOutput(ENVIRONMENT_OUTPUT_NAME, {});
-      logger.warning(
-        `Failed to resolve a build environment suitable for automatically building your code. ${error3.message}`
-      );
-    } else {
-      core23.setFailed(
-        `Failed to resolve a build environment suitable for automatically building your code. ${error3.message}`
-      );
-      const statusReportBase2 = await createStatusReportBase(
-        "resolve-environment" /* ResolveEnvironment */,
-        getActionsStatus(error3),
-        startedAt,
-        config,
-        await checkDiskUsage(logger),
-        logger,
-        error3.message,
-        error3.stack
-      );
-      if (statusReportBase2 !== void 0) {
-        await sendStatusReport(statusReportBase2);
-      }
-    }
-    return;
-  }
-  const statusReportBase = await createStatusReportBase(
-    "resolve-environment" /* ResolveEnvironment */,
-    "success",
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger
-  );
-  if (statusReportBase !== void 0) {
-    await sendStatusReport(statusReportBase);
-  }
-}
-async function runWrapper6() {
-  const startedAt = /* @__PURE__ */ new Date();
-  const logger = getActionsLogger();
-  try {
-    await run5(startedAt);
-  } catch (error3) {
-    core23.setFailed(
-      `${"resolve-environment" /* ResolveEnvironment */} action failed: ${getErrorMessage(
-        error3
-      )}`
-    );
-    await sendUnhandledErrorStatusReport(
-      "resolve-environment" /* ResolveEnvironment */,
-      startedAt,
-      error3,
-      logger
-    );
-  }
-  await checkForTimeout();
-}
-
-// src/setup-codeql-action.ts
-var core24 = __toESM(require_core());
-async function sendCompletedStatusReport3(startedAt, toolsInput, toolsDownloadStatusReport, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger, error3) {
-  const statusReportBase = await createStatusReportBase(
-    "setup-codeql" /* SetupCodeQL */,
-    getActionsStatus(error3),
-    startedAt,
-    void 0,
-    await checkDiskUsage(logger),
-    logger,
-    error3?.message,
-    error3?.stack
-  );
-  if (statusReportBase === void 0) {
-    return;
-  }
-  const initStatusReport = {
-    ...statusReportBase,
-    tools_input: toolsInput?.value || "",
-    tools_resolved_version: toolsVersion,
-    tools_source: toolsSource || "UNKNOWN" /* Unknown */,
-    workflow_languages: ""
-  };
-  if (toolsInput !== void 0) {
-    initStatusReport.computed_inputs.tools = toolsInput;
-  }
-  const initToolsDownloadFields = {};
-  if (toolsDownloadStatusReport?.downloadDurationMs !== void 0) {
-    initToolsDownloadFields.tools_download_duration_ms = toolsDownloadStatusReport.downloadDurationMs;
-  }
-  if (toolsFeatureFlagsValid !== void 0) {
-    initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
-  }
-  await sendStatusReport({ ...initStatusReport, ...initToolsDownloadFields });
-}
-async function run6(actionState) {
-  const { logger, startedAt } = actionState;
-  let codeql;
-  let toolsInput;
-  let toolsDownloadStatusReport;
-  let toolsFeatureFlagsValid;
-  let toolsSource;
-  let toolsVersion;
-  try {
-    initializeEnvironment(getActionVersion());
-    const apiDetails = {
-      auth: getRequiredInput("token"),
-      externalRepoAuth: getOptionalInput("external-repository-token"),
-      url: getRequiredEnvParam("GITHUB_SERVER_URL"),
-      apiURL: getRequiredEnvParam("GITHUB_API_URL")
-    };
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    checkActionVersion(getActionVersion(), gitHubVersion);
-    const repositoryNwo = getRepositoryNwo();
-    const features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger
-    );
-    const repositoryPropertiesResult = await loadRepositoryProperties(
-      repositoryNwo,
-      logger
-    );
-    const repositoryProperties = repositoryPropertiesResult.orElse({});
-    const actionStateWithFeatures = { ...actionState, features };
-    const statusReportBase = await createStatusReportBase(
-      "setup-codeql" /* SetupCodeQL */,
-      "starting",
-      startedAt,
-      void 0,
-      await checkDiskUsage(logger),
-      logger
-    );
-    if (statusReportBase !== void 0) {
-      await sendStatusReport(statusReportBase);
-    }
-    toolsInput = await getToolsInput(
-      actionStateWithFeatures,
-      repositoryProperties
-    );
-    const codeQLDefaultVersionInfo = await features.getEnabledDefaultCliVersions(gitHubVersion.type);
-    toolsFeatureFlagsValid = codeQLDefaultVersionInfo.toolsFeatureFlagsValid;
-    const rawLanguages = getRawLanguagesNoAutodetect(
-      getOptionalInput("languages")
-    );
-    const analysisKinds = await getAnalysisKinds(logger, features);
-    const initCodeQLResult = await initCodeQL(
-      toolsInput?.value,
-      apiDetails,
-      getTemporaryDirectory(),
-      gitHubVersion.type,
-      codeQLDefaultVersionInfo,
-      rawLanguages,
-      analysisKinds.length === 1 && analysisKinds[0] === "code-scanning" /* CodeScanning */,
-      features,
-      logger
-    );
-    codeql = initCodeQLResult.codeql;
-    toolsDownloadStatusReport = initCodeQLResult.toolsDownloadStatusReport;
-    toolsVersion = initCodeQLResult.toolsVersion;
-    toolsSource = initCodeQLResult.toolsSource;
-    core24.setOutput("codeql-path", codeql.getPath());
-    core24.setOutput("codeql-version", (await codeql.getVersion()).version);
-    core24.exportVariable("CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */, "true");
-  } catch (unwrappedError) {
-    const error3 = wrapError(unwrappedError);
-    core24.setFailed(error3.message);
-    const statusReportBase = await createStatusReportBase(
-      "setup-codeql" /* SetupCodeQL */,
-      error3 instanceof ConfigurationError ? "user-error" : "failure",
-      startedAt,
-      void 0,
-      await checkDiskUsage(logger),
-      logger,
-      error3.message,
-      error3.stack
-    );
-    if (statusReportBase !== void 0) {
-      await sendStatusReport(statusReportBase);
-    }
-    return;
-  }
-  await sendCompletedStatusReport3(
-    startedAt,
-    toolsInput,
-    toolsDownloadStatusReport,
-    toolsFeatureFlagsValid,
-    toolsSource,
-    toolsVersion,
-    logger
-  );
-}
-var setupCodeQL2 = {
-  name: "setup-codeql" /* SetupCodeQL */,
-  run: run6
-};
-async function runWrapper7() {
-  await runInActions(setupCodeQL2);
-  await checkForTimeout();
-}
-
-// src/start-proxy-action.ts
-var import_child_process2 = require("child_process");
-var path29 = __toESM(require("path"));
-var core27 = __toESM(require_core());
-
-// src/start-proxy.ts
-var path27 = __toESM(require("path"));
-var core26 = __toESM(require_core());
-var toolcache4 = __toESM(require_tool_cache());
-
-// src/start-proxy/validation.ts
-var core25 = __toESM(require_core());
-function cloneCredential(schema, obj) {
-  const result = {};
-  for (const key of Object.keys(schema)) {
-    if (!isDefined2(obj[key])) {
-      continue;
-    }
-    result[key] = obj[key];
-  }
-  return result;
-}
-function getAuthConfig(config) {
-  for (const oidcSchema of oidcSchemas) {
-    if (validateSchema(oidcSchema.schema, config)) {
-      return cloneCredential(oidcSchema.schema, config);
-    }
-  }
-  if (isToken(config)) {
-    if (isDefined2(config.token)) {
-      core25.setSecret(config.token);
-    }
-    return cloneCredential(tokenSchema, config);
-  } else {
-    let username = void 0;
-    let password = void 0;
-    if ("password" in config && isString(config.password)) {
-      core25.setSecret(config.password);
-      password = config.password;
-    }
-    if ("username" in config && isString(config.username)) {
-      username = config.username;
-    }
-    return {
-      username,
-      password
-    };
-  }
-}
-
-// src/start-proxy.ts
-function getStartProxyErrorMessage(errorType) {
-  switch (errorType) {
-    case 0 /* DownloadFailed */:
-      return "Failed to download proxy archive.";
-    case 1 /* ExtractionFailed */:
-      return "Failed to extract proxy archive.";
-    case 2 /* CacheFailed */:
-      return "Failed to add proxy to toolcache";
-  }
-}
-var StartProxyError = class extends Error {
-  errorType;
-  constructor(errorType) {
-    super();
-    this.errorType = errorType;
-  }
-};
-async function sendSuccessStatusReport(startedAt, config, registry_types, logger) {
-  const statusReportBase = await createStatusReportBase(
-    "start-proxy" /* StartProxy */,
-    "success",
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger
-  );
-  if (statusReportBase !== void 0) {
-    const statusReport = {
-      ...statusReportBase,
-      registry_types: registry_types.join(",")
-    };
-    await sendStatusReport(statusReport);
-  }
-}
-function getSafeErrorMessage(error3) {
-  if (error3 instanceof StartProxyError) {
-    return getStartProxyErrorMessage(error3.errorType);
-  }
-  return `Error from start-proxy Action omitted (${error3.constructor.name}).`;
-}
-async function sendFailedStatusReport(logger, startedAt, language, unwrappedError) {
-  const error3 = wrapError(unwrappedError);
-  core26.setFailed(`start-proxy action failed: ${error3.message}`);
-  const statusReportMessage = getSafeErrorMessage(error3);
-  const errorStatusReportBase = await createStatusReportBase(
-    "start-proxy" /* StartProxy */,
-    getActionsStatus(error3),
-    startedAt,
-    {
-      languages: language === void 0 ? void 0 : [language]
-    },
-    await checkDiskUsage(logger),
-    logger,
-    statusReportMessage
-  );
-  if (errorStatusReportBase !== void 0) {
-    await sendStatusReport(errorStatusReportBase);
-  }
-}
-var UPDATEJOB_PROXY = "update-job-proxy";
-var UPDATEJOB_PROXY_VERSION = "v2.0.20250624110901";
-var UPDATEJOB_PROXY_URL_PREFIX = "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.22.0/";
-function isPAT(value) {
-  return isAuthToken(value, [
-    GITHUB_PAT_CLASSIC_PATTERN,
-    GITHUB_PAT_FINE_GRAINED_PATTERN
-  ]);
-}
-var ALWAYS_ENABLED_REGISTRY_TYPE = [
-  "git_source",
-  "docker_registry"
-];
-var LANGUAGE_TO_REGISTRY_TYPE = {
-  actions: [],
-  cpp: [],
-  java: ["maven_repository"],
-  csharp: ["nuget_feed"],
-  javascript: [],
-  python: [],
-  ruby: [],
-  rust: [],
-  swift: [],
-  go: ["goproxy_server", "git_source"]
-};
-function getRegistryAddress(registry) {
-  if (isDefined2(registry.url) && isString(registry.url) && isStringOrUndefined(registry.host)) {
-    return {
-      url: registry.url,
-      host: registry.host
-    };
-  } else if (isDefined2(registry.host) && isString(registry.host)) {
-    return {
-      url: void 0,
-      host: registry.host
-    };
-  } else {
-    throw new ConfigurationError(
-      "Invalid credentials - must specify host or url"
-    );
-  }
-}
-function getCredentials(logger, registrySecrets, registriesCredentials, language) {
-  const registryTypeForLanguage = language ? LANGUAGE_TO_REGISTRY_TYPE[language] : void 0;
-  let credentialsStr;
-  if (registriesCredentials !== void 0) {
-    logger.info(`Using registries_credentials input.`);
-    credentialsStr = Buffer.from(registriesCredentials, "base64").toString();
-  } else if (registrySecrets !== void 0) {
-    logger.info(`Using registry_secrets input.`);
-    credentialsStr = registrySecrets;
-  } else {
-    logger.info(`No credentials defined.`);
-    return [];
-  }
-  let parsed;
-  try {
-    parsed = parseString(credentialsStr);
-  } catch {
-    logger.error("Failed to parse the credentials data.");
-    throw new ConfigurationError("Invalid credentials format.");
-  }
-  if (!isArray(parsed)) {
-    throw new ConfigurationError(
-      "Expected credentials data to be an array of configurations, but it is not."
-    );
-  }
-  const out = [];
-  for (const e of parsed) {
-    if (e === null || !isObject(e)) {
-      throw new ConfigurationError("Invalid credentials - must be an object");
-    }
-    if (!isDefined2(e.type) || !isString(e.type)) {
-      throw new ConfigurationError("Invalid credentials - must have a type");
-    }
-    const authConfig = getAuthConfig(e);
-    const address = getRegistryAddress(e);
-    if (!ALWAYS_ENABLED_REGISTRY_TYPE.some((t) => t === e.type) && registryTypeForLanguage && !registryTypeForLanguage.some((t) => t === e.type)) {
-      continue;
-    }
-    const isPrintable2 = (str) => {
-      return str ? /^[\x20-\x7E]*$/.test(str) : true;
-    };
-    for (const key of Object.keys(e)) {
-      const val = e[key];
-      if (typeof val === "string" && !isPrintable2(val)) {
-        throw new ConfigurationError(
-          "Invalid credentials - fields must contain only printable characters"
-        );
-      }
-    }
-    const noUsername = !hasUsername(authConfig) || !isDefined2(authConfig.username);
-    const passwordIsPAT = hasUsernameAndPassword(authConfig) && isDefined2(authConfig.password) && isPAT(authConfig.password);
-    const tokenIsPAT = hasToken(authConfig) && isDefined2(authConfig.token) && isPAT(authConfig.token);
-    if (noUsername && (passwordIsPAT || tokenIsPAT)) {
-      logger.warning(
-        `A ${e.type} private registry is configured for ${e.host || e.url} using a GitHub Personal Access Token (PAT), but no username was provided. This may not work correctly. When configuring a private registry using a PAT, select "Username and password" and enter the username of the user who generated the PAT.`
-      );
-    }
-    const baseCredential = { type: e.type };
-    if ("replaces-base" in e) {
-      if (isDefined2(e["replaces-base"]) && typeof e["replaces-base"] === "boolean") {
-        baseCredential["replaces-base"] = e["replaces-base"];
-      } else {
-        throw new ConfigurationError(
-          "Invalid credentials - 'replaces-base' must be a boolean"
-        );
-      }
-    }
-    out.push({
-      ...baseCredential,
-      ...authConfig,
-      ...address
-    });
-  }
-  return out;
-}
-function getProxyPackage() {
-  const platform2 = process.platform === "win32" ? "win64" : process.platform === "darwin" ? "osx64" : "linux64";
-  return `${UPDATEJOB_PROXY}-${platform2}.tar.gz`;
-}
-function getFallbackUrl(proxyPackage) {
-  return `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`;
-}
-async function getReleaseByVersion(version) {
-  return getApiClient().rest.repos.getReleaseByTag({
-    owner: "github",
-    repo: "codeql-action",
-    tag: version
-  });
-}
-async function getCliVersionFromFeatures(features) {
-  const gitHubVersion = await getGitHubVersion();
-  return await features.getEnabledDefaultCliVersions(gitHubVersion.type);
-}
-async function getDownloadUrl(logger, features) {
-  const proxyPackage = getProxyPackage();
-  try {
-    const useFeaturesToDetermineCLI = await features.getValue(
-      "start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */
-    );
-    const versionInfo = useFeaturesToDetermineCLI ? (await getCliVersionFromFeatures(features)).enabledVersions[0] : {
-      cliVersion,
-      tagName: bundleVersion
-    };
-    const cliRelease = await getReleaseByVersion(versionInfo.tagName);
-    for (const asset of cliRelease.data.assets) {
-      if (asset.name === proxyPackage) {
-        logger.info(
-          `Found '${proxyPackage}' in release '${versionInfo.tagName}' at '${asset.url}'`
-        );
-        return {
-          url: asset.url,
-          // The `update-job-proxy` doesn't have a version as such. Since we now bundle it
-          // with CodeQL CLI bundle releases, we use the corresponding CLI version to
-          // differentiate between (potentially) different versions of `update-job-proxy`.
-          version: versionInfo.cliVersion
-        };
-      }
-    }
-  } catch (ex) {
-    logger.warning(
-      `Failed to retrieve information about the linked release: ${getErrorMessage(ex)}`
-    );
-  }
-  logger.info(
-    `Did not find '${proxyPackage}' in the linked release, falling back to hard-coded version.`
-  );
-  return {
-    url: getFallbackUrl(proxyPackage),
-    version: UPDATEJOB_PROXY_VERSION
-  };
-}
-async function downloadProxy(logger, url2, authorization) {
-  try {
-    return toolcache4.downloadTool(
-      url2,
-      /* dest: */
-      void 0,
-      authorization,
-      {
-        accept: "application/octet-stream"
-      }
-    );
-  } catch (error3) {
-    logger.error(
-      `Failed to download proxy archive from ${url2}: ${getErrorMessage(error3)}`
-    );
-    throw new StartProxyError(0 /* DownloadFailed */);
-  }
-}
-async function extractProxy(logger, archive) {
-  try {
-    return await toolcache4.extractTar(archive);
-  } catch (error3) {
-    logger.error(
-      `Failed to extract proxy archive from ${archive}: ${getErrorMessage(error3)}`
-    );
-    throw new StartProxyError(1 /* ExtractionFailed */);
-  }
-}
-async function cacheProxy(logger, source, filename, version) {
-  try {
-    return await toolcache4.cacheDir(source, filename, version);
-  } catch (error3) {
-    logger.error(
-      `Failed to add proxy archive from ${source} to toolcache: ${getErrorMessage(error3)}`
-    );
-    throw new StartProxyError(2 /* CacheFailed */);
-  }
-}
-function getProxyFilename() {
-  return process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY;
-}
-async function getProxyBinaryPath(logger, features) {
-  const proxyFileName = getProxyFilename();
-  const proxyInfo = await getDownloadUrl(logger, features);
-  let proxyBin = toolcache4.find(proxyFileName, proxyInfo.version);
-  if (!proxyBin) {
-    const apiDetails = getApiDetails();
-    const authorization = getAuthorizationHeaderFor(
-      logger,
-      apiDetails,
-      proxyInfo.url
-    );
-    const temp = await downloadProxy(logger, proxyInfo.url, authorization);
-    const extracted = await extractProxy(logger, temp);
-    proxyBin = await cacheProxy(
-      logger,
-      extracted,
-      proxyFileName,
-      proxyInfo.version
-    );
-  }
-  return path27.join(proxyBin, proxyFileName);
-}
-
-// src/start-proxy/ca.ts
-var import_node_forge = __toESM(require_lib6());
-var KEY_SIZE = 2048;
-var KEY_EXPIRY_YEARS = 2;
-var CERT_SUBJECT = [
-  {
-    name: "commonName",
-    value: "Dependabot Internal CA"
-  },
-  {
-    name: "organizationName",
-    value: "GitHub inc."
-  },
-  {
-    shortName: "OU",
-    value: "Dependabot"
-  },
-  {
-    name: "countryName",
-    value: "US"
-  },
-  {
-    shortName: "ST",
-    value: "California"
-  },
-  {
-    name: "localityName",
-    value: "San Francisco"
-  }
-];
-var allExtensions = [
-  { name: "basicConstraints", cA: true },
-  {
-    name: "keyUsage",
-    critical: true,
-    keyCertSign: true,
-    cRLSign: true,
-    digitalSignature: true
-  },
-  { name: "subjectKeyIdentifier" },
-  { name: "authorityKeyIdentifier", keyIdentifier: true }
-];
-function generateCertificateAuthority() {
-  const keys = import_node_forge.pki.rsa.generateKeyPair(KEY_SIZE);
-  const cert = import_node_forge.pki.createCertificate();
-  cert.publicKey = keys.publicKey;
-  cert.serialNumber = "01";
-  cert.validity.notBefore = /* @__PURE__ */ new Date();
-  cert.validity.notAfter = /* @__PURE__ */ new Date();
-  cert.validity.notAfter.setFullYear(
-    cert.validity.notBefore.getFullYear() + KEY_EXPIRY_YEARS
-  );
-  cert.setSubject(CERT_SUBJECT);
-  cert.setIssuer(CERT_SUBJECT);
-  cert.setExtensions(allExtensions);
-  cert.sign(keys.privateKey, import_node_forge.md.sha256.create());
-  const pem = import_node_forge.pki.certificateToPem(cert);
-  const key = import_node_forge.pki.privateKeyToPem(keys.privateKey);
-  return { cert: pem, key };
-}
-
-// src/start-proxy/environment.ts
-var fs31 = __toESM(require("fs"));
-var path28 = __toESM(require("path"));
-var toolrunner5 = __toESM(require_toolrunner());
-var io8 = __toESM(require_io());
-function checkEnvVar(logger, name) {
-  const value = process.env[name];
-  if (isDefined2(value)) {
-    const url2 = URL.parse(value);
-    if (isDefined2(url2)) {
-      url2.username = "";
-      url2.password = "";
-      logger.info(`Environment variable '${name}' is set to '${url2}'.`);
-    } else {
-      logger.info(`Environment variable '${name}' is set to '${value}'.`);
-    }
-    return true;
-  } else {
-    logger.debug(`Environment variable '${name}' is not set.`);
-    return false;
-  }
-}
-var javaProperties = [
-  "http.proxyHost",
-  "http.proxyPort",
-  "https.proxyHost",
-  "https.proxyPort",
-  "http.nonProxyHosts",
-  "java.net.useSystemProxies",
-  "javax.net.ssl.trustStore",
-  "javax.net.ssl.trustStoreType",
-  "javax.net.ssl.trustStoreProvider",
-  "jdk.tls.client.protocols",
-  "jdk.tls.disabledAlgorithms",
-  "jdk.security.allowNonCaAnchor",
-  "https.protocols",
-  "com.sun.net.ssl.enableAIAcaIssuers",
-  "com.sun.net.ssl.checkRevocation",
-  "com.sun.security.enableCRLDP",
-  "ocsp.enable"
-];
-var JAVA_PROXY_ENV_VARS = [
-  "JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */,
-  "JDK_JAVA_OPTIONS" /* JDK_JAVA_OPTIONS */,
-  "_JAVA_OPTIONS" /* _JAVA_OPTIONS */
-];
-function checkJavaEnvVars(logger) {
-  for (const envVar of JAVA_PROXY_ENV_VARS) {
-    checkEnvVar(logger, envVar);
-  }
-}
-function discoverActionsJdks() {
-  const paths = /* @__PURE__ */ new Set();
-  const javaHome = process.env["JAVA_HOME" /* JAVA_HOME */];
-  if (isDefined2(javaHome)) {
-    paths.add(javaHome);
-  }
-  for (const [envVar, value] of Object.entries(process.env)) {
-    if (isDefined2(value) && envVar.match(/^JAVA_HOME_\d+_/)) {
-      paths.add(value);
-    }
-  }
-  return paths;
-}
-function checkJdkSettings(logger, jdkHome) {
-  const filesToCheck = [
-    // JDK 9+
-    path28.join("conf", "net.properties"),
-    // JDK 8 and below
-    path28.join("lib", "net.properties")
-  ];
-  for (const fileToCheck of filesToCheck) {
-    const file = path28.join(jdkHome, fileToCheck);
-    try {
-      if (fs31.existsSync(file)) {
-        logger.debug(`Found '${file}'.`);
-        const lines = String(fs31.readFileSync(file)).split("\n");
-        for (const line of lines) {
-          for (const property of javaProperties) {
-            if (line.startsWith(`${property}=`)) {
-              logger.info(`Found '${line.trimEnd()}' in '${file}'.`);
-            }
-          }
-        }
-      } else {
-        logger.debug(`'${file}' does not exist.`);
-      }
-    } catch (err) {
-      logger.debug(`Failed to read '${file}': ${getErrorMessage(err)}`);
-    }
-  }
-}
-async function showJavaSettings(logger) {
-  try {
-    const java = await io8.which("java", true);
-    let output = "";
-    await new toolrunner5.ToolRunner(
-      java,
-      ["-XshowSettings:all", "-XshowSettings:security:all", "-version"],
-      {
-        silent: true,
-        listeners: {
-          stdout: (data) => {
-            output += String(data);
-          },
-          stderr: (data) => {
-            output += String(data);
-          }
-        }
-      }
-    ).exec();
-    logger.startGroup("Java settings");
-    logger.info(output);
-    logger.endGroup();
-  } catch (err) {
-    logger.debug(`Failed to query java settings: ${getErrorMessage(err)}`);
-  }
-}
-var ProxyEnvVars = /* @__PURE__ */ ((ProxyEnvVars2) => {
-  ProxyEnvVars2["HTTP_PROXY"] = "HTTP_PROXY";
-  ProxyEnvVars2["HTTPS_PROXY"] = "HTTPS_PROXY";
-  ProxyEnvVars2["ALL_PROXY"] = "ALL_PROXY";
-  return ProxyEnvVars2;
-})(ProxyEnvVars || {});
-function checkProxyEnvVars(logger) {
-  for (const envVar of Object.values(ProxyEnvVars)) {
-    checkEnvVar(logger, envVar);
-    checkEnvVar(logger, envVar.toLowerCase());
-  }
-}
-async function checkProxyEnvironment(logger, language) {
-  checkProxyEnvVars(logger);
-  if (language === void 0 || language === "java" /* java */) {
-    checkJavaEnvVars(logger);
-    await showJavaSettings(logger);
-    const jdks = discoverActionsJdks();
-    for (const jdk of jdks) {
-      checkJdkSettings(logger, jdk);
-    }
-  }
-}
-
-// src/start-proxy/reachability.ts
-var https2 = __toESM(require("https"));
-var import_https_proxy_agent = __toESM(require_dist3());
-var connectionTestConfig = {
-  nuget_feed: { path: "v3/index.json" }
-};
-function makeTestUrl(config, base) {
-  if (config?.path === void 0) {
-    return base;
-  }
-  if (base.pathname.endsWith(config.path)) {
-    return base;
-  }
-  return new URL(config.path, base);
-}
-var ReachabilityError = class extends Error {
-  constructor(statusCode) {
-    super();
-    this.statusCode = statusCode;
-  }
-  statusCode;
-};
-var NetworkReachabilityBackend = class {
-  constructor(proxy) {
-    this.proxy = proxy;
-    this.agent = new import_https_proxy_agent.HttpsProxyAgent(`http://${proxy.host}:${proxy.port}`);
-  }
-  proxy;
-  agent;
-  async checkConnection(url2) {
-    return new Promise((resolve14, reject) => {
-      const req = https2.request(
-        url2,
-        {
-          agent: this.agent,
-          method: "GET",
-          ca: this.proxy.cert,
-          timeout: 5 * 1e3
-          // 5 seconds
-        },
-        (res) => {
-          res.destroy();
-          if (res.statusCode !== void 0 && res.statusCode < 400) {
-            resolve14(res.statusCode);
-          } else {
-            reject(new ReachabilityError(res.statusCode));
-          }
-        }
-      );
-      req.on("error", (e) => {
-        reject(e);
-      });
-      req.on("timeout", () => {
-        req.destroy();
-        reject(new Error("Connection timeout."));
-      });
-      req.end();
-    });
-  }
-};
-async function checkConnections(logger, proxy, backend) {
-  const result = /* @__PURE__ */ new Set();
-  if (proxy.registries.length === 0) return result;
-  logger.startGroup("Testing connections via the proxy");
-  logger.info(
-    `The connection tests performed here are best-effort only and failures here may not affect the subsequent analysis. See ${"https://docs.github.com/en/code-security/reference/code-scanning/code-scanning-logs#diagnostic-information-for-private-package-registries" /* PRIVATE_REGISTRY_LOGS */} for more information.`
-  );
-  try {
-    if (backend === void 0) {
-      backend = new NetworkReachabilityBackend(proxy);
-    }
-    for (const registry of proxy.registries) {
-      const config = connectionTestConfig[registry.type];
-      const address = getAddressString(registry);
-      const url2 = URL.parse(address);
-      if (url2 === null) {
-        logger.info(
-          `Skipping check for ${address} since it is not a valid URL.`
-        );
-        continue;
-      }
-      const testUrl = makeTestUrl(config, url2);
-      try {
-        logger.debug(`Testing connection to ${url2}...`);
-        const statusCode = await backend.checkConnection(testUrl);
-        logger.info(`Successfully tested connection to ${url2} (${statusCode})`);
-        result.add(registry);
-      } catch (e) {
-        if (e instanceof ReachabilityError && e.statusCode !== void 0) {
-          logger.info(`Connection test to ${url2} failed. (${e.statusCode})`);
-        } else {
-          logger.warning(
-            `Connection test to ${url2} failed: ${getErrorMessage(e)}`
-          );
-        }
-      }
-    }
-    logger.debug(`Finished testing connections to private registries.`);
-  } catch (e) {
-    logger.warning(
-      `Failed to test connections to private registries: ${getErrorMessage(e)}`
-    );
-  }
-  logger.endGroup();
-  return result;
-}
-
-// src/start-proxy-action.ts
-async function run7(action) {
-  const startedAt = action.startedAt;
-  const logger = action.logger;
-  let features;
-  let language;
-  try {
-    persistInputs();
-    const tempDir = getTemporaryDirectory();
-    const proxyLogFilePath = path29.resolve(tempDir, "proxy.log");
-    core27.saveState("proxy-log-file", proxyLogFilePath);
-    const repositoryNwo = getRepositoryNwo();
-    const gitHubVersion = await getGitHubVersion();
-    features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger
-    );
-    const languageInput = getOptionalInput("language");
-    language = languageInput ? parseBuiltInLanguage(languageInput) : void 0;
-    const credentials = getCredentials(
-      logger,
-      getOptionalInput("registry_secrets"),
-      getOptionalInput("registries_credentials"),
-      language
-    );
-    if (credentials.length === 0) {
-      logger.info("No credentials found, skipping proxy setup.");
-      return;
-    }
-    logger.info(
-      `Credentials loaded for the following registries:
- ${credentials.map((c) => credentialToStr(c)).join("\n")}`
-    );
-    if (core27.isDebug() || isInTestMode()) {
-      try {
-        await checkProxyEnvironment(logger, language);
-      } catch (err) {
-        logger.debug(
-          `Unable to inspect runner environment: ${getErrorMessage(err)}`
-        );
-      }
-    }
-    const ca = generateCertificateAuthority();
-    const proxyConfig = {
-      all_credentials: credentials,
-      ca
-    };
-    const proxyBin = await getProxyBinaryPath(logger, features);
-    const proxyInfo = await startProxy(
-      proxyBin,
-      proxyConfig,
-      proxyLogFilePath,
-      logger
-    );
-    await checkConnections(logger, proxyInfo);
-    await sendSuccessStatusReport(
-      startedAt,
-      {
-        languages: language === void 0 ? void 0 : [language]
-      },
-      proxyConfig.all_credentials.map((c) => c.type),
-      logger
-    );
-  } catch (unwrappedError) {
-    await sendFailedStatusReport(logger, startedAt, language, unwrappedError);
-  }
-}
-var startProxyAction = {
-  name: "start-proxy" /* StartProxy */,
-  run: run7,
-  transformTelemetryError: getSafeErrorMessage
-};
-async function runWrapper8() {
-  await runInActions(startProxyAction);
-}
-async function startProxy(binPath, config, logFilePath, logger) {
-  const host = "127.0.0.1";
-  let port = 49152;
-  let subprocess = void 0;
-  let tries = 5;
-  let subprocessError = void 0;
-  while (tries-- > 0 && !subprocess && !subprocessError) {
-    subprocess = (0, import_child_process2.spawn)(
-      binPath,
-      ["-addr", `${host}:${port}`, "-config", "-", "-logfile", logFilePath],
-      {
-        detached: true,
-        stdio: ["pipe", "ignore", "ignore"]
-      }
-    );
-    subprocess.unref();
-    if (subprocess.pid) {
-      core27.saveState("proxy-process-pid", `${subprocess.pid}`);
-    }
-    subprocess.on("error", (error3) => {
-      subprocessError = error3;
-    });
-    subprocess.on("exit", (code) => {
-      if (code !== 0) {
-        port = Math.floor(Math.random() * (65535 - 49152) + 49152);
-        subprocess = void 0;
-      }
-    });
-    subprocess.stdin?.write(JSON.stringify(config));
-    subprocess.stdin?.end();
-    await delay(1e3);
-  }
-  if (subprocessError) {
-    throw subprocessError;
-  }
-  logger.info(`Proxy started on ${host}:${port}`);
-  core27.setOutput("proxy_host", host);
-  core27.setOutput("proxy_port", port.toString());
-  core27.setOutput("proxy_ca_certificate", config.ca.cert);
-  const registry_urls = config.all_credentials.filter((credential) => credential.url !== void 0).map((credential) => ({
-    type: credential.type,
-    url: credential.url,
-    "replaces-base": credential["replaces-base"]
-  }));
-  core27.setOutput("proxy_urls", JSON.stringify(registry_urls));
-  return { host, port, cert: config.ca.cert, registries: registry_urls };
-}
-
-// src/start-proxy-action-post.ts
-var core28 = __toESM(require_core());
-async function runWrapper9() {
-  const logger = getActionsLogger();
-  try {
-    restoreInputs();
-    const pid = core28.getState("proxy-process-pid");
-    if (pid) {
-      process.kill(Number(pid));
-    }
-    const config = await getConfig(
-      getTemporaryDirectory(),
-      logger
-    );
-    if (config?.debugMode || core28.isDebug()) {
-      const logFilePath = core28.getState("proxy-log-file");
-      logger.info(
-        "Debug mode is on. Uploading proxy log as Actions debugging artifact..."
-      );
-      if (config?.gitHubVersion.type === void 0) {
-        logger.warning(
-          `Did not upload debug artifacts because cannot determine the GitHub variant running.`
-        );
-        return;
-      }
-      const gitHubVersion = await getGitHubVersion();
-      checkGitHubVersionInRange(gitHubVersion, logger);
-      await uploadArtifacts(
-        logger,
-        [logFilePath],
-        getTemporaryDirectory(),
-        "proxy-log-file",
-        gitHubVersion.type
-      );
-    }
-  } catch (error3) {
-    logger.warning(
-      `start-proxy post-action step failed: ${getErrorMessage(error3)}`
-    );
-  }
-}
-
-// src/upload-sarif-action.ts
-var core29 = __toESM(require_core());
-async function sendSuccessStatusReport2(startedAt, uploadStats, logger) {
-  const statusReportBase = await createStatusReportBase(
-    "upload-sarif" /* UploadSarif */,
-    "success",
-    startedAt,
-    void 0,
-    await checkDiskUsage(logger),
-    logger
-  );
-  if (statusReportBase !== void 0) {
-    const statusReport = {
-      ...statusReportBase,
-      ...uploadStats
-    };
-    await sendStatusReport(statusReport);
-  }
-}
-async function run8({ startedAt, logger }) {
-  try {
-    initializeEnvironment(getActionVersion());
-    const gitHubVersion = await getGitHubVersion();
-    checkActionVersion(getActionVersion(), gitHubVersion);
-    persistInputs();
-    const repositoryNwo = getRepositoryNwo();
-    const features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger
-    );
-    const startingStatusReportBase = await createStatusReportBase(
-      "upload-sarif" /* UploadSarif */,
-      "starting",
-      startedAt,
-      void 0,
-      await checkDiskUsage(logger),
-      logger
-    );
-    if (startingStatusReportBase !== void 0) {
-      await sendStatusReport(startingStatusReportBase);
-    }
-    const sarifPath = getRequiredInput("sarif_file");
-    const checkoutPath = getRequiredInput("checkout_path");
-    const category = getOptionalInput("category");
-    const uploadResults = await postProcessAndUploadSarif(
-      logger,
-      features,
-      "always",
-      checkoutPath,
-      sarifPath,
-      category
-    );
-    if (Object.keys(uploadResults).length === 0) {
-      throw new ConfigurationError(
-        `No SARIF files found to upload in "${sarifPath}".`
-      );
-    }
-    const codeScanningResult = uploadResults["code-scanning" /* CodeScanning */];
-    if (codeScanningResult !== void 0) {
-      core29.setOutput("sarif-id", codeScanningResult.sarifID);
-    }
-    core29.setOutput("sarif-ids", JSON.stringify(uploadResults));
-    if (shouldSkipSarifUpload()) {
-      core29.debug(
-        "SARIF upload disabled by an environment variable. Waiting for processing is disabled."
-      );
-    } else if (getRequiredInput("wait-for-processing") === "true") {
-      if (codeScanningResult !== void 0) {
-        await waitForProcessing(
-          getRepositoryNwo(),
-          codeScanningResult.sarifID,
-          logger
-        );
-      }
-    }
-    await sendSuccessStatusReport2(
-      startedAt,
-      codeScanningResult?.statusReport || {},
-      logger
-    );
-  } catch (unwrappedError) {
-    const error3 = isThirdPartyAnalysis("upload-sarif" /* UploadSarif */) && unwrappedError instanceof InvalidSarifUploadError ? new ConfigurationError(unwrappedError.message) : wrapError(unwrappedError);
-    const message = error3.message;
-    core29.setFailed(message);
-    const errorStatusReportBase = await createStatusReportBase(
-      "upload-sarif" /* UploadSarif */,
-      getActionsStatus(error3),
-      startedAt,
-      void 0,
-      await checkDiskUsage(logger),
-      logger,
-      message,
-      error3.stack
-    );
-    if (errorStatusReportBase !== void 0) {
-      await sendStatusReport(errorStatusReportBase);
-    }
-    return;
-  }
-}
-var uploadSarif = {
-  name: "upload-sarif" /* UploadSarif */,
-  run: run8
-};
-async function runWrapper10() {
-  await runInActions(uploadSarif);
-}
-
-// src/upload-sarif-action-post.ts
-var core30 = __toESM(require_core());
-async function runWrapper11() {
-  try {
-    restoreInputs();
-    const logger = getActionsLogger();
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    if (process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] !== "true") {
-      if (gitHubVersion.type === void 0) {
-        core30.warning(
-          `Did not upload debug artifacts because cannot determine the GitHub variant running.`
-        );
-        return;
-      }
-      await withGroup(
-        "Uploading combined SARIF debug artifact",
-        () => uploadCombinedSarifArtifacts(
-          logger,
-          gitHubVersion.type,
-          // The codeqlVersion is not applicable for uploading non-codeql sarif.
-          // We can assume all versions are safe to upload.
-          void 0
-        )
-      );
-    }
-  } catch (error3) {
-    core30.setFailed(
-      `upload-sarif post-action step failed: ${getErrorMessage(error3)}`
-    );
-  }
-}
-
-// actions:entry-points
-async function runAnalyzeAction() {
-  return await runWrapper();
-}
-async function runAnalyzePostAction() {
-  return await runWrapper2();
-}
-async function runAutobuildAction() {
-  return await runWrapper3();
-}
-async function runInitAction() {
-  return await runWrapper4();
-}
-async function runInitPostAction() {
-  return await runWrapper5();
-}
-async function runResolveEnvironmentAction() {
-  return await runWrapper6();
-}
-async function runSetupCodeqlAction() {
-  return await runWrapper7();
-}
-async function runStartProxyAction() {
-  return await runWrapper8();
-}
-async function runStartProxyPostAction() {
-  return await runWrapper9();
-}
-async function runUploadSarifAction() {
-  return await runWrapper10();
-}
-async function runUploadSarifPostAction() {
-  return await runWrapper11();
-}
-// Annotate the CommonJS export names for ESM import in node:
-0 && (module.exports = {
-  runAnalyzeAction,
-  runAnalyzePostAction,
-  runAutobuildAction,
-  runInitAction,
-  runInitPostAction,
-  runResolveEnvironmentAction,
-  runSetupCodeqlAction,
-  runStartProxyAction,
-  runStartProxyPostAction,
-  runUploadSarifAction,
-  runUploadSarifPostAction,
-  uploadLib
-});
-/*! Bundled license information:
-
-undici/lib/web/fetch/body.js:
-  (*! formdata-polyfill. MIT License. Jimmy Wärting  *)
-
-undici/lib/web/websocket/frame.js:
-  (*! ws. MIT License. Einar Otto Stangvik  *)
-
-content-type/dist/index.js:
-  (*!
-   * content-type
-   * Copyright(c) 2015 Douglas Christopher Wilson
-   * MIT Licensed
-   *)
-
-@octokit/request-error/dist-src/index.js:
-  (* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *)
-
-@octokit/request/dist-bundle/index.js:
-  (* v8 ignore next -- @preserve *)
-  (* v8 ignore else -- @preserve *)
-
-@octokit/graphql/dist-bundle/index.js:
-  (* v8 ignore if -- @preserve *)
-
-normalize-path/index.js:
-  (*!
-   * normalize-path 
-   *
-   * Copyright (c) 2014-2018, Jon Schlinkert.
-   * Released under the MIT License.
-   *)
-
-safe-buffer/index.js:
-  (*! safe-buffer. MIT License. Feross Aboukhadijeh  *)
-
-archiver/lib/error.js:
-archiver/lib/core.js:
-  (**
-   * Archiver Core
-   *
-   * @ignore
-   * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
-   * @copyright (c) 2012-2014 Chris Talkington, contributors.
-   *)
-
-crc-32/crc32.js:
-  (*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
-
-zip-stream/index.js:
-zip-stream/index.js:
-  (**
-   * ZipStream
-   *
-   * @ignore
-   * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
-   * @copyright (c) 2014 Chris Talkington, contributors.
-   *)
-
-archiver/lib/plugins/zip.js:
-archiver/lib/plugins/zip.js:
-  (**
-   * ZIP Format Plugin
-   *
-   * @module plugins/zip
-   * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
-   * @copyright (c) 2012-2014 Chris Talkington, contributors.
-   *)
-
-archiver/lib/plugins/tar.js:
-archiver/lib/plugins/tar.js:
-  (**
-   * TAR Format Plugin
-   *
-   * @module plugins/tar
-   * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
-   * @copyright (c) 2012-2014 Chris Talkington, contributors.
-   *)
-
-archiver/lib/plugins/json.js:
-archiver/lib/plugins/json.js:
-  (**
-   * JSON Format Plugin
-   *
-   * @module plugins/json
-   * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
-   * @copyright (c) 2012-2014 Chris Talkington, contributors.
-   *)
-
-archiver/index.js:
-  (**
-   * Archiver Vending
-   *
-   * @ignore
-   * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
-   * @copyright (c) 2012-2014 Chris Talkington, contributors.
-   *)
-
-tmp/lib/tmp.js:
-  (*!
-   * Tmp
-   *
-   * Copyright (c) 2011-2017 KARASZI Istvan 
-   *
-   * MIT Licensed
-   *)
-
-js-yaml/dist/js-yaml.mjs:
-  (*! js-yaml 5.2.3 https://github.com/nodeca/js-yaml @license MIT *)
-
-long/index.js:
-  (**
-   * @license
-   * Copyright 2009 The Closure Library Authors
-   * Copyright 2020 Daniel Wirtz / The long.js Authors.
-   *
-   * 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.
-   *
-   * SPDX-License-Identifier: Apache-2.0
-   *)
-*/
diff --git a/lib/init-entry.js b/lib/init-entry.js
deleted file mode 100644
index f092a9192e..0000000000
--- a/lib/init-entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Automatically generated from 'action-entry.js.tpl' for 'src/init-action.ts'.
-
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.runInitAction)();
diff --git a/lib/init-post-entry.js b/lib/init-post-entry.js
deleted file mode 100644
index 978f755db9..0000000000
--- a/lib/init-post-entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Automatically generated from 'action-entry.js.tpl' for 'src/init-action-post.ts'.
-
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.runInitPostAction)();
diff --git a/lib/resolve-environment-entry.js b/lib/resolve-environment-entry.js
deleted file mode 100644
index 46904c5b98..0000000000
--- a/lib/resolve-environment-entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Automatically generated from 'action-entry.js.tpl' for 'src/resolve-environment-action.ts'.
-
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.runResolveEnvironmentAction)();
diff --git a/lib/setup-codeql-entry.js b/lib/setup-codeql-entry.js
deleted file mode 100644
index 572347ddd5..0000000000
--- a/lib/setup-codeql-entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Automatically generated from 'action-entry.js.tpl' for 'src/setup-codeql-action.ts'.
-
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.runSetupCodeqlAction)();
diff --git a/lib/start-proxy-entry.js b/lib/start-proxy-entry.js
deleted file mode 100644
index d0bdce708f..0000000000
--- a/lib/start-proxy-entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Automatically generated from 'action-entry.js.tpl' for 'src/start-proxy-action.ts'.
-
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.runStartProxyAction)();
diff --git a/lib/start-proxy-post-entry.js b/lib/start-proxy-post-entry.js
deleted file mode 100644
index 16fcedced6..0000000000
--- a/lib/start-proxy-post-entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Automatically generated from 'action-entry.js.tpl' for 'src/start-proxy-action-post.ts'.
-
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.runStartProxyPostAction)();
diff --git a/lib/upload-lib.js b/lib/upload-lib.js
deleted file mode 100644
index be0245929c..0000000000
--- a/lib/upload-lib.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Automatically generated from 'upload-lib-stub.js.tpl' for 'src/upload-lib.ts'.
-
-"use strict";
-
-module.exports = require("./entry-points").uploadLib;
diff --git a/lib/upload-sarif-entry.js b/lib/upload-sarif-entry.js
deleted file mode 100644
index 9a9e31bd85..0000000000
--- a/lib/upload-sarif-entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Automatically generated from 'action-entry.js.tpl' for 'src/upload-sarif-action.ts'.
-
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.runUploadSarifAction)();
diff --git a/lib/upload-sarif-post-entry.js b/lib/upload-sarif-post-entry.js
deleted file mode 100644
index f47fad5464..0000000000
--- a/lib/upload-sarif-post-entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Automatically generated from 'action-entry.js.tpl' for 'src/upload-sarif-action-post.ts'.
-
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.runUploadSarifPostAction)();
diff --git a/package-lock.json b/package-lock.json
deleted file mode 100644
index 6a74ca0270..0000000000
--- a/package-lock.json
+++ /dev/null
@@ -1,9860 +0,0 @@
-{
-  "name": "codeql",
-  "version": "4.37.8",
-  "lockfileVersion": 3,
-  "requires": true,
-  "packages": {
-    "": {
-      "name": "codeql",
-      "version": "4.37.8",
-      "license": "MIT",
-      "workspaces": [
-        "pr-checks"
-      ],
-      "dependencies": {
-        "@actions/artifact": "^5.0.3",
-        "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2",
-        "@actions/cache": "^5.2.0",
-        "@actions/core": "^2.0.3",
-        "@actions/exec": "^2.0.0",
-        "@actions/github": "^8.0.1",
-        "@actions/glob": "^0.5.0",
-        "@actions/http-client": "^3.0.0",
-        "@actions/io": "^2.0.0",
-        "@actions/tool-cache": "^3.0.1",
-        "@octokit/core": "^7.0.7",
-        "@octokit/plugin-paginate-rest": "^14.0.0",
-        "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
-        "@octokit/plugin-retry": "^8.1.1",
-        "archiver": "^8.0.0",
-        "fast-deep-equal": "^3.1.3",
-        "follow-redirects": "^1.16.0",
-        "get-folder-size": "^5.0.0",
-        "https-proxy-agent": "^7.0.6",
-        "js-yaml": "^5.2.3",
-        "jsonschema": "1.5.0",
-        "long": "^5.3.2",
-        "node-forge": "^1.4.0",
-        "semver": "^7.8.5",
-        "undici": "^6.28.0",
-        "uuid": "^14.0.1"
-      },
-      "devDependencies": {
-        "@ava/typescript": "6.0.0",
-        "@eslint/compat": "^2.1.0",
-        "@microsoft/eslint-formatter-sarif": "^3.1.0",
-        "@octokit/types": "^16.0.0",
-        "@types/archiver": "^8.0.0",
-        "@types/follow-redirects": "^1.14.4",
-        "@types/js-yaml": "^4.0.9",
-        "@types/node": "^20.19.43",
-        "@types/node-forge": "^1.3.14",
-        "@types/sarif": "^2.1.7",
-        "@types/semver": "^7.8.0",
-        "@types/sinon": "^22.0.0",
-        "ava": "^6.4.1",
-        "esbuild": "^0.28.1",
-        "eslint": "^9.39.5",
-        "eslint-import-resolver-typescript": "^4.4.5",
-        "eslint-plugin-github": "^6.1.2",
-        "eslint-plugin-import-x": "^4.17.1",
-        "eslint-plugin-jsdoc": "^62.9.0",
-        "eslint-plugin-no-async-foreach": "^0.1.1",
-        "glob": "^13.0.6",
-        "globals": "^17.9.0",
-        "nock": "^14.0.17",
-        "sinon": "^22.1.0",
-        "typescript": "^6.0.3",
-        "typescript-eslint": "^8.66.0"
-      }
-    },
-    "node_modules/@aashutoshrathi/word-wrap": {
-      "version": "1.2.6",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/@actions/artifact": {
-      "version": "5.0.3",
-      "resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-5.0.3.tgz",
-      "integrity": "sha512-FIEG8Kum0wABZnktJvFi1xuVPc31xrunhZwLCvjrCGISQOm0ifyo7cjqf6PHiEeqoWMa5HIGOsB+lGM4aKCseA==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/core": "^2.0.0",
-        "@actions/github": "^6.0.1",
-        "@actions/http-client": "^3.0.2",
-        "@azure/storage-blob": "^12.29.1",
-        "@octokit/core": "^5.2.1",
-        "@octokit/plugin-request-log": "^1.0.4",
-        "@octokit/plugin-retry": "^3.0.9",
-        "@octokit/request": "^8.4.1",
-        "@octokit/request-error": "^5.1.1",
-        "@protobuf-ts/plugin": "^2.2.3-alpha.1",
-        "archiver": "^7.0.1",
-        "jwt-decode": "^3.1.2",
-        "unzip-stream": "^0.3.1"
-      }
-    },
-    "node_modules/@actions/artifact-legacy": {
-      "name": "@actions/artifact",
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-1.1.2.tgz",
-      "integrity": "sha512-1gLONA4xw3/Q/9vGxKwkFdV9u1LE2RWGx/IpAqg28ZjprCnJFjwn4pA7LtShqg5mg5WhMek2fjpyH1leCmOlQQ==",
-      "dependencies": {
-        "@actions/core": "^1.9.1",
-        "@actions/http-client": "^2.0.1",
-        "tmp": "^0.2.1",
-        "tmp-promise": "^3.0.2"
-      }
-    },
-    "node_modules/@actions/artifact-legacy/node_modules/@actions/core": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
-      "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/exec": "^1.1.1",
-        "@actions/http-client": "^2.0.1"
-      }
-    },
-    "node_modules/@actions/artifact-legacy/node_modules/@actions/exec": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
-      "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/io": "^1.0.1"
-      }
-    },
-    "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client": {
-      "version": "2.2.3",
-      "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz",
-      "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==",
-      "license": "MIT",
-      "dependencies": {
-        "tunnel": "^0.0.6",
-        "undici": "^5.25.4"
-      }
-    },
-    "node_modules/@actions/artifact-legacy/node_modules/@actions/io": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
-      "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==",
-      "license": "MIT"
-    },
-    "node_modules/@actions/artifact/node_modules/@actions/github": {
-      "version": "6.0.1",
-      "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.1.tgz",
-      "integrity": "sha512-xbZVcaqD4XnQAe35qSQqskb3SqIAfRyLBrHMd/8TuL7hJSz2QtbDwnNM8zWx4zO5l2fnGtseNE3MbEvD7BxVMw==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/http-client": "^2.2.0",
-        "@octokit/core": "^5.0.1",
-        "@octokit/plugin-paginate-rest": "^9.2.2",
-        "@octokit/plugin-rest-endpoint-methods": "^10.4.0",
-        "@octokit/request": "^8.4.1",
-        "@octokit/request-error": "^5.1.1",
-        "undici": "^5.28.5"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@actions/github/node_modules/@actions/http-client": {
-      "version": "2.2.3",
-      "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz",
-      "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==",
-      "license": "MIT",
-      "dependencies": {
-        "tunnel": "^0.0.6",
-        "undici": "^5.25.4"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/auth-token": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz",
-      "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==",
-      "license": "MIT",
-      "engines": {
-        "node": ">= 18"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/core": {
-      "version": "5.2.2",
-      "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.2.tgz",
-      "integrity": "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/auth-token": "^4.0.0",
-        "@octokit/graphql": "^7.1.0",
-        "@octokit/request": "^8.4.1",
-        "@octokit/request-error": "^5.1.1",
-        "@octokit/types": "^13.0.0",
-        "before-after-hook": "^2.2.0",
-        "universal-user-agent": "^6.0.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/endpoint": {
-      "version": "9.0.6",
-      "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz",
-      "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/types": "^13.1.0",
-        "universal-user-agent": "^6.0.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/graphql": {
-      "version": "7.1.1",
-      "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.1.tgz",
-      "integrity": "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/request": "^8.4.1",
-        "@octokit/types": "^13.0.0",
-        "universal-user-agent": "^6.0.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/openapi-types": {
-      "version": "12.11.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz",
-      "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==",
-      "license": "MIT"
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/plugin-paginate-rest": {
-      "version": "9.2.2",
-      "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.2.tgz",
-      "integrity": "sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/types": "^12.6.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      },
-      "peerDependencies": {
-        "@octokit/core": "5"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": {
-      "version": "20.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz",
-      "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==",
-      "license": "MIT"
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": {
-      "version": "12.6.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz",
-      "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^20.0.0"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/plugin-rest-endpoint-methods": {
-      "version": "10.4.1",
-      "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz",
-      "integrity": "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/types": "^12.6.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      },
-      "peerDependencies": {
-        "@octokit/core": "5"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": {
-      "version": "20.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz",
-      "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==",
-      "license": "MIT"
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": {
-      "version": "12.6.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz",
-      "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^20.0.0"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/plugin-retry": {
-      "version": "3.0.9",
-      "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz",
-      "integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/types": "^6.0.3",
-        "bottleneck": "^2.15.3"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/plugin-retry/node_modules/@octokit/types": {
-      "version": "6.41.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz",
-      "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^12.11.0"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/request": {
-      "version": "8.4.1",
-      "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz",
-      "integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/endpoint": "^9.0.6",
-        "@octokit/request-error": "^5.1.1",
-        "@octokit/types": "^13.1.0",
-        "universal-user-agent": "^6.0.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/request-error": {
-      "version": "5.1.1",
-      "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz",
-      "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==",
-      "dependencies": {
-        "@octokit/types": "^13.1.0",
-        "deprecation": "^2.0.0",
-        "once": "^1.4.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/types": {
-      "version": "13.10.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz",
-      "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==",
-      "dependencies": {
-        "@octokit/openapi-types": "^24.2.0"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/@octokit/types/node_modules/@octokit/openapi-types": {
-      "version": "24.2.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz",
-      "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="
-    },
-    "node_modules/@actions/artifact/node_modules/archiver": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz",
-      "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==",
-      "license": "MIT",
-      "dependencies": {
-        "archiver-utils": "^5.0.2",
-        "async": "^3.2.4",
-        "buffer-crc32": "^1.0.0",
-        "readable-stream": "^4.0.0",
-        "readdir-glob": "^1.1.2",
-        "tar-stream": "^3.0.0",
-        "zip-stream": "^6.0.1"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/before-after-hook": {
-      "version": "2.2.3",
-      "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
-      "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==",
-      "license": "Apache-2.0"
-    },
-    "node_modules/@actions/artifact/node_modules/brace-expansion": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
-      "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
-      "license": "MIT",
-      "dependencies": {
-        "balanced-match": "^1.0.0"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/compress-commons": {
-      "version": "6.0.2",
-      "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz",
-      "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==",
-      "license": "MIT",
-      "dependencies": {
-        "crc-32": "^1.2.0",
-        "crc32-stream": "^6.0.0",
-        "is-stream": "^2.0.1",
-        "normalize-path": "^3.0.0",
-        "readable-stream": "^4.0.0"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/crc32-stream": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz",
-      "integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==",
-      "license": "MIT",
-      "dependencies": {
-        "crc-32": "^1.2.0",
-        "readable-stream": "^4.0.0"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/is-stream": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
-      "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/minimatch": {
-      "version": "5.1.9",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz",
-      "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==",
-      "license": "ISC",
-      "dependencies": {
-        "brace-expansion": "^2.0.1"
-      },
-      "engines": {
-        "node": ">=10"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/readdir-glob": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz",
-      "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==",
-      "license": "Apache-2.0",
-      "dependencies": {
-        "minimatch": "^5.1.0"
-      }
-    },
-    "node_modules/@actions/artifact/node_modules/zip-stream": {
-      "version": "6.0.1",
-      "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz",
-      "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==",
-      "license": "MIT",
-      "dependencies": {
-        "archiver-utils": "^5.0.0",
-        "compress-commons": "^6.0.2",
-        "readable-stream": "^4.0.0"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/@actions/cache": {
-      "version": "5.2.0",
-      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-5.2.0.tgz",
-      "integrity": "sha512-1R1Oc8cuDNCygsIP7gLiKLGCymOw/k5FkGQkXZFcLz6/RWyMImkfP0dZX6kjA9SRAmANcKNocI2XrsIaZ1it8w==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/core": "^2.0.0",
-        "@actions/exec": "^2.0.0",
-        "@actions/glob": "^0.5.1",
-        "@actions/http-client": "^3.0.2",
-        "@actions/io": "^2.0.0",
-        "@azure/abort-controller": "^1.1.0",
-        "@azure/core-rest-pipeline": "^1.22.0",
-        "@azure/storage-blob": "^12.29.1",
-        "@protobuf-ts/runtime-rpc": "^2.11.1",
-        "semver": "^6.3.1"
-      }
-    },
-    "node_modules/@actions/cache/node_modules/semver": {
-      "version": "6.3.1",
-      "license": "ISC",
-      "bin": {
-        "semver": "bin/semver.js"
-      }
-    },
-    "node_modules/@actions/core": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.3.tgz",
-      "integrity": "sha512-Od9Thc3T1mQJYddvVPM4QGiLUewdh+3txmDYHHxoNdkqysR1MbCT+rFOtNUxYAz+7+6RIsqipVahY2GJqGPyxA==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/exec": "^2.0.0",
-        "@actions/http-client": "^3.0.2"
-      }
-    },
-    "node_modules/@actions/exec": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-2.0.0.tgz",
-      "integrity": "sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/io": "^2.0.0"
-      }
-    },
-    "node_modules/@actions/github": {
-      "version": "8.0.1",
-      "resolved": "https://registry.npmjs.org/@actions/github/-/github-8.0.1.tgz",
-      "integrity": "sha512-cue7mS+kx1/2Dnc/094pitRUm+0uPXVXYVaqOdZwD15BsXATWYHW3idJDYOlyBc5gJlzAQ/w5YLU4LR8D7hjVg==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/http-client": "^3.0.2",
-        "@octokit/core": "^7.0.6",
-        "@octokit/plugin-paginate-rest": "^14.0.0",
-        "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
-        "@octokit/request": "^10.0.7",
-        "@octokit/request-error": "^7.1.0",
-        "undici": "^6.23.0"
-      }
-    },
-    "node_modules/@actions/glob": {
-      "version": "0.5.1",
-      "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.1.tgz",
-      "integrity": "sha512-+dv/t2aKQdKp9WWSp+1yIXVJzH5Q38M0Mta26pzIbeec14EcIleMB7UU6N7sNgbEuYfyuVGpE5pOKjl6j1WXkA==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/core": "^2.0.3",
-        "minimatch": "^3.0.4"
-      }
-    },
-    "node_modules/@actions/http-client": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.2.tgz",
-      "integrity": "sha512-JP38FYYpyqvUsz+Igqlc/JG6YO9PaKuvqjM3iGvaLqFnJ7TFmcLyy2IDrY0bI0qCQug8E9K+elv5ZNfw62ZJzA==",
-      "license": "MIT",
-      "dependencies": {
-        "tunnel": "^0.0.6",
-        "undici": "^6.23.0"
-      }
-    },
-    "node_modules/@actions/io": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/@actions/io/-/io-2.0.0.tgz",
-      "integrity": "sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg==",
-      "license": "MIT"
-    },
-    "node_modules/@actions/tool-cache": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-3.0.1.tgz",
-      "integrity": "sha512-euK7sID37jMg1yWGkdXkLPI5Te7x/+2QMUPeHXogcpzUZ81mqlDZ+CgYhQo3LtB8LpVnnQyjs+hTTU0Ir4Y0RQ==",
-      "license": "MIT",
-      "dependencies": {
-        "@actions/core": "^2.0.1",
-        "@actions/exec": "^2.0.0",
-        "@actions/http-client": "^3.0.2",
-        "@actions/io": "^2.0.0",
-        "semver": "^6.1.0"
-      }
-    },
-    "node_modules/@ava/typescript": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/@ava/typescript/-/typescript-6.0.0.tgz",
-      "integrity": "sha512-+8oDYc4J5cCaWZh1VUbyc+cegGplJO9FqHpqR4LVAVx8fRLVRaYlC4yyA6cqHJ1vWP23Ff/ECS5U68Zz6OLZlg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "escape-string-regexp": "^5.0.0",
-        "execa": "^9.6.0"
-      },
-      "engines": {
-        "node": "^20.8 || ^22 || >=24"
-      }
-    },
-    "node_modules/@ava/typescript/node_modules/escape-string-regexp": {
-      "version": "5.0.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@azure/abort-controller": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
-      "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.2.0"
-      },
-      "engines": {
-        "node": ">=12.0.0"
-      }
-    },
-    "node_modules/@azure/core-auth": {
-      "version": "1.10.1",
-      "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.10.1.tgz",
-      "integrity": "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg==",
-      "license": "MIT",
-      "dependencies": {
-        "@azure/abort-controller": "^2.1.2",
-        "@azure/core-util": "^1.13.0",
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/core-auth/node_modules/@azure/abort-controller": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
-      "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/core-client": {
-      "version": "1.10.1",
-      "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.10.1.tgz",
-      "integrity": "sha512-Nh5PhEOeY6PrnxNPsEHRr9eimxLwgLlpmguQaHKBinFYA/RU9+kOYVOQqOrTsCL+KSxrLLl1gD8Dk5BFW/7l/w==",
-      "license": "MIT",
-      "dependencies": {
-        "@azure/abort-controller": "^2.1.2",
-        "@azure/core-auth": "^1.10.0",
-        "@azure/core-rest-pipeline": "^1.22.0",
-        "@azure/core-tracing": "^1.3.0",
-        "@azure/core-util": "^1.13.0",
-        "@azure/logger": "^1.3.0",
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/core-client/node_modules/@azure/abort-controller": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
-      "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/core-http-compat": {
-      "version": "2.3.1",
-      "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.3.1.tgz",
-      "integrity": "sha512-az9BkXND3/d5VgdRRQVkiJb2gOmDU8Qcq4GvjtBmDICNiQ9udFmDk4ZpSB5Qq1OmtDJGlQAfBaS4palFsazQ5g==",
-      "license": "MIT",
-      "dependencies": {
-        "@azure/abort-controller": "^2.1.2",
-        "@azure/core-client": "^1.10.0",
-        "@azure/core-rest-pipeline": "^1.22.0"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/core-http-compat/node_modules/@azure/abort-controller": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
-      "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/core-lro": {
-      "version": "2.7.2",
-      "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.7.2.tgz",
-      "integrity": "sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==",
-      "license": "MIT",
-      "dependencies": {
-        "@azure/abort-controller": "^2.0.0",
-        "@azure/core-util": "^1.2.0",
-        "@azure/logger": "^1.0.0",
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/core-lro/node_modules/@azure/abort-controller": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
-      "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/core-paging": {
-      "version": "1.6.2",
-      "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.6.2.tgz",
-      "integrity": "sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/core-rest-pipeline": {
-      "version": "1.22.2",
-      "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.22.2.tgz",
-      "integrity": "sha512-MzHym+wOi8CLUlKCQu12de0nwcq9k9Kuv43j4Wa++CsCpJwps2eeBQwD2Bu8snkxTtDKDx4GwjuR9E8yC8LNrg==",
-      "license": "MIT",
-      "dependencies": {
-        "@azure/abort-controller": "^2.1.2",
-        "@azure/core-auth": "^1.10.0",
-        "@azure/core-tracing": "^1.3.0",
-        "@azure/core-util": "^1.13.0",
-        "@azure/logger": "^1.3.0",
-        "@typespec/ts-http-runtime": "^0.3.0",
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
-      "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/core-tracing": {
-      "version": "1.3.1",
-      "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.3.1.tgz",
-      "integrity": "sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/core-util": {
-      "version": "1.13.1",
-      "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.13.1.tgz",
-      "integrity": "sha512-XPArKLzsvl0Hf0CaGyKHUyVgF7oDnhKoP85Xv6M4StF/1AhfORhZudHtOyf2s+FcbuQ9dPRAjB8J2KvRRMUK2A==",
-      "license": "MIT",
-      "dependencies": {
-        "@azure/abort-controller": "^2.1.2",
-        "@typespec/ts-http-runtime": "^0.3.0",
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/core-util/node_modules/@azure/abort-controller": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
-      "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/core-xml": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.5.0.tgz",
-      "integrity": "sha512-D/sdlJBMJfx7gqoj66PKVmhDDaU6TKA49ptcolxdas29X7AfvLTmfAGLjAcIMBK7UZ2o4lygHIqVckOlQU3xWw==",
-      "license": "MIT",
-      "dependencies": {
-        "fast-xml-parser": "^5.0.7",
-        "tslib": "^2.8.1"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/logger": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.3.0.tgz",
-      "integrity": "sha512-fCqPIfOcLE+CGqGPd66c8bZpwAji98tZ4JI9i/mlTNTlsIWslCfpg48s/ypyLxZTump5sypjrKn2/kY7q8oAbA==",
-      "license": "MIT",
-      "dependencies": {
-        "@typespec/ts-http-runtime": "^0.3.0",
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/storage-blob": {
-      "version": "12.29.1",
-      "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.29.1.tgz",
-      "integrity": "sha512-7ktyY0rfTM0vo7HvtK6E3UvYnI9qfd6Oz6z/+92VhGRveWng3kJwMKeUpqmW/NmwcDNbxHpSlldG+vsUnRFnBg==",
-      "license": "MIT",
-      "dependencies": {
-        "@azure/abort-controller": "^2.1.2",
-        "@azure/core-auth": "^1.9.0",
-        "@azure/core-client": "^1.9.3",
-        "@azure/core-http-compat": "^2.2.0",
-        "@azure/core-lro": "^2.2.0",
-        "@azure/core-paging": "^1.6.2",
-        "@azure/core-rest-pipeline": "^1.19.1",
-        "@azure/core-tracing": "^1.2.0",
-        "@azure/core-util": "^1.11.0",
-        "@azure/core-xml": "^1.4.5",
-        "@azure/logger": "^1.1.4",
-        "@azure/storage-common": "^12.1.1",
-        "events": "^3.0.0",
-        "tslib": "^2.8.1"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
-      "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@azure/storage-common": {
-      "version": "12.1.1",
-      "resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.1.1.tgz",
-      "integrity": "sha512-eIOH1pqFwI6UmVNnDQvmFeSg0XppuzDLFeUNO/Xht7ODAzRLgGDh7h550pSxoA+lPDxBl1+D2m/KG3jWzCUjTg==",
-      "license": "MIT",
-      "dependencies": {
-        "@azure/abort-controller": "^2.1.2",
-        "@azure/core-auth": "^1.9.0",
-        "@azure/core-http-compat": "^2.2.0",
-        "@azure/core-rest-pipeline": "^1.19.1",
-        "@azure/core-tracing": "^1.2.0",
-        "@azure/core-util": "^1.11.0",
-        "@azure/logger": "^1.1.4",
-        "events": "^3.3.0",
-        "tslib": "^2.8.1"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@azure/storage-common/node_modules/@azure/abort-controller": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
-      "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
-      "license": "MIT",
-      "dependencies": {
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@emnapi/core": {
-      "version": "1.8.1",
-      "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.8.1.tgz",
-      "integrity": "sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg==",
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "dependencies": {
-        "@emnapi/wasi-threads": "1.1.0",
-        "tslib": "^2.4.0"
-      }
-    },
-    "node_modules/@emnapi/runtime": {
-      "version": "1.8.1",
-      "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz",
-      "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==",
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "dependencies": {
-        "tslib": "^2.4.0"
-      }
-    },
-    "node_modules/@emnapi/wasi-threads": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz",
-      "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==",
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "dependencies": {
-        "tslib": "^2.4.0"
-      }
-    },
-    "node_modules/@es-joy/jsdoccomment": {
-      "version": "0.86.0",
-      "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.86.0.tgz",
-      "integrity": "sha512-ukZmRQ81WiTpDWO6D/cTBM7XbrNtutHKvAVnZN/8pldAwLoJArGOvkNyxPTBGsPjsoaQBJxlH+tE2TNA/92Qgw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/estree": "^1.0.8",
-        "@typescript-eslint/types": "^8.58.0",
-        "comment-parser": "1.4.6",
-        "esquery": "^1.7.0",
-        "jsdoc-type-pratt-parser": "~7.2.0"
-      },
-      "engines": {
-        "node": "^20.19.0 || ^22.13.0 || >=24"
-      }
-    },
-    "node_modules/@es-joy/jsdoccomment/node_modules/esquery": {
-      "version": "1.7.0",
-      "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",
-      "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "estraverse": "^5.1.0"
-      },
-      "engines": {
-        "node": ">=0.10"
-      }
-    },
-    "node_modules/@es-joy/resolve.exports": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/@es-joy/resolve.exports/-/resolve.exports-1.2.0.tgz",
-      "integrity": "sha512-Q9hjxWI5xBM+qW2enxfe8wDKdFWMfd0Z29k5ZJnuBqD/CasY5Zryj09aCA6owbGATWz+39p5uIdaHXpopOcG8g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=10"
-      }
-    },
-    "node_modules/@esbuild/aix-ppc64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
-      "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
-      "cpu": [
-        "ppc64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "aix"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/android-arm": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",
-      "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
-      "cpu": [
-        "arm"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "android"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/android-arm64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",
-      "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "android"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/android-x64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",
-      "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "android"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/darwin-arm64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",
-      "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "darwin"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/darwin-x64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",
-      "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "darwin"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/freebsd-arm64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",
-      "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "freebsd"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/freebsd-x64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",
-      "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "freebsd"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-arm": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",
-      "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
-      "cpu": [
-        "arm"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-arm64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",
-      "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-ia32": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",
-      "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
-      "cpu": [
-        "ia32"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-loong64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",
-      "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
-      "cpu": [
-        "loong64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-mips64el": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",
-      "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
-      "cpu": [
-        "mips64el"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-ppc64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",
-      "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
-      "cpu": [
-        "ppc64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-riscv64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",
-      "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
-      "cpu": [
-        "riscv64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-s390x": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",
-      "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
-      "cpu": [
-        "s390x"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/linux-x64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",
-      "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/netbsd-arm64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",
-      "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "netbsd"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/netbsd-x64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",
-      "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "netbsd"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/openbsd-arm64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",
-      "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "openbsd"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/openbsd-x64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",
-      "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "openbsd"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/openharmony-arm64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",
-      "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "openharmony"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/sunos-x64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",
-      "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "sunos"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/win32-arm64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",
-      "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "win32"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/win32-ia32": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",
-      "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
-      "cpu": [
-        "ia32"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "win32"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@esbuild/win32-x64": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",
-      "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "win32"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@eslint-community/eslint-utils": {
-      "version": "4.9.1",
-      "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
-      "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "eslint-visitor-keys": "^3.4.3"
-      },
-      "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      },
-      "peerDependencies": {
-        "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
-      }
-    },
-    "node_modules/@eslint-community/regexpp": {
-      "version": "4.12.2",
-      "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
-      "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
-      }
-    },
-    "node_modules/@eslint/compat": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-2.1.0.tgz",
-      "integrity": "sha512-LgaSCymEpw7tF53xvDw9SNsraPb1IBHxpdABIOM0hW8UAlP8znrjYtuxfR58FSJ3L9BhwD+FaPRFQpZq84Nh6g==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@eslint/core": "^1.2.1"
-      },
-      "engines": {
-        "node": "^20.19.0 || ^22.13.0 || >=24"
-      },
-      "peerDependencies": {
-        "eslint": "^8.40 || 9 || 10"
-      },
-      "peerDependenciesMeta": {
-        "eslint": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/@eslint/config-array": {
-      "version": "0.21.2",
-      "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz",
-      "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@eslint/object-schema": "^2.1.7",
-        "debug": "^4.3.1",
-        "minimatch": "^3.1.5"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      }
-    },
-    "node_modules/@eslint/config-helpers": {
-      "version": "0.4.2",
-      "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
-      "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@eslint/core": "^0.17.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      }
-    },
-    "node_modules/@eslint/config-helpers/node_modules/@eslint/core": {
-      "version": "0.17.0",
-      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
-      "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@types/json-schema": "^7.0.15"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      }
-    },
-    "node_modules/@eslint/core": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz",
-      "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@types/json-schema": "^7.0.15"
-      },
-      "engines": {
-        "node": "^20.19.0 || ^22.13.0 || >=24"
-      }
-    },
-    "node_modules/@eslint/eslintrc": {
-      "version": "3.3.6",
-      "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.6.tgz",
-      "integrity": "sha512-l2Ul9PrHsPCKcEY/ac7VgFj9D80C7S68sOKc618SyHDPK36s1XcFebXY0iTzUVn4Yq+YbwvSnDmCz9yxjX+QrA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ajv": "^6.14.0",
-        "debug": "^4.3.2",
-        "espree": "^10.0.1",
-        "globals": "^14.0.0",
-        "ignore": "^5.2.0",
-        "import-fresh": "^3.2.1",
-        "js-yaml": "^4.3.0",
-        "minimatch": "^3.1.5",
-        "strip-json-comments": "^3.1.1"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/@eslint/eslintrc/node_modules/globals": {
-      "version": "14.0.0",
-      "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
-      "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@eslint/eslintrc/node_modules/js-yaml": {
-      "version": "4.3.1",
-      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
-      "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/puzrin"
-        },
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/nodeca"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "argparse": "^2.0.1"
-      },
-      "bin": {
-        "js-yaml": "bin/js-yaml.js"
-      }
-    },
-    "node_modules/@eslint/js": {
-      "version": "9.39.5",
-      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.5.tgz",
-      "integrity": "sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://eslint.org/donate"
-      }
-    },
-    "node_modules/@eslint/object-schema": {
-      "version": "2.1.7",
-      "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
-      "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      }
-    },
-    "node_modules/@eslint/plugin-kit": {
-      "version": "0.4.1",
-      "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
-      "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@eslint/core": "^0.17.0",
-        "levn": "^0.4.1"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      }
-    },
-    "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": {
-      "version": "0.17.0",
-      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
-      "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@types/json-schema": "^7.0.15"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      }
-    },
-    "node_modules/@github/browserslist-config": {
-      "version": "1.0.0",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@humanfs/core": {
-      "version": "0.19.1",
-      "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
-      "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": ">=18.18.0"
-      }
-    },
-    "node_modules/@humanfs/node": {
-      "version": "0.16.7",
-      "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz",
-      "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@humanfs/core": "^0.19.1",
-        "@humanwhocodes/retry": "^0.4.0"
-      },
-      "engines": {
-        "node": ">=18.18.0"
-      }
-    },
-    "node_modules/@humanwhocodes/config-array": {
-      "version": "0.13.0",
-      "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz",
-      "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==",
-      "deprecated": "Use @eslint/config-array instead",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@humanwhocodes/object-schema": "^2.0.3",
-        "debug": "^4.3.1",
-        "minimatch": "^3.0.5"
-      },
-      "engines": {
-        "node": ">=10.10.0"
-      }
-    },
-    "node_modules/@humanwhocodes/module-importer": {
-      "version": "1.0.1",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": ">=12.22"
-      },
-      "funding": {
-        "type": "github",
-        "url": "https://github.com/sponsors/nzakas"
-      }
-    },
-    "node_modules/@humanwhocodes/object-schema": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
-      "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
-      "deprecated": "Use @eslint/object-schema instead",
-      "dev": true,
-      "license": "BSD-3-Clause"
-    },
-    "node_modules/@humanwhocodes/retry": {
-      "version": "0.4.3",
-      "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
-      "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": ">=18.18"
-      },
-      "funding": {
-        "type": "github",
-        "url": "https://github.com/sponsors/nzakas"
-      }
-    },
-    "node_modules/@isaacs/fs-minipass": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
-      "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "minipass": "^7.0.4"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/@mapbox/node-pre-gyp": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.3.tgz",
-      "integrity": "sha512-uwPAhccfFJlsfCxMYTwOdVfOz3xqyj8xYL3zJj8f0pb30tLohnnFPhLuqp4/qoEz8sNxe4SESZedcBojRefIzg==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "consola": "^3.2.3",
-        "detect-libc": "^2.0.0",
-        "https-proxy-agent": "^7.0.5",
-        "node-fetch": "^2.6.7",
-        "nopt": "^8.0.0",
-        "semver": "^7.5.3",
-        "tar": "^7.4.0"
-      },
-      "bin": {
-        "node-pre-gyp": "bin/node-pre-gyp"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/@microsoft/eslint-formatter-sarif/-/eslint-formatter-sarif-3.1.0.tgz",
-      "integrity": "sha512-/mn4UXziHzGXnKCg+r8HGgPy+w4RzpgdoqFuqaKOqUVBT5x2CygGefIrO4SusaY7t0C4gyIWMNu6YQT6Jw64Cw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "eslint": "^8.9.0",
-        "jschardet": "latest",
-        "lodash": "^4.17.14",
-        "utf8": "^3.0.0"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/@eslint/eslintrc": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
-      "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ajv": "^6.12.4",
-        "debug": "^4.3.2",
-        "espree": "^9.6.0",
-        "globals": "^13.19.0",
-        "ignore": "^5.2.0",
-        "import-fresh": "^3.2.1",
-        "js-yaml": "^4.1.0",
-        "minimatch": "^3.1.2",
-        "strip-json-comments": "^3.1.1"
-      },
-      "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/@eslint/js": {
-      "version": "8.57.1",
-      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz",
-      "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/ansi-styles": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
-      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "color-convert": "^2.0.1"
-      },
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/chalk": {
-      "version": "4.1.2",
-      "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
-      "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ansi-styles": "^4.1.0",
-        "supports-color": "^7.1.0"
-      },
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/chalk?sponsor=1"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/doctrine": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
-      "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "esutils": "^2.0.2"
-      },
-      "engines": {
-        "node": ">=6.0.0"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/escape-string-regexp": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
-      "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/eslint": {
-      "version": "8.57.1",
-      "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz",
-      "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==",
-      "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@eslint-community/eslint-utils": "^4.2.0",
-        "@eslint-community/regexpp": "^4.6.1",
-        "@eslint/eslintrc": "^2.1.4",
-        "@eslint/js": "8.57.1",
-        "@humanwhocodes/config-array": "^0.13.0",
-        "@humanwhocodes/module-importer": "^1.0.1",
-        "@nodelib/fs.walk": "^1.2.8",
-        "@ungap/structured-clone": "^1.2.0",
-        "ajv": "^6.12.4",
-        "chalk": "^4.0.0",
-        "cross-spawn": "^7.0.2",
-        "debug": "^4.3.2",
-        "doctrine": "^3.0.0",
-        "escape-string-regexp": "^4.0.0",
-        "eslint-scope": "^7.2.2",
-        "eslint-visitor-keys": "^3.4.3",
-        "espree": "^9.6.1",
-        "esquery": "^1.4.2",
-        "esutils": "^2.0.2",
-        "fast-deep-equal": "^3.1.3",
-        "file-entry-cache": "^6.0.1",
-        "find-up": "^5.0.0",
-        "glob-parent": "^6.0.2",
-        "globals": "^13.19.0",
-        "graphemer": "^1.4.0",
-        "ignore": "^5.2.0",
-        "imurmurhash": "^0.1.4",
-        "is-glob": "^4.0.0",
-        "is-path-inside": "^3.0.3",
-        "js-yaml": "^4.1.0",
-        "json-stable-stringify-without-jsonify": "^1.0.1",
-        "levn": "^0.4.1",
-        "lodash.merge": "^4.6.2",
-        "minimatch": "^3.1.2",
-        "natural-compare": "^1.4.0",
-        "optionator": "^0.9.3",
-        "strip-ansi": "^6.0.1",
-        "text-table": "^0.2.0"
-      },
-      "bin": {
-        "eslint": "bin/eslint.js"
-      },
-      "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/eslint-scope": {
-      "version": "7.2.2",
-      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
-      "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "dependencies": {
-        "esrecurse": "^4.3.0",
-        "estraverse": "^5.2.0"
-      },
-      "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/espree": {
-      "version": "9.6.1",
-      "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
-      "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "dependencies": {
-        "acorn": "^8.9.0",
-        "acorn-jsx": "^5.3.2",
-        "eslint-visitor-keys": "^3.4.1"
-      },
-      "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/file-entry-cache": {
-      "version": "6.0.1",
-      "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
-      "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "flat-cache": "^3.0.4"
-      },
-      "engines": {
-        "node": "^10.12.0 || >=12.0.0"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/flat-cache": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
-      "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "flatted": "^3.2.9",
-        "keyv": "^4.5.3",
-        "rimraf": "^3.0.2"
-      },
-      "engines": {
-        "node": "^10.12.0 || >=12.0.0"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/glob-parent": {
-      "version": "6.0.2",
-      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
-      "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "is-glob": "^4.0.3"
-      },
-      "engines": {
-        "node": ">=10.13.0"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/globals": {
-      "version": "13.24.0",
-      "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
-      "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "type-fest": "^0.20.2"
-      },
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@microsoft/eslint-formatter-sarif/node_modules/js-yaml": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz",
-      "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/puzrin"
-        },
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/nodeca"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "argparse": "^2.0.1"
-      },
-      "bin": {
-        "js-yaml": "bin/js-yaml.js"
-      }
-    },
-    "node_modules/@mswjs/interceptors": {
-      "version": "0.41.3",
-      "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.41.3.tgz",
-      "integrity": "sha512-cXu86tF4VQVfwz8W1SPbhoRyHJkti6mjH/XJIxp40jhO4j2k1m4KYrEykxqWPkFF3vrK4rgQppBh//AwyGSXPA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@open-draft/deferred-promise": "^2.2.0",
-        "@open-draft/logger": "^0.3.0",
-        "@open-draft/until": "^2.0.0",
-        "is-node-process": "^1.2.0",
-        "outvariant": "^1.4.3",
-        "strict-event-emitter": "^0.5.1"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/@napi-rs/wasm-runtime": {
-      "version": "0.2.12",
-      "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz",
-      "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==",
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "dependencies": {
-        "@emnapi/core": "^1.4.3",
-        "@emnapi/runtime": "^1.4.3",
-        "@tybys/wasm-util": "^0.10.0"
-      }
-    },
-    "node_modules/@nodable/entities": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.1.0.tgz",
-      "integrity": "sha512-nyT7T3nbMyBI/lvr6L5TyWbFJAI9FTgVRakNoBqCD+PmID8DzFrrNdLLtHMwMszOtqZa8PAOV24ZqDnQrhQINA==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/nodable"
-        }
-      ],
-      "license": "MIT"
-    },
-    "node_modules/@nodelib/fs.scandir": {
-      "version": "2.1.5",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@nodelib/fs.stat": "2.0.5",
-        "run-parallel": "^1.1.9"
-      },
-      "engines": {
-        "node": ">= 8"
-      }
-    },
-    "node_modules/@nodelib/fs.stat": {
-      "version": "2.0.5",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 8"
-      }
-    },
-    "node_modules/@nodelib/fs.walk": {
-      "version": "1.2.8",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@nodelib/fs.scandir": "2.1.5",
-        "fastq": "^1.6.0"
-      },
-      "engines": {
-        "node": ">= 8"
-      }
-    },
-    "node_modules/@octokit/auth-token": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz",
-      "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==",
-      "license": "MIT",
-      "engines": {
-        "node": ">= 20"
-      }
-    },
-    "node_modules/@octokit/core": {
-      "version": "7.0.7",
-      "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.7.tgz",
-      "integrity": "sha512-DcB0M3KFgr9ECI328lhBMVsyFT2DnmNucSBTqEN3exyNKUzkkpUSCHmTRcunF41Eou2TIQKW4seewri8ON9bSA==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/auth-token": "^6.0.0",
-        "@octokit/graphql": "^9.0.4",
-        "@octokit/request": "^10.0.13",
-        "@octokit/request-error": "^7.1.1",
-        "@octokit/types": "^17.0.0",
-        "before-after-hook": "^4.0.0",
-        "universal-user-agent": "^7.0.0"
-      },
-      "engines": {
-        "node": ">= 20"
-      }
-    },
-    "node_modules/@octokit/core/node_modules/@octokit/openapi-types": {
-      "version": "28.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-28.0.0.tgz",
-      "integrity": "sha512-0rFyLuyHvIj6uuZWuDslxkowFYdPXoNIkeAv4b27dzm2Tf4vGWXnPsMcxs7d65kLdMERgP3wc1AEPlqMz8e1cQ==",
-      "license": "MIT"
-    },
-    "node_modules/@octokit/core/node_modules/@octokit/types": {
-      "version": "17.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-17.0.0.tgz",
-      "integrity": "sha512-ByP1v7YL5SMveFPP7+sj0/ZuWCOOg/Chs4NafOMpq6WNIM/hdGY0S7C0TCGDBWu1aGmOxmUIhMx3cO+IdwYZ1Q==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^28.0.0"
-      }
-    },
-    "node_modules/@octokit/core/node_modules/universal-user-agent": {
-      "version": "7.0.3",
-      "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz",
-      "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==",
-      "license": "ISC"
-    },
-    "node_modules/@octokit/endpoint": {
-      "version": "11.0.4",
-      "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.4.tgz",
-      "integrity": "sha512-f1cOWoHPmxryJFknxbtDdjODWfV8A9tc8Aae6ermXPNgHFZ/x91AtHIz4gicEjL8hkJiip+u21QHJORfBv/qiA==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/types": "^17.0.0",
-        "universal-user-agent": "^7.0.2"
-      },
-      "engines": {
-        "node": ">= 20"
-      }
-    },
-    "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": {
-      "version": "28.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-28.0.0.tgz",
-      "integrity": "sha512-0rFyLuyHvIj6uuZWuDslxkowFYdPXoNIkeAv4b27dzm2Tf4vGWXnPsMcxs7d65kLdMERgP3wc1AEPlqMz8e1cQ==",
-      "license": "MIT"
-    },
-    "node_modules/@octokit/endpoint/node_modules/@octokit/types": {
-      "version": "17.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-17.0.0.tgz",
-      "integrity": "sha512-ByP1v7YL5SMveFPP7+sj0/ZuWCOOg/Chs4NafOMpq6WNIM/hdGY0S7C0TCGDBWu1aGmOxmUIhMx3cO+IdwYZ1Q==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^28.0.0"
-      }
-    },
-    "node_modules/@octokit/endpoint/node_modules/universal-user-agent": {
-      "version": "7.0.3",
-      "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz",
-      "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==",
-      "license": "ISC"
-    },
-    "node_modules/@octokit/graphql": {
-      "version": "9.0.4",
-      "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.4.tgz",
-      "integrity": "sha512-5s15CCiY8XXQ+FG+b1YQcl6Z2FA++nwAz/tg2VUrTmnMncP+2nnGUEYANImdnxsA2Fnq+Mbl7hDjUTw7cFAwcg==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/request": "^10.0.13",
-        "@octokit/types": "^17.0.0",
-        "universal-user-agent": "^7.0.0"
-      },
-      "engines": {
-        "node": ">= 20"
-      }
-    },
-    "node_modules/@octokit/graphql/node_modules/@octokit/openapi-types": {
-      "version": "28.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-28.0.0.tgz",
-      "integrity": "sha512-0rFyLuyHvIj6uuZWuDslxkowFYdPXoNIkeAv4b27dzm2Tf4vGWXnPsMcxs7d65kLdMERgP3wc1AEPlqMz8e1cQ==",
-      "license": "MIT"
-    },
-    "node_modules/@octokit/graphql/node_modules/@octokit/types": {
-      "version": "17.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-17.0.0.tgz",
-      "integrity": "sha512-ByP1v7YL5SMveFPP7+sj0/ZuWCOOg/Chs4NafOMpq6WNIM/hdGY0S7C0TCGDBWu1aGmOxmUIhMx3cO+IdwYZ1Q==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^28.0.0"
-      }
-    },
-    "node_modules/@octokit/graphql/node_modules/universal-user-agent": {
-      "version": "7.0.3",
-      "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz",
-      "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==",
-      "license": "ISC"
-    },
-    "node_modules/@octokit/openapi-types": {
-      "version": "27.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-27.0.0.tgz",
-      "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==",
-      "license": "MIT"
-    },
-    "node_modules/@octokit/plugin-paginate-rest": {
-      "version": "14.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz",
-      "integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/types": "^16.0.0"
-      },
-      "engines": {
-        "node": ">= 20"
-      },
-      "peerDependencies": {
-        "@octokit/core": ">=6"
-      }
-    },
-    "node_modules/@octokit/plugin-request-log": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
-      "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
-      "license": "MIT",
-      "peerDependencies": {
-        "@octokit/core": ">=3"
-      }
-    },
-    "node_modules/@octokit/plugin-rest-endpoint-methods": {
-      "version": "17.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-17.0.0.tgz",
-      "integrity": "sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/types": "^16.0.0"
-      },
-      "engines": {
-        "node": ">= 20"
-      },
-      "peerDependencies": {
-        "@octokit/core": ">=6"
-      }
-    },
-    "node_modules/@octokit/plugin-retry": {
-      "version": "8.1.1",
-      "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-8.1.1.tgz",
-      "integrity": "sha512-VCVvZ/R1+u3WuiBWpNavZ0mY4aaJNAsENrpBP9aLSR2QyOpQgd7DhM5j4AW7z4MQpnJYgwBPf0XqPQoNBRdQwg==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/request-error": "^7.1.1",
-        "@octokit/types": "^17.0.0",
-        "bottleneck": "^2.15.3"
-      },
-      "engines": {
-        "node": ">= 20"
-      },
-      "peerDependencies": {
-        "@octokit/core": ">=7"
-      }
-    },
-    "node_modules/@octokit/plugin-retry/node_modules/@octokit/openapi-types": {
-      "version": "28.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-28.0.0.tgz",
-      "integrity": "sha512-0rFyLuyHvIj6uuZWuDslxkowFYdPXoNIkeAv4b27dzm2Tf4vGWXnPsMcxs7d65kLdMERgP3wc1AEPlqMz8e1cQ==",
-      "license": "MIT"
-    },
-    "node_modules/@octokit/plugin-retry/node_modules/@octokit/types": {
-      "version": "17.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-17.0.0.tgz",
-      "integrity": "sha512-ByP1v7YL5SMveFPP7+sj0/ZuWCOOg/Chs4NafOMpq6WNIM/hdGY0S7C0TCGDBWu1aGmOxmUIhMx3cO+IdwYZ1Q==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^28.0.0"
-      }
-    },
-    "node_modules/@octokit/request": {
-      "version": "10.0.13",
-      "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.13.tgz",
-      "integrity": "sha512-v2269YxL9Yf+x3d+gRI63FP0vFQEiWgLyBzxe/Y+0yFDg2B/Tzf5dhh9VNfccVAQnfcfwQWyk/y6Bn7rUXXs7A==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/endpoint": "^11.0.3",
-        "@octokit/request-error": "^7.1.1",
-        "@octokit/types": "^17.0.0",
-        "content-type": "^2.0.0",
-        "json-with-bigint": "^3.5.3",
-        "universal-user-agent": "^7.0.2"
-      },
-      "engines": {
-        "node": ">= 20"
-      }
-    },
-    "node_modules/@octokit/request-error": {
-      "version": "7.1.1",
-      "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.1.tgz",
-      "integrity": "sha512-+eaY7G2VVpSf2pc5Gn1+mph837V/d/TYTJAgWL9Tb0ogGYcpN3IlAVFgjL+Vv93F/sevrxkvsYCedtpLdcFLzA==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/types": "^17.0.0"
-      },
-      "engines": {
-        "node": ">= 20"
-      }
-    },
-    "node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": {
-      "version": "28.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-28.0.0.tgz",
-      "integrity": "sha512-0rFyLuyHvIj6uuZWuDslxkowFYdPXoNIkeAv4b27dzm2Tf4vGWXnPsMcxs7d65kLdMERgP3wc1AEPlqMz8e1cQ==",
-      "license": "MIT"
-    },
-    "node_modules/@octokit/request-error/node_modules/@octokit/types": {
-      "version": "17.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-17.0.0.tgz",
-      "integrity": "sha512-ByP1v7YL5SMveFPP7+sj0/ZuWCOOg/Chs4NafOMpq6WNIM/hdGY0S7C0TCGDBWu1aGmOxmUIhMx3cO+IdwYZ1Q==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^28.0.0"
-      }
-    },
-    "node_modules/@octokit/request/node_modules/@octokit/openapi-types": {
-      "version": "28.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-28.0.0.tgz",
-      "integrity": "sha512-0rFyLuyHvIj6uuZWuDslxkowFYdPXoNIkeAv4b27dzm2Tf4vGWXnPsMcxs7d65kLdMERgP3wc1AEPlqMz8e1cQ==",
-      "license": "MIT"
-    },
-    "node_modules/@octokit/request/node_modules/@octokit/types": {
-      "version": "17.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-17.0.0.tgz",
-      "integrity": "sha512-ByP1v7YL5SMveFPP7+sj0/ZuWCOOg/Chs4NafOMpq6WNIM/hdGY0S7C0TCGDBWu1aGmOxmUIhMx3cO+IdwYZ1Q==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^28.0.0"
-      }
-    },
-    "node_modules/@octokit/request/node_modules/universal-user-agent": {
-      "version": "7.0.3",
-      "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz",
-      "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==",
-      "license": "ISC"
-    },
-    "node_modules/@octokit/types": {
-      "version": "16.0.0",
-      "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz",
-      "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==",
-      "license": "MIT",
-      "dependencies": {
-        "@octokit/openapi-types": "^27.0.0"
-      }
-    },
-    "node_modules/@open-draft/deferred-promise": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz",
-      "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@open-draft/logger": {
-      "version": "0.3.0",
-      "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz",
-      "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "is-node-process": "^1.2.0",
-        "outvariant": "^1.4.0"
-      }
-    },
-    "node_modules/@open-draft/until": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz",
-      "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@pkgr/core": {
-      "version": "0.1.1",
-      "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz",
-      "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "^12.20.0 || ^14.18.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/unts"
-      }
-    },
-    "node_modules/@protobuf-ts/plugin": {
-      "version": "2.9.4",
-      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.4.tgz",
-      "integrity": "sha512-Db5Laq5T3mc6ERZvhIhkj1rn57/p8gbWiCKxQWbZBBl20wMuqKoHbRw4tuD7FyXi+IkwTToaNVXymv5CY3E8Rw==",
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@protobuf-ts/plugin-framework": "^2.9.4",
-        "@protobuf-ts/protoc": "^2.9.4",
-        "@protobuf-ts/runtime": "^2.9.4",
-        "@protobuf-ts/runtime-rpc": "^2.9.4",
-        "typescript": "^3.9"
-      },
-      "bin": {
-        "protoc-gen-dump": "bin/protoc-gen-dump",
-        "protoc-gen-ts": "bin/protoc-gen-ts"
-      }
-    },
-    "node_modules/@protobuf-ts/plugin-framework": {
-      "version": "2.9.4",
-      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.4.tgz",
-      "integrity": "sha512-9nuX1kjdMliv+Pes8dQCKyVhjKgNNfwxVHg+tx3fLXSfZZRcUHMc1PMwB9/vTvc6gBKt9QGz5ERqSqZc0++E9A==",
-      "license": "(Apache-2.0 AND BSD-3-Clause)",
-      "dependencies": {
-        "@protobuf-ts/runtime": "^2.9.4",
-        "typescript": "^3.9"
-      }
-    },
-    "node_modules/@protobuf-ts/plugin-framework/node_modules/typescript": {
-      "version": "3.9.10",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
-      "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
-      "license": "Apache-2.0",
-      "bin": {
-        "tsc": "bin/tsc",
-        "tsserver": "bin/tsserver"
-      },
-      "engines": {
-        "node": ">=4.2.0"
-      }
-    },
-    "node_modules/@protobuf-ts/plugin/node_modules/typescript": {
-      "version": "3.9.10",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
-      "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
-      "license": "Apache-2.0",
-      "bin": {
-        "tsc": "bin/tsc",
-        "tsserver": "bin/tsserver"
-      },
-      "engines": {
-        "node": ">=4.2.0"
-      }
-    },
-    "node_modules/@protobuf-ts/protoc": {
-      "version": "2.9.4",
-      "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.4.tgz",
-      "integrity": "sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ==",
-      "license": "Apache-2.0",
-      "bin": {
-        "protoc": "protoc.js"
-      }
-    },
-    "node_modules/@protobuf-ts/runtime": {
-      "version": "2.11.1",
-      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.11.1.tgz",
-      "integrity": "sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==",
-      "license": "(Apache-2.0 AND BSD-3-Clause)"
-    },
-    "node_modules/@protobuf-ts/runtime-rpc": {
-      "version": "2.11.1",
-      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.11.1.tgz",
-      "integrity": "sha512-4CqqUmNA+/uMz00+d3CYKgElXO9VrEbucjnBFEjqI4GuDrEQ32MaI3q+9qPBvIGOlL4PmHXrzM32vBPWRhQKWQ==",
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@protobuf-ts/runtime": "^2.11.1"
-      }
-    },
-    "node_modules/@rollup/pluginutils": {
-      "version": "5.3.0",
-      "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz",
-      "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/estree": "^1.0.0",
-        "estree-walker": "^2.0.2",
-        "picomatch": "^4.0.2"
-      },
-      "engines": {
-        "node": ">=14.0.0"
-      },
-      "peerDependencies": {
-        "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
-      },
-      "peerDependenciesMeta": {
-        "rollup": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/@rtsao/scc": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
-      "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@sec-ant/readable-stream": {
-      "version": "0.4.1",
-      "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz",
-      "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@sindresorhus/base62": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/@sindresorhus/base62/-/base62-1.0.0.tgz",
-      "integrity": "sha512-TeheYy0ILzBEI/CO55CP6zJCSdSWeRtGnHy8U8dWSUH4I68iqTsy7HkMktR4xakThc9jotkPQUXT4ITdbV7cHA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@sindresorhus/merge-streams": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz",
-      "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==",
-      "dev": true,
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@sinonjs/commons": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz",
-      "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "type-detect": "4.0.8"
-      }
-    },
-    "node_modules/@sinonjs/fake-timers": {
-      "version": "15.4.0",
-      "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.4.0.tgz",
-      "integrity": "sha512-DsG+8/LscQIQg68J6Ef3dv10u6nVyetYn923s3/sus5eaGfTo1of5WMZSLf0UJc9KDuKPilPH0UDJCjvNbDNCA==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "@sinonjs/commons": "^3.0.1"
-      }
-    },
-    "node_modules/@sinonjs/samsam": {
-      "version": "10.0.2",
-      "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-10.0.2.tgz",
-      "integrity": "sha512-8lVwD1Df1BmzoaOLhMcGGcz/Jyr5QY2KSB75/YK1QgKzoabTeLdIVyhXNZK9ojfSKSdirbXqdbsXXqP9/Ve8+A==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "@sinonjs/commons": "^3.0.1",
-        "type-detect": "^4.1.0"
-      }
-    },
-    "node_modules/@sinonjs/samsam/node_modules/type-detect": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz",
-      "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/@tybys/wasm-util": {
-      "version": "0.10.1",
-      "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
-      "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "dependencies": {
-        "tslib": "^2.4.0"
-      }
-    },
-    "node_modules/@types/archiver": {
-      "version": "8.0.0",
-      "resolved": "https://registry.npmjs.org/@types/archiver/-/archiver-8.0.0.tgz",
-      "integrity": "sha512-YpXPbEuv9+eUIPPQWUPahj3cvs9isWRuF+J4z+KbdYVDO3rWorWQFxUVHnwPu2AgKwvgpki5F2VMX0Xx+mX45A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/node": "*",
-        "@types/readdir-glob": "*"
-      }
-    },
-    "node_modules/@types/color-name": {
-      "version": "1.1.1",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@types/estree": {
-      "version": "1.0.8",
-      "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
-      "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
-      "dev": true
-    },
-    "node_modules/@types/follow-redirects": {
-      "version": "1.14.4",
-      "resolved": "https://registry.npmjs.org/@types/follow-redirects/-/follow-redirects-1.14.4.tgz",
-      "integrity": "sha512-GWXfsD0Jc1RWiFmMuMFCpXMzi9L7oPDVwxUnZdg89kDNnqsRfUKXEtUYtA98A6lig1WXH/CYY/fvPW9HuN5fTA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/node": "*"
-      }
-    },
-    "node_modules/@types/js-yaml": {
-      "version": "4.0.9",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@types/json-schema": {
-      "version": "7.0.15",
-      "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
-      "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@types/json5": {
-      "version": "0.0.29",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@types/node": {
-      "version": "20.19.43",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz",
-      "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "undici-types": "~6.21.0"
-      }
-    },
-    "node_modules/@types/node-forge": {
-      "version": "1.3.14",
-      "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.14.tgz",
-      "integrity": "sha512-mhVF2BnD4BO+jtOp7z1CdzaK4mbuK0LLQYAvdOLqHTavxFNq4zA1EmYkpnFjP8HOUzedfQkRnp0E2ulSAYSzAw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/node": "*"
-      }
-    },
-    "node_modules/@types/readdir-glob": {
-      "version": "1.1.5",
-      "resolved": "https://registry.npmjs.org/@types/readdir-glob/-/readdir-glob-1.1.5.tgz",
-      "integrity": "sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/node": "*"
-      }
-    },
-    "node_modules/@types/sarif": {
-      "version": "2.1.7",
-      "resolved": "https://registry.npmjs.org/@types/sarif/-/sarif-2.1.7.tgz",
-      "integrity": "sha512-kRz0VEkJqWLf1LLVN4pT1cg1Z9wAuvI6L97V3m2f5B76Tg8d413ddvLBPTEHAZJlnn4XSvu0FkZtViCQGVyrXQ==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@types/semver": {
-      "version": "7.8.0",
-      "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.8.0.tgz",
-      "integrity": "sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@types/sinon": {
-      "version": "22.0.0",
-      "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-22.0.0.tgz",
-      "integrity": "sha512-TDbVpbccc2HfiqHR09Argj3mHV1KMW7sCCKj52fsl8lbRLkEn7fB1966EWhOKWUBcqfBueZuPoA7/OK1CKiy3g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/sinonjs__fake-timers": "*"
-      }
-    },
-    "node_modules/@types/sinonjs__fake-timers": {
-      "version": "8.1.2",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/@typescript-eslint/eslint-plugin": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.66.0.tgz",
-      "integrity": "sha512-p088eaGrzYz1s+7cov0aMOCkNGTJlVxF4jgubf28c8L0Cv9Rloj8YBHnv4hXLq6IIEE1AsjNWavO+k+8kP2Y0A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@eslint-community/regexpp": "^4.12.2",
-        "@typescript-eslint/scope-manager": "8.66.0",
-        "@typescript-eslint/type-utils": "8.66.0",
-        "@typescript-eslint/utils": "8.66.0",
-        "@typescript-eslint/visitor-keys": "8.66.0",
-        "ignore": "^7.0.5",
-        "natural-compare": "^1.4.0",
-        "ts-api-utils": "^2.5.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependencies": {
-        "@typescript-eslint/parser": "^8.66.0",
-        "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
-        "typescript": ">=4.8.4 <6.1.0"
-      }
-    },
-    "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
-      "version": "7.0.5",
-      "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
-      "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 4"
-      }
-    },
-    "node_modules/@typescript-eslint/parser": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.66.0.tgz",
-      "integrity": "sha512-X6ypGChaWYk6PBtUg2BwuTZEFFcHJAtGTVJ9/lCTOufhZ4i9fNolQNnktq+kkMCwMj7V8Svsq7+TxSDslmhE0g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@typescript-eslint/scope-manager": "8.66.0",
-        "@typescript-eslint/types": "8.66.0",
-        "@typescript-eslint/typescript-estree": "8.66.0",
-        "@typescript-eslint/visitor-keys": "8.66.0",
-        "debug": "^4.4.3"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependencies": {
-        "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
-        "typescript": ">=4.8.4 <6.1.0"
-      }
-    },
-    "node_modules/@typescript-eslint/parser/node_modules/debug": {
-      "version": "4.4.3",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
-      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/@typescript-eslint/project-service": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.66.0.tgz",
-      "integrity": "sha512-7MthGPTt4BP69lSryqpqq8HQqxuzynssckL/jyDyk3+TNMQ3y2jFWkptCrktWvBrP+EH787Nl5N5Qpw7WZg+5g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@typescript-eslint/tsconfig-utils": "^8.66.0",
-        "@typescript-eslint/types": "^8.66.0",
-        "debug": "^4.4.3"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependencies": {
-        "typescript": ">=4.8.4 <6.1.0"
-      }
-    },
-    "node_modules/@typescript-eslint/project-service/node_modules/debug": {
-      "version": "4.4.3",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
-      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/@typescript-eslint/scope-manager": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.66.0.tgz",
-      "integrity": "sha512-8TGcH25j9zqJ/IULB/ppyhRvxA8QYfFEZ7nfbg6/BN9spDgb8fPWQXlE5l8TWBL50EtUx007uZ1o9VOwrq2/9g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@typescript-eslint/types": "8.66.0",
-        "@typescript-eslint/visitor-keys": "8.66.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      }
-    },
-    "node_modules/@typescript-eslint/tsconfig-utils": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.66.0.tgz",
-      "integrity": "sha512-9D5gLYZG4rOjcoag8MQ/fWI8WqA9wcPDyOGyWtWFhvM1lHRbliqUSPIY5J3zqCU1tvSwzXxnnjhQhz5Ne7mJ4g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependencies": {
-        "typescript": ">=4.8.4 <6.1.0"
-      }
-    },
-    "node_modules/@typescript-eslint/type-utils": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.66.0.tgz",
-      "integrity": "sha512-LG2dWfjZQQp0ADtAu/EWJVayefGL2UEZ3CDeI44D9v3rXB/WYUqE/jpO28KrEKul5AySrmI+Zh1v6v+xW2U9+g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@typescript-eslint/types": "8.66.0",
-        "@typescript-eslint/typescript-estree": "8.66.0",
-        "@typescript-eslint/utils": "8.66.0",
-        "debug": "^4.4.3",
-        "ts-api-utils": "^2.5.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependencies": {
-        "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
-        "typescript": ">=4.8.4 <6.1.0"
-      }
-    },
-    "node_modules/@typescript-eslint/type-utils/node_modules/debug": {
-      "version": "4.4.3",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
-      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/@typescript-eslint/types": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.66.0.tgz",
-      "integrity": "sha512-H6gcYaSDOyvL3AD/jHUtUFo2jqGgn/F6nuyuZSu0QTesxL+cP4dQoIMrODRofuJC09g64+WgZ6tE19Y1N2YIFQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      }
-    },
-    "node_modules/@typescript-eslint/typescript-estree": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.66.0.tgz",
-      "integrity": "sha512-8/x4INiiQb10jGgXYD7116/zQ+OL84ZIFn0za68wwFHCanT/VLbBEroWht8RV8fn0/ZCAoazHLQgwUC0UQcDfg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@typescript-eslint/project-service": "8.66.0",
-        "@typescript-eslint/tsconfig-utils": "8.66.0",
-        "@typescript-eslint/types": "8.66.0",
-        "@typescript-eslint/visitor-keys": "8.66.0",
-        "debug": "^4.4.3",
-        "minimatch": "^10.2.2",
-        "semver": "^7.7.3",
-        "tinyglobby": "^0.2.15",
-        "ts-api-utils": "^2.5.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependencies": {
-        "typescript": ">=4.8.4 <6.1.0"
-      }
-    },
-    "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": {
-      "version": "4.0.4",
-      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
-      "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "18 || 20 || >=22"
-      }
-    },
-    "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
-      "version": "5.0.9",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
-      "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "balanced-match": "^4.0.2"
-      },
-      "engines": {
-        "node": "20 || >=22"
-      }
-    },
-    "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": {
-      "version": "4.4.3",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
-      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
-      "version": "10.2.6",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
-      "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
-      "dev": true,
-      "license": "BlueOak-1.0.0",
-      "dependencies": {
-        "brace-expansion": "^5.0.8"
-      },
-      "engines": {
-        "node": "18 || 20 || >=22"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      }
-    },
-    "node_modules/@typescript-eslint/utils": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.66.0.tgz",
-      "integrity": "sha512-jasearZPolBw5NJNYGMwxzHMF83niVWmMU1VdHzG1CyfI2VS7f7nZltnKtHcg20hW+7Uo5GfK4MeDPoU3qI8EA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@eslint-community/eslint-utils": "^4.9.1",
-        "@typescript-eslint/scope-manager": "8.66.0",
-        "@typescript-eslint/types": "8.66.0",
-        "@typescript-eslint/typescript-estree": "8.66.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependencies": {
-        "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
-        "typescript": ">=4.8.4 <6.1.0"
-      }
-    },
-    "node_modules/@typescript-eslint/visitor-keys": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.66.0.tgz",
-      "integrity": "sha512-dkKR8q+lKciskj1Y3vthHktl+3cMLWGyVUP23bRiPZ5O9BRT++4EqDDV+TVeIKBL1VXVEqrJlz8MYbcnvJcAlg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@typescript-eslint/types": "8.66.0",
-        "eslint-visitor-keys": "^5.0.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      }
-    },
-    "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
-      "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": "^20.19.0 || ^22.13.0 || >=24"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/@typespec/ts-http-runtime": {
-      "version": "0.3.2",
-      "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.2.tgz",
-      "integrity": "sha512-IlqQ/Gv22xUC1r/WQm4StLkYQmaaTsXAhUVsNE0+xiyf0yRFiH5++q78U3bw6bLKDCTmh0uqKB9eG9+Bt75Dkg==",
-      "license": "MIT",
-      "dependencies": {
-        "http-proxy-agent": "^7.0.0",
-        "https-proxy-agent": "^7.0.0",
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/@ungap/structured-clone": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz",
-      "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",
-      "dev": true,
-      "license": "ISC"
-    },
-    "node_modules/@unrs/resolver-binding-android-arm-eabi": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz",
-      "integrity": "sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==",
-      "cpu": [
-        "arm"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "android"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-android-arm64": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz",
-      "integrity": "sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "android"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-darwin-arm64": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz",
-      "integrity": "sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "darwin"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-darwin-x64": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz",
-      "integrity": "sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "darwin"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-freebsd-x64": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz",
-      "integrity": "sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "freebsd"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz",
-      "integrity": "sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==",
-      "cpu": [
-        "arm"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz",
-      "integrity": "sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==",
-      "cpu": [
-        "arm"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-arm64-gnu": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz",
-      "integrity": "sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-arm64-musl": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz",
-      "integrity": "sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz",
-      "integrity": "sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==",
-      "cpu": [
-        "ppc64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz",
-      "integrity": "sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==",
-      "cpu": [
-        "riscv64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-riscv64-musl": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz",
-      "integrity": "sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==",
-      "cpu": [
-        "riscv64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-s390x-gnu": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz",
-      "integrity": "sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==",
-      "cpu": [
-        "s390x"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-x64-gnu": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz",
-      "integrity": "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-linux-x64-musl": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz",
-      "integrity": "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "linux"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-wasm32-wasi": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz",
-      "integrity": "sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==",
-      "cpu": [
-        "wasm32"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "dependencies": {
-        "@napi-rs/wasm-runtime": "^0.2.11"
-      },
-      "engines": {
-        "node": ">=14.0.0"
-      }
-    },
-    "node_modules/@unrs/resolver-binding-win32-arm64-msvc": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz",
-      "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==",
-      "cpu": [
-        "arm64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "win32"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-win32-ia32-msvc": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz",
-      "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==",
-      "cpu": [
-        "ia32"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "win32"
-      ]
-    },
-    "node_modules/@unrs/resolver-binding-win32-x64-msvc": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz",
-      "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==",
-      "cpu": [
-        "x64"
-      ],
-      "dev": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "win32"
-      ]
-    },
-    "node_modules/@vercel/nft": {
-      "version": "0.29.4",
-      "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.29.4.tgz",
-      "integrity": "sha512-6lLqMNX3TuycBPABycx7A9F1bHQR7kiQln6abjFbPrf5C/05qHM9M5E4PeTE59c7z8g6vHnx1Ioihb2AQl7BTA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@mapbox/node-pre-gyp": "^2.0.0",
-        "@rollup/pluginutils": "^5.1.3",
-        "acorn": "^8.6.0",
-        "acorn-import-attributes": "^1.9.5",
-        "async-sema": "^3.1.1",
-        "bindings": "^1.4.0",
-        "estree-walker": "2.0.2",
-        "glob": "^10.4.5",
-        "graceful-fs": "^4.2.9",
-        "node-gyp-build": "^4.2.2",
-        "picomatch": "^4.0.2",
-        "resolve-from": "^5.0.0"
-      },
-      "bin": {
-        "nft": "out/cli.js"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/abbrev": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz",
-      "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==",
-      "dev": true,
-      "license": "ISC",
-      "engines": {
-        "node": "^18.17.0 || >=20.5.0"
-      }
-    },
-    "node_modules/abort-controller": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
-      "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
-      "license": "MIT",
-      "dependencies": {
-        "event-target-shim": "^5.0.0"
-      },
-      "engines": {
-        "node": ">=6.5"
-      }
-    },
-    "node_modules/acorn": {
-      "version": "8.16.0",
-      "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz",
-      "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
-      "dev": true,
-      "license": "MIT",
-      "bin": {
-        "acorn": "bin/acorn"
-      },
-      "engines": {
-        "node": ">=0.4.0"
-      }
-    },
-    "node_modules/acorn-import-attributes": {
-      "version": "1.9.5",
-      "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz",
-      "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==",
-      "dev": true,
-      "license": "MIT",
-      "peerDependencies": {
-        "acorn": "^8"
-      }
-    },
-    "node_modules/acorn-jsx": {
-      "version": "5.3.2",
-      "dev": true,
-      "license": "MIT",
-      "peerDependencies": {
-        "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
-      }
-    },
-    "node_modules/acorn-walk": {
-      "version": "8.3.5",
-      "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz",
-      "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "acorn": "^8.11.0"
-      },
-      "engines": {
-        "node": ">=0.4.0"
-      }
-    },
-    "node_modules/agent-base": {
-      "version": "7.1.3",
-      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz",
-      "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==",
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/ajv": {
-      "version": "6.15.0",
-      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz",
-      "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "fast-deep-equal": "^3.1.1",
-        "fast-json-stable-stringify": "^2.0.0",
-        "json-schema-traverse": "^0.4.1",
-        "uri-js": "^4.2.2"
-      },
-      "funding": {
-        "type": "github",
-        "url": "https://github.com/sponsors/epoberezkin"
-      }
-    },
-    "node_modules/ansi-regex": {
-      "version": "5.0.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/ansi-styles": {
-      "version": "6.2.3",
-      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
-      "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
-      }
-    },
-    "node_modules/archiver": {
-      "version": "8.0.0",
-      "resolved": "https://registry.npmjs.org/archiver/-/archiver-8.0.0.tgz",
-      "integrity": "sha512-fV1orZfsnPn9BaSByR/qE67rJCLJEy2Ox5bq7nJh+jquWaNh6Sfec75kJ2T6PtdGUbPQlrVoSVCEOa5SdiTQ1g==",
-      "license": "MIT",
-      "dependencies": {
-        "async": "^3.2.4",
-        "buffer-crc32": "^1.0.0",
-        "is-stream": "^4.0.0",
-        "lazystream": "^1.0.0",
-        "normalize-path": "^3.0.0",
-        "readable-stream": "^4.0.0",
-        "readdir-glob": "^3.0.0",
-        "tar-stream": "^3.0.0",
-        "zip-stream": "^7.0.2"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/archiver-utils": {
-      "version": "5.0.2",
-      "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz",
-      "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==",
-      "license": "MIT",
-      "dependencies": {
-        "glob": "^10.0.0",
-        "graceful-fs": "^4.2.0",
-        "is-stream": "^2.0.1",
-        "lazystream": "^1.0.0",
-        "lodash": "^4.17.15",
-        "normalize-path": "^3.0.0",
-        "readable-stream": "^4.0.0"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/archiver-utils/node_modules/is-stream": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
-      "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/are-docs-informative": {
-      "version": "0.0.2",
-      "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz",
-      "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=14"
-      }
-    },
-    "node_modules/argparse": {
-      "version": "2.0.1",
-      "license": "Python-2.0"
-    },
-    "node_modules/aria-query": {
-      "version": "5.3.2",
-      "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",
-      "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/array-buffer-byte-length": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz",
-      "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "is-array-buffer": "^3.0.5"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/array-find-index": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
-      "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==",
-      "dev": true,
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/array-includes": {
-      "version": "3.1.9",
-      "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz",
-      "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.4",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.24.0",
-        "es-object-atoms": "^1.1.1",
-        "get-intrinsic": "^1.3.0",
-        "is-string": "^1.1.1",
-        "math-intrinsics": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/array.prototype.findlastindex": {
-      "version": "1.2.6",
-      "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz",
-      "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.4",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.9",
-        "es-errors": "^1.3.0",
-        "es-object-atoms": "^1.1.1",
-        "es-shim-unscopables": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/array.prototype.flat": {
-      "version": "1.3.3",
-      "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz",
-      "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.5",
-        "es-shim-unscopables": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/array.prototype.flatmap": {
-      "version": "1.3.3",
-      "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz",
-      "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.5",
-        "es-shim-unscopables": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/arraybuffer.prototype.slice": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz",
-      "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "array-buffer-byte-length": "^1.0.1",
-        "call-bind": "^1.0.8",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.5",
-        "es-errors": "^1.3.0",
-        "get-intrinsic": "^1.2.6",
-        "is-array-buffer": "^3.0.4"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/arrgv": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/arrgv/-/arrgv-1.0.2.tgz",
-      "integrity": "sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==",
-      "dev": true,
-      "engines": {
-        "node": ">=8.0.0"
-      }
-    },
-    "node_modules/arrify": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz",
-      "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==",
-      "dev": true,
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/ast-types-flow": {
-      "version": "0.0.8",
-      "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz",
-      "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/async": {
-      "version": "3.2.6",
-      "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
-      "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==",
-      "license": "MIT"
-    },
-    "node_modules/async-function": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz",
-      "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/async-sema": {
-      "version": "3.1.1",
-      "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.1.tgz",
-      "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/ava": {
-      "version": "6.4.1",
-      "resolved": "https://registry.npmjs.org/ava/-/ava-6.4.1.tgz",
-      "integrity": "sha512-vxmPbi1gZx9zhAjHBgw81w/iEDKcrokeRk/fqDTyA2DQygZ0o+dUGRHFOtX8RA5N0heGJTTsIk7+xYxitDb61Q==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@vercel/nft": "^0.29.4",
-        "acorn": "^8.15.0",
-        "acorn-walk": "^8.3.4",
-        "ansi-styles": "^6.2.1",
-        "arrgv": "^1.0.2",
-        "arrify": "^3.0.0",
-        "callsites": "^4.2.0",
-        "cbor": "^10.0.9",
-        "chalk": "^5.4.1",
-        "chunkd": "^2.0.1",
-        "ci-info": "^4.3.0",
-        "ci-parallel-vars": "^1.0.1",
-        "cli-truncate": "^4.0.0",
-        "code-excerpt": "^4.0.0",
-        "common-path-prefix": "^3.0.0",
-        "concordance": "^5.0.4",
-        "currently-unhandled": "^0.4.1",
-        "debug": "^4.4.1",
-        "emittery": "^1.2.0",
-        "figures": "^6.1.0",
-        "globby": "^14.1.0",
-        "ignore-by-default": "^2.1.0",
-        "indent-string": "^5.0.0",
-        "is-plain-object": "^5.0.0",
-        "is-promise": "^4.0.0",
-        "matcher": "^5.0.0",
-        "memoize": "^10.1.0",
-        "ms": "^2.1.3",
-        "p-map": "^7.0.3",
-        "package-config": "^5.0.0",
-        "picomatch": "^4.0.2",
-        "plur": "^5.1.0",
-        "pretty-ms": "^9.2.0",
-        "resolve-cwd": "^3.0.0",
-        "stack-utils": "^2.0.6",
-        "strip-ansi": "^7.1.0",
-        "supertap": "^3.0.1",
-        "temp-dir": "^3.0.0",
-        "write-file-atomic": "^6.0.0",
-        "yargs": "^17.7.2"
-      },
-      "bin": {
-        "ava": "entrypoints/cli.mjs"
-      },
-      "engines": {
-        "node": "^18.18 || ^20.8 || ^22 || ^23 || >=24"
-      },
-      "peerDependencies": {
-        "@ava/typescript": "*"
-      },
-      "peerDependenciesMeta": {
-        "@ava/typescript": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/ava/node_modules/ansi-regex": {
-      "version": "6.2.2",
-      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
-      "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/ansi-regex?sponsor=1"
-      }
-    },
-    "node_modules/ava/node_modules/callsites": {
-      "version": "4.2.0",
-      "resolved": "https://registry.npmjs.org/callsites/-/callsites-4.2.0.tgz",
-      "integrity": "sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==",
-      "dev": true,
-      "engines": {
-        "node": ">=12.20"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/ava/node_modules/debug": {
-      "version": "4.4.3",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
-      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/ava/node_modules/strip-ansi": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
-      "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ansi-regex": "^6.2.2"
-      },
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/strip-ansi?sponsor=1"
-      }
-    },
-    "node_modules/available-typed-arrays": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
-      "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "possible-typed-array-names": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/axe-core": {
-      "version": "4.10.2",
-      "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.2.tgz",
-      "integrity": "sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==",
-      "dev": true,
-      "license": "MPL-2.0",
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/axobject-query": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz",
-      "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/b4a": {
-      "version": "1.6.7",
-      "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz",
-      "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==",
-      "license": "Apache-2.0"
-    },
-    "node_modules/balanced-match": {
-      "version": "1.0.0",
-      "license": "MIT"
-    },
-    "node_modules/bare-events": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz",
-      "integrity": "sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==",
-      "license": "Apache-2.0",
-      "optional": true
-    },
-    "node_modules/base64-js": {
-      "version": "1.5.1",
-      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
-      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "license": "MIT"
-    },
-    "node_modules/before-after-hook": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-4.0.0.tgz",
-      "integrity": "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==",
-      "license": "Apache-2.0"
-    },
-    "node_modules/binary": {
-      "version": "0.3.0",
-      "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
-      "integrity": "sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==",
-      "license": "MIT",
-      "dependencies": {
-        "buffers": "~0.1.1",
-        "chainsaw": "~0.1.0"
-      },
-      "engines": {
-        "node": "*"
-      }
-    },
-    "node_modules/bindings": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
-      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "file-uri-to-path": "1.0.0"
-      }
-    },
-    "node_modules/blueimp-md5": {
-      "version": "2.19.0",
-      "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
-      "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==",
-      "dev": true
-    },
-    "node_modules/bottleneck": {
-      "version": "2.19.5",
-      "license": "MIT"
-    },
-    "node_modules/brace-expansion": {
-      "version": "1.1.18",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",
-      "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",
-      "license": "MIT",
-      "dependencies": {
-        "balanced-match": "^1.0.0",
-        "concat-map": "0.0.1"
-      }
-    },
-    "node_modules/braces": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
-      "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "fill-range": "^7.1.1"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/browserslist": {
-      "version": "4.24.2",
-      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz",
-      "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "opencollective",
-          "url": "https://opencollective.com/browserslist"
-        },
-        {
-          "type": "tidelift",
-          "url": "https://tidelift.com/funding/github/npm/browserslist"
-        },
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/ai"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "caniuse-lite": "^1.0.30001669",
-        "electron-to-chromium": "^1.5.41",
-        "node-releases": "^2.0.18",
-        "update-browserslist-db": "^1.1.1"
-      },
-      "bin": {
-        "browserslist": "cli.js"
-      },
-      "engines": {
-        "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
-      }
-    },
-    "node_modules/buffer": {
-      "version": "6.0.3",
-      "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
-      "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "base64-js": "^1.3.1",
-        "ieee754": "^1.2.1"
-      }
-    },
-    "node_modules/buffer-crc32": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz",
-      "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=8.0.0"
-      }
-    },
-    "node_modules/buffers": {
-      "version": "0.1.1",
-      "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
-      "integrity": "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==",
-      "engines": {
-        "node": ">=0.2.0"
-      }
-    },
-    "node_modules/call-bind": {
-      "version": "1.0.8",
-      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
-      "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind-apply-helpers": "^1.0.0",
-        "es-define-property": "^1.0.0",
-        "get-intrinsic": "^1.2.4",
-        "set-function-length": "^1.2.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/call-bind-apply-helpers": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
-      "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
-      "dev": true,
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "function-bind": "^1.1.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/call-bound": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
-      "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind-apply-helpers": "^1.0.2",
-        "get-intrinsic": "^1.3.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/callsites": {
-      "version": "3.1.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/caniuse-lite": {
-      "version": "1.0.30001766",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001766.tgz",
-      "integrity": "sha512-4C0lfJ0/YPjJQHagaE9x2Elb69CIqEPZeG0anQt9SIvIoOH4a4uaRl73IavyO+0qZh6MDLH//DrXThEYKHkmYA==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "opencollective",
-          "url": "https://opencollective.com/browserslist"
-        },
-        {
-          "type": "tidelift",
-          "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
-        },
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/ai"
-        }
-      ],
-      "license": "CC-BY-4.0"
-    },
-    "node_modules/cbor": {
-      "version": "10.0.12",
-      "resolved": "https://registry.npmjs.org/cbor/-/cbor-10.0.12.tgz",
-      "integrity": "sha512-exQDevYd7ZQLP4moMQcZkKCVZsXLAtUSflObr3xTh4xzFIv/xBCdvCd6L259kQOUP2kcTC0jvC6PpZIf/WmRXA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "nofilter": "^3.0.2"
-      },
-      "engines": {
-        "node": ">=20"
-      }
-    },
-    "node_modules/chainsaw": {
-      "version": "0.1.0",
-      "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",
-      "integrity": "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==",
-      "license": "MIT/X11",
-      "dependencies": {
-        "traverse": ">=0.3.0 <0.4"
-      },
-      "engines": {
-        "node": "*"
-      }
-    },
-    "node_modules/chalk": {
-      "version": "5.6.2",
-      "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
-      "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "^12.17.0 || ^14.13 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/chalk?sponsor=1"
-      }
-    },
-    "node_modules/chownr": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
-      "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==",
-      "dev": true,
-      "license": "BlueOak-1.0.0",
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/chunkd": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/chunkd/-/chunkd-2.0.1.tgz",
-      "integrity": "sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==",
-      "dev": true
-    },
-    "node_modules/ci-info": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz",
-      "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/sibiraj-s"
-        }
-      ],
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/ci-parallel-vars": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/ci-parallel-vars/-/ci-parallel-vars-1.0.1.tgz",
-      "integrity": "sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==",
-      "dev": true
-    },
-    "node_modules/cli-truncate": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz",
-      "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "slice-ansi": "^5.0.0",
-        "string-width": "^7.0.0"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/cli-truncate/node_modules/ansi-regex": {
-      "version": "6.2.2",
-      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
-      "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/ansi-regex?sponsor=1"
-      }
-    },
-    "node_modules/cli-truncate/node_modules/emoji-regex": {
-      "version": "10.6.0",
-      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
-      "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/cli-truncate/node_modules/string-width": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
-      "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "emoji-regex": "^10.3.0",
-        "get-east-asian-width": "^1.0.0",
-        "strip-ansi": "^7.1.0"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/cli-truncate/node_modules/strip-ansi": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
-      "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ansi-regex": "^6.2.2"
-      },
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/strip-ansi?sponsor=1"
-      }
-    },
-    "node_modules/cliui": {
-      "version": "8.0.1",
-      "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
-      "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "string-width": "^4.2.0",
-        "strip-ansi": "^6.0.1",
-        "wrap-ansi": "^7.0.0"
-      },
-      "engines": {
-        "node": ">=12"
-      }
-    },
-    "node_modules/code-excerpt": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-4.0.0.tgz",
-      "integrity": "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==",
-      "dev": true,
-      "dependencies": {
-        "convert-to-spaces": "^2.0.1"
-      },
-      "engines": {
-        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
-      }
-    },
-    "node_modules/color-convert": {
-      "version": "2.0.1",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "color-name": "~1.1.4"
-      },
-      "engines": {
-        "node": ">=7.0.0"
-      }
-    },
-    "node_modules/color-name": {
-      "version": "1.1.4",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/comment-parser": {
-      "version": "1.4.6",
-      "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.6.tgz",
-      "integrity": "sha512-ObxuY6vnbWTN6Od72xfwN9DbzC7Y2vv8u1Soi9ahRKL37gb6y1qk6/dgjs+3JWuXJHWvsg3BXIwzd/rkmAwavg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 12.0.0"
-      }
-    },
-    "node_modules/common-path-prefix": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
-      "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==",
-      "dev": true
-    },
-    "node_modules/compress-commons": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-7.0.1.tgz",
-      "integrity": "sha512-g0S8KAD8qf4+V//pr3BfB1aBnARLXNz2Gx+jmHU0LEriUuoQUOPOulVquHKTJ8+EAIIO7fhseNDr9wK5Q9FKBQ==",
-      "license": "MIT",
-      "dependencies": {
-        "crc-32": "^1.2.0",
-        "crc32-stream": "^7.0.1",
-        "is-stream": "^4.0.0",
-        "normalize-path": "^3.0.0",
-        "readable-stream": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/concat-map": {
-      "version": "0.0.1",
-      "license": "MIT"
-    },
-    "node_modules/concordance": {
-      "version": "5.0.4",
-      "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz",
-      "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==",
-      "dev": true,
-      "dependencies": {
-        "date-time": "^3.1.0",
-        "esutils": "^2.0.3",
-        "fast-diff": "^1.2.0",
-        "js-string-escape": "^1.0.1",
-        "lodash": "^4.17.15",
-        "md5-hex": "^3.0.1",
-        "semver": "^7.3.2",
-        "well-known-symbols": "^2.0.0"
-      },
-      "engines": {
-        "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14"
-      }
-    },
-    "node_modules/consola": {
-      "version": "3.4.2",
-      "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
-      "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "^14.18.0 || >=16.10.0"
-      }
-    },
-    "node_modules/content-type": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
-      "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/express"
-      }
-    },
-    "node_modules/convert-to-spaces": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz",
-      "integrity": "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==",
-      "dev": true,
-      "engines": {
-        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
-      }
-    },
-    "node_modules/core-util-is": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
-      "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
-      "license": "MIT"
-    },
-    "node_modules/crc-32": {
-      "version": "1.2.2",
-      "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
-      "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
-      "license": "Apache-2.0",
-      "bin": {
-        "crc32": "bin/crc32.njs"
-      },
-      "engines": {
-        "node": ">=0.8"
-      }
-    },
-    "node_modules/crc32-stream": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-7.0.1.tgz",
-      "integrity": "sha512-IBWsY8xznyQrcHn8h4bC8/4ErNke5elzgG8GcqF4RFPw6aHkWWRc7Tgw6upjaTX/CT/yQgqYENkxYsTYN+hW2g==",
-      "license": "MIT",
-      "dependencies": {
-        "crc-32": "^1.2.0",
-        "readable-stream": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/cross-spawn": {
-      "version": "7.0.6",
-      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
-      "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
-      "dev": true,
-      "dependencies": {
-        "path-key": "^3.1.0",
-        "shebang-command": "^2.0.0",
-        "which": "^2.0.1"
-      },
-      "engines": {
-        "node": ">= 8"
-      }
-    },
-    "node_modules/currently-unhandled": {
-      "version": "0.4.1",
-      "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz",
-      "integrity": "sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==",
-      "dev": true,
-      "dependencies": {
-        "array-find-index": "^1.0.1"
-      },
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/damerau-levenshtein": {
-      "version": "1.0.8",
-      "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz",
-      "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==",
-      "dev": true,
-      "license": "BSD-2-Clause"
-    },
-    "node_modules/data-view-buffer": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz",
-      "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "es-errors": "^1.3.0",
-        "is-data-view": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/data-view-byte-length": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz",
-      "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "es-errors": "^1.3.0",
-        "is-data-view": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/inspect-js"
-      }
-    },
-    "node_modules/data-view-byte-offset": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz",
-      "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "es-errors": "^1.3.0",
-        "is-data-view": "^1.0.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/date-time": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz",
-      "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==",
-      "dev": true,
-      "dependencies": {
-        "time-zone": "^1.0.0"
-      },
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/debug": {
-      "version": "4.4.1",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
-      "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/deep-is": {
-      "version": "0.1.4",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/define-data-property": {
-      "version": "1.1.4",
-      "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
-      "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
-      "dev": true,
-      "dependencies": {
-        "es-define-property": "^1.0.0",
-        "es-errors": "^1.3.0",
-        "gopd": "^1.0.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/define-properties": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz",
-      "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==",
-      "dev": true,
-      "dependencies": {
-        "define-data-property": "^1.0.1",
-        "has-property-descriptors": "^1.0.0",
-        "object-keys": "^1.1.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/deprecation": {
-      "version": "2.3.1",
-      "license": "ISC"
-    },
-    "node_modules/detect-libc": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
-      "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/diff": {
-      "version": "9.0.0",
-      "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz",
-      "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "engines": {
-        "node": ">=0.3.1"
-      }
-    },
-    "node_modules/doctrine": {
-      "version": "2.1.0",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "esutils": "^2.0.2"
-      },
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/dunder-proto": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
-      "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
-      "dev": true,
-      "dependencies": {
-        "call-bind-apply-helpers": "^1.0.1",
-        "es-errors": "^1.3.0",
-        "gopd": "^1.2.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/electron-to-chromium": {
-      "version": "1.5.68",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.68.tgz",
-      "integrity": "sha512-FgMdJlma0OzUYlbrtZ4AeXjKxKPk6KT8WOP8BjcqxWtlg8qyJQjRzPJzUtUn5GBg1oQ26hFs7HOOHJMYiJRnvQ==",
-      "dev": true,
-      "license": "ISC"
-    },
-    "node_modules/emittery": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/emittery/-/emittery-1.2.0.tgz",
-      "integrity": "sha512-KxdRyyFcS85pH3dnU8Y5yFUm2YJdaHwcBZWrfG8o89ZY9a13/f9itbN+YG3ELbBo9Pg5zvIozstmuV8bX13q6g==",
-      "dev": true,
-      "engines": {
-        "node": ">=14.16"
-      },
-      "funding": {
-        "url": "https://github.com/sindresorhus/emittery?sponsor=1"
-      }
-    },
-    "node_modules/emoji-regex": {
-      "version": "8.0.0",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/es-abstract": {
-      "version": "1.24.1",
-      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz",
-      "integrity": "sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "array-buffer-byte-length": "^1.0.2",
-        "arraybuffer.prototype.slice": "^1.0.4",
-        "available-typed-arrays": "^1.0.7",
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.4",
-        "data-view-buffer": "^1.0.2",
-        "data-view-byte-length": "^1.0.2",
-        "data-view-byte-offset": "^1.0.1",
-        "es-define-property": "^1.0.1",
-        "es-errors": "^1.3.0",
-        "es-object-atoms": "^1.1.1",
-        "es-set-tostringtag": "^2.1.0",
-        "es-to-primitive": "^1.3.0",
-        "function.prototype.name": "^1.1.8",
-        "get-intrinsic": "^1.3.0",
-        "get-proto": "^1.0.1",
-        "get-symbol-description": "^1.1.0",
-        "globalthis": "^1.0.4",
-        "gopd": "^1.2.0",
-        "has-property-descriptors": "^1.0.2",
-        "has-proto": "^1.2.0",
-        "has-symbols": "^1.1.0",
-        "hasown": "^2.0.2",
-        "internal-slot": "^1.1.0",
-        "is-array-buffer": "^3.0.5",
-        "is-callable": "^1.2.7",
-        "is-data-view": "^1.0.2",
-        "is-negative-zero": "^2.0.3",
-        "is-regex": "^1.2.1",
-        "is-set": "^2.0.3",
-        "is-shared-array-buffer": "^1.0.4",
-        "is-string": "^1.1.1",
-        "is-typed-array": "^1.1.15",
-        "is-weakref": "^1.1.1",
-        "math-intrinsics": "^1.1.0",
-        "object-inspect": "^1.13.4",
-        "object-keys": "^1.1.1",
-        "object.assign": "^4.1.7",
-        "own-keys": "^1.0.1",
-        "regexp.prototype.flags": "^1.5.4",
-        "safe-array-concat": "^1.1.3",
-        "safe-push-apply": "^1.0.0",
-        "safe-regex-test": "^1.1.0",
-        "set-proto": "^1.0.0",
-        "stop-iteration-iterator": "^1.1.0",
-        "string.prototype.trim": "^1.2.10",
-        "string.prototype.trimend": "^1.0.9",
-        "string.prototype.trimstart": "^1.0.8",
-        "typed-array-buffer": "^1.0.3",
-        "typed-array-byte-length": "^1.0.3",
-        "typed-array-byte-offset": "^1.0.4",
-        "typed-array-length": "^1.0.7",
-        "unbox-primitive": "^1.1.0",
-        "which-typed-array": "^1.1.19"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/es-define-property": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
-      "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/es-errors": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
-      "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/es-object-atoms": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
-      "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
-      "dev": true,
-      "dependencies": {
-        "es-errors": "^1.3.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/es-set-tostringtag": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
-      "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
-      "dev": true,
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "get-intrinsic": "^1.2.6",
-        "has-tostringtag": "^1.0.2",
-        "hasown": "^2.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/es-shim-unscopables": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz",
-      "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "hasown": "^2.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/es-to-primitive": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz",
-      "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "is-callable": "^1.2.7",
-        "is-date-object": "^1.0.5",
-        "is-symbol": "^1.0.4"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/esbuild": {
-      "version": "0.28.1",
-      "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
-      "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
-      "dev": true,
-      "hasInstallScript": true,
-      "license": "MIT",
-      "bin": {
-        "esbuild": "bin/esbuild"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "optionalDependencies": {
-        "@esbuild/aix-ppc64": "0.28.1",
-        "@esbuild/android-arm": "0.28.1",
-        "@esbuild/android-arm64": "0.28.1",
-        "@esbuild/android-x64": "0.28.1",
-        "@esbuild/darwin-arm64": "0.28.1",
-        "@esbuild/darwin-x64": "0.28.1",
-        "@esbuild/freebsd-arm64": "0.28.1",
-        "@esbuild/freebsd-x64": "0.28.1",
-        "@esbuild/linux-arm": "0.28.1",
-        "@esbuild/linux-arm64": "0.28.1",
-        "@esbuild/linux-ia32": "0.28.1",
-        "@esbuild/linux-loong64": "0.28.1",
-        "@esbuild/linux-mips64el": "0.28.1",
-        "@esbuild/linux-ppc64": "0.28.1",
-        "@esbuild/linux-riscv64": "0.28.1",
-        "@esbuild/linux-s390x": "0.28.1",
-        "@esbuild/linux-x64": "0.28.1",
-        "@esbuild/netbsd-arm64": "0.28.1",
-        "@esbuild/netbsd-x64": "0.28.1",
-        "@esbuild/openbsd-arm64": "0.28.1",
-        "@esbuild/openbsd-x64": "0.28.1",
-        "@esbuild/openharmony-arm64": "0.28.1",
-        "@esbuild/sunos-x64": "0.28.1",
-        "@esbuild/win32-arm64": "0.28.1",
-        "@esbuild/win32-ia32": "0.28.1",
-        "@esbuild/win32-x64": "0.28.1"
-      }
-    },
-    "node_modules/escalade": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
-      "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/escape-string-regexp": {
-      "version": "1.0.5",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.8.0"
-      }
-    },
-    "node_modules/eslint": {
-      "version": "9.39.5",
-      "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.5.tgz",
-      "integrity": "sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@eslint-community/eslint-utils": "^4.8.0",
-        "@eslint-community/regexpp": "^4.12.1",
-        "@eslint/config-array": "^0.21.2",
-        "@eslint/config-helpers": "^0.4.2",
-        "@eslint/core": "^0.17.0",
-        "@eslint/eslintrc": "^3.3.6",
-        "@eslint/js": "9.39.5",
-        "@eslint/plugin-kit": "^0.4.1",
-        "@humanfs/node": "^0.16.6",
-        "@humanwhocodes/module-importer": "^1.0.1",
-        "@humanwhocodes/retry": "^0.4.2",
-        "@types/estree": "^1.0.6",
-        "ajv": "^6.14.0",
-        "chalk": "^4.0.0",
-        "cross-spawn": "^7.0.6",
-        "debug": "^4.3.2",
-        "escape-string-regexp": "^4.0.0",
-        "eslint-scope": "^8.4.0",
-        "eslint-visitor-keys": "^4.2.1",
-        "espree": "^10.4.0",
-        "esquery": "^1.5.0",
-        "esutils": "^2.0.2",
-        "fast-deep-equal": "^3.1.3",
-        "file-entry-cache": "^8.0.0",
-        "find-up": "^5.0.0",
-        "glob-parent": "^6.0.2",
-        "ignore": "^5.2.0",
-        "imurmurhash": "^0.1.4",
-        "is-glob": "^4.0.0",
-        "json-stable-stringify-without-jsonify": "^1.0.1",
-        "lodash.merge": "^4.6.2",
-        "minimatch": "^3.1.5",
-        "natural-compare": "^1.4.0",
-        "optionator": "^0.9.3"
-      },
-      "bin": {
-        "eslint": "bin/eslint.js"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://eslint.org/donate"
-      },
-      "peerDependencies": {
-        "jiti": "*"
-      },
-      "peerDependenciesMeta": {
-        "jiti": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/eslint-config-prettier": {
-      "version": "8.3.0",
-      "dev": true,
-      "license": "MIT",
-      "bin": {
-        "eslint-config-prettier": "bin/cli.js"
-      },
-      "peerDependencies": {
-        "eslint": ">=7.0.0"
-      }
-    },
-    "node_modules/eslint-import-context": {
-      "version": "0.1.9",
-      "resolved": "https://registry.npmjs.org/eslint-import-context/-/eslint-import-context-0.1.9.tgz",
-      "integrity": "sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "get-tsconfig": "^4.10.1",
-        "stable-hash-x": "^0.2.0"
-      },
-      "engines": {
-        "node": "^12.20.0 || ^14.18.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint-import-context"
-      },
-      "peerDependencies": {
-        "unrs-resolver": "^1.0.0"
-      },
-      "peerDependenciesMeta": {
-        "unrs-resolver": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/eslint-import-resolver-node": {
-      "version": "0.3.9",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "debug": "^3.2.7",
-        "is-core-module": "^2.13.0",
-        "resolve": "^1.22.4"
-      }
-    },
-    "node_modules/eslint-import-resolver-node/node_modules/debug": {
-      "version": "3.2.7",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.1"
-      }
-    },
-    "node_modules/eslint-import-resolver-typescript": {
-      "version": "4.4.5",
-      "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.4.5.tgz",
-      "integrity": "sha512-nbE5XLph6TLtGYcu/U6e6ZVXyKBhbDWK5cLGk76eJ7NdZpwf1P9EFkpt1Z01mNZNrrilsAYWKH6zUkL4reoXbw==",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "debug": "^4.4.1",
-        "eslint-import-context": "^0.1.8",
-        "get-tsconfig": "^4.10.1",
-        "is-bun-module": "^2.0.0",
-        "stable-hash-x": "^0.2.0",
-        "tinyglobby": "^0.2.14",
-        "unrs-resolver": "^1.7.11"
-      },
-      "engines": {
-        "node": "^16.17.0 || >=18.6.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint-import-resolver-typescript"
-      },
-      "peerDependencies": {
-        "eslint": "*",
-        "eslint-plugin-import": "*",
-        "eslint-plugin-import-x": "*"
-      },
-      "peerDependenciesMeta": {
-        "eslint-plugin-import": {
-          "optional": true
-        },
-        "eslint-plugin-import-x": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/eslint-module-utils": {
-      "version": "2.12.1",
-      "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz",
-      "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "debug": "^3.2.7"
-      },
-      "engines": {
-        "node": ">=4"
-      },
-      "peerDependenciesMeta": {
-        "eslint": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/eslint-module-utils/node_modules/debug": {
-      "version": "3.2.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
-      "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.1"
-      }
-    },
-    "node_modules/eslint-plugin-escompat": {
-      "version": "3.11.4",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-escompat/-/eslint-plugin-escompat-3.11.4.tgz",
-      "integrity": "sha512-j0ywwNnIufshOzgAu+PfIig1c7VRClKSNKzpniMT2vXQ4leL5q+e/SpMFQU0nrdL2WFFM44XmhSuwmxb3G0CJg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "browserslist": "^4.23.1"
-      },
-      "peerDependencies": {
-        "eslint": ">=5.14.1"
-      }
-    },
-    "node_modules/eslint-plugin-eslint-comments": {
-      "version": "3.2.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "escape-string-regexp": "^1.0.5",
-        "ignore": "^5.0.5"
-      },
-      "engines": {
-        "node": ">=6.5.0"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/mysticatea"
-      },
-      "peerDependencies": {
-        "eslint": ">=4.19.1"
-      }
-    },
-    "node_modules/eslint-plugin-filenames": {
-      "version": "1.3.2",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "lodash.camelcase": "4.3.0",
-        "lodash.kebabcase": "4.1.1",
-        "lodash.snakecase": "4.1.1",
-        "lodash.upperfirst": "4.3.1"
-      },
-      "peerDependencies": {
-        "eslint": "*"
-      }
-    },
-    "node_modules/eslint-plugin-github": {
-      "version": "6.1.2",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-6.1.2.tgz",
-      "integrity": "sha512-XU1fVItfnwYWXG0GqH0MV2VY9EzvgbPxDnUJ9I1915Cpn24z13Vgx1pttrdQy6bhLmDYp+Wl7pX/L1YMKdG+6g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@eslint/compat": "^2.0.0",
-        "@eslint/eslintrc": "^3.3.6",
-        "@eslint/js": "^9.39.5",
-        "@github/browserslist-config": "^1.0.0",
-        "@typescript-eslint/eslint-plugin": "^8.0.0",
-        "@typescript-eslint/parser": "^8.0.0",
-        "aria-query": "^5.3.0",
-        "eslint-config-prettier": ">=8.0.0",
-        "eslint-plugin-escompat": "^3.11.3",
-        "eslint-plugin-eslint-comments": "^3.2.0",
-        "eslint-plugin-filenames": "^1.3.2",
-        "eslint-plugin-i18n-text": "^1.0.1",
-        "eslint-plugin-import": "^2.31.0",
-        "eslint-plugin-jsx-a11y": "^6.10.2",
-        "eslint-plugin-no-only-tests": "^3.0.0",
-        "eslint-plugin-prettier": "^5.2.1",
-        "eslint-rule-documentation": ">=1.0.0",
-        "globals": "^17.7.0",
-        "jsx-ast-utils": "^3.3.2",
-        "prettier": "^3.0.0",
-        "svg-element-attributes": "^1.3.1",
-        "typescript": "^6.0.3",
-        "typescript-eslint": "^8.14.0"
-      },
-      "bin": {
-        "eslint-ignore-errors": "bin/eslint-ignore-errors.js"
-      },
-      "peerDependencies": {
-        "eslint": "^8 || ^9 || ^10"
-      }
-    },
-    "node_modules/eslint-plugin-i18n-text": {
-      "version": "1.0.1",
-      "dev": true,
-      "license": "MIT",
-      "peerDependencies": {
-        "eslint": ">=5.0.0"
-      }
-    },
-    "node_modules/eslint-plugin-import": {
-      "version": "2.32.0",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz",
-      "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@rtsao/scc": "^1.1.0",
-        "array-includes": "^3.1.9",
-        "array.prototype.findlastindex": "^1.2.6",
-        "array.prototype.flat": "^1.3.3",
-        "array.prototype.flatmap": "^1.3.3",
-        "debug": "^3.2.7",
-        "doctrine": "^2.1.0",
-        "eslint-import-resolver-node": "^0.3.9",
-        "eslint-module-utils": "^2.12.1",
-        "hasown": "^2.0.2",
-        "is-core-module": "^2.16.1",
-        "is-glob": "^4.0.3",
-        "minimatch": "^3.1.2",
-        "object.fromentries": "^2.0.8",
-        "object.groupby": "^1.0.3",
-        "object.values": "^1.2.1",
-        "semver": "^6.3.1",
-        "string.prototype.trimend": "^1.0.9",
-        "tsconfig-paths": "^3.15.0"
-      },
-      "engines": {
-        "node": ">=4"
-      },
-      "peerDependencies": {
-        "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9"
-      }
-    },
-    "node_modules/eslint-plugin-import-x": {
-      "version": "4.17.1",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.17.1.tgz",
-      "integrity": "sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@typescript-eslint/types": "^8.56.0",
-        "comment-parser": "^1.4.1",
-        "debug": "^4.4.1",
-        "eslint-import-context": "^0.1.9",
-        "is-glob": "^4.0.3",
-        "minimatch": "^9.0.3 || ^10.1.2",
-        "semver": "^7.7.2",
-        "stable-hash-x": "^0.2.0",
-        "unrs-resolver": "^1.9.2"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint-plugin-import-x"
-      },
-      "peerDependencies": {
-        "@typescript-eslint/utils": "^8.56.0",
-        "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
-        "eslint-import-resolver-node": "*"
-      },
-      "peerDependenciesMeta": {
-        "@typescript-eslint/utils": {
-          "optional": true
-        },
-        "eslint-import-resolver-node": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/eslint-plugin-import-x/node_modules/balanced-match": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.3.tgz",
-      "integrity": "sha512-1pHv8LX9CpKut1Zp4EXey7Z8OfH11ONNH6Dhi2WDUt31VVZFXZzKwXcysBgqSumFCmR+0dqjMK5v5JiFHzi0+g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": "20 || >=22"
-      }
-    },
-    "node_modules/eslint-plugin-import-x/node_modules/brace-expansion": {
-      "version": "5.0.9",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
-      "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "balanced-match": "^4.0.2"
-      },
-      "engines": {
-        "node": "20 || >=22"
-      }
-    },
-    "node_modules/eslint-plugin-import-x/node_modules/minimatch": {
-      "version": "10.2.4",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
-      "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
-      "dev": true,
-      "license": "BlueOak-1.0.0",
-      "dependencies": {
-        "brace-expansion": "^5.0.2"
-      },
-      "engines": {
-        "node": "18 || 20 || >=22"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      }
-    },
-    "node_modules/eslint-plugin-import/node_modules/debug": {
-      "version": "3.2.7",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.1"
-      }
-    },
-    "node_modules/eslint-plugin-jsdoc": {
-      "version": "62.9.0",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-62.9.0.tgz",
-      "integrity": "sha512-PY7/X4jrVgoIDncUmITlUqK546Ltmx/Pd4Hdsu4CvSjryQZJI2mEV4vrdMufyTetMiZ5taNSqvK//BTgVUlNkA==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "@es-joy/jsdoccomment": "~0.86.0",
-        "@es-joy/resolve.exports": "1.2.0",
-        "are-docs-informative": "^0.0.2",
-        "comment-parser": "1.4.6",
-        "debug": "^4.4.3",
-        "escape-string-regexp": "^4.0.0",
-        "espree": "^11.2.0",
-        "esquery": "^1.7.0",
-        "html-entities": "^2.6.0",
-        "object-deep-merge": "^2.0.0",
-        "parse-imports-exports": "^0.2.4",
-        "semver": "^7.7.4",
-        "spdx-expression-parse": "^4.0.0",
-        "to-valid-identifier": "^1.0.0"
-      },
-      "engines": {
-        "node": "^20.19.0 || ^22.13.0 || >=24"
-      },
-      "peerDependencies": {
-        "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0"
-      }
-    },
-    "node_modules/eslint-plugin-jsdoc/node_modules/debug": {
-      "version": "4.4.3",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
-      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/eslint-plugin-jsdoc/node_modules/escape-string-regexp": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
-      "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
-      "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": "^20.19.0 || ^22.13.0 || >=24"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/eslint-plugin-jsdoc/node_modules/espree": {
-      "version": "11.2.0",
-      "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz",
-      "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "dependencies": {
-        "acorn": "^8.16.0",
-        "acorn-jsx": "^5.3.2",
-        "eslint-visitor-keys": "^5.0.1"
-      },
-      "engines": {
-        "node": "^20.19.0 || ^22.13.0 || >=24"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/eslint-plugin-jsdoc/node_modules/esquery": {
-      "version": "1.7.0",
-      "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",
-      "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "estraverse": "^5.1.0"
-      },
-      "engines": {
-        "node": ">=0.10"
-      }
-    },
-    "node_modules/eslint-plugin-jsx-a11y": {
-      "version": "6.10.2",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz",
-      "integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "aria-query": "^5.3.2",
-        "array-includes": "^3.1.8",
-        "array.prototype.flatmap": "^1.3.2",
-        "ast-types-flow": "^0.0.8",
-        "axe-core": "^4.10.0",
-        "axobject-query": "^4.1.0",
-        "damerau-levenshtein": "^1.0.8",
-        "emoji-regex": "^9.2.2",
-        "hasown": "^2.0.2",
-        "jsx-ast-utils": "^3.3.5",
-        "language-tags": "^1.0.9",
-        "minimatch": "^3.1.2",
-        "object.fromentries": "^2.0.8",
-        "safe-regex-test": "^1.0.3",
-        "string.prototype.includes": "^2.0.1"
-      },
-      "engines": {
-        "node": ">=4.0"
-      },
-      "peerDependencies": {
-        "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9"
-      }
-    },
-    "node_modules/eslint-plugin-jsx-a11y/node_modules/emoji-regex": {
-      "version": "9.2.2",
-      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
-      "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/eslint-plugin-no-async-foreach": {
-      "version": "0.1.1",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "requireindex": "~1.1.0"
-      },
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/eslint-plugin-no-only-tests": {
-      "version": "3.1.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=5.0.0"
-      }
-    },
-    "node_modules/eslint-plugin-prettier": {
-      "version": "5.2.1",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz",
-      "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "prettier-linter-helpers": "^1.0.0",
-        "synckit": "^0.9.1"
-      },
-      "engines": {
-        "node": "^14.18.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint-plugin-prettier"
-      },
-      "peerDependencies": {
-        "@types/eslint": ">=8.0.0",
-        "eslint": ">=8.0.0",
-        "eslint-config-prettier": "*",
-        "prettier": ">=3.0.0"
-      },
-      "peerDependenciesMeta": {
-        "@types/eslint": {
-          "optional": true
-        },
-        "eslint-config-prettier": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/eslint-rule-documentation": {
-      "version": "1.0.23",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=4.0.0"
-      }
-    },
-    "node_modules/eslint-scope": {
-      "version": "8.4.0",
-      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
-      "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "dependencies": {
-        "esrecurse": "^4.3.0",
-        "estraverse": "^5.2.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/eslint-visitor-keys": {
-      "version": "3.4.3",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/eslint/node_modules/@eslint/core": {
-      "version": "0.17.0",
-      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
-      "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@types/json-schema": "^7.0.15"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      }
-    },
-    "node_modules/eslint/node_modules/ansi-styles": {
-      "version": "4.2.1",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/color-name": "^1.1.1",
-        "color-convert": "^2.0.1"
-      },
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
-      }
-    },
-    "node_modules/eslint/node_modules/chalk": {
-      "version": "4.1.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ansi-styles": "^4.1.0",
-        "supports-color": "^7.1.0"
-      },
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/chalk?sponsor=1"
-      }
-    },
-    "node_modules/eslint/node_modules/escape-string-regexp": {
-      "version": "4.0.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/eslint/node_modules/eslint-visitor-keys": {
-      "version": "4.2.1",
-      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
-      "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/eslint/node_modules/glob-parent": {
-      "version": "6.0.2",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "is-glob": "^4.0.3"
-      },
-      "engines": {
-        "node": ">=10.13.0"
-      }
-    },
-    "node_modules/espree": {
-      "version": "10.4.0",
-      "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
-      "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "dependencies": {
-        "acorn": "^8.15.0",
-        "acorn-jsx": "^5.3.2",
-        "eslint-visitor-keys": "^4.2.1"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/espree/node_modules/eslint-visitor-keys": {
-      "version": "4.2.1",
-      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
-      "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/esprima": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
-      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
-      "dev": true,
-      "bin": {
-        "esparse": "bin/esparse.js",
-        "esvalidate": "bin/esvalidate.js"
-      },
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/esquery": {
-      "version": "1.5.0",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "estraverse": "^5.1.0"
-      },
-      "engines": {
-        "node": ">=0.10"
-      }
-    },
-    "node_modules/esrecurse": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
-      "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "dependencies": {
-        "estraverse": "^5.2.0"
-      },
-      "engines": {
-        "node": ">=4.0"
-      }
-    },
-    "node_modules/estraverse": {
-      "version": "5.3.0",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "engines": {
-        "node": ">=4.0"
-      }
-    },
-    "node_modules/estree-walker": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
-      "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/esutils": {
-      "version": "2.0.3",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/event-target-shim": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
-      "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/events": {
-      "version": "3.3.0",
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.8.x"
-      }
-    },
-    "node_modules/execa": {
-      "version": "9.6.1",
-      "resolved": "https://registry.npmjs.org/execa/-/execa-9.6.1.tgz",
-      "integrity": "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@sindresorhus/merge-streams": "^4.0.0",
-        "cross-spawn": "^7.0.6",
-        "figures": "^6.1.0",
-        "get-stream": "^9.0.0",
-        "human-signals": "^8.0.1",
-        "is-plain-obj": "^4.1.0",
-        "is-stream": "^4.0.1",
-        "npm-run-path": "^6.0.0",
-        "pretty-ms": "^9.2.0",
-        "signal-exit": "^4.1.0",
-        "strip-final-newline": "^4.0.0",
-        "yoctocolors": "^2.1.1"
-      },
-      "engines": {
-        "node": "^18.19.0 || >=20.5.0"
-      },
-      "funding": {
-        "url": "https://github.com/sindresorhus/execa?sponsor=1"
-      }
-    },
-    "node_modules/fast-deep-equal": {
-      "version": "3.1.3",
-      "license": "MIT"
-    },
-    "node_modules/fast-diff": {
-      "version": "1.2.0",
-      "dev": true,
-      "license": "Apache-2.0"
-    },
-    "node_modules/fast-fifo": {
-      "version": "1.3.2",
-      "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
-      "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",
-      "license": "MIT"
-    },
-    "node_modules/fast-glob": {
-      "version": "3.3.3",
-      "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
-      "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@nodelib/fs.stat": "^2.0.2",
-        "@nodelib/fs.walk": "^1.2.3",
-        "glob-parent": "^5.1.2",
-        "merge2": "^1.3.0",
-        "micromatch": "^4.0.8"
-      },
-      "engines": {
-        "node": ">=8.6.0"
-      }
-    },
-    "node_modules/fast-json-stable-stringify": {
-      "version": "2.1.0",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/fast-levenshtein": {
-      "version": "2.0.6",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/fast-xml-builder": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz",
-      "integrity": "sha512-00aAWieqff+ZJhsXA4g1g7M8k+7AYoMUUHF+/zFb5U6Uv/P0Vl4QZo84/IcufzYalLuEj9928bXN9PbbFzMF0Q==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/NaturalIntelligence"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "path-expression-matcher": "^1.5.0",
-        "xml-naming": "^0.1.0"
-      }
-    },
-    "node_modules/fast-xml-parser": {
-      "version": "5.7.1",
-      "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.7.1.tgz",
-      "integrity": "sha512-8Cc3f8GUGUULg34pBch/KGyPLglS+OFs05deyOlY7fL2MTagYPKrVQNmR1fLF/yJ9PH5ZSTd3YDF6pnmeZU+zA==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/NaturalIntelligence"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "@nodable/entities": "^2.1.0",
-        "fast-xml-builder": "^1.1.5",
-        "path-expression-matcher": "^1.5.0",
-        "strnum": "^2.2.3"
-      },
-      "bin": {
-        "fxparser": "src/cli/cli.js"
-      }
-    },
-    "node_modules/fastq": {
-      "version": "1.8.0",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "reusify": "^1.0.4"
-      }
-    },
-    "node_modules/figures": {
-      "version": "6.1.0",
-      "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",
-      "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==",
-      "dev": true,
-      "dependencies": {
-        "is-unicode-supported": "^2.0.0"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/file-entry-cache": {
-      "version": "8.0.0",
-      "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
-      "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "flat-cache": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=16.0.0"
-      }
-    },
-    "node_modules/file-uri-to-path": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
-      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/fill-range": {
-      "version": "7.1.1",
-      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
-      "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "to-regex-range": "^5.0.1"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/find-up": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
-      "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "locate-path": "^6.0.0",
-        "path-exists": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/find-up-simple": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz",
-      "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==",
-      "dev": true,
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/flat-cache": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
-      "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "flatted": "^3.2.9",
-        "keyv": "^4.5.4"
-      },
-      "engines": {
-        "node": ">=16"
-      }
-    },
-    "node_modules/flatted": {
-      "version": "3.4.2",
-      "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
-      "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
-      "dev": true,
-      "license": "ISC"
-    },
-    "node_modules/follow-redirects": {
-      "version": "1.16.0",
-      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
-      "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
-      "funding": [
-        {
-          "type": "individual",
-          "url": "https://github.com/sponsors/RubenVerborgh"
-        }
-      ],
-      "license": "MIT",
-      "engines": {
-        "node": ">=4.0"
-      },
-      "peerDependenciesMeta": {
-        "debug": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/for-each": {
-      "version": "0.3.5",
-      "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz",
-      "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "is-callable": "^1.2.7"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/fsevents": {
-      "version": "2.3.3",
-      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
-      "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
-      "dev": true,
-      "hasInstallScript": true,
-      "license": "MIT",
-      "optional": true,
-      "os": [
-        "darwin"
-      ],
-      "engines": {
-        "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
-      }
-    },
-    "node_modules/function-bind": {
-      "version": "1.1.2",
-      "dev": true,
-      "license": "MIT",
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/function.prototype.name": {
-      "version": "1.1.8",
-      "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz",
-      "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.3",
-        "define-properties": "^1.2.1",
-        "functions-have-names": "^1.2.3",
-        "hasown": "^2.0.2",
-        "is-callable": "^1.2.7"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/functions-have-names": {
-      "version": "1.2.3",
-      "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
-      "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
-      "dev": true,
-      "license": "MIT",
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/generator-function": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz",
-      "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/get-caller-file": {
-      "version": "2.0.5",
-      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
-      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
-      "dev": true,
-      "license": "ISC",
-      "engines": {
-        "node": "6.* || 8.* || >= 10.*"
-      }
-    },
-    "node_modules/get-east-asian-width": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz",
-      "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/get-folder-size": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/get-folder-size/-/get-folder-size-5.0.0.tgz",
-      "integrity": "sha512-+fgtvbL83tSDypEK+T411GDBQVQtxv+qtQgbV+HVa/TYubqDhNd5ghH/D6cOHY9iC5/88GtOZB7WI8PXy2A3bg==",
-      "license": "MIT",
-      "bin": {
-        "get-folder-size": "bin/get-folder-size.js"
-      },
-      "engines": {
-        "node": ">=18.11.0"
-      }
-    },
-    "node_modules/get-intrinsic": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
-      "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
-      "dev": true,
-      "dependencies": {
-        "call-bind-apply-helpers": "^1.0.2",
-        "es-define-property": "^1.0.1",
-        "es-errors": "^1.3.0",
-        "es-object-atoms": "^1.1.1",
-        "function-bind": "^1.1.2",
-        "get-proto": "^1.0.1",
-        "gopd": "^1.2.0",
-        "has-symbols": "^1.1.0",
-        "hasown": "^2.0.2",
-        "math-intrinsics": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/get-proto": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
-      "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
-      "dev": true,
-      "dependencies": {
-        "dunder-proto": "^1.0.1",
-        "es-object-atoms": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/get-stream": {
-      "version": "9.0.1",
-      "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz",
-      "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@sec-ant/readable-stream": "^0.4.1",
-        "is-stream": "^4.0.1"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/get-symbol-description": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz",
-      "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "es-errors": "^1.3.0",
-        "get-intrinsic": "^1.2.6"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/get-tsconfig": {
-      "version": "4.13.6",
-      "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.6.tgz",
-      "integrity": "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "resolve-pkg-maps": "^1.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
-      }
-    },
-    "node_modules/glob": {
-      "version": "13.0.6",
-      "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
-      "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
-      "license": "BlueOak-1.0.0",
-      "dependencies": {
-        "minimatch": "^10.2.2",
-        "minipass": "^7.1.3",
-        "path-scurry": "^2.0.2"
-      },
-      "engines": {
-        "node": "18 || 20 || >=22"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      }
-    },
-    "node_modules/glob-parent": {
-      "version": "5.1.2",
-      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
-      "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "is-glob": "^4.0.1"
-      },
-      "engines": {
-        "node": ">= 6"
-      }
-    },
-    "node_modules/glob/node_modules/balanced-match": {
-      "version": "4.0.4",
-      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
-      "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
-      "license": "MIT",
-      "engines": {
-        "node": "18 || 20 || >=22"
-      }
-    },
-    "node_modules/glob/node_modules/brace-expansion": {
-      "version": "5.0.9",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
-      "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
-      "license": "MIT",
-      "dependencies": {
-        "balanced-match": "^4.0.2"
-      },
-      "engines": {
-        "node": "20 || >=22"
-      }
-    },
-    "node_modules/glob/node_modules/minimatch": {
-      "version": "10.2.4",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
-      "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
-      "license": "BlueOak-1.0.0",
-      "dependencies": {
-        "brace-expansion": "^5.0.2"
-      },
-      "engines": {
-        "node": "18 || 20 || >=22"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      }
-    },
-    "node_modules/globals": {
-      "version": "17.9.0",
-      "resolved": "https://registry.npmjs.org/globals/-/globals-17.9.0.tgz",
-      "integrity": "sha512-m/MvAW61QVU5VDNF1Vj8axt016h8w7L5TU1e9zlab7XIttAT2YAlCwl75K1fOqvMM9apmD7lbCIRhpfkhmxhCg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/globalthis": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",
-      "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "define-properties": "^1.2.1",
-        "gopd": "^1.0.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/globby": {
-      "version": "14.1.0",
-      "resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz",
-      "integrity": "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@sindresorhus/merge-streams": "^2.1.0",
-        "fast-glob": "^3.3.3",
-        "ignore": "^7.0.3",
-        "path-type": "^6.0.0",
-        "slash": "^5.1.0",
-        "unicorn-magic": "^0.3.0"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/globby/node_modules/@sindresorhus/merge-streams": {
-      "version": "2.3.0",
-      "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz",
-      "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/globby/node_modules/ignore": {
-      "version": "7.0.5",
-      "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
-      "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 4"
-      }
-    },
-    "node_modules/gopd": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
-      "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/graceful-fs": {
-      "version": "4.2.10",
-      "license": "ISC"
-    },
-    "node_modules/graphemer": {
-      "version": "1.4.0",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/has-bigints": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz",
-      "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/has-flag": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
-      "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/has-property-descriptors": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
-      "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
-      "dev": true,
-      "dependencies": {
-        "es-define-property": "^1.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/has-proto": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz",
-      "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "dunder-proto": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/has-symbols": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
-      "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/has-tostringtag": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
-      "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
-      "dev": true,
-      "dependencies": {
-        "has-symbols": "^1.0.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/hasown": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
-      "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
-      "dev": true,
-      "dependencies": {
-        "function-bind": "^1.1.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/html-entities": {
-      "version": "2.6.0",
-      "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz",
-      "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/mdevils"
-        },
-        {
-          "type": "patreon",
-          "url": "https://patreon.com/mdevils"
-        }
-      ],
-      "license": "MIT"
-    },
-    "node_modules/http-proxy-agent": {
-      "version": "7.0.2",
-      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
-      "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
-      "license": "MIT",
-      "dependencies": {
-        "agent-base": "^7.1.0",
-        "debug": "^4.3.4"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/https-proxy-agent": {
-      "version": "7.0.6",
-      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
-      "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
-      "license": "MIT",
-      "dependencies": {
-        "agent-base": "^7.1.2",
-        "debug": "4"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
-    "node_modules/human-signals": {
-      "version": "8.0.1",
-      "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz",
-      "integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "engines": {
-        "node": ">=18.18.0"
-      }
-    },
-    "node_modules/ieee754": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
-      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "license": "BSD-3-Clause"
-    },
-    "node_modules/ignore": {
-      "version": "5.3.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 4"
-      }
-    },
-    "node_modules/ignore-by-default": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-2.1.0.tgz",
-      "integrity": "sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==",
-      "dev": true,
-      "engines": {
-        "node": ">=10 <11 || >=12 <13 || >=14"
-      }
-    },
-    "node_modules/import-fresh": {
-      "version": "3.3.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "parent-module": "^1.0.0",
-        "resolve-from": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=6"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/import-fresh/node_modules/resolve-from": {
-      "version": "4.0.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/imurmurhash": {
-      "version": "0.1.4",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.8.19"
-      }
-    },
-    "node_modules/indent-string": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz",
-      "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==",
-      "dev": true,
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/inherits": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
-      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
-      "license": "ISC"
-    },
-    "node_modules/internal-slot": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz",
-      "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "hasown": "^2.0.2",
-        "side-channel": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/irregular-plurals": {
-      "version": "3.5.0",
-      "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz",
-      "integrity": "sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/is-array-buffer": {
-      "version": "3.0.5",
-      "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz",
-      "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.3",
-        "get-intrinsic": "^1.2.6"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-async-function": {
-      "version": "2.1.1",
-      "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz",
-      "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "async-function": "^1.0.0",
-        "call-bound": "^1.0.3",
-        "get-proto": "^1.0.1",
-        "has-tostringtag": "^1.0.2",
-        "safe-regex-test": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-bigint": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz",
-      "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "has-bigints": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-boolean-object": {
-      "version": "1.2.2",
-      "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz",
-      "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "has-tostringtag": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-bun-module": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz",
-      "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "semver": "^7.7.1"
-      }
-    },
-    "node_modules/is-callable": {
-      "version": "1.2.7",
-      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
-      "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-core-module": {
-      "version": "2.16.1",
-      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
-      "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "hasown": "^2.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-data-view": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz",
-      "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "get-intrinsic": "^1.2.6",
-        "is-typed-array": "^1.1.13"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-date-object": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz",
-      "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "has-tostringtag": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-extglob": {
-      "version": "2.1.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/is-finalizationregistry": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz",
-      "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-fullwidth-code-point": {
-      "version": "3.0.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/is-generator-function": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz",
-      "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.4",
-        "generator-function": "^2.0.0",
-        "get-proto": "^1.0.1",
-        "has-tostringtag": "^1.0.2",
-        "safe-regex-test": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-glob": {
-      "version": "4.0.3",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "is-extglob": "^2.1.1"
-      },
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/is-map": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz",
-      "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-negative-zero": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz",
-      "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-node-process": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz",
-      "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/is-number": {
-      "version": "7.0.0",
-      "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
-      "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.12.0"
-      }
-    },
-    "node_modules/is-number-object": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz",
-      "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "has-tostringtag": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-path-inside": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
-      "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/is-plain-obj": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
-      "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/is-plain-object": {
-      "version": "5.0.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/is-promise": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
-      "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
-      "dev": true
-    },
-    "node_modules/is-regex": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz",
-      "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "gopd": "^1.2.0",
-        "has-tostringtag": "^1.0.2",
-        "hasown": "^2.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-set": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz",
-      "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-shared-array-buffer": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz",
-      "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-stream": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz",
-      "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/is-string": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz",
-      "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "has-tostringtag": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-symbol": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz",
-      "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "has-symbols": "^1.1.0",
-        "safe-regex-test": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-typed-array": {
-      "version": "1.1.15",
-      "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz",
-      "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "which-typed-array": "^1.1.16"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-unicode-supported": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
-      "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
-      "dev": true,
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/is-weakmap": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz",
-      "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-weakref": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz",
-      "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/is-weakset": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz",
-      "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "get-intrinsic": "^1.2.6"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/isarray": {
-      "version": "2.0.5",
-      "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
-      "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/isexe": {
-      "version": "2.0.0",
-      "dev": true,
-      "license": "ISC"
-    },
-    "node_modules/js-string-escape": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
-      "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
-    "node_modules/js-yaml": {
-      "version": "5.2.3",
-      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.3.tgz",
-      "integrity": "sha512-n+mUVyUX5bVv7G/G2zyIHOhdxfuU1dY2NOFzTQUWiMUbFss8b57NFlgCCaggU78wSw5KVS9cllzeLyzyR+n5nw==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/puzrin"
-        },
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/nodeca"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "argparse": "^2.0.1"
-      },
-      "bin": {
-        "js-yaml": "bin/js-yaml.mjs"
-      }
-    },
-    "node_modules/jschardet": {
-      "version": "3.1.4",
-      "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz",
-      "integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==",
-      "dev": true,
-      "license": "LGPL-2.1+",
-      "engines": {
-        "node": ">=0.1.90"
-      }
-    },
-    "node_modules/jsdoc-type-pratt-parser": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-7.2.0.tgz",
-      "integrity": "sha512-dh140MMgjyg3JhJZY/+iEzW+NO5xR2gpbDFKHqotCmexElVntw7GjWjt511+C/Ef02RU5TKYrJo/Xlzk+OLaTw==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=20.0.0"
-      }
-    },
-    "node_modules/json-buffer": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
-      "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/json-schema-traverse": {
-      "version": "0.4.1",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/json-stable-stringify-without-jsonify": {
-      "version": "1.0.1",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/json-stringify-safe": {
-      "version": "5.0.1",
-      "dev": true,
-      "license": "ISC"
-    },
-    "node_modules/json-with-bigint": {
-      "version": "3.5.10",
-      "resolved": "https://registry.npmjs.org/json-with-bigint/-/json-with-bigint-3.5.10.tgz",
-      "integrity": "sha512-Vcx+JVNEBts/xfcoCS69sKrOhOk/3TVlvlT+XzUOefVKnnrbYSCKpDCm10pohsJFtsJVYnwa/cXRZ4eElzaM6w==",
-      "license": "MIT"
-    },
-    "node_modules/json5": {
-      "version": "1.0.2",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "minimist": "^1.2.0"
-      },
-      "bin": {
-        "json5": "lib/cli.js"
-      }
-    },
-    "node_modules/jsonschema": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz",
-      "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==",
-      "license": "MIT",
-      "engines": {
-        "node": "*"
-      }
-    },
-    "node_modules/jsx-ast-utils": {
-      "version": "3.3.5",
-      "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz",
-      "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "array-includes": "^3.1.6",
-        "array.prototype.flat": "^1.3.1",
-        "object.assign": "^4.1.4",
-        "object.values": "^1.1.6"
-      },
-      "engines": {
-        "node": ">=4.0"
-      }
-    },
-    "node_modules/jwt-decode": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz",
-      "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==",
-      "license": "MIT"
-    },
-    "node_modules/keyv": {
-      "version": "4.5.4",
-      "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
-      "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "json-buffer": "3.0.1"
-      }
-    },
-    "node_modules/language-subtag-registry": {
-      "version": "0.3.23",
-      "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz",
-      "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==",
-      "dev": true,
-      "license": "CC0-1.0"
-    },
-    "node_modules/language-tags": {
-      "version": "1.0.9",
-      "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz",
-      "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "language-subtag-registry": "^0.3.20"
-      },
-      "engines": {
-        "node": ">=0.10"
-      }
-    },
-    "node_modules/lazystream": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
-      "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==",
-      "license": "MIT",
-      "dependencies": {
-        "readable-stream": "^2.0.5"
-      },
-      "engines": {
-        "node": ">= 0.6.3"
-      }
-    },
-    "node_modules/lazystream/node_modules/isarray": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
-      "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
-      "license": "MIT"
-    },
-    "node_modules/lazystream/node_modules/readable-stream": {
-      "version": "2.3.8",
-      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
-      "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
-      "license": "MIT",
-      "dependencies": {
-        "core-util-is": "~1.0.0",
-        "inherits": "~2.0.3",
-        "isarray": "~1.0.0",
-        "process-nextick-args": "~2.0.0",
-        "safe-buffer": "~5.1.1",
-        "string_decoder": "~1.1.1",
-        "util-deprecate": "~1.0.1"
-      }
-    },
-    "node_modules/lazystream/node_modules/safe-buffer": {
-      "version": "5.1.2",
-      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
-      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
-      "license": "MIT"
-    },
-    "node_modules/lazystream/node_modules/string_decoder": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-      "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-      "license": "MIT",
-      "dependencies": {
-        "safe-buffer": "~5.1.0"
-      }
-    },
-    "node_modules/levn": {
-      "version": "0.4.1",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "prelude-ls": "^1.2.1",
-        "type-check": "~0.4.0"
-      },
-      "engines": {
-        "node": ">= 0.8.0"
-      }
-    },
-    "node_modules/load-json-file": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-7.0.1.tgz",
-      "integrity": "sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==",
-      "dev": true,
-      "engines": {
-        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/locate-path": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
-      "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "p-locate": "^5.0.0"
-      },
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/lodash": {
-      "version": "4.18.1",
-      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
-      "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
-      "license": "MIT"
-    },
-    "node_modules/lodash.camelcase": {
-      "version": "4.3.0",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/lodash.kebabcase": {
-      "version": "4.1.1",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/lodash.merge": {
-      "version": "4.6.2",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/lodash.snakecase": {
-      "version": "4.1.1",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/lodash.upperfirst": {
-      "version": "4.3.1",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/long": {
-      "version": "5.3.2",
-      "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
-      "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA=="
-    },
-    "node_modules/lru-cache": {
-      "version": "11.5.1",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz",
-      "integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==",
-      "license": "BlueOak-1.0.0",
-      "engines": {
-        "node": "20 || >=22"
-      }
-    },
-    "node_modules/matcher": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/matcher/-/matcher-5.0.0.tgz",
-      "integrity": "sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "escape-string-regexp": "^5.0.0"
-      },
-      "engines": {
-        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/matcher/node_modules/escape-string-regexp": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
-      "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/math-intrinsics": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
-      "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/md5-hex": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz",
-      "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==",
-      "dev": true,
-      "dependencies": {
-        "blueimp-md5": "^2.10.0"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/memoize": {
-      "version": "10.2.0",
-      "resolved": "https://registry.npmjs.org/memoize/-/memoize-10.2.0.tgz",
-      "integrity": "sha512-DeC6b7QBrZsRs3Y02A6A7lQyzFbsQbqgjI6UW0GigGWV+u1s25TycMr0XHZE4cJce7rY/vyw2ctMQqfDkIhUEA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "mimic-function": "^5.0.1"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sindresorhus/memoize?sponsor=1"
-      }
-    },
-    "node_modules/merge2": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
-      "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 8"
-      }
-    },
-    "node_modules/micromatch": {
-      "version": "4.0.8",
-      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
-      "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "braces": "^3.0.3",
-        "picomatch": "^2.3.1"
-      },
-      "engines": {
-        "node": ">=8.6"
-      }
-    },
-    "node_modules/micromatch/node_modules/picomatch": {
-      "version": "2.3.2",
-      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
-      "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8.6"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/jonschlinkert"
-      }
-    },
-    "node_modules/mimic-function": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
-      "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/minimatch": {
-      "version": "3.1.5",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
-      "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
-      "license": "ISC",
-      "dependencies": {
-        "brace-expansion": "^1.1.7"
-      },
-      "engines": {
-        "node": "*"
-      }
-    },
-    "node_modules/minimist": {
-      "version": "1.2.8",
-      "license": "MIT",
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/minipass": {
-      "version": "7.1.3",
-      "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
-      "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
-      "license": "BlueOak-1.0.0",
-      "engines": {
-        "node": ">=16 || 14 >=14.17"
-      }
-    },
-    "node_modules/minizlib": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz",
-      "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "minipass": "^7.1.2"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
-    "node_modules/mkdirp": {
-      "version": "0.5.6",
-      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
-      "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
-      "license": "MIT",
-      "dependencies": {
-        "minimist": "^1.2.6"
-      },
-      "bin": {
-        "mkdirp": "bin/cmd.js"
-      }
-    },
-    "node_modules/ms": {
-      "version": "2.1.3",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
-      "license": "MIT"
-    },
-    "node_modules/napi-postinstall": {
-      "version": "0.3.4",
-      "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz",
-      "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==",
-      "dev": true,
-      "license": "MIT",
-      "bin": {
-        "napi-postinstall": "lib/cli.js"
-      },
-      "engines": {
-        "node": "^12.20.0 || ^14.18.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/napi-postinstall"
-      }
-    },
-    "node_modules/natural-compare": {
-      "version": "1.4.0",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/nock": {
-      "version": "14.0.17",
-      "resolved": "https://registry.npmjs.org/nock/-/nock-14.0.17.tgz",
-      "integrity": "sha512-EjRr1weMa4ALQX35AgZTEnP+weJJjlW1KGDiNM2IQC2069YDHas4f4B4UUYR+TTLyKWxJvOz2wObDKQs/LNreA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@mswjs/interceptors": "^0.41.0",
-        "json-stringify-safe": "^5.0.1",
-        "propagate": "^2.0.0"
-      },
-      "engines": {
-        "node": ">=18.20.0 <20 || >=20.12.1"
-      }
-    },
-    "node_modules/node-fetch": {
-      "version": "2.7.0",
-      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
-      "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "whatwg-url": "^5.0.0"
-      },
-      "engines": {
-        "node": "4.x || >=6.0.0"
-      },
-      "peerDependencies": {
-        "encoding": "^0.1.0"
-      },
-      "peerDependenciesMeta": {
-        "encoding": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/node-forge": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
-      "integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
-      "license": "(BSD-3-Clause OR GPL-2.0)",
-      "engines": {
-        "node": ">= 6.13.0"
-      }
-    },
-    "node_modules/node-gyp-build": {
-      "version": "4.8.4",
-      "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
-      "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
-      "dev": true,
-      "license": "MIT",
-      "bin": {
-        "node-gyp-build": "bin.js",
-        "node-gyp-build-optional": "optional.js",
-        "node-gyp-build-test": "build-test.js"
-      }
-    },
-    "node_modules/node-releases": {
-      "version": "2.0.18",
-      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz",
-      "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/nofilter": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz",
-      "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12.19"
-      }
-    },
-    "node_modules/nopt": {
-      "version": "8.1.0",
-      "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz",
-      "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "abbrev": "^3.0.0"
-      },
-      "bin": {
-        "nopt": "bin/nopt.js"
-      },
-      "engines": {
-        "node": "^18.17.0 || >=20.5.0"
-      }
-    },
-    "node_modules/normalize-path": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
-      "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/npm-run-path": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz",
-      "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "path-key": "^4.0.0",
-        "unicorn-magic": "^0.3.0"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/npm-run-path/node_modules/path-key": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
-      "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/object-deep-merge": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/object-deep-merge/-/object-deep-merge-2.0.0.tgz",
-      "integrity": "sha512-3DC3UMpeffLTHiuXSy/UG4NOIYTLlY9u3V82+djSCLYClWobZiS4ivYzpIUWrRY/nfsJ8cWsKyG3QfyLePmhvg==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/object-inspect": {
-      "version": "1.13.4",
-      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
-      "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/object-keys": {
-      "version": "1.1.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/object.assign": {
-      "version": "4.1.7",
-      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz",
-      "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.3",
-        "define-properties": "^1.2.1",
-        "es-object-atoms": "^1.0.0",
-        "has-symbols": "^1.1.0",
-        "object-keys": "^1.1.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/object.fromentries": {
-      "version": "2.0.8",
-      "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz",
-      "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==",
-      "dev": true,
-      "dependencies": {
-        "call-bind": "^1.0.7",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.2",
-        "es-object-atoms": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/object.groupby": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz",
-      "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==",
-      "dev": true,
-      "dependencies": {
-        "call-bind": "^1.0.7",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/object.values": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz",
-      "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.3",
-        "define-properties": "^1.2.1",
-        "es-object-atoms": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/once": {
-      "version": "1.4.0",
-      "license": "ISC",
-      "dependencies": {
-        "wrappy": "1"
-      }
-    },
-    "node_modules/optionator": {
-      "version": "0.9.3",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@aashutoshrathi/word-wrap": "^1.2.3",
-        "deep-is": "^0.1.3",
-        "fast-levenshtein": "^2.0.6",
-        "levn": "^0.4.1",
-        "prelude-ls": "^1.2.1",
-        "type-check": "^0.4.0"
-      },
-      "engines": {
-        "node": ">= 0.8.0"
-      }
-    },
-    "node_modules/outvariant": {
-      "version": "1.4.3",
-      "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.3.tgz",
-      "integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/own-keys": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz",
-      "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "get-intrinsic": "^1.2.6",
-        "object-keys": "^1.1.1",
-        "safe-push-apply": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/p-limit": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
-      "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "yocto-queue": "^0.1.0"
-      },
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/p-locate": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
-      "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "p-limit": "^3.0.2"
-      },
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/p-map": {
-      "version": "7.0.4",
-      "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.4.tgz",
-      "integrity": "sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/package-config": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/package-config/-/package-config-5.0.0.tgz",
-      "integrity": "sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==",
-      "dev": true,
-      "dependencies": {
-        "find-up-simple": "^1.0.0",
-        "load-json-file": "^7.0.1"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/parent-module": {
-      "version": "1.0.1",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "callsites": "^3.0.0"
-      },
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/parse-imports-exports": {
-      "version": "0.2.4",
-      "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz",
-      "integrity": "sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "parse-statements": "1.0.11"
-      }
-    },
-    "node_modules/parse-ms": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz",
-      "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==",
-      "dev": true,
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/parse-statements": {
-      "version": "1.0.11",
-      "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.11.tgz",
-      "integrity": "sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/path-exists": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
-      "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/path-expression-matcher": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz",
-      "integrity": "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/NaturalIntelligence"
-        }
-      ],
-      "license": "MIT",
-      "engines": {
-        "node": ">=14.0.0"
-      }
-    },
-    "node_modules/path-key": {
-      "version": "3.1.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/path-parse": {
-      "version": "1.0.7",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/path-scurry": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
-      "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
-      "license": "BlueOak-1.0.0",
-      "dependencies": {
-        "lru-cache": "^11.0.0",
-        "minipass": "^7.1.2"
-      },
-      "engines": {
-        "node": "18 || 20 || >=22"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      }
-    },
-    "node_modules/path-type": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/path-type/-/path-type-6.0.0.tgz",
-      "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/picocolors": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
-      "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
-      "dev": true,
-      "license": "ISC"
-    },
-    "node_modules/picomatch": {
-      "version": "4.0.4",
-      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
-      "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/jonschlinkert"
-      }
-    },
-    "node_modules/plur": {
-      "version": "5.1.0",
-      "resolved": "https://registry.npmjs.org/plur/-/plur-5.1.0.tgz",
-      "integrity": "sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "irregular-plurals": "^3.3.0"
-      },
-      "engines": {
-        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/possible-typed-array-names": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
-      "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/pr-checks": {
-      "resolved": "pr-checks",
-      "link": true
-    },
-    "node_modules/prelude-ls": {
-      "version": "1.2.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8.0"
-      }
-    },
-    "node_modules/prettier": {
-      "version": "3.4.1",
-      "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz",
-      "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==",
-      "dev": true,
-      "license": "MIT",
-      "bin": {
-        "prettier": "bin/prettier.cjs"
-      },
-      "engines": {
-        "node": ">=14"
-      },
-      "funding": {
-        "url": "https://github.com/prettier/prettier?sponsor=1"
-      }
-    },
-    "node_modules/prettier-linter-helpers": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
-      "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "fast-diff": "^1.1.2"
-      },
-      "engines": {
-        "node": ">=6.0.0"
-      }
-    },
-    "node_modules/pretty-ms": {
-      "version": "9.3.0",
-      "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz",
-      "integrity": "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "parse-ms": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/process": {
-      "version": "0.11.10",
-      "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
-      "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6.0"
-      }
-    },
-    "node_modules/process-nextick-args": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
-      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
-      "license": "MIT"
-    },
-    "node_modules/propagate": {
-      "version": "2.0.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 8"
-      }
-    },
-    "node_modules/punycode": {
-      "version": "2.3.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/queue-microtask": {
-      "version": "1.2.3",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "license": "MIT"
-    },
-    "node_modules/queue-tick": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz",
-      "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==",
-      "license": "MIT"
-    },
-    "node_modules/readable-stream": {
-      "version": "4.7.0",
-      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz",
-      "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==",
-      "license": "MIT",
-      "dependencies": {
-        "abort-controller": "^3.0.0",
-        "buffer": "^6.0.3",
-        "events": "^3.3.0",
-        "process": "^0.11.10",
-        "string_decoder": "^1.3.0"
-      },
-      "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      }
-    },
-    "node_modules/readdir-glob": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-3.0.0.tgz",
-      "integrity": "sha512-AhNB2KgKeVJr16nK9LLZbJNWnYoT23ZrumNKFDebHBdkC8KHSqWo871JAUhoWC/RtjEVdqNMFpM6qrwRbaUqpw==",
-      "license": "Apache-2.0",
-      "dependencies": {
-        "minimatch": "^10.2.2"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/yqnn"
-      }
-    },
-    "node_modules/readdir-glob/node_modules/balanced-match": {
-      "version": "4.0.4",
-      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
-      "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
-      "license": "MIT",
-      "engines": {
-        "node": "18 || 20 || >=22"
-      }
-    },
-    "node_modules/readdir-glob/node_modules/brace-expansion": {
-      "version": "5.0.9",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
-      "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
-      "license": "MIT",
-      "dependencies": {
-        "balanced-match": "^4.0.2"
-      },
-      "engines": {
-        "node": "20 || >=22"
-      }
-    },
-    "node_modules/readdir-glob/node_modules/minimatch": {
-      "version": "10.2.5",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
-      "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
-      "license": "BlueOak-1.0.0",
-      "dependencies": {
-        "brace-expansion": "^5.0.5"
-      },
-      "engines": {
-        "node": "18 || 20 || >=22"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      }
-    },
-    "node_modules/reflect.getprototypeof": {
-      "version": "1.0.10",
-      "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz",
-      "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.9",
-        "es-errors": "^1.3.0",
-        "es-object-atoms": "^1.0.0",
-        "get-intrinsic": "^1.2.7",
-        "get-proto": "^1.0.1",
-        "which-builtin-type": "^1.2.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/regexp.prototype.flags": {
-      "version": "1.5.4",
-      "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz",
-      "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "define-properties": "^1.2.1",
-        "es-errors": "^1.3.0",
-        "get-proto": "^1.0.1",
-        "gopd": "^1.2.0",
-        "set-function-name": "^2.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/require-directory": {
-      "version": "2.1.1",
-      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
-      "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/requireindex": {
-      "version": "1.1.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.10.5"
-      }
-    },
-    "node_modules/reserved-identifiers": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/reserved-identifiers/-/reserved-identifiers-1.2.0.tgz",
-      "integrity": "sha512-yE7KUfFvaBFzGPs5H3Ops1RevfUEsDc5Iz65rOwWg4lE8HJSYtle77uul3+573457oHvBKuHYDl/xqUkKpEEdw==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/resolve": {
-      "version": "1.22.8",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "is-core-module": "^2.13.0",
-        "path-parse": "^1.0.7",
-        "supports-preserve-symlinks-flag": "^1.0.0"
-      },
-      "bin": {
-        "resolve": "bin/resolve"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/resolve-cwd": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz",
-      "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==",
-      "dev": true,
-      "dependencies": {
-        "resolve-from": "^5.0.0"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/resolve-from": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
-      "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
-      "dev": true,
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/resolve-pkg-maps": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
-      "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
-      "dev": true,
-      "license": "MIT",
-      "funding": {
-        "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
-      }
-    },
-    "node_modules/reusify": {
-      "version": "1.0.4",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "iojs": ">=1.0.0",
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/rimraf": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
-      "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
-      "deprecated": "Rimraf versions prior to v4 are no longer supported",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "glob": "^7.1.3"
-      },
-      "bin": {
-        "rimraf": "bin.js"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      }
-    },
-    "node_modules/run-parallel": {
-      "version": "1.2.0",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "queue-microtask": "^1.2.2"
-      }
-    },
-    "node_modules/safe-array-concat": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz",
-      "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.2",
-        "get-intrinsic": "^1.2.6",
-        "has-symbols": "^1.1.0",
-        "isarray": "^2.0.5"
-      },
-      "engines": {
-        "node": ">=0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/safe-buffer": {
-      "version": "5.2.1",
-      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
-      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "license": "MIT"
-    },
-    "node_modules/safe-push-apply": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz",
-      "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "isarray": "^2.0.5"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/safe-regex-test": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz",
-      "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "es-errors": "^1.3.0",
-        "is-regex": "^1.2.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/semver": {
-      "version": "7.8.5",
-      "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
-      "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
-      "license": "ISC",
-      "bin": {
-        "semver": "bin/semver.js"
-      },
-      "engines": {
-        "node": ">=10"
-      }
-    },
-    "node_modules/serialize-error": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz",
-      "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==",
-      "dev": true,
-      "dependencies": {
-        "type-fest": "^0.13.1"
-      },
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/serialize-error/node_modules/type-fest": {
-      "version": "0.13.1",
-      "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
-      "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
-      "dev": true,
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/set-function-length": {
-      "version": "1.2.2",
-      "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
-      "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
-      "dev": true,
-      "dependencies": {
-        "define-data-property": "^1.1.4",
-        "es-errors": "^1.3.0",
-        "function-bind": "^1.1.2",
-        "get-intrinsic": "^1.2.4",
-        "gopd": "^1.0.1",
-        "has-property-descriptors": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/set-function-name": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz",
-      "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "define-data-property": "^1.1.4",
-        "es-errors": "^1.3.0",
-        "functions-have-names": "^1.2.3",
-        "has-property-descriptors": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/set-proto": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz",
-      "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "dunder-proto": "^1.0.1",
-        "es-errors": "^1.3.0",
-        "es-object-atoms": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/shebang-command": {
-      "version": "2.0.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "shebang-regex": "^3.0.0"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/shebang-regex": {
-      "version": "3.0.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/side-channel": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
-      "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "object-inspect": "^1.13.3",
-        "side-channel-list": "^1.0.0",
-        "side-channel-map": "^1.0.1",
-        "side-channel-weakmap": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/side-channel-list": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
-      "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "object-inspect": "^1.13.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/side-channel-map": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
-      "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "es-errors": "^1.3.0",
-        "get-intrinsic": "^1.2.5",
-        "object-inspect": "^1.13.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/side-channel-weakmap": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
-      "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "es-errors": "^1.3.0",
-        "get-intrinsic": "^1.2.5",
-        "object-inspect": "^1.13.3",
-        "side-channel-map": "^1.0.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/signal-exit": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
-      "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
-      "dev": true,
-      "engines": {
-        "node": ">=14"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      }
-    },
-    "node_modules/sinon": {
-      "version": "22.1.0",
-      "resolved": "https://registry.npmjs.org/sinon/-/sinon-22.1.0.tgz",
-      "integrity": "sha512-n1ajF2rBWMTtEwbKcw4UdFg4nCnDdq/U6RDoxtOd7oapOlRoJ5ynwFx60owROyhDpA9QhMZi0pCO/xtmwFjG7w==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "@sinonjs/commons": "^3.0.1",
-        "@sinonjs/fake-timers": "^15.4.0",
-        "@sinonjs/samsam": "^10.0.2",
-        "diff": "^9.0.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/sinon"
-      }
-    },
-    "node_modules/slash": {
-      "version": "5.1.0",
-      "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
-      "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=14.16"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/slice-ansi": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz",
-      "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ansi-styles": "^6.0.0",
-        "is-fullwidth-code-point": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/slice-ansi?sponsor=1"
-      }
-    },
-    "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz",
-      "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/spdx-exceptions": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz",
-      "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==",
-      "dev": true,
-      "license": "CC-BY-3.0"
-    },
-    "node_modules/spdx-expression-parse": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz",
-      "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "spdx-exceptions": "^2.1.0",
-        "spdx-license-ids": "^3.0.0"
-      }
-    },
-    "node_modules/spdx-license-ids": {
-      "version": "3.0.22",
-      "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz",
-      "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==",
-      "dev": true,
-      "license": "CC0-1.0"
-    },
-    "node_modules/sprintf-js": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
-      "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
-      "dev": true
-    },
-    "node_modules/stable-hash-x": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/stable-hash-x/-/stable-hash-x-0.2.0.tgz",
-      "integrity": "sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12.0.0"
-      }
-    },
-    "node_modules/stack-utils": {
-      "version": "2.0.6",
-      "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz",
-      "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==",
-      "dev": true,
-      "dependencies": {
-        "escape-string-regexp": "^2.0.0"
-      },
-      "engines": {
-        "node": ">=10"
-      }
-    },
-    "node_modules/stack-utils/node_modules/escape-string-regexp": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
-      "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
-      "dev": true,
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/stop-iteration-iterator": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
-      "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "internal-slot": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/streamx": {
-      "version": "2.20.1",
-      "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.20.1.tgz",
-      "integrity": "sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA==",
-      "license": "MIT",
-      "dependencies": {
-        "fast-fifo": "^1.3.2",
-        "queue-tick": "^1.0.1",
-        "text-decoder": "^1.1.0"
-      },
-      "optionalDependencies": {
-        "bare-events": "^2.2.0"
-      }
-    },
-    "node_modules/strict-event-emitter": {
-      "version": "0.5.1",
-      "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz",
-      "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/string_decoder": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
-      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
-      "license": "MIT",
-      "dependencies": {
-        "safe-buffer": "~5.2.0"
-      }
-    },
-    "node_modules/string-width": {
-      "version": "4.2.3",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "emoji-regex": "^8.0.0",
-        "is-fullwidth-code-point": "^3.0.0",
-        "strip-ansi": "^6.0.1"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/string.prototype.includes": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz",
-      "integrity": "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.7",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/string.prototype.trim": {
-      "version": "1.2.10",
-      "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz",
-      "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.2",
-        "define-data-property": "^1.1.4",
-        "define-properties": "^1.2.1",
-        "es-abstract": "^1.23.5",
-        "es-object-atoms": "^1.0.0",
-        "has-property-descriptors": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/string.prototype.trimend": {
-      "version": "1.0.9",
-      "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz",
-      "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.2",
-        "define-properties": "^1.2.1",
-        "es-object-atoms": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/string.prototype.trimstart": {
-      "version": "1.0.8",
-      "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz",
-      "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==",
-      "dev": true,
-      "dependencies": {
-        "call-bind": "^1.0.7",
-        "define-properties": "^1.2.1",
-        "es-object-atoms": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/strip-ansi": {
-      "version": "6.0.1",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ansi-regex": "^5.0.1"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/strip-bom": {
-      "version": "3.0.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/strip-final-newline": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz",
-      "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/strip-json-comments": {
-      "version": "3.1.1",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/strnum": {
-      "version": "2.2.3",
-      "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.2.3.tgz",
-      "integrity": "sha512-oKx6RUCuHfT3oyVjtnrmn19H1SiCqgJSg+54XqURKp5aCMbrXrhLjRN9TjuwMjiYstZ0MzDrHqkGZ5dFTKd+zg==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/NaturalIntelligence"
-        }
-      ],
-      "license": "MIT"
-    },
-    "node_modules/supertap": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/supertap/-/supertap-3.0.1.tgz",
-      "integrity": "sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==",
-      "dev": true,
-      "dependencies": {
-        "indent-string": "^5.0.0",
-        "js-yaml": "^3.14.1",
-        "serialize-error": "^7.0.1",
-        "strip-ansi": "^7.0.1"
-      },
-      "engines": {
-        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
-      }
-    },
-    "node_modules/supertap/node_modules/ansi-regex": {
-      "version": "6.1.0",
-      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
-      "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
-      "dev": true,
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/ansi-regex?sponsor=1"
-      }
-    },
-    "node_modules/supertap/node_modules/argparse": {
-      "version": "1.0.10",
-      "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
-      "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
-      "dev": true,
-      "dependencies": {
-        "sprintf-js": "~1.0.2"
-      }
-    },
-    "node_modules/supertap/node_modules/js-yaml": {
-      "version": "3.15.0",
-      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.0.tgz",
-      "integrity": "sha512-ttBQIIQPDeLjpPOohtUdXuXUVoA2uIB6fEH9HyJ7234s5mBJ5wTx20njxplLZQgLaOfpmPQA7X2t5AX6tIPbog==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "argparse": "^1.0.7",
-        "esprima": "^4.0.0"
-      },
-      "bin": {
-        "js-yaml": "bin/js-yaml.js"
-      }
-    },
-    "node_modules/supertap/node_modules/strip-ansi": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
-      "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
-      "dev": true,
-      "dependencies": {
-        "ansi-regex": "^6.0.1"
-      },
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/strip-ansi?sponsor=1"
-      }
-    },
-    "node_modules/supports-color": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
-      "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "has-flag": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
-    "node_modules/supports-preserve-symlinks-flag": {
-      "version": "1.0.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/svg-element-attributes": {
-      "version": "1.3.1",
-      "dev": true,
-      "license": "MIT",
-      "funding": {
-        "type": "github",
-        "url": "https://github.com/sponsors/wooorm"
-      }
-    },
-    "node_modules/synckit": {
-      "version": "0.9.2",
-      "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz",
-      "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@pkgr/core": "^0.1.0",
-        "tslib": "^2.6.2"
-      },
-      "engines": {
-        "node": "^14.18.0 || >=16.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/unts"
-      }
-    },
-    "node_modules/tar": {
-      "version": "7.5.20",
-      "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.20.tgz",
-      "integrity": "sha512-9FcyK4PA6+WbzlTM9WhQm6vB5W7cP7dUiPsv1g7YDwEQnQ1CGpK3MGlKk/ITVWMk05kHZuBhmVhiv8LZoy/PFQ==",
-      "dev": true,
-      "license": "BlueOak-1.0.0",
-      "dependencies": {
-        "@isaacs/fs-minipass": "^4.0.0",
-        "chownr": "^3.0.0",
-        "minipass": "^7.1.2",
-        "minizlib": "^3.1.0",
-        "yallist": "^5.0.0"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/tar-stream": {
-      "version": "3.1.7",
-      "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz",
-      "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==",
-      "license": "MIT",
-      "dependencies": {
-        "b4a": "^1.6.4",
-        "fast-fifo": "^1.2.0",
-        "streamx": "^2.15.0"
-      }
-    },
-    "node_modules/temp-dir": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz",
-      "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==",
-      "dev": true,
-      "engines": {
-        "node": ">=14.16"
-      }
-    },
-    "node_modules/text-decoder": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.0.tgz",
-      "integrity": "sha512-n1yg1mOj9DNpk3NeZOx7T6jchTbyJS3i3cucbNN6FcdPriMZx7NsgrGpWWdWZZGxD7ES1XB+3uoqHMgOKaN+fg==",
-      "license": "Apache-2.0",
-      "dependencies": {
-        "b4a": "^1.6.4"
-      }
-    },
-    "node_modules/text-table": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
-      "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/time-zone": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz",
-      "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==",
-      "dev": true,
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/tinyglobby": {
-      "version": "0.2.15",
-      "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
-      "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "fdir": "^6.5.0",
-        "picomatch": "^4.0.3"
-      },
-      "engines": {
-        "node": ">=12.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/SuperchupuDev"
-      }
-    },
-    "node_modules/tinyglobby/node_modules/fdir": {
-      "version": "6.5.0",
-      "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
-      "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12.0.0"
-      },
-      "peerDependencies": {
-        "picomatch": "^3 || ^4"
-      },
-      "peerDependenciesMeta": {
-        "picomatch": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/tmp": {
-      "version": "0.2.7",
-      "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.7.tgz",
-      "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=14.14"
-      }
-    },
-    "node_modules/tmp-promise": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz",
-      "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==",
-      "dependencies": {
-        "tmp": "^0.2.0"
-      }
-    },
-    "node_modules/to-regex-range": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
-      "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "is-number": "^7.0.0"
-      },
-      "engines": {
-        "node": ">=8.0"
-      }
-    },
-    "node_modules/to-valid-identifier": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/to-valid-identifier/-/to-valid-identifier-1.0.0.tgz",
-      "integrity": "sha512-41wJyvKep3yT2tyPqX/4blcfybknGB4D+oETKLs7Q76UiPqRpUJK3hr1nxelyYO0PHKVzJwlu0aCeEAsGI6rpw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@sindresorhus/base62": "^1.0.0",
-        "reserved-identifiers": "^1.0.0"
-      },
-      "engines": {
-        "node": ">=20"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/tr46": {
-      "version": "0.0.3",
-      "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
-      "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/traverse": {
-      "version": "0.3.9",
-      "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
-      "integrity": "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==",
-      "license": "MIT/X11",
-      "engines": {
-        "node": "*"
-      }
-    },
-    "node_modules/ts-api-utils": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz",
-      "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18.12"
-      },
-      "peerDependencies": {
-        "typescript": ">=4.8.4"
-      }
-    },
-    "node_modules/tsconfig-paths": {
-      "version": "3.15.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/json5": "^0.0.29",
-        "json5": "^1.0.2",
-        "minimist": "^1.2.6",
-        "strip-bom": "^3.0.0"
-      }
-    },
-    "node_modules/tslib": {
-      "version": "2.8.1",
-      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
-      "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
-      "license": "0BSD"
-    },
-    "node_modules/tsx": {
-      "version": "4.23.8",
-      "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.8.tgz",
-      "integrity": "sha512-8W675THjbzfFmLOQzjDBIBna+WjqMGIxmSZ1mMc1+o9qoVsEuAgQu5j5ueLhau8inOkDu9OslVg0FmfBs1RIHw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "esbuild": "~0.28.0"
-      },
-      "bin": {
-        "tsx": "dist/cli.mjs"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      },
-      "optionalDependencies": {
-        "fsevents": "~2.3.3"
-      }
-    },
-    "node_modules/tunnel": {
-      "version": "0.0.6",
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.6.11 <=0.7.0 || >=0.7.3"
-      }
-    },
-    "node_modules/type-check": {
-      "version": "0.4.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "prelude-ls": "^1.2.1"
-      },
-      "engines": {
-        "node": ">= 0.8.0"
-      }
-    },
-    "node_modules/type-detect": {
-      "version": "4.0.8",
-      "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
-      "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/type-fest": {
-      "version": "0.20.2",
-      "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
-      "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
-      "dev": true,
-      "license": "(MIT OR CC0-1.0)",
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/typed-array-buffer": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz",
-      "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "es-errors": "^1.3.0",
-        "is-typed-array": "^1.1.14"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/typed-array-byte-length": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz",
-      "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.8",
-        "for-each": "^0.3.3",
-        "gopd": "^1.2.0",
-        "has-proto": "^1.2.0",
-        "is-typed-array": "^1.1.14"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/typed-array-byte-offset": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz",
-      "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "available-typed-arrays": "^1.0.7",
-        "call-bind": "^1.0.8",
-        "for-each": "^0.3.3",
-        "gopd": "^1.2.0",
-        "has-proto": "^1.2.0",
-        "is-typed-array": "^1.1.15",
-        "reflect.getprototypeof": "^1.0.9"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/typed-array-length": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz",
-      "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind": "^1.0.7",
-        "for-each": "^0.3.3",
-        "gopd": "^1.0.1",
-        "is-typed-array": "^1.1.13",
-        "possible-typed-array-names": "^1.0.0",
-        "reflect.getprototypeof": "^1.0.6"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/typescript": {
-      "version": "6.0.3",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
-      "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
-      "dev": true,
-      "license": "Apache-2.0",
-      "bin": {
-        "tsc": "bin/tsc",
-        "tsserver": "bin/tsserver"
-      },
-      "engines": {
-        "node": ">=14.17"
-      }
-    },
-    "node_modules/typescript-eslint": {
-      "version": "8.66.0",
-      "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.66.0.tgz",
-      "integrity": "sha512-QlEbBPz/RuJ1XUHj29nm3t0F/O/cSlEnntozqPOYHnnTGAXFamnMBu5i9Vn6vhUPHGAjR+Vl+5J8vPN/BMUrJw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@typescript-eslint/eslint-plugin": "8.66.0",
-        "@typescript-eslint/parser": "8.66.0",
-        "@typescript-eslint/typescript-estree": "8.66.0",
-        "@typescript-eslint/utils": "8.66.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependencies": {
-        "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
-        "typescript": ">=4.8.4 <6.1.0"
-      }
-    },
-    "node_modules/unbox-primitive": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz",
-      "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.3",
-        "has-bigints": "^1.0.2",
-        "has-symbols": "^1.1.0",
-        "which-boxed-primitive": "^1.1.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/undici": {
-      "version": "6.28.0",
-      "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz",
-      "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=18.17"
-      }
-    },
-    "node_modules/undici-types": {
-      "version": "6.21.0",
-      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
-      "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/unicorn-magic": {
-      "version": "0.3.0",
-      "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz",
-      "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/universal-user-agent": {
-      "version": "6.0.0",
-      "license": "ISC"
-    },
-    "node_modules/unrs-resolver": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz",
-      "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==",
-      "dev": true,
-      "hasInstallScript": true,
-      "license": "MIT",
-      "dependencies": {
-        "napi-postinstall": "^0.3.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/unrs-resolver"
-      },
-      "optionalDependencies": {
-        "@unrs/resolver-binding-android-arm-eabi": "1.11.1",
-        "@unrs/resolver-binding-android-arm64": "1.11.1",
-        "@unrs/resolver-binding-darwin-arm64": "1.11.1",
-        "@unrs/resolver-binding-darwin-x64": "1.11.1",
-        "@unrs/resolver-binding-freebsd-x64": "1.11.1",
-        "@unrs/resolver-binding-linux-arm-gnueabihf": "1.11.1",
-        "@unrs/resolver-binding-linux-arm-musleabihf": "1.11.1",
-        "@unrs/resolver-binding-linux-arm64-gnu": "1.11.1",
-        "@unrs/resolver-binding-linux-arm64-musl": "1.11.1",
-        "@unrs/resolver-binding-linux-ppc64-gnu": "1.11.1",
-        "@unrs/resolver-binding-linux-riscv64-gnu": "1.11.1",
-        "@unrs/resolver-binding-linux-riscv64-musl": "1.11.1",
-        "@unrs/resolver-binding-linux-s390x-gnu": "1.11.1",
-        "@unrs/resolver-binding-linux-x64-gnu": "1.11.1",
-        "@unrs/resolver-binding-linux-x64-musl": "1.11.1",
-        "@unrs/resolver-binding-wasm32-wasi": "1.11.1",
-        "@unrs/resolver-binding-win32-arm64-msvc": "1.11.1",
-        "@unrs/resolver-binding-win32-ia32-msvc": "1.11.1",
-        "@unrs/resolver-binding-win32-x64-msvc": "1.11.1"
-      }
-    },
-    "node_modules/unzip-stream": {
-      "version": "0.3.4",
-      "resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.4.tgz",
-      "integrity": "sha512-PyofABPVv+d7fL7GOpusx7eRT9YETY2X04PhwbSipdj6bMxVCFJrr+nm0Mxqbf9hUiTin/UsnuFWBXlDZFy0Cw==",
-      "license": "MIT",
-      "dependencies": {
-        "binary": "^0.3.0",
-        "mkdirp": "^0.5.1"
-      }
-    },
-    "node_modules/update-browserslist-db": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz",
-      "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "opencollective",
-          "url": "https://opencollective.com/browserslist"
-        },
-        {
-          "type": "tidelift",
-          "url": "https://tidelift.com/funding/github/npm/browserslist"
-        },
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/ai"
-        }
-      ],
-      "license": "MIT",
-      "dependencies": {
-        "escalade": "^3.2.0",
-        "picocolors": "^1.1.0"
-      },
-      "bin": {
-        "update-browserslist-db": "cli.js"
-      },
-      "peerDependencies": {
-        "browserslist": ">= 4.21.0"
-      }
-    },
-    "node_modules/uri-js": {
-      "version": "4.4.1",
-      "dev": true,
-      "license": "BSD-2-Clause",
-      "dependencies": {
-        "punycode": "^2.1.0"
-      }
-    },
-    "node_modules/utf8": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
-      "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "node_modules/util-deprecate": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
-      "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
-      "license": "MIT"
-    },
-    "node_modules/uuid": {
-      "version": "14.0.1",
-      "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.1.tgz",
-      "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==",
-      "funding": [
-        "https://github.com/sponsors/broofa",
-        "https://github.com/sponsors/ctavan"
-      ],
-      "license": "MIT",
-      "bin": {
-        "uuid": "dist-node/bin/uuid"
-      }
-    },
-    "node_modules/webidl-conversions": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
-      "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
-      "dev": true,
-      "license": "BSD-2-Clause"
-    },
-    "node_modules/well-known-symbols": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz",
-      "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==",
-      "dev": true,
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/whatwg-url": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
-      "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "tr46": "~0.0.3",
-        "webidl-conversions": "^3.0.0"
-      }
-    },
-    "node_modules/which": {
-      "version": "2.0.2",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "isexe": "^2.0.0"
-      },
-      "bin": {
-        "node-which": "bin/node-which"
-      },
-      "engines": {
-        "node": ">= 8"
-      }
-    },
-    "node_modules/which-boxed-primitive": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz",
-      "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "is-bigint": "^1.1.0",
-        "is-boolean-object": "^1.2.1",
-        "is-number-object": "^1.1.1",
-        "is-string": "^1.1.1",
-        "is-symbol": "^1.1.1"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/which-builtin-type": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz",
-      "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "function.prototype.name": "^1.1.6",
-        "has-tostringtag": "^1.0.2",
-        "is-async-function": "^2.0.0",
-        "is-date-object": "^1.1.0",
-        "is-finalizationregistry": "^1.1.0",
-        "is-generator-function": "^1.0.10",
-        "is-regex": "^1.2.1",
-        "is-weakref": "^1.0.2",
-        "isarray": "^2.0.5",
-        "which-boxed-primitive": "^1.1.0",
-        "which-collection": "^1.0.2",
-        "which-typed-array": "^1.1.16"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/which-collection": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz",
-      "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "is-map": "^2.0.3",
-        "is-set": "^2.0.3",
-        "is-weakmap": "^2.0.2",
-        "is-weakset": "^2.0.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/which-typed-array": {
-      "version": "1.1.20",
-      "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz",
-      "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "available-typed-arrays": "^1.0.7",
-        "call-bind": "^1.0.8",
-        "call-bound": "^1.0.4",
-        "for-each": "^0.3.5",
-        "get-proto": "^1.0.1",
-        "gopd": "^1.2.0",
-        "has-tostringtag": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/wrap-ansi": {
-      "version": "7.0.0",
-      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
-      "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ansi-styles": "^4.0.0",
-        "string-width": "^4.1.0",
-        "strip-ansi": "^6.0.0"
-      },
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
-      }
-    },
-    "node_modules/wrap-ansi/node_modules/ansi-styles": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
-      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "color-convert": "^2.0.1"
-      },
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
-      }
-    },
-    "node_modules/wrappy": {
-      "version": "1.0.2",
-      "license": "ISC"
-    },
-    "node_modules/write-file-atomic": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-6.0.0.tgz",
-      "integrity": "sha512-GmqrO8WJ1NuzJ2DrziEI2o57jKAVIQNf8a18W3nCYU3H7PNWqCCVTeH6/NQE93CIllIgQS98rrmVkYgTX9fFJQ==",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "imurmurhash": "^0.1.4",
-        "signal-exit": "^4.0.1"
-      },
-      "engines": {
-        "node": "^18.17.0 || >=20.5.0"
-      }
-    },
-    "node_modules/xml-naming": {
-      "version": "0.1.0",
-      "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.1.0.tgz",
-      "integrity": "sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==",
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/NaturalIntelligence"
-        }
-      ],
-      "license": "MIT",
-      "engines": {
-        "node": ">=16.0.0"
-      }
-    },
-    "node_modules/y18n": {
-      "version": "5.0.8",
-      "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
-      "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
-      "dev": true,
-      "license": "ISC",
-      "engines": {
-        "node": ">=10"
-      }
-    },
-    "node_modules/yallist": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
-      "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==",
-      "dev": true,
-      "license": "BlueOak-1.0.0",
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/yaml": {
-      "version": "2.9.0",
-      "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
-      "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
-      "license": "ISC",
-      "bin": {
-        "yaml": "bin.mjs"
-      },
-      "engines": {
-        "node": ">= 14.6"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/eemeli"
-      }
-    },
-    "node_modules/yargs": {
-      "version": "17.7.2",
-      "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
-      "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "cliui": "^8.0.1",
-        "escalade": "^3.1.1",
-        "get-caller-file": "^2.0.5",
-        "require-directory": "^2.1.1",
-        "string-width": "^4.2.3",
-        "y18n": "^5.0.5",
-        "yargs-parser": "^21.1.1"
-      },
-      "engines": {
-        "node": ">=12"
-      }
-    },
-    "node_modules/yargs-parser": {
-      "version": "21.1.1",
-      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
-      "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
-      "dev": true,
-      "license": "ISC",
-      "engines": {
-        "node": ">=12"
-      }
-    },
-    "node_modules/yocto-queue": {
-      "version": "0.1.0",
-      "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
-      "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/yoctocolors": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz",
-      "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/zip-stream": {
-      "version": "7.0.5",
-      "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-7.0.5.tgz",
-      "integrity": "sha512-dSvYKdvLsAHCDqPOhIwk/q5CvuWtTB3Dgpoe0uVEFjTzIOAmsQpprX25InCvrvJsirEbu1OHyy67n/kAj1Sw/w==",
-      "license": "MIT",
-      "dependencies": {
-        "compress-commons": "^7.0.0",
-        "normalize-path": "^3.0.0",
-        "readable-stream": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "pr-checks": {
-      "dependencies": {
-        "@actions/core": "^2.0.3",
-        "@actions/github": "^8.0.1",
-        "@octokit/core": "^7.0.7",
-        "@octokit/plugin-paginate-rest": ">=9.2.2",
-        "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
-        "semver": "^7.8.5",
-        "yaml": "^2.9.0"
-      },
-      "devDependencies": {
-        "@types/node": "^20.19.43",
-        "tsx": "^4.23.8"
-      }
-    }
-  }
-}
diff --git a/package.json b/package.json
deleted file mode 100644
index 4e5d1410ce..0000000000
--- a/package.json
+++ /dev/null
@@ -1,100 +0,0 @@
-{
-  "name": "codeql",
-  "version": "4.37.8",
-  "private": true,
-  "description": "CodeQL action",
-  "scripts": {
-    "_build_comment": "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'",
-    "build": "./scripts/check-node-modules.sh && npm run transpile && node build.mjs",
-    "lint": "eslint --report-unused-disable-directives --max-warnings=0 .",
-    "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif",
-    "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix",
-    "ava": "npm run transpile && ava --verbose",
-    "test": "npm run ava -- src/",
-    "test-debug": "npm run test -- --timeout=20m",
-    "transpile": "tsc --build --verbose tsconfig.json",
-    "update-pr-checks": "./pr-checks/sync.sh"
-  },
-  "license": "MIT",
-  "workspaces": [
-    "pr-checks"
-  ],
-  "dependencies": {
-    "@actions/artifact": "^5.0.3",
-    "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2",
-    "@actions/cache": "^5.2.0",
-    "@actions/core": "^2.0.3",
-    "@actions/exec": "^2.0.0",
-    "@actions/github": "^8.0.1",
-    "@actions/glob": "^0.5.0",
-    "@actions/http-client": "^3.0.0",
-    "@actions/io": "^2.0.0",
-    "@actions/tool-cache": "^3.0.1",
-    "@octokit/core": "^7.0.7",
-    "@octokit/plugin-paginate-rest": "^14.0.0",
-    "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
-    "@octokit/plugin-retry": "^8.1.1",
-    "archiver": "^8.0.0",
-    "fast-deep-equal": "^3.1.3",
-    "follow-redirects": "^1.16.0",
-    "get-folder-size": "^5.0.0",
-    "https-proxy-agent": "^7.0.6",
-    "js-yaml": "^5.2.3",
-    "jsonschema": "1.5.0",
-    "long": "^5.3.2",
-    "node-forge": "^1.4.0",
-    "semver": "^7.8.5",
-    "uuid": "^14.0.1",
-    "undici": "^6.28.0"
-  },
-  "devDependencies": {
-    "@ava/typescript": "6.0.0",
-    "@eslint/compat": "^2.1.0",
-    "@microsoft/eslint-formatter-sarif": "^3.1.0",
-    "@octokit/types": "^16.0.0",
-    "@types/archiver": "^8.0.0",
-    "@types/follow-redirects": "^1.14.4",
-    "@types/js-yaml": "^4.0.9",
-    "@types/node": "^20.19.43",
-    "@types/node-forge": "^1.3.14",
-    "@types/sarif": "^2.1.7",
-    "@types/semver": "^7.8.0",
-    "@types/sinon": "^22.0.0",
-    "ava": "^6.4.1",
-    "esbuild": "^0.28.1",
-    "eslint": "^9.39.5",
-    "eslint-import-resolver-typescript": "^4.4.5",
-    "eslint-plugin-github": "^6.1.2",
-    "eslint-plugin-import-x": "^4.17.1",
-    "eslint-plugin-jsdoc": "^62.9.0",
-    "eslint-plugin-no-async-foreach": "^0.1.1",
-    "glob": "^13.0.6",
-    "globals": "^17.9.0",
-    "nock": "^14.0.17",
-    "sinon": "^22.1.0",
-    "typescript": "^6.0.3",
-    "typescript-eslint": "^8.66.0"
-  },
-  "overrides": {
-    "@actions/tool-cache": {
-      "semver": ">=6.3.1"
-    },
-    "@octokit/request-error": {
-      "semver": ">=5.1.1"
-    },
-    "@octokit/request": {
-      "semver": ">=8.4.1"
-    },
-    "@octokit/plugin-paginate-rest": {
-      "semver": ">=9.2.2"
-    },
-    "eslint-plugin-import": {
-      "semver": ">=6.3.1"
-    },
-    "eslint-plugin-jsx-a11y": {
-      "semver": ">=6.3.1"
-    },
-    "glob": "^13.0.6",
-    "undici": "^6.28.0"
-  }
-}
diff --git a/pr-checks/.gitignore b/pr-checks/.gitignore
deleted file mode 100644
index c2658d7d1b..0000000000
--- a/pr-checks/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/
diff --git a/pr-checks/api-client.ts b/pr-checks/api-client.ts
deleted file mode 100644
index 93675dba77..0000000000
--- a/pr-checks/api-client.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import * as githubUtils from "@actions/github/lib/utils";
-import { type Octokit } from "@octokit/core";
-import { type PaginateInterface } from "@octokit/plugin-paginate-rest";
-import { type Api } from "@octokit/plugin-rest-endpoint-methods";
-
-/** The type of the Octokit client. */
-export type ApiClient = Octokit & Api & { paginate: PaginateInterface };
-
-/** Constructs an `ApiClient` using `token` for authentication. */
-export function getApiClient(token: string): ApiClient {
-  const opts = githubUtils.getOctokitOptions(token);
-  return new githubUtils.GitHub(opts);
-}
diff --git a/pr-checks/bundle-changelog.test.ts b/pr-checks/bundle-changelog.test.ts
deleted file mode 100644
index 6cc4d096ba..0000000000
--- a/pr-checks/bundle-changelog.test.ts
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * Tests for `bundle-changelog.ts`.
- */
-
-import * as assert from "node:assert/strict";
-import * as fs from "node:fs";
-import * as os from "node:os";
-import * as path from "node:path";
-import { afterEach, beforeEach, describe, it } from "node:test";
-
-import {
-  CLI_VERSION_ENV_VAR,
-  getCLIVersion,
-  getPRNumber,
-  getPRUrl,
-  PR_URL_ENV_VAR,
-  updateChangelog,
-} from "./bundle-changelog";
-import {
-  EMPTY_CHANGELOG,
-  NO_CHANGES_STR,
-  UNRELEASED_PLACEHOLDER,
-} from "./changelog";
-
-let testDir: string;
-
-beforeEach(() => {
-  // Set up a temporary directory for testing
-  testDir = fs.mkdtempSync(path.join(os.tmpdir(), "bundle-changelog-test-"));
-});
-
-afterEach(() => {
-  /** Clean up temporary directories. */
-  fs.rmSync(testDir, { recursive: true, force: true });
-});
-
-describe("getCLIVersion", async () => {
-  await it("throws if the environment variable is not set", async () => {
-    delete process.env[CLI_VERSION_ENV_VAR];
-    assert.throws(() => getCLIVersion());
-  });
-
-  await it("throws if the environment variable is empty", async () => {
-    process.env[CLI_VERSION_ENV_VAR] = "    ";
-    assert.throws(() => getCLIVersion());
-  });
-
-  await it("returns value of the environment variable if set", async () => {
-    const testValue = "1.2.3";
-    process.env[CLI_VERSION_ENV_VAR] = testValue;
-    assert.deepEqual(getCLIVersion(), testValue);
-  });
-});
-
-const testPrUrl = "https://github.com/github/codeql-action/pulls/42";
-
-describe("getPRUrl", async () => {
-  await it("throws if the environment variable is not set", async () => {
-    delete process.env[PR_URL_ENV_VAR];
-    assert.throws(() => getPRUrl());
-  });
-
-  await it("throws if the environment variable is empty", async () => {
-    process.env[PR_URL_ENV_VAR] = "    ";
-    assert.throws(() => getPRUrl());
-  });
-
-  await it("returns value of the environment variable if set", async () => {
-    process.env[PR_URL_ENV_VAR] = testPrUrl;
-    assert.deepEqual(getPRUrl(), testPrUrl);
-  });
-});
-
-describe("getPRNumber", async () => {
-  await it("throws if the last part of the input is not a number", async () => {
-    assert.throws(() => getPRNumber(`${testPrUrl}/foo`));
-  });
-
-  await it("throws if the last part of the input is not a positive number", async () => {
-    assert.throws(() => getPRNumber(`${testPrUrl}/-100`));
-  });
-
-  await it("returns the PR number from an URL", async () => {
-    assert.equal(getPRNumber(testPrUrl), 42);
-  });
-});
-
-const testChangelog = `${EMPTY_CHANGELOG.trimEnd()}
-
-## 4.23.7
-
-- Other change
-
-## 4.23.6
-
-${NO_CHANGES_STR}`;
-
-const expectedChangelog = `# CodeQL Action Changelog
-
-## ${UNRELEASED_PLACEHOLDER}
-
-- Update default CodeQL bundle version to
-
-## 4.23.7
-
-- Other change
-
-## 4.23.6
-
-${NO_CHANGES_STR}`;
-
-describe("updateChangelog", async () => {
-  await it("removes `NO_CHANGES_STR` if present in [UNRELEASED] section", async () => {
-    const result = updateChangelog(EMPTY_CHANGELOG, "");
-    assert.ok(!result.includes(NO_CHANGES_STR.trim()));
-  });
-
-  await it("doesn't remove `NO_CHANGES_STR` if present in versioned section", async () => {
-    const result = updateChangelog(
-      EMPTY_CHANGELOG.replace(UNRELEASED_PLACEHOLDER, "1.2.3"),
-      "",
-    );
-    assert.ok(result.includes(NO_CHANGES_STR.trim()));
-  });
-
-  await it("throws if there are no sections", async () => {
-    assert.throws(() => {
-      updateChangelog(
-        "# CodeQL Action Changelog",
-        "- Update default CodeQL bundle version to",
-      );
-    });
-  });
-
-  await it("adds note at the end of the first section", async () => {
-    const result = updateChangelog(
-      testChangelog,
-      "- Update default CodeQL bundle version to",
-    );
-    assert.deepEqual(result, expectedChangelog);
-  });
-});
diff --git a/pr-checks/bundle-changelog.ts b/pr-checks/bundle-changelog.ts
deleted file mode 100755
index 557a8556c1..0000000000
--- a/pr-checks/bundle-changelog.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/**
- * Updates the changelog with a change note for an updated CodeQL CLI bundle.
- */
-
-import * as fs from "node:fs";
-
-import {
-  parseChangelog,
-  renderChangelog,
-  UNRELEASED_PLACEHOLDER,
-} from "./changelog";
-import { CHANGELOG_FILE, CLI_BUNDLE_RELEASE_URL_PREFIX } from "./config";
-import { getErrorMessage } from "./util";
-
-export const CLI_VERSION_ENV_VAR = "CLI_VERSION";
-export const PR_URL_ENV_VAR = "PR_URL";
-
-/** Gets the CLI version from the environment. */
-export function getCLIVersion() {
-  const cliVersion = process.env[CLI_VERSION_ENV_VAR];
-
-  if (cliVersion === undefined || cliVersion.trim() === "") {
-    throw new Error(`No CLI version was set in '${CLI_VERSION_ENV_VAR}'.`);
-  }
-
-  return cliVersion;
-}
-
-/** Gets the PR URL from the environment. */
-export function getPRUrl() {
-  const prUrl = process.env[PR_URL_ENV_VAR];
-
-  if (prUrl === undefined || prUrl.trim() === "") {
-    throw new Error(`No PR URL was set in '${PR_URL_ENV_VAR}'.`);
-  }
-
-  return prUrl;
-}
-
-/**
- * Gets the PR number from something like a PR URL.
- */
-export function getPRNumber(prUrl: string) {
-  const prUrlParts = prUrl.split("/");
-  const prNumberStr = prUrlParts[prUrlParts.length - 1];
-
-  const prNumber = Number.parseInt(prNumberStr, 10);
-
-  if (!Number.isInteger(prNumber) || prNumber <= 0) {
-    throw new Error(
-      `Invalid PR URL '${prUrl}': last part is not a positive number`,
-    );
-  }
-
-  return prNumber;
-}
-
-/**
- * Updates `changelog` by adding `changelogNote` to the first section.
- *
- * @param contents The existing changelog contents.
- * @param changelogNote The note to add to the first section.
- */
-export function updateChangelog(contents: string, changelogNote: string) {
-  // If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
-  contents = contents.replace(
-    `## ${UNRELEASED_PLACEHOLDER}\n\nNo user facing changes.`,
-    `## ${UNRELEASED_PLACEHOLDER}\n`,
-  );
-
-  const changelog = parseChangelog(contents);
-
-  if (changelog.sections.length === 0) {
-    throw new Error("The changelog contains no existing sections.");
-  }
-
-  // Add the changelog note to the bottom of the first section.
-  const firstSection = changelog.sections[0];
-  const lastLine = firstSection.bodyLines.pop();
-
-  if (lastLine !== undefined && lastLine.trim() !== "") {
-    // We expect the last line to be empty. If it isn't for some reason,
-    // add it back.
-    firstSection.bodyLines.push(lastLine);
-  }
-
-  firstSection.bodyLines.push(changelogNote);
-
-  // If the last line is empty as expected, then add it back in after the new note.
-  if (lastLine?.trim() === "") {
-    firstSection.bodyLines.push(lastLine);
-  }
-
-  return renderChangelog(changelog);
-}
-
-function main() {
-  try {
-    const cliVersion = getCLIVersion();
-    const prUrl = getPRUrl();
-
-    // The GitHub Release for the new bundle version.
-    const bundleReleaseUrl = `${CLI_BUNDLE_RELEASE_URL_PREFIX}${cliVersion}`;
-
-    // Get the PR number from the PR URL.
-    const prNumber = getPRNumber(prUrl);
-    const changelogNote = `- Update default CodeQL bundle version to [${cliVersion}](${bundleReleaseUrl}). [#${prNumber}](${prUrl})`;
-
-    let changelog = fs.readFileSync(CHANGELOG_FILE, "utf-8");
-
-    changelog = updateChangelog(changelog, changelogNote);
-
-    fs.writeFileSync(CHANGELOG_FILE, changelog);
-
-    return 0;
-  } catch (err) {
-    console.error(`Failed to bundle changelog: ${getErrorMessage(err)}`);
-    return -1;
-  }
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  process.exit(main());
-}
diff --git a/pr-checks/bundle-metadata.ts b/pr-checks/bundle-metadata.ts
deleted file mode 100755
index 25c282e9ae..0000000000
--- a/pr-checks/bundle-metadata.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env npx tsx
-
-import * as fs from "node:fs/promises";
-
-import { BUNDLE_METADATA_FILE } from "./config";
-
-interface InputInfo {
-  bytesInOutput: number;
-}
-
-type Inputs = Record;
-
-interface Output {
-  bytes: number;
-  inputs: Inputs;
-}
-
-interface Metadata {
-  outputs: Record;
-}
-
-function toMB(bytes: number): string {
-  return `${(bytes / (1024 * 1024)).toFixed(2)}MB`;
-}
-
-async function main() {
-  const fileContents = await fs.readFile(BUNDLE_METADATA_FILE);
-  const metadata = JSON.parse(String(fileContents)) as Metadata;
-
-  for (const [outputFile, outputData] of Object.entries(
-    metadata.outputs,
-  ).reverse()) {
-    console.info(`${outputFile}: ${toMB(outputData.bytes)}`);
-
-    for (const [inputName, inputData] of Object.entries(outputData.inputs)) {
-      // Ignore any inputs that make up less than 5% of the output.
-      const percentage = (inputData.bytesInOutput / outputData.bytes) * 100.0;
-      if (percentage < 5.0) continue;
-
-      console.info(`  ${inputName}: ${toMB(inputData.bytesInOutput)}`);
-    }
-  }
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  void main();
-}
diff --git a/pr-checks/changelog.test.ts b/pr-checks/changelog.test.ts
deleted file mode 100755
index 817852e3e1..0000000000
--- a/pr-checks/changelog.test.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/**
- * Tests for `changelog.ts`.
- */
-
-import * as assert from "node:assert/strict";
-import * as fs from "node:fs";
-import { describe, it } from "node:test";
-
-import {
-  EMPTY_CHANGELOG,
-  getReleaseDateString,
-  parseChangelog,
-  processChangelogForBackports,
-  renderChangelog,
-  setVersionAndDate,
-} from "./changelog";
-import { CHANGELOG_FILE } from "./config";
-
-const testDate = new Date(2026, 7, 14);
-
-describe("getReleaseDateString", async () => {
-  await it("formats dates as expected", async () => {
-    assert.equal(getReleaseDateString(testDate), "14 Aug 2026");
-  });
-});
-
-const emptyChangelogExpected = `# CodeQL Action Changelog
-
-## 9.99.9 - 14 Aug 2026
-
-No user facing changes.
-
-`;
-
-describe("setVersionAndDate", async () => {
-  await it("replaces the placeholder", async () => {
-    const result = setVersionAndDate("9.99.9", EMPTY_CHANGELOG, testDate);
-    assert.equal(result, emptyChangelogExpected);
-  });
-});
-
-describe("parseChangelog + renderChangelog", async () => {
-  await it("renderChangelog(parseChangelog(c)) == c", async () => {
-    const actualChangelog = fs.readFileSync(CHANGELOG_FILE, "utf-8");
-    const roundtrip = renderChangelog(parseChangelog(actualChangelog));
-    assert.deepEqual(roundtrip.split("\n"), actualChangelog.split("\n"));
-  });
-});
-
-const testChangelog = `# CodeQL Action Changelog
-
-## 4.12.3 - 14 Aug 2026
-
-No user facing changes.
-`;
-
-const testChangelogResult: string = `# CodeQL Action Changelog
-
-## 3.12.3 - 14 Aug 2026
-
-No user facing changes.
-`;
-
-describe("processChangelogForBackports", async () => {
-  await it("replaces major versions", async () => {
-    const result = processChangelogForBackports("4", "3", testChangelog);
-
-    assert.deepEqual(result.split("\n"), testChangelogResult.split("\n"));
-  });
-});
diff --git a/pr-checks/changelog.ts b/pr-checks/changelog.ts
deleted file mode 100644
index 4cf1e75494..0000000000
--- a/pr-checks/changelog.ts
+++ /dev/null
@@ -1,212 +0,0 @@
-import * as fs from "node:fs";
-
-import { CHANGELOG_FILE, DryRunOption } from "./config";
-
-/** The placeholder in the header for unreleased changes. */
-export const UNRELEASED_PLACEHOLDER = "[UNRELEASED]";
-
-/** The default contents for a section in the changelog. */
-export const NO_CHANGES_STR = "No user facing changes.\n\n";
-
-/** Placeholder changelog content for a new release. */
-export const EMPTY_CHANGELOG = `# CodeQL Action Changelog
-
-## ${UNRELEASED_PLACEHOLDER}
-
-${NO_CHANGES_STR}`;
-
-/**
- * Represents sections in a changelog.
- */
-export interface ChangelogSection {
-  headerLine: string;
-  bodyLines: string[];
-}
-
-/**
- * Represents a changelog.
- */
-export interface Changelog {
-  preamble: string[];
-  sections: ChangelogSection[];
-}
-
-/** Returns `date` formatted as `DD Mon YYYY`. */
-export function getReleaseDateString(today: Date = new Date()): string {
-  return today.toLocaleDateString("en-GB", {
-    day: "2-digit",
-    month: "short",
-    year: "numeric",
-  });
-}
-
-export interface OpenChangelogOptions {
-  initChangelog?: boolean;
-}
-
-export function withChangelog(
-  transformer: (contents: string) => string,
-  options: DryRunOption & OpenChangelogOptions,
-): void {
-  let content: string;
-
-  if (options.initChangelog && !fs.existsSync(CHANGELOG_FILE)) {
-    content = EMPTY_CHANGELOG;
-  } else {
-    content = fs.readFileSync(CHANGELOG_FILE, "utf8");
-  }
-
-  if (!options.dryRun) {
-    fs.writeFileSync(CHANGELOG_FILE, transformer(content), "utf8");
-  } else {
-    console.info(`[DRY RUN] Would have written updated changelog.`);
-  }
-}
-
-/**
- * Updates the `[UNRELEASED]` marker in `CHANGELOG.md` with the given version
- * and today's date.
- */
-export function setVersionAndDate(
-  version: string,
-  content: string,
-  date: Date = new Date(),
-): string {
-  const versionAndDate = `${version} - ${getReleaseDateString(date)}`;
-  return content.replace(UNRELEASED_PLACEHOLDER, versionAndDate);
-}
-
-/**
- * Parses `content` into a structured representation of a changelog.
- *
- * @param content The contents of the changelog file.
- */
-export function parseChangelog(content: string): Changelog {
-  const lines = content.split("\n");
-  let i = 0;
-
-  const preamble: string[] = [];
-  const sections: ChangelogSection[] = [];
-  let currentSection: ChangelogSection | undefined = undefined;
-
-  // Process all lines of the input file.
-  while (i < lines.length) {
-    const line = lines[i];
-
-    // Sections of the changelog start with `## `.
-    if (line.startsWith("## ")) {
-      // We have discovered a new section. If `currentSection` is already defined,
-      // then this marks the end of that section. Push it to the array of sections
-      // in the changelog.
-      if (currentSection !== undefined) {
-        sections.push(currentSection);
-      }
-
-      // Initialise the new section.
-      currentSection = { headerLine: line, bodyLines: [] };
-    } else if (currentSection !== undefined) {
-      // Add lines between the section header and the next to the current section.
-      currentSection.bodyLines.push(line);
-    } else {
-      // This is neither a section header nor are we in a section already,
-      // so this line is part of the preamble.
-      preamble.push(line);
-    }
-
-    i++;
-  }
-
-  // Push the current section to the array of completed sections, if there is
-  // still one unfinished.
-  if (currentSection !== undefined) {
-    sections.push(currentSection);
-  }
-
-  return { preamble, sections };
-}
-
-/**
- * Combines an array of lines into a single string by adding line breaks.
- */
-export function unlines(lines: string[]): string {
-  return `${lines.join("\n")}`;
-}
-
-/**
- * Renders a given changelog to a string.
- */
-export function renderChangelog(changelog: Changelog): string {
-  let result = unlines(changelog.preamble);
-
-  for (const section of changelog.sections) {
-    result += `\n${section.headerLine}\n${unlines(section.bodyLines)}`;
-  }
-
-  return result;
-}
-
-/**
- * Processes changelog entries for a backport, converting version references
- * from the source major version to the target major version and filtering
- * entries that only apply to newer versions.
- */
-export function processChangelogForBackports(
-  sourceBranchMajorVersion: string,
-  targetBranchMajorVersion: string,
-  content: string,
-): string {
-  // Changelog entries can use the following format to indicate
-  // that they only apply to newer versions
-  const someVersionsOnlyRegex = /\[v(\d+)\+ only\]/;
-
-  // Parse the changelog.
-  const changelog = parseChangelog(content);
-
-  if (changelog.sections.length === 0) {
-    throw new Error("Could not find any change sections in CHANGELOG.md");
-  }
-
-  // Filter out changelog entries that only apply to newer versions and
-  // update the section headings with the backport major version for
-  // sections we keep.
-  for (const section of changelog.sections) {
-    // Update the section headings with the backport major version.
-    section.headerLine = section.headerLine.replace(
-      `## ${sourceBranchMajorVersion}`,
-      `## ${targetBranchMajorVersion}`,
-    );
-
-    const filteredEntries: string[] = [];
-    let foundContent = false;
-
-    for (const line of section.bodyLines) {
-      // Skip the entry if `someVersionsOnlyRegex` matches and the major version
-      // of the target branch is smaller than the required version.
-      const match = someVersionsOnlyRegex.exec(line);
-      if (
-        match &&
-        Number.parseInt(targetBranchMajorVersion) < Number.parseInt(match[1])
-      ) {
-        continue;
-      }
-
-      // Keep the line.
-      filteredEntries.push(line);
-
-      // Set `foundContent` to `true` if the line is not empty.
-      if (line.trim() !== "") {
-        foundContent = true;
-      }
-    }
-
-    // Update the section with the retained entries.
-    section.bodyLines = filteredEntries;
-
-    // Add an entry if we didn't keep any.
-    if (!foundContent) {
-      section.bodyLines.push(NO_CHANGES_STR.trim());
-    }
-  }
-
-  return renderChangelog(changelog);
-}
diff --git a/pr-checks/check-repo-size.test.ts b/pr-checks/check-repo-size.test.ts
deleted file mode 100644
index 3299fa03cf..0000000000
--- a/pr-checks/check-repo-size.test.ts
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/*
-Tests for check-repo-size.ts.
-*/
-
-import * as assert from "node:assert/strict";
-import { execFileSync } from "node:child_process";
-import { randomBytes } from "node:crypto";
-import * as fs from "node:fs";
-import * as os from "node:os";
-import * as path from "node:path";
-import { afterEach, beforeEach, describe, it } from "node:test";
-
-import {
-  COMMENT_MARKER,
-  DEFAULT_BASE_REF,
-  buildCommentBody,
-  formatBytes,
-  formatPercent,
-  isDeltaSignificant,
-  measureArchiveSize,
-  readArgs,
-} from "./check-repo-size";
-
-describe("formatBytes", async () => {
-  const cases: Array<[number, boolean, string]> = [
-    // Unsigned values, including sub-KiB amounts which round to 0.00.
-    [0, false, "0.00 KiB"],
-    [512, false, "0.50 KiB"],
-    [1024, false, "1.00 KiB"],
-    [1024 * 1024, false, "1024.00 KiB"],
-    [2 * 1024 * 1024, false, "2048.00 KiB"],
-    // Negative values always use a leading minus.
-    [-2 * 1024 * 1024, false, "-2048.00 KiB"],
-    // signed=true prepends a + to non-negative values.
-    [0, true, "+0.00 KiB"],
-    [2 * 1024 * 1024, true, "+2048.00 KiB"],
-    [-2 * 1024 * 1024, true, "-2048.00 KiB"],
-  ];
-  for (const [bytes, signed, expected] of cases) {
-    await it(`formats ${bytes} (signed=${signed}) as ${expected}`, () => {
-      assert.equal(formatBytes(bytes, signed), expected);
-    });
-  }
-});
-
-describe("formatPercent", async () => {
-  await it("formats positive fractions with a leading +", () => {
-    assert.equal(formatPercent(0.1), "+10.00%");
-    assert.equal(formatPercent(0.0123), "+1.23%");
-  });
-
-  await it("formats negative fractions with a leading -", () => {
-    assert.equal(formatPercent(-0.1), "-10.00%");
-  });
-
-  await it("formats zero without a sign", () => {
-    assert.equal(formatPercent(0), "0.00%");
-  });
-});
-
-describe("isDeltaSignificant", async () => {
-  const cases: Array<[number, number, number, boolean]> = [
-    // At and above threshold (both signs).
-    [100, 1000, 0.1, true],
-    [101, 1000, 0.1, true],
-    [-100, 1000, 0.1, true],
-    // Below threshold (both signs, plus exact zero).
-    [99, 1000, 0.1, false],
-    [-99, 1000, 0.1, false],
-    [0, 1000, 0.1, false],
-  ];
-  for (const [delta, base, fraction, expected] of cases) {
-    await it(`returns ${expected} for delta=${delta}, base=${base}, fraction=${fraction}`, () => {
-      assert.equal(isDeltaSignificant(delta, base, fraction), expected);
-    });
-  }
-});
-
-describe("buildCommentBody", async () => {
-  await it("includes the marker, the base/PR/delta rows, and the run URL", () => {
-    const body = buildCommentBody({
-      baseRef: "main",
-      baseSize: 2_000_000,
-      prSize: 2_300_000,
-      runUrl: "https://example.test/run",
-    });
-
-    assert.match(body, new RegExp(`^${escapeRegExp(COMMENT_MARKER)}`));
-    assert.match(body, /Base \(`main`\) \| 1953\.13 KiB \(2000000 bytes\)/);
-    assert.match(body, /This PR \| 2246\.09 KiB \(2300000 bytes\)/);
-    assert.match(
-      body,
-      /\*\*Delta\*\* \| \*\*\+292\.97 KiB \(\+300000 bytes, \+15\.00%\)\*\*/,
-    );
-    assert.match(body, /\[workflow run\]\(https:\/\/example\.test\/run\)/);
-  });
-
-  await it("formats negative deltas with a leading minus and omits the run URL when missing", () => {
-    const body = buildCommentBody({
-      baseRef: "main",
-      baseSize: 2_000_000,
-      prSize: 1_800_000,
-    });
-    assert.match(
-      body,
-      /\*\*Delta\*\* \| \*\*-195\.31 KiB \(-200000 bytes, -10\.00%\)\*\*/,
-    );
-    assert.doesNotMatch(body, /workflow run/);
-  });
-});
-
-describe("readArgs", async () => {
-  await it("defaults the base ref and head commit for local runs", () => {
-    const originalEnv = process.env;
-    const originalArgv = process.argv;
-
-    try {
-      process.env = {};
-      process.argv = ["node", "check-repo-size.ts", "--output-dir", "/tmp/out"];
-
-      const args = readArgs();
-
-      assert.equal(args.baseRef, DEFAULT_BASE_REF);
-      assert.equal(args.baseCommitish, `origin/${DEFAULT_BASE_REF}`);
-      assert.equal(args.headCommitish, "HEAD");
-      assert.equal(args.outputDir, "/tmp/out");
-      assert.equal(args.runUrl, undefined);
-    } finally {
-      process.env = originalEnv;
-      process.argv = originalArgv;
-    }
-  });
-
-  await it("uses the base and head SHAs when provided by the workflow", () => {
-    const originalEnv = process.env;
-    const originalArgv = process.argv;
-
-    try {
-      process.env = {
-        BASE_REF: "main",
-        BASE_SHA: "abc123",
-        HEAD_SHA: "def456",
-        RUN_URL: "https://example.test/run",
-      };
-      process.argv = ["node", "check-repo-size.ts", "--output-dir", "/tmp/out"];
-
-      const args = readArgs();
-
-      assert.equal(args.baseRef, "main");
-      assert.equal(args.baseCommitish, "abc123");
-      assert.equal(args.headCommitish, "def456");
-      assert.equal(args.outputDir, "/tmp/out");
-      assert.equal(args.runUrl, "https://example.test/run");
-    } finally {
-      process.env = originalEnv;
-      process.argv = originalArgv;
-    }
-  });
-
-  await it("throws when --output-dir is missing", () => {
-    const originalEnv = process.env;
-    const originalArgv = process.argv;
-
-    try {
-      process.env = {};
-      process.argv = ["node", "check-repo-size.ts"];
-      assert.throws(() => readArgs(), /--output-dir is required/);
-    } finally {
-      process.env = originalEnv;
-      process.argv = originalArgv;
-    }
-  });
-});
-
-let repoDir: string;
-
-beforeEach(() => {
-  repoDir = fs.mkdtempSync(path.join(os.tmpdir(), "check-repo-size-test-"));
-  execFileSync("git", ["init", "--initial-branch=main", "-q"], {
-    cwd: repoDir,
-  });
-  execFileSync("git", ["config", "user.email", "test@example.test"], {
-    cwd: repoDir,
-  });
-  execFileSync("git", ["config", "user.name", "Test"], { cwd: repoDir });
-  execFileSync("git", ["config", "commit.gpgsign", "false"], { cwd: repoDir });
-});
-
-afterEach(() => {
-  fs.rmSync(repoDir, { recursive: true, force: true });
-});
-
-function commit(name: string, content: string, message: string) {
-  fs.writeFileSync(path.join(repoDir, name), content);
-  execFileSync("git", ["add", name], { cwd: repoDir });
-  execFileSync("git", ["commit", "-q", "-m", message], { cwd: repoDir });
-}
-
-describe("measureArchiveSize", async () => {
-  await it("returns a positive byte count for a non-empty repo", async () => {
-    commit("a.txt", "hello world\n", "first");
-    const size = await measureArchiveSize("HEAD", repoDir);
-    assert.ok(size > 0, `expected size > 0, got ${size}`);
-  });
-
-  await it("returns the same size on repeated runs (deterministic)", async () => {
-    commit("a.txt", "hello world\n", "first");
-    const a = await measureArchiveSize("HEAD", repoDir);
-    const b = await measureArchiveSize("HEAD", repoDir);
-    assert.equal(a, b);
-  });
-
-  await it("returns a larger size when more content is added", async () => {
-    commit("a.txt", "hello world\n", "first");
-    const small = await measureArchiveSize("HEAD", repoDir);
-
-    // Use random bytes so the new content is incompressible and the archive
-    // is guaranteed to grow even after gzip.
-    commit("b.bin", randomBytes(8192).toString("base64"), "second");
-    const big = await measureArchiveSize("HEAD", repoDir);
-    assert.ok(
-      big > small,
-      `expected ${big} > ${small} after adding more content`,
-    );
-  });
-
-  await it("ignores untracked files (e.g. node_modules)", async () => {
-    commit("a.txt", "hello\n", "first");
-    commit(".gitignore", "node_modules/\n", "ignore node_modules");
-    const sizeBefore = await measureArchiveSize("HEAD", repoDir);
-
-    fs.mkdirSync(path.join(repoDir, "node_modules"));
-    fs.writeFileSync(
-      path.join(repoDir, "node_modules", "huge.bin"),
-      "x".repeat(1_000_000),
-    );
-
-    const sizeAfter = await measureArchiveSize("HEAD", repoDir);
-    assert.equal(
-      sizeAfter,
-      sizeBefore,
-      "untracked node_modules should not affect the archive size",
-    );
-  });
-
-  await it("rejects when the ref does not exist", async () => {
-    commit("a.txt", "hello\n", "first");
-    await assert.rejects(
-      () => measureArchiveSize("does-not-exist", repoDir),
-      /git archive does-not-exist exited with code/,
-    );
-  });
-});
-
-function escapeRegExp(s: string): string {
-  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
-}
diff --git a/pr-checks/check-repo-size.ts b/pr-checks/check-repo-size.ts
deleted file mode 100644
index e38b19cce0..0000000000
--- a/pr-checks/check-repo-size.ts
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/*
-Measures the difference in the `.tar.gz`'d checkout size of the repo between the PR head and the PR
-base. This size is relevant because it corresponds to the duration of the "Download action
-repository" step that happens at the start of every job that uses this Action.
-
-Writes the candidate sticky-comment body and a small metadata file to `--output-dir`. A separate
-workflow job consumes those artifacts and decides whether to create or update a PR comment.
-*/
-
-import { spawn } from "node:child_process";
-import * as fs from "node:fs";
-import * as path from "node:path";
-import { parseArgs } from "node:util";
-
-import { REPO_ROOT } from "./config";
-
-/** Hidden marker used to find the existing sticky comment on a PR. */
-export const COMMENT_MARKER = "";
-
-export const DEFAULT_BASE_REF = "main";
-
-/**
- * Fraction of the base archive size at which a delta is considered significant enough to warrant
- * a new sticky comment. We always update an existing comment regardless, so the comment stays in
- * sync as the diff evolves.
- */
-export const SIGNIFICANT_DELTA_FRACTION = 0.1;
-
-/**
- * Stream `git archive --format=tar.gz ` and count the compressed bytes.
- *
- * `git archive` only includes tracked files, so untracked directories like `node_modules` and
- * `build` aren't counted in the size downloaded when starting up a CodeQL job.
- */
-export async function measureArchiveSize(
-  ref: string,
-  cwd: string,
-): Promise {
-  const git = spawn("git", ["archive", "--format=tar.gz", ref], { cwd });
-
-  let stderr = "";
-  git.stderr.on("data", (chunk: Buffer) => {
-    stderr += chunk.toString();
-  });
-
-  let size = 0;
-  git.stdout.on("data", (chunk: Buffer) => {
-    size += chunk.length;
-  });
-
-  const exitCode = await new Promise((resolve, reject) => {
-    git.on("error", reject);
-    git.on("close", resolve);
-  });
-
-  if (exitCode !== 0) {
-    throw new Error(
-      `git archive ${ref} exited with code ${exitCode}: ${stderr.trim()}`,
-    );
-  }
-  return size;
-}
-
-/**
- * Format a byte count as KiB. If `signed` is true, a leading `+` is prepended for non-negative
- * values so gains and losses are visually distinct.
- */
-export function formatBytes(bytes: number, signed = false): string {
-  const sign = bytes < 0 ? "-" : signed ? "+" : "";
-  const kib = Math.abs(bytes) / 1024;
-  return `${sign}${kib.toFixed(2)} KiB`;
-}
-
-/** Format a fraction as a signed percentage with 2 decimal places. */
-export function formatPercent(fraction: number): string {
-  const pct = fraction * 100;
-  const sign = pct > 0 ? "+" : "";
-  return `${sign}${pct.toFixed(2)}%`;
-}
-
-export interface CommentBodyOptions {
-  baseRef: string;
-  baseSize: number;
-  prSize: number;
-  /** Optional URL of the workflow run, included in the comment footer. */
-  runUrl?: string;
-}
-
-export function buildCommentBody(opts: CommentBodyOptions): string {
-  const { baseRef, baseSize, prSize, runUrl } = opts;
-  const delta = prSize - baseSize;
-  const signedDelta = delta >= 0 ? `+${delta}` : `${delta}`;
-  const runUrlLine = runUrl
-    ? ` See the [workflow run](${runUrl}) for details.`
-    : "";
-
-  return [
-    COMMENT_MARKER,
-    "### Repository checkout size",
-    "",
-    "| | Compressed archive size |",
-    "|---|---|",
-    `| Base (\`${baseRef}\`) | ${formatBytes(baseSize)} (${baseSize} bytes) |`,
-    `| This PR | ${formatBytes(prSize)} (${prSize} bytes) |`,
-    `| **Delta** | **${formatBytes(delta, true)} (${signedDelta} bytes, ${formatPercent(delta / baseSize)})** |`,
-    "",
-    "Sizes are measured by streaming `git archive --format=tar.gz `, " +
-      "which includes tracked files and excludes untracked files such as " +
-      "`node_modules`. The compressed checkout is " +
-      "downloaded by every consumer of this Action, so changes here directly " +
-      `affect Action download time.${runUrlLine}`,
-  ].join("\n");
-}
-
-/**
- * Returns true when the absolute delta is at least `fraction` of the base size. Both increases and
- * decreases are considered significant, so we report wins as well as losses.
- */
-export function isDeltaSignificant(
-  delta: number,
-  baseSize: number,
-  fraction: number,
-): boolean {
-  return Math.abs(delta) >= baseSize * fraction;
-}
-
-interface MainArgs {
-  /** Base ref of the PR. Defaults to `main`. Used as the label in the PR comment. */
-  baseRef: string;
-  /** Base commit-ish to archive. Defaults to `origin/` for local runs. */
-  baseCommitish: string;
-  /** Head commit-ish to archive. Defaults to `HEAD` for local runs. */
-  headCommitish: string;
-  /** Optional URL of the workflow run, surfaced in the comment footer. */
-  runUrl?: string;
-  /** Directory where `body.md` and `metadata.json` are written. */
-  outputDir: string;
-}
-
-export function readArgs(): MainArgs {
-  const { values } = parseArgs({
-    options: {
-      "output-dir": { type: "string" },
-    },
-    strict: true,
-  });
-
-  const outputDir = values["output-dir"];
-  if (!outputDir) {
-    throw new Error("--output-dir is required");
-  }
-
-  const baseRef = process.env.BASE_REF ?? DEFAULT_BASE_REF;
-  const baseCommitish = process.env.BASE_SHA ?? `origin/${baseRef}`;
-  const headCommitish = process.env.HEAD_SHA ?? "HEAD";
-
-  return {
-    baseRef,
-    baseCommitish,
-    headCommitish,
-    runUrl: process.env.RUN_URL,
-    outputDir,
-  };
-}
-
-async function main(): Promise {
-  const args = readArgs();
-
-  console.log(`Measuring base archive size for ${args.baseCommitish}...`);
-  const baseSize = await measureArchiveSize(args.baseCommitish, REPO_ROOT);
-  console.log(`  ${baseSize} bytes`);
-
-  console.log(`Measuring PR archive size for ${args.headCommitish}...`);
-  const prSize = await measureArchiveSize(args.headCommitish, REPO_ROOT);
-  console.log(`  ${prSize} bytes`);
-
-  const delta = prSize - baseSize;
-  const significant = isDeltaSignificant(
-    delta,
-    baseSize,
-    SIGNIFICANT_DELTA_FRACTION,
-  );
-  console.log(
-    `Delta: ${delta} bytes (significant=${significant}, threshold=${(
-      SIGNIFICANT_DELTA_FRACTION * 100
-    ).toFixed(2)}%)`,
-  );
-
-  const body = buildCommentBody({
-    baseRef: args.baseRef,
-    baseSize,
-    prSize,
-    runUrl: args.runUrl,
-  });
-
-  fs.mkdirSync(args.outputDir, { recursive: true });
-  fs.writeFileSync(path.join(args.outputDir, "body.md"), body);
-  fs.writeFileSync(
-    path.join(args.outputDir, "metadata.json"),
-    `${JSON.stringify(
-      { significant, baseRef: args.baseRef, baseSize, prSize, delta },
-      null,
-      2,
-    )}\n`,
-  );
-  console.log(`Wrote body.md and metadata.json to ${args.outputDir}.`);
-  return 0;
-}
-
-async function run(): Promise {
-  try {
-    process.exit(await main());
-  } catch (err) {
-    console.error(err instanceof Error ? err.message : String(err));
-    process.exit(1);
-  }
-}
-
-if (require.main === module) {
-  void run();
-}
diff --git a/pr-checks/checks/all-platform-bundle.yml b/pr-checks/checks/all-platform-bundle.yml
deleted file mode 100644
index d35620706f..0000000000
--- a/pr-checks/checks/all-platform-bundle.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: "All-platform bundle"
-description: "Tests using an all-platform CodeQL Bundle"
-operatingSystems:
-  - ubuntu
-  - macos
-  - windows
-versions:
-  - nightly-latest
-useAllPlatformBundle: "true"
-installGo: true
-installDotNet: true
-steps:
-  - id: init
-    uses: ./../action/init
-    with:
-      # Swift is not supported on Ubuntu so we manually exclude it from the list here
-      languages: cpp,csharp,go,java,javascript,python,ruby
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/analysis-kinds.yml b/pr-checks/checks/analysis-kinds.yml
deleted file mode 100644
index 5b2aaf4aad..0000000000
--- a/pr-checks/checks/analysis-kinds.yml
+++ /dev/null
@@ -1,80 +0,0 @@
-name: "Analysis kinds"
-description: "Tests basic functionality for different `analysis-kinds` inputs."
-versions:
-  - linked
-  - nightly-latest
-analysisKinds:
-  - code-scanning
-  - code-quality
-  - code-scanning,code-quality
-  - risk-assessment
-env:
-  CODEQL_ACTION_RISK_ASSESSMENT_ID: 1
-  CHECK_SCRIPT: |
-    const fs = require('fs');
-
-    const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
-    const expectPresent = JSON.parse(process.env['EXPECT_PRESENT']);
-    const run = sarif.runs[0];
-    const extensions = run.tool.extensions;
-
-    if (extensions === undefined) {
-      core.setFailed('`extensions` property not found in the SARIF run property bag.');
-    }
-
-    // ID of a query we want to check the presence for
-    const targetId = 'js/regex/always-matches';
-    const found = extensions.find(extension => extension.rules && extension.rules.find(rule => rule.id === targetId));
-
-    if (found && expectPresent) {
-      console.log(`Found rule with id '${targetId}'.`);
-    } else if (!found && !expectPresent) {
-      console.log(`Rule with id '${targetId}' was not found.`);
-    } else {
-      core.setFailed(`${ found ? "Found" : "Didn't find" } rule ${targetId}`);
-    }
-steps:
-  - uses: ./../action/init
-    with:
-      languages: javascript
-      analysis-kinds: ${{ matrix.analysis-kinds }}
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-      post-processed-sarif-path: "${{ runner.temp }}/post-processed"
-
-  - name: Upload SARIF files
-    uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-    with:
-      name: |
-        analysis-kinds-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}
-      path: "${{ runner.temp }}/results/*.sarif"
-      retention-days: 7
-
-  - name: Upload post-processed SARIF
-    uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-    with:
-      name: |
-        post-processed-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}
-      path: "${{ runner.temp }}/post-processed"
-      retention-days: 7
-      if-no-files-found: error
-
-  - name: Check quality query does not appear in security SARIF
-    if: contains(matrix.analysis-kinds, 'code-scanning')
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    env:
-      SARIF_PATH: "${{ runner.temp }}/results/javascript.sarif"
-      EXPECT_PRESENT: "false"
-    with:
-      script: ${{ env.CHECK_SCRIPT }}
-  - name: Check quality query appears in quality SARIF
-    if: contains(matrix.analysis-kinds, 'code-quality')
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    env:
-      SARIF_PATH: "${{ runner.temp }}/results/javascript.quality.sarif"
-      EXPECT_PRESENT: "true"
-    with:
-      script: ${{ env.CHECK_SCRIPT }}
diff --git a/pr-checks/checks/analyze-ref-input.yml b/pr-checks/checks/analyze-ref-input.yml
deleted file mode 100644
index 683d40df9f..0000000000
--- a/pr-checks/checks/analyze-ref-input.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: "Analyze: 'ref' and 'sha' from inputs"
-description: "Checks that specifying 'ref' and 'sha' as inputs works"
-versions:
-  - default
-installGo: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      languages: cpp,csharp,java,javascript,python
-      config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
-    with:
-      ref: 'refs/heads/main'
-      sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
diff --git a/pr-checks/checks/autobuild-action.yml b/pr-checks/checks/autobuild-action.yml
deleted file mode 100644
index d46204c89d..0000000000
--- a/pr-checks/checks/autobuild-action.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: "autobuild-action"
-description: "Tests that the C# autobuild action works"
-operatingSystems:
-  - ubuntu
-  - macos
-  - windows
-versions:
-  - linked
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      languages: csharp
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/autobuild
-    env:
-      # Explicitly disable the CLR tracer.
-      COR_ENABLE_PROFILING: ""
-      COR_PROFILER: ""
-      COR_PROFILER_PATH_64: ""
-      CORECLR_ENABLE_PROFILING: ""
-      CORECLR_PROFILER: ""
-      CORECLR_PROFILER_PATH_64: ""
-  - uses: ./../action/analyze
-  - name: Check database
-    run: |
-      cd "$RUNNER_TEMP/codeql_databases"
-      if [[ ! -d csharp ]]; then
-        echo "Did not find a C# database"
-        exit 1
-      fi
diff --git a/pr-checks/checks/autobuild-direct-tracing-with-working-dir.yml b/pr-checks/checks/autobuild-direct-tracing-with-working-dir.yml
deleted file mode 100644
index 0956b34479..0000000000
--- a/pr-checks/checks/autobuild-direct-tracing-with-working-dir.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: "Autobuild direct tracing (custom working directory)"
-description: >
-  An end-to-end integration test of a Java repository built using 'build-mode: autobuild',
-  with direct tracing enabled and a custom working directory specified as the input to the
-  autobuild Action.
-operatingSystems:
-  - ubuntu
-  - windows
-versions:
-  - linked
-  - nightly-latest
-installJava: true
-env:
-  CODEQL_ACTION_AUTOBUILD_BUILD_MODE_DIRECT_TRACING: true
-steps:
-  - name: Test setup
-    run: |
-      # Make sure that Gradle build succeeds in autobuild-dir ...
-      cp -a ../action/tests/java-repo autobuild-dir
-      # ... and fails if attempted in the current directory
-      echo > build.gradle
-  - uses: ./../action/init
-    with:
-      build-mode: autobuild
-      languages: java
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Check that indirect tracing is disabled
-    run: |
-      if [[ ! -z "${CODEQL_RUNNER}" ]]; then
-        echo "Expected indirect tracing to be disabled, but the" \
-          "CODEQL_RUNNER environment variable is set."
-        exit 1
-      fi
-  - uses: ./../action/autobuild
-    with:
-      working-directory: autobuild-dir
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/autobuild-working-dir.yml b/pr-checks/checks/autobuild-working-dir.yml
deleted file mode 100644
index 5feee38f71..0000000000
--- a/pr-checks/checks/autobuild-working-dir.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: "Autobuild working directory"
-description: "Tests working-directory input of autobuild action"
-versions:
-  - linked
-steps:
-  - name: Test setup
-    run: |
-      # Make sure that Gradle build succeeds in autobuild-dir ...
-      cp -a ../action/tests/java-repo autobuild-dir
-      # ... and fails if attempted in the current directory
-      echo > build.gradle
-  - uses: ./../action/init
-    with:
-      languages: java
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/autobuild
-    with:
-      working-directory: autobuild-dir
-  - uses: ./../action/analyze
-  - name: Check database
-    run: |
-      cd "$RUNNER_TEMP/codeql_databases"
-      if [[ ! -d java ]]; then
-        echo "Did not find a Java database"
-        exit 1
-      fi
diff --git a/pr-checks/checks/build-mode-autobuild.yml b/pr-checks/checks/build-mode-autobuild.yml
deleted file mode 100644
index 56845f0633..0000000000
--- a/pr-checks/checks/build-mode-autobuild.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: "Build mode autobuild"
-description: "An end-to-end integration test of a Java repository built using 'build-mode: autobuild'"
-operatingSystems:
-  - ubuntu
-  - windows
-versions:
-  - linked
-  - nightly-latest
-installJava: true
-installYq: true
-steps:
-  - name: Set up Java test repo configuration
-    run: |
-      mv * .github ../action/tests/multi-language-repo/
-      mv ../action/tests/multi-language-repo/.github/workflows .github
-      mv ../action/tests/java-repo/* .
-
-  - uses: ./../action/init
-    id: init
-    with:
-      build-mode: autobuild
-      db-location: "${{ runner.temp }}/customDbLocation"
-      languages: java
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - name: Validate database build mode
-    run: |
-      metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
-      build_mode=$(yq eval '.buildMode' "$metadata_path")
-      if [[ "$build_mode" != "autobuild" ]]; then
-        echo "Expected build mode to be 'autobuild' but was $build_mode"
-        exit 1
-      fi
-
-  - name: Check that indirect tracing is disabled
-    run: |
-      if [[ ! -z "${CODEQL_RUNNER}" ]]; then
-        echo "Expected indirect tracing to be disabled, but the" \
-          "CODEQL_RUNNER environment variable is set."
-        exit 1
-      fi
-
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/build-mode-manual.yml b/pr-checks/checks/build-mode-manual.yml
deleted file mode 100644
index 2d7a44bdc0..0000000000
--- a/pr-checks/checks/build-mode-manual.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: "Build mode manual"
-description: "An end-to-end integration test of a Java repository built using 'build-mode: manual'"
-versions:
-  - nightly-latest
-installGo: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    id: init
-    with:
-      build-mode: manual
-      db-location: "${{ runner.temp }}/customDbLocation"
-      languages: java
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - name: Validate database build mode
-    run: |
-      metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
-      build_mode=$(yq eval '.buildMode' "$metadata_path")
-      if [[ "$build_mode" != "manual" ]]; then
-        echo "Expected build mode to be 'manual' but was $build_mode"
-        exit 1
-      fi
-
-  - name: Build code
-    run: ./build.sh
-
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/build-mode-none.yml b/pr-checks/checks/build-mode-none.yml
deleted file mode 100644
index f35dbc2a53..0000000000
--- a/pr-checks/checks/build-mode-none.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: "Build mode none"
-description: "An end-to-end integration test of a Java repository built using 'build-mode: none'"
-versions:
-  - linked
-  - nightly-latest
-steps:
-  - uses: ./../action/init
-    id: init
-    with:
-      build-mode: none
-      db-location: "${{ runner.temp }}/customDbLocation"
-      languages: java
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - name: Validate database build mode
-    run: |
-      metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
-      build_mode=$(yq eval '.buildMode' "$metadata_path")
-      if [[ "$build_mode" != "none" ]]; then
-        echo "Expected build mode to be 'none' but was $build_mode"
-        exit 1
-      fi
-
-  # The latest nightly supports omitting the autobuild Action when the build mode is specified.
-  - uses: ./../action/autobuild
-    if: matrix.version != 'nightly-latest'
-
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/build-mode-rollback.yml b/pr-checks/checks/build-mode-rollback.yml
deleted file mode 100644
index cfb4dfa224..0000000000
--- a/pr-checks/checks/build-mode-rollback.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: "Build mode rollback"
-description: "The build mode is rolled back from none to autobuild when the relevant feature flag is enabled."
-versions:
-  - nightly-latest
-env:
-  CODEQL_ACTION_DISABLE_JAVA_BUILDLESS: true
-steps:
-  - name: Set up Java test repo configuration
-    run: |
-      mv * .github ../action/tests/multi-language-repo/
-      mv ../action/tests/multi-language-repo/.github/workflows .github
-      mv ../action/tests/java-repo/* .
-
-  - uses: ./../action/init
-    id: init
-    with:
-      build-mode: none
-      db-location: "${{ runner.temp }}/customDbLocation"
-      languages: java
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - name: Validate database build mode
-    run: |
-      metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
-      build_mode=$(yq eval '.buildMode' "$metadata_path")
-      if [[ "$build_mode" != "autobuild" ]]; then
-        echo "Expected build mode to be 'autobuild' but was $build_mode"
-        exit 1
-      fi
-
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/bundle-from-nightly.yml b/pr-checks/checks/bundle-from-nightly.yml
deleted file mode 100644
index ac7076cb0c..0000000000
--- a/pr-checks/checks/bundle-from-nightly.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: "Bundle: From nightly"
-description: "The nightly CodeQL bundle should be used when forced"
-versions:
-  - linked # overruled by the FF set below
-steps:
-  - id: init
-    uses: ./../action/init
-    env:
-      CODEQL_ACTION_FORCE_NIGHTLY: true
-    with:
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      languages: javascript
-  - name: Fail if the CodeQL version is not a nightly
-    if: ${{ !contains(steps.init.outputs.codeql-version, '+') }}
-    run: exit 1
diff --git a/pr-checks/checks/bundle-from-toolcache.yml b/pr-checks/checks/bundle-from-toolcache.yml
deleted file mode 100644
index 0e51e2e12b..0000000000
--- a/pr-checks/checks/bundle-from-toolcache.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: "Bundle: From toolcache"
-description: "The CodeQL bundle should be cached within the toolcache"
-versions:
-  - toolcache
-steps:
-  - name: Install @actions/tool-cache
-    run: npm install @actions/tool-cache@3
-  - name: Check toolcache contains CodeQL
-    continue-on-error: true
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    with:
-      script: |
-        const toolcache = require('@actions/tool-cache');
-        const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
-        if (allCodeqlVersions.length === 0) {
-          throw new Error(`CodeQL could not be found in the toolcache`);
-        }
-  - id: setup-codeql
-    uses: ./../action/setup-codeql
-    with:
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Check CodeQL is installed within the toolcache
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    with:
-      script: |
-        const toolcache = require('@actions/tool-cache');
-        const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
-        console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
-        if (allCodeqlVersions.length === 0) {
-          throw new Error('CodeQL not found in toolcache');
-        }
diff --git a/pr-checks/checks/bundle-toolcache.yml b/pr-checks/checks/bundle-toolcache.yml
deleted file mode 100644
index 83d1d7d0b5..0000000000
--- a/pr-checks/checks/bundle-toolcache.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-name: "Bundle: Caching checks"
-description: "The CodeQL bundle should be cached within the toolcache"
-versions:
-  - linked
-operatingSystems:
-  - ubuntu
-  - macos
-  - windows
-steps:
-  - name: Remove CodeQL from toolcache
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    with:
-      script: |
-        const fs = require('fs');
-        const path = require('path');
-        const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
-        fs.rmdirSync(codeqlPath, { recursive: true });
-  - name: Install @actions/tool-cache
-    run: npm install @actions/tool-cache@3
-  - name: Check toolcache does not contain CodeQL
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    with:
-      script: |
-        const toolcache = require('@actions/tool-cache');
-        const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
-        if (allCodeqlVersions.length !== 0) {
-          throw new Error(`CodeQL should not be found in the toolcache, but found ${allCodeqlVersions}`);
-        }
-        console.log('No versions of CodeQL found in the toolcache');
-  - id: init
-    uses: ./../action/init
-    with:
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/analyze
-    with:
-      output: ${{ runner.temp }}/results
-      upload-database: false
-  - name: Check CodeQL is installed within the toolcache
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    with:
-      script: |
-        const toolcache = require('@actions/tool-cache');
-        const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
-        console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
-        if (allCodeqlVersions.length === 0) {
-          throw new Error('CodeQL not found in toolcache');
-        }
-        if (allCodeqlVersions.length > 1) {
-          throw new Error('Multiple CodeQL versions found in toolcache');
-        }
diff --git a/pr-checks/checks/cleanup-db-cluster-dir.yml b/pr-checks/checks/cleanup-db-cluster-dir.yml
deleted file mode 100644
index 15124fd53f..0000000000
--- a/pr-checks/checks/cleanup-db-cluster-dir.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: "Clean up database cluster directory"
-description: "The database cluster directory is cleaned up if it is not empty."
-versions:
-  - linked
-steps:
-  - name: Add a file to the database cluster directory
-    run: |
-      mkdir -p "${{ runner.temp }}/customDbLocation/javascript"
-      touch "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt"
-
-  - uses: ./../action/init
-    id: init
-    with:
-      build-mode: none
-      db-location: "${{ runner.temp }}/customDbLocation"
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - name: Validate file cleaned up
-    run: |
-      if [[ -f "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" ]]; then
-        echo "File was not cleaned up"
-        exit 1
-      fi
-      echo "File was cleaned up"
diff --git a/pr-checks/checks/config-export.yml b/pr-checks/checks/config-export.yml
deleted file mode 100644
index 93c6407355..0000000000
--- a/pr-checks/checks/config-export.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: "Config export"
-description: "Tests that the code scanning configuration file is exported to SARIF correctly."
-versions:
-  - linked
-  - nightly-latest
-steps:
-  - uses: ./../action/init
-    with:
-      languages: javascript
-      queries: security-extended
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-  - name: Upload SARIF
-    uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-    with:
-      name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
-      path: "${{ runner.temp }}/results/javascript.sarif"
-      retention-days: 7
-  - name: Check config properties appear in SARIF
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    env:
-      SARIF_PATH: "${{ runner.temp }}/results/javascript.sarif"
-    with:
-      script: |
-        const fs = require('fs');
-
-        const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
-        const run = sarif.runs[0];
-        const configSummary = run.properties.codeqlConfigSummary;
-
-        if (configSummary === undefined) {
-          core.setFailed('`codeqlConfigSummary` property not found in the SARIF run property bag.');
-        }
-        if (configSummary.disableDefaultQueries !== false) {
-          core.setFailed('`disableDefaultQueries` property incorrect: expected false, got ' +
-            `${JSON.stringify(configSummary.disableDefaultQueries)}.`);
-        }
-        const expectedQueries = [{ type: 'builtinSuite', uses: 'security-extended' }];
-        // Use JSON.stringify to deep-equal the arrays.
-        if (JSON.stringify(configSummary.queries) !== JSON.stringify(expectedQueries)) {
-          core.setFailed(`\`queries\` property incorrect: expected ${JSON.stringify(expectedQueries)}, got ` +
-            `${JSON.stringify(configSummary.queries)}.`);
-        }
-        core.info('Finished config export tests.');
diff --git a/pr-checks/checks/config-input.yml b/pr-checks/checks/config-input.yml
deleted file mode 100644
index d4dab66295..0000000000
--- a/pr-checks/checks/config-input.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: "Config input"
-description: "Tests specifying configuration using the config input"
-installNode: true
-versions:
-  - linked
-steps:
-  - name: Copy queries into workspace
-    run: |
-      cp -a ../action/queries .
-
-  - uses: ./../action/init
-    with:
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      languages: javascript
-      build-mode: none
-      config: |
-        disable-default-queries: true
-        queries:
-          - name: Run custom query
-            uses: ./queries/default-setup-environment-variables.ql
-        paths-ignore:
-          - tests
-          - lib
-
-  - uses: ./../action/analyze
-    with:
-      output: ${{ runner.temp }}/results
-
-  - name: Check SARIF
-    uses: ./../action/.github/actions/check-sarif
-    with:
-      sarif-file: ${{ runner.temp }}/results/javascript.sarif
-      queries-run: javascript/codeql-action/default-setup-env-vars
-      queries-not-run: javascript/codeql-action/default-setup-context-properties
diff --git a/pr-checks/checks/cpp-deptrace-disabled.yml b/pr-checks/checks/cpp-deptrace-disabled.yml
deleted file mode 100644
index 7eaddd8529..0000000000
--- a/pr-checks/checks/cpp-deptrace-disabled.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: "C/C++: disabling autoinstalling dependencies (Linux)"
-description: "Checks that running C/C++ autobuild with autoinstalling dependencies explicitly disabled works"
-versions:
-  - linked
-  - default
-  - nightly-latest
-env:
-  DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
-steps:
-  - name: Test setup
-    run: |
-      cp -a ../action/tests/cpp-autobuild autobuild-dir
-  - uses: ./../action/init
-    with:
-      languages: cpp
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/autobuild
-    with:
-      working-directory: autobuild-dir
-    env:
-      CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false
-  - run: |
-      if ls /usr/bin/errno; then
-        echo "C/C++ autobuild installed errno, but it should not have since auto-install dependencies is disabled."
-        exit 1
-      fi
diff --git a/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml b/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml
deleted file mode 100644
index 5765fb002c..0000000000
--- a/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: "C/C++: autoinstalling dependencies is skipped (macOS)"
-description: "Checks that running C/C++ autobuild with autoinstalling dependencies explicitly enabled is a no-op on macOS"
-operatingSystems:
-  - macos
-versions:
-  - linked
-  - nightly-latest
-env:
-  DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
-steps:
-  - name: Test setup
-    run: |
-      cp -a ../action/tests/cpp-autobuild autobuild-dir
-  - uses: ./../action/init
-    with:
-      languages: cpp
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/autobuild
-    with:
-      working-directory: autobuild-dir
-    env:
-      CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true
-  - run: |
-      if ! ls /usr/bin/errno; then
-        echo "As expected, CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES is a no-op on macOS"
-      else
-        echo "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES should not have had any effect on macOS"
-        exit 1
-      fi
diff --git a/pr-checks/checks/cpp-deptrace-enabled.yml b/pr-checks/checks/cpp-deptrace-enabled.yml
deleted file mode 100644
index 7a522ae86f..0000000000
--- a/pr-checks/checks/cpp-deptrace-enabled.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: "C/C++: autoinstalling dependencies (Linux)"
-description: "Checks that running C/C++ autobuild with autoinstalling dependencies works"
-versions:
-  - linked
-  - default
-  - nightly-latest
-env:
-  DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
-steps:
-  - name: Test setup
-    run: |
-      cp -a ../action/tests/cpp-autobuild autobuild-dir
-  - uses: ./../action/init
-    with:
-      languages: cpp
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/autobuild
-    with:
-      working-directory: autobuild-dir
-    env:
-      CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true
-  - run: |
-      if ! ls /usr/bin/errno; then
-        echo "Did not autoinstall errno"
-        exit 1
-      fi
diff --git a/pr-checks/checks/diagnostics-export.yml b/pr-checks/checks/diagnostics-export.yml
deleted file mode 100644
index 61b9ae5efc..0000000000
--- a/pr-checks/checks/diagnostics-export.yml
+++ /dev/null
@@ -1,84 +0,0 @@
-name: "Diagnostic export"
-description: "Tests that manually added diagnostics are correctly exported to SARIF."
-versions:
-  - linked
-  - nightly-latest
-env:
-  CODEQL_ACTION_EXPORT_DIAGNOSTICS: true
-steps:
-  - uses: ./../action/init
-    id: init
-    with:
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Add test diagnostics
-    env:
-      CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
-    run: |
-      "$CODEQL_PATH" database add-diagnostic \
-        "$RUNNER_TEMP/codeql_databases/javascript" \
-        --file-path /path/to/file \
-        --plaintext-message "Plaintext message" \
-        --source-id "lang/diagnostics/example" \
-        --source-name "Diagnostic name" \
-        --ready-for-status-page
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-  - name: Upload SARIF
-    uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-    with:
-      name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
-      path: "${{ runner.temp }}/results/javascript.sarif"
-      retention-days: 7
-  - name: Check diagnostics appear in SARIF
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    env:
-      SARIF_PATH: "${{ runner.temp }}/results/javascript.sarif"
-    with:
-      script: |
-        const fs = require('fs');
-
-        function checkStatusPageNotification(n) {
-          const expectedMessage = 'Plaintext message';
-          if (n.message.text !== expectedMessage) {
-            core.setFailed(`Expected the status page diagnostic to have the message '${expectedMessage}', but found '${n.message.text}'.`);
-          }
-          if (n.locations.length !== 1) {
-            core.setFailed(`Expected the status page diagnostic to have exactly 1 location, but found ${n.locations.length}.`);
-          }
-        }
-
-        const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
-        const run = sarif.runs[0];
-
-        const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
-        const statusPageNotifications = toolExecutionNotifications.filter(n =>
-          n.descriptor.id === 'lang/diagnostics/example' && n.properties?.visibility?.statusPage
-        );
-        if (statusPageNotifications.length !== 1) {
-          core.setFailed(
-            'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
-              `'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
-              `${statusPageNotifications.length}. All notification reporting descriptors: ` +
-              `${JSON.stringify(toolExecutionNotifications)}.`
-          );
-        }
-        checkStatusPageNotification(statusPageNotifications[0]);
-
-        const notifications = run.tool.driver.notifications;
-        const diagnosticNotification = notifications.filter(n =>
-          n.id === 'lang/diagnostics/example' && n.name === 'lang/diagnostics/example' &&
-            n.fullDescription.text === 'Diagnostic name'
-        );
-        if (diagnosticNotification.length !== 1) {
-          core.setFailed(
-            'Expected exactly one notification for this diagnostic in the ' +
-              `'runs[].tool.driver.notifications[]' SARIF property, but found ` +
-              `${diagnosticNotification.length}. All notifications: ` +
-              `${JSON.stringify(notifications)}.`
-          );
-        }
-
-        core.info('Finished diagnostic export test');
diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml
deleted file mode 100644
index c5d5d12dda..0000000000
--- a/pr-checks/checks/export-file-baseline-information.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-name: "Export file baseline information"
-description: "Tests that file baseline information is exported when the feature is enabled"
-operatingSystems:
-  - ubuntu
-  - macos
-  - windows
-versions:
-  - nightly-latest
-installGo: true
-installDotNet: true
-env:
-  CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS: false
-  CODEQL_ACTION_SUBLANGUAGE_FILE_COVERAGE: true
-steps:
-  - uses: ./../action/init
-    id: init
-    with:
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-  - name: Upload SARIF
-    uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-    with:
-      name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json
-      path: "${{ runner.temp }}/results/javascript.sarif"
-      retention-days: 7
-  - name: Check results
-    run: |
-      cd "$RUNNER_TEMP/results"
-      expected_baseline_languages="c csharp go java kotlin javascript python ruby"
-      if [[ $RUNNER_OS == "macOS" ]]; then
-        expected_baseline_languages+=" swift"
-      fi
-
-      for lang in ${expected_baseline_languages}; do
-        rule_name="cli/expected-extracted-files/${lang}"
-        found_notification=$(jq --arg rule_name "${rule_name}" '[.runs[0].tool.driver.notifications |
-          select(. != null) | flatten | .[].id] | any(. == $rule_name)' javascript.sarif)
-        if [[ "${found_notification}" != "true" ]]; then
-          echo "Expected SARIF output to contain notification '${rule_name}', but found no such notification."
-          exit 1
-        else
-          echo "Found notification '${rule_name}'."
-        fi
-      done
diff --git a/pr-checks/checks/extractor-ram-threads.yml b/pr-checks/checks/extractor-ram-threads.yml
deleted file mode 100644
index 17ed1998ef..0000000000
--- a/pr-checks/checks/extractor-ram-threads.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: "Extractor ram and threads options test"
-description: "Tests passing RAM and threads limits to extractors"
-versions:
-  - linked
-steps:
-  - uses: ./../action/init
-    with:
-      languages: java
-      ram: 230
-      threads: 1
-  - name: Assert Results
-    run: |
-      if [ "${CODEQL_RAM}" != "230" ]; then
-        echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"
-        exit 1
-      fi
-      if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then
-        echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230"
-        exit 1
-      fi
-      if [ "${CODEQL_THREADS}" != "1" ]; then
-        echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1"
-        exit 1
-      fi
-      if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then
-        echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1"
-        exit 1
-      fi
diff --git a/pr-checks/checks/global-proxy.yml b/pr-checks/checks/global-proxy.yml
deleted file mode 100644
index 9d9653c13c..0000000000
--- a/pr-checks/checks/global-proxy.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-name: "Proxy test"
-description: "Tests using a proxy specified by the https_proxy environment variable"
-versions:
-  - linked
-  - nightly-latest
-container:
-  image: ubuntu:22.04
-  options: --cap-add=NET_ADMIN
-services:
-  squid-proxy:
-    image: ubuntu/squid:latest
-    ports:
-      - 3128:3128
-env:
-  CODEQL_ACTION_TOLERATE_MISSING_GIT_VERSION: true
-steps:
-  - name: Block direct internet access to force proxy usage
-    run: |
-      apt-get update -qq && apt-get install -y -qq iptables >/dev/null 2>&1
-      PROXY_IP=$(getent hosts squid-proxy | awk '{ print $1 }')
-      echo "Squid proxy IP: $PROXY_IP"
-      # Allow all traffic to the proxy container
-      iptables -A OUTPUT -d "$PROXY_IP" -j ACCEPT
-      # Allow DNS resolution
-      iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
-      iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT
-      # Allow loopback
-      iptables -A OUTPUT -o lo -j ACCEPT
-      # Allow already-established connections (from checkout/prepare-test)
-      iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-      # Block all other outbound HTTP and HTTPS, ensuring direct access fails
-      iptables -A OUTPUT -p tcp --dport 80 -j REJECT --reject-with tcp-reset
-      iptables -A OUTPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
-      echo "Direct HTTP/HTTPS access is now blocked - all traffic must go through the proxy"
-
-  - name: Set proxy environment variables
-    shell: bash
-    run: |
-      echo "http_proxy=http://squid-proxy:3128" >> $GITHUB_ENV
-      echo "HTTP_PROXY=http://squid-proxy:3128" >> $GITHUB_ENV
-      echo "https_proxy=http://squid-proxy:3128" >> $GITHUB_ENV
-      echo "HTTPS_PROXY=http://squid-proxy:3128" >> $GITHUB_ENV
-
-  - uses: ./../action/init
-    with:
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/go-custom-queries.yml b/pr-checks/checks/go-custom-queries.yml
deleted file mode 100644
index 867d8dc6cc..0000000000
--- a/pr-checks/checks/go-custom-queries.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: "Go: Custom queries"
-description: "Checks that Go works in conjunction with a config file specifying custom queries"
-collection: go
-operatingSystems:
-  - ubuntu
-versions:
-  - linked
-  - nightly-latest
-installGo: true
-installDotNet: true
-env:
-  DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
-steps:
-  - uses: ./../action/init
-    with:
-      languages: go
-      config-file: ./.github/codeql/custom-queries.yml
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml b/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml
deleted file mode 100644
index f0b4097d7b..0000000000
--- a/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-name: "Go: diagnostic when Go is changed after init step"
-description: "Checks that we emit a diagnostic if Go is changed after the init step"
-# only Linux is affected
-# pinned to a version which does not support statically linked binaries for indirect tracing
-versions:
-  - default
-installGo: true
-collection: go
-steps:
-  - uses: ./../action/init
-    with:
-      languages: go
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  # Deliberately change Go after the `init` step
-  - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
-    with:
-      go-version: "1.20"
-  - name: Build code
-    run: go build main.go
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-  - name: Check diagnostic appears in SARIF
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    env:
-      SARIF_PATH: "${{ runner.temp }}/results/go.sarif"
-    with:
-      script: |
-        const fs = require('fs');
-
-        const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
-        const run = sarif.runs[0];
-
-        const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
-        const statusPageNotifications = toolExecutionNotifications.filter(n =>
-          n.descriptor.id === 'go/workflow/go-installed-after-codeql-init' && n.properties?.visibility?.statusPage
-        );
-        if (statusPageNotifications.length !== 1) {
-          core.setFailed(
-            'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
-              `'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
-              `${statusPageNotifications.length}. All notification reporting descriptors: ` +
-              `${JSON.stringify(toolExecutionNotifications)}.`
-          );
-        }
diff --git a/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml b/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml
deleted file mode 100644
index 5068df622b..0000000000
--- a/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: "Go: diagnostic when `file` is not installed"
-description: "Checks that we emit a diagnostic if the `file` program is not installed"
-# only Linux is affected
-# pinned to a version which does not support statically linked binaries for indirect tracing
-versions:
-  - default
-installGo: true
-collection: go
-steps:
-  - name: Remove `file` program
-    run: |
-      echo $(which file)
-      sudo rm -rf $(which file)
-      echo $(which file)
-  - uses: ./../action/init
-    with:
-      languages: go
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: go build main.go
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-  - name: Check diagnostic appears in SARIF
-    uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
-    env:
-      SARIF_PATH: "${{ runner.temp }}/results/go.sarif"
-    with:
-      script: |
-        const fs = require('fs');
-
-        const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
-        const run = sarif.runs[0];
-
-        const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
-        const statusPageNotifications = toolExecutionNotifications.filter(n =>
-          n.descriptor.id === 'go/workflow/file-program-unavailable' && n.properties?.visibility?.statusPage
-        );
-        if (statusPageNotifications.length !== 1) {
-          core.setFailed(
-            'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
-              `'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
-              `${statusPageNotifications.length}. All notification reporting descriptors: ` +
-              `${JSON.stringify(toolExecutionNotifications)}.`
-          );
-        }
diff --git a/pr-checks/checks/go-indirect-tracing-workaround.yml b/pr-checks/checks/go-indirect-tracing-workaround.yml
deleted file mode 100644
index 0856e8cf58..0000000000
--- a/pr-checks/checks/go-indirect-tracing-workaround.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: "Go: workaround for indirect tracing"
-description: "Checks that our workaround for indirect tracing for Go 1.21+ on Linux works"
-# only Linux is affected
-# pinned to a version which does not support statically linked binaries for indirect tracing
-versions:
-  - default
-installGo: true
-collection: go
-steps:
-  - uses: ./../action/init
-    with:
-      languages: go
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: go build main.go
-  - uses: ./../action/analyze
-  - run: |
-      if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then
-        echo "Expected the workaround for indirect tracing of static binaries to trigger, but the" \
-          "CODEQL_ACTION_GO_BINARY environment variable is not set."
-        exit 1
-      fi
-      if [[ ! -f "${CODEQL_ACTION_GO_BINARY}" ]]; then
-        echo "CODEQL_ACTION_GO_BINARY is set, but the corresponding script does not exist."
-        exit 1
-      fi
-
-
-      # Once we start running Bash 4.2 in all environments, we can replace the
-      # `! -z` flag with the more elegant `-v` which confirms that the variable
-      # is actually unset and not potentially set to a blank value.
-      if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then
-        echo "Expected the Go autobuilder not to be run, but the" \
-          "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
-        exit 1
-      fi
-      cd "$RUNNER_TEMP/codeql_databases"
-      if [[ ! -d go ]]; then
-        echo "Did not find a Go database"
-        exit 1
-      fi
diff --git a/pr-checks/checks/go-tracing-autobuilder.yml b/pr-checks/checks/go-tracing-autobuilder.yml
deleted file mode 100644
index c454fc27eb..0000000000
--- a/pr-checks/checks/go-tracing-autobuilder.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: "Go: tracing with autobuilder step"
-description: "Checks that Go tracing works when using an autobuilder step"
-collection: go
-operatingSystems:
-  - ubuntu
-  - macos
-osCodeQlVersions:
-  macos:
-    - linked
-    - nightly-latest
-env:
-  DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
-installGo: true
-steps:
-  - uses: ./../action/init
-    with:
-      languages: go
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/autobuild
-  - uses: ./../action/analyze
-  - run: |
-      if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
-        echo "Expected the Go autobuilder to be run, but the" \
-          "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was not true."
-        exit 1
-      fi
-      cd "$RUNNER_TEMP/codeql_databases"
-      if [[ ! -d go ]]; then
-        echo "Did not find a Go database"
-        exit 1
-      fi
diff --git a/pr-checks/checks/go-tracing-custom-build-steps.yml b/pr-checks/checks/go-tracing-custom-build-steps.yml
deleted file mode 100644
index 31c4f27c33..0000000000
--- a/pr-checks/checks/go-tracing-custom-build-steps.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: "Go: tracing with custom build steps"
-description: "Checks that Go tracing traces the build when using custom build steps"
-collection: go
-operatingSystems:
-  - ubuntu
-  - macos
-osCodeQlVersions:
-  macos:
-    - linked
-    - nightly-latest
-installGo: true
-steps:
-  - uses: ./../action/init
-    with:
-      languages: go
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: go build main.go
-  - uses: ./../action/analyze
-  - run: |
-      # Once we start running Bash 4.2 in all environments, we can replace the
-      # `! -z` flag with the more elegant `-v` which confirms that the variable
-      # is actually unset and not potentially set to a blank value.
-      if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then
-        echo "Expected the Go autobuilder not to be run, but the" \
-          "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
-        exit 1
-      fi
-      cd "$RUNNER_TEMP/codeql_databases"
-      if [[ ! -d go ]]; then
-        echo "Did not find a Go database"
-        exit 1
-      fi
diff --git a/pr-checks/checks/go-tracing-legacy-workflow.yml b/pr-checks/checks/go-tracing-legacy-workflow.yml
deleted file mode 100644
index 5431fac0f9..0000000000
--- a/pr-checks/checks/go-tracing-legacy-workflow.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: "Go: tracing with legacy workflow"
-description: "Checks that we run the autobuilder in legacy workflows with neither an autobuild step nor manual build steps"
-collection: go
-operatingSystems:
-  - ubuntu
-  - macos
-osCodeQlVersions:
-  macos:
-    - linked
-    - nightly-latest
-env:
-  DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
-installGo: true
-steps:
-  - uses: ./../action/init
-    with:
-      languages: go
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/analyze
-  - run: |
-      cd "$RUNNER_TEMP/codeql_databases"
-      if [[ ! -d go ]]; then
-        echo "Did not find a Go database"
-        exit 1
-      fi
diff --git a/pr-checks/checks/init-with-registries.yml b/pr-checks/checks/init-with-registries.yml
deleted file mode 100644
index 69e2188de2..0000000000
--- a/pr-checks/checks/init-with-registries.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-# A test for running the init command with a registries block.
-# This test does _not_ validate that the action can authenticate
-# against multiple registries. All it does is validate that the
-# basic mechanics of multi-registry auth is working.
-name: "Packaging: Download using registries"
-description: "Checks that specifying a registries block and associated auth works as expected"
-versions:
-  # This feature is not compatible with older CLIs
-  - default
-  - linked
-  - nightly-latest
-
-permissions:
-  contents: read
-  packages: read
-
-steps:
-  - name: Init with registries
-    uses: ./../action/init
-    with:
-      db-location: "${{ runner.temp }}/customDbLocation"
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      config-file: ./.github/codeql/codeql-config-registries.yml
-      languages: javascript
-      registries: |
-          - url: "https://ghcr.io/v2/"
-            packages: "*/*"
-            token: "${{ secrets.GITHUB_TOKEN }}"
-
-  - name: Verify packages installed
-    run: |
-      PRIVATE_PACK="$HOME/.codeql/packages/codeql-testing/private-pack"
-      CODEQL_PACK1="$HOME/.codeql/packages/codeql-testing/codeql-pack1"
-
-      if [[ -d $PRIVATE_PACK ]]
-      then
-          echo "$PRIVATE_PACK was installed."
-      else
-          echo "::error $PRIVATE_PACK pack was not installed."
-          exit 1
-      fi
-
-      if [[ -d $CODEQL_PACK1 ]]
-      then
-          echo "$CODEQL_PACK1 was installed."
-      else
-          echo "::error $CODEQL_PACK1 pack was not installed."
-          exit 1
-      fi
-
-  - name: Verify qlconfig.yml file was created
-    run: |
-      QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
-      echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH"
-      if [[ -f $QLCONFIG_PATH ]]
-      then
-          echo "qlconfig.yml file was created."
-      else
-          echo "::error qlconfig.yml file was not created."
-          exit 1
-      fi
-
-  - name: Verify contents of qlconfig.yml
-    run: |
-      QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
-      cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")'
-      if [[ $? -eq 0 ]]
-      then
-          echo "Registry was added to qlconfig.yml file."
-      else
-          echo "::error Registry was not added to qlconfig.yml file."
-          echo "Contents of qlconfig.yml file:"
-          cat $QLCONFIG_PATH
-          exit 1
-      fi
diff --git a/pr-checks/checks/javascript-source-root.yml b/pr-checks/checks/javascript-source-root.yml
deleted file mode 100644
index c814e77e4f..0000000000
--- a/pr-checks/checks/javascript-source-root.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-name: "Custom source root"
-description: "Checks that the argument specifying a non-default source root works"
-# This feature is not compatible with old CLIs
-versions:
-  - linked
-  - default
-  - nightly-latest
-steps:
-  - name: Move codeql-action
-    run: |
-      mkdir ../new-source-root
-      mv * ../new-source-root
-  - uses: ./../action/init
-    with:
-      languages: javascript
-      source-root: ../new-source-root
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/analyze
-    with:
-      skip-queries: true
-  - name: Assert database exists
-    run: |
-      cd "$RUNNER_TEMP/codeql_databases"
-      if [[ ! -d javascript ]]; then
-        echo "Did not find a JavaScript database"
-        exit 1
-      fi
diff --git a/pr-checks/checks/job-run-uuid-sarif.yml b/pr-checks/checks/job-run-uuid-sarif.yml
deleted file mode 100644
index b86725d944..0000000000
--- a/pr-checks/checks/job-run-uuid-sarif.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: "Job run UUID added to SARIF"
-description: "Tests that the job run UUID is added to the SARIF output"
-versions:
-  - nightly-latest
-steps:
-  - uses: ./../action/init
-    id: init
-    with:
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-  - name: Upload SARIF
-    uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-    with:
-      name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json
-      path: "${{ runner.temp }}/results/javascript.sarif"
-      retention-days: 7
-  - name: Check results
-    run: |
-      cd "$RUNNER_TEMP/results"
-      actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif)
-      if [[ "$actual" != "$CODEQL_ACTION_JOB_RUN_UUID" ]]; then
-        echo "Expected SARIF output to contain job run UUID '$CODEQL_ACTION_JOB_RUN_UUID', but found '$actual'."
-        exit 1
-      else
-        echo "Found job run UUID '$actual'."
-      fi
diff --git a/pr-checks/checks/language-aliases.yml b/pr-checks/checks/language-aliases.yml
deleted file mode 100644
index b83dd5d0fa..0000000000
--- a/pr-checks/checks/language-aliases.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-name: "Language aliases"
-description: "Tests that language aliases are resolved correctly"
-versions:
-  - linked
-steps:
-  - uses: ./../action/init
-    with:
-      languages: C#,java-kotlin,typescript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - name: "Check languages"
-    run: |
-      expected_languages="csharp,java,javascript"
-      actual_languages=$(jq -r '.languages | join(",")' "$RUNNER_TEMP"/config)
-
-      if [ "$expected_languages" != "$actual_languages" ]; then
-        echo "Resolved languages did not match expected list. " \
-          "Expected languages: $expected_languages. Actual languages: $actual_languages."
-        exit 1
-      fi
diff --git a/pr-checks/checks/local-bundle.yml b/pr-checks/checks/local-bundle.yml
deleted file mode 100644
index 52e3ff552d..0000000000
--- a/pr-checks/checks/local-bundle.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: "Local CodeQL bundle"
-description: "Tests using a CodeQL bundle from a local file rather than a URL"
-versions:
-  - linked
-installGo: true
-installDotNet: true
-steps:
-  - name: Fetch latest CodeQL bundle
-    run: |
-      wget https://github.com/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.zst
-  - id: init
-    uses: ./../action/init
-    with:
-      # Swift is not supported on Ubuntu so we manually exclude it from the list here
-      languages: cpp,csharp,go,java,javascript,python,ruby
-      tools: ./codeql-bundle-linux64.tar.zst
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml
deleted file mode 100644
index b57e90ab4c..0000000000
--- a/pr-checks/checks/multi-language-autodetect.yml
+++ /dev/null
@@ -1,95 +0,0 @@
-name: "Multi-language repository"
-description: "An end-to-end integration test of a multi-language repository using automatic language detection"
-operatingSystems:
-  - ubuntu
-  - os: macos
-    runner-image: macos-latest-xlarge
-  # Older CodeQL CLI versions only support Swift up to 6.1, which requires Xcode 16. That is
-  # not available on macOS 26, so run these versions on macOS 15 where we select Xcode 16
-  # below. See https://github.com/actions/runner-images/issues/14167.
-  - os: macos
-    runner-image: macos-15-xlarge
-    codeql-versions:
-      - stable-v2.19.4
-      - stable-v2.20.7
-      - stable-v2.21.4
-      - stable-v2.22.4
-env:
-  CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI: true
-installGo: true
-installDotNet: true
-steps:
-  - name: Install Python 3.13 for older CLI versions
-    # We need Python 3.13 for older CLI versions because they are not compatible with Python 3.14 or newer.
-    # See https://github.com/github/codeql-action/pull/3212
-    if: matrix.version != 'nightly-latest' && matrix.version != 'linked'
-    uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
-    with:
-      python-version: "3.13"
-
-  - name: Use Xcode 16
-    # Only the older CodeQL CLI versions need Xcode 16, and these run on macOS 15.
-    if: matrix.os == 'macos-15-xlarge'
-    run: sudo xcode-select -s "/Applications/Xcode_16.app"
-
-  - uses: ./../action/init
-    id: init
-    with:
-      db-location: "${{ runner.temp }}/customDbLocation"
-      languages: ${{ runner.os == 'Linux' && 'cpp,csharp,go,java,javascript,python,ruby' || '' }}
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - name: Build code
-    run: ./build.sh
-
-  - uses: ./../action/analyze
-    id: analysis
-    with:
-      upload-database: false
-
-  - name: Check language autodetect for all languages excluding Swift
-    run: |
-      CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }}
-      if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
-        echo "Did not create a database for CPP, or created it in the wrong location."
-        exit 1
-      fi
-      CSHARP_DB=${{ fromJson(steps.analysis.outputs.db-locations).csharp }}
-      if [[ ! -d $CSHARP_DB ]] || [[ ! $CSHARP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
-        echo "Did not create a database for C Sharp, or created it in the wrong location."
-        exit 1
-      fi
-      GO_DB=${{ fromJson(steps.analysis.outputs.db-locations).go }}
-      if [[ ! -d $GO_DB ]] || [[ ! $GO_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
-        echo "Did not create a database for Go, or created it in the wrong location."
-        exit 1
-      fi
-      JAVA_DB=${{ fromJson(steps.analysis.outputs.db-locations).java }}
-      if [[ ! -d $JAVA_DB ]] || [[ ! $JAVA_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
-        echo "Did not create a database for Java, or created it in the wrong location."
-        exit 1
-      fi
-      JAVASCRIPT_DB=${{ fromJson(steps.analysis.outputs.db-locations).javascript }}
-      if [[ ! -d $JAVASCRIPT_DB ]] || [[ ! $JAVASCRIPT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
-        echo "Did not create a database for Javascript, or created it in the wrong location."
-        exit 1
-      fi
-      PYTHON_DB=${{ fromJson(steps.analysis.outputs.db-locations).python }}
-      if [[ ! -d $PYTHON_DB ]] || [[ ! $PYTHON_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
-        echo "Did not create a database for Python, or created it in the wrong location."
-        exit 1
-      fi
-      RUBY_DB=${{ fromJson(steps.analysis.outputs.db-locations).ruby }}
-      if [[ ! -d $RUBY_DB ]] || [[ ! $RUBY_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
-        echo "Did not create a database for Ruby, or created it in the wrong location."
-        exit 1
-      fi
-
-  - name: Check language autodetect for Swift on macOS
-    if: runner.os == 'macOS'
-    run: |
-      SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
-      if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
-        echo "Did not create a database for Swift, or created it in the wrong location."
-        exit 1
-      fi
diff --git a/pr-checks/checks/overlay-init-fallback.yml b/pr-checks/checks/overlay-init-fallback.yml
deleted file mode 100644
index 26d8c85672..0000000000
--- a/pr-checks/checks/overlay-init-fallback.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-name: "Overlay database init fallback"
-description: "Tests that overlay init action succeeds with non-overlay packs"
-versions:
-  - linked
-  - nightly-latest
-steps:
-  - uses: ./../action/init
-    with:
-      languages: actions   # Any language without overlay support will do
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-    env:
-      CODEQL_OVERLAY_DATABASE_MODE: overlay-base
-  - uses: ./../action/analyze
-    id: analysis
-    with:
-      upload-database: false
-  - name: Check database
-    run: |
-      cd "$RUNNER_TEMP/codeql_databases/actions"
-      if ! grep -q 'overlayBaseDatabase: false' codeql-database.yml ; then
-        echo "This test needs to be updated to use a non-overlay language."
-        exit 1
-      fi
diff --git a/pr-checks/checks/packaging-codescanning-config-inputs-js.yml b/pr-checks/checks/packaging-codescanning-config-inputs-js.yml
deleted file mode 100644
index aadce0662d..0000000000
--- a/pr-checks/checks/packaging-codescanning-config-inputs-js.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: "Packaging: Config and input passed to the CLI"
-description: "Checks that specifying packages using a combination of a config file and input to the Action works"
-# This feature is not compatible with old CLIs
-versions:
-  - linked
-  - default
-  - nightly-latest
-installGo: true
-installNode: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      config-file: ".github/codeql/codeql-config-packaging3.yml"
-      packs: +codeql-testing/codeql-pack1@1.0.0
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-
-  - name: Check results
-    uses: ./../action/.github/actions/check-sarif
-    with:
-      sarif-file: ${{ runner.temp }}/results/javascript.sarif
-      queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
-      queries-not-run: foo,bar
-
-  - name: Assert Results
-    run: |
-      cd "$RUNNER_TEMP/results"
-      # We should have 4 hits from these rules
-      EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
-
-      # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
-      RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
-      echo "Found matching rules '$RULES'"
-      if [ "$RULES" != "$EXPECTED_RULES" ]; then
-        echo "Did not match expected rules '$EXPECTED_RULES'."
-        exit 1
-      fi
diff --git a/pr-checks/checks/packaging-config-inputs-js.yml b/pr-checks/checks/packaging-config-inputs-js.yml
deleted file mode 100644
index 9d0ed13757..0000000000
--- a/pr-checks/checks/packaging-config-inputs-js.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: "Packaging: Config and input"
-description: "Checks that specifying packages using a combination of a config file and input to the Action works"
-# This feature is not compatible with old CLIs
-versions:
-  - linked
-  - default
-  - nightly-latest
-installGo: true
-installNode: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      config-file: ".github/codeql/codeql-config-packaging3.yml"
-      packs: +codeql-testing/codeql-pack1@1.0.0
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-
-  - name: Check results
-    uses: ./../action/.github/actions/check-sarif
-    with:
-      sarif-file: ${{ runner.temp }}/results/javascript.sarif
-      queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
-      queries-not-run: foo,bar
-
-  - name: Assert Results
-    run: |
-      cd "$RUNNER_TEMP/results"
-      # We should have 4 hits from these rules
-      EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
-
-      # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
-      RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
-      echo "Found matching rules '$RULES'"
-      if [ "$RULES" != "$EXPECTED_RULES" ]; then
-        echo "Did not match expected rules '$EXPECTED_RULES'."
-        exit 1
-      fi
diff --git a/pr-checks/checks/packaging-config-js.yml b/pr-checks/checks/packaging-config-js.yml
deleted file mode 100644
index d10a21f86a..0000000000
--- a/pr-checks/checks/packaging-config-js.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: "Packaging: Config file"
-description: "Checks that specifying packages using only a config file works"
-# This feature is not compatible with old CLIs
-versions:
-  - linked
-  - default
-  - nightly-latest
-installGo: true
-installNode: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      config-file: ".github/codeql/codeql-config-packaging.yml"
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-
-  - name: Check results
-    uses: ./../action/.github/actions/check-sarif
-    with:
-      sarif-file: ${{ runner.temp }}/results/javascript.sarif
-      queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
-      queries-not-run: foo,bar
-
-  - name: Assert Results
-    run: |
-      cd "$RUNNER_TEMP/results"
-      # We should have 4 hits from these rules
-      EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
-
-      # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
-      RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
-      echo "Found matching rules '$RULES'"
-      if [ "$RULES" != "$EXPECTED_RULES" ]; then
-        echo "Did not match expected rules '$EXPECTED_RULES'."
-        exit 1
-      fi
diff --git a/pr-checks/checks/packaging-inputs-js.yml b/pr-checks/checks/packaging-inputs-js.yml
deleted file mode 100644
index c3adbaaa1c..0000000000
--- a/pr-checks/checks/packaging-inputs-js.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: "Packaging: Action input"
-description: "Checks that specifying packages using the input to the Action works"
-# This feature is not compatible with old CLIs
-versions:
-  - linked
-  - default
-  - nightly-latest
-installGo: true
-installNode: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      config-file: ".github/codeql/codeql-config-packaging2.yml"
-      languages: javascript
-      packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2, codeql-testing/codeql-pack3:other-query.ql
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-
-  - name: Check results
-    uses: ./../action/.github/actions/check-sarif
-    with:
-      sarif-file: ${{ runner.temp }}/results/javascript.sarif
-      queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
-      queries-not-run: foo,bar
-
-  - name: Assert Results
-    run: |
-      cd "$RUNNER_TEMP/results"
-      # We should have 4 hits from these rules
-      EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
-
-      # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
-      RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
-      echo "Found matching rules '$RULES'"
-      if [ "$RULES" != "$EXPECTED_RULES" ]; then
-        echo "Did not match expected rules '$EXPECTED_RULES'."
-        exit 1
-      fi
diff --git a/pr-checks/checks/remote-config.yml b/pr-checks/checks/remote-config.yml
deleted file mode 100644
index 9211cb2128..0000000000
--- a/pr-checks/checks/remote-config.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: "Remote config file"
-description: "Checks that specifying packages using only a config file works"
-operatingSystems:
-  - ubuntu
-versions:
-  - linked
-  - nightly-latest
-installGo: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      languages: cpp,csharp,java,javascript,python
-      config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
diff --git a/pr-checks/checks/resolve-environment-action.yml b/pr-checks/checks/resolve-environment-action.yml
deleted file mode 100644
index 4ea1bfad41..0000000000
--- a/pr-checks/checks/resolve-environment-action.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: "Resolve environment"
-description: "Tests that the resolve-environment action works for Go and JavaScript/TypeScript"
-versions:
-  - linked
-  - default
-  - nightly-latest
-steps:
-  - uses: ./../action/init
-    with:
-      languages: go,javascript-typescript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-
-  - name: Resolve environment for Go
-    uses: ./../action/resolve-environment
-    id: resolve-environment-go
-    with:
-      language: go
-
-  - name: Fail if Go configuration missing
-    if: (!fromJSON(steps.resolve-environment-go.outputs.environment).configuration.go)
-    run: exit 1
-
-  - name: Resolve environment for JavaScript/TypeScript
-    uses: ./../action/resolve-environment
-    id: resolve-environment-js
-    with:
-      language: javascript-typescript
-
-  - name: Fail if JavaScript/TypeScript configuration present
-    if: fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript
-    run: exit 1
diff --git a/pr-checks/checks/rubocop-multi-language.yml b/pr-checks/checks/rubocop-multi-language.yml
deleted file mode 100644
index 37c5d36e90..0000000000
--- a/pr-checks/checks/rubocop-multi-language.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-name: "RuboCop multi-language"
-description: "Tests using RuboCop to analyze a multi-language repository and then using the CodeQL Action to upload the resulting SARIF"
-# This check doesn't use CodeQL, so the `version` matrix variable is unused.
-versions:
-  - default
-steps:
-  - name: Set up Ruby
-    uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
-    with:
-      ruby-version: 2.6
-  - name: Install Code Scanning integration
-    run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install
-  - name: Install dependencies
-    run: bundle install
-  - name: RuboCop run
-    run: |
-      bash -c "
-        bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
-        [[ $? -ne 2 ]]
-      "
-  - uses: ./../action/upload-sarif
-    with:
-      sarif_file: rubocop.sarif
diff --git a/pr-checks/checks/ruby.yml b/pr-checks/checks/ruby.yml
deleted file mode 100644
index fe061c085c..0000000000
--- a/pr-checks/checks/ruby.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: "Ruby analysis"
-description: "Tests creation of a Ruby database"
-versions:
-  - linked
-  - default
-  - nightly-latest
-operatingSystems:
-  - ubuntu
-  - macos
-steps:
-  - uses: ./../action/init
-    with:
-      languages: ruby
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/analyze
-    id: analysis
-    with:
-      upload-database: false
-  - name: Check database
-    run: |
-      RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}"
-      if [[ ! -d "$RUBY_DB" ]]; then
-        echo "Did not create a database for Ruby."
-        exit 1
-      fi
diff --git a/pr-checks/checks/rust.yml b/pr-checks/checks/rust.yml
deleted file mode 100644
index 8589ba80e5..0000000000
--- a/pr-checks/checks/rust.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: "Rust analysis"
-description: "Tests creation of a Rust database"
-versions:
-  # experimental rust support introduced, requires action to set `CODEQL_ENABLE_EXPERIMENTAL_FEATURES`
-  - stable-v2.19.4
-  # first public preview version
-  - stable-v2.22.1
-  - linked
-  - default
-  - nightly-latest
-steps:
-  - uses: ./../action/init
-    with:
-      languages: rust
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - uses: ./../action/analyze
-    id: analysis
-    with:
-      upload-database: false
-  - name: Check database
-    run: |
-      RUST_DB="${{ fromJson(steps.analysis.outputs.db-locations).rust }}"
-      if [[ ! -d "$RUST_DB" ]]; then
-        echo "Did not create a database for Rust."
-        exit 1
-      fi
diff --git a/pr-checks/checks/split-workflow.yml b/pr-checks/checks/split-workflow.yml
deleted file mode 100644
index 4f7128c857..0000000000
--- a/pr-checks/checks/split-workflow.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-name: "Split workflow"
-description: "Tests a split-up workflow in which we first build a database and later analyze it"
-operatingSystems:
-  - ubuntu
-  - macos
-# This feature is not compatible with old CLIs
-versions:
-  - linked
-  - default
-  - nightly-latest
-installGo: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      config-file: ".github/codeql/codeql-config-packaging3.yml"
-      packs: +codeql-testing/codeql-pack1@1.0.0
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
-    with:
-      skip-queries: true
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-
-  - name: Assert No Results
-    run: |
-      if [ "$(ls -A $RUNNER_TEMP/results)" ]; then
-        echo "Expected results directory to be empty after skipping query execution!"
-        exit 1
-      fi
-  - uses: ./../action/analyze
-    with:
-      output: "${{ runner.temp }}/results"
-      upload-database: false
-  - name: Assert Results
-    run: |
-      cd "$RUNNER_TEMP/results"
-      # We should have 4 hits from these rules
-      EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
-
-      # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
-      RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
-      echo "Found matching rules '$RULES'"
-      if [ "$RULES" != "$EXPECTED_RULES" ]; then
-        echo "Did not match expected rules '$EXPECTED_RULES'."
-        exit 1
-      fi
diff --git a/pr-checks/checks/start-proxy.yml b/pr-checks/checks/start-proxy.yml
deleted file mode 100644
index 675fc013a2..0000000000
--- a/pr-checks/checks/start-proxy.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-name: "Start proxy"
-description: "Tests that the proxy can be initialised on all platforms"
-operatingSystems:
-  - ubuntu
-  - macos
-  - windows
-versions:
-  - linked
-env:
-  CODEQL_ACTION_PROXY_API_REQUESTS: "true"
-steps:
-  - name: Setup proxy for registries
-    id: proxy
-    uses: ./../action/start-proxy
-    with:
-      language: java
-      registry_secrets: |
-        [
-          {
-            "type": "maven_repository",
-            "url": "https://repo.maven.apache.org/maven2/"
-          },
-          {
-            "type": "maven_repository",
-            "url": "https://repo1.maven.org/maven2"
-          }
-        ]
-
-  - name: Print proxy outputs
-    run: |
-      echo "${{ steps.proxy.outputs.proxy_host }}"
-      echo "${{ steps.proxy.outputs.proxy_port }}"
-      echo "${{ steps.proxy.outputs.proxy_urls }}"
-
-  - name: Fail if proxy outputs are not set
-    if: (!steps.proxy.outputs.proxy_host) || (!steps.proxy.outputs.proxy_port) || (!steps.proxy.outputs.proxy_ca_certificate) || (!steps.proxy.outputs.proxy_urls)
-    run: exit 1
-
-  - name: Fail if proxy_urls does not contain all registries
-    if: |
-      join(fromJSON(steps.proxy.outputs.proxy_urls)[*].type, ',') != 'maven_repository,maven_repository'
-      || !contains(steps.proxy.outputs.proxy_urls, 'https://repo.maven.apache.org/maven2/')
-      || !contains(steps.proxy.outputs.proxy_urls, 'https://repo1.maven.org/maven2')
-    run: exit 1
-
-  - uses: ./../action/init
-    env:
-      CODEQL_PROXY_HOST: ${{ steps.proxy.outputs.proxy_host }}
-      CODEQL_PROXY_PORT: ${{ steps.proxy.outputs.proxy_port }}
-      CODEQL_PROXY_CA_CERTIFICATE: ${{ steps.proxy.outputs.proxy_ca_certificate }}
-    with:
-      languages: java
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      config-file: codeql-action@main:tests/multi-language-repo/.github/codeql/custom-queries.yml
diff --git a/pr-checks/checks/submit-sarif-failure.yml b/pr-checks/checks/submit-sarif-failure.yml
deleted file mode 100644
index c33e1322f7..0000000000
--- a/pr-checks/checks/submit-sarif-failure.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: Submit SARIF after failure
-description: Check that a SARIF file is submitted for the workflow run if it fails
-versions:
-  - linked
-  - default
-  - nightly-latest
-
-env:
-  # Internal-only environment variable used to indicate that the post-init Action
-  # should expect to upload a SARIF file for the failed run.
-  CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF: true
-  # Make sure the uploading SARIF files feature is enabled.
-  CODEQL_ACTION_UPLOAD_FAILED_SARIF: true
-  # Upload the failed SARIF file as an integration test of the API endpoint.
-  CODEQL_ACTION_TEST_MODE: false
-  # Mark telemetry for this workflow so it can be treated separately.
-  CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
-
-permissions:
-  contents: read
-  security-events: write # needed to upload the SARIF file
-
-steps:
-  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
-  - uses: ./init
-    with:
-      languages: javascript
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Fail
-    # We want this job to pass if the Action correctly uploads the SARIF file for
-    # the failed run.
-    # Setting this step to continue on error means that it is marked as completing
-    # successfully, so will not fail the job.
-    continue-on-error: true
-    run: exit 1
-  - uses: ./analyze
-    # In a real workflow, this step wouldn't run. Since we used `continue-on-error`
-    # above, we manually disable it with an `if` condition.
-    if: false
-    with:
-      category: "/test-codeql-version:${{ matrix.version }}"
diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml
deleted file mode 100644
index 393857cd2c..0000000000
--- a/pr-checks/checks/swift-autobuild.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: "Swift analysis using autobuild"
-description: "Tests creation of a Swift database using autobuild"
-versions:
-  - nightly-latest
-operatingSystems:
-  - os: macos
-    runner-image: macos-latest-xlarge
-steps:
-  - uses: ./../action/init
-    id: init
-    with:
-      languages: swift
-      build-mode: autobuild
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Check working directory
-    run: pwd
-  - uses: ./../action/autobuild
-    timeout-minutes: 30
-  - uses: ./../action/analyze
-    id: analysis
-    with:
-      upload-database: false
-  - name: Check database
-    run: |
-      SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
-      if [[ ! -d "$SWIFT_DB" ]]; then
-        echo "Did not create a database for Swift."
-        exit 1
-      fi
diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml
deleted file mode 100644
index a2d04421b8..0000000000
--- a/pr-checks/checks/swift-custom-build.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: "Swift analysis using a custom build command"
-description: "Tests creation of a Swift database using custom build"
-versions:
-  - linked
-  - default
-  - nightly-latest
-operatingSystems:
-  - macos
-installGo: true
-installDotNet: true
-env:
-  DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
-steps:
-  - uses: ./../action/init
-    id: init
-    with:
-      languages: swift
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Check working directory
-    run: pwd
-  - name: Build code
-    run: ./build.sh
-  - uses: ./../action/analyze
-    id: analysis
-    with:
-      upload-database: false
-  - name: Check database
-    run: |
-      SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
-      if [[ ! -d "$SWIFT_DB" ]]; then
-        echo "Did not create a database for Swift."
-        exit 1
-      fi
diff --git a/pr-checks/checks/unset-environment.yml b/pr-checks/checks/unset-environment.yml
deleted file mode 100644
index dd41f159b5..0000000000
--- a/pr-checks/checks/unset-environment.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-name: "Test unsetting environment variables"
-description: "An end-to-end integration test that unsets some environment variables"
-operatingSystems:
-  - ubuntu
-versions:
-  - linked
-  - nightly-latest
-installGo: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    id: init
-    with:
-      db-location: ${{ runner.temp }}/customDbLocation
-      # Swift is not supported on Ubuntu so we manually exclude it from the list here
-      languages: cpp,csharp,go,java,javascript,python,ruby
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-  - name: Build code
-    run: env -i PATH="$PATH" HOME="$HOME" ./build.sh
-  - uses: ./../action/analyze
-    id: analysis
-    with:
-      upload-database: false
-  - run: |
-      CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
-      if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then
-        echo "::error::Did not create a database for CPP, or created it in the wrong location." \
-          "Expected location was '${RUNNER_TEMP}/customDbLocation/cpp' but actual was '${CPP_DB}'"
-        exit 1
-      fi
-      CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}"
-      if [[ ! -d "$CSHARP_DB" ]] || [[ ! "$CSHARP_DB" == "${RUNNER_TEMP}/customDbLocation/csharp" ]]; then
-        echo "::error::Did not create a database for C Sharp, or created it in the wrong location." \
-          "Expected location was '${RUNNER_TEMP}/customDbLocation/csharp' but actual was '${CSHARP_DB}'"
-        exit 1
-      fi
-      GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}"
-      if [[ ! -d "$GO_DB" ]] || [[ ! "$GO_DB" == "${RUNNER_TEMP}/customDbLocation/go" ]]; then
-        echo "::error::Did not create a database for Go, or created it in the wrong location." \
-          "Expected location was '${RUNNER_TEMP}/customDbLocation/go' but actual was '${GO_DB}'"
-        exit 1
-      fi
-      JAVA_DB="${{ fromJson(steps.analysis.outputs.db-locations).java }}"
-      if [[ ! -d "$JAVA_DB" ]] || [[ ! "$JAVA_DB" == "${RUNNER_TEMP}/customDbLocation/java" ]]; then
-        echo "::error::Did not create a database for Java, or created it in the wrong location." \
-          "Expected location was '${RUNNER_TEMP}/customDbLocation/java' but actual was '${JAVA_DB}'"
-        exit 1
-      fi
-      JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}"
-      if [[ ! -d "$JAVASCRIPT_DB" ]] || [[ ! "$JAVASCRIPT_DB" == "${RUNNER_TEMP}/customDbLocation/javascript" ]]; then
-        echo "::error::Did not create a database for Javascript, or created it in the wrong location." \
-          "Expected location was '${RUNNER_TEMP}/customDbLocation/javascript' but actual was '${JAVASCRIPT_DB}'"
-        exit 1
-      fi
-      PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}"
-      if [[ ! -d "$PYTHON_DB" ]] || [[ ! "$PYTHON_DB" == "${RUNNER_TEMP}/customDbLocation/python" ]]; then
-        echo "::error::Did not create a database for Python, or created it in the wrong location." \
-          "Expected location was '${RUNNER_TEMP}/customDbLocation/python' but actual was '${PYTHON_DB}'"
-        exit 1
-      fi
diff --git a/pr-checks/checks/upload-ref-sha-input.yml b/pr-checks/checks/upload-ref-sha-input.yml
deleted file mode 100644
index 9700827151..0000000000
--- a/pr-checks/checks/upload-ref-sha-input.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: "Upload-sarif: 'ref' and 'sha' from inputs"
-description: "Checks that specifying 'ref' and 'sha' as inputs works"
-versions:
-  - default
-installGo: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      languages: cpp,csharp,java,javascript,python
-      config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }}
-  - name: Build code
-    run: ./build.sh
-  # Generate some SARIF we can upload with the upload-sarif step
-  - uses: ./../action/analyze
-    with:
-      ref: 'refs/heads/main'
-      sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
-      upload: never
-  - uses: ./../action/upload-sarif
-    with:
-      ref: 'refs/heads/main'
-      sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
diff --git a/pr-checks/checks/upload-sarif.yml b/pr-checks/checks/upload-sarif.yml
deleted file mode 100644
index 8056a5179c..0000000000
--- a/pr-checks/checks/upload-sarif.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-name: "Test different uses of `upload-sarif`"
-description: "Checks that uploading SARIFs to the code quality endpoint works"
-versions:
-  - default
-analysisKinds:
-  - code-scanning
-  - code-quality
-  - code-scanning,code-quality
-installGo: true
-installDotNet: true
-steps:
-  - uses: ./../action/init
-    with:
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      languages: csharp,java,javascript,python
-      analysis-kinds: ${{ matrix.analysis-kinds }}
-  - name: Build code
-    run: ./build.sh
-  # Generate some SARIF we can upload with the upload-sarif step
-  - uses: ./../action/analyze
-    with:
-      ref: 'refs/heads/main'
-      sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
-      upload: never
-      output: ${{ runner.temp }}/results
-
-  - name: |
-      Upload all SARIF files for `analysis-kinds: ${{ matrix.analysis-kinds }}`
-    uses: ./../action/upload-sarif
-    id: upload-sarif
-    with:
-      ref: 'refs/heads/main'
-      sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
-      sarif_file: ${{ runner.temp }}/results
-      category: |
-        ${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:all-files/
-  - name: "Fail for missing output from `upload-sarif` step for `code-scanning`"
-    if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-scanning)
-    run: exit 1
-  - name: "Fail for missing output from `upload-sarif` step for `code-quality`"
-    if: contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)
-    run: exit 1
-
-  - name: Upload single SARIF file for Code Scanning
-    uses: ./../action/upload-sarif
-    id: upload-single-sarif-code-scanning
-    if: contains(matrix.analysis-kinds, 'code-scanning')
-    with:
-      ref: 'refs/heads/main'
-      sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
-      sarif_file: ${{ runner.temp }}/results/javascript.sarif
-      category: |
-        ${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-scanning/
-  - name: "Fail for missing output from `upload-single-sarif-code-scanning` step"
-    if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-sarif-code-scanning.outputs.sarif-ids).code-scanning)
-    run: exit 1
-  - name: Upload single SARIF file for Code Quality
-    uses: ./../action/upload-sarif
-    id: upload-single-sarif-code-quality
-    if: contains(matrix.analysis-kinds, 'code-quality')
-    with:
-      ref: 'refs/heads/main'
-      sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
-      sarif_file: ${{ runner.temp }}/results/javascript.quality.sarif
-      category: |
-        ${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-quality/
-  - name: "Fail for missing output from `upload-single-sarif-code-quality` step"
-    if: contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-single-sarif-code-quality.outputs.sarif-ids).code-quality)
-    run: exit 1
-
-  - name: Change SARIF file extension
-    if: contains(matrix.analysis-kinds, 'code-scanning')
-    run: mv ${{ runner.temp }}/results/javascript.sarif ${{ runner.temp }}/results/javascript.sarif.json
-  - name: Upload single non-`.sarif` file
-    uses: ./../action/upload-sarif
-    id: upload-single-non-sarif
-    if: contains(matrix.analysis-kinds, 'code-scanning')
-    with:
-      ref: 'refs/heads/main'
-      sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
-      sarif_file: ${{ runner.temp }}/results/javascript.sarif.json
-      category: |
-        ${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:non-sarif/
-  - name: "Fail for missing output from `upload-single-non-sarif` step"
-    if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-non-sarif.outputs.sarif-ids).code-scanning)
-    run: exit 1
diff --git a/pr-checks/checks/with-checkout-path.yml b/pr-checks/checks/with-checkout-path.yml
deleted file mode 100644
index a6cde895b6..0000000000
--- a/pr-checks/checks/with-checkout-path.yml
+++ /dev/null
@@ -1,67 +0,0 @@
-name: "Use a custom `checkout_path`"
-description: "Checks that a custom `checkout_path` will find the proper commit_oid"
-versions:
-  - linked
-installGo: true
-installDotNet: true
-steps:
-  # This ensures we don't accidentally use the original checkout for any part of the test.
-  - name: Delete original checkout
-    run: |
-      # delete the original checkout so we don't accidentally use it.
-      # Actions does not support deleting the current working directory, so we
-      # delete the contents of the directory instead.
-      rm -rf ./* .github .git
-  # Check out the actions repo again, but at a different location.
-  # choose an arbitrary SHA so that we can later test that the commit_oid is not from main
-  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
-    with:
-      ref: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
-      path: x/y/z/some-path
-
-  - uses: ./../action/init
-    with:
-      tools: ${{ steps.prepare-test.outputs.tools-url }}
-      # it's enough to test one compiled language and one interpreted language
-      languages: csharp,javascript
-      source-root: x/y/z/some-path/tests/multi-language-repo
-
-  - name: Build code
-    working-directory: x/y/z/some-path/tests/multi-language-repo
-    run: |
-      ./build.sh
-
-  - uses: ./../action/analyze
-    with:
-      checkout_path: x/y/z/some-path/tests/multi-language-repo
-      ref: v1.1.0
-      sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
-
-  - name: Verify SARIF after upload
-    run: |
-      PAYLOAD_FILE="$RUNNER_TEMP/payload-code-scanning.json"
-      EXPECTED_COMMIT_OID="474bbf07f9247ffe1856c6a0f94aeeb10e7afee6"
-      EXPECTED_REF="v1.1.0"
-      EXPECTED_CHECKOUT_URI_SUFFIX="/x/y/z/some-path/tests/multi-language-repo"
-
-      ACTUAL_COMMIT_OID="$(cat "$PAYLOAD_FILE" | jq -r .commit_oid)"
-      ACTUAL_REF="$(cat "$PAYLOAD_FILE" | jq -r .ref)"
-      ACTUAL_CHECKOUT_URI="$(cat "$PAYLOAD_FILE" | jq -r .checkout_uri)"
-
-      if [[ "$EXPECTED_COMMIT_OID" != "$ACTUAL_COMMIT_OID" ]]; then
-        echo "::error Invalid commit oid. Expected: $EXPECTED_COMMIT_OID Actual: $ACTUAL_COMMIT_OID"
-        echo "$PAYLOAD_FILE"
-        exit 1
-      fi
-
-      if [[ "$EXPECTED_REF" != "$ACTUAL_REF" ]]; then
-        echo "::error Invalid ref. Expected: '$EXPECTED_REF' Actual: '$ACTUAL_REF'"
-        echo "$PAYLOAD_FILE"
-        exit 1
-      fi
-
-      if [[ "$ACTUAL_CHECKOUT_URI" != *$EXPECTED_CHECKOUT_URI_SUFFIX ]]; then
-        echo "::error Invalid checkout URI suffix. Expected suffix: $EXPECTED_CHECKOUT_URI_SUFFIX Actual uri: $ACTUAL_CHECKOUT_URI"
-        echo "$PAYLOAD_FILE"
-        exit 1
-      fi
diff --git a/pr-checks/config.ts b/pr-checks/config.ts
deleted file mode 100644
index 356fe665f9..0000000000
--- a/pr-checks/config.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import path from "path";
-
-/** The oldest supported major version of the CodeQL Action. */
-export const OLDEST_SUPPORTED_MAJOR_VERSION = 3;
-
-/** The `pr-checks` directory. */
-export const PR_CHECKS_DIR = __dirname;
-
-/** The repository root. */
-export const REPO_ROOT = path.join(PR_CHECKS_DIR, "..");
-
-/** The path of the file configuring which checks shouldn't be required. */
-export const PR_CHECK_EXCLUDED_FILE = path.join(PR_CHECKS_DIR, "excluded.yml");
-
-/** The path of the main `package.json`. */
-export const PACKAGE_JSON = path.join(REPO_ROOT, "package.json");
-
-/** The path of the changelog. */
-export const CHANGELOG_FILE = path.join(REPO_ROOT, "CHANGELOG.md");
-
-/** The path to the esbuild metadata file. */
-export const BUNDLE_METADATA_FILE = path.join(REPO_ROOT, "meta.json");
-
-/** The `src` directory. */
-const SOURCE_ROOT = path.join(REPO_ROOT, "src");
-
-/** The path to the built-in languages file. */
-export const BUILTIN_LANGUAGES_FILE = path.join(
-  SOURCE_ROOT,
-  "languages",
-  "builtin.json",
-);
-
-/** Path to the api-compatibility.json file. */
-export const API_COMPATIBILITY_FILE = path.join(
-  SOURCE_ROOT,
-  "api-compatibility.json",
-);
-
-/** The prefix of CodeQL CLI bundle release URLs. */
-export const CLI_BUNDLE_RELEASE_URL_PREFIX =
-  "https://github.com/github/codeql-action/releases/tag/codeql-bundle-v";
-
-/** A common interface for operations that support dry runs. */
-export interface DryRunOption {
-  /** A value indicating whether to perform operations with side effects. */
-  dryRun?: boolean;
-}
diff --git a/pr-checks/excluded.yml b/pr-checks/excluded.yml
deleted file mode 100644
index 1a5262fc0b..0000000000
--- a/pr-checks/excluded.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-# PR checks to exclude from required checks
-contains:
-  - "ESLint"
-  - "https://"
-  - "test-setup-python-scripts"
-  - "update"
-  - "Update"
-is:
-  - "Agent"
-  - "check-expected-release-files"
-  - "Cleanup artifacts"
-  - "CodeQL"
-  - "copilot-pull-request-reviewer"
-  - "Dependabot"
-  - "Label PR with size"
-  - "Post repo size comment"
-  - "Prepare"
-  - "Upload results"
diff --git a/pr-checks/justfile b/pr-checks/justfile
deleted file mode 100644
index 245ca0a6a7..0000000000
--- a/pr-checks/justfile
+++ /dev/null
@@ -1 +0,0 @@
-set fallback := true
diff --git a/pr-checks/package.json b/pr-checks/package.json
deleted file mode 100644
index 6c23d847f2..0000000000
--- a/pr-checks/package.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "private": true,
-  "description": "Dependencies for the sync.ts",
-  "dependencies": {
-    "@actions/core": "^2.0.3",
-    "@actions/github": "^8.0.1",
-    "@octokit/core": "^7.0.7",
-    "@octokit/plugin-paginate-rest": ">=9.2.2",
-    "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
-    "semver": "^7.8.5",
-    "yaml": "^2.9.0"
-  },
-  "devDependencies": {
-    "@types/node": "^20.19.43",
-    "tsx": "^4.23.8"
-  }
-}
diff --git a/pr-checks/prepare-changelog.test.ts b/pr-checks/prepare-changelog.test.ts
deleted file mode 100644
index 13a302c8f6..0000000000
--- a/pr-checks/prepare-changelog.test.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Tests for `prepare-changelog.ts`.
- */
-
-import * as assert from "node:assert/strict";
-import * as fs from "node:fs";
-import * as os from "node:os";
-import * as path from "node:path";
-import { afterEach, beforeEach, describe, it } from "node:test";
-
-import { EMPTY_CHANGELOG, NO_CHANGES_STR } from "./changelog";
-import { extractChangelogSnippet } from "./prepare-changelog";
-
-let testDir: string;
-
-beforeEach(() => {
-  // Set up a temporary directory for testing
-  testDir = fs.mkdtempSync(path.join(os.tmpdir(), "prepare-changelog-test-"));
-});
-
-afterEach(() => {
-  /** Clean up temporary directories. */
-  fs.rmSync(testDir, { recursive: true, force: true });
-});
-
-const testBody = `- Test change`;
-const testChangelog = `${EMPTY_CHANGELOG.replace(NO_CHANGES_STR, testBody)}
-
-## Another section
-
-- Other change`;
-
-describe("extractChangelogSnippet", async () => {
-  await it("returns the default body if the input doesn't exist", async () => {
-    const result = extractChangelogSnippet(path.join(testDir, "not-here.md"));
-    assert.deepEqual(result, NO_CHANGES_STR);
-  });
-
-  await it("returns the first section if the input exists", async () => {
-    const changelogPath = path.join(testDir, "test-readme.md");
-    fs.writeFileSync(changelogPath, testChangelog);
-
-    const result = extractChangelogSnippet(changelogPath);
-    assert.deepEqual(result, testBody);
-  });
-
-  await it("returns an empty string if there is no first section", async () => {
-    const changelogPath = path.join(testDir, "test-readme.md");
-    fs.writeFileSync(changelogPath, "# CodeQL Action Changelog\n");
-
-    const result = extractChangelogSnippet(changelogPath);
-    assert.deepEqual(result, "");
-  });
-});
diff --git a/pr-checks/prepare-changelog.ts b/pr-checks/prepare-changelog.ts
deleted file mode 100755
index 0c89699fc8..0000000000
--- a/pr-checks/prepare-changelog.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/**
- * Extracts the body of the first changelog section and outputs it to either
- * stdout or a file.
- */
-
-import * as fs from "node:fs";
-import { parseArgs } from "node:util";
-
-import { NO_CHANGES_STR, parseChangelog } from "./changelog";
-import { CHANGELOG_FILE } from "./config";
-import { getErrorMessage } from "./util";
-
-/**
- * Prepare the changelog for the new release
- * This function will extract the part of the changelog that
- * we want to include in the new release.
- *
- * @param changelogPath The path to the changelog file.
- */
-export function extractChangelogSnippet(changelogPath: string) {
-  try {
-    const content = fs.readFileSync(changelogPath, "utf-8");
-    const changelog = parseChangelog(content);
-
-    // Return an empty string if we couldn't find the first section.
-    if (changelog.sections.length === 0) {
-      return "";
-    }
-
-    return changelog.sections[0].bodyLines.join("\n").trim();
-  } catch (err) {
-    if (err instanceof Error && "code" in err && err.code === "ENOENT") {
-      console.error(`Changelog file at '${changelogPath}' does not exist.`);
-      return NO_CHANGES_STR;
-    } else {
-      throw Error(
-        `Failed to open changelog file at '${changelogPath}': ${getErrorMessage(err)}`,
-      );
-    }
-  }
-}
-
-function main() {
-  try {
-    const { values } = parseArgs({
-      options: {
-        changelog: {
-          type: "string",
-          short: "f",
-          default: CHANGELOG_FILE,
-        },
-        output: {
-          type: "string",
-          short: "o",
-        },
-      },
-      strict: true,
-    });
-
-    const body = extractChangelogSnippet(values.changelog);
-
-    // If no `output` argument was provided, output to stdout. Otherwise,
-    // write a file to the specified path.
-    if (values.output === undefined) {
-      console.info(body);
-    } else {
-      fs.writeFileSync(values.output, body);
-    }
-
-    return 0;
-  } catch (err) {
-    console.error(`Failed to prepare changelog: ${getErrorMessage(err)}`);
-    return -1;
-  }
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  process.exit(main());
-}
diff --git a/pr-checks/readme.md b/pr-checks/readme.md
deleted file mode 100644
index 81eff0cdaf..0000000000
--- a/pr-checks/readme.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# PR Checks
-
-This folder contains the workflow generator that must be run in order to create the
-workflows used by the CodeQL Action CI. Workflows must be recreated after any change
-to one of the files in this directory.
-
-## Updating workflows
-
-Run `./sync.sh` to invoke the workflow generator and re-generate the workflow files in `.github/workflows/` based on the templates in `pr-checks/checks/`.
-
-Alternatively, you can use `just`:
-
-1. Install https://github.com/casey/just by whichever way you prefer.
-2. Run `just update-pr-checks` in your terminal.
diff --git a/pr-checks/release-branches.test.ts b/pr-checks/release-branches.test.ts
deleted file mode 100644
index b33c7b85a7..0000000000
--- a/pr-checks/release-branches.test.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/*
-Tests for the release-branches.ts script
-*/
-
-import * as assert from "node:assert/strict";
-import { describe, it } from "node:test";
-
-import { computeBackportBranches } from "./release-branches";
-
-describe("computeBackportBranches", async () => {
-  await it("rejects invalid major versions", () => {
-    // The majorVersion is expected to be in vN format.
-    assert.throws(() => computeBackportBranches("3", "v4.28.0", 3));
-    assert.throws(() => computeBackportBranches("v3.1", "v4.28.0", 3));
-  });
-
-  await it("rejects invalid latest tags", () => {
-    // The latestTag is expected to be in vN.M.P format.
-    assert.throws(() => computeBackportBranches("v3", "v4", 3));
-    assert.throws(() => computeBackportBranches("v3", "4", 3));
-    assert.throws(() => computeBackportBranches("v3", "v4.28", 3));
-    assert.throws(() => computeBackportBranches("v3", "4.28", 3));
-    assert.throws(() => computeBackportBranches("v3", "4.28.0", 3));
-  });
-
-  await it("sets backport source branch based on major version", () => {
-    // Test that the backport source branch is releases/v{majorVersion}
-    const result = computeBackportBranches("v3", "v4.28.0", 3);
-    assert.equal(result.backportSourceBranch, "releases/v3");
-  });
-
-  await it("no backport targets when major version is the oldest supported", () => {
-    // When majorVersion equals the major version of latestTag and we do not support older major versions,
-    // then there are no older supported branches to backport to.
-    const result = computeBackportBranches("v3", "v3.28.0", 3);
-    assert.deepEqual(result.backportTargetBranches, []);
-  });
-
-  await it("backports to older supported major versions", () => {
-    const result = computeBackportBranches("v4", "v4.1.0", 3);
-    assert.equal(result.backportSourceBranch, "releases/v4");
-    assert.deepEqual(result.backportTargetBranches, ["releases/v3"]);
-  });
-
-  await it("backports to multiple older supported branches", () => {
-    const result = computeBackportBranches("v5", "v5.0.0", 3);
-    assert.equal(result.backportSourceBranch, "releases/v5");
-    assert.deepEqual(result.backportTargetBranches, [
-      "releases/v4",
-      "releases/v3",
-    ]);
-  });
-
-  await it("does not backport when major version is older than latest tag", () => {
-    const result = computeBackportBranches("v2", "v3.28.0", 2);
-    assert.equal(result.backportSourceBranch, "releases/v2");
-    assert.deepEqual(result.backportTargetBranches, []);
-  });
-});
diff --git a/pr-checks/release-branches.ts b/pr-checks/release-branches.ts
deleted file mode 100755
index d0b4702018..0000000000
--- a/pr-checks/release-branches.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/usr/bin/env npx tsx
-
-import { parseArgs } from "node:util";
-
-import * as core from "@actions/core";
-
-import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config";
-
-/** The results of checking which release branches to backport to.  */
-export interface BackportInfo {
-  /** The source release branch. */
-  backportSourceBranch: string;
-  /**
-   * The computed release branches we should backport to.
-   * Will be empty if there are no branches we need to backport to.
-   */
-  backportTargetBranches: string[];
-}
-
-/**
- * Compute the backport source and target branches for a release.
- *
- * @param majorVersion - The major version string (e.g. "v4").
- * @param latestTag - The most recent tag published to the repository (e.g. "v4.32.6").
- * @param oldestSupportedMajorVersion - The oldest supported major version number.
- * @returns The names of the source branch and target branches.
- */
-export function computeBackportBranches(
-  majorVersion: string,
-  latestTag: string,
-  oldestSupportedMajorVersion: number,
-): BackportInfo {
-  // Perform some sanity checks on the inputs.
-  // For `majorVersion`, we expect exactly `vN` for some `N`.
-  const majorVersionMatch = majorVersion.match(/^v(\d+)$/);
-  if (!majorVersionMatch) {
-    throw new Error("--major-version value must be in `vN` format.");
-  }
-
-  // For latestTag, we expect something starting with `vN.M.P`
-  const latestTagMatch = latestTag.match(/^v(\d+)\.\d+\.\d+/);
-  if (!latestTagMatch) {
-    throw new Error(
-      `--latest-tag value must be in 'vN.M.P' format, but '${latestTag}' is not.`,
-    );
-  }
-
-  const majorVersionNumber = Number.parseInt(majorVersionMatch[1]);
-  const latestTagMajor = Number.parseInt(latestTagMatch[1]);
-
-  // If this is a primary release, we backport to all supported branches,
-  // so we check whether the majorVersion taken from the package.json
-  // is greater than or equal to the latest tag pulled from the repo.
-  // For example...
-  //     'v1' >= 'v2' is False # we're operating from an older release branch and should not backport
-  //     'v2' >= 'v2' is True  # the normal case where we're updating the current version
-  //     'v3' >= 'v2' is True  # in this case we are making the first release of a new major version
-  const considerBackports = majorVersionNumber >= latestTagMajor;
-
-  const backportSourceBranch = `releases/v${majorVersionNumber}`;
-  const backportTargetBranches: string[] = [];
-
-  if (considerBackports) {
-    for (let i = majorVersionNumber - 1; i > 0; i--) {
-      const branchName = `releases/v${i}`;
-      if (i >= oldestSupportedMajorVersion) {
-        backportTargetBranches.push(branchName);
-      }
-    }
-  }
-
-  return { backportSourceBranch, backportTargetBranches };
-}
-
-async function main() {
-  const { values: options } = parseArgs({
-    options: {
-      // The major version of the release in `vN` format (e.g. `v4`).
-      "major-version": {
-        type: "string",
-      },
-      // The most recent tag published to the repository (e.g. `v4.28.0`).
-      "latest-tag": {
-        type: "string",
-      },
-    },
-    strict: true,
-  });
-
-  if (options["major-version"] === undefined) {
-    throw Error("--major-version is required");
-  }
-  if (options["latest-tag"] === undefined) {
-    throw Error("--latest-tag is required");
-  }
-
-  const majorVersion = options["major-version"];
-  const latestTag = options["latest-tag"];
-
-  console.log(`Major version: ${majorVersion}`);
-  console.log(`Latest tag: ${latestTag}`);
-
-  const result = computeBackportBranches(
-    majorVersion,
-    latestTag,
-    OLDEST_SUPPORTED_MAJOR_VERSION,
-  );
-
-  core.setOutput("backport_source_branch", result.backportSourceBranch);
-  core.setOutput(
-    "backport_target_branches",
-    JSON.stringify(result.backportTargetBranches),
-  );
-
-  process.exit(0);
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  void main();
-}
diff --git a/pr-checks/rollback-changelog.test.ts b/pr-checks/rollback-changelog.test.ts
deleted file mode 100644
index 5264755a69..0000000000
--- a/pr-checks/rollback-changelog.test.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Tests for `rollback-changelog.ts`.
- */
-
-import * as assert from "node:assert/strict";
-import * as fs from "node:fs";
-import { describe, it } from "node:test";
-
-import { getReleaseDateString, parseChangelog } from "./changelog";
-import { CHANGELOG_FILE } from "./config";
-import { updateChangelog } from "./rollback-changelog";
-
-describe("updateChangelog", async () => {
-  await it("replaces the first section with one for the rollback release", async () => {
-    const actualChangelog = parseChangelog(
-      fs.readFileSync(CHANGELOG_FILE, "utf-8"),
-    );
-    const existingFirstSection = actualChangelog.sections[0];
-
-    const today = new Date();
-    updateChangelog(actualChangelog, {
-      "new-version": "Test.1.3",
-      "rollback-version": "Test.1.2",
-      "target-version": "Test.1.1",
-      today,
-    });
-
-    // Check that the old, first section is gone.
-    for (const section of actualChangelog.sections) {
-      assert.notDeepEqual(section, existingFirstSection);
-    }
-
-    // Check that the new, first section matches our expectations.
-    const newFirstSection = actualChangelog.sections[0];
-    assert.deepEqual(
-      newFirstSection.headerLine,
-      `## Test.1.3 - ${getReleaseDateString(today)}`,
-    );
-    assert.equal(newFirstSection.bodyLines.length, 3);
-    assert.deepEqual(
-      newFirstSection.bodyLines[1],
-      `This release rolls back Test.1.2 due to issues with that release. It is identical to Test.1.1.`,
-    );
-  });
-});
diff --git a/pr-checks/rollback-changelog.ts b/pr-checks/rollback-changelog.ts
deleted file mode 100755
index 15a37b1b7c..0000000000
--- a/pr-checks/rollback-changelog.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/**
- * Replaces the current, first section of the changelog with a new one for the rollback release.
- */
-
-import * as fs from "node:fs";
-import { parseArgs } from "node:util";
-
-import {
-  Changelog,
-  ChangelogSection,
-  getReleaseDateString,
-  parseChangelog,
-  renderChangelog,
-} from "./changelog";
-import { CHANGELOG_FILE } from "./config";
-import { getErrorMessage } from "./util";
-
-export interface RollbackChangelogInputs {
-  "target-version": string;
-  "rollback-version": string;
-  "new-version": string;
-  today?: Date;
-}
-
-/**
- * Replaces the current, first section of the changelog with a new one for the rollback release.
- */
-export function updateChangelog(
-  changelog: Changelog,
-  versions: RollbackChangelogInputs,
-) {
-  // Drop the existing first section.
-  changelog.sections.shift();
-
-  // Construct the section for the rollback version.
-  const newSection: ChangelogSection = {
-    headerLine: `## ${versions["new-version"]} - ${getReleaseDateString(versions.today)}`,
-    bodyLines: [
-      "",
-      `This release rolls back ${versions["rollback-version"]} due to issues with that release. It is identical to ${versions["target-version"]}.`,
-      "",
-    ],
-  };
-
-  // Add the new section at the top of the changelog.
-  changelog.sections.unshift(newSection);
-}
-
-function main() {
-  try {
-    const options = {
-      "target-version": { type: "string", short: "t" },
-      "rollback-version": { type: "string", short: "r" },
-      "new-version": { type: "string", short: "n" },
-    } as const;
-
-    const { values } = parseArgs({ options, strict: true });
-
-    for (const key of Object.keys(options)) {
-      const val = values[key as keyof typeof values];
-      if (val === undefined || val.trim() === "") {
-        throw new Error(`Argument '--${key}' is required.`);
-      }
-    }
-
-    const changelog = parseChangelog(fs.readFileSync(CHANGELOG_FILE, "utf-8"));
-    updateChangelog(changelog, values as RollbackChangelogInputs);
-    console.info(renderChangelog(changelog));
-
-    return 0;
-  } catch (err) {
-    console.error(
-      `Failed to prepare rollback changelog: ${getErrorMessage(err)}`,
-    );
-    return -1;
-  }
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  process.exit(main());
-}
diff --git a/pr-checks/sync-back.test.ts b/pr-checks/sync-back.test.ts
deleted file mode 100755
index 52d4c98f3f..0000000000
--- a/pr-checks/sync-back.test.ts
+++ /dev/null
@@ -1,284 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/*
-Tests for the sync-back.ts script
-*/
-
-import * as assert from "node:assert/strict";
-import * as fs from "node:fs";
-import * as os from "node:os";
-import * as path from "node:path";
-import { afterEach, beforeEach, describe, it } from "node:test";
-
-import {
-  scanGeneratedWorkflows,
-  updateSyncTs,
-  updateTemplateFiles,
-} from "./sync-back";
-
-let testDir: string;
-let workflowDir: string;
-let checksDir: string;
-let syncTsPath: string;
-
-beforeEach(() => {
-  /** Set up temporary directories and files for testing */
-  testDir = fs.mkdtempSync(path.join(os.tmpdir(), "sync-back-test-"));
-  workflowDir = path.join(testDir, ".github", "workflows");
-  checksDir = path.join(testDir, "pr-checks", "checks");
-  fs.mkdirSync(workflowDir, { recursive: true });
-  fs.mkdirSync(checksDir, { recursive: true });
-
-  // Create sync.ts file path
-  syncTsPath = path.join(testDir, "pr-checks", "sync.ts");
-});
-
-afterEach(() => {
-  /** Clean up temporary directories */
-  fs.rmSync(testDir, { recursive: true, force: true });
-});
-
-describe("scanGeneratedWorkflows", async () => {
-  await it("basic workflow scanning", () => {
-    /** Test basic workflow scanning functionality */
-    const workflowContent = `
-name: Test Workflow
-jobs:
-  test:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-      - uses: actions/setup-node@v5
-      - uses: actions/setup-go@v6
-`;
-
-    fs.writeFileSync(path.join(workflowDir, "__test.yml"), workflowContent);
-
-    const result = scanGeneratedWorkflows(workflowDir);
-
-    assert.equal(result["actions/checkout"], "v4");
-    assert.equal(result["actions/setup-node"], "v5");
-    assert.equal(result["actions/setup-go"], "v6");
-  });
-
-  await it("scanning workflows with version comments", () => {
-    /** Test scanning workflows with version comments */
-    const workflowContent = `
-name: Test Workflow
-jobs:
-  test:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-      - uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
-      - uses: actions/setup-python@v6 # Latest Python
-`;
-
-    fs.writeFileSync(path.join(workflowDir, "__test.yml"), workflowContent);
-
-    const result = scanGeneratedWorkflows(workflowDir);
-
-    assert.equal(result["actions/checkout"], "v4");
-    assert.equal(
-      result["ruby/setup-ruby"],
-      "44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
-    );
-    assert.equal(result["actions/setup-python"], "v6 # Latest Python");
-  });
-
-  await it("ignores local actions", () => {
-    /** Test that local actions (starting with ./) are ignored */
-    const workflowContent = `
-name: Test Workflow
-jobs:
-  test:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-      - uses: ./.github/actions/local-action
-      - uses: ./another-local-action@v1
-`;
-
-    fs.writeFileSync(path.join(workflowDir, "__test.yml"), workflowContent);
-
-    const result = scanGeneratedWorkflows(workflowDir);
-
-    assert.equal(result["actions/checkout"], "v4");
-    assert.equal("./.github/actions/local-action" in result, false);
-    assert.equal("./another-local-action" in result, false);
-  });
-});
-
-describe("updateSyncTs", async () => {
-  await it("updates sync.ts file", () => {
-    /** Test updating sync.ts file */
-    const syncTsContent = `
-const steps = [
-  {
-    uses: "actions/setup-node@v4",
-    with: { "node-version": "16" },
-  },
-  {
-    uses: "actions/setup-go@v5",
-    with: { "go-version": "1.19" },
-  },
-];
-`;
-
-    fs.writeFileSync(syncTsPath, syncTsContent);
-
-    const actionVersions = {
-      "actions/setup-node": "v5",
-      "actions/setup-go": "v6",
-    };
-
-    const result = updateSyncTs(syncTsPath, actionVersions);
-    assert.equal(result, true);
-
-    const updatedContent = fs.readFileSync(syncTsPath, "utf8");
-
-    assert.ok(updatedContent.includes('uses: "actions/setup-node@v5"'));
-    assert.ok(updatedContent.includes('uses: "actions/setup-go@v6"'));
-  });
-
-  await it("strips comments from versions", () => {
-    /** Test updating sync.ts file when versions have comments */
-    const syncTsContent = `
-const steps = [
-  {
-    uses: "actions/setup-node@v4",
-    with: { "node-version": "16" },
-  },
-];
-`;
-
-    fs.writeFileSync(syncTsPath, syncTsContent);
-
-    const actionVersions = {
-      "actions/setup-node": "v5 # Latest version",
-    };
-
-    const result = updateSyncTs(syncTsPath, actionVersions);
-    assert.equal(result, true);
-
-    const updatedContent = fs.readFileSync(syncTsPath, "utf8");
-
-    // sync.ts should get the version without comment
-    assert.ok(updatedContent.includes('uses: "actions/setup-node@v5"'));
-    assert.ok(!updatedContent.includes("# Latest version"));
-  });
-
-  await it("returns false when no changes are needed", () => {
-    /** Test that updateSyncTs returns false when no changes are needed */
-    const syncTsContent = `
-const steps = [
-  {
-    uses: "actions/setup-node@v5",
-    with: { "node-version": "16" },
-  },
-];
-`;
-
-    fs.writeFileSync(syncTsPath, syncTsContent);
-
-    const actionVersions = {
-      "actions/setup-node": "v5",
-    };
-
-    const result = updateSyncTs(syncTsPath, actionVersions);
-    assert.equal(result, false);
-  });
-
-  await it("updates SHA-pinned pinnedUses references", () => {
-    /** Test updating `pinnedUses(...)` references with new SHA and version */
-    const syncTsContent = `
-const steps = [
-  {
-    uses: pinnedUses(
-      "actions/setup-node",
-      "0000000000000000000000000000000000000000",
-      "v6.0.0",
-    ),
-  },
-];
-`;
-
-    fs.writeFileSync(syncTsPath, syncTsContent);
-
-    const actionVersions = {
-      "actions/setup-node": "48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0",
-    };
-
-    const result = updateSyncTs(syncTsPath, actionVersions);
-    assert.equal(result, true);
-
-    const updatedContent = fs.readFileSync(syncTsPath, "utf8");
-
-    assert.ok(
-      updatedContent.includes('"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e"'),
-    );
-    assert.ok(updatedContent.includes('"v6.4.0"'));
-    assert.ok(
-      !updatedContent.includes("0000000000000000000000000000000000000000"),
-    );
-    assert.ok(!updatedContent.includes('"v6.0.0"'));
-  });
-});
-
-describe("updateTemplateFiles", async () => {
-  await it("updates template files", () => {
-    /** Test updating template files */
-    const templateContent = `
-name: Test Template
-steps:
-  - uses: actions/checkout@v3
-  - uses: actions/setup-node@v4
-    with:
-      node-version: 16
-`;
-
-    const templatePath = path.join(checksDir, "test.yml");
-    fs.writeFileSync(templatePath, templateContent);
-
-    const actionVersions = {
-      "actions/checkout": "v4",
-      "actions/setup-node": "v5 # Latest",
-    };
-
-    const result = updateTemplateFiles(checksDir, actionVersions);
-    assert.equal(result.length, 1);
-    assert.ok(result.includes(templatePath));
-
-    const updatedContent = fs.readFileSync(templatePath, "utf8");
-
-    assert.ok(updatedContent.includes("uses: actions/checkout@v4"));
-    assert.ok(updatedContent.includes("uses: actions/setup-node@v5 # Latest"));
-  });
-
-  await it("preserves version comments", () => {
-    /** Test that updating template files preserves version comments */
-    const templateContent = `
-name: Test Template
-steps:
-  - uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.256.0
-`;
-
-    const templatePath = path.join(checksDir, "test.yml");
-    fs.writeFileSync(templatePath, templateContent);
-
-    const actionVersions = {
-      "ruby/setup-ruby": "55511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
-    };
-
-    const result = updateTemplateFiles(checksDir, actionVersions);
-    assert.equal(result.length, 1);
-
-    const updatedContent = fs.readFileSync(templatePath, "utf8");
-
-    assert.ok(
-      updatedContent.includes(
-        "uses: ruby/setup-ruby@55511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
-      ),
-    );
-  });
-});
diff --git a/pr-checks/sync-back.ts b/pr-checks/sync-back.ts
deleted file mode 100755
index bb442b2fe1..0000000000
--- a/pr-checks/sync-back.ts
+++ /dev/null
@@ -1,237 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/*
-Sync-back script to automatically update action versions in source templates
-from the generated workflow files after Dependabot updates.
-
-This script scans the generated workflow files (.github/workflows/__*.yml) to find
-all external action versions used, then updates:
-1. Hardcoded action versions in pr-checks/sync.ts
-2. Action version references in template files in pr-checks/checks/
-
-The script automatically detects all actions used in generated workflows and
-preserves version comments (e.g., # v1.2.3) when syncing versions.
-
-This ensures that when Dependabot updates action versions in generated workflows,
-those changes are properly synced back to the source templates. Regular workflow
-files are updated directly by Dependabot and don't need sync-back.
-*/
-
-import * as fs from "fs";
-import { parseArgs } from "node:util";
-import * as path from "path";
-
-const THIS_DIR = __dirname;
-const CHECKS_DIR = path.join(THIS_DIR, "checks");
-const WORKFLOW_DIR = path.join(THIS_DIR, "..", ".github", "workflows");
-const SYNC_TS_PATH = path.join(THIS_DIR, "sync.ts");
-
-/**
- * Scan generated workflow files to extract the latest action versions.
- *
- * @param workflowDir - Path to .github/workflows directory
- * @returns Map from action names to their latest versions (including comments)
- */
-export function scanGeneratedWorkflows(
-  workflowDir: string,
-): Record {
-  const actionVersions: Record = {};
-
-  const generatedFiles = fs
-    .readdirSync(workflowDir)
-    .filter((f) => f.startsWith("__") && f.endsWith(".yml"))
-    .map((f) => path.join(workflowDir, f));
-
-  for (const filePath of generatedFiles) {
-    const content = fs.readFileSync(filePath, "utf8");
-
-    // Find all action uses in the file, including potential comments
-    // This pattern captures: action_name@version_with_possible_comment
-    const pattern = /uses:\s+([^/\s]+\/[^@\s]+)@([^@\n]+)/g;
-    let match: RegExpExecArray | null;
-
-    while ((match = pattern.exec(content)) !== null) {
-      const actionName = match[1];
-      const versionWithComment = match[2].trimEnd();
-
-      // Only track non-local actions (those with / but not starting with ./)
-      if (!actionName.startsWith("./")) {
-        // Assume that version numbers are consistent (this should be the case on a Dependabot update PR)
-        actionVersions[actionName] = versionWithComment;
-      }
-    }
-  }
-
-  return actionVersions;
-}
-
-/**
- * Update hardcoded action versions in pr-checks/sync.ts
- *
- * Handles both inline `uses: "owner/action@ref"` strings and SHA-pinned
- * references expressed via the `pinnedUses("owner/action", "", "version")`
- * helper.
- *
- * @param syncTsPath - Path to sync.ts file
- * @param actionVersions - Map of action names to versions (may include comments)
- * @returns True if the file was modified, false otherwise
- */
-export function updateSyncTs(
-  syncTsPath: string,
-  actionVersions: Record,
-): boolean {
-  if (!fs.existsSync(syncTsPath)) {
-    throw new Error(`Could not find ${syncTsPath}`);
-  }
-
-  let content = fs.readFileSync(syncTsPath, "utf8");
-  const originalContent = content;
-
-  // Update hardcoded action versions
-  for (const [actionName, versionWithComment] of Object.entries(
-    actionVersions,
-  )) {
-    // Split the scanned value into the ref (e.g. a commit SHA) and the optional
-    // trailing version comment (e.g. `v6.0.3`).
-    const ref = versionWithComment.includes("#")
-      ? versionWithComment.split("#")[0].trim()
-      : versionWithComment.trim();
-    const versionComment = versionWithComment.includes("#")
-      ? versionWithComment.split("#")[1].trim()
-      : "";
-
-    const escaped = actionName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
-
-    // Look for patterns like uses: "actions/setup-node@v4"
-    // Note that this will break if we store an Action uses reference in a
-    // variable - that's a risk we're happy to take since in that case the
-    // PR checks will just fail.
-    const usesPattern = new RegExp(`(uses:\\s*")${escaped}@(?:[^"]+)(")`, "g");
-    content = content.replace(usesPattern, `$1${actionName}@${ref}$2`);
-
-    // Look for SHA-pinned references expressed via the `pinnedUses` helper, e.g.
-    // `pinnedUses("actions/checkout", "", "v6.0.3")`, updating both the
-    // pinned ref and the version comment.
-    const pinnedPattern = new RegExp(
-      `(pinnedUses\\(\\s*")${escaped}("\\s*,\\s*")[^"]*("\\s*,\\s*")([^"]*)(")`,
-      "g",
-    );
-    content = content.replace(
-      pinnedPattern,
-      (_match, p1, p2, p3, oldVersion, p5) =>
-        `${p1}${actionName}${p2}${ref}${p3}${versionComment || oldVersion}${p5}`,
-    );
-  }
-
-  if (content !== originalContent) {
-    fs.writeFileSync(syncTsPath, content, "utf8");
-    console.info(`Updated ${syncTsPath}`);
-    return true;
-  } else {
-    console.info(`No changes needed in ${syncTsPath}`);
-    return false;
-  }
-}
-
-/**
- * Update action versions in template files in pr-checks/checks/
- *
- * @param checksDir - Path to pr-checks/checks directory
- * @param actionVersions - Map of action names to versions (may include comments)
- * @returns List of files that were modified
- */
-export function updateTemplateFiles(
-  checksDir: string,
-  actionVersions: Record,
-): string[] {
-  const modifiedFiles: string[] = [];
-
-  const templateFiles = fs
-    .readdirSync(checksDir)
-    .filter((f) => f.endsWith(".yml"))
-    .map((f) => path.join(checksDir, f));
-
-  for (const filePath of templateFiles) {
-    let content = fs.readFileSync(filePath, "utf8");
-    const originalContent = content;
-
-    // Update action versions
-    for (const [actionName, versionWithComment] of Object.entries(
-      actionVersions,
-    )) {
-      // Look for patterns like 'uses: actions/setup-node@v4' or 'uses: actions/setup-node@sha # comment'
-      const escaped = actionName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
-      const pattern = new RegExp(`(uses:\\s+${escaped})@(?:[^@\n]+)`, "g");
-      content = content.replace(pattern, `$1@${versionWithComment}`);
-    }
-
-    if (content !== originalContent) {
-      fs.writeFileSync(filePath, content, "utf8");
-      modifiedFiles.push(filePath);
-      console.info(`Updated ${filePath}`);
-    }
-  }
-
-  return modifiedFiles;
-}
-
-function main(): number {
-  const { values } = parseArgs({
-    options: {
-      verbose: {
-        type: "boolean",
-        short: "v",
-        default: false,
-      },
-    },
-    strict: true,
-  });
-
-  const verbose = values.verbose ?? false;
-
-  console.info("Scanning generated workflows for latest action versions...");
-  const actionVersions = scanGeneratedWorkflows(WORKFLOW_DIR);
-
-  if (verbose) {
-    console.info("Found action versions:");
-    for (const [action, version] of Object.entries(actionVersions)) {
-      console.info(`  ${action}@${version}`);
-    }
-  }
-
-  if (Object.keys(actionVersions).length === 0) {
-    console.error("No action versions found in generated workflows");
-    return 1;
-  }
-
-  // Update files
-  console.info("\nUpdating source files...");
-  const modifiedFiles: string[] = [];
-
-  // Update sync.ts
-  if (updateSyncTs(SYNC_TS_PATH, actionVersions)) {
-    modifiedFiles.push(SYNC_TS_PATH);
-  }
-
-  // Update template files
-  const templateModified = updateTemplateFiles(CHECKS_DIR, actionVersions);
-  modifiedFiles.push(...templateModified);
-
-  if (modifiedFiles.length > 0) {
-    console.info(`\nSync completed. Modified ${modifiedFiles.length} files:`);
-    for (const filePath of modifiedFiles) {
-      console.info(`  ${filePath}`);
-    }
-  } else {
-    console.info(
-      "\nNo files needed updating - all action versions are already in sync",
-    );
-  }
-
-  return 0;
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  process.exit(main());
-}
diff --git a/pr-checks/sync-checks.test.ts b/pr-checks/sync-checks.test.ts
deleted file mode 100644
index 18d288582d..0000000000
--- a/pr-checks/sync-checks.test.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/*
-Tests for the sync-checks.ts script
-*/
-
-import * as assert from "node:assert/strict";
-import { describe, it } from "node:test";
-
-import {
-  CheckInfo,
-  Exclusions,
-  Options,
-  removeExcluded,
-  resolveToken,
-} from "./sync-checks";
-
-const defaultOptions: Options = {
-  apply: false,
-  verbose: false,
-};
-
-const toCheckInfo = (name: string) =>
-  ({ context: name, app_id: -1 }) satisfies CheckInfo;
-
-const expectedPartialMatches = ["PR Check - Foo", "https://example.com"].map(
-  toCheckInfo,
-);
-
-const expectedExactMatches = ["CodeQL", "Update"].map(toCheckInfo);
-
-const testChecks = expectedExactMatches.concat(expectedPartialMatches);
-
-const emptyExclusions: Exclusions = {
-  is: [],
-  contains: [],
-};
-
-describe("removeExcluded", async () => {
-  await it("retains all checks if no exclusions are configured", () => {
-    const retained = removeExcluded(
-      defaultOptions,
-      emptyExclusions,
-      testChecks,
-    );
-    assert.deepEqual(retained, testChecks);
-  });
-
-  await it("removes exact matches", () => {
-    const retained = removeExcluded(
-      defaultOptions,
-      { ...emptyExclusions, is: ["CodeQL", "Update"] },
-      testChecks,
-    );
-    assert.deepEqual(retained, expectedPartialMatches);
-  });
-
-  await it("removes partial matches", () => {
-    const retained = removeExcluded(
-      defaultOptions,
-      { ...emptyExclusions, contains: ["https://", "PR Check"] },
-      testChecks,
-    );
-    assert.deepEqual(retained, expectedExactMatches);
-  });
-});
-
-describe("resolveToken", async () => {
-  await it("reads the token from standard input", async () => {
-    const token = await resolveToken(
-      { tokenStdin: true },
-      { env: {}, readStdin: async () => " stdin-token\n" },
-    );
-    assert.equal(token, "stdin-token");
-  });
-
-  await it("reads the token from the GH_TOKEN environment variable", async () => {
-    const token = await resolveToken(
-      {},
-      { env: { GH_TOKEN: "env-token" }, readStdin: async () => "" },
-    );
-    assert.equal(token, "env-token");
-  });
-
-  await it("reads the token from the GITHUB_TOKEN environment variable", async () => {
-    const token = await resolveToken(
-      {},
-      { env: { GITHUB_TOKEN: "env-token" }, readStdin: async () => "" },
-    );
-    assert.equal(token, "env-token");
-  });
-
-  await it("rejects an empty standard input token", async () => {
-    await assert.rejects(
-      resolveToken(
-        { tokenStdin: true },
-        { env: {}, readStdin: async () => "\n" },
-      ),
-      /No token received on standard input/,
-    );
-  });
-
-  await it("rejects missing token sources", async () => {
-    await assert.rejects(
-      resolveToken({}, { env: {}, readStdin: async () => "" }),
-      /Missing authentication token/,
-    );
-  });
-});
diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts
deleted file mode 100755
index afebc5831e..0000000000
--- a/pr-checks/sync-checks.ts
+++ /dev/null
@@ -1,347 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/** Update the required checks based on the current branch. */
-
-import * as fs from "fs";
-import { parseArgs } from "node:util";
-
-import * as yaml from "yaml";
-
-import { type ApiClient, getApiClient } from "./api-client";
-import {
-  OLDEST_SUPPORTED_MAJOR_VERSION,
-  PR_CHECK_EXCLUDED_FILE,
-} from "./config";
-
-/** Represents the command-line options. */
-export interface Options {
-  /** Whether to read the GitHub API token from standard input. */
-  tokenStdin?: boolean;
-  /** The git ref to use the checks for. */
-  ref?: string;
-  /** Whether to actually apply the changes or not. */
-  apply: boolean;
-  /** Whether to output additional information. */
-  verbose: boolean;
-}
-
-/** Identifies the CodeQL Action repository. */
-const codeqlActionRepo = {
-  owner: "github",
-  repo: "codeql-action",
-};
-
-/** Environment variables to check for a GitHub API token. */
-const TOKEN_ENVIRONMENT_VARIABLES = ["GH_TOKEN", "GITHUB_TOKEN"];
-
-/** Represents the sources from which we can retrieve the GitHub API token. */
-interface TokenSource {
-  /** Environment variables to inspect. */
-  env: NodeJS.ProcessEnv;
-  /** Reads a token from standard input. */
-  readStdin: () => Promise;
-}
-
-/** Reads the GitHub API token from standard input. */
-async function readTokenFromStdin(): Promise {
-  let token = "";
-  process.stdin.setEncoding("utf8");
-  for await (const chunk of process.stdin) {
-    token += chunk;
-  }
-  return token.trim();
-}
-
-/** Gets a GitHub API token from one of the supported environment variables. */
-function getTokenFromEnvironment(env: NodeJS.ProcessEnv): string | undefined {
-  for (const variableName of TOKEN_ENVIRONMENT_VARIABLES) {
-    const token = env[variableName]?.trim();
-    if (token) {
-      return token;
-    }
-  }
-  return undefined;
-}
-
-/** Gets the token to use to authenticate to the GitHub API. */
-export async function resolveToken(
-  options: Pick,
-  tokenSource: TokenSource = {
-    env: process.env,
-    readStdin: readTokenFromStdin,
-  },
-): Promise {
-  if (options.tokenStdin) {
-    const token = (await tokenSource.readStdin()).trim();
-    if (token.length === 0) {
-      throw new Error("No token received on standard input.");
-    }
-    return token;
-  }
-
-  const environmentToken = getTokenFromEnvironment(tokenSource.env);
-  if (environmentToken !== undefined) {
-    return environmentToken;
-  }
-
-  throw new Error(
-    "Missing authentication token. Set GH_TOKEN/GITHUB_TOKEN or pipe a token " +
-      "to --token-stdin.",
-  );
-}
-
-/** Represents a configuration of which checks should not be set up as required checks. */
-export interface Exclusions {
-  /** A list of strings that, if contained in a check name, are excluded. */
-  contains: string[];
-  /** A list of check names that are excluded if their name is an exact match. */
-  is: string[];
-}
-
-/** Loads the configuration for which checks to exclude. */
-function loadExclusions(): Exclusions {
-  return yaml.parse(
-    fs.readFileSync(PR_CHECK_EXCLUDED_FILE, "utf-8"),
-  ) as Exclusions;
-}
-
-/**
- * Represents information about a check run. We track the `app_id` that generated the check,
- * because the API will require it in addition to the name in the future.
- */
-export interface CheckInfo {
-  /** The display name of the check. */
-  context: string;
-  /** The ID of the app that generated the check. */
-  app_id: number;
-}
-
-/** Removes entries from `checkInfos` based on the configuration. */
-export function removeExcluded(
-  options: Options,
-  exclusions: Exclusions,
-  checkInfos: CheckInfo[],
-): CheckInfo[] {
-  if (options.verbose) {
-    console.log(exclusions);
-  }
-
-  return checkInfos.filter((checkInfo) => {
-    if (exclusions.is.includes(checkInfo.context)) {
-      console.info(
-        `Excluding '${checkInfo.context}' because it is an exact exclusion.`,
-      );
-      return false;
-    }
-
-    for (const containsStr of exclusions.contains) {
-      if (checkInfo.context.includes(containsStr)) {
-        console.info(
-          `Excluding '${checkInfo.context}' because it contains '${containsStr}'.`,
-        );
-        return false;
-      }
-    }
-
-    // Keep.
-    return true;
-  });
-}
-
-/** Gets a list of check run names for `ref`. */
-async function getChecksFor(
-  options: Options,
-  client: ApiClient,
-  ref: string,
-): Promise {
-  console.info(`Getting checks for '${ref}'`);
-
-  const response = await client.paginate(
-    "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
-    {
-      ...codeqlActionRepo,
-      ref,
-    },
-  );
-
-  if (response.length === 0) {
-    throw new Error(`No checks found for '${ref}'.`);
-  }
-
-  console.info(`Retrieved ${response.length} check runs.`);
-
-  const notSkipped = response.filter(
-    (checkRun) => checkRun.conclusion !== "skipped",
-  );
-  console.info(`Of those: ${notSkipped.length} were not skipped.`);
-
-  // We use the ID of the app that generated the check run when returned by the API,
-  // but default to -1 to tell the API that any check with the given name should be
-  // required.
-  const checkInfos = notSkipped.map((check) => ({
-    context: check.name,
-    app_id: check.app?.id || -1,
-  }));
-
-  // Load the configuration for which checks to exclude and apply it before
-  // returning the checks.
-  const exclusions = loadExclusions();
-  return removeExcluded(options, exclusions, checkInfos);
-}
-
-/** Gets the current list of release branches. */
-async function getReleaseBranches(client: ApiClient): Promise {
-  const refs = await client.rest.git.listMatchingRefs({
-    ...codeqlActionRepo,
-    ref: "heads/releases/v",
-  });
-  return refs.data.map((ref) => ref.ref).sort();
-}
-
-/** Updates the required status checks for `branch` to `checks`. */
-async function patchBranchProtectionRule(
-  client: ApiClient,
-  branch: string,
-  checks: Set,
-) {
-  await client.rest.repos.setStatusCheckContexts({
-    ...codeqlActionRepo,
-    branch,
-    contexts: Array.from(checks),
-  });
-}
-
-/** Sets `checkNames` as required checks for `branch`. */
-async function updateBranch(
-  options: Options,
-  client: ApiClient,
-  branch: string,
-  checkNames: Set,
-) {
-  console.info(`Updating '${branch}'...`);
-
-  // Query the current set of required checks for this branch.
-  const currentContexts = await client.rest.repos.getAllStatusCheckContexts({
-    ...codeqlActionRepo,
-    branch,
-  });
-
-  // Identify which required checks we will remove and which ones we will add.
-  const currentCheckNames = new Set(currentContexts.data);
-  let additions = 0;
-  let removals = 0;
-  let unchanged = 0;
-
-  for (const currentCheck of currentCheckNames) {
-    if (!checkNames.has(currentCheck)) {
-      console.info(`- Removing '${currentCheck}' for branch '${branch}'`);
-      removals++;
-    } else {
-      unchanged++;
-    }
-  }
-  for (const newCheck of checkNames) {
-    if (!currentCheckNames.has(newCheck)) {
-      console.info(`+ Adding '${newCheck}' for branch '${branch}'`);
-      additions++;
-    }
-  }
-
-  console.info(
-    `For '${branch}': ${removals} removals; ${additions} additions; ${unchanged} unchanged`,
-  );
-
-  // Perform the update if there are changes and `--apply` was specified.
-  if (unchanged === checkNames.size && removals === 0 && additions === 0) {
-    console.info("Not applying changes because there is nothing to do.");
-  } else if (options.apply) {
-    await patchBranchProtectionRule(client, branch, checkNames);
-  } else {
-    console.info("Not applying changes because `--apply` was not specified.");
-  }
-}
-
-async function main(): Promise {
-  const { values: options } = parseArgs({
-    options: {
-      // Read the token to use to authenticate to the API from standard input.
-      "token-stdin": {
-        type: "boolean",
-        default: false,
-      },
-      // The git ref for which to retrieve the check runs.
-      ref: {
-        type: "string",
-        default: "main",
-      },
-      // By default, we perform a dry-run. Setting `apply` to `true` actually applies the changes.
-      apply: {
-        type: "boolean",
-        default: false,
-      },
-      // Whether to output additional information.
-      verbose: {
-        type: "boolean",
-        default: false,
-      },
-    },
-    strict: true,
-  });
-
-  const token = await resolveToken({
-    tokenStdin: options["token-stdin"],
-  });
-
-  console.info(
-    `Oldest supported major version is: ${OLDEST_SUPPORTED_MAJOR_VERSION}`,
-  );
-
-  // Initialise the API client.
-  const client = getApiClient(token);
-
-  // Find the check runs for the specified `ref` that we will later set as the required checks
-  // for the main and release branches.
-  const checkInfos = await getChecksFor(options, client, options.ref);
-  const checkNames = new Set(checkInfos.map((info) => info.context));
-
-  // Update the main branch.
-  await updateBranch(options, client, "main", checkNames);
-
-  // Retrieve the refs of the release branches.
-  const releaseBranches = await getReleaseBranches(client);
-  console.info(
-    `Found ${releaseBranches.length} release branches: ${releaseBranches.join(", ")}`,
-  );
-
-  for (const releaseBranchRef of releaseBranches) {
-    // Sanity check that the ref name is in the expected format and extract the major version.
-    const releaseBranchMatch = releaseBranchRef.match(
-      /^refs\/heads\/(releases\/v(\d+))/,
-    );
-    if (!releaseBranchMatch) {
-      console.warn(
-        `Branch ref '${releaseBranchRef}' not in the expected format.`,
-      );
-      continue;
-    }
-    const releaseBranch = releaseBranchMatch[1];
-    const releaseBranchMajor = Number.parseInt(releaseBranchMatch[2]);
-
-    // Update the required checks for this major version if it is still supported.
-    if (releaseBranchMajor < OLDEST_SUPPORTED_MAJOR_VERSION) {
-      console.info(
-        `Skipping '${releaseBranch}' since it is older than v${OLDEST_SUPPORTED_MAJOR_VERSION}`,
-      );
-      continue;
-    } else {
-      await updateBranch(options, client, releaseBranch, checkNames);
-    }
-  }
-
-  process.exit(0);
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  void main();
-}
diff --git a/pr-checks/sync.sh b/pr-checks/sync.sh
deleted file mode 100755
index c059594493..0000000000
--- a/pr-checks/sync.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-set -e
-
-cd "$(dirname "$0")"
-
-# Run `npm ci` in CI or `npm install` otherwise.
-if [ "$GITHUB_ACTIONS" = "true" ]; then
-  echo "In Actions, running 'npm ci' for 'sync.ts'..."
-  npm ci
-else
-  echo "Running 'npm install' for 'sync.ts'..."
-  npm install --no-audit --no-fund
-fi
-
-npx tsx sync.ts
diff --git a/pr-checks/sync.ts b/pr-checks/sync.ts
deleted file mode 100755
index 9dcce16fe5..0000000000
--- a/pr-checks/sync.ts
+++ /dev/null
@@ -1,849 +0,0 @@
-#!/usr/bin/env npx tsx
-
-import * as fs from "fs";
-import * as path from "path";
-
-import * as yaml from "yaml";
-
-import { BuiltInLanguage } from "../src/languages";
-
-/**
- * Returns a `uses` value for `action` pinned to a commit SHA, with the
- * human-readable version recorded in a trailing comment.
- */
-function pinnedUses(action: string, sha: string, version: string): yaml.Scalar {
-  const node = new yaml.Scalar(`${action}@${sha}`);
-  node.comment = ` ${version}`;
-  return node;
-}
-
-/** Known workflow input names. */
-enum KnownInputName {
-  GoVersion = "go-version",
-  JavaVersion = "java-version",
-  PythonVersion = "python-version",
-  DotnetVersion = "dotnet-version",
-}
-
-/**
- * Represents workflow input definitions.
- */
-interface WorkflowInput {
-  type: string;
-  description: string;
-  required: boolean;
-  default: string;
-}
-
-/** A partial mapping from known input names to input definitions. */
-type WorkflowInputs = Partial>;
-
-/** An operating system identifier. */
-type OperatingSystemIdentifier = "ubuntu" | "macos" | "windows";
-
-/**
- * Represents an operating system matrix entry for a generated PR check workflow.
- *
- * Either a string containing the OS identifier or an object containing the OS identifier and an
- * optional runner image label.
- */
-type OperatingSystem =
-  | OperatingSystemIdentifier
-  | {
-      /** OS identifier. */
-      os: OperatingSystemIdentifier;
-      /** Optional runner image label. */
-      "runner-image"?: string;
-      /**
-       * Optional CodeQL versions to run on this entry. If specified, this entry runs only these
-       * versions. A sibling entry for the same OS that omits `codeql-versions` runs all versions
-       * not claimed by any sibling entry. This allows pinning specific CodeQL versions to a
-       * particular runner image while letting the remaining versions default to another.
-       */
-      "codeql-versions"?: string[];
-    };
-
-/**
- * Represents PR check specifications.
- */
-interface Specification extends JobSpecification {
-  /** Workflow-level input definitions forwarded to `workflow_dispatch`/`workflow_call`. */
-  inputs?: Record;
-  /** CodeQL bundle versions to test against. Defaults to `DEFAULT_TEST_VERSIONS`. */
-  versions?: string[];
-  /** Operating system prefixes, either as strings or with explicit runner image labels. */
-  operatingSystems?: OperatingSystem[];
-  /** Per-OS version overrides. If specified for an OS, only those versions are tested on that OS. */
-  osCodeQlVersions?: Record;
-  /** Whether to use the all-platform CodeQL bundle. */
-  useAllPlatformBundle?: string;
-  /** Values for the `analysis-kinds` matrix dimension. */
-  analysisKinds?: string[];
-
-  /** Container image configuration for the job. */
-  container?: any;
-  /** Service containers for the job. */
-  services?: any;
-
-  /** Additional jobs to run after the main PR check job. */
-  validationJobs?: Record;
-
-  /** If set, this check is part of a named collection that gets its own caller workflow. */
-  collection?: string;
-}
-
-/** Minimal type to represent steps in Actions workflows. */
-interface Step {
-  name?: string;
-  [other: string]: any;
-}
-
-/** Represents job specifications. */
-interface JobSpecification {
-  /** The display name for the check. */
-  name: string;
-  /** Custom permissions override for the job. */
-  permissions?: Record;
-  /** Extra environment variables for the job. */
-  env?: Record;
-
-  /** The workflow steps specific to this check. */
-  steps: Step[];
-
-  installNode?: boolean;
-  installGo?: boolean;
-  installJava?: boolean;
-  installPython?: boolean;
-  installDotNet?: boolean;
-  installYq?: boolean;
-}
-
-/** Describes language/framework-specific steps and inputs. */
-interface LanguageSetup {
-  specProperty: keyof JobSpecification;
-  /** The names of the known inputs which are required for this setup step. */
-  inputs?: KnownInputName[];
-  steps: Step[];
-}
-
-/** Describes partial mappings from built-in languages to their specific setup information. */
-type LanguageSetups = Partial>;
-
-// The default set of CodeQL Bundle versions to use for the PR checks.
-const defaultTestVersions = [
-  // The oldest supported CodeQL version. If bumping, update `CODEQL_MINIMUM_VERSION` in `codeql.ts`
-  "stable-v2.19.4",
-  // The last CodeQL release in the 2.20 series.
-  "stable-v2.20.7",
-  // The last CodeQL release in the 2.21 series.
-  "stable-v2.21.4",
-  // The last CodeQL release in the 2.22 series.
-  "stable-v2.22.4",
-  // The last CodeQL release in the 2.23 series.
-  "stable-v2.23.9",
-  // The last CodeQL release in the 2.24 series.
-  "stable-v2.24.3",
-  // The default version of CodeQL for Dotcom, as determined by feature flags.
-  "default",
-  // The version of CodeQL shipped with the Action in `defaults.json`. During the release process
-  // for a new CodeQL release, there will be a period of time during which this will be newer than
-  // the default version on Dotcom.
-  "linked",
-  // A nightly build directly from the our private repo, built in the last 24 hours.
-  "nightly-latest",
-];
-
-/** The default versions we use for languages / frameworks, if not specified as a workflow input. */
-const defaultLanguageVersions = {
-  javascript: "20.x",
-  go: ">=1.21.0",
-  java: "17",
-  python: "3.13",
-  csharp: "9.x",
-} as const satisfies Partial>;
-
-/** A mapping from known input names to their specifications. */
-const inputSpecs: WorkflowInputs = {
-  [KnownInputName.GoVersion]: {
-    type: "string",
-    description: "The version of Go to install",
-    required: false,
-    default: defaultLanguageVersions.go,
-  },
-  [KnownInputName.JavaVersion]: {
-    type: "string",
-    description: "The version of Java to install",
-    required: false,
-    default: defaultLanguageVersions.java,
-  },
-  [KnownInputName.PythonVersion]: {
-    type: "string",
-    description: "The version of Python to install",
-    required: false,
-    default: defaultLanguageVersions.python,
-  },
-  [KnownInputName.DotnetVersion]: {
-    type: "string",
-    description: "The version of .NET to install",
-    required: false,
-    default: defaultLanguageVersions.csharp,
-  },
-};
-
-/** Obtains a `WorkflowInputs` object for all the inputs given by `requiredInputs`. */
-function getSetupInputs(requiredInputs: Set): WorkflowInputs {
-  const inputs: WorkflowInputs = {};
-
-  // Copy the input specifications for the requested inputs into the output.
-  for (const requiredInput of requiredInputs) {
-    inputs[requiredInput] = inputSpecs[requiredInput];
-  }
-
-  return inputs;
-}
-
-/** A partial mapping from known languages to their specific setup information. */
-const languageSetups: LanguageSetups = {
-  javascript: {
-    specProperty: "installNode",
-    steps: [
-      {
-        name: "Install Node.js",
-        uses: pinnedUses(
-          "actions/setup-node",
-          "820762786026740c76f36085b0efc47a31fe5020",
-          "v7.0.0",
-        ),
-        with: {
-          "node-version": defaultLanguageVersions.javascript,
-          cache: "npm",
-        },
-      },
-      {
-        name: "Install dependencies",
-        run: "npm ci",
-      },
-    ],
-  },
-  go: {
-    specProperty: "installGo",
-    inputs: [KnownInputName.GoVersion],
-    steps: [
-      {
-        name: "Install Go",
-        uses: pinnedUses(
-          "actions/setup-go",
-          "b7ad1dad31e06c5925ef5d2fc7ad053ef454303e",
-          "v7.0.0",
-        ),
-        with: {
-          "go-version": `\${{ inputs.go-version || '${defaultLanguageVersions.go}' }}`,
-          // to avoid potentially misleading autobuilder results where we expect it to download
-          // dependencies successfully, but they actually come from a warm cache
-          cache: false,
-        },
-      },
-    ],
-  },
-  java: {
-    specProperty: "installJava",
-    inputs: [KnownInputName.JavaVersion],
-    steps: [
-      {
-        name: "Install Java",
-        uses: pinnedUses(
-          "actions/setup-java",
-          "b6effb05e454b25005698d916606bdc6ffcbf961",
-          "v5.7.0",
-        ),
-        with: {
-          "java-version": `\${{ inputs.java-version || '${defaultLanguageVersions.java}' }}`,
-          distribution: "temurin",
-        },
-      },
-    ],
-  },
-  python: {
-    specProperty: "installPython",
-    inputs: [KnownInputName.PythonVersion],
-    steps: [
-      {
-        name: "Install Python",
-        uses: pinnedUses(
-          "actions/setup-python",
-          "5fda3b95a4ea91299a34e894583c3862153e4b97",
-          "v7.0.0",
-        ),
-        with: {
-          "python-version": `\${{ inputs.python-version || '${defaultLanguageVersions.python}' }}`,
-        },
-      },
-    ],
-  },
-  csharp: {
-    specProperty: "installDotNet",
-    inputs: [KnownInputName.DotnetVersion],
-    steps: [
-      {
-        name: "Install .NET",
-        uses: pinnedUses(
-          "actions/setup-dotnet",
-          "a98b56852c35b8e3190ac28c8c2271da59106c68",
-          "v6.0.0",
-        ),
-        with: {
-          "dotnet-version": `\${{ inputs.dotnet-version || '${defaultLanguageVersions.csharp}' }}`,
-        },
-      },
-    ],
-  },
-};
-
-// This is essentially an arbitrary version of `yq`, which happened to be the one that
-// `choco` fetched when we moved away from using that here.
-// See https://github.com/github/codeql-action/pull/3423
-const YQ_VERSION = "v4.50.1";
-
-const THIS_DIR = __dirname;
-const CHECKS_DIR = path.join(THIS_DIR, "checks");
-const OUTPUT_DIR = path.join(THIS_DIR, "..", ".github", "workflows");
-
-/**
- * Loads and parses a YAML file.
- */
-function loadYaml(filePath: string): yaml.Document {
-  const content = fs.readFileSync(filePath, "utf8");
-  return yaml.parseDocument(content);
-}
-
-/** Computes the union of all given `sets`. */
-function unionAll(sets: Array>): Set {
-  return sets.reduce((prev, cur) => prev.union(cur), new Set());
-}
-
-/**
- * Serialize a value to YAML and write it to a file, prepended with the
- * standard header comment.
- */
-function writeYaml(filePath: string, workflow: any): void {
-  const header = `# Warning: This file is generated automatically, and should not be modified.
-# Instead, please modify the template in the pr-checks directory and run:
-#     pr-checks/sync.sh
-# to regenerate this file.
-
-`;
-  const workflowDoc = new yaml.Document(workflow, {
-    aliasDuplicateObjects: false,
-  });
-  const yamlStr = yaml.stringify(workflowDoc, {
-    aliasDuplicateObjects: false,
-    singleQuote: true,
-    lineWidth: 0,
-  });
-  fs.writeFileSync(filePath, stripTrailingWhitespace(header + yamlStr), "utf8");
-}
-
-/**
- * Strip trailing whitespace from each line.
- */
-function stripTrailingWhitespace(content: string): string {
-  return content
-    .split("\n")
-    .map((line) => line.trimEnd())
-    .join("\n");
-}
-
-/** Generates the matrix for a job. */
-function generateJobMatrix(
-  checkSpecification: Specification,
-): Array> {
-  let matrix: Array> = [];
-
-  const operatingSystems = checkSpecification.operatingSystems ?? ["ubuntu"];
-
-  // For each OS, collect the CodeQL versions explicitly claimed by entries that specify
-  // `codeql-versions`. A sibling entry for the same OS that omits `codeql-versions` runs all
-  // versions not in this set.
-  const claimedVersionsByOs = new Map>();
-  for (const operatingSystemConfig of operatingSystems) {
-    if (typeof operatingSystemConfig === "string") {
-      continue;
-    }
-    const entryVersions = operatingSystemConfig["codeql-versions"];
-    if (!entryVersions) {
-      continue;
-    }
-    const claimed =
-      claimedVersionsByOs.get(operatingSystemConfig.os) ?? new Set();
-    for (const entryVersion of entryVersions) {
-      claimed.add(entryVersion);
-    }
-    claimedVersionsByOs.set(operatingSystemConfig.os, claimed);
-  }
-
-  for (const version of checkSpecification.versions ?? defaultTestVersions) {
-    if (version === "latest") {
-      throw new Error(
-        `Did not recognise "version: ${version}". Did you mean "version: linked"?`,
-      );
-    }
-
-    const defaultRunnerImages = [
-      "ubuntu-latest",
-      "macos-latest",
-      "windows-latest",
-    ];
-
-    for (const operatingSystemConfig of operatingSystems) {
-      const operatingSystem =
-        typeof operatingSystemConfig === "string"
-          ? operatingSystemConfig
-          : operatingSystemConfig.os;
-
-      // If osCodeQlVersions is set for this OS, only include the specified CodeQL versions.
-      const allowedVersions =
-        checkSpecification.osCodeQlVersions?.[operatingSystem];
-      if (allowedVersions && !allowedVersions.includes(version)) {
-        continue;
-      }
-
-      // An entry that specifies `codeql-versions` runs only those versions. A sibling entry for
-      // the same OS that omits `codeql-versions` runs all versions not claimed by its siblings.
-      const entryVersions =
-        typeof operatingSystemConfig === "string"
-          ? undefined
-          : operatingSystemConfig["codeql-versions"];
-      const runsThisVersion = entryVersions
-        ? entryVersions.includes(version)
-        : !claimedVersionsByOs.get(operatingSystem)?.has(version);
-      if (!runsThisVersion) {
-        continue;
-      }
-
-      const runnerImagesForOs =
-        typeof operatingSystemConfig === "string" ||
-        operatingSystemConfig["runner-image"] === undefined
-          ? defaultRunnerImages.filter((image) =>
-              image.startsWith(operatingSystem),
-            )
-          : [operatingSystemConfig["runner-image"]];
-
-      for (const runnerImage of runnerImagesForOs) {
-        matrix.push({
-          os: runnerImage,
-          version,
-        });
-      }
-    }
-  }
-
-  if (checkSpecification.analysisKinds) {
-    const newMatrix: Array> = [];
-    for (const matrixInclude of matrix) {
-      for (const analysisKind of checkSpecification.analysisKinds) {
-        newMatrix.push({
-          ...matrixInclude,
-          "analysis-kinds": analysisKind,
-        });
-      }
-    }
-    matrix = newMatrix;
-  }
-
-  return matrix;
-}
-
-/**
- * Retrieves setup steps and additional input definitions based on specific languages or frameworks
- * that are requested by the `checkSpecification`.
- *
- * @returns An object containing setup steps and required input names.
- */
-function getSetupSteps(checkSpecification: JobSpecification): {
-  inputs: Set;
-  steps: Step[];
-} {
-  const inputs: Array> = [];
-  const steps: Step[] = [];
-
-  for (const language of Object.values(BuiltInLanguage).sort()) {
-    const setupSpec = languageSetups[language];
-
-    if (
-      setupSpec === undefined ||
-      checkSpecification[setupSpec.specProperty] !== true
-    ) {
-      continue;
-    }
-
-    steps.push(...setupSpec.steps);
-    inputs.push(new Set(setupSpec.inputs));
-  }
-
-  const installYq = checkSpecification.installYq;
-
-  if (installYq) {
-    steps.push({
-      name: "Install yq",
-      if: "runner.os == 'Windows'",
-      env: {
-        YQ_PATH: "${{ runner.temp }}/yq",
-        YQ_VERSION,
-      },
-      run:
-        'gh release download --repo mikefarah/yq --pattern "yq_windows_amd64.exe" "$YQ_VERSION" -O "$YQ_PATH/yq.exe"\n' +
-        'echo "$YQ_PATH" >> "$GITHUB_PATH"',
-    });
-  }
-
-  return { inputs: unionAll(inputs), steps };
-}
-
-/**
- * Generates an Actions job from the `checkSpecification`.
- *
- * @param specDocument
- * The raw YAML document of the PR check specification.
- * Used to extract `jobs` without losing the original formatting.
- * @param checkSpecification The PR check specification.
- * @returns The job and additional workflow inputs.
- */
-function generateJob(
-  specDocument: yaml.Document,
-  checkSpecification: Specification,
-) {
-  const matrix: Array> =
-    generateJobMatrix(checkSpecification);
-
-  const useAllPlatformBundle = checkSpecification.useAllPlatformBundle
-    ? checkSpecification.useAllPlatformBundle
-    : "false";
-
-  // Determine which languages or frameworks have to be installed.
-  const setupInfo = getSetupSteps(checkSpecification);
-  const workflowInputs = setupInfo.inputs;
-
-  // Construct the workflow steps needed for this check.
-  const steps: Step[] = [
-    {
-      name: "Check out repository",
-      uses: pinnedUses(
-        "actions/checkout",
-        "3d3c42e5aac5ba805825da76410c181273ba90b1",
-        "v7.0.1",
-      ),
-    },
-    ...setupInfo.steps,
-    {
-      name: "Prepare test",
-      id: "prepare-test",
-      uses: "./.github/actions/prepare-test",
-      with: {
-        version: "${{ matrix.version }}",
-        "use-all-platform-bundle": useAllPlatformBundle,
-        // If the action is being run from a container, then do not setup kotlin.
-        // This is because the kotlin binaries cannot be downloaded from the container.
-        "setup-kotlin": "container" in checkSpecification ? "false" : "true",
-      },
-    },
-  ];
-
-  // Extract the sequence of steps from the YAML document to persist as much formatting as possible.
-  const specSteps = specDocument.get("steps") as yaml.YAMLSeq;
-
-  // A handful of workflow specifications use double quotes for values, while we generally use single quotes.
-  // This replaces double quotes with single quotes for consistency.
-  yaml.visit(specSteps, {
-    Scalar(_key, node) {
-      if (node.type === "QUOTE_DOUBLE") {
-        node.type = "QUOTE_SINGLE";
-      }
-    },
-  });
-
-  // Add the generated steps in front of the ones from the specification.
-  specSteps.items.unshift(...steps);
-
-  const checkJob: Record = {
-    strategy: {
-      "fail-fast": false,
-      matrix: {
-        include: matrix,
-      },
-    },
-    name: checkSpecification.name,
-    if: "github.triggering_actor != 'dependabot[bot]'",
-    permissions: {
-      contents: "read",
-      "security-events": "read",
-    },
-    "timeout-minutes": 45,
-    "runs-on": "${{ matrix.os }}",
-    steps: specSteps,
-  };
-
-  if (checkSpecification.permissions) {
-    checkJob.permissions = checkSpecification.permissions;
-  }
-
-  for (const key of ["env", "container", "services"] as const) {
-    if (checkSpecification[key] !== undefined) {
-      checkJob[key] = checkSpecification[key];
-    }
-  }
-
-  checkJob.env = checkJob.env ?? {};
-  if (!("CODEQL_ACTION_TEST_MODE" in checkJob.env)) {
-    checkJob.env.CODEQL_ACTION_TEST_MODE = true;
-  }
-
-  return { checkJob, workflowInputs };
-}
-
-/** Generates a validation job. */
-function generateValidationJob(
-  specDocument: yaml.Document,
-  jobSpecification: JobSpecification,
-  checkName: string,
-  name: string,
-) {
-  // Determine which languages or frameworks have to be installed.
-  const { inputs, steps } = getSetupSteps(jobSpecification);
-
-  // Extract the sequence of steps from the YAML document to persist as much formatting as possible.
-  const specSteps = specDocument.getIn([
-    "validationJobs",
-    name,
-    "steps",
-  ]) as yaml.YAMLSeq;
-
-  // Add the generated steps in front of the ones from the specification.
-  specSteps.items.unshift(...steps);
-
-  const validationJob: Record = {
-    name: jobSpecification.name,
-    if: "github.triggering_actor != 'dependabot[bot]'",
-    needs: [checkName],
-    permissions: {
-      contents: "read",
-      "security-events": "read",
-    },
-    "timeout-minutes": 5,
-    "runs-on": "ubuntu-slim",
-    steps: specSteps,
-  };
-
-  if (jobSpecification.permissions) {
-    validationJob.permissions = jobSpecification.permissions;
-  }
-
-  for (const key of ["env"] as const) {
-    if (jobSpecification[key] !== undefined) {
-      validationJob[key] = jobSpecification[key];
-    }
-  }
-
-  validationJob.env = validationJob.env ?? {};
-  if (!("CODEQL_ACTION_TEST_MODE" in validationJob.env)) {
-    validationJob.env.CODEQL_ACTION_TEST_MODE = true;
-  }
-
-  return { validationJob, inputs };
-}
-
-/** Generates additional jobs that run after the main check job, based on the `validationJobs` property. */
-function generateValidationJobs(
-  specDocument: yaml.Document,
-  checkSpecification: Specification,
-  checkName: string,
-): {
-  validationJobs: Record;
-  workflowInputs: Set;
-} {
-  if (checkSpecification.validationJobs === undefined) {
-    return { validationJobs: {}, workflowInputs: new Set() };
-  }
-
-  const validationJobs: Record = {};
-  const workflowInputs: Array> = [];
-
-  for (const [jobName, jobSpec] of Object.entries(
-    checkSpecification.validationJobs,
-  )) {
-    if (checkName === jobName) {
-      throw new Error(
-        `Validation job '${jobName}' cannot have the same name as the main job.`,
-      );
-    }
-
-    const { validationJob, inputs } = generateValidationJob(
-      specDocument,
-      jobSpec,
-      checkName,
-      jobName,
-    );
-    validationJobs[jobName] = validationJob;
-    workflowInputs.push(inputs);
-  }
-
-  return {
-    validationJobs,
-    workflowInputs: unionAll(workflowInputs),
-  };
-}
-
-/**
- * Main entry point for the sync script.
- */
-function main(): void {
-  // Ensure the output directory exists.
-  fs.mkdirSync(OUTPUT_DIR, { recursive: true });
-
-  // Discover and sort all check specification files.
-  const checkFiles = fs
-    .readdirSync(CHECKS_DIR)
-    .filter((f) => f.endsWith(".yml"))
-    .sort()
-    .map((f) => path.join(CHECKS_DIR, f));
-
-  console.log(`Found ${checkFiles.length} check specification(s).`);
-
-  const collections: Record<
-    string,
-    Array<{
-      specification: Specification;
-      checkName: string;
-      inputs: Record;
-    }>
-  > = {};
-
-  for (const file of checkFiles) {
-    const checkName = path.basename(file, ".yml");
-    const specDocument = loadYaml(file);
-    const checkSpecification = specDocument.toJS() as Specification;
-
-    console.log(`Processing: ${checkName} — "${checkSpecification.name}"`);
-
-    const { checkJob, workflowInputs } = generateJob(
-      specDocument,
-      checkSpecification,
-    );
-    const { validationJobs, workflowInputs: validationJobInputs } =
-      generateValidationJobs(specDocument, checkSpecification, checkName);
-    const combinedInputs = getSetupInputs(
-      workflowInputs.union(validationJobInputs),
-    );
-
-    // If this check belongs to a named collection, record it.
-    if (checkSpecification.collection) {
-      const collectionName = checkSpecification.collection;
-      if (!collections[collectionName]) {
-        collections[collectionName] = [];
-      }
-      collections[collectionName].push({
-        specification: checkSpecification,
-        checkName,
-        inputs: combinedInputs,
-      });
-    }
-
-    let extraGroupName = "";
-    for (const inputName of Object.keys(combinedInputs)) {
-      extraGroupName += `-\${{inputs.${inputName}}}`;
-    }
-
-    const cron = new yaml.Scalar("0 5 * * *");
-    cron.type = yaml.Scalar.QUOTE_SINGLE;
-
-    const workflow = {
-      name: `PR Check - ${checkSpecification.name}`,
-      env: {
-        GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
-        GO111MODULE: "auto",
-      },
-      on: {
-        push: {
-          branches: ["main", "releases/v*"],
-        },
-        pull_request: {},
-        merge_group: {
-          types: ["checks_requested"],
-        },
-        schedule: [{ cron }],
-        workflow_dispatch: {
-          inputs: combinedInputs,
-        },
-        workflow_call: {
-          inputs: combinedInputs,
-        },
-      },
-      defaults: {
-        run: {
-          shell: "bash",
-        },
-      },
-      concurrency: {
-        "cancel-in-progress":
-          "${{ github.event_name == 'pull_request' || false }}",
-        group: `${checkName}-\${{github.ref}}${extraGroupName}`,
-      },
-      jobs: {
-        [checkName]: checkJob,
-        ...validationJobs,
-      },
-    };
-
-    const outputPath = path.join(OUTPUT_DIR, `__${checkName}.yml`);
-    writeYaml(outputPath, workflow);
-  }
-
-  // Write workflow files for collections.
-  for (const collectionName of Object.keys(collections)) {
-    const jobs: Record = {};
-    let combinedInputs: Record = {};
-
-    for (const check of collections[collectionName]) {
-      const { checkName, specification, inputs: checkInputs } = check;
-      const checkWith: Record = {};
-
-      combinedInputs = { ...combinedInputs, ...checkInputs };
-
-      for (const inputName of Object.keys(checkInputs)) {
-        checkWith[inputName] = `\${{ inputs.${inputName} }}`;
-      }
-
-      jobs[checkName] = {
-        name: specification.name,
-        permissions: {
-          contents: "read",
-          "security-events": "read",
-        },
-        uses: `./.github/workflows/__${checkName}.yml`,
-        with: checkWith,
-      };
-    }
-
-    const collectionWorkflow = {
-      name: `Manual Check - ${collectionName}`,
-      env: {
-        GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
-        GO111MODULE: "auto",
-      },
-      on: {
-        workflow_dispatch: {
-          inputs: combinedInputs,
-        },
-      },
-      jobs,
-    };
-
-    const outputPath = path.join(OUTPUT_DIR, `__${collectionName}.yml`);
-    writeYaml(outputPath, collectionWorkflow);
-  }
-
-  console.log(
-    `\nDone. Wrote ${checkFiles.length} workflow file(s) to ${OUTPUT_DIR}`,
-  );
-}
-
-main();
diff --git a/pr-checks/tsconfig.json b/pr-checks/tsconfig.json
deleted file mode 100644
index b010827cf5..0000000000
--- a/pr-checks/tsconfig.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "extends": "../tsconfig.json",
-  "compilerOptions": {
-    /* Basic Options */
-    "lib": ["esnext"],
-    "module": "preserve",
-    "rootDir": "..",
-    "sourceMap": false,
-    "noEmit": true,
-  },
-  "include": ["./*.ts", "../src/**/*.ts"],
-  "exclude": ["node_modules"]
-}
diff --git a/pr-checks/update-builtin-languages.ts b/pr-checks/update-builtin-languages.ts
deleted file mode 100644
index a7be6ed36f..0000000000
--- a/pr-checks/update-builtin-languages.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/*
- * Updates src/languages/builtin.json by querying the CodeQL CLI for:
- * - Languages that have default queries (via codeql-extractor.yml)
- * - Language aliases (via `codeql resolve languages --format=betterjson --extractor-include-aliases`)
- *
- * Usage:
- *   npx tsx pr-checks/update-builtin-languages.ts [path-to-codeql]
- *
- * If no path is given, falls back to "codeql".
- */
-
-import { execFileSync } from "node:child_process";
-import * as fs from "node:fs";
-import * as path from "node:path";
-
-import * as yaml from "yaml";
-
-import { EnvVar } from "../src/environment";
-
-import { BUILTIN_LANGUAGES_FILE } from "./config";
-
-/** Resolve all known language extractor directories. */
-function resolveLanguages(codeqlPath: string): Record {
-  return JSON.parse(
-    execFileSync(codeqlPath, ["resolve", "languages", "--format=json"], {
-      encoding: "utf8",
-      env: {
-        ...process.env,
-        [EnvVar.EXPERIMENTAL_FEATURES]: "true", // include experimental languages
-      },
-    }),
-  ) as Record;
-}
-
-/**
- * Return the sorted list of languages whose extractors ship default queries.
- *
- * @param extractorDirs - Map from language to list of extractor directories
- */
-function findLanguagesWithDefaultQueries(
-  extractorDirs: Record,
-): string[] {
-  const languages: string[] = [];
-
-  for (const [language, dirs] of Object.entries(extractorDirs)) {
-    if (dirs.length !== 1) {
-      throw new Error(
-        `Expected exactly one extractor directory for language '${language}', but found ${dirs.length}: ${dirs.join(
-          ", ",
-        )}`,
-      );
-    }
-
-    const extractorYmlPath = path.join(dirs[0], "codeql-extractor.yml");
-
-    if (!fs.existsSync(extractorYmlPath)) {
-      throw new Error(
-        `Extractor YAML not found for language '${language}' at expected path: ${extractorYmlPath}`,
-      );
-    }
-
-    const extractorYml = yaml.parse(fs.readFileSync(extractorYmlPath, "utf8"));
-    const defaultQueries: unknown[] | undefined = extractorYml.default_queries;
-
-    if (Array.isArray(defaultQueries) && defaultQueries.length > 0) {
-      console.log(
-        `  ✅ ${language}: included (default queries: ${JSON.stringify(defaultQueries)})`,
-      );
-      languages.push(language);
-    } else {
-      console.log(`  ❌ ${language}: excluded (no default queries)`);
-    }
-  }
-
-  return languages.sort();
-}
-
-/**
- * Resolve language aliases from the CodeQL CLI, keeping only those whose
- * target is in the given set of included languages.
- */
-function resolveAliases(
-  codeqlPath: string,
-  includedLanguages: Set,
-): Record {
-  const betterjsonOutput = JSON.parse(
-    execFileSync(
-      codeqlPath,
-      [
-        "resolve",
-        "languages",
-        "--format=betterjson",
-        "--extractor-include-aliases",
-      ],
-      { encoding: "utf8" },
-    ),
-  );
-
-  return Object.fromEntries(
-    Object.entries((betterjsonOutput.aliases ?? {}) as Record)
-      .filter(([, target]) => includedLanguages.has(target))
-      .sort(([a], [b]) => a.localeCompare(b)),
-  );
-}
-
-/** Write the built-in languages data to disk. */
-function writeBuiltinLanguages(
-  languages: string[],
-  aliases: Record,
-): void {
-  const content = `${JSON.stringify({ languages, aliases }, null, 2)}\n`;
-  fs.mkdirSync(path.dirname(BUILTIN_LANGUAGES_FILE), { recursive: true });
-  fs.writeFileSync(BUILTIN_LANGUAGES_FILE, content);
-
-  console.log(`\nWrote ${BUILTIN_LANGUAGES_FILE}`);
-  console.log(`  Languages: ${languages.join(", ")}`);
-  console.log(`  Aliases: ${Object.keys(aliases).join(", ")}`);
-}
-
-function main(): void {
-  const codeqlPath = process.argv[2] || "codeql";
-
-  const extractorDirs = resolveLanguages(codeqlPath);
-  const languages = findLanguagesWithDefaultQueries(extractorDirs);
-  const aliases = resolveAliases(codeqlPath, new Set(languages));
-  writeBuiltinLanguages(languages, aliases);
-}
-
-main();
diff --git a/pr-checks/update-ghes-versions.test.ts b/pr-checks/update-ghes-versions.test.ts
deleted file mode 100644
index 187c067c37..0000000000
--- a/pr-checks/update-ghes-versions.test.ts
+++ /dev/null
@@ -1,204 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/*
- * Tests for the update-ghes-versions.ts script
- */
-
-import * as assert from "node:assert/strict";
-import { describe, it } from "node:test";
-
-import {
-  addWeeks,
-  determineSupportedRange,
-  type EnterpriseReleases,
-  parseEnterpriseVersion,
-  printEnterpriseVersion,
-} from "./update-ghes-versions";
-
-describe("parseEnterpriseVersion", async () => {
-  await it("parses a two-component version string", () => {
-    const ver = parseEnterpriseVersion("3.10");
-    assert.notEqual(ver, null);
-    assert.equal(ver!.major, 3);
-    assert.equal(ver!.minor, 10);
-    assert.equal(ver!.patch, 0);
-  });
-
-  await it("parses a three-component version string", () => {
-    const ver = parseEnterpriseVersion("3.10.2");
-    assert.notEqual(ver, null);
-    assert.equal(ver!.major, 3);
-    assert.equal(ver!.minor, 10);
-    assert.equal(ver!.patch, 2);
-  });
-
-  await it("returns null for invalid input", () => {
-    assert.equal(parseEnterpriseVersion("not-a-version"), null);
-  });
-});
-
-describe("printEnterpriseVersion", async () => {
-  await it("prints only major.minor when patch is 0", () => {
-    const ver = parseEnterpriseVersion("3.10")!;
-    assert.equal(printEnterpriseVersion(ver), "3.10");
-  });
-
-  await it("includes patch when non-zero", () => {
-    const ver = parseEnterpriseVersion("3.10.2")!;
-    assert.equal(printEnterpriseVersion(ver), "3.10.2");
-  });
-});
-
-describe("addWeeks", async () => {
-  await it("adds weeks to a date", () => {
-    const date = new Date("2025-01-01T00:00:00Z");
-    const result = addWeeks(date, 2);
-    assert.equal(result.toISOString(), "2025-01-15T00:00:00.000Z");
-  });
-
-  await it("does not mutate the original date", () => {
-    const date = new Date("2025-01-01T00:00:00Z");
-    addWeeks(date, 2);
-    assert.equal(date.toISOString(), "2025-01-01T00:00:00.000Z");
-  });
-});
-
-/**
- * Helper to build a release entry with a feature freeze and end-of-life date.
- * Dates are ISO date strings (e.g. "2025-06-01").
- */
-function release(featureFreeze: string, end: string) {
-  return { feature_freeze: featureFreeze, end };
-}
-
-describe("determineSupportedRange", async () => {
-  // A fixed "today" for deterministic tests.
-  const today = new Date("2025-06-15");
-
-  const farPastEnd = "2020-01-01";
-  const farFutureEnd = "2099-12-31";
-  const farPastFreeze = "2020-01-01";
-  const farFutureFreeze = "2099-12-31";
-
-  await it("returns the only supported release as both min and max", () => {
-    const releases: EnterpriseReleases = {
-      "3.10": release(farPastFreeze, farFutureEnd),
-    };
-    const result = determineSupportedRange(
-      today,
-      { minimumVersion: "3.10", maximumVersion: "3.10" },
-      releases,
-    );
-    assert.equal(result.minimumVersion, "3.10");
-    assert.equal(result.maximumVersion, "3.10");
-  });
-
-  await it("determines the range from multiple supported releases", () => {
-    const releases: EnterpriseReleases = {
-      "3.10": release(farPastFreeze, farFutureEnd),
-      "3.11": release(farPastFreeze, farFutureEnd),
-      "3.12": release(farPastFreeze, farFutureEnd),
-    };
-    const result = determineSupportedRange(
-      today,
-      { minimumVersion: "3.10", maximumVersion: "3.12" },
-      releases,
-    );
-    assert.equal(result.minimumVersion, "3.10");
-    assert.equal(result.maximumVersion, "3.12");
-  });
-
-  await it("drops an end-of-life release from the minimum", () => {
-    const releases: EnterpriseReleases = {
-      // 3.10 has been end of life for a long time.
-      "3.10": release(farPastFreeze, farPastEnd),
-      "3.11": release(farPastFreeze, farFutureEnd),
-      "3.12": release(farPastFreeze, farFutureEnd),
-    };
-    const result = determineSupportedRange(
-      today,
-      { minimumVersion: "3.10", maximumVersion: "3.12" },
-      releases,
-    );
-    assert.equal(result.minimumVersion, "3.11");
-    assert.equal(result.maximumVersion, "3.12");
-  });
-
-  await it("bumps the maximum when a newer release's feature freeze has passed", () => {
-    const releases: EnterpriseReleases = {
-      "3.10": release(farPastFreeze, farFutureEnd),
-      "3.11": release(farPastFreeze, farFutureEnd),
-      // 3.12 has a feature freeze far in the past, so it should be picked up.
-      "3.12": release(farPastFreeze, farFutureEnd),
-    };
-    const result = determineSupportedRange(
-      today,
-      // The stored maximum is 3.11, but 3.12 should be picked up.
-      { minimumVersion: "3.10", maximumVersion: "3.11" },
-      releases,
-    );
-    assert.equal(result.minimumVersion, "3.10");
-    assert.equal(result.maximumVersion, "3.12");
-  });
-
-  await it("does not bump the maximum when feature freeze is far in the future", () => {
-    const releases: EnterpriseReleases = {
-      "3.10": release(farPastFreeze, farFutureEnd),
-      "3.11": release(farPastFreeze, farFutureEnd),
-      // 3.12 has a feature freeze far in the future, so it should NOT be picked up.
-      "3.12": release(farFutureFreeze, farFutureEnd),
-    };
-    const result = determineSupportedRange(
-      today,
-      { minimumVersion: "3.10", maximumVersion: "3.11" },
-      releases,
-    );
-    assert.equal(result.minimumVersion, "3.10");
-    assert.equal(result.maximumVersion, "3.11");
-  });
-
-  await it("ignores releases older than the first supported release (2.22)", () => {
-    const releases: EnterpriseReleases = {
-      "2.21": release(farPastFreeze, farFutureEnd),
-      "3.10": release(farPastFreeze, farFutureEnd),
-      "3.11": release(farPastFreeze, farFutureEnd),
-    };
-    const result = determineSupportedRange(
-      today,
-      { minimumVersion: "3.10", maximumVersion: "3.11" },
-      releases,
-    );
-    // 2.21 is older than 2.22, so it should be ignored — 3.10 remains the minimum.
-    assert.equal(result.minimumVersion, "3.10");
-    assert.equal(result.maximumVersion, "3.11");
-  });
-
-  await it("throws when no supported releases remain", () => {
-    const releases: EnterpriseReleases = {
-      // All releases are end of life.
-      "3.10": release(farPastFreeze, farPastEnd),
-      "3.11": release(farPastFreeze, farPastEnd),
-    };
-    assert.throws(
-      () =>
-        determineSupportedRange(
-          today,
-          { minimumVersion: "3.10", maximumVersion: "3.11" },
-          releases,
-        ),
-      /Could not determine oldest supported release/,
-    );
-  });
-
-  await it("throws when maximumVersion is not a valid version", () => {
-    assert.throws(
-      () =>
-        determineSupportedRange(
-          today,
-          { minimumVersion: "3.10", maximumVersion: "invalid" },
-          {},
-        ),
-      /is not a valid semantic version/,
-    );
-  });
-});
diff --git a/pr-checks/update-ghes-versions.ts b/pr-checks/update-ghes-versions.ts
deleted file mode 100755
index 055424dff1..0000000000
--- a/pr-checks/update-ghes-versions.ts
+++ /dev/null
@@ -1,243 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/**
- * Updates src/api-compatibility.json with the current range of supported
- * GitHub Enterprise Server versions by reading the releases.json file from
- * an `enterprise-releases` checkout.
- */
-
-import * as fs from "node:fs";
-import * as path from "node:path";
-
-import { type SemVer } from "semver";
-import * as semver from "semver";
-
-import * as json from "../src/json";
-
-import { API_COMPATIBILITY_FILE } from "./config";
-
-/** The first GHES version that included Code Scanning. */
-const FIRST_SUPPORTED_RELEASE: SemVer = new semver.SemVer("2.22.0");
-
-/** Environment variables specific to this script. */
-export enum EnvVar {
-  ENTERPRISE_RELEASES_PATH = "ENTERPRISE_RELEASES_PATH",
-}
-
-/**
- * The semver specification requires three numeric components, but GHES release families
- * only have two. This function uses `semver.coerce` to first coerce the version string
- * into an acceptable input for `semver.parse`. E.g. `3.10` becomes `3.10.0`.
- */
-export function parseEnterpriseVersion(val: string): SemVer | null {
-  return semver.parse(semver.coerce(val));
-}
-
-/**
- * Mirroring `parseEnterpriseVersion`, this function returns only the major and minor
- * version components from `ver`.
- */
-export function printEnterpriseVersion(ver: SemVer) {
-  if (ver.patch === 0) {
-    return `${ver.major}.${ver.minor}`;
-  }
-  return ver.toString();
-}
-
-/** The JSON schema for `API_COMPATIBILITY_FILE`. */
-const apiCompatibilitySchema = {
-  minimumVersion: json.string,
-  maximumVersion: json.string,
-} as const satisfies json.Schema;
-
-/** The type representing the expected contents of `API_COMPATIBILITY_FILE`. */
-type ApiCompatibility = json.FromSchema;
-
-/** Reads the current contents of the `API_COMPATIBILITY_FILE` file. */
-export function readApiCompatibility(): ApiCompatibility {
-  const apiCompatibilityData: unknown = JSON.parse(
-    fs.readFileSync(API_COMPATIBILITY_FILE, "utf8"),
-  );
-
-  if (!json.isObject(apiCompatibilityData)) {
-    throw new Error(
-      `Expected '${API_COMPATIBILITY_FILE}' to contain an object.`,
-    );
-  }
-  if (!json.validateSchema(apiCompatibilitySchema, apiCompatibilityData)) {
-    throw new Error(
-      `The contents of '${API_COMPATIBILITY_FILE}' do not match the expected JSON schema.`,
-    );
-  }
-
-  return apiCompatibilityData;
-}
-
-/** The JSON schema for entries in the `releases.json` file. */
-const releaseDataSchema = {
-  feature_freeze: json.string,
-  end: json.string,
-} as const satisfies json.Schema;
-
-/** The type representing entries in the `releases.json` file. */
-export type ReleaseData = json.FromSchema;
-
-/** A mapping from GHES releases to release information. */
-export type EnterpriseReleases = Record;
-
-/** Reads information about GHES releases. */
-export function readEnterpriseReleases(
-  enterpriseReleasesPath: string,
-): EnterpriseReleases {
-  const releaseFilePath = path.join(enterpriseReleasesPath, "releases.json");
-  const releases: unknown = JSON.parse(
-    fs.readFileSync(releaseFilePath, "utf8"),
-  );
-
-  if (!json.isObject(releases)) {
-    throw new Error(`Expected '${releaseFilePath}' to contain an object.`);
-  }
-
-  // Remove GHES version using a previous version numbering scheme.
-  delete releases["11.10"];
-
-  // Validate that the object satisfies the schema.
-  for (const [, releaseData] of Object.entries(releases)) {
-    if (!json.isObject(releaseData)) {
-      throw new Error(
-        `Expected release data to be an object, but it is ${typeof releaseData}.`,
-      );
-    }
-    if (!json.validateSchema(releaseDataSchema, releaseData)) {
-      throw new Error("Expected release data to satisfy schema.");
-    }
-  }
-
-  return releases;
-}
-
-/** Adds `weeks`-many weeks to the UTC date of `date`. */
-export function addWeeks(date: Date, weeks: number): Date {
-  const result = new Date(date);
-  result.setUTCDate(date.getUTCDate() + weeks * 7);
-  return result;
-}
-
-/** Determines the current range of GHES versions we should support. */
-export function determineSupportedRange(
-  today: Date,
-  apiCompatibilityData: ApiCompatibility,
-  releases: EnterpriseReleases,
-): ApiCompatibility {
-  // We only care about the UTC date component.
-  today.setUTCHours(0, 0, 0, 0);
-
-  // Our goal is to identify the oldest and newest GHES release we should support.
-  // We begin with `oldestSupportRelease = undefined` so that we determine the
-  // minimum from scratch and don't stick to `apiCompatibilityData.minimumVersion`
-  // when it is no longer supported.
-  // For `newestSupportedRelease`, we assume that `apiCompatibilityData.maximumVersion`
-  // is guaranteed to not be outdated.
-  let oldestSupportedRelease: SemVer | undefined;
-  let newestSupportedRelease = parseEnterpriseVersion(
-    apiCompatibilityData.maximumVersion,
-  );
-
-  if (newestSupportedRelease === null) {
-    throw new Error(
-      `${apiCompatibilityData.maximumVersion} is not a valid semantic version.`,
-    );
-  }
-
-  // NOTE: We deliberately omit including any data from `releases` in the error messages below.
-
-  for (const [releaseVersionString, releaseData] of Object.entries(releases)) {
-    const releaseVersion = parseEnterpriseVersion(releaseVersionString);
-
-    if (releaseVersion === null) {
-      throw new Error("Invalid enterprise release version.");
-    }
-
-    // Ignore GHES releases older than `FIRST_SUPPORTED_RELEASE`.
-    if (semver.compare(releaseVersion, FIRST_SUPPORTED_RELEASE) < 0) {
-      continue;
-    }
-
-    // Set `newestSupportedRelease` to a GHES release if it has a greater version
-    // than the current `newestSupportedRelease` and the feature freeze has
-    // already happened or will be in the next two weeks.
-    if (semver.compare(releaseVersion, newestSupportedRelease) > 0) {
-      const featureFreezeDate = new Date(releaseData.feature_freeze);
-      if (featureFreezeDate < addWeeks(today, 2)) {
-        newestSupportedRelease = releaseVersion;
-      }
-    }
-
-    if (
-      oldestSupportedRelease === undefined ||
-      semver.compare(releaseVersion, oldestSupportedRelease) < 0
-    ) {
-      const endOfLifeDate = new Date(releaseData.end);
-      // The GHES version is not actually end of life until the end of the day
-      // specified by `endOfLifeDate`. Wait an extra week to be safe.
-      const isEndOfLife = today > addWeeks(endOfLifeDate, 1);
-      if (!isEndOfLife) {
-        oldestSupportedRelease = releaseVersion;
-      }
-    }
-  }
-
-  if (!oldestSupportedRelease) {
-    throw new Error("Could not determine oldest supported release.");
-  }
-
-  return {
-    maximumVersion: printEnterpriseVersion(newestSupportedRelease),
-    minimumVersion: printEnterpriseVersion(oldestSupportedRelease),
-  };
-}
-
-function main() {
-  const enterpriseReleasesPath = process.env[EnvVar.ENTERPRISE_RELEASES_PATH];
-  if (!enterpriseReleasesPath) {
-    throw new Error(
-      `${EnvVar.ENTERPRISE_RELEASES_PATH} environment variable must be set`,
-    );
-  }
-
-  // Get the version compatibility data stored in the repo.
-  const apiCompatibilityData = readApiCompatibility();
-
-  // Get the GHES release information.
-  const releases = readEnterpriseReleases(enterpriseReleasesPath);
-
-  // Determine the supported range.
-  const newCompatibilityData: ApiCompatibility = determineSupportedRange(
-    new Date(),
-    apiCompatibilityData,
-    releases,
-  );
-
-  // If the version range has changed, write the updates to `API_COMPATIBILITY_FILE`.
-  if (
-    newCompatibilityData.minimumVersion !==
-      apiCompatibilityData.minimumVersion ||
-    newCompatibilityData.maximumVersion !== apiCompatibilityData.maximumVersion
-  ) {
-    const data = JSON.stringify(newCompatibilityData);
-    fs.writeFileSync(API_COMPATIBILITY_FILE, `${data}\n`);
-
-    console.log(
-      `Updated '${path.basename(API_COMPATIBILITY_FILE)}': ${newCompatibilityData.minimumVersion} - ${newCompatibilityData.maximumVersion}`,
-    );
-  } else {
-    console.log(
-      `No changes, not writing to '${path.basename(API_COMPATIBILITY_FILE)}'.`,
-    );
-  }
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  main();
-}
diff --git a/pr-checks/update-release-branch.ts b/pr-checks/update-release-branch.ts
deleted file mode 100755
index 088da59281..0000000000
--- a/pr-checks/update-release-branch.ts
+++ /dev/null
@@ -1,840 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/**
- * Creates a release preparation branch and opens a PR to merge changes from a
- * source branch into a target release branch.
- *
- * For primary releases this merges `main` into the latest `releases/vN` branch.
- * For backports this merges a newer release branch into an older one, handling
- * version number and changelog migration automatically.
- *
- * Usage:
- *   update-release-branch.ts \
- *     --repository-nwo github/codeql-action \
- *     --source-branch main \
- *     --target-branch releases/v4 \
- *     --conductor username \
- *     [--is-primary-release] \
- *     [--dry-run]
- */
-
-import { execFileSync, type ExecFileSyncOptions } from "node:child_process";
-import { parseArgs } from "node:util";
-
-import { type ApiClient, getApiClient } from "./api-client";
-import * as changelog from "./changelog";
-import { DryRunOption, REPO_ROOT } from "./config";
-import {
-  getCurrentVersion,
-  replaceVersionInPackageJson,
-  withPackageJson,
-} from "./versions";
-
-/**
- * NB: This exact commit message is used to find commits for reverting during backports.
- *  Changing it requires a transition period where both old and new versions are supported.
- */
-export const BACKPORT_COMMIT_MESSAGE = "Update version and changelog for v";
-
-/**
- * Commit message used for rebuild commits, both those produced by this script and those produced
- *  by the `Rebuild Action` workflow (`.github/workflows/rebuild.yml`).
- */
-export const REBUILD_COMMIT_MESSAGE = "Rebuild";
-
-/** The name of the git remote. */
-const ORIGIN = "origin";
-
-/** Environment variables checked (in order) for a GitHub API token. */
-const TOKEN_ENVIRONMENT_VARIABLES = ["GH_TOKEN", "GITHUB_TOKEN"] as const;
-
-/** The expected prefix for release branch names. */
-const RELEASE_BRANCH_PREFIX = "releases/v";
-
-/**
- * Gets a GitHub API token from one of the supported environment variables.
- * @throws If none of the supported environment variables is set.
- */
-export function getGitHubToken(): string {
-  for (const name of TOKEN_ENVIRONMENT_VARIABLES) {
-    const token = process.env[name]?.trim();
-    if (token) {
-      return token;
-    }
-  }
-  throw new Error("Missing GitHub token. Set GITHUB_TOKEN or GH_TOKEN.");
-}
-
-/** Options for {@link runCommand}. */
-export interface RunCommandOptions extends DryRunOption {
-  /** Options for `execFileSync`. */
-  execOptions?: ExecFileSyncOptions;
-}
-
-/**
- * Runs a command, streaming output to the console by default.
- *
- * @param command The name of the command to run.
- * @param args The arguments for the command.
- * @throws When the process exits with a non-zero exit code.
- * @param options How to run the command.
- */
-export function runCommand(
-  command: string,
-  args: string[],
-  options?: RunCommandOptions,
-) {
-  if (!options?.dryRun) {
-    console.log(`Running \`${command} ${args.join(" ")}\`.`);
-    return execFileSync(command, args, {
-      stdio: "inherit",
-      cwd: REPO_ROOT,
-      ...options?.execOptions,
-    });
-  } else {
-    console.info(
-      `[DRY RUN] Would have executed '${command} ${args.join(" ")}'`,
-    );
-    return "";
-  }
-}
-
-/** Options for {@link runGit}. */
-export interface RunGitOptions extends DryRunOption {
-  /** When true, non-zero exit codes will not throw. */
-  allowNonZeroExitCode?: boolean;
-}
-
-/**
- * Runs `git` with the given `args` and returns the stdout.
- *
- * @param args - Arguments to pass to `git`.
- * @param options - Optional settings.
- * @throws If `git` does not exit successfully, unless
- *         `options.allowNonZeroExitCode` is `true`.
- * @returns The trimmed stdout output.
- */
-export function runGit(args: string[], options?: RunGitOptions): string {
-  const execOptions: ExecFileSyncOptions = {
-    encoding: "utf8",
-    stdio: ["pipe", "pipe", "pipe"],
-  };
-
-  try {
-    const result = runCommand("git", args, {
-      dryRun: options?.dryRun,
-      execOptions,
-    }) as string;
-    return result.trimEnd();
-  } catch (error: unknown) {
-    if (options?.allowNonZeroExitCode) {
-      // execFileSync throws an object with `stdout` when the process exits
-      // with a non-zero code.
-      const execError = error as { stdout?: Buffer | string };
-      if (typeof execError.stdout === "string") {
-        return execError.stdout.trimEnd();
-      }
-      if (Buffer.isBuffer(execError.stdout)) {
-        return execError.stdout.toString("utf8").trimEnd();
-      }
-      return "";
-    }
-    throw error;
-  }
-}
-
-/** Returns true if the given branch exists on the origin remote. */
-export function branchExistsOnRemote(branchName: string): boolean {
-  const result = runGit(["ls-remote", "--heads", ORIGIN, branchName]);
-  return result !== "";
-}
-
-/** Represents commits returned by the GitHub API (relevant fields only). */
-export interface GitHubCommit {
-  sha: string;
-  commit: { message: string; author: { date?: string } | null };
-  author: { login: string } | null;
-  committer: { login: string } | null;
-  parents: Array<{ sha: string }>;
-}
-
-/** Returns true if the commit is an automatic PR merge commit made by GitHub. */
-export function isPrMergeCommit(commit: GitHubCommit): boolean {
-  return commit.committer?.login === "web-flow" && commit.parents.length > 1;
-}
-
-/**
- * Gets a list of commits on the source branch that are not on the target branch,
- * excluding automatic PR merge commits. This will not include any commits that
- * exist on the target branch that aren't on the source branch.
- *
- * Uses `git log` to find the SHAs, then fetches each commit from the GitHub API
- * to obtain full metadata (author, parents, associated PRs, etc.).
- *
- * @param client - An authenticated GitHub API client.
- * @param owner - The repository owner.
- * @param repo - The repository name.
- * @param sourceBranch - The source branch name (without `origin/` prefix).
- * @param targetBranch - The target branch name (without `origin/` prefix).
- * @returns The list of non-merge commits unique to the source branch.
- */
-export async function getCommitDifference(
-  client: ApiClient,
-  owner: string,
-  repo: string,
-  sourceBranch: string,
-  targetBranch: string,
-): Promise {
-  const logOutput = runGit([
-    "log",
-    "--pretty=format:%H",
-    `${ORIGIN}/${targetBranch}..${ORIGIN}/${sourceBranch}`,
-  ]);
-
-  // An empty log output means no commits to merge.
-  if (logOutput === "") {
-    return [];
-  }
-
-  const shas = logOutput.split("\n");
-
-  // Fetch full commit objects from the API.
-  console.info(
-    `Fetching information about ${shas.length} commits from the API...`,
-  );
-
-  const commits: GitHubCommit[] = [];
-  for (const sha of shas) {
-    const { data } = await client.rest.repos.getCommit({
-      owner,
-      repo,
-      ref: sha,
-    });
-    commits.push(data as GitHubCommit);
-  }
-
-  // Filter out automatic PR merge commits.
-  return commits.filter((c) => !isPrMergeCommit(c));
-}
-
-/** Truncates a commit message for display. */
-export function getTruncatedCommitMessage(message: string): string {
-  const firstLine = message.split("\n")[0];
-  if (firstLine.length > 60) {
-    return `${firstLine.slice(0, 57)}...`;
-  }
-  return firstLine;
-}
-
-/** Represents pull requests associated with a commit (relevant fields only). */
-export interface AssociatedPullRequest {
-  number: number;
-  user: { login: string; site_admin: boolean } | null;
-  merge_commit_sha: string | null;
-}
-
-/**
- * Gets the pull request that introduced a commit to the source branch.
- * Returns the earliest PR by number if multiple are associated.
- */
-export async function getPrForCommit(
-  client: ApiClient,
-  owner: string,
-  repo: string,
-  commit: GitHubCommit,
-): Promise {
-  const prs = await client.paginate(
-    client.rest.repos.listPullRequestsAssociatedWithCommit,
-    {
-      owner,
-      repo,
-      commit_sha: commit.sha,
-    },
-  );
-
-  if (prs.length === 0) {
-    return undefined;
-  }
-
-  // Return the earliest PR by number.
-  const sorted = [...prs].sort((a, b) => a.number - b.number);
-  return sorted[0];
-}
-
-/**
- * Get the login of the person who merged a pull request.
- * Falls back to the commit author of the merge commit.
- * For most cases this will be the same as the author, but for PRs opened
- * by external contributors getting the merger will get us the GitHub
- * employee who reviewed and merged the PR.
- */
-export async function getMergerOfPr(
-  client: ApiClient,
-  owner: string,
-  repo: string,
-  pr: AssociatedPullRequest,
-): Promise {
-  if (!pr.merge_commit_sha) {
-    return "unknown";
-  }
-  const { data: commit } = await client.rest.repos.getCommit({
-    owner,
-    repo,
-    ref: pr.merge_commit_sha,
-  });
-  return commit.author?.login ?? "unknown";
-}
-
-/**
- * Returns the PR author's login if they are GitHub staff (site_admin),
- * otherwise undefined.
- */
-export function getPrAuthorIfStaff(
-  pr: AssociatedPullRequest,
-): string | undefined {
-  if (pr.user?.site_admin) {
-    return pr.user.login;
-  }
-  return undefined;
-}
-
-/** Parameters for {@link openPr}. */
-interface OpenPrParams {
-  client: ApiClient;
-  owner: string;
-  repo: string;
-  commits: GitHubCommit[];
-  sourceBranchShortSha: string;
-  newBranchName: string;
-  sourceBranch: string;
-  targetBranch: string;
-  conductor: string;
-  isPrimaryRelease: boolean;
-  conflictedFiles: string[];
-  dryRun: boolean;
-}
-
-/**
- * Opens a pull request from the new branch to the target branch and assigns
- * the conductor.
- */
-export async function openPr(params: OpenPrParams): Promise {
-  const {
-    client,
-    owner,
-    repo,
-    commits,
-    sourceBranchShortSha,
-    newBranchName,
-    sourceBranch,
-    targetBranch,
-    conductor,
-    isPrimaryRelease,
-    conflictedFiles,
-    dryRun,
-  } = params;
-
-  // Sort the commits into those with and without associated PRs.
-  const pullRequests: AssociatedPullRequest[] = [];
-  const commitsWithoutPrs: GitHubCommit[] = [];
-
-  console.info(`Finding PRs for ${commits.length} commits...`);
-
-  for (const commit of commits) {
-    const pr = await getPrForCommit(client, owner, repo, commit);
-    if (!pr) {
-      commitsWithoutPrs.push(commit);
-    } else if (!pullRequests.some((p) => p.number === pr.number)) {
-      pullRequests.push(pr);
-    }
-  }
-
-  console.log(`Found ${pullRequests.length} pull requests.`);
-  console.log(
-    `Found ${commitsWithoutPrs.length} commits not in a pull request.`,
-  );
-
-  // Sort PRs by number (ascending) and commits by date.
-  pullRequests.sort((a, b) => a.number - b.number);
-  commitsWithoutPrs.sort((a, b) => {
-    const dateA = a.commit.author?.date ?? "";
-    const dateB = b.commit.author?.date ?? "";
-    return dateA.localeCompare(dateB);
-  });
-
-  // Build the PR body.
-  const body: string[] = [];
-  body.push(`Merging ${sourceBranchShortSha} into \`${targetBranch}\`.`);
-  body.push("");
-  body.push(`Conductor for this PR is @${conductor}.`);
-
-  if (pullRequests.length > 0) {
-    body.push("");
-    body.push("Contains the following pull requests:");
-    for (const pr of pullRequests) {
-      const displayUser =
-        getPrAuthorIfStaff(pr) ??
-        (await getMergerOfPr(client, owner, repo, pr));
-      body.push(`- #${pr.number} (@${displayUser})`);
-    }
-  }
-
-  if (commitsWithoutPrs.length > 0) {
-    body.push("");
-    body.push("Contains the following commits not from a pull request:");
-    for (const commit of commitsWithoutPrs) {
-      const authorDesc = commit.author ? ` (@${commit.author.login})` : "";
-      body.push(
-        `- ${commit.sha} - ${getTruncatedCommitMessage(commit.commit.message)}${authorDesc}`,
-      );
-    }
-  }
-
-  body.push("");
-  body.push("Please do the following:");
-  if (conflictedFiles.length > 0) {
-    body.push(
-      " - [ ] Ensure `package.json` file contains the correct version.",
-    );
-    body.push(
-      " - [ ] Add a commit to this branch to resolve the merge conflicts in the following files:",
-    );
-    for (const file of conflictedFiles) {
-      body.push(`    - \`${file}\``);
-    }
-    body.push(
-      ` - [ ] Rebuild the Action locally (\`npm run build\`) and push any changes to the built output in \`lib\` as a separate commit named exactly \`${REBUILD_COMMIT_MESSAGE}\`.`,
-    );
-    body.push(
-      " - [ ] Ensure another maintainer has reviewed the additional commits you added to this branch to resolve the merge conflicts.",
-    );
-  }
-  body.push(
-    " - [ ] Ensure the CHANGELOG displays the correct version and date.",
-  );
-  body.push(
-    " - [ ] Ensure the CHANGELOG includes all relevant, user-facing changes since the last release.",
-  );
-  body.push(
-    ` - [ ] Check that there are not any unexpected commits being merged into the \`${targetBranch}\` branch.`,
-  );
-  body.push(
-    " - [ ] Ensure the docs team is aware of any documentation changes that need to be released.",
-  );
-  body.push(
-    " - [ ] Approve running the full set of PR checks if you have not pushed any changes.",
-  );
-  body.push(
-    " - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.",
-  );
-
-  if (isPrimaryRelease) {
-    body.push(
-      " - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.",
-    );
-    body.push(
-      " - [ ] Merge all backport PRs to older release branches, that will automatically be created once this PR is merged.",
-    );
-  }
-
-  const title = `Merge ${sourceBranch} into ${targetBranch}`;
-
-  if (dryRun) {
-    console.info(`[DRY RUN] Would create PR: "${title}" with body:`);
-
-    for (const line of body) {
-      console.info(`[DRY RUN] > ${line}`);
-    }
-
-    console.info(`[DRY RUN] and assign it to @${conductor}`);
-
-    return;
-  }
-
-  // Create the pull request.
-  const { data: pr } = await client.rest.pulls.create({
-    owner,
-    repo,
-    title,
-    body: body.join("\n"),
-    head: newBranchName,
-    base: targetBranch,
-  });
-  console.log(`Created PR #${pr.number}`);
-
-  // Assign the conductor.
-  await client.rest.issues.addAssignees({
-    owner,
-    repo,
-    issue_number: pr.number,
-    assignees: [conductor],
-  });
-  console.log(`Assigned PR to ${conductor}`);
-}
-
-interface MainOptions {
-  dryRun: boolean;
-  repositoryNwo: string;
-  sourceBranch: string;
-  targetBranch: string;
-  isPrimaryRelease: boolean;
-  conductor: string;
-}
-
-function parseCliOptions(): MainOptions {
-  const { values } = parseArgs({
-    options: {
-      "dry-run": { type: "boolean", default: false },
-      "repository-nwo": { type: "string" },
-      "source-branch": { type: "string" },
-      "target-branch": { type: "string" },
-      "is-primary-release": { type: "boolean", default: false },
-      conductor: { type: "string" },
-    },
-    strict: true,
-  });
-
-  if (!values["repository-nwo"]) {
-    throw new Error("--repository-nwo is required");
-  }
-  if (!values["source-branch"]) {
-    throw new Error("--source-branch is required");
-  }
-  if (!values["target-branch"]) {
-    throw new Error("--target-branch is required");
-  }
-  if (!values["conductor"]) {
-    throw new Error("--conductor is required");
-  }
-
-  return {
-    dryRun: values["dry-run"],
-    repositoryNwo: values["repository-nwo"],
-    sourceBranch: values["source-branch"],
-    targetBranch: values["target-branch"],
-    isPrimaryRelease: values["is-primary-release"] ?? false,
-    conductor: values["conductor"],
-  };
-}
-
-/**
- * Rebuilds the action (npm ci + npm run build) and commits any changes.
- */
-export function rebuildAction(options: MainOptions): void {
-  // For backports, the only source-level change vs the source branch is the new version number,
-  // so we just need to refresh the version embedded in `lib/`.
-  runCommand("npm", ["ci"]);
-  runCommand("npm", ["run", "build"]);
-
-  runGit(["add", "--all"], { dryRun: options.dryRun });
-
-  // `git diff --cached --quiet` exits 0 if there are no staged changes.
-  try {
-    execFileSync("git", ["diff", "--cached", "--quiet"]);
-    console.log("Rebuild produced no changes; skipping Rebuild commit.");
-  } catch {
-    runGit(["commit", "-m", REBUILD_COMMIT_MESSAGE], {
-      dryRun: options.dryRun,
-    });
-    console.log("Created Rebuild commit.");
-  }
-}
-
-/**
- * Prepares the new update/backport branch.
- *
- * @param options The options we are running with.
- * @param newBranchName The name of the new branch to create.
- * @param targetBranchMajorVersion The target branch's major version.
- * @param version The target version.
- */
-export async function prepareNewBranch(
-  options: MainOptions,
-  newBranchName: string,
-  targetBranchMajorVersion: string,
-  version: string,
-): Promise {
-  // The process of creating the v{Older} release can run into merge conflicts. We commit the unresolved
-  // conflicts so a maintainer can easily resolve them (vs erroring and requiring maintainers to
-  // reconstruct the release manually)
-  let conflictedFiles: string[] = [];
-
-  if (!options.isPrimaryRelease) {
-    // For backports, the source branch is also a release branch.
-    const sourceBranchMajorVersion = options.sourceBranch.replace(
-      RELEASE_BRANCH_PREFIX,
-      "",
-    );
-
-    // Start from the target branch.
-    console.log(
-      `Creating ${newBranchName} from the ${ORIGIN}/${options.targetBranch} branch`,
-    );
-
-    runGit(
-      ["checkout", "-b", newBranchName, `${ORIGIN}/${options.targetBranch}`],
-      { dryRun: options.dryRun },
-    );
-
-    // Revert the commit that we made as part of the last release that updated the version number and
-    // changelog to refer to {older}.x.x variants. This avoids merge conflicts in the changelog and
-    // package.json files when we merge in the v{latest} branch.
-    // This commit will not exist the first time we release the v{N-1} branch from the v{N} branch, so we
-    // use `git log --grep` to conditionally revert the commit.
-    console.log(
-      "Reverting the version number and changelog updates from the last release to avoid conflicts",
-    );
-    const vOlderUpdateCommits = runGit([
-      "log",
-      "--grep",
-      `^${BACKPORT_COMMIT_MESSAGE}`,
-      "--format=%H",
-    ])
-      .split("\n")
-      .filter((s) => s !== "");
-
-    if (vOlderUpdateCommits.length > 0) {
-      // Only revert the newest commit as older ones will already have been
-      // reverted in previous releases.
-      console.log(`  Reverting ${vOlderUpdateCommits[0]}`);
-      runGit(["revert", vOlderUpdateCommits[0], "--no-edit"], {
-        dryRun: options.dryRun,
-      });
-
-      // Also revert the "Rebuild" commit, whether created by this script or
-      // by the `Rebuild Action` workflow.
-      const rebuildCommits = runGit([
-        "log",
-        "--grep",
-        `^${REBUILD_COMMIT_MESSAGE}$`,
-        "--format=%H",
-      ])
-        .split("\n")
-        .filter((s) => s !== "");
-      const rebuildCommit = rebuildCommits[0];
-      console.log(`  Reverting ${rebuildCommit}`);
-      runGit(["revert", rebuildCommit, "--no-edit"], {
-        dryRun: options.dryRun,
-      });
-    } else {
-      console.log("  Nothing to revert.");
-    }
-
-    // Merge the source branch into the release prep branch.
-    console.log(
-      `Merging ${ORIGIN}/${options.sourceBranch} into the release prep branch`,
-    );
-    runGit(["merge", `${ORIGIN}/${options.sourceBranch}`], {
-      allowNonZeroExitCode: true,
-      dryRun: options.dryRun,
-    });
-    conflictedFiles = runGit(["diff", "--name-only", "--diff-filter", "U"])
-      .split("\n")
-      .filter((s) => s !== "");
-    if (conflictedFiles.length > 0) {
-      runGit(["add", "."], {
-        dryRun: options.dryRun,
-      });
-      runGit(["commit", "--no-edit"], {
-        dryRun: options.dryRun,
-      });
-    }
-
-    // Migrate the package version number.
-    console.log(`Setting version number to '${version}' in package.json`);
-    withPackageJson((content) => {
-      const currentPkgVersion = getCurrentVersion(content);
-      if (currentPkgVersion) {
-        return {
-          content: replaceVersionInPackageJson(
-            currentPkgVersion,
-            version,
-            content,
-          ),
-          value: currentPkgVersion,
-        };
-      }
-      return { value: currentPkgVersion };
-    }, options);
-    runGit(["add", "package.json"], {
-      dryRun: options.dryRun,
-    });
-
-    // Migrate the changelog notes from the source major version to the target.
-    console.log(
-      `Migrating changelog notes from v${sourceBranchMajorVersion} to v${targetBranchMajorVersion}`,
-    );
-    changelog.withChangelog(
-      (contents) =>
-        changelog.processChangelogForBackports(
-          sourceBranchMajorVersion,
-          targetBranchMajorVersion,
-          contents,
-        ),
-      options,
-    );
-
-    runGit(["add", "CHANGELOG.md"], {
-      dryRun: options.dryRun,
-    });
-    runGit(["commit", "-m", `${BACKPORT_COMMIT_MESSAGE}${version}`], {
-      dryRun: options.dryRun,
-    });
-  } else {
-    // For a standard (primary) release, there won't be new commits on the
-    // target branch that aren't already on the source branch, so we can just
-    // start from the source branch.
-    runGit(
-      ["checkout", "-b", newBranchName, `${ORIGIN}/${options.sourceBranch}`],
-      {
-        dryRun: options.dryRun,
-      },
-    );
-
-    console.log("Updating changelog");
-    changelog.withChangelog(
-      (contents) => changelog.setVersionAndDate(version, contents),
-      { ...options, initChangelog: true },
-    );
-
-    runGit(["add", "CHANGELOG.md"], {
-      dryRun: options.dryRun,
-    });
-    runGit(["commit", "-m", `Update changelog for v${version}`], {
-      dryRun: options.dryRun,
-    });
-  }
-
-  // For backports, rebuild the action unless there were merge conflicts.
-  if (!options.isPrimaryRelease) {
-    if (conflictedFiles.length === 0) {
-      console.log("Rebuilding the Action.");
-      rebuildAction(options);
-    } else {
-      console.log(
-        `Skipping automatic rebuild because the merge produced conflicts in: ${conflictedFiles.join(", ")}`,
-      );
-    }
-  }
-
-  return conflictedFiles;
-}
-
-async function main(): Promise {
-  const options = parseCliOptions();
-  const token = getGitHubToken();
-  const client = getApiClient(token);
-
-  if (!options.targetBranch.startsWith(RELEASE_BRANCH_PREFIX)) {
-    throw new Error(
-      `Expected target branch to start with '${RELEASE_BRANCH_PREFIX}', but got '${options.targetBranch}'.`,
-    );
-  }
-  if (
-    !options.isPrimaryRelease &&
-    !options.sourceBranch.startsWith(RELEASE_BRANCH_PREFIX)
-  ) {
-    throw new Error(
-      `Expected source branch to start with '${RELEASE_BRANCH_PREFIX}' for backports, but got '${options.sourceBranch}'.`,
-    );
-  }
-  if (!options.repositoryNwo.includes("/")) {
-    throw new Error(
-      `Expected repository name with owner in 'owner/repo' format, but got '${options.repositoryNwo}'`,
-    );
-  }
-
-  const targetBranchMajorVersion = options.targetBranch.replace(
-    RELEASE_BRANCH_PREFIX,
-    "",
-  );
-
-  const currentVersion = withPackageJson((content) => {
-    return { value: getCurrentVersion(content) };
-  }, options);
-
-  if (!currentVersion) {
-    throw new Error("Failed to read current version from package.json");
-  }
-
-  const [, vMinor, vPatch] = currentVersion.split(".");
-  const version = `${targetBranchMajorVersion}.${vMinor}.${vPatch}`;
-
-  console.log(
-    `Considering difference between ${options.sourceBranch} and ${options.targetBranch}...`,
-  );
-
-  const sourceBranchShortSha = runGit([
-    "rev-parse",
-    "--short",
-    `${ORIGIN}/${options.sourceBranch}`,
-  ]);
-  console.log(
-    `Current head of ${options.sourceBranch} is ${sourceBranchShortSha}.`,
-  );
-
-  const [owner, repo] = options.repositoryNwo.split("/");
-  const commits = await getCommitDifference(
-    client,
-    owner,
-    repo,
-    options.sourceBranch,
-    options.targetBranch,
-  );
-
-  if (commits.length === 0) {
-    console.log(
-      `No commits to merge from ${options.sourceBranch} to ${options.targetBranch}.`,
-    );
-    return;
-  }
-
-  // Use a distinct branch prefix to support specific PR checks on backports.
-  const branchPrefix = options.isPrimaryRelease ? "update" : "backport";
-
-  // The branch name is based on the target version and the SHA of the source
-  // branch head. If the branch already exists we can assume this script has
-  // already run for this combination.
-  const newBranchName = `${branchPrefix}-v${version}-${sourceBranchShortSha}`;
-  console.log(`Branch name is '${newBranchName}'.`);
-
-  // Check if the branch already exists. If so we can abort as this script
-  // has already run on this combination of branches.
-  if (branchExistsOnRemote(newBranchName)) {
-    console.log(`Branch '${newBranchName}' already exists. Nothing to do.`);
-    return;
-  }
-
-  // Prepare the update/backport branch.
-  const conflictedFiles = await prepareNewBranch(
-    options,
-    newBranchName,
-    targetBranchMajorVersion,
-    version,
-  );
-
-  // Push the new branch to the remote.
-  console.log(`Creating branch ${newBranchName}.`);
-  runGit(["push", ORIGIN, newBranchName], { dryRun: options.dryRun });
-
-  // Open a PR to merge the new branch into the target branch.
-  await openPr({
-    client,
-    owner,
-    repo,
-    commits,
-    sourceBranchShortSha,
-    newBranchName,
-    sourceBranch: options.sourceBranch,
-    targetBranch: options.targetBranch,
-    conductor: options.conductor,
-    isPrimaryRelease: options.isPrimaryRelease,
-    conflictedFiles,
-    dryRun: options.dryRun,
-  });
-}
-
-// Only call `main` if this script was run directly.
-if (require.main === module) {
-  void main();
-}
diff --git a/pr-checks/util.ts b/pr-checks/util.ts
deleted file mode 100644
index 353b2a9654..0000000000
--- a/pr-checks/util.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Returns an appropriate message for the error.
- *
- * If the error is an `Error` instance, this returns the error message without
- * an `Error: ` prefix.
- */
-export function getErrorMessage(error: unknown): string {
-  return error instanceof Error ? error.message : String(error);
-}
diff --git a/pr-checks/versions.test.ts b/pr-checks/versions.test.ts
deleted file mode 100755
index 6697710f83..0000000000
--- a/pr-checks/versions.test.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env npx tsx
-
-/**
- * Tests for `versions.ts`.
- */
-
-import * as assert from "node:assert/strict";
-import { describe, it } from "node:test";
-
-import { getCurrentVersion, replaceVersionInPackageJson } from "./versions";
-
-describe("getCurrentVersion", async () => {
-  await it("reads versions", async () => {
-    const result = getCurrentVersion(`{ "version": "1.23.4" }`);
-    assert.deepEqual(result, "1.23.4");
-  });
-});
-
-const packageJsonContents = `{
-  "name": "codeql",
-  "version": "1.23.4"
-}
-`;
-
-const packageJsonContentsExpected = `{
-  "name": "codeql",
-  "version": "2.23.4"
-}
-`;
-
-describe("replaceVersionInPackageJson", async () => {
-  await it("replaces versions", async () => {
-    const result = replaceVersionInPackageJson(
-      "1.23.4",
-      "2.23.4",
-      packageJsonContents,
-    );
-    assert.deepEqual(
-      result.split("\n"),
-      packageJsonContentsExpected.split("\n"),
-    );
-    assert.deepEqual(JSON.parse(result), { name: "codeql", version: "2.23.4" });
-  });
-});
diff --git a/pr-checks/versions.ts b/pr-checks/versions.ts
deleted file mode 100644
index 4abc7faa17..0000000000
--- a/pr-checks/versions.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import * as fs from "node:fs";
-
-import { DryRunOption, PACKAGE_JSON } from "./config";
-
-export function withPackageJson(
-  transformer: (content: string) => { value: T; content?: string },
-  options: DryRunOption,
-): T {
-  const content = fs.readFileSync(PACKAGE_JSON, "utf8");
-  const result = transformer(content);
-
-  if (result.content !== undefined) {
-    if (!options.dryRun) {
-      fs.writeFileSync(PACKAGE_JSON, result.content, "utf8");
-    } else {
-      console.info(`[DRY RUN] Would have written an updated package.json`);
-    }
-  }
-
-  return result.value;
-}
-
-/** Reads the current version from `package.json`. */
-export function getCurrentVersion(content: string): string | undefined {
-  const pkg: { version: string } = JSON.parse(content);
-  return pkg.version;
-}
-
-/**
- * Replaces the version in `package.json` textually. Only updates the version
- * field that immediately follows the `"name": "codeql"` line.
- * `npm version` doesn't always work because of merge conflicts, so we
- * replace the version in package.json textually.
- */
-export function replaceVersionInPackageJson(
-  prevVersion: string,
-  newVersion: string,
-  content: string,
-): string {
-  const lines = content.split("\n");
-  let prevLineIsCodeql = false;
-  const output: string[] = [];
-
-  for (const line of lines) {
-    if (prevLineIsCodeql && line.includes(`"version": "${prevVersion}"`)) {
-      output.push(line.replace(prevVersion, newVersion));
-    } else {
-      output.push(line);
-    }
-    prevLineIsCodeql = line.includes('"name": "codeql",');
-  }
-
-  return output.join("\n");
-}
diff --git a/python-setup/check_python12.ps1 b/python-setup/check_python12.ps1
deleted file mode 100644
index f35558b07e..0000000000
--- a/python-setup/check_python12.ps1
+++ /dev/null
@@ -1,19 +0,0 @@
-
-#! /usr/bin/pwsh
-
-# If we are running greater than or equal to python 3.12, change py to run version 3.11
-Write-Host "Checking python version"
-if ((py -3 -c "import sys; print(0 if sys.version_info >= (3, 12) else 1)") -eq "0") {
-  Write-Host "python 3.12+ detected, setting PY_PYTHON3=3.11"
-  # First make sure we have python 3.11 installed
-  py -3.11 -c "import imp"
-  if ($LASTEXITCODE -eq 0) {
-    Write-Host "python 3.11 detected, using this version instead of 3.12+."
-    Write-Output "PY_PYTHON3=3.11" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
-  } else {
-    Write-Host "FAILURE: Python 3.12+ is not supported, and Python 3.11 could not be detected on the system. Please install Python 3.11."
-    exit 1
-  }
-} else {
-  Write-Host "python 3.12+ not detected, not making any changes."
-}
diff --git a/queries/binary-planting.ql b/queries/binary-planting.ql
deleted file mode 100644
index 952d0372e9..0000000000
--- a/queries/binary-planting.ql
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @name Exec call vulnerable to binary planting
- * @description On Windows, executing a binary with an unqualified name will execute a binary in the working directory in preference to a binary on PATH.
- * @kind path-problem
- * @problem.severity error
- * @id javascript/codeql-action/binary-planting
- */
-
-import javascript
-import DataFlow
-import DataFlow::PathGraph
-
-class WhichBarrierGuardNode extends DataFlow::BarrierGuardNode, DataFlow::InvokeNode {
-  WhichBarrierGuardNode() { getCalleeName() = "which" }
-
-  override predicate blocks(boolean outcome, Expr e) {
-    outcome = true and
-    e = getArgument(0).asExpr()
-  }
-}
-
-class BinaryPlantingConfiguration extends DataFlow::Configuration {
-  BinaryPlantingConfiguration() {
-    this = "BinaryPlantingConfiguration"
-  }
-
-  override predicate isSource(Node node) {
-    node.asExpr() instanceof StringLiteral and
-    not node.asExpr().(StringLiteral).getValue().matches("%/%") and
-    not node.getFile().getBaseName().matches("%.test.ts")
-  }
-
-  override predicate isSink(Node node) {
-    node instanceof SystemCommandExecution or
-    exists(InvokeExpr e | e.getCalleeName() = "ToolRunner" and e.getArgument(0) = node.asExpr())
-  }
-
-  override predicate isBarrierGuard(DataFlow::BarrierGuardNode guard) {
-    guard instanceof WhichBarrierGuardNode
-  }
-}
-
-from BinaryPlantingConfiguration cfg, PathNode source, PathNode sink
-where cfg.hasFlowPath(source, sink)
-select source.getNode(), source, sink, "This exec call might be vulnerable to Windows binary planting vulnerabilities."
diff --git a/queries/codeql-pack.lock.yml b/queries/codeql-pack.lock.yml
deleted file mode 100644
index 83711aafe0..0000000000
--- a/queries/codeql-pack.lock.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-lockVersion: 1.0.0
-dependencies:
-  codeql-javascript:
-    version: 0.6.1
-  codeql/regex:
-    version: 0.0.12
-  codeql/tutorial:
-    version: 0.0.9
-  codeql/util:
-    version: 0.0.9
-  codeql/yaml:
-    version: 0.0.1
-compiled: false
diff --git a/queries/codeql-pack.yml b/queries/codeql-pack.yml
deleted file mode 100644
index a7ded7576c..0000000000
--- a/queries/codeql-pack.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-name: codeql-action-custom-queries-javascript
-version: 0.0.0
-dependencies:
-  codeql/javascript-all: 0.6.1
diff --git a/queries/default-setup-environment-variables.ql b/queries/default-setup-environment-variables.ql
deleted file mode 100644
index 9f677dfb9b..0000000000
--- a/queries/default-setup-environment-variables.ql
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @name Some environment variables may not exist in default setup workflows
- * @id javascript/codeql-action/default-setup-env-vars
- * @kind problem
- * @severity warning
- */
-
-import javascript
-
-bindingset[envVar]
-predicate isSafeForDefaultSetup(string envVar) {
-  // Ignore internal Code Scanning environment variables
-  envVar.matches("CODE_SCANNING_%") or
-  envVar.matches("CODEQL_%") or
-  envVar.matches("CODESCANNING_%") or
-  envVar.matches("LGTM_%") or
-  // We flag up usage of potentially unsafe parts of the GitHub event in `default-setup-event-context.ql`.
-  envVar = "GITHUB_EVENT_PATH" or
-  // The following environment variables are known to be safe for use with default setup
-  envVar =
-    [
-      "GITHUB_ACTION_REF", "GITHUB_ACTION_REPOSITORY", "GITHUB_ACTOR", "GITHUB_API_URL",
-      "GITHUB_BASE_REF", "GITHUB_EVENT_NAME", "GITHUB_JOB", "GITHUB_RUN_ATTEMPT", "GITHUB_RUN_ID",
-      "GITHUB_SHA", "GITHUB_REPOSITORY", "GITHUB_SERVER_URL", "GITHUB_TOKEN", "GITHUB_WORKFLOW",
-      "GITHUB_WORKSPACE", "GOFLAGS", "ImageVersion", "JAVA_TOOL_OPTIONS", "RUNNER_ARCH",
-      "RUNNER_ENVIRONMENT", "RUNNER_NAME", "RUNNER_OS", "RUNNER_TEMP", "RUNNER_TOOL_CACHE"
-    ]
-}
-
-predicate envVarRead(DataFlow::Node node, string envVar) {
-  node =
-    any(DataFlow::PropRead read |
-      read = NodeJSLib::process().getAPropertyRead("env").getAPropertyRead() and
-      envVar = read.getPropertyName()
-    ) or
-  node =
-    any(DataFlow::CallNode call |
-      call.getCalleeName().matches("get%EnvParam") and
-      envVar = call.getArgument(0).getStringValue()
-    )
-}
-
-from DataFlow::Node read, string envVar
-where
-  envVarRead(read, envVar) and
-  read.getFile().getRelativePath().matches("src/%") and
-  not read.getFile().getBaseName().matches("%.test.ts") and
-  not isSafeForDefaultSetup(envVar)
-select read,
-  "The environment variable " + envVar +
-    " may not exist in default setup workflows. If all uses are safe, add it to the list of " +
-    "environment variables that are known to be safe in " +
-    "'queries/default-setup-environment-variables.ql'. If this use is safe but others are not, " +
-    "dismiss this alert as a false positive."
diff --git a/queries/default-setup-event-context.ql b/queries/default-setup-event-context.ql
deleted file mode 100644
index 15b1c27c8c..0000000000
--- a/queries/default-setup-event-context.ql
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @name Some context properties may not exist in default setup workflows
- * @id javascript/codeql-action/default-setup-context-properties
- * @kind path-problem
- * @severity warning
- */
-
-import javascript
-import DataFlow::PathGraph
-
-class NotParsedLabel extends DataFlow::FlowLabel {
-  NotParsedLabel() { this = "not-parsed" }
-}
-
-class ParsedLabel extends DataFlow::FlowLabel {
-  ParsedLabel() { this = "parsed" }
-}
-
-class EventContextAccessConfiguration extends DataFlow::Configuration {
-  EventContextAccessConfiguration() { this = "EventContextAccessConfiguration" }
-
-  override predicate isSource(DataFlow::Node source, DataFlow::FlowLabel lbl) {
-    source = NodeJSLib::process().getAPropertyRead("env").getAPropertyRead("GITHUB_EVENT_PATH") and
-    lbl instanceof NotParsedLabel
-  }
-
-  override predicate isSink(DataFlow::Node sink, DataFlow::FlowLabel lbl) {
-    sink instanceof DataFlow::PropRead and
-    lbl instanceof ParsedLabel and
-    not exists(DataFlow::PropRead n | sink = n.getBase()) and
-    not sink.asExpr().getFile().getBaseName().matches("%.test.ts")
-  }
-
-  override predicate isAdditionalFlowStep(
-    DataFlow::Node src, DataFlow::Node trg, DataFlow::FlowLabel inlbl, DataFlow::FlowLabel outlbl
-  ) {
-    src = trg.(FileSystemReadAccess).getAPathArgument() and inlbl = outlbl
-    or
-    exists(JsonParserCall c |
-      src = c.getInput() and
-      trg = c.getOutput() and
-      inlbl instanceof NotParsedLabel and
-      outlbl instanceof ParsedLabel
-    )
-    or
-    (
-      TaintTracking::sharedTaintStep(src, trg) or
-      DataFlow::SharedFlowStep::step(src, trg) or
-      DataFlow::SharedFlowStep::step(src, trg, _, _)
-    ) and
-    inlbl = outlbl
-  }
-}
-
-from EventContextAccessConfiguration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
-where cfg.hasFlowPath(source, sink)
-select sink.getNode(), source, sink,
-  "This event context property may not exist in default setup workflows."
diff --git a/queries/import-action-entrypoint.ql b/queries/import-action-entrypoint.ql
deleted file mode 100644
index 531010f11e..0000000000
--- a/queries/import-action-entrypoint.ql
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * @name Import action entrypoint
- * @description Importing the entrypoint file for an action is dangerous
- * because the code from that action will be run when the file is imported.
- * @kind problem
- * @problem.severity error
- * @id javascript/codeql-action/import-action-entrypoint
- */
-
-import javascript
-
-class ActionEntrypointFile extends File {
-  ActionEntrypointFile() {
-    exists(Module m | m.getPath() = this.getAbsolutePath() and
-       // This is quite a broad check and relies on the function name, but hopefully it'll be accurate enough
-       m.getAStmt().getAChildExpr+().(CallExpr).getCalleeName() = "run") and
-    // Requiring the relative path to exist limits us to files in the code repository and avoid libraries
-    exists(this.getRelativePath())
-  }
-}
-
-from ImportDeclaration i
-where exists(ActionEntrypointFile f | i.getImportedModule().getPath() = f.getAbsolutePath())
-select i, "This imports the entrypoint file for an action. This will execute the code from the action."
diff --git a/queries/inconsistent-action-input.ql b/queries/inconsistent-action-input.ql
deleted file mode 100644
index a48f4f6e8f..0000000000
--- a/queries/inconsistent-action-input.ql
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * @name Inconsistent action input
- * @description If multiple actions define an input with the same name, then the input
- *   must be defined in an identical way to avoid confusion for the user.
- *   This also makes writing queries like required-action-input.ql easier.
- * @kind problem
- * @severity error
- * @id javascript/codeql-action/inconsistent-action-input
- */
-
-import javascript
-
-/**
- * A declaration of a github action.
- */
-class ActionDeclaration extends File {
-  ActionDeclaration() {
-    getRelativePath().matches("%/action.yml") and
-    // Ignore internal Actions
-    not getRelativePath().matches(".github/actions/%")
-  }
-
-  /**
-   * The name of the action.
-   */
-  string getName() {
-    result = getRelativePath().regexpCapture("(.*)/action.yml", 1)
-  }
-
-  YamlDocument getRootNode() {
-    result.getFile() = this
-  }
-
-  YamlValue getInput(string inputName) {
-    result = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).lookup(inputName)
-  }
-}
-
-predicate areNotEquivalent(YamlValue x, YamlValue y) {
-  x.getTag() != y.getTag()
-  or
-  x.(YamlScalar).getValue() != y.(YamlScalar).getValue()
-  or
-  x.getNumChild() != y.getNumChild()
-  or
-  exists(int i | areNotEquivalent(x.getChild(i), y.getChild(i)))
-}
-
-from ActionDeclaration actionA, ActionDeclaration actionB, string inputName
-where actionA.getName() < actionB.getName() // prevent duplicates which are permutations of the names
-  and areNotEquivalent(actionA.getInput(inputName), actionB.getInput(inputName))
-  // ram and threads inputs in different actions are supposed to have different description
-  and inputName != "ram" and inputName != "threads"
-select actionA, "Action $@ and action $@ both declare input $@, however their definitions are not identical. This may be confusing to users.",
-  actionA, actionA.getName(), actionB, actionB.getName(), inputName, inputName
diff --git a/queries/required-action-input.ql b/queries/required-action-input.ql
deleted file mode 100644
index e4a0b155ff..0000000000
--- a/queries/required-action-input.ql
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @name Required action input
- * @description For action inputs the core.input represents input with no value as the emptystring.
- *   This doesn't promote good type checking. Instead, use either actions-util.getOptionalInput or
- *   actions-util.getRequiredInput depending on if the input always has a value or not. The input
- *   will always have a value if it is required or has a default value.
- * @kind problem
- * @problem.severity error
- * @id javascript/codeql-action/required-action-input
- */
-
-import javascript
-
-/**
- * A declaration of a github action.
- */
-class ActionDeclaration extends File {
-  ActionDeclaration() {
-    getRelativePath().matches("%/action.yml")
-  }
-
-  YamlDocument getRootNode() {
-    result.getFile() = this
-  }
-
-  /**
-   * The name of any input to this action.
-   */
-  string getAnInput() {
-    result = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).getKey(_).(YamlString).getValue()
-  }
-
-  /**
-   * The given input always has a value, either because it is required,
-   * or because it has a default value.
-   */
-  predicate inputAlwaysHasValue(string input) {
-    exists(YamlMapping value |
-      value = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).lookup(input) and
-      (exists(value.lookup("default")) or
-       value.lookup("required").(YamlBool).getBoolValue() = true))
-  }
-}
-
-/**
- * An import from "@actions/core"
- */
-class ActionsLibImport extends ImportDeclaration {
-  ActionsLibImport() {
-    getImportedPath().getValue() = "@actions/core"
-  }
-
-  Variable getAProvidedVariable() {
-    result = getASpecifier().getLocal().getVariable()
-  }
-}
-
-/**
- * A call to the core.getInput method.
- */
-class CoreGetInputMethodCallExpr extends MethodCallExpr {
-  CoreGetInputMethodCallExpr() {
-    getMethodName() = "getInput" and
-    exists(ActionsLibImport libImport |
-      this.getReceiver() = libImport.getAProvidedVariable().getAnAccess() or
-      this.getReceiver().(PropAccess).getBase() = libImport.getAProvidedVariable().getAnAccess())
-  }
-
-  /**
-   * The name of the input being accessed.
-   */
-  string getInputName() {
-    result = getArgument(0).(StringLiteral).getValue()
-  }
-}
-
-from ActionDeclaration action, CoreGetInputMethodCallExpr getInputCall, string inputName, string alternateFunction
-where action.getAnInput() = inputName
-  // We don't want to create an alert for the users core.getInput in the getRequiredInput
-  // and getOptionalInput functions themselves, and this check here does that in a
-  // roundabout way by checking the parameter is a string literal. This should be enough
-  // and hopefully won't discount any real calls to core.getInput, but is worth noting here.
-  and getInputCall.getInputName() = inputName
-  and ((action.inputAlwaysHasValue(inputName) and alternateFunction = "getRequiredInput")
-    or (not action.inputAlwaysHasValue(inputName) and alternateFunction = "geOptionalInput"))
-select getInputCall, "This input may be undefined. Please use actions-util.$@ instead.", alternateFunction, alternateFunction
\ No newline at end of file
diff --git a/queries/undeclared-action-input.ql b/queries/undeclared-action-input.ql
deleted file mode 100644
index 726f50a19f..0000000000
--- a/queries/undeclared-action-input.ql
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * @name Undeclared action input
- * @description Code tries to use an input parameter that is not defined for this action.
-   Perhaps this code is shared by multiple actions.
- * @kind problem
- * @problem.severity error
- * @id javascript/codeql-action/undeclared-action-input
- */
-
-import javascript
-
-/**
- * A declaration of a github action, including its inputs and entrypoint.
- */
-class ActionDeclaration extends File {
-  ActionDeclaration() {
-    getRelativePath().matches("%/action.yml")
-  }
-
-  /**
-   * The name of the action.
-   */
-  string getName() {
-    result = getRelativePath().regexpCapture("(.*)/action.yml", 1)
-  }
-
-  YamlDocument getRootNode() {
-    result.getFile() = this
-  }
-
-  /**
-   * The name of any input to this action.
-   */
-  string getAnInput() {
-    result = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).getKey(_).(YamlString).getValue()
-  }
-
-  /**
-   * The function that is the entrypoint to this action.
-   */
-  FunctionDeclStmt getEntrypoint() {
-    result.getFile().getRelativePath() = getRootNode().
-      (YamlMapping).lookup("runs").
-      (YamlMapping).lookup("main").
-      (YamlString).getValue().regexpReplaceAll("\\.\\./lib/(.*)\\.js", "src/$1.ts") and
-    result.getName() = "run"
-  }
-}
-
-/**
- * A function declared on CodeQL interface from codeql.ts
- */
-class CodeQLFunction extends Function {
-  CodeQLFunction() {
-    exists(Function getCodeQLForCmd, ObjectExpr obj |
-      getCodeQLForCmd.getName() = "getCodeQLForCmd" and
-      obj = getCodeQLForCmd.getAStmt().(ReturnStmt).getExpr() and
-      obj.getAProperty().getInit() = this)
-  }
-}
-
-/**
- * Any expr that is a transitive child of the given function.
- */
-Expr getAFunctionChildExpr(Function f) {
-  result.getContainer() = f
-}
-
-/*
- * Result is a function that is called from the body of the given function `f`
- */
-Function calledBy(Function f) {
-  result = getAFunctionChildExpr(f).(InvokeExpr).getResolvedCallee()
-  or
-  // Assume outer function causes inner function to be called,
-  // except for the special case of the CodeQL functions.
-  (result.getEnclosingContainer() = f and not result instanceof CodeQLFunction)
-  or
-  // Handle calls to CodeQL functions by name
-  getAFunctionChildExpr(f).(InvokeExpr).getCalleeName() = result.(CodeQLFunction).getName()
-}
-
-/**
- * A call to the core.getInput method.
- */
-class GetInputMethodCallExpr extends MethodCallExpr {
-  GetInputMethodCallExpr() {
-    getMethodName() = "getInput"
-  }
-
-  /**
-   * The name of the input being accessed.
-   */
-  string getInputName() {
-    result = getArgument(0).(StringLiteral).getValue()
-  }
-}
-
-from ActionDeclaration action, GetInputMethodCallExpr getInputCall, string inputName
-where getAFunctionChildExpr(calledBy*(action.getEntrypoint())) = getInputCall and
-  inputName = getInputCall.getInputName() and
-  not inputName = action.getAnInput()
-select getInputCall, "The $@ input is not defined for the $@ action", inputName, inputName, action, action.getName()
\ No newline at end of file
diff --git a/resolve-environment/action.yml b/resolve-environment/action.yml
deleted file mode 100644
index b93efb20d5..0000000000
--- a/resolve-environment/action.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: 'CodeQL: Resolve Build Environment'
-description: '[Experimental] Attempt to infer a build environment suitable for automatic builds'
-author: 'GitHub'
-inputs:
-  token:
-    description: "GitHub token to use for authenticating with this instance of GitHub. The token must be the built-in GitHub Actions token, and the workflow must have the `security-events: write` permission. Most of the time it is advisable to avoid specifying this input so that the workflow falls back to using the default value."
-    required: false
-    default: ${{ github.token }}
-  matrix:
-    default: ${{ toJson(matrix) }}
-  language:
-    description: The language to infer the build environment configuration for.
-    required: true
-  working-directory:
-    description: >-
-      Resolve the build environment based on the files located at the specified
-      path (relative to $GITHUB_WORKSPACE). If this input is not set, then the
-      build environment is resolved based on the files in $GITHUB_WORKSPACE.
-    required: false
-outputs:
-  environment:
-    description: The inferred build environment configuration.
-runs:
-  using: node24
-  main: '../lib/resolve-environment-entry.js'
diff --git a/scripts/check-node-modules.sh b/scripts/check-node-modules.sh
deleted file mode 100755
index f476d244f9..0000000000
--- a/scripts/check-node-modules.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# Check if running in GitHub Actions
-if [ "$GITHUB_ACTIONS" = "true" ]; then
-  echo "Running in a GitHub Actions workflow; not running 'npm install'"
-  exit 0
-fi
-
-# Check if npm install is likely needed before proceeding
-if [ ! -d node_modules ]; then
-  echo "Running 'npm install' because 'node_modules' directory is missing."
-  npm install
-elif [ package.json -nt package-lock.json ]; then
-  echo "Running 'npm install' because 'package-lock.json' appears to be outdated."
-  npm install
-elif [ package-lock.json -nt node_modules/.package-lock.json ]; then
-  echo "Running 'npm install' because 'node_modules/.package-lock.json' appears to be outdated."
-  npm install
-else
-  echo "Skipping 'npm install' because everything appears to be up-to-date."
-fi
diff --git a/setup-codeql/action.yml b/setup-codeql/action.yml
deleted file mode 100644
index 8d13eeaff0..0000000000
--- a/setup-codeql/action.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-name: 'CodeQL: Setup'
-description: 'Installs the CodeQL CLI'
-author: 'GitHub'
-inputs:
-  tools:
-    description: >-
-      By default, the Action will use the recommended version of the CodeQL
-      Bundle to analyze your project. You can override this choice using this
-      input. One of:
-
-      - A local path to a CodeQL Bundle tarball, or
-      - The URL of a CodeQL Bundle tarball GitHub release asset, or
-      - A special value `linked` which uses the version of the CodeQL tools
-        that the Action has been bundled with.
-      - A special value `nightly` which uses the latest nightly version of the
-        CodeQL tools. Note that this is unstable and not recommended for
-        production use.
-
-      If not specified, the Action will check in several places until it finds
-      the CodeQL tools.
-    required: false
-  languages:
-    description: >-
-      A comma-separated list of CodeQL languages that will be analyzed in subsequent
-      `github/codeql-action/init` and `github/codeql-action/analyze` invocations. If specified, the
-      Action may use this list to select a CodeQL CLI version that is best suited to analyzing those
-      languages, for example by preferring a version that has a cached overlay-base database for the
-      specified languages. This input is not remembered and must also be passed to
-      `github/codeql-action/init`.
-    required: false
-  analysis-kinds:
-    description: >-
-      [Internal] A comma-separated list of analysis kinds that subsequent
-      `github/codeql-action/init` invocations will enable. If specified, the Action may use this
-      list to select a CodeQL CLI version that is best suited to those analysis kinds. This input is
-      not remembered and must also be passed to `github/codeql-action/init`.
-
-      Available options are the same as for the `analysis-kinds` input on the `init` Action.
-    default: 'code-scanning'
-    required: true
-  token:
-    description: GitHub token to use for authenticating with this instance of GitHub.
-    default: ${{ github.token }}
-    required: false
-  matrix:
-    default: ${{ toJson(matrix) }}
-    required: false
-  external-repository-token:
-    description: A token for fetching additional files from private repositories in the same GitHub instance that is running this action.
-    required: false
-outputs:
-  codeql-path:
-    description: The path of the CodeQL binary that was installed.
-  codeql-version:
-    description: The version of the CodeQL binary that was installed.
-runs:
-  using: node24
-  main: '../lib/setup-codeql-entry.js'
diff --git a/src/action-common.test.ts b/src/action-common.test.ts
deleted file mode 100644
index fc2e0a9aaa..0000000000
--- a/src/action-common.test.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-import * as core from "@actions/core";
-import test from "ava";
-import sinon from "sinon";
-
-import * as common from "./action-common";
-import * as actionsUtil from "./actions-util";
-import * as environment from "./environment";
-import * as logging from "./logging";
-import { ActionName } from "./status-report";
-import * as statusReport from "./status-report";
-import {
-  getTestActionsEnv,
-  getTestEnv,
-  makeMacro,
-  RecordingLogger,
-  setupTests,
-} from "./testing-utils";
-import { getErrorMessage } from "./util";
-
-setupTests(test);
-
-interface RunInActionsTestOpts {
-  runFn?: () => Promise;
-  expectedErrorMessage?: string;
-  expectedTelemetryError?: string;
-}
-
-const runInActionsMacro = makeMacro({
-  exec: async (t, opts: RunInActionsTestOpts) => {
-    const expectFailure = opts?.expectedErrorMessage !== undefined;
-
-    const logger = new RecordingLogger();
-    const getActionsLogger = sinon
-      .stub(logging, "getActionsLogger")
-      .returns(logger);
-
-    const env = getTestEnv();
-    const getEnv = sinon.stub(environment, "getEnv").returns(env);
-
-    const actionsEnv = getTestActionsEnv(env);
-    const getActionsEnv = sinon
-      .stub(actionsUtil, "getActionsEnv")
-      .returns(actionsEnv);
-
-    const getJobUUID = sinon
-      .stub(statusReport, "getJobUUID")
-      .returns("test-job-uuid");
-
-    const setFailed = sinon.stub(core, "setFailed");
-    const sendUnhandledErrorStatusReport = sinon.stub(
-      statusReport,
-      "sendUnhandledErrorStatusReport",
-    );
-
-    const name = ActionName.Init;
-    const run = sinon.stub();
-
-    if (opts?.runFn) {
-      run.callsFake(opts.runFn);
-    }
-
-    const transformTelemetryError = sinon
-      .stub()
-      .callsFake((err) => opts?.expectedTelemetryError ?? getErrorMessage(err));
-    const testAction: common.Action = {
-      name,
-      run,
-      transformTelemetryError,
-    };
-
-    await common.runInActions(testAction);
-
-    // These always should have been called once.
-    t.true(getActionsLogger.calledOnce);
-    t.true(getEnv.calledOnce);
-    t.true(getActionsEnv.calledOnce);
-
-    const expectedActionState = {
-      actions: actionsEnv,
-      env,
-      logger,
-      name: ActionName.Init,
-    };
-
-    t.true(getJobUUID.calledOnceWithExactly(sinon.match(expectedActionState)));
-    t.true(run.calledOnceWithExactly(sinon.match(expectedActionState)));
-
-    t.is(setFailed.calledOnce, expectFailure ?? false);
-    t.is(sendUnhandledErrorStatusReport.calledOnce, expectFailure ?? false);
-
-    if (expectFailure) {
-      t.true(
-        setFailed.calledOnceWithExactly(
-          `${statusReport.getDisplayActionName(name)} action failed: ${opts?.expectedErrorMessage}`,
-        ),
-      );
-      t.true(
-        sendUnhandledErrorStatusReport.calledOnceWithExactly(
-          name,
-          sinon.match.any,
-          opts?.expectedTelemetryError ?? opts?.expectedErrorMessage,
-          logger,
-        ),
-      );
-    }
-  },
-  title: (providedTitle) => `runInActions - ${providedTitle}`,
-});
-
-runInActionsMacro.serial("calls run", {});
-runInActionsMacro.serial("handles run exceptions", {
-  runFn: () => {
-    throw new Error("Test failure");
-  },
-  expectedErrorMessage: "Test failure",
-});
-runInActionsMacro.serial("transforms run exceptions", {
-  runFn: () => {
-    throw new Error("Test failure");
-  },
-  expectedErrorMessage: "Test failure",
-  expectedTelemetryError: "Transformed failure message",
-});
diff --git a/src/action-common.ts b/src/action-common.ts
deleted file mode 100644
index 95323e7f2a..0000000000
--- a/src/action-common.ts
+++ /dev/null
@@ -1,126 +0,0 @@
-import * as core from "@actions/core";
-
-import { ActionsEnv, getActionsEnv } from "./actions-util";
-import type { ApiClient } from "./api-client";
-import { Env, ReadOnlyEnv } from "./environment";
-import type { FeatureEnablement } from "./feature-flags";
-import { getActionsLogger, Logger } from "./logging";
-import {
-  ActionName,
-  getDisplayActionName,
-  getJobUUID,
-  sendUnhandledErrorStatusReport,
-} from "./status-report";
-import { getEnv, getErrorMessage, wrapError } from "./util";
-
-/** Base state that is available to an Action on startup. */
-export interface BaseState {
-  /** The name of the Action. */
-  name: ActionName;
-  /** When the Action was started. */
-  startedAt: Date;
-}
-
-/** Describes different state features that an Action may have. */
-export interface FeatureState {
-  Base: BaseState;
-  Logger: {
-    /** The logger that is in use. */
-    logger: Logger;
-  };
-  Env: {
-    /** Information about environment variables. */
-    env: Env;
-  };
-  ReadOnlyEnv: {
-    env: ReadOnlyEnv;
-  };
-  Actions: {
-    /** Access to Actions-related functionality. */
-    actions: ActionsEnv;
-  };
-  Api: {
-    /** A GitHub API client. */
-    apiClient: ApiClient;
-  };
-  FeatureFlags: {
-    /** Information about enabled feature flags. */
-    features: FeatureEnablement;
-  };
-}
-
-/** Identifies a type of state an Action may have. */
-export type StateFeature = keyof FeatureState;
-
-/** Constructs the intersection of all state types identifies by `Fs`. */
-export type FieldsOf = Fs extends []
-  ? Record
-  : Fs extends [
-        infer Head extends StateFeature,
-        ...infer Tail extends readonly StateFeature[],
-      ]
-    ? FeatureState[Head] & FieldsOf
-    : never;
-
-/** Describes the state of an Action that has access to the state corresponding to `Fs`. */
-export type ActionState = FieldsOf;
-
-/** The type of an Action's main entry point. This is a function that is provided
- * with a basic `ActionState` object with features that are always available.
- * Each Action can then augment the `state` further if additional features are required.
- */
-export type ActionMain = (
-  state: ActionState<["Base", "Logger", "Env", "Actions"]>,
-) => Promise;
-
-/** A specification for a CodeQL Action step. */
-export interface Action {
-  /** The name of the Action. */
-  name: ActionName;
-  /** The entry point for the Action. */
-  run: ActionMain;
-  /**
-   * An optional function that transforms a caught error into a message suitable for
-   * inclusion in a status report. This is primarily intended for the `start-proxy`
-   * action to replace the thrown `Error`'s message with a safe one.
-   */
-  transformTelemetryError?: (error: Error) => string;
-}
-
-/** A generic entry point that sets up the basic environment for the `action` and runs it. */
-export async function runInActions(action: Action) {
-  const startedAt = new Date();
-  const logger = getActionsLogger();
-  const env = getEnv();
-  const actionsEnv = getActionsEnv();
-
-  try {
-    const actionState = {
-      name: action.name,
-      startedAt,
-      logger,
-      env,
-      actions: actionsEnv,
-    };
-
-    // Create a unique identifier for this run.
-    getJobUUID(actionState);
-
-    await action.run(actionState);
-  } catch (error) {
-    core.setFailed(
-      `${getDisplayActionName(action.name)} action failed: ${getErrorMessage(error)}`,
-    );
-
-    const statusReportError =
-      action.transformTelemetryError !== undefined
-        ? action.transformTelemetryError(wrapError(error))
-        : error;
-    await sendUnhandledErrorStatusReport(
-      action.name,
-      startedAt,
-      statusReportError,
-      logger,
-    );
-  }
-}
diff --git a/src/action-entry.js.tpl b/src/action-entry.js.tpl
deleted file mode 100644
index aabcfd3efa..0000000000
--- a/src/action-entry.js.tpl
+++ /dev/null
@@ -1,4 +0,0 @@
-"use strict";
-
-const import_entry_points = require("./entry-points");
-void (0, import_entry_points.run__ACTION__)();
diff --git a/src/actions-util.test.ts b/src/actions-util.test.ts
deleted file mode 100644
index 3940cf7551..0000000000
--- a/src/actions-util.test.ts
+++ /dev/null
@@ -1,281 +0,0 @@
-import * as github from "@actions/github";
-import test from "ava";
-
-import {
-  fixCodeQualityCategory,
-  getPullRequestBranches,
-  isAnalyzingPullRequest,
-  isDefaultSetup,
-  isDynamicWorkflow,
-} from "./actions-util";
-import { computeAutomationID } from "./api-client";
-import { EnvVar } from "./environment";
-import { getRunnerLogger } from "./logging";
-import { setupTests } from "./testing-utils";
-import { initializeEnvironment } from "./util";
-
-setupTests(test);
-
-function withMockedContext(mockPayload: any, testFn: () => T): T {
-  const originalPayload = github.context.payload;
-  github.context.payload = mockPayload;
-  try {
-    return testFn();
-  } finally {
-    github.context.payload = originalPayload;
-  }
-}
-
-function withMockedEnv(
-  envVars: Record,
-  testFn: () => T,
-): T {
-  const originalEnv = { ...process.env };
-
-  // Apply environment changes
-  for (const [key, value] of Object.entries(envVars)) {
-    if (value === undefined) {
-      delete process.env[key];
-    } else {
-      process.env[key] = value;
-    }
-  }
-
-  try {
-    return testFn();
-  } finally {
-    // Restore original environment
-    process.env = originalEnv;
-  }
-}
-
-test("computeAutomationID()", async (t) => {
-  let actualAutomationID = computeAutomationID(
-    ".github/workflows/codeql-analysis.yml:analyze",
-    '{"language": "javascript", "os": "linux"}',
-  );
-  t.deepEqual(
-    actualAutomationID,
-    ".github/workflows/codeql-analysis.yml:analyze/language:javascript/os:linux/",
-  );
-
-  // check the environment sorting
-  actualAutomationID = computeAutomationID(
-    ".github/workflows/codeql-analysis.yml:analyze",
-    '{"os": "linux", "language": "javascript"}',
-  );
-  t.deepEqual(
-    actualAutomationID,
-    ".github/workflows/codeql-analysis.yml:analyze/language:javascript/os:linux/",
-  );
-
-  // check that an empty environment produces the right results
-  actualAutomationID = computeAutomationID(
-    ".github/workflows/codeql-analysis.yml:analyze",
-    "{}",
-  );
-  t.deepEqual(
-    actualAutomationID,
-    ".github/workflows/codeql-analysis.yml:analyze/",
-  );
-
-  // check non string environment values
-  actualAutomationID = computeAutomationID(
-    ".github/workflows/codeql-analysis.yml:analyze",
-    '{"number": 1, "object": {"language": "javascript"}}',
-  );
-  t.deepEqual(
-    actualAutomationID,
-    ".github/workflows/codeql-analysis.yml:analyze/number:/object:/",
-  );
-
-  // check undefined environment
-  actualAutomationID = computeAutomationID(
-    ".github/workflows/codeql-analysis.yml:analyze",
-    undefined,
-  );
-  t.deepEqual(
-    actualAutomationID,
-    ".github/workflows/codeql-analysis.yml:analyze/",
-  );
-});
-
-test.serial("getPullRequestBranches() with pull request context", (t) => {
-  withMockedContext(
-    {
-      pull_request: {
-        number: 123,
-        base: { ref: "main" },
-        head: { label: "user:feature-branch" },
-      },
-    },
-    () => {
-      t.deepEqual(getPullRequestBranches(), {
-        base: "main",
-        head: "user:feature-branch",
-      });
-      t.is(isAnalyzingPullRequest(), true);
-    },
-  );
-});
-
-test.serial(
-  "getPullRequestBranches() returns undefined with push context",
-  (t) => {
-    withMockedContext(
-      {
-        push: {
-          ref: "refs/heads/main",
-        },
-      },
-      () => {
-        t.is(getPullRequestBranches(), undefined);
-        t.is(isAnalyzingPullRequest(), false);
-      },
-    );
-  },
-);
-
-test.serial(
-  "getPullRequestBranches() with Default Setup environment variables",
-  (t) => {
-    withMockedContext({}, () => {
-      withMockedEnv(
-        {
-          CODE_SCANNING_REF: "refs/heads/feature-branch",
-          CODE_SCANNING_BASE_BRANCH: "main",
-        },
-        () => {
-          t.deepEqual(getPullRequestBranches(), {
-            base: "main",
-            head: "refs/heads/feature-branch",
-          });
-          t.is(isAnalyzingPullRequest(), true);
-        },
-      );
-    });
-  },
-);
-
-test.serial(
-  "getPullRequestBranches() returns undefined when only CODE_SCANNING_REF is set",
-  (t) => {
-    withMockedContext({}, () => {
-      withMockedEnv(
-        {
-          CODE_SCANNING_REF: "refs/heads/feature-branch",
-          CODE_SCANNING_BASE_BRANCH: undefined,
-        },
-        () => {
-          t.is(getPullRequestBranches(), undefined);
-          t.is(isAnalyzingPullRequest(), false);
-        },
-      );
-    });
-  },
-);
-
-test.serial(
-  "getPullRequestBranches() returns undefined when only CODE_SCANNING_BASE_BRANCH is set",
-  (t) => {
-    withMockedContext({}, () => {
-      withMockedEnv(
-        {
-          CODE_SCANNING_REF: undefined,
-          CODE_SCANNING_BASE_BRANCH: "main",
-        },
-        () => {
-          t.is(getPullRequestBranches(), undefined);
-          t.is(isAnalyzingPullRequest(), false);
-        },
-      );
-    });
-  },
-);
-
-test.serial(
-  "getPullRequestBranches() returns undefined when no PR context",
-  (t) => {
-    withMockedContext({}, () => {
-      withMockedEnv(
-        {
-          CODE_SCANNING_REF: undefined,
-          CODE_SCANNING_BASE_BRANCH: undefined,
-        },
-        () => {
-          t.is(getPullRequestBranches(), undefined);
-          t.is(isAnalyzingPullRequest(), false);
-        },
-      );
-    });
-  },
-);
-
-test.serial("initializeEnvironment", (t) => {
-  initializeEnvironment("1.2.3");
-  t.deepEqual(process.env[EnvVar.VERSION], "1.2.3");
-});
-
-test.serial("fixCodeQualityCategory", (t) => {
-  withMockedEnv(
-    {
-      GITHUB_EVENT_NAME: "dynamic",
-    },
-    () => {
-      const logger = getRunnerLogger(true);
-
-      // Categories that should get adjusted.
-      t.is(fixCodeQualityCategory(logger, "/language:c#"), "/language:csharp");
-      t.is(fixCodeQualityCategory(logger, "/language:cpp"), "/language:c-cpp");
-      t.is(fixCodeQualityCategory(logger, "/language:c"), "/language:c-cpp");
-      t.is(
-        fixCodeQualityCategory(logger, "/language:java"),
-        "/language:java-kotlin",
-      );
-      t.is(
-        fixCodeQualityCategory(logger, "/language:javascript"),
-        "/language:javascript-typescript",
-      );
-      t.is(
-        fixCodeQualityCategory(logger, "/language:typescript"),
-        "/language:javascript-typescript",
-      );
-      t.is(
-        fixCodeQualityCategory(logger, "/language:kotlin"),
-        "/language:java-kotlin",
-      );
-
-      // Categories that should not get adjusted.
-      t.is(
-        fixCodeQualityCategory(logger, "/language:csharp"),
-        "/language:csharp",
-      );
-      t.is(fixCodeQualityCategory(logger, "/language:go"), "/language:go");
-      t.is(
-        fixCodeQualityCategory(logger, "/language:actions"),
-        "/language:actions",
-      );
-
-      // Other cases.
-      t.is(fixCodeQualityCategory(logger, undefined), undefined);
-      t.is(fixCodeQualityCategory(logger, "random string"), "random string");
-      t.is(fixCodeQualityCategory(logger, "kotlin"), "kotlin");
-    },
-  );
-});
-
-test.serial(
-  "isDynamicWorkflow() returns true if event name is `dynamic`",
-  (t) => {
-    process.env.GITHUB_EVENT_NAME = "dynamic";
-    t.assert(isDynamicWorkflow());
-    process.env.GITHUB_EVENT_NAME = "push";
-    t.false(isDynamicWorkflow());
-  },
-);
-
-test.serial("isDefaultSetup() returns true when expected", (t) => {
-  process.env.GITHUB_EVENT_NAME = "dynamic";
-  process.env[EnvVar.ANALYSIS_KEY] = "dynamic/github-code-scanning";
-  t.assert(isDefaultSetup());
-});
diff --git a/src/actions-util.ts b/src/actions-util.ts
deleted file mode 100644
index dd5124620d..0000000000
--- a/src/actions-util.ts
+++ /dev/null
@@ -1,503 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as core from "@actions/core";
-import * as toolrunner from "@actions/exec/lib/toolrunner";
-import * as github from "@actions/github";
-import * as io from "@actions/io";
-
-import type { Config } from "./config-utils";
-import { Env, EnvVar, ActionsEnvVars } from "./environment";
-import { Logger } from "./logging";
-import {
-  doesDirectoryExist,
-  getCodeQLDatabasePath,
-  ConfigurationError,
-  getEnv,
-} from "./util";
-
-/**
- * This constant is set to the value of the `"version"` property in `package.json` by `esbuild`.
- * It is also set in `ava.setup.mjs` for tests.
- */
-declare const __CODEQL_ACTION_VERSION__: string;
-
-/**
- * Abstracts over GitHub Actions functions so that we do not have to stub
- * global functions in tests.
- */
-export interface ActionsEnv {
-  getRequiredInput: (name: string) => string;
-  getOptionalInput: (name: string) => string | undefined;
-  exportVariable: (name: string, value: string) => void;
-}
-
-/**
- * Gets the real `ActionsEnv` used by production code.
- */
-export function getActionsEnv(): ActionsEnv {
-  return {
-    getRequiredInput,
-    getOptionalInput,
-    exportVariable: core.exportVariable,
-  };
-}
-
-/**
- * Wrapper around core.getInput for inputs that always have a value.
- * Also see getOptionalInput.
- *
- * This allows us to get stronger type checking of required/optional inputs.
- */
-export const getRequiredInput = function (name: string): string {
-  const value = core.getInput(name);
-  if (!value) {
-    throw new ConfigurationError(`Input required and not supplied: ${name}`);
-  }
-  return value;
-};
-
-/**
- * Wrapper around core.getInput that converts empty inputs to undefined.
- * Also see getRequiredInput.
- *
- * This allows us to get stronger type checking of required/optional inputs.
- */
-export const getOptionalInput = function (name: string): string | undefined {
-  const value = core.getInput(name);
-  return value.length > 0 ? value : undefined;
-};
-
-/**
- * Gets the temporary directory used by the CodeQL Action. This will either be the temporary
- * directory that has been set in `CODEQL_ACTION_TEMP` by e.g. a previous step, or the
- * value of `RUNNER_TEMP` otherwise.
- */
-export function getTemporaryDirectory(env: Env = getEnv()): string {
-  return (
-    env.getOptional(EnvVar.TEMP) ?? env.getRequired(ActionsEnvVars.RUNNER_TEMP)
-  );
-}
-
-const PR_DIFF_RANGE_JSON_FILENAME = "pr-diff-range.json";
-
-export function getDiffRangesJsonFilePath(env: Env = getEnv()): string {
-  return path.join(getTemporaryDirectory(env), PR_DIFF_RANGE_JSON_FILENAME);
-}
-
-export function getActionVersion(): string {
-  return __CODEQL_ACTION_VERSION__;
-}
-
-/**
- * Returns the name of the event that triggered this workflow.
- *
- * This will be "dynamic" for default setup workflow runs.
- */
-export function getWorkflowEventName(env: Env = getEnv()) {
-  return env.getRequired(ActionsEnvVars.GITHUB_EVENT_NAME);
-}
-
-/**
- * Returns whether the current workflow is executing a local copy of the Action, e.g. we're running
- * a workflow on the codeql-action repo itself.
- */
-export function isRunningLocalAction(env: Env = getEnv()): boolean {
-  const relativeScriptPath = getRelativeScriptPath(env);
-  return (
-    relativeScriptPath.startsWith("..") || path.isAbsolute(relativeScriptPath)
-  );
-}
-
-/**
- * Get the location where the Action is running from.
- *
- * This can be used to get the Action's name or tell if we're running a local Action.
- */
-function getRelativeScriptPath(env: Env): string {
-  const runnerTemp = env.getRequired(ActionsEnvVars.RUNNER_TEMP);
-  const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions");
-  return path.relative(actionsDirectory, __filename);
-}
-
-/** Returns the contents of `GITHUB_EVENT_PATH` as a JSON object. */
-export function getWorkflowEvent(env: Env = getEnv()): any {
-  const eventJsonFile = env.getRequired(ActionsEnvVars.GITHUB_EVENT_PATH);
-  try {
-    return JSON.parse(fs.readFileSync(eventJsonFile, "utf-8"));
-  } catch (e) {
-    throw new Error(
-      `Unable to read workflow event JSON from ${eventJsonFile}: ${e}`,
-    );
-  }
-}
-
-export async function printDebugLogs(config: Config) {
-  for (const language of config.languages) {
-    const databaseDirectory = getCodeQLDatabasePath(config, language);
-    const logsDirectory = path.join(databaseDirectory, "log");
-    if (!doesDirectoryExist(logsDirectory)) {
-      core.info(`Directory ${logsDirectory} does not exist.`);
-      continue; // Skip this language database.
-    }
-
-    const walkLogFiles = (dir: string) => {
-      const entries = fs.readdirSync(dir, { withFileTypes: true });
-      if (entries.length === 0) {
-        core.info(`No debug logs found at directory ${logsDirectory}.`);
-      }
-      for (const entry of entries) {
-        if (entry.isFile()) {
-          const absolutePath = path.resolve(dir, entry.name);
-          core.startGroup(
-            `CodeQL Debug Logs - ${language} - ${entry.name} from file at path ${absolutePath}`,
-          );
-          process.stdout.write(fs.readFileSync(absolutePath));
-          core.endGroup();
-        } else if (entry.isDirectory()) {
-          walkLogFiles(path.resolve(dir, entry.name));
-        }
-      }
-    };
-    walkLogFiles(logsDirectory);
-  }
-}
-
-export type UploadKind = "always" | "failure-only" | "never";
-
-/**
- * Parses the `upload` input into an `UploadKind`, converting unspecified and deprecated upload
- * inputs appropriately.
- */
-export function getUploadValue(input: string | undefined): UploadKind {
-  switch (input) {
-    case undefined:
-    case "true":
-    case "always":
-      return "always";
-    case "false":
-    case "failure-only":
-      return "failure-only";
-    case "never":
-      return "never";
-    default:
-      core.warning(
-        `Unrecognized 'upload' input to 'analyze' Action: ${input}. Defaulting to 'always'.`,
-      );
-      return "always";
-  }
-}
-
-/**
- * Get the workflow run ID.
- */
-export function getWorkflowRunID(env: Env = getEnv()): number {
-  const workflowRunIdString = env.getRequired(ActionsEnvVars.GITHUB_RUN_ID);
-  const workflowRunID = parseInt(workflowRunIdString, 10);
-  if (Number.isNaN(workflowRunID)) {
-    throw new Error(
-      `${ActionsEnvVars.GITHUB_RUN_ID} must define a non NaN workflow run ID. Current value is ${workflowRunIdString}`,
-    );
-  }
-  if (workflowRunID < 0) {
-    throw new Error(
-      `${ActionsEnvVars.GITHUB_RUN_ID} must be a non-negative integer. Current value is ${workflowRunIdString}`,
-    );
-  }
-  return workflowRunID;
-}
-
-/**
- * Get the workflow run attempt number.
- */
-export function getWorkflowRunAttempt(env: Env = getEnv()): number {
-  const workflowRunAttemptString = env.getRequired(
-    ActionsEnvVars.GITHUB_RUN_ATTEMPT,
-  );
-  const workflowRunAttempt = parseInt(workflowRunAttemptString, 10);
-  if (Number.isNaN(workflowRunAttempt)) {
-    throw new Error(
-      `${ActionsEnvVars.GITHUB_RUN_ATTEMPT} must define a non NaN workflow run attempt. Current value is ${workflowRunAttemptString}`,
-    );
-  }
-  if (workflowRunAttempt <= 0) {
-    throw new Error(
-      `${ActionsEnvVars.GITHUB_RUN_ATTEMPT} must be a positive integer. Current value is ${workflowRunAttemptString}`,
-    );
-  }
-  return workflowRunAttempt;
-}
-
-export class FileCmdNotFoundError extends Error {
-  constructor(msg: string) {
-    super(msg);
-
-    this.name = "FileCmdNotFoundError";
-  }
-}
-
-/**
- * Tries to obtain the output of the `file` command for the file at the specified path.
- * The output will vary depending on the type of `file`, which operating system we are running on, etc.
- */
-export const getFileType = async (filePath: string): Promise => {
-  let stderr = "";
-  let stdout = "";
-
-  let fileCmdPath: string;
-
-  try {
-    fileCmdPath = await io.which("file", true);
-  } catch (e) {
-    throw new FileCmdNotFoundError(
-      `The \`file\` program is required, but does not appear to be installed. Please install it: ${e}`,
-    );
-  }
-
-  try {
-    // The `file` command will output information about the type of file pointed at by `filePath`.
-    // For binary files, this may include e.g. whether they are static of dynamic binaries.
-    // The `-L` switch instructs the command to follow symbolic links.
-    await new toolrunner.ToolRunner(fileCmdPath, ["-L", filePath], {
-      silent: true,
-      listeners: {
-        stdout: (data) => {
-          stdout += data.toString();
-        },
-        stderr: (data) => {
-          stderr += data.toString();
-        },
-      },
-    }).exec();
-    return stdout.trim();
-  } catch (e) {
-    core.info(
-      `Could not determine type of ${filePath} from ${stdout}. ${stderr}`,
-    );
-
-    throw e;
-  }
-};
-
-export function isSelfHostedRunner(env: Env = getEnv()) {
-  return env.getOptional(ActionsEnvVars.RUNNER_ENVIRONMENT) === "self-hosted";
-}
-
-/** Determines whether the workflow trigger is `dynamic`. */
-export function isDynamicWorkflow(env: Env = getEnv()): boolean {
-  return getWorkflowEventName(env) === "dynamic";
-}
-
-/** Determines whether we are running in default setup. */
-export function isDefaultSetup(env: Env = getEnv()): boolean {
-  return isDynamicWorkflow(env);
-}
-
-export function prettyPrintInvocation(cmd: string, args: string[]): string {
-  return [cmd, ...args].map((x) => (x.includes(" ") ? `'${x}'` : x)).join(" ");
-}
-
-/**
- * An error from a tool invocation, with associated exit code, stderr, etc.
- */
-export class CommandInvocationError extends Error {
-  constructor(
-    public cmd: string,
-    public args: string[],
-    public exitCode: number | undefined,
-    public stderr: string,
-    public stdout: string = "",
-  ) {
-    const prettyCommand = prettyPrintInvocation(cmd, args);
-    const lastLine = ensureEndsInPeriod(
-      stderr.trim().split("\n").pop()?.trim() || "n/a",
-    );
-    super(
-      `Failed to run "${prettyCommand}". ` +
-        `Exit code was ${exitCode} and last log line was: ${lastLine} See the logs for more details.`,
-    );
-  }
-}
-
-export function ensureEndsInPeriod(text: string): string {
-  return text[text.length - 1] === "." ? text : `${text}.`;
-}
-
-/**
- * A constant defining the maximum number of characters we will keep from
- * the programs stderr for logging.
- *
- * This serves two purposes:
- * 1. It avoids an OOM if a program fails in a way that results it
- *    printing many log lines.
- * 2. It avoids us hitting the limit of how much data we can send in our
- *    status reports on GitHub.com.
- */
-const MAX_STDERR_BUFFER_SIZE = 20000;
-
-/**
- * Runs a CLI tool.
- *
- * @returns Standard output produced by the tool.
- * @throws A `CommandInvocationError` if the tool exits with a non-zero status code.
- */
-export async function runTool(
-  cmd: string,
-  args: string[] = [],
-  opts: { stdin?: string; noStreamStdout?: boolean } = {},
-): Promise {
-  let stdout = "";
-  let stderr = "";
-  if (!opts.noStreamStdout) {
-    process.stdout.write(`[command]${cmd} ${args.join(" ")}\n`);
-  }
-  const exitCode = await new toolrunner.ToolRunner(cmd, args, {
-    ignoreReturnCode: true,
-    listeners: {
-      stdout: (data: Buffer) => {
-        stdout += data.toString("utf8");
-        if (!opts.noStreamStdout) {
-          process.stdout.write(data);
-        }
-      },
-      stderr: (data: Buffer) => {
-        let readStartIndex = 0;
-        // If the error is too large, then we only take the last MAX_STDERR_BUFFER_SIZE characters
-        if (data.length - MAX_STDERR_BUFFER_SIZE > 0) {
-          // Eg: if we have MAX_STDERR_BUFFER_SIZE the start index should be 2.
-          readStartIndex = data.length - MAX_STDERR_BUFFER_SIZE + 1;
-        }
-        stderr += data.toString("utf8", readStartIndex);
-        // Mimic the standard behavior of the toolrunner by writing stderr to stdout
-        process.stdout.write(data);
-      },
-    },
-    silent: true,
-    ...(opts.stdin ? { input: Buffer.from(opts.stdin || "") } : {}),
-  }).exec();
-  if (exitCode !== 0) {
-    throw new CommandInvocationError(cmd, args, exitCode, stderr, stdout);
-  }
-  return stdout;
-}
-
-const persistedInputsKey = "persisted_inputs";
-
-/**
- * Persists all inputs to the action as state that can be retrieved later in the post-action.
- * This would be simplified if actions/runner#3514 is addressed.
- * https://github.com/actions/runner/issues/3514
- */
-export const persistInputs = function (env: Env = getEnv()) {
-  const entries = env.entries();
-  const inputEnvironmentVariables = entries.filter(([name]) =>
-    name.startsWith("INPUT_"),
-  );
-  core.saveState(persistedInputsKey, JSON.stringify(inputEnvironmentVariables));
-};
-
-/**
- * Restores all inputs to the action from the persisted state.
- */
-export const restoreInputs = function () {
-  const persistedInputs = core.getState(persistedInputsKey);
-  if (persistedInputs) {
-    for (const [name, value] of JSON.parse(persistedInputs)) {
-      process.env[name] = value;
-    }
-  }
-};
-
-export interface PullRequestBranches {
-  base: string;
-  head: string;
-}
-
-/**
- * Returns the base and head branches of the pull request being analyzed.
- *
- * @returns the base and head branches of the pull request, or undefined if
- * we are not analyzing a pull request.
- */
-export function getPullRequestBranches(
-  env: Env = getEnv(),
-): PullRequestBranches | undefined {
-  const pullRequest = github.context.payload.pull_request;
-  if (pullRequest) {
-    return {
-      base: pullRequest.base.ref,
-      // We use the head label instead of the head ref here, because the head
-      // ref lacks owner information and by itself does not uniquely identify
-      // the head branch (which may be in a forked repository).
-      head: pullRequest.head.label,
-    };
-  }
-
-  // PR analysis under Default Setup does not have the pull_request context,
-  // but it should set CODE_SCANNING_REF and CODE_SCANNING_BASE_BRANCH.
-  const codeScanningRef = env.getOptional(EnvVar.CODE_SCANNING_REF);
-  const codeScanningBaseBranch = env.getOptional(
-    EnvVar.CODE_SCANNING_BASE_BRANCH,
-  );
-  if (codeScanningRef && codeScanningBaseBranch) {
-    return {
-      base: codeScanningBaseBranch,
-      // PR analysis under Default Setup analyzes the PR head commit instead of
-      // the merge commit, so we can use the provided ref directly.
-      head: codeScanningRef,
-    };
-  }
-  return undefined;
-}
-
-/**
- * Returns whether we are analyzing a pull request.
- */
-export function isAnalyzingPullRequest(env: Env = getEnv()): boolean {
-  return getPullRequestBranches(env) !== undefined;
-}
-
-/**
- * A workaround for code quality to map category names from old default setup workflows
- * to ones that the code quality service expects.
- */
-const qualityCategoryMapping: Record = {
-  "c#": "csharp",
-  cpp: "c-cpp",
-  c: "c-cpp",
-  "c++": "c-cpp",
-  java: "java-kotlin",
-  javascript: "javascript-typescript",
-  typescript: "javascript-typescript",
-  kotlin: "java-kotlin",
-};
-
-/** Adjusts the category string for a Code Quality SARIF file if an "old"
- * category identifier is used by Default Setup.
- */
-export function fixCodeQualityCategory(
-  logger: Logger,
-  category?: string,
-  env: Env = getEnv(),
-): string | undefined {
-  // The `category` should always be set by Default Setup. We perform this check
-  // to avoid potential issues if Code Quality supports Advanced Setup in the future
-  // and before this workaround is removed.
-  if (
-    category !== undefined &&
-    isDefaultSetup(env) &&
-    category.startsWith("/language:")
-  ) {
-    const language = category.substring("/language:".length);
-    const mappedLanguage = qualityCategoryMapping[language];
-    if (mappedLanguage) {
-      const newCategory = `/language:${mappedLanguage}`;
-      logger.info(
-        `Adjusted category for Code Quality from '${category}' to '${newCategory}'.`,
-      );
-      return newCategory;
-    }
-  }
-
-  return category;
-}
diff --git a/src/analyses.test.ts b/src/analyses.test.ts
deleted file mode 100644
index 9d0a9eb3e0..0000000000
--- a/src/analyses.test.ts
+++ /dev/null
@@ -1,289 +0,0 @@
-import path from "path";
-
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import {
-  AnalysisKind,
-  CodeScanning,
-  compatibilityMatrix,
-  RiskAssessment,
-  getAnalysisConfig,
-  getAnalysisKinds,
-  parseAnalysisKinds,
-  supportedAnalysisKinds,
-} from "./analyses";
-import { EnvVar } from "./environment";
-import { getRunnerLogger } from "./logging";
-import {
-  createFeatures,
-  RecordingLogger,
-  setupBaseActionsVars,
-  setupTests,
-} from "./testing-utils";
-import { AssessmentPayload } from "./upload-lib/types";
-import { ConfigurationError } from "./util";
-
-setupTests(test);
-
-test("All known analysis kinds can be parsed successfully", async (t) => {
-  for (const analysisKind of supportedAnalysisKinds) {
-    t.deepEqual(await parseAnalysisKinds(analysisKind), [analysisKind]);
-  }
-});
-
-test("Parsing analysis kinds returns unique results", async (t) => {
-  const analysisKinds = await parseAnalysisKinds(
-    "code-scanning,code-quality,code-scanning",
-  );
-  t.deepEqual(analysisKinds, [
-    AnalysisKind.CodeScanning,
-    AnalysisKind.CodeQuality,
-  ]);
-});
-
-test("Parsing an unknown analysis kind fails with a configuration error", async (t) => {
-  await t.throwsAsync(parseAnalysisKinds("code-scanning,foo"), {
-    instanceOf: ConfigurationError,
-  });
-});
-
-test("Parsing analysis kinds requires at least one analysis kind", async (t) => {
-  await t.throwsAsync(parseAnalysisKinds(","), {
-    instanceOf: ConfigurationError,
-  });
-});
-
-test.serial(
-  "getAnalysisKinds - returns expected analysis kinds for `analysis-kinds` input",
-  async (t) => {
-    process.env[EnvVar.TEST_MODE] = "true";
-    const features = createFeatures([]);
-    const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-    requiredInputStub
-      .withArgs("analysis-kinds")
-      .returns("code-scanning,code-quality");
-    const result = await getAnalysisKinds(
-      getRunnerLogger(true),
-      features,
-      true,
-    );
-    t.assert(result.includes(AnalysisKind.CodeScanning));
-    t.assert(result.includes(AnalysisKind.CodeQuality));
-  },
-);
-
-test.serial(
-  "getAnalysisKinds - only use `code-scanning` for multiple analysis kinds outside of test mode",
-  async (t) => {
-    setupBaseActionsVars();
-    process.env[EnvVar.TEST_MODE] = "false";
-    const features = createFeatures([]);
-    const logger = new RecordingLogger();
-    const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-    requiredInputStub
-      .withArgs("analysis-kinds")
-      .returns("code-scanning,code-quality");
-    const result = await getAnalysisKinds(logger, features, true);
-    t.deepEqual(result, [AnalysisKind.CodeScanning]);
-    t.assert(
-      logger.hasMessage(
-        "Continuing with only `analysis-kinds: code-scanning`.",
-      ),
-    );
-  },
-);
-
-test.serial(
-  "getAnalysisKinds - logs error for non-default `analysis-kinds` in custom workflow",
-  async (t) => {
-    setupBaseActionsVars({ GITHUB_EVENT_NAME: "push" });
-    process.env[EnvVar.TEST_MODE] = "false";
-    const features = createFeatures([]);
-    const logger = new RecordingLogger();
-    const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-    requiredInputStub.withArgs("analysis-kinds").returns("code-quality");
-    const result = await getAnalysisKinds(logger, features, true);
-    t.deepEqual(result, [AnalysisKind.CodeQuality]);
-    t.assert(
-      logger.hasMessage(
-        "An analysis kind other than `code-scanning` was specified in a custom workflow.",
-      ),
-    );
-  },
-);
-
-test.serial(
-  "getAnalysisKinds - no error for non-default `analysis-kinds` in managed workflow",
-  async (t) => {
-    setupBaseActionsVars({ GITHUB_EVENT_NAME: "dynamic" });
-    process.env[EnvVar.TEST_MODE] = "false";
-    const features = createFeatures([]);
-    const logger = new RecordingLogger();
-    const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-    requiredInputStub.withArgs("analysis-kinds").returns("code-quality");
-    const result = await getAnalysisKinds(logger, features, true);
-    t.deepEqual(result, [AnalysisKind.CodeQuality]);
-    t.deepEqual(logger.messages, []);
-  },
-);
-
-test.serial(
-  "getAnalysisKinds - includes `code-quality` when deprecated `quality-queries` input is used",
-  async (t) => {
-    process.env[EnvVar.TEST_MODE] = "true";
-    const features = createFeatures([]);
-    const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-    requiredInputStub.withArgs("analysis-kinds").returns("code-scanning");
-    const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
-    optionalInputStub.withArgs("quality-queries").returns("code-quality");
-    const result = await getAnalysisKinds(
-      getRunnerLogger(true),
-      features,
-      true,
-    );
-    t.assert(result.includes(AnalysisKind.CodeScanning));
-    t.assert(result.includes(AnalysisKind.CodeQuality));
-  },
-);
-
-test.serial(
-  "getAnalysisKinds - throws if `analysis-kinds` input is invalid",
-  async (t) => {
-    const features = createFeatures([]);
-    const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-    requiredInputStub.withArgs("analysis-kinds").returns("no-such-thing");
-    await t.throwsAsync(
-      getAnalysisKinds(getRunnerLogger(true), features, true),
-    );
-  },
-);
-
-// Test the compatibility matrix by looping through all analysis kinds.
-const analysisKinds = Object.values(AnalysisKind);
-for (let i = 0; i < analysisKinds.length; i++) {
-  const analysisKind = analysisKinds[i];
-
-  for (let j = i + 1; j < analysisKinds.length; j++) {
-    const otherAnalysis = analysisKinds[j];
-
-    if (analysisKind === otherAnalysis) continue;
-    if (compatibilityMatrix[analysisKind].has(otherAnalysis)) {
-      test.serial(
-        `getAnalysisKinds - allows ${analysisKind} with ${otherAnalysis}`,
-        async (t) => {
-          setupBaseActionsVars();
-          process.env[EnvVar.TEST_MODE] = "true";
-          const features = createFeatures([]);
-          const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-          requiredInputStub
-            .withArgs("analysis-kinds")
-            .returns([analysisKind, otherAnalysis].join(","));
-          const result = await getAnalysisKinds(
-            getRunnerLogger(true),
-            features,
-            true,
-          );
-          t.is(result.length, 2);
-        },
-      );
-    } else {
-      test.serial(
-        `getAnalysisKinds - throws if ${analysisKind} is enabled with ${otherAnalysis}`,
-        async (t) => {
-          setupBaseActionsVars();
-          const features = createFeatures([]);
-          const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-          requiredInputStub
-            .withArgs("analysis-kinds")
-            .returns([analysisKind, otherAnalysis].join(","));
-          await t.throwsAsync(
-            getAnalysisKinds(getRunnerLogger(true), features, true),
-            {
-              instanceOf: ConfigurationError,
-              message: `${analysisKind} and ${otherAnalysis} cannot be enabled at the same time`,
-            },
-          );
-        },
-      );
-    }
-  }
-}
-
-test("Code Scanning configuration does not accept other SARIF extensions", (t) => {
-  for (const analysisKind of supportedAnalysisKinds) {
-    if (analysisKind === AnalysisKind.CodeScanning) continue;
-
-    const analysis = getAnalysisConfig(analysisKind);
-    const sarifPath = path.join("path", "to", `file${analysis.sarifExtension}`);
-
-    // The Code Scanning configuration's `sarifPredicate` should not accept a path which
-    // ends in a different configuration's `sarifExtension`.
-    t.false(CodeScanning.sarifPredicate(sarifPath));
-  }
-});
-
-test.serial(
-  "Risk Assessment configuration transforms SARIF upload payload",
-  (t) => {
-    process.env[EnvVar.RISK_ASSESSMENT_ID] = "1";
-    const payload = RiskAssessment.transformPayload({
-      commit_oid: "abc",
-      sarif: "sarif",
-      ref: "ref",
-      workflow_run_attempt: 1,
-      workflow_run_id: 1,
-      checkout_uri: "uri",
-      tool_names: [],
-    }) as AssessmentPayload;
-
-    const expected: AssessmentPayload = { sarif: "sarif", assessment_id: 1 };
-    t.deepEqual(expected, payload);
-  },
-);
-
-test.serial(
-  "Risk Assessment configuration throws for negative assessment IDs",
-  (t) => {
-    process.env[EnvVar.RISK_ASSESSMENT_ID] = "-1";
-    t.throws(
-      () =>
-        RiskAssessment.transformPayload({
-          commit_oid: "abc",
-          sarif: "sarif",
-          ref: "ref",
-          workflow_run_attempt: 1,
-          workflow_run_id: 1,
-          checkout_uri: "uri",
-          tool_names: [],
-        }),
-      {
-        instanceOf: Error,
-        message: (msg) =>
-          msg.startsWith(`${EnvVar.RISK_ASSESSMENT_ID} must not be negative: `),
-      },
-    );
-  },
-);
-
-test.serial("Risk Assessment configuration throws for invalid IDs", (t) => {
-  process.env[EnvVar.RISK_ASSESSMENT_ID] = "foo";
-  t.throws(
-    () =>
-      RiskAssessment.transformPayload({
-        commit_oid: "abc",
-        sarif: "sarif",
-        ref: "ref",
-        workflow_run_attempt: 1,
-        workflow_run_id: 1,
-        checkout_uri: "uri",
-        tool_names: [],
-      }),
-    {
-      instanceOf: Error,
-      message: (msg) =>
-        msg.startsWith(`${EnvVar.RISK_ASSESSMENT_ID} must not be NaN: `),
-    },
-  );
-});
diff --git a/src/analyses.ts b/src/analyses.ts
deleted file mode 100644
index 5f81e1f8ec..0000000000
--- a/src/analyses.ts
+++ /dev/null
@@ -1,301 +0,0 @@
-import {
-  fixCodeQualityCategory,
-  getOptionalInput,
-  getRequiredInput,
-  isDynamicWorkflow,
-} from "./actions-util";
-import { EnvVar } from "./environment";
-import { Feature, FeatureEnablement } from "./feature-flags";
-import { Logger } from "./logging";
-import {
-  AssessmentPayload,
-  BasePayload,
-  UploadPayload,
-} from "./upload-lib/types";
-import { ConfigurationError, getRequiredEnvParam, isInTestMode } from "./util";
-
-export enum AnalysisKind {
-  CodeScanning = "code-scanning",
-  CodeQuality = "code-quality",
-  RiskAssessment = "risk-assessment",
-}
-
-export type CompatibilityMatrix = Record>;
-
-/** A mapping from analysis kinds to other analysis kinds which can be enabled concurrently. */
-export const compatibilityMatrix: CompatibilityMatrix = {
-  [AnalysisKind.CodeScanning]: new Set([AnalysisKind.CodeQuality]),
-  [AnalysisKind.CodeQuality]: new Set([AnalysisKind.CodeScanning]),
-  [AnalysisKind.RiskAssessment]: new Set(),
-};
-
-// Exported for testing. A set of all known analysis kinds.
-export const supportedAnalysisKinds = new Set(Object.values(AnalysisKind));
-
-/**
- * Parses a comma-separated string into a list of unique analysis kinds.
- * Throws a configuration error if the input contains unknown analysis kinds
- * or doesn't contain at least one element.
- *
- * @param input The comma-separated string to parse.
- * @returns The array of unique analysis kinds that were parsed from the input string.
- */
-export async function parseAnalysisKinds(
-  input: string,
-): Promise {
-  const components = input.split(",");
-
-  if (components.length < 1) {
-    throw new ConfigurationError(
-      "At least one analysis kind must be configured.",
-    );
-  }
-
-  for (const component of components) {
-    if (!supportedAnalysisKinds.has(component as AnalysisKind)) {
-      throw new ConfigurationError(`Unknown analysis kind: ${component}`);
-    }
-  }
-
-  // Return all unique elements.
-  return Array.from(
-    new Set(components.map((component) => component as AnalysisKind)),
-  );
-}
-
-// Used to avoid re-parsing the input after we have done it once.
-let cachedAnalysisKinds: AnalysisKind[] | undefined;
-
-/** Determines whether `code-scanning` is the only enabled analysis kind in `analysisKinds`. */
-function isOnlyCodeScanningEnabled(analysisKinds: AnalysisKind[]) {
-  return (
-    analysisKinds.length === 1 && analysisKinds[0] === AnalysisKind.CodeScanning
-  );
-}
-
-/** Prepends a generic message about the intended usage for `analysis-kinds` to `message`. */
-function makeAnalysisKindUsageError(message: string) {
-  return (
-    "The `analysis-kinds` input is experimental and for GitHub-internal use only. " +
-    `Its behaviour may change at any time or be removed entirely. ${message}`
-  );
-}
-
-/**
- * Initialises the analysis kinds for the analysis based on the `analysis-kinds` input.
- * This function will also use the deprecated `quality-queries` input as an indicator to enable `code-quality`.
- * If the `analysis-kinds` input cannot be parsed, a `ConfigurationError` is thrown.
- *
- * @param logger The logger to use.
- * @param skipCache For testing, whether to ignore the cached values (default: false).
- *
- * @returns The array of enabled analysis kinds.
- * @throws A `ConfigurationError` if the `analysis-kinds` input cannot be parsed.
- */
-export async function getAnalysisKinds(
-  logger: Logger,
-  features: FeatureEnablement,
-  skipCache: boolean = false,
-): Promise {
-  if (!skipCache && cachedAnalysisKinds !== undefined) {
-    return cachedAnalysisKinds;
-  }
-
-  const analysisKinds = await parseAnalysisKinds(
-    getRequiredInput("analysis-kinds"),
-  );
-
-  // Log an error if we are outside of a GitHub-managed workflow and an analysis kind
-  // other than `code-scanning` is enabled.
-  if (
-    !isInTestMode() &&
-    !isDynamicWorkflow() &&
-    !isOnlyCodeScanningEnabled(analysisKinds)
-  ) {
-    const codeQualityHint = analysisKinds.includes(AnalysisKind.CodeQuality)
-      ? " If your intention is to use quality queries outside of Code Quality, " +
-        "use the `queries` input with `code-quality` instead."
-      : "";
-
-    logger.error(
-      makeAnalysisKindUsageError(
-        "An analysis kind other than `code-scanning` was specified in a custom workflow. " +
-          `This is not supported and will become a fatal error in a future version of the CodeQL Action.${codeQualityHint}`,
-      ),
-    );
-  }
-
-  // Warn that `quality-queries` is deprecated if there is an argument for it.
-  const qualityQueriesInput = getOptionalInput("quality-queries");
-
-  if (qualityQueriesInput !== undefined) {
-    logger.warning(
-      "The `quality-queries` input is deprecated and will be removed in a future version of the CodeQL Action. " +
-        "Use the `analysis-kinds` input to configure different analysis kinds instead.",
-    );
-  }
-
-  // For backwards compatibility, add Code Quality to the enabled analysis kinds
-  // if an input to `quality-queries` was specified. We should remove this once
-  // `quality-queries` is no longer used.
-  if (
-    !analysisKinds.includes(AnalysisKind.CodeQuality) &&
-    qualityQueriesInput !== undefined
-  ) {
-    analysisKinds.push(AnalysisKind.CodeQuality);
-  }
-
-  // Check that all enabled analysis kinds are compatible with each other.
-  for (const analysisKind of analysisKinds) {
-    for (const otherAnalysisKind of analysisKinds) {
-      if (analysisKind === otherAnalysisKind) continue;
-
-      if (!compatibilityMatrix[analysisKind].has(otherAnalysisKind)) {
-        throw new ConfigurationError(
-          `${analysisKind} and ${otherAnalysisKind} cannot be enabled at the same time`,
-        );
-      }
-    }
-  }
-
-  // Log an error if we have multiple inputs for `analysis-kinds` outside of test mode,
-  // and enable only `code-scanning`.
-  if (
-    !isInTestMode() &&
-    analysisKinds.length > 1 &&
-    !(await features.getValue(Feature.AllowMultipleAnalysisKinds))
-  ) {
-    logger.error(
-      makeAnalysisKindUsageError(
-        "Specifying multiple values as input is no longer supported. " +
-          "Continuing with only `analysis-kinds: code-scanning`.",
-      ),
-    );
-
-    // Only enable Code Scanning.
-    cachedAnalysisKinds = [AnalysisKind.CodeScanning];
-    return cachedAnalysisKinds;
-  }
-
-  // Cache the analysis kinds and return them.
-  cachedAnalysisKinds = analysisKinds;
-  return cachedAnalysisKinds;
-}
-
-/** The queries to use for Code Quality analyses. */
-export const codeQualityQueries: string[] = ["code-quality"];
-
-// Enumerates API endpoints that accept SARIF files.
-enum SARIF_UPLOAD_ENDPOINT {
-  CODE_SCANNING = "PUT /repos/:owner/:repo/code-scanning/analysis",
-  CODE_QUALITY = "PUT /repos/:owner/:repo/code-quality/analysis",
-  RISK_ASSESSMENT = "PUT /repos/:owner/:repo/code-scanning/risk-assessment",
-}
-
-// Represents configurations for different analysis kinds.
-export interface AnalysisConfig {
-  /** The analysis kind the configuration is for. */
-  kind: AnalysisKind;
-  /** A display friendly name for logs. */
-  name: string;
-  /** The API endpoint to upload SARIF files to. */
-  target: SARIF_UPLOAD_ENDPOINT;
-  /** The file extension for SARIF files generated by this kind of analysis. */
-  sarifExtension: string;
-  /** A predicate on filenames to decide whether a SARIF file
-   * belongs to this kind of analysis. */
-  sarifPredicate: (name: string) => boolean;
-  /** Analysis-specific adjustment of the category. */
-  fixCategory: (logger: Logger, category?: string) => string | undefined;
-  /** A prefix for environment variables used to track the uniqueness of SARIF uploads. */
-  sentinelPrefix: string;
-  /** Transforms the upload payload in an analysis-specific way. */
-  transformPayload: (payload: UploadPayload) => BasePayload;
-}
-
-// Represents the Code Scanning analysis configuration.
-export const CodeScanning: AnalysisConfig = {
-  kind: AnalysisKind.CodeScanning,
-  name: "code scanning",
-  target: SARIF_UPLOAD_ENDPOINT.CODE_SCANNING,
-  sarifExtension: ".sarif",
-  sarifPredicate: (name) =>
-    name.endsWith(CodeScanning.sarifExtension) &&
-    !CodeQuality.sarifPredicate(name) &&
-    !RiskAssessment.sarifPredicate(name),
-  fixCategory: (_, category) => category,
-  sentinelPrefix: "CODEQL_UPLOAD_SARIF_",
-  transformPayload: (payload) => payload,
-};
-
-// Represents the Code Quality analysis configuration.
-export const CodeQuality: AnalysisConfig = {
-  kind: AnalysisKind.CodeQuality,
-  name: "code quality",
-  target: SARIF_UPLOAD_ENDPOINT.CODE_QUALITY,
-  sarifExtension: ".quality.sarif",
-  sarifPredicate: (name) => name.endsWith(CodeQuality.sarifExtension),
-  fixCategory: fixCodeQualityCategory,
-  sentinelPrefix: "CODEQL_UPLOAD_QUALITY_SARIF_",
-  transformPayload: (payload) => payload,
-};
-
-/**
- * Retrieves the CSRA assessment id from an environment variable and adds it to the payload.
- * @param payload The base payload.
- */
-function addAssessmentId(payload: UploadPayload): AssessmentPayload {
-  const rawAssessmentId = getRequiredEnvParam(EnvVar.RISK_ASSESSMENT_ID);
-  const assessmentId = parseInt(rawAssessmentId, 10);
-  if (Number.isNaN(assessmentId)) {
-    throw new Error(
-      `${EnvVar.RISK_ASSESSMENT_ID} must not be NaN: ${rawAssessmentId}`,
-    );
-  }
-  if (assessmentId < 0) {
-    throw new Error(
-      `${EnvVar.RISK_ASSESSMENT_ID} must not be negative: ${rawAssessmentId}`,
-    );
-  }
-  return { sarif: payload.sarif, assessment_id: assessmentId };
-}
-
-export const RiskAssessment: AnalysisConfig = {
-  kind: AnalysisKind.RiskAssessment,
-  name: "code scanning risk assessment",
-  target: SARIF_UPLOAD_ENDPOINT.RISK_ASSESSMENT,
-  sarifExtension: ".csra.sarif",
-  sarifPredicate: (name) => name.endsWith(RiskAssessment.sarifExtension),
-  fixCategory: (_, category) => category,
-  sentinelPrefix: "CODEQL_UPLOAD_CSRA_SARIF_",
-  transformPayload: addAssessmentId,
-};
-
-/**
- * Gets the `AnalysisConfig` corresponding to `kind`.
- * @param kind The analysis kind to get the `AnalysisConfig` for.
- * @returns The `AnalysisConfig` corresponding to `kind`.
- */
-export function getAnalysisConfig(kind: AnalysisKind): AnalysisConfig {
-  // Using a switch statement here accomplishes two things:
-  // 1. The type checker believes us that we have a case for every `AnalysisKind`.
-  // 2. If we ever add another member to `AnalysisKind`, the type checker will alert us that we have to add a case.
-  switch (kind) {
-    case AnalysisKind.CodeScanning:
-      return CodeScanning;
-    case AnalysisKind.CodeQuality:
-      return CodeQuality;
-    case AnalysisKind.RiskAssessment:
-      return RiskAssessment;
-  }
-}
-
-// Since we have overlapping extensions (i.e. ".sarif" includes ".quality.sarif"),
-// we want to scan a folder containing SARIF files in an order that finds the more
-// specific extensions first. This constant defines an array in the order of analyis
-// configurations with more specific extensions to less specific extensions.
-export const SarifScanOrder: AnalysisConfig[] = [
-  RiskAssessment,
-  CodeQuality,
-  CodeScanning,
-];
diff --git a/src/analyze-action-post.ts b/src/analyze-action-post.ts
deleted file mode 100644
index 732b52af19..0000000000
--- a/src/analyze-action-post.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * This file is the entry point for the `post:` hook of `analyze-action.yml`.
- * It will run after the all steps in this job, in reverse order in relation to
- * other `post:` hooks.
- */
-import * as fs from "fs";
-
-import * as core from "@actions/core";
-
-import * as actionsUtil from "./actions-util";
-import { getGitHubVersion } from "./api-client";
-import { getCodeQL } from "./codeql";
-import { getConfig } from "./config-utils";
-import * as debugArtifacts from "./debug-artifacts";
-import {
-  getCsharpTempDependencyDir,
-  getJavaTempDependencyDir,
-} from "./dependency-caching";
-import { EnvVar } from "./environment";
-import { getActionsLogger } from "./logging";
-import { checkGitHubVersionInRange, getErrorMessage } from "./util";
-
-export async function runWrapper() {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-
-  try {
-    actionsUtil.restoreInputs();
-    const logger = getActionsLogger();
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-
-    // Upload SARIF artifacts if we determine that this is a first-party analysis run.
-    // For third-party runs, this artifact will be uploaded in the `upload-sarif-post` step.
-    if (process.env[EnvVar.INIT_ACTION_HAS_RUN] === "true") {
-      const config = await getConfig(
-        actionsUtil.getTemporaryDirectory(),
-        logger,
-      );
-      if (config !== undefined) {
-        const codeql = await getCodeQL(logger, config.codeQLCmd);
-        const version = await codeql.getVersion();
-        await debugArtifacts.uploadCombinedSarifArtifacts(
-          logger,
-          config.gitHubVersion.type,
-          version.version,
-        );
-      }
-    }
-
-    // If we analysed Java or C# in build-mode: none, we may have downloaded dependencies
-    // to the temp directory. Clean these up so they don't persist unnecessarily
-    // long on self-hosted runners.
-    const tempDependencyDirs = [
-      getJavaTempDependencyDir(),
-      getCsharpTempDependencyDir(),
-    ];
-    for (const tempDependencyDir of tempDependencyDirs) {
-      if (fs.existsSync(tempDependencyDir)) {
-        try {
-          fs.rmSync(tempDependencyDir, { recursive: true });
-        } catch (error) {
-          logger.info(
-            `Failed to remove temporary dependencies directory: ${getErrorMessage(error)}`,
-          );
-        }
-      }
-    }
-  } catch (error) {
-    core.setFailed(
-      `analyze post-action step failed: ${getErrorMessage(error)}`,
-    );
-  }
-}
diff --git a/src/analyze-action.test.ts b/src/analyze-action.test.ts
deleted file mode 100644
index 923908a641..0000000000
--- a/src/analyze-action.test.ts
+++ /dev/null
@@ -1,142 +0,0 @@
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import * as analyze from "./analyze";
-import { runWrapper } from "./analyze-action";
-import * as api from "./api-client";
-import * as configUtils from "./config-utils";
-import * as gitUtils from "./git-utils";
-import * as statusReport from "./status-report";
-import {
-  setupTests,
-  setupActionsVars,
-  mockFeatureFlagApiEndpoint,
-} from "./testing-utils";
-import * as util from "./util";
-
-setupTests(test);
-
-test.serial(
-  "analyze action with RAM & threads from environment variables",
-  async (t) => {
-    // This test frequently times out on Windows with the default timeout, so we bump
-    // it a bit to 20s.
-    t.timeout(1000 * 20);
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(statusReport, "createStatusReportBase")
-        .resolves({} as statusReport.StatusReportBase);
-      sinon.stub(statusReport, "sendStatusReport").resolves();
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-      const gitHubVersion: util.GitHubVersion = {
-        type: util.GitHubVariant.DOTCOM,
-      };
-      sinon.stub(configUtils, "getConfig").resolves({
-        gitHubVersion,
-        augmentationProperties: {},
-        languages: [],
-        packs: [],
-        trapCaches: {},
-      } as unknown as configUtils.Config);
-      const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-      requiredInputStub.withArgs("token").returns("fake-token");
-      requiredInputStub.withArgs("upload-database").returns("false");
-      requiredInputStub.withArgs("output").returns("out");
-      const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
-      optionalInputStub.withArgs("expect-error").returns("false");
-      sinon.stub(api, "getGitHubVersion").resolves(gitHubVersion);
-      mockFeatureFlagApiEndpoint(200, {});
-
-      // When there are no action inputs for RAM and threads, the action uses
-      // environment variables (passed down from the init action) to set RAM and
-      // threads usage.
-      process.env["CODEQL_THREADS"] = "-1";
-      process.env["CODEQL_RAM"] = "4992";
-
-      const runFinalizeStub = sinon.stub(analyze, "runFinalize");
-      const runQueriesStub = sinon.stub(analyze, "runQueries");
-
-      await runWrapper();
-
-      t.assert(
-        runFinalizeStub.calledOnceWith(
-          sinon.match.any,
-          sinon.match.any,
-          "--threads=-1",
-          "--ram=4992",
-        ),
-      );
-      t.assert(
-        runQueriesStub.calledOnceWith(
-          sinon.match.any,
-          "--ram=4992",
-          "--threads=-1",
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "analyze action with RAM & threads from action inputs",
-  async (t) => {
-    t.timeout(1000 * 20);
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(statusReport, "createStatusReportBase")
-        .resolves({} as statusReport.StatusReportBase);
-      sinon.stub(statusReport, "sendStatusReport").resolves();
-      const gitHubVersion: util.GitHubVersion = {
-        type: util.GitHubVariant.DOTCOM,
-      };
-      sinon.stub(configUtils, "getConfig").resolves({
-        gitHubVersion,
-        augmentationProperties: {},
-        languages: [],
-        packs: [],
-        trapCaches: {},
-      } as unknown as configUtils.Config);
-      const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
-      requiredInputStub.withArgs("token").returns("fake-token");
-      requiredInputStub.withArgs("upload-database").returns("false");
-      requiredInputStub.withArgs("output").returns("out");
-      const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
-      optionalInputStub.withArgs("expect-error").returns("false");
-      sinon.stub(api, "getGitHubVersion").resolves(gitHubVersion);
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-      mockFeatureFlagApiEndpoint(200, {});
-
-      process.env["CODEQL_THREADS"] = "1";
-      process.env["CODEQL_RAM"] = "4992";
-
-      // Action inputs have precedence over environment variables.
-      optionalInputStub.withArgs("threads").returns("-1");
-      optionalInputStub.withArgs("ram").returns("3012");
-
-      const runFinalizeStub = sinon.stub(analyze, "runFinalize");
-      const runQueriesStub = sinon.stub(analyze, "runQueries");
-
-      await runWrapper();
-
-      t.assert(
-        runFinalizeStub.calledOnceWith(
-          sinon.match.any,
-          sinon.match.any,
-          "--threads=-1",
-          "--ram=3012",
-        ),
-      );
-      t.assert(
-        runQueriesStub.calledOnceWith(
-          sinon.match.any,
-          "--ram=3012",
-          "--threads=-1",
-        ),
-      );
-    });
-  },
-);
diff --git a/src/analyze-action.ts b/src/analyze-action.ts
deleted file mode 100644
index c3c2e40e7f..0000000000
--- a/src/analyze-action.ts
+++ /dev/null
@@ -1,534 +0,0 @@
-import * as fs from "fs";
-import path from "path";
-import { performance } from "perf_hooks";
-
-import * as core from "@actions/core";
-
-import { Action, ActionState, runInActions } from "./action-common";
-import * as actionsUtil from "./actions-util";
-import * as analyses from "./analyses";
-import {
-  CodeQLAnalysisError,
-  dbIsFinalized,
-  QueriesStatusReport,
-  runFinalize,
-  runQueries,
-  setupDiffInformedQueryRun,
-  warnIfGoInstalledAfterInit,
-} from "./analyze";
-import { getApiDetails, getGitHubVersion } from "./api-client";
-import { runAutobuild } from "./autobuild";
-import { getTotalCacheSize, shouldStoreCache } from "./caching-utils";
-import { getCodeQL } from "./codeql";
-import { Config, getConfig } from "./config-utils";
-import {
-  cleanupAndUploadDatabases,
-  DatabaseUploadResult,
-} from "./database-upload";
-import {
-  DependencyCacheUploadStatusReport,
-  uploadDependencyCaches,
-} from "./dependency-caching";
-import { EnvVar } from "./environment";
-import { initFeatures } from "./feature-flags";
-import { BuiltInLanguage } from "./languages";
-import { getActionsLogger, Logger } from "./logging";
-import { cleanupAndUploadOverlayBaseDatabaseToCache } from "./overlay/caching";
-import { getRepositoryNwo } from "./repository";
-import * as statusReport from "./status-report";
-import {
-  ActionName,
-  createStatusReportBase,
-  DatabaseCreationTimings,
-  getActionsStatus,
-  StatusReportBase,
-} from "./status-report";
-import {
-  cleanupTrapCaches,
-  TrapCacheCleanupStatusReport,
-  uploadTrapCaches,
-} from "./trap-caching";
-import * as uploadLib from "./upload-lib";
-import { UploadResult } from "./upload-lib";
-import { postProcessAndUploadSarif } from "./upload-sarif";
-import * as util from "./util";
-
-interface AnalysisStatusReport
-  extends uploadLib.UploadStatusReport,
-    QueriesStatusReport {}
-
-interface FinishStatusReport
-  extends StatusReportBase,
-    DatabaseCreationTimings,
-    AnalysisStatusReport {
-  dependency_caching_upload_results?: DependencyCacheUploadStatusReport;
-  database_upload_results: DatabaseUploadResult[];
-}
-
-interface FinishWithTrapUploadStatusReport extends FinishStatusReport {
-  /** Size of TRAP caches that we uploaded, in bytes. */
-  trap_cache_upload_size_bytes: number;
-  /** Time taken to upload TRAP caches, in milliseconds. */
-  trap_cache_upload_duration_ms: number;
-}
-
-async function sendStatusReport(
-  startedAt: Date,
-  config: Config | undefined,
-  stats: AnalysisStatusReport | undefined,
-  error: Error | undefined,
-  trapCacheUploadTime: number | undefined,
-  dbCreationTimings: DatabaseCreationTimings | undefined,
-  didUploadTrapCaches: boolean,
-  trapCacheCleanup: TrapCacheCleanupStatusReport | undefined,
-  dependencyCacheResults: DependencyCacheUploadStatusReport | undefined,
-  databaseUploadResults: DatabaseUploadResult[],
-  logger: Logger,
-) {
-  const status = getActionsStatus(error, stats?.analyze_failure_language);
-  const statusReportBase = await createStatusReportBase(
-    ActionName.Analyze,
-    status,
-    startedAt,
-    config,
-    await util.checkDiskUsage(logger),
-    logger,
-    error?.message,
-    error?.stack,
-  );
-  if (statusReportBase !== undefined) {
-    const report: FinishStatusReport = {
-      ...statusReportBase,
-      ...(stats || {}),
-      ...(dbCreationTimings || {}),
-      ...(trapCacheCleanup || {}),
-      dependency_caching_upload_results: dependencyCacheResults,
-      database_upload_results: databaseUploadResults,
-    };
-    if (config && didUploadTrapCaches) {
-      const trapCacheUploadStatusReport: FinishWithTrapUploadStatusReport = {
-        ...report,
-        trap_cache_upload_duration_ms: Math.round(trapCacheUploadTime || 0),
-        trap_cache_upload_size_bytes: Math.round(
-          await getTotalCacheSize(Object.values(config.trapCaches), logger),
-        ),
-      };
-      await statusReport.sendStatusReport(trapCacheUploadStatusReport);
-    } else {
-      await statusReport.sendStatusReport(report);
-    }
-  }
-}
-
-// `expect-error` should only be set to a non-false value by the CodeQL Action PR checks.
-function hasBadExpectErrorInput(): boolean {
-  return (
-    actionsUtil.getOptionalInput("expect-error") !== "false" &&
-    !util.isInTestMode()
-  );
-}
-
-/**
- * Returns whether any TRAP files exist under the `db-go` folder,
- * indicating whether Go extraction has extracted at least one file.
- */
-function doesGoExtractionOutputExist(config: Config): boolean {
-  const golangDbDirectory = util.getCodeQLDatabasePath(
-    config,
-    BuiltInLanguage.go,
-  );
-  const trapDirectory = path.join(
-    golangDbDirectory,
-    "trap",
-    BuiltInLanguage.go,
-  );
-  return (
-    fs.existsSync(trapDirectory) &&
-    fs
-      .readdirSync(trapDirectory)
-      .some((fileName) =>
-        [
-          ".trap",
-          ".trap.gz",
-          ".trap.br",
-          ".trap.tar.gz",
-          ".trap.tar.br",
-          ".trap.tar",
-        ].some((ext) => fileName.endsWith(ext)),
-      )
-  );
-}
-
-/**
- * We attempt to autobuild Go to preserve compatibility for users who have
- * set up Go using a legacy scanning style CodeQL workflow, i.e. one without
- * an autobuild step or manual build steps.
- *
- * - We detect whether an autobuild step is present by checking the
- * `CODEQL_ACTION_DID_AUTOBUILD_GOLANG` environment variable, which is set
- * when the autobuilder is invoked.
- * - We detect whether the Go database has already been finalized in case it
- * has been manually set in a prior Action step.
- * - We approximate whether manual build steps are present by looking at
- * whether any extraction output already exists for Go.
- */
-async function runAutobuildIfLegacyGoWorkflow(config: Config, logger: Logger) {
-  if (!config.languages.includes(BuiltInLanguage.go)) {
-    return;
-  }
-  if (config.buildMode) {
-    logger.debug(
-      "Skipping legacy Go autobuild since a build mode has been specified.",
-    );
-    return;
-  }
-  if (process.env[EnvVar.DID_AUTOBUILD_GOLANG] === "true") {
-    logger.debug("Won't run Go autobuild since it has already been run.");
-    return;
-  }
-  if (dbIsFinalized(config, BuiltInLanguage.go, logger)) {
-    logger.debug(
-      "Won't run Go autobuild since there is already a finalized database for Go.",
-    );
-    return;
-  }
-  // This captures whether a user has added manual build steps for Go
-  if (doesGoExtractionOutputExist(config)) {
-    logger.debug(
-      "Won't run Go autobuild since at least one file of Go code has already been extracted.",
-    );
-    // If the user has run the manual build step, and has set the `CODEQL_EXTRACTOR_GO_BUILD_TRACING`
-    // variable, we suggest they remove it from their workflow.
-    if ("CODEQL_EXTRACTOR_GO_BUILD_TRACING" in process.env) {
-      logger.warning(
-        `The CODEQL_EXTRACTOR_GO_BUILD_TRACING environment variable has no effect on workflows with manual build steps, so we recommend that you remove it from your workflow.`,
-      );
-    }
-    return;
-  }
-  logger.debug(
-    "Running Go autobuild because extraction output (TRAP files) for Go code has not been found.",
-  );
-  await runAutobuild(config, BuiltInLanguage.go, logger);
-}
-
-async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-
-  let uploadResults:
-    | Partial>
-    | undefined = undefined;
-  let runStats: QueriesStatusReport | undefined = undefined;
-  let config: Config | undefined = undefined;
-  let trapCacheCleanupTelemetry: TrapCacheCleanupStatusReport | undefined =
-    undefined;
-  let trapCacheUploadTime: number | undefined = undefined;
-  let dbCreationTimings: DatabaseCreationTimings | undefined = undefined;
-  let didUploadTrapCaches = false;
-  let dependencyCacheResults: DependencyCacheUploadStatusReport | undefined;
-  let databaseUploadResults: DatabaseUploadResult[] = [];
-
-  try {
-    util.initializeEnvironment(actionsUtil.getActionVersion());
-
-    // Make inputs accessible in the `post` step, details at
-    // https://github.com/github/codeql-action/issues/2553
-    actionsUtil.persistInputs();
-
-    const statusReportBase = await createStatusReportBase(
-      ActionName.Analyze,
-      "starting",
-      startedAt,
-      config,
-      await util.checkDiskUsage(logger),
-      logger,
-    );
-    if (statusReportBase !== undefined) {
-      await statusReport.sendStatusReport(statusReportBase);
-    }
-
-    config = await getConfig(actionsUtil.getTemporaryDirectory(), logger);
-    if (config === undefined) {
-      throw new util.ConfigurationError(
-        "Config file could not be found at expected location. Has the 'init' action been called?",
-      );
-    }
-
-    const codeql = await getCodeQL(logger, config.codeQLCmd);
-
-    if (hasBadExpectErrorInput()) {
-      throw new util.ConfigurationError(
-        "`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork.",
-      );
-    }
-
-    // Unset the CODEQL_PROXY_* environment variables when using older CodeQL
-    // CLIs, as they are not needed and can cause issues.
-    if (
-      process.env.CODEQL_PROXY_HOST === "" &&
-      !(await util.codeQlVersionAtLeast(codeql, "2.20.7"))
-    ) {
-      delete process.env.CODEQL_PROXY_HOST;
-      delete process.env.CODEQL_PROXY_PORT;
-      delete process.env.CODEQL_PROXY_CA_CERTIFICATE;
-    }
-
-    if (actionsUtil.getOptionalInput("cleanup-level")) {
-      logger.info(
-        "The 'cleanup-level' input is ignored since the CodeQL Action now automatically " +
-          "manages database cleanup. This input can safely be removed from your workflow.",
-      );
-    }
-
-    const apiDetails = getApiDetails();
-    const outputDir = actionsUtil.getRequiredInput("output");
-    core.exportVariable(EnvVar.SARIF_RESULTS_OUTPUT_DIR, outputDir);
-    const threads = util.getThreadsFlag(
-      actionsUtil.getOptionalInput("threads") || process.env["CODEQL_THREADS"],
-      logger,
-    );
-
-    const repositoryNwo = getRepositoryNwo();
-
-    const gitHubVersion = await getGitHubVersion();
-
-    util.checkActionVersion(actionsUtil.getActionVersion(), gitHubVersion);
-
-    const features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      actionsUtil.getTemporaryDirectory(),
-      logger,
-    );
-
-    const memory = util.getMemoryFlag(
-      actionsUtil.getOptionalInput("ram") || process.env["CODEQL_RAM"],
-      logger,
-    );
-
-    // Setup diff informed analysis if needed (based on whether init created the file)
-    const diffRangePackDir = await setupDiffInformedQueryRun(logger);
-
-    await warnIfGoInstalledAfterInit(config, logger);
-    await runAutobuildIfLegacyGoWorkflow(config, logger);
-
-    dbCreationTimings = await runFinalize(
-      features,
-      outputDir,
-      threads,
-      memory,
-      codeql,
-      config,
-      logger,
-    );
-
-    if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
-      // Warn if the removed `add-snippets` input is used.
-      if (actionsUtil.getOptionalInput("add-snippets") !== undefined) {
-        logger.warning(
-          "The `add-snippets` input has been removed and no longer has any effect.",
-        );
-      }
-
-      runStats = await runQueries(
-        outputDir,
-        memory,
-        threads,
-        diffRangePackDir,
-        actionsUtil.getOptionalInput("category"),
-        codeql,
-        config,
-        logger,
-        features,
-      );
-    }
-
-    const dbLocations: { [lang: string]: string } = {};
-    for (const language of config.languages) {
-      dbLocations[language] = util.getCodeQLDatabasePath(config, language);
-    }
-    core.setOutput("db-locations", dbLocations);
-    core.setOutput("sarif-output", path.resolve(outputDir));
-    const uploadKind = actionsUtil.getUploadValue(
-      actionsUtil.getOptionalInput("upload"),
-    );
-    if (runStats) {
-      const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
-      const category = actionsUtil.getOptionalInput("category");
-
-      uploadResults = await postProcessAndUploadSarif(
-        logger,
-        features,
-        uploadKind,
-        checkoutPath,
-        outputDir,
-        category,
-        actionsUtil.getOptionalInput("post-processed-sarif-path"),
-      );
-
-      // Set the SARIF id outputs only if we have results for them, to avoid
-      // having keys with empty values in the action output.
-      if (uploadResults[analyses.AnalysisKind.CodeScanning] !== undefined) {
-        core.setOutput(
-          "sarif-id",
-          uploadResults[analyses.AnalysisKind.CodeScanning].sarifID,
-        );
-      }
-      if (uploadResults[analyses.AnalysisKind.CodeQuality] !== undefined) {
-        core.setOutput(
-          "quality-sarif-id",
-          uploadResults[analyses.AnalysisKind.CodeQuality].sarifID,
-        );
-      }
-    } else {
-      logger.info("Not uploading results");
-    }
-
-    // Possibly upload the overlay-base database to actions cache.
-    // Note: Take care with the ordering of this call since databases may be cleaned up
-    // at the `overlay` level.
-    await cleanupAndUploadOverlayBaseDatabaseToCache(codeql, config, logger);
-
-    // Possibly upload the database bundles for remote queries.
-    // Note: Take care with the ordering of this call since databases may be cleaned up
-    // at the `overlay` or `clear` level.
-    databaseUploadResults = await cleanupAndUploadDatabases(
-      repositoryNwo,
-      codeql,
-      config,
-      apiDetails,
-      features,
-      logger,
-    );
-
-    // Possibly upload the TRAP caches for later re-use
-    const trapCacheUploadStartTime = performance.now();
-    didUploadTrapCaches = await uploadTrapCaches(codeql, config, logger);
-    trapCacheUploadTime = performance.now() - trapCacheUploadStartTime;
-
-    // Clean up TRAP caches
-    trapCacheCleanupTelemetry = await cleanupTrapCaches(
-      config,
-      features,
-      logger,
-    );
-
-    // Store dependency cache(s) if dependency caching is enabled.
-    if (shouldStoreCache(config.dependencyCachingEnabled)) {
-      dependencyCacheResults = await uploadDependencyCaches(
-        codeql,
-        features,
-        config,
-        logger,
-      );
-    }
-
-    // We don't upload results in test mode, so don't wait for processing
-    if (util.isInTestMode()) {
-      logger.debug("In test mode. Waiting for processing is disabled.");
-    } else if (
-      uploadResults?.[analyses.AnalysisKind.CodeScanning] !== undefined &&
-      actionsUtil.getRequiredInput("wait-for-processing") === "true"
-    ) {
-      await uploadLib.waitForProcessing(
-        getRepositoryNwo(),
-        uploadResults[analyses.AnalysisKind.CodeScanning].sarifID,
-        getActionsLogger(),
-      );
-    }
-    // If we did not throw an error yet here, but we expect one, throw it.
-    if (actionsUtil.getOptionalInput("expect-error") === "true") {
-      core.setFailed(
-        `expect-error input was set to true but no error was thrown.`,
-      );
-    }
-    core.exportVariable(EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true");
-  } catch (unwrappedError) {
-    const error = util.wrapError(unwrappedError);
-    if (
-      actionsUtil.getOptionalInput("expect-error") !== "true" ||
-      hasBadExpectErrorInput()
-    ) {
-      core.setFailed(error.message);
-    }
-
-    await sendStatusReport(
-      startedAt,
-      config,
-      error instanceof CodeQLAnalysisError
-        ? error.queriesStatusReport
-        : undefined,
-      error instanceof CodeQLAnalysisError ? error.error : error,
-      trapCacheUploadTime,
-      dbCreationTimings,
-      didUploadTrapCaches,
-      trapCacheCleanupTelemetry,
-      dependencyCacheResults,
-      databaseUploadResults,
-      logger,
-    );
-    return;
-  }
-
-  if (
-    runStats !== undefined &&
-    uploadResults?.[analyses.AnalysisKind.CodeScanning] !== undefined
-  ) {
-    await sendStatusReport(
-      startedAt,
-      config,
-      {
-        ...runStats,
-        ...uploadResults[analyses.AnalysisKind.CodeScanning].statusReport,
-      },
-      undefined,
-      trapCacheUploadTime,
-      dbCreationTimings,
-      didUploadTrapCaches,
-      trapCacheCleanupTelemetry,
-      dependencyCacheResults,
-      databaseUploadResults,
-      logger,
-    );
-  } else if (runStats !== undefined) {
-    await sendStatusReport(
-      startedAt,
-      config,
-      { ...runStats },
-      undefined,
-      trapCacheUploadTime,
-      dbCreationTimings,
-      didUploadTrapCaches,
-      trapCacheCleanupTelemetry,
-      dependencyCacheResults,
-      databaseUploadResults,
-      logger,
-    );
-  } else {
-    await sendStatusReport(
-      startedAt,
-      config,
-      undefined,
-      undefined,
-      trapCacheUploadTime,
-      dbCreationTimings,
-      didUploadTrapCaches,
-      trapCacheCleanupTelemetry,
-      dependencyCacheResults,
-      databaseUploadResults,
-      logger,
-    );
-  }
-}
-
-/** Defines the `analyze` Action. */
-const analyze: Action = {
-  name: ActionName.Analyze,
-  run,
-};
-
-export async function runWrapper() {
-  await runInActions(analyze);
-  await util.checkForTimeout();
-}
diff --git a/src/analyze.test.ts b/src/analyze.test.ts
deleted file mode 100644
index 7523d239bf..0000000000
--- a/src/analyze.test.ts
+++ /dev/null
@@ -1,180 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import test from "ava";
-import * as sinon from "sinon";
-
-import { CodeQuality, CodeScanning, RiskAssessment } from "./analyses";
-import {
-  runQueries,
-  defaultSuites,
-  resolveQuerySuiteAlias,
-  addSarifExtension,
-  diffRangeExtensionPackContents,
-} from "./analyze";
-import { createStubCodeQL } from "./codeql";
-import { Feature } from "./feature-flags";
-import { BuiltInLanguage } from "./languages";
-import { getRunnerLogger } from "./logging";
-import {
-  setupTests,
-  setupActionsVars,
-  createFeatures,
-  createTestConfig,
-} from "./testing-utils";
-import * as uploadLib from "./upload-lib";
-import * as util from "./util";
-
-setupTests(test);
-
-/**
- * Checks the status report produced by the analyze Action.
- *
- * - Checks that the duration fields are populated for the correct language.
- * - Checks that the QA telemetry status report fields are populated when the QA feature flag is enabled.
- */
-test.serial("status report fields", async (t) => {
-  return await util.withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-
-    const memoryFlag = "";
-    const threadsFlag = "";
-    sinon.stub(uploadLib, "validateSarifFileSchema");
-
-    for (const language of Object.values(BuiltInLanguage)) {
-      const codeql = createStubCodeQL({
-        databaseRunQueries: async () => {},
-        databaseInterpretResults: async (
-          _db: string,
-          _queriesRun: string[],
-          sarifFile: string,
-        ) => {
-          fs.writeFileSync(
-            sarifFile,
-            JSON.stringify({
-              runs: [
-                // references a rule with the lines-of-code tag, so baseline should be injected
-                {
-                  tool: {
-                    extensions: [
-                      {
-                        rules: [
-                          {
-                            properties: {
-                              tags: ["lines-of-code"],
-                            },
-                          },
-                        ],
-                      },
-                    ],
-                  },
-                  properties: {
-                    metricResults: [
-                      {
-                        rule: {
-                          index: 0,
-                          toolComponent: {
-                            index: 0,
-                          },
-                        },
-                        value: 123,
-                      },
-                    ],
-                  },
-                },
-                {},
-              ],
-            }),
-          );
-          return "";
-        },
-      });
-
-      const config = createTestConfig({
-        languages: [language],
-        tempDir: tmpDir,
-        dbLocation: path.resolve(tmpDir, "codeql_databases"),
-      });
-      fs.mkdirSync(util.getCodeQLDatabasePath(config, language), {
-        recursive: true,
-      });
-
-      const statusReport = await runQueries(
-        tmpDir,
-        memoryFlag,
-        threadsFlag,
-        undefined,
-        undefined,
-        codeql,
-        config,
-        getRunnerLogger(true),
-        createFeatures([Feature.QaTelemetryEnabled]),
-      );
-      t.deepEqual(Object.keys(statusReport).sort(), [
-        "analysis_builds_overlay_base_database",
-        "analysis_is_diff_informed",
-        "analysis_is_overlay",
-        `analyze_builtin_queries_${language}_duration_ms`,
-        "event_reports",
-        `interpret_results_${language}_duration_ms`,
-      ]);
-      for (const eventReport of statusReport.event_reports!) {
-        t.deepEqual(eventReport.event, "codeql database interpret-results");
-        t.true("properties" in eventReport);
-        t.true("alertCounts" in eventReport.properties!);
-      }
-    }
-  });
-});
-
-test("resolveQuerySuiteAlias", (t) => {
-  // default query suite names should resolve to something language-specific ending in `.qls`.
-  for (const suite of defaultSuites) {
-    const resolved = resolveQuerySuiteAlias(BuiltInLanguage.go, suite);
-    t.assert(
-      path.extname(resolved) === ".qls",
-      "Resolved default suite doesn't end in .qls",
-    );
-    t.assert(
-      resolved.indexOf(BuiltInLanguage.go) >= 0,
-      "Resolved default suite doesn't contain language name",
-    );
-  }
-
-  // other inputs should be returned unchanged
-  const names = ["foo", "bar", "codeql/go-queries@1.0"];
-
-  for (const name of names) {
-    t.deepEqual(resolveQuerySuiteAlias(BuiltInLanguage.go, name), name);
-  }
-});
-
-test("addSarifExtension", (t) => {
-  for (const language of Object.values(BuiltInLanguage)) {
-    t.deepEqual(addSarifExtension(CodeScanning, language), `${language}.sarif`);
-    t.deepEqual(
-      addSarifExtension(CodeQuality, language),
-      `${language}.quality.sarif`,
-    );
-    t.is(addSarifExtension(RiskAssessment, language), `${language}.csra.sarif`);
-  }
-});
-
-test("diffRangeExtensionPackContents", (t) => {
-  const output = diffRangeExtensionPackContents(
-    [
-      {
-        path: "main.js",
-        startLine: 10,
-        endLine: 20,
-      },
-    ],
-    "/checkout/path",
-  );
-
-  const expected = fs.readFileSync(
-    `${__dirname}/../src/testdata/pr-diff-range.yml`,
-    "utf8",
-  );
-  t.deepEqual(output, expected);
-});
diff --git a/src/analyze.ts b/src/analyze.ts
deleted file mode 100644
index 411477b597..0000000000
--- a/src/analyze.ts
+++ /dev/null
@@ -1,707 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-import { performance } from "perf_hooks";
-
-import * as io from "@actions/io";
-import * as yaml from "js-yaml";
-
-import { getTemporaryDirectory, getRequiredInput } from "./actions-util";
-import * as analyses from "./analyses";
-import { setupCppAutobuild } from "./autobuild";
-import { type CodeQL } from "./codeql";
-import * as configUtils from "./config-utils";
-import {
-  getCsharpTempDependencyDir,
-  getJavaTempDependencyDir,
-} from "./dependency-caching";
-import { addDiagnostic, makeDiagnostic } from "./diagnostics";
-import {
-  DiffThunkRange,
-  readDiffRangesJsonFile,
-} from "./diff-informed-analysis-utils";
-import { EnvVar } from "./environment";
-import { FeatureEnablement, Feature } from "./feature-flags";
-import { BuiltInLanguage, Language } from "./languages";
-import { Logger, withGroupAsync } from "./logging";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import type * as sarif from "./sarif";
-import { DatabaseCreationTimings, EventReport } from "./status-report";
-import { endTracingForCluster } from "./tracer-config";
-import * as util from "./util";
-import { BuildMode } from "./util";
-
-export class CodeQLAnalysisError extends Error {
-  constructor(
-    public queriesStatusReport: QueriesStatusReport,
-    public message: string,
-    public error: Error,
-  ) {
-    super(message);
-    this.name = "CodeQLAnalysisError";
-  }
-}
-
-type BuiltInLanguageKey = keyof typeof BuiltInLanguage;
-
-type RunQueriesDurationStatusReport = {
-  /**
-   * Time taken in ms to run queries for the language (or undefined if this language was not analyzed).
-   *
-   * The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
-   * taken to run _all_ the queries.
-   */
-  [L in BuiltInLanguageKey as `analyze_builtin_queries_${L}_duration_ms`]?: number;
-};
-
-type InterpretResultsDurationStatusReport = {
-  /** Time taken in ms to interpret results for the language (or undefined if this language was not analyzed). */
-  [L in BuiltInLanguageKey as `interpret_results_${L}_duration_ms`]?: number;
-};
-
-export interface QueriesStatusReport
-  extends RunQueriesDurationStatusReport,
-    InterpretResultsDurationStatusReport {
-  /**
-   * Whether the analysis is diff-informed (in the sense that the action generates a diff-range data
-   * extension for the analysis, regardless of whether the data extension is actually used by queries).
-   */
-  analysis_is_diff_informed?: boolean;
-
-  /**
-   * Whether the analysis runs in overlay mode (i.e., uses an overlay-base database).
-   * This is true if the AugmentationProperties.overlayDatabaseMode === Overlay.
-   */
-  analysis_is_overlay?: boolean;
-
-  /**
-   * Whether the analysis builds an overlay-base database.
-   * This is true if the AugmentationProperties.overlayDatabaseMode === OverlayBase.
-   */
-  analysis_builds_overlay_base_database?: boolean;
-
-  /** Name of language that errored during analysis (or undefined if no language failed). */
-  analyze_failure_language?: string;
-  /** Reports on discrete events associated with this status report. */
-  event_reports?: EventReport[];
-}
-
-async function setupPythonExtractor(logger: Logger) {
-  const codeqlPython = process.env["CODEQL_PYTHON"];
-  if (codeqlPython === undefined || codeqlPython.length === 0) {
-    // If CODEQL_PYTHON is not set, no dependencies were installed, so we don't need to do anything
-    return;
-  }
-
-  logger.warning(
-    "The CODEQL_PYTHON environment variable is no longer supported. Please remove it from your workflow. This environment variable was originally used to specify a Python executable that included the dependencies of your Python code, however Python analysis no longer uses these dependencies." +
-      "\nIf you used CODEQL_PYTHON to force the version of Python to analyze as, please use CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION instead, such as 'CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION=2.7' or 'CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION=3.11'.",
-  );
-  return;
-}
-
-export async function runExtraction(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  config: configUtils.Config,
-  logger: Logger,
-) {
-  for (const language of config.languages) {
-    if (dbIsFinalized(config, language, logger)) {
-      logger.debug(
-        `Database for ${language} has already been finalized, skipping extraction.`,
-      );
-      continue;
-    }
-
-    if (await shouldExtractLanguage(codeql, config, language)) {
-      logger.startGroup(`Extracting ${language}`);
-      if (language === BuiltInLanguage.python) {
-        await setupPythonExtractor(logger);
-      }
-      if (config.buildMode) {
-        if (
-          language === BuiltInLanguage.cpp &&
-          config.buildMode === BuildMode.Autobuild
-        ) {
-          await setupCppAutobuild(codeql, logger);
-        }
-
-        // The Java and C# `build-mode: none` extractors place dependencies in the
-        // database scratch directory by default. For dependency caching purposes, we want
-        // a stable path that caches can be restored into and that we can cache at the
-        // end of the workflow (i.e. that does not get removed when the scratch directory is).
-        if (
-          language === BuiltInLanguage.java &&
-          config.buildMode === BuildMode.None
-        ) {
-          process.env["CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS_DEPENDENCY_DIR"] =
-            getJavaTempDependencyDir();
-        }
-        if (
-          language === BuiltInLanguage.csharp &&
-          config.buildMode === BuildMode.None &&
-          (await features.getValue(Feature.CsharpCacheBuildModeNone))
-        ) {
-          process.env[
-            "CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR"
-          ] = getCsharpTempDependencyDir();
-        }
-
-        await codeql.extractUsingBuildMode(config, language);
-      } else {
-        await codeql.extractScannedLanguage(config, language);
-      }
-      logger.endGroup();
-    }
-  }
-}
-
-async function shouldExtractLanguage(
-  codeql: CodeQL,
-  config: configUtils.Config,
-  language: Language,
-): Promise {
-  return (
-    config.buildMode === BuildMode.None ||
-    (config.buildMode === BuildMode.Autobuild &&
-      process.env[EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY] !== "true") ||
-    (!config.buildMode && (await codeql.isScannedLanguage(language)))
-  );
-}
-
-export function dbIsFinalized(
-  config: configUtils.Config,
-  language: Language,
-  logger: Logger,
-) {
-  const dbPath = util.getCodeQLDatabasePath(config, language);
-  try {
-    const dbInfo = yaml.load(
-      fs.readFileSync(path.resolve(dbPath, "codeql-database.yml"), "utf8"),
-    ) as { inProgress?: boolean };
-    return !("inProgress" in dbInfo);
-  } catch {
-    logger.warning(
-      `Could not check whether database for ${language} was finalized. Assuming it is not.`,
-    );
-    return false;
-  }
-}
-
-async function finalizeDatabaseCreation(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  config: configUtils.Config,
-  threadsFlag: string,
-  memoryFlag: string,
-  logger: Logger,
-): Promise {
-  const extractionStart = performance.now();
-  await runExtraction(codeql, features, config, logger);
-  const extractionTime = performance.now() - extractionStart;
-
-  const trapImportStart = performance.now();
-  for (const language of config.languages) {
-    if (dbIsFinalized(config, language, logger)) {
-      logger.info(
-        `There is already a finalized database for ${language} at the location where the CodeQL Action places databases, so we did not create one.`,
-      );
-    } else {
-      logger.startGroup(`Finalizing ${language}`);
-      await codeql.finalizeDatabase(
-        util.getCodeQLDatabasePath(config, language),
-        threadsFlag,
-        memoryFlag,
-        config.debugMode,
-      );
-      logger.endGroup();
-    }
-  }
-  const trapImportTime = performance.now() - trapImportStart;
-
-  return {
-    scanned_language_extraction_duration_ms: Math.round(extractionTime),
-    trap_import_duration_ms: Math.round(trapImportTime),
-  };
-}
-
-/**
- * Set up the diff-informed analysis feature.
- *
- * @returns Absolute path to the directory containing the extension pack for
- * the diff range information, or `undefined` if the feature is disabled.
- */
-export async function setupDiffInformedQueryRun(
-  logger: Logger,
-): Promise {
-  return await withGroupAsync(
-    "Generating diff range extension pack",
-    async () => {
-      const diffRanges = readDiffRangesJsonFile(logger);
-      if (diffRanges === undefined) {
-        logger.info(
-          "No precomputed diff ranges found; skipping diff-informed analysis stage.",
-        );
-        return undefined;
-      }
-
-      const checkoutPath = getRequiredInput("checkout_path");
-      const packDir = writeDiffRangeDataExtensionPack(
-        logger,
-        diffRanges,
-        checkoutPath,
-      );
-      logger.info(
-        `Successfully created diff range extension pack at ${packDir}.`,
-      );
-      return packDir;
-    },
-  );
-}
-
-export function diffRangeExtensionPackContents(
-  ranges: DiffThunkRange[],
-  checkoutPath: string,
-): string {
-  const header = `
-extensions:
-  - addsTo:
-      pack: codeql/util
-      extensible: restrictAlertsTo
-      checkPresence: false
-    data:
-`;
-
-  let data = ranges
-    .map((range) => {
-      // Diff-informed queries expect the file path to be absolute. CodeQL always
-      // uses forward slashes as the path separator, so on Windows we need to
-      // replace any backslashes with forward slashes.
-      const filename = path
-        .join(checkoutPath, range.path)
-        .replaceAll(path.sep, "/");
-
-      // Using yaml.dump() with `quoteStyle: "double"` ensures that all special
-      // characters are escaped, and that the path is always rendered as a
-      // quoted string on a single line.
-      return (
-        `      - [${yaml.dump(filename, { forceQuotes: true, quoteStyle: "single" }).trim()}, ` +
-        `${range.startLine}, ${range.endLine}]\n`
-      );
-    })
-    .join("");
-  if (!data) {
-    // Ensure that the data extension is not empty, so that a pull request with
-    // no edited lines would exclude (instead of accepting) all alerts.
-    data = '      - ["", 0, 0]\n';
-  }
-
-  return header + data;
-}
-
-/**
- * Create an extension pack in the temporary directory that contains the file
- * line ranges that were added or modified in the pull request.
- *
- * @param logger
- * @param ranges The file line ranges, as returned by
- * `getPullRequestEditedDiffRanges`.
- * @param checkoutPath The path at which the repository was checked out.
- * @returns The absolute path of the directory containing the extension pack.
- */
-function writeDiffRangeDataExtensionPack(
-  logger: Logger,
-  ranges: DiffThunkRange[],
-  checkoutPath: string,
-): string {
-  if (ranges.length === 0) {
-    // An empty diff range means that there are no added or modified lines in
-    // the pull request. But the `restrictAlertsTo` extensible predicate
-    // interprets an empty data extension differently, as an indication that
-    // all alerts should be included. So we need to specifically set the diff
-    // range to a non-empty list that cannot match any alert location.
-    ranges = [{ path: "", startLine: 0, endLine: 0 }];
-  }
-
-  const diffRangeDir = path.join(getTemporaryDirectory(), "pr-diff-range");
-
-  // We expect the Actions temporary directory to already exist, so are mainly
-  // using `recursive: true` to avoid errors if the directory already exists,
-  // for example if the analyze Action is run multiple times in the same job.
-  // This is not really something that is supported, but we make use of it in
-  // tests.
-  fs.mkdirSync(diffRangeDir, { recursive: true });
-  fs.writeFileSync(
-    path.join(diffRangeDir, "qlpack.yml"),
-    `
-name: codeql-action/pr-diff-range
-version: 0.0.0
-library: true
-extensionTargets:
-  codeql/util: '*'
-dataExtensions:
-  - pr-diff-range.yml
-`,
-  );
-
-  const extensionContents = diffRangeExtensionPackContents(
-    ranges,
-    checkoutPath,
-  );
-  const extensionFilePath = path.join(diffRangeDir, "pr-diff-range.yml");
-  fs.writeFileSync(extensionFilePath, extensionContents);
-  logger.debug(
-    `Wrote pr-diff-range extension pack to ${extensionFilePath}:\n${extensionContents}`,
-  );
-
-  return diffRangeDir;
-}
-
-// A set of default query suite names that are understood by the CLI.
-export const defaultSuites: Set = new Set([
-  "security-experimental",
-  "security-extended",
-  "security-and-quality",
-  "code-quality",
-  "code-scanning",
-]);
-
-/**
- * If `maybeSuite` is the name of a default query suite, it is resolved into the corresponding
- * query suite name for the given `language`. Otherwise, `maybeSuite` is returned as is.
- *
- * @param language The language for which to resolve the default query suite name.
- * @param maybeSuite The string that potentially contains the name of a default query suite.
- * @returns Returns the resolved query suite name, or the unmodified input.
- */
-export function resolveQuerySuiteAlias(
-  language: Language,
-  maybeSuite: string,
-): string {
-  if (defaultSuites.has(maybeSuite)) {
-    return `${language}-${maybeSuite}.qls`;
-  }
-
-  return maybeSuite;
-}
-
-/**
- * Adds the appropriate file extension for the given analysis configuration to the given base filename.
- */
-export function addSarifExtension(
-  analysis: analyses.AnalysisConfig,
-  base: string,
-): string {
-  return `${base}${analysis.sarifExtension}`;
-}
-
-// Runs queries and creates sarif files in the given folder
-export async function runQueries(
-  sarifFolder: string,
-  memoryFlag: string,
-  threadsFlag: string,
-  diffRangePackDir: string | undefined,
-  automationDetailsId: string | undefined,
-  codeql: CodeQL,
-  config: configUtils.Config,
-  logger: Logger,
-  features: FeatureEnablement,
-): Promise {
-  const statusReport: QueriesStatusReport = {};
-  const queryFlags = [memoryFlag, threadsFlag];
-  const incrementalMode: string[] = [];
-
-  // Preserve cached intermediate results for overlay-base databases.
-  if (config.overlayDatabaseMode !== OverlayDatabaseMode.OverlayBase) {
-    queryFlags.push("--expect-discarded-cache");
-  }
-
-  statusReport.analysis_is_diff_informed = diffRangePackDir !== undefined;
-  if (diffRangePackDir) {
-    queryFlags.push(`--additional-packs=${diffRangePackDir}`);
-    queryFlags.push("--extension-packs=codeql-action/pr-diff-range");
-    incrementalMode.push("diff-informed");
-  }
-
-  statusReport.analysis_is_overlay =
-    config.overlayDatabaseMode === OverlayDatabaseMode.Overlay;
-  statusReport.analysis_builds_overlay_base_database =
-    config.overlayDatabaseMode === OverlayDatabaseMode.OverlayBase;
-  if (config.overlayDatabaseMode === OverlayDatabaseMode.Overlay) {
-    incrementalMode.push("overlay");
-  }
-
-  const sarifRunPropertyFlag =
-    incrementalMode.length > 0
-      ? `--sarif-run-property=incrementalMode=${incrementalMode.join(",")}`
-      : undefined;
-
-  const dbAnalysisConfig = configUtils.getPrimaryAnalysisConfig(config);
-
-  for (const language of config.languages) {
-    try {
-      // This should be empty to run only the query suite that was generated when
-      // the database was initialised.
-      const queries: string[] = [];
-
-      // If multiple analysis kinds are enabled, the database is initialised for Code Scanning.
-      // To avoid duplicate work, we want to run queries for all analyses at the same time.
-      // To do this, we invoke `run-queries` once with the generated query suite that was created
-      // when the database was initialised + the queries for other analysis kinds.
-      if (config.analysisKinds.length > 1) {
-        queries.push(util.getGeneratedSuitePath(config, language));
-
-        if (configUtils.isCodeQualityEnabled(config)) {
-          for (const qualityQuery of analyses.codeQualityQueries) {
-            queries.push(resolveQuerySuiteAlias(language, qualityQuery));
-          }
-        }
-      }
-
-      // The work needed to generate the query suites
-      // is done in the CLI. We just need to make a single
-      // call to run all the queries for each language and
-      // another to interpret the results.
-      logger.startGroup(`Running queries for ${language}`);
-      const startTimeRunQueries = new Date().getTime();
-      const databasePath = util.getCodeQLDatabasePath(config, language);
-      await codeql.databaseRunQueries(databasePath, queryFlags, queries);
-      logger.debug(`Finished running queries for ${language}.`);
-      // TODO should not be using `builtin` here. We should be using `all` instead.
-      // The status report does not support `all` yet.
-      statusReport[`analyze_builtin_queries_${language}_duration_ms`] =
-        new Date().getTime() - startTimeRunQueries;
-
-      // There is always at least one analysis kind enabled. Running `interpret-results`
-      // produces the SARIF file for the analysis kind that the database was initialised with.
-      const startTimeInterpretResults = new Date();
-      const { summary: analysisSummary, sarifFile } =
-        await runInterpretResultsFor(
-          dbAnalysisConfig,
-          language,
-          undefined,
-          config.debugMode,
-        );
-
-      // This case is only needed if Code Quality is not the sole analysis kind.
-      // In this case, we will have run queries for all analysis kinds. The previous call to
-      // `interpret-results` will have produced a SARIF file for Code Scanning and we now
-      // need to produce an additional SARIF file for Code Quality.
-      let qualityAnalysisSummary: string | undefined;
-      if (
-        config.analysisKinds.length > 1 &&
-        configUtils.isCodeQualityEnabled(config)
-      ) {
-        const qualityResult = await runInterpretResultsFor(
-          analyses.CodeQuality,
-          language,
-          analyses.codeQualityQueries.map((i) =>
-            resolveQuerySuiteAlias(language, i),
-          ),
-          config.debugMode,
-        );
-        qualityAnalysisSummary = qualityResult.summary;
-      }
-      const endTimeInterpretResults = new Date();
-      statusReport[`interpret_results_${language}_duration_ms`] =
-        endTimeInterpretResults.getTime() - startTimeInterpretResults.getTime();
-      logger.endGroup();
-
-      if (analysisSummary.trim()) {
-        logger.info(analysisSummary);
-      }
-      if (qualityAnalysisSummary?.trim()) {
-        logger.info(qualityAnalysisSummary);
-      }
-      if (!config.enableFileCoverageInformation) {
-        logger.info(
-          "To speed up pull request analysis, file coverage information is only enabled when analyzing " +
-            "the default branch and protected branches.",
-        );
-      }
-
-      if (await features.getValue(Feature.QaTelemetryEnabled)) {
-        // Note: QA adds the `code-quality` query suite to the `queries` input,
-        // so this is fine since there is no `.quality.sarif`.
-        const perQueryAlertCounts = getPerQueryAlertCounts(sarifFile);
-
-        const perQueryAlertCountEventReport: EventReport = {
-          event: "codeql database interpret-results",
-          started_at: startTimeInterpretResults.toISOString(),
-          completed_at: endTimeInterpretResults.toISOString(),
-          exit_status: "success",
-          language,
-          properties: {
-            alertCounts: perQueryAlertCounts,
-          },
-        };
-
-        if (statusReport["event_reports"] === undefined) {
-          statusReport["event_reports"] = [];
-        }
-        statusReport["event_reports"].push(perQueryAlertCountEventReport);
-      }
-    } catch (e) {
-      statusReport.analyze_failure_language = language;
-      throw new CodeQLAnalysisError(
-        statusReport,
-        `Error running analysis for ${language}: ${util.getErrorMessage(e)}`,
-        util.wrapError(e),
-      );
-    }
-  }
-
-  return statusReport;
-
-  async function runInterpretResultsFor(
-    analysis: analyses.AnalysisConfig,
-    language: Language,
-    queries: string[] | undefined,
-    enableDebugLogging: boolean,
-  ): Promise<{ summary: string; sarifFile: string }> {
-    logger.info(`Interpreting ${analysis.name} results for ${language}`);
-
-    // Apply the analysis configuration's `fixCategory` function to adjust the category if needed.
-    // This is a no-op for Code Scanning.
-    const category = analysis.fixCategory(logger, automationDetailsId);
-
-    const sarifFile = path.join(
-      sarifFolder,
-      addSarifExtension(analysis, language),
-    );
-
-    const summary = await runInterpretResults(
-      language,
-      queries,
-      sarifFile,
-      enableDebugLogging,
-      category,
-    );
-
-    return { summary, sarifFile };
-  }
-
-  async function runInterpretResults(
-    language: Language,
-    queries: string[] | undefined,
-    sarifFile: string,
-    enableDebugLogging: boolean,
-    category: string | undefined,
-  ): Promise {
-    const databasePath = util.getCodeQLDatabasePath(config, language);
-    return await codeql.databaseInterpretResults(
-      databasePath,
-      queries,
-      sarifFile,
-      threadsFlag,
-      enableDebugLogging ? "-vv" : "-v",
-      sarifRunPropertyFlag,
-      category,
-      config,
-      features,
-    );
-  }
-
-  /** Get an object with all queries and their counts parsed from a SARIF file path. */
-  function getPerQueryAlertCounts(sarifPath: string): Record {
-    const sarifObject = JSON.parse(
-      fs.readFileSync(sarifPath, "utf8"),
-    ) as sarif.Log;
-    // We do not need to compute fingerprints because we are not sending data based off of locations.
-
-    // Generate the query: alert count object
-    const perQueryAlertCounts: Record = {};
-
-    // All rules (queries), from all results, from all runs
-    for (const sarifRun of sarifObject.runs) {
-      if (sarifRun.results) {
-        for (const result of sarifRun.results) {
-          const query = result.rule?.id || result.ruleId;
-          if (query) {
-            perQueryAlertCounts[query] = (perQueryAlertCounts[query] || 0) + 1;
-          }
-        }
-      }
-    }
-    return perQueryAlertCounts;
-  }
-}
-
-export async function runFinalize(
-  features: FeatureEnablement,
-  outputDir: string,
-  threadsFlag: string,
-  memoryFlag: string,
-  codeql: CodeQL,
-  config: configUtils.Config,
-  logger: Logger,
-): Promise {
-  try {
-    await fs.promises.rm(outputDir, { force: true, recursive: true });
-  } catch (error: any) {
-    if (error?.code !== "ENOENT") {
-      throw error;
-    }
-  }
-  await fs.promises.mkdir(outputDir, { recursive: true });
-
-  const timings = await finalizeDatabaseCreation(
-    codeql,
-    features,
-    config,
-    threadsFlag,
-    memoryFlag,
-    logger,
-  );
-
-  // If we didn't already end tracing in the autobuild Action, end it now.
-  if (process.env[EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY] !== "true") {
-    await endTracingForCluster(codeql, config, logger);
-  }
-  return timings;
-}
-
-export async function warnIfGoInstalledAfterInit(
-  config: configUtils.Config,
-  logger: Logger,
-) {
-  // Check that `which go` still points at the same path it did when the `init` Action ran to ensure that no steps
-  // in-between performed any setup. We encourage users to perform all setup tasks before initializing CodeQL so that
-  // the setup tasks do not interfere with our analysis.
-  // Furthermore, if we installed a wrapper script in the `init` Action, we need to ensure that there isn't a step
-  // in the workflow after the `init` step which installs a different version of Go and takes precedence in the PATH,
-  // thus potentially circumventing our workaround that allows tracing to work.
-  const goInitPath = process.env[EnvVar.GO_BINARY_LOCATION];
-
-  if (
-    process.env[EnvVar.DID_AUTOBUILD_GOLANG] !== "true" &&
-    goInitPath !== undefined
-  ) {
-    const goBinaryPath = await io.which("go", true);
-
-    if (goInitPath !== goBinaryPath) {
-      logger.warning(
-        `Expected \`which go\` to return ${goInitPath}, but got ${goBinaryPath}: please ensure that the correct version of Go is installed before the \`codeql-action/init\` Action is used.`,
-      );
-
-      addDiagnostic(
-        config,
-        BuiltInLanguage.go,
-        makeDiagnostic(
-          "go/workflow/go-installed-after-codeql-init",
-          "Go was installed after the `codeql-action/init` Action was run",
-          {
-            markdownMessage:
-              "To avoid interfering with the CodeQL analysis, perform all installation steps before calling the `github/codeql-action/init` Action.",
-            visibility: {
-              statusPage: true,
-              telemetry: true,
-              cliSummaryTable: true,
-            },
-            severity: "warning",
-          },
-        ),
-      );
-    }
-  }
-}
diff --git a/src/api-client.test.ts b/src/api-client.test.ts
deleted file mode 100644
index ae8c6269b1..0000000000
--- a/src/api-client.test.ts
+++ /dev/null
@@ -1,274 +0,0 @@
-import * as github from "@actions/github";
-import * as githubUtils from "@actions/github/lib/utils";
-import test from "ava";
-import * as sinon from "sinon";
-import { ProxyAgent } from "undici";
-
-import * as actionsUtil from "./actions-util";
-import * as api from "./api-client";
-import { DO_NOT_RETRY_STATUSES } from "./api-client";
-import { ActionsEnvVars, RegistryProxyVars } from "./environment";
-import { callee, getTestEnv, setupTests } from "./testing-utils";
-import * as util from "./util";
-
-setupTests(test);
-
-test.beforeEach(() => {
-  util.initializeEnvironment(actionsUtil.getActionVersion());
-});
-
-test.serial("getApiClient", async (t) => {
-  const pluginStub: sinon.SinonStub = sinon.stub(githubUtils.GitHub, "plugin");
-  const githubStub: sinon.SinonStub = sinon.stub();
-  pluginStub.returns(githubStub);
-
-  const env = getTestEnv();
-  env.set(ActionsEnvVars.GITHUB_SERVER_URL, "http://github.localhost");
-  env.set(ActionsEnvVars.GITHUB_API_URL, "http://api.github.localhost");
-
-  sinon.stub(actionsUtil, "getRequiredInput").withArgs("token").returns("xyz");
-
-  const apiClient = api.getApiClient(env);
-  t.truthy(apiClient);
-
-  t.true(githubStub.calledOnce);
-  t.assert(
-    githubStub.calledOnceWithExactly({
-      auth: "token xyz",
-      baseUrl: "http://api.github.localhost",
-      log: sinon.match.any,
-      userAgent: `CodeQL-Action/${actionsUtil.getActionVersion()}`,
-      request: sinon.match.any,
-      retry: {
-        doNotRetry: DO_NOT_RETRY_STATUSES,
-      },
-    }),
-  );
-});
-
-function mockGetMetaVersionHeader(
-  versionHeader: string | undefined,
-): sinon.SinonStub {
-  // Passing an auth token is required, so we just use a dummy value
-  const client = github.getOctokit("123");
-  const response = {
-    headers: {
-      "x-github-enterprise-version": versionHeader,
-    },
-  };
-  const spyGetContents = sinon
-    .stub(client.rest.meta, "get")
-    // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-    .resolves(response as any);
-  sinon.stub(api, "getApiClient").value(() => client);
-  return spyGetContents;
-}
-
-test.serial("getGitHubVersion for Dotcom", async (t) => {
-  const apiDetails = {
-    auth: "",
-    url: "https://github.com",
-    apiURL: "",
-  };
-  sinon.stub(api, "getApiDetails").returns(apiDetails);
-  const v = await api.getGitHubVersionFromApi(
-    github.getOctokit("123"),
-    apiDetails,
-  );
-  t.deepEqual(util.GitHubVariant.DOTCOM, v.type);
-});
-
-test.serial("getGitHubVersion for GHES", async (t) => {
-  mockGetMetaVersionHeader("2.0");
-  const v2 = await api.getGitHubVersionFromApi(api.getApiClient(), {
-    auth: "",
-    url: "https://ghe.example.com",
-    apiURL: undefined,
-  });
-  t.deepEqual(
-    { type: util.GitHubVariant.GHES, version: "2.0" } as util.GitHubVersion,
-    v2,
-  );
-});
-
-test.serial("getGitHubVersion for different domain", async (t) => {
-  mockGetMetaVersionHeader(undefined);
-  const v3 = await api.getGitHubVersionFromApi(api.getApiClient(), {
-    auth: "",
-    url: "https://ghe.example.com",
-    apiURL: undefined,
-  });
-  t.deepEqual({ type: util.GitHubVariant.DOTCOM }, v3);
-});
-
-test.serial("getGitHubVersion for GHEC-DR", async (t) => {
-  mockGetMetaVersionHeader("ghe.com");
-  const gheDotcom = await api.getGitHubVersionFromApi(api.getApiClient(), {
-    auth: "",
-    url: "https://foo.ghe.com",
-    apiURL: undefined,
-  });
-  t.deepEqual({ type: util.GitHubVariant.GHEC_DR }, gheDotcom);
-});
-
-test.serial(
-  "wrapApiConfigurationError correctly wraps specific configuration errors",
-  (t) => {
-    // We don't reclassify arbitrary errors
-    const arbitraryError = new Error("arbitrary error");
-    let res = api.wrapApiConfigurationError(arbitraryError);
-    t.is(res, arbitraryError);
-
-    // Same goes for arbitrary errors
-    const configError = new util.ConfigurationError("arbitrary error");
-    res = api.wrapApiConfigurationError(configError);
-    t.is(res, configError);
-
-    // If an HTTP error doesn't contain a specific error message, we don't
-    // wrap is an an API error.
-    const httpError = new util.HTTPError("arbitrary HTTP error", 456);
-    res = api.wrapApiConfigurationError(httpError);
-    t.is(res, httpError);
-
-    // For other HTTP errors, we wrap them as Configuration errors if they contain
-    // specific error messages.
-    const httpNotFoundError = new util.HTTPError("commit not found", 404);
-    res = api.wrapApiConfigurationError(httpNotFoundError);
-    t.deepEqual(res, new util.ConfigurationError("commit not found"));
-
-    const refNotFoundError = new util.HTTPError(
-      "ref 'refs/heads/jitsi' not found in this repository - https://docs.github.com/rest",
-      404,
-    );
-    res = api.wrapApiConfigurationError(refNotFoundError);
-    t.deepEqual(
-      res,
-      new util.ConfigurationError(
-        "ref 'refs/heads/jitsi' not found in this repository - https://docs.github.com/rest",
-      ),
-    );
-
-    const apiRateLimitError = new util.HTTPError(
-      "API rate limit exceeded for installation",
-      403,
-    );
-    res = api.wrapApiConfigurationError(apiRateLimitError);
-    t.deepEqual(
-      res,
-      new util.ConfigurationError("API rate limit exceeded for installation"),
-    );
-
-    const tokenSuggestionMessage =
-      "Please check that your token is valid and has the required permissions: contents: read, security-events: write";
-    const badCredentialsError = new util.HTTPError("Bad credentials", 401);
-    res = api.wrapApiConfigurationError(badCredentialsError);
-    t.deepEqual(res, new util.ConfigurationError(tokenSuggestionMessage));
-
-    const notFoundError = new util.HTTPError("Not Found", 404);
-    res = api.wrapApiConfigurationError(notFoundError);
-    t.deepEqual(res, new util.ConfigurationError(tokenSuggestionMessage));
-
-    const resourceNotAccessibleError = new util.HTTPError(
-      "Resource not accessible by integration",
-      403,
-    );
-    res = api.wrapApiConfigurationError(resourceNotAccessibleError);
-    t.deepEqual(
-      res,
-      new util.ConfigurationError("Resource not accessible by integration"),
-    );
-
-    // Enablement errors.
-    const enablementErrorMessages = [
-      "Code Security must be enabled for this repository to use code scanning",
-      "Advanced Security must be enabled for this repository to use code scanning",
-      "Code Scanning is not enabled for this repository. Please enable code scanning in the repository settings.",
-      "Code quality is not enabled for this repository. Please enable code quality in the repository settings.",
-    ];
-    const transforms = [
-      (msg: string) => msg,
-      (msg: string) => msg.toLowerCase(),
-      (msg: string) => msg.toLocaleUpperCase(),
-    ];
-
-    for (const enablementErrorMessage of enablementErrorMessages) {
-      for (const transform of transforms) {
-        const enablementError = new util.HTTPError(
-          transform(enablementErrorMessage),
-          403,
-        );
-        res = api.wrapApiConfigurationError(enablementError);
-        t.deepEqual(
-          res,
-          new util.ConfigurationError(
-            api.getFeatureEnablementError(enablementError.message),
-          ),
-        );
-      }
-    }
-  },
-);
-
-test("getRegistryProxy - returns undefined if the proxy is not configured", async (t) => {
-  const target = callee(api.getRegistryProxy).withArgs();
-
-  // Empty environment.
-  await target.passes(t.is, undefined);
-  // Only the host.
-  await target
-    .withEnv(getTestEnv({ [RegistryProxyVars.PROXY_HOST]: "localhost" }))
-    .passes(t.is, undefined);
-  // Only the port.
-  await target
-    .withEnv(getTestEnv({ [RegistryProxyVars.PROXY_PORT]: "1234" }))
-    .passes(t.is, undefined);
-});
-
-test("getRegistryProxy - returns value when both vars are set", async (t) => {
-  await callee(api.getRegistryProxy)
-    .withArgs()
-    .withEnv(
-      getTestEnv({
-        [RegistryProxyVars.PROXY_HOST]: "localhost",
-        [RegistryProxyVars.PROXY_PORT]: "1234",
-      }),
-    )
-    .passes(t.truthy);
-});
-
-test("getRegistryProxyConfig - gets the configuration from the env vars", async (t) => {
-  const host = "localhost";
-  const port = "1234";
-  const ca = "cert";
-
-  await callee(api.getRegistryProxyConfig)
-    .withArgs()
-    .withEnv(
-      getTestEnv({
-        [RegistryProxyVars.PROXY_HOST]: host,
-        [RegistryProxyVars.PROXY_PORT]: port,
-        [RegistryProxyVars.PROXY_CA_CERTIFICATE]: ca,
-      }),
-    )
-    .passes(t.like, { host, port, ca });
-});
-
-test("makeProxyRequestOptions - returns defaults without custom proxy", async (t) => {
-  t.deepEqual(
-    api.makeProxyRequestOptions(undefined),
-    githubUtils.defaults.request,
-  );
-});
-
-test("makeProxyRequestOptions - returns fetch with custom proxy", async (t) => {
-  const opts = api.makeProxyRequestOptions(
-    new ProxyAgent("http://localhost:1080"),
-  );
-  // Fetch should be different from the defaults.
-  t.notDeepEqual(opts?.fetch, githubUtils.defaults.request?.fetch);
-  // The options should be the same aside from that.
-  t.deepEqual(
-    { ...opts, fetch: githubUtils.defaults.request?.fetch },
-    githubUtils.defaults.request,
-  );
-});
diff --git a/src/api-client.ts b/src/api-client.ts
deleted file mode 100644
index ba800a2587..0000000000
--- a/src/api-client.ts
+++ /dev/null
@@ -1,452 +0,0 @@
-import * as core from "@actions/core";
-import * as githubUtils from "@actions/github/lib/utils";
-import { type Octokit } from "@octokit/core";
-import { type PaginateInterface } from "@octokit/plugin-paginate-rest";
-import { type Api } from "@octokit/plugin-rest-endpoint-methods";
-import * as retry from "@octokit/plugin-retry";
-import { RequestRequestOptions } from "@octokit/types";
-import {
-  ProxyAgent,
-  RequestInfo,
-  RequestInit,
-  fetch as undiciFetch,
-} from "undici";
-
-import type { ActionState } from "./action-common";
-import { getActionVersion, getRequiredInput } from "./actions-util";
-import {
-  ActionsEnvVars,
-  EnvVar,
-  ReadOnlyEnv,
-  RegistryProxyVars,
-  getEnv,
-} from "./environment";
-import { Logger } from "./logging";
-import { getRepositoryNwo, RepositoryNwo } from "./repository";
-import {
-  asHTTPError,
-  ConfigurationError,
-  getRequiredEnvParam,
-  GITHUB_DOTCOM_URL,
-  GitHubVariant,
-  GitHubVersion,
-  parseGitHubUrl,
-  parseMatrixInput,
-} from "./util";
-
-const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version";
-
-/**
- * HTTP status codes that should not be retried.
- *
- * The default Octokit list is 400, 401, 403, 404, 410, 422, and 451. We have
- * observed transient errors with authentication, so we remove 401, 403, and 404
- * from the default list to ensure that these errors are retried.
- */
-export const DO_NOT_RETRY_STATUSES = [400, 410, 422, 451];
-
-export type GitHubApiCombinedDetails = GitHubApiDetails &
-  GitHubApiExternalRepoDetails;
-
-export interface GitHubApiDetails {
-  auth: string;
-  url: string;
-  apiURL: string | undefined;
-}
-
-export interface GitHubApiExternalRepoDetails {
-  externalRepoAuth?: string;
-  url: string;
-  apiURL: string | undefined;
-}
-
-/**
- * Gets the configuration for the private registry authentication proxy,
- * if it is available in the environment.
- *
- * @param action The required Action state.
- * @returns The hostname, port, and CA retrieved from the corresponding environment variables.
- */
-export function getRegistryProxyConfig(action: ActionState<["ReadOnlyEnv"]>) {
-  return {
-    host: action.env.getOptional(RegistryProxyVars.PROXY_HOST),
-    port: action.env.getOptional(RegistryProxyVars.PROXY_PORT),
-    ca: action.env.getOptional(RegistryProxyVars.PROXY_CA_CERTIFICATE),
-  };
-}
-
-/**
- * Gets the configuration for the private registry authentication proxy,
- * and uses it to initialise a corresponding `ProxyAgent`.
- *
- * @param action The required Action state.
- * @returns A `ProxyAgent` corresponding to the private registry proxy,
- *          or `undefined` if we couldn't retrieve the host and port.
- */
-export function getRegistryProxy(
-  action: ActionState<["Logger", "ReadOnlyEnv"]>,
-): ProxyAgent | undefined {
-  const { host, port, ca } = getRegistryProxyConfig(action);
-
-  if (host && port) {
-    const uri = `http://${host}:${port}`;
-    action.logger.debug(
-      `Using private registry proxy at '${uri}' for API client.`,
-    );
-    return new ProxyAgent({
-      uri,
-      keepAliveTimeout: 10,
-      keepAliveMaxTimeout: 10,
-      requestTls: ca ? { ca } : undefined,
-    });
-  }
-
-  return undefined;
-}
-
-/**
- * Constructs a `RequestRequestOptions` with a custom `fetch` implementation
- * that uses `dispatcher` as a proxy for requests.
- *
- * @param dispatcher The proxy to use, if any.
- */
-export function makeProxyRequestOptions(
-  dispatcher: ProxyAgent | undefined,
-): RequestRequestOptions | undefined {
-  // If we don't have a custom `ProxyAgent`, return the defaults.
-  if (dispatcher === undefined) {
-    return githubUtils.defaults.request;
-  }
-
-  // Otherwise, construct the custom `fetch` and add it onto the defaults.
-  return {
-    ...githubUtils.defaults.request,
-    fetch: (req: RequestInfo, init?: RequestInit) => {
-      return undiciFetch(req, { ...init, dispatcher });
-    },
-  };
-}
-
-/** The type of GitHub API client we use. */
-export type ApiClient = Octokit & Api & { paginate: PaginateInterface };
-
-/** Options for `createApiClientWithDetails`. */
-interface CreateApiClientOptions {
-  allowExternal?: boolean;
-  proxy?: ProxyAgent;
-}
-
-function createApiClientWithDetails(
-  apiDetails: GitHubApiCombinedDetails,
-  { allowExternal = false, proxy = undefined }: CreateApiClientOptions = {},
-): ApiClient {
-  const auth =
-    (allowExternal && apiDetails.externalRepoAuth) || apiDetails.auth;
-  const retryingOctokit = githubUtils.GitHub.plugin(retry.retry);
-  const requestOptions = makeProxyRequestOptions(proxy);
-  return new retryingOctokit(
-    githubUtils.getOctokitOptions(auth, {
-      baseUrl: apiDetails.apiURL,
-      userAgent: `CodeQL-Action/${getActionVersion()}`,
-      log: {
-        debug: core.debug,
-        info: core.info,
-        warn: core.warning,
-        error: core.error,
-      },
-      request: requestOptions,
-      retry: {
-        doNotRetry: DO_NOT_RETRY_STATUSES,
-      },
-    }),
-  );
-}
-
-export function getApiDetails(env: ReadOnlyEnv = getEnv()): GitHubApiDetails {
-  return {
-    auth: getRequiredInput("token"),
-    url: env.getRequired(ActionsEnvVars.GITHUB_SERVER_URL),
-    apiURL: env.getRequired(ActionsEnvVars.GITHUB_API_URL),
-  };
-}
-
-export function getApiClient(env: ReadOnlyEnv = getEnv()) {
-  return createApiClientWithDetails(getApiDetails(env));
-}
-
-export function getApiClientWithExternalAuth(
-  apiDetails: GitHubApiCombinedDetails,
-  proxy?: ProxyAgent,
-) {
-  return createApiClientWithDetails(apiDetails, { allowExternal: true, proxy });
-}
-
-/**
- * Gets a value for the `Authorization` header for a request to `url`; or `undefined` if the
- * `Authorization` header should not be set for `url`.
- *
- * @param logger The logger to use for debugging messages.
- * @param apiDetails Details of the GitHub API we are using.
- * @param url The URL for which we want to add an `Authorization` header.
- *
- * @returns The value for the `Authorization` header or `undefined` if it shouldn't be populated.
- */
-export function getAuthorizationHeaderFor(
-  logger: Logger,
-  apiDetails: GitHubApiDetails,
-  url: string,
-): string | undefined {
-  // We only want to provide an authorization header if we are downloading
-  // from the same GitHub instance the Action is running on.
-  // This avoids leaking Enterprise tokens to dotcom.
-  if (
-    url.startsWith(`${apiDetails.url}/`) ||
-    (apiDetails.apiURL && url.startsWith(`${apiDetails.apiURL}/`))
-  ) {
-    logger.debug(`Providing an authorization token.`);
-    return `token ${apiDetails.auth}`;
-  }
-
-  logger.debug(`Not using an authorization token.`);
-  return undefined;
-}
-
-let cachedGitHubVersion: GitHubVersion | undefined = undefined;
-
-export async function getGitHubVersionFromApi(
-  apiClient: any,
-  apiDetails: GitHubApiDetails,
-): Promise {
-  // We can avoid making an API request in the standard dotcom case
-  if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) {
-    return { type: GitHubVariant.DOTCOM };
-  }
-
-  // Doesn't strictly have to be the meta endpoint as we're only
-  // using the response headers which are available on every request.
-  //
-  // See https://docs.github.com/en/rest/meta/meta#get-github-meta-information.
-  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-  const response = await apiClient.rest.meta.get();
-
-  // This happens on dotcom, although we expect to have already returned in that
-  // case. This can also serve as a fallback in cases we haven't foreseen.
-  if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === undefined) {
-    return { type: GitHubVariant.DOTCOM };
-  }
-
-  if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") {
-    return { type: GitHubVariant.GHEC_DR };
-  }
-
-  const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] as string;
-  return { type: GitHubVariant.GHES, version };
-}
-
-/**
- * Report the GitHub server version. This is a wrapper around
- * util.getGitHubVersion() that automatically supplies GitHub API details using
- * GitHub Action inputs.
- *
- * @returns GitHub version
- */
-export async function getGitHubVersion(): Promise {
-  if (cachedGitHubVersion === undefined) {
-    cachedGitHubVersion = await getGitHubVersionFromApi(
-      getApiClient(),
-      getApiDetails(),
-    );
-  }
-  return cachedGitHubVersion;
-}
-
-/**
- * Get the path of the currently executing workflow relative to the repository root.
- *
- * See https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run
- * and https://docs.github.com/en/rest/actions/workflows#get-a-workflow.
- */
-export async function getWorkflowRelativePath(): Promise {
-  const repo_nwo = getRepositoryNwo();
-  const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID"));
-
-  const apiClient = getApiClient();
-  const runsResponse = await apiClient.request(
-    "GET /repos/:owner/:repo/actions/runs/:run_id?exclude_pull_requests=true",
-    {
-      owner: repo_nwo.owner,
-      repo: repo_nwo.repo,
-      run_id,
-    },
-  );
-  const workflowUrl = runsResponse.data.workflow_url;
-
-  const requiredWorkflowRegex =
-    /\/repos\/[^/]+\/[^/]+\/actions\/required_workflows\/[^/]+/;
-  if (!workflowUrl || requiredWorkflowRegex.test(workflowUrl as string)) {
-    // For required workflows, the workflowUrl is invalid so we cannot fetch more informations
-    // about the workflow.
-    // However, the path is available in the original response.
-    return runsResponse.data.path as string;
-  }
-
-  const workflowResponse = await apiClient.request(`GET ${workflowUrl}`);
-
-  return workflowResponse.data.path as string;
-}
-
-/**
- * Get the analysis key parameter for the current job.
- *
- * This will combine the workflow path and current job name.
- * Computing this the first time requires making requests to
- * the GitHub API, but after that the result will be cached.
- */
-export async function getAnalysisKey(): Promise {
-  let analysisKey = process.env[EnvVar.ANALYSIS_KEY];
-  if (analysisKey !== undefined) {
-    return analysisKey;
-  }
-
-  const workflowPath = await getWorkflowRelativePath();
-  const jobName = getRequiredEnvParam("GITHUB_JOB");
-
-  analysisKey = `${workflowPath}:${jobName}`;
-  core.exportVariable(EnvVar.ANALYSIS_KEY, analysisKey);
-  return analysisKey;
-}
-
-export async function getAutomationID(): Promise {
-  const analysis_key = await getAnalysisKey();
-  const environment = getRequiredInput("matrix");
-
-  return computeAutomationID(analysis_key, environment);
-}
-
-export function computeAutomationID(
-  analysis_key: string,
-  environment: string | undefined,
-): string {
-  let automationID = `${analysis_key}/`;
-
-  const matrix = parseMatrixInput(environment);
-  if (matrix !== undefined) {
-    // the id has to be deterministic so we sort the fields
-    for (const entry of Object.entries(matrix).sort()) {
-      if (typeof entry[1] === "string") {
-        automationID += `${entry[0]}:${entry[1]}/`;
-      } else {
-        // In code scanning we just handle the string values,
-        // the rest get converted to the empty string
-        automationID += `${entry[0]}:/`;
-      }
-    }
-  }
-
-  return automationID;
-}
-
-export interface ActionsCacheItem {
-  created_at?: string;
-  id?: number;
-  key?: string;
-  size_in_bytes?: number;
-}
-
-/**
- * List all Actions cache entries starting with the provided key prefix and matching the provided ref.
- *
- * See https://docs.github.com/en/rest/actions/cache#list-github-actions-caches-for-a-repository.
- */
-export async function listActionsCaches(
-  keyPrefix: string,
-  ref?: string,
-): Promise {
-  const repositoryNwo = getRepositoryNwo();
-
-  return await getApiClient().paginate(
-    "GET /repos/{owner}/{repo}/actions/caches",
-    {
-      owner: repositoryNwo.owner,
-      repo: repositoryNwo.repo,
-      key: keyPrefix,
-      ref,
-    },
-  );
-}
-
-/**
- * Delete an Actions cache item by its ID.
- *
- * See https://docs.github.com/en/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id.
- */
-export async function deleteActionsCache(id: number) {
-  const repositoryNwo = getRepositoryNwo();
-
-  await getApiClient().rest.actions.deleteActionsCacheById({
-    owner: repositoryNwo.owner,
-    repo: repositoryNwo.repo,
-    cache_id: id,
-  });
-}
-
-/**
- * Retrieve all custom repository properties.
- *
- * See https://docs.github.com/en/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository.
- */
-export async function getRepositoryProperties(repositoryNwo: RepositoryNwo) {
-  return getApiClient().request("GET /repos/:owner/:repo/properties/values", {
-    owner: repositoryNwo.owner,
-    repo: repositoryNwo.repo,
-  });
-}
-
-function isEnablementError(msg: string) {
-  return [
-    /Code Security must be enabled/i,
-    /Advanced Security must be enabled/i,
-    /Code Scanning is not enabled/i,
-    /Code Quality is not enabled/i,
-  ].some((pattern) => pattern.test(msg));
-}
-
-// TODO: Move to `error-messages.ts` after refactoring import order to avoid cycle
-// since `error-messages.ts` currently depends on this file.
-export function getFeatureEnablementError(message: string): string {
-  return `Please verify that the necessary features are enabled: ${message}`;
-}
-
-export function wrapApiConfigurationError(e: unknown) {
-  const httpError = asHTTPError(e);
-  if (httpError !== undefined) {
-    if (
-      [
-        /API rate limit exceeded/,
-        /commit not found/,
-        /Resource not accessible by integration/,
-        /ref .* not found in this repository/,
-      ].some((pattern) => pattern.test(httpError.message))
-    ) {
-      return new ConfigurationError(httpError.message);
-    }
-    if (
-      httpError.message.includes("Bad credentials") ||
-      httpError.message.includes("Not Found") ||
-      httpError.message.includes("Requires authentication")
-    ) {
-      return new ConfigurationError(
-        "Please check that your token is valid and has the required permissions: contents: read, security-events: write",
-      );
-    }
-    if (httpError.status === 403 && isEnablementError(httpError.message)) {
-      return new ConfigurationError(
-        getFeatureEnablementError(httpError.message),
-      );
-    }
-    if (httpError.status === 429) {
-      return new ConfigurationError("API rate limit exceeded");
-    }
-  }
-  return e;
-}
diff --git a/src/api-compatibility.json b/src/api-compatibility.json
deleted file mode 100644
index 7569440194..0000000000
--- a/src/api-compatibility.json
+++ /dev/null
@@ -1 +0,0 @@
-{"maximumVersion": "3.22", "minimumVersion": "3.17"}
diff --git a/src/artifact-scanner.test.ts b/src/artifact-scanner.test.ts
deleted file mode 100644
index 56f99e1138..0000000000
--- a/src/artifact-scanner.test.ts
+++ /dev/null
@@ -1,183 +0,0 @@
-import * as fs from "fs";
-import * as os from "os";
-import * as path from "path";
-
-import test from "ava";
-
-import {
-  GITHUB_PAT_CLASSIC_PATTERN,
-  isAuthToken,
-  scanArtifactsForTokens,
-  TokenType,
-} from "./artifact-scanner";
-import { getRunnerLogger } from "./logging";
-import {
-  checkExpectedLogMessages,
-  getRecordingLogger,
-  LoggedMessage,
-  makeTestToken,
-} from "./testing-utils";
-
-test("makeTestToken", (t) => {
-  t.is(makeTestToken().length, 36);
-  t.is(makeTestToken(255).length, 255);
-});
-
-test("isAuthToken", (t) => {
-  // Undefined for strings that aren't tokens
-  t.is(isAuthToken("some string"), undefined);
-  t.is(isAuthToken("ghp_"), undefined);
-  t.is(isAuthToken("ghp_123"), undefined);
-
-  // Token types for strings that are tokens.
-  t.is(isAuthToken(`ghp_${makeTestToken()}`), TokenType.PersonalAccessClassic);
-  t.is(isAuthToken(`ghp_${makeTestToken()}`), TokenType.PersonalAccessClassic);
-  t.is(
-    isAuthToken(`ghs_${makeTestToken(255)}`),
-    TokenType.AppInstallationAccess,
-  );
-  t.is(
-    isAuthToken(`github_pat_${makeTestToken(22)}_${makeTestToken(59)}`),
-    TokenType.PersonalAccessFineGrained,
-  );
-
-  // With a custom pattern set
-  t.is(
-    isAuthToken(`ghp_${makeTestToken()}`, [GITHUB_PAT_CLASSIC_PATTERN]),
-    TokenType.PersonalAccessClassic,
-  );
-  t.is(
-    isAuthToken(`github_pat_${makeTestToken(22)}_${makeTestToken(59)}`, [
-      GITHUB_PAT_CLASSIC_PATTERN,
-    ]),
-    undefined,
-  );
-});
-
-const testTokens = [
-  {
-    type: TokenType.PersonalAccessClassic,
-    value: `ghp_${makeTestToken()}`,
-    checkPattern: "Personal Access Token",
-  },
-  {
-    type: TokenType.PersonalAccessFineGrained,
-    value:
-      "github_pat_1234567890ABCDEFGHIJKL_MNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHI",
-    checkPattern: "Personal Access Token",
-  },
-  {
-    type: TokenType.OAuth,
-    value: `gho_${makeTestToken()}`,
-  },
-  {
-    type: TokenType.UserToServer,
-    value: `ghu_${makeTestToken()}`,
-  },
-  {
-    type: TokenType.ServerToServer,
-    value: `ghs_${makeTestToken()}`,
-  },
-  {
-    type: TokenType.Refresh,
-    value: `ghr_${makeTestToken()}`,
-  },
-  {
-    type: TokenType.AppInstallationAccess,
-    value: `ghs_${makeTestToken(255)}`,
-  },
-];
-
-for (const { type, value, checkPattern } of testTokens) {
-  test(`scanArtifactsForTokens detects GitHub ${type} tokens in files`, async (t) => {
-    const logMessages = [];
-    const logger = getRecordingLogger(logMessages, { logToConsole: false });
-    const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "scanner-test-"));
-
-    try {
-      // Create a test file with a fake GitHub token
-      const testFile = path.join(tempDir, "test.txt");
-      fs.writeFileSync(testFile, `This is a test file with token ${value}`);
-
-      const error = await t.throwsAsync(
-        async () => await scanArtifactsForTokens([testFile], logger),
-      );
-
-      t.regex(
-        error?.message || "",
-        new RegExp(`Found 1 potential GitHub token.*${checkPattern || type}`),
-      );
-      t.regex(error?.message || "", /test\.txt/);
-
-      checkExpectedLogMessages(t, logMessages, [
-        "Starting best-effort check",
-        `Found 1 ${type}`,
-      ]);
-    } finally {
-      // Clean up
-      fs.rmSync(tempDir, { recursive: true, force: true });
-    }
-  });
-}
-
-test("scanArtifactsForTokens handles files without tokens", async (t) => {
-  const logger = getRunnerLogger(true);
-  const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "scanner-test-"));
-
-  try {
-    // Create a test file without tokens
-    const testFile = path.join(tempDir, "test.txt");
-    fs.writeFileSync(
-      testFile,
-      "This is a test file without any sensitive data",
-    );
-
-    await t.notThrowsAsync(
-      async () => await scanArtifactsForTokens([testFile], logger),
-    );
-  } finally {
-    // Clean up
-    fs.rmSync(tempDir, { recursive: true, force: true });
-  }
-});
-
-// `scanArchiveFile` does not support Windows, so we skip this test there.
-if (os.platform() !== "win32") {
-  test("scanArtifactsForTokens finds token in debug artifacts", async (t) => {
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages, { logToConsole: false });
-    // The zip here is a regression test based on
-    // https://github.com/github/codeql-action/security/advisories/GHSA-vqf5-2xx6-9wfm
-    const testZip = path.join(
-      __dirname,
-      "..",
-      "src",
-      "testdata",
-      "debug-artifacts-with-fake-token.zip",
-    );
-
-    // This zip file contains a nested structure with a fake token in:
-    // my-db-java-partial.zip/trap/java/invocations/kotlin.9017231652989744319.trap
-    const error = await t.throwsAsync(
-      async () => await scanArtifactsForTokens([testZip], logger),
-    );
-
-    t.regex(
-      error?.message || "",
-      /Found.*potential GitHub token/,
-      "Should detect token in nested zip",
-    );
-    t.regex(
-      error?.message || "",
-      /kotlin\.9017231652989744319\.trap/,
-      "Should report the .trap file containing the token",
-    );
-
-    const logOutput = messages.map((msg) => msg.message).join("\n");
-    t.regex(
-      logOutput,
-      /^Extracting gz file: .*\.gz$/m,
-      "Logs should show that .gz files were extracted",
-    );
-  });
-}
diff --git a/src/artifact-scanner.ts b/src/artifact-scanner.ts
deleted file mode 100644
index 5f238811a1..0000000000
--- a/src/artifact-scanner.ts
+++ /dev/null
@@ -1,430 +0,0 @@
-import * as fs from "fs";
-import * as os from "os";
-import * as path from "path";
-
-import * as exec from "@actions/exec";
-
-import { Logger } from "./logging";
-import { getErrorMessage } from "./util";
-
-/**
- * Enumerates known types of GitHub token formats.
- */
-export enum TokenType {
-  PersonalAccessClassic = "Personal Access Token (Classic)",
-  PersonalAccessFineGrained = "Personal Access Token (Fine-grained)",
-  OAuth = "OAuth Access Token",
-  UserToServer = "User-to-Server Token",
-  ServerToServer = "Server-to-Server Token",
-  Refresh = "Refresh Token",
-  AppInstallationAccess = "App Installation Access Token",
-}
-
-/** A value of this type associates a token type with its pattern. */
-export interface TokenPattern {
-  type: TokenType;
-  pattern: RegExp;
-}
-
-/** The pattern for PATs (Classic) */
-export const GITHUB_PAT_CLASSIC_PATTERN: TokenPattern = {
-  type: TokenType.PersonalAccessClassic,
-  pattern: /\bghp_[a-zA-Z0-9]{36}\b/g,
-};
-
-/** The pattern for PATs (Fine-grained) */
-export const GITHUB_PAT_FINE_GRAINED_PATTERN: TokenPattern = {
-  type: TokenType.PersonalAccessFineGrained,
-  pattern: /\bgithub_pat_[a-zA-Z0-9_]+\b/g,
-};
-
-/**
- * GitHub token patterns to scan for.
- * These patterns match various GitHub token formats.
- */
-const GITHUB_TOKEN_PATTERNS: TokenPattern[] = [
-  GITHUB_PAT_CLASSIC_PATTERN,
-  GITHUB_PAT_FINE_GRAINED_PATTERN,
-  {
-    type: TokenType.OAuth,
-    pattern: /\bgho_[a-zA-Z0-9]{36}\b/g,
-  },
-  {
-    type: TokenType.UserToServer,
-    pattern: /\bghu_[a-zA-Z0-9]{36}\b/g,
-  },
-  {
-    type: TokenType.ServerToServer,
-    pattern: /\bghs_[a-zA-Z0-9]{36}\b/g,
-  },
-  {
-    type: TokenType.Refresh,
-    pattern: /\bghr_[a-zA-Z0-9]{36}\b/g,
-  },
-  {
-    type: TokenType.AppInstallationAccess,
-    pattern: /\bghs_[a-zA-Z0-9]{255}\b/g,
-  },
-];
-
-interface TokenFinding {
-  tokenType: string;
-  filePath: string;
-}
-
-interface ScanResult {
-  scannedFiles: number;
-  findings: TokenFinding[];
-}
-
-/**
- * Checks whether `value` matches any token `patterns`.
- * @param value The value to match against.
- * @param patterns The patterns to check.
- * @returns The type of the first matching pattern, or `undefined` if none match.
- */
-export function isAuthToken(
-  value: string,
-  patterns: TokenPattern[] = GITHUB_TOKEN_PATTERNS,
-) {
-  for (const { type, pattern } of patterns) {
-    if (value.match(pattern)) {
-      return type;
-    }
-  }
-  return undefined;
-}
-
-/**
- * Scans a file for GitHub tokens.
- *
- * @param filePath Path to the file to scan
- * @param relativePath Relative path for display purposes
- * @param logger Logger instance
- * @returns Array of token findings in the file
- */
-function scanFileForTokens(
-  filePath: string,
-  relativePath: string,
-  logger: Logger,
-): TokenFinding[] {
-  const findings: TokenFinding[] = [];
-  try {
-    const content = fs.readFileSync(filePath, "utf8");
-
-    for (const { type, pattern } of GITHUB_TOKEN_PATTERNS) {
-      const matches = content.match(pattern);
-      if (matches) {
-        for (let i = 0; i < matches.length; i++) {
-          findings.push({ tokenType: type, filePath: relativePath });
-        }
-        logger.debug(`Found ${matches.length} ${type}(s) in ${relativePath}`);
-      }
-    }
-
-    return findings;
-  } catch (e) {
-    // If we can't read the file as text, it's likely binary or inaccessible
-    logger.debug(
-      `Could not scan file ${filePath} for tokens: ${getErrorMessage(e)}`,
-    );
-    return [];
-  }
-}
-
-/**
- * Recursively extracts and scans archive files (.zip, .gz, .tar.gz).
- *
- * @param archivePath Path to the archive file
- * @param relativeArchivePath Relative path of the archive for display
- * @param extractDir Directory to extract to
- * @param logger Logger instance
- * @param depth Current recursion depth (to prevent infinite loops)
- * @returns Scan results
- */
-async function scanArchiveFile(
-  archivePath: string,
-  relativeArchivePath: string,
-  extractDir: string,
-  logger: Logger,
-  depth: number = 0,
-): Promise {
-  const MAX_DEPTH = 10; // Prevent infinite recursion
-  if (depth > MAX_DEPTH) {
-    throw new Error(
-      `Maximum archive extraction depth (${MAX_DEPTH}) reached for ${archivePath}`,
-    );
-  }
-
-  if (process.platform === "win32") {
-    throw new Error("Scanning archives is not supported on Windows.");
-  }
-
-  const result: ScanResult = {
-    scannedFiles: 0,
-    findings: [],
-  };
-
-  try {
-    const tempExtractDir = fs.mkdtempSync(
-      path.join(extractDir, `extract-${depth}-`),
-    );
-
-    // Determine archive type and extract accordingly
-    const fileName = path.basename(archivePath).toLowerCase();
-    if (fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz")) {
-      // Extract tar.gz files
-      logger.debug(`Extracting tar.gz file: ${archivePath}`);
-      await exec.exec("tar", ["-xzf", archivePath, "-C", tempExtractDir], {
-        silent: true,
-      });
-    } else if (fileName.endsWith(".tar.zst")) {
-      // Extract tar.zst files
-      logger.debug(`Extracting tar.zst file: ${archivePath}`);
-      await exec.exec(
-        "tar",
-        ["--zstd", "-xf", archivePath, "-C", tempExtractDir],
-        {
-          silent: true,
-        },
-      );
-    } else if (fileName.endsWith(".zst")) {
-      // Extract .zst files (single file compression)
-      logger.debug(`Extracting zst file: ${archivePath}`);
-      const outputFile = path.join(
-        tempExtractDir,
-        path.basename(archivePath, ".zst"),
-      );
-      await exec.exec("zstd", ["-d", archivePath, "-o", outputFile], {
-        silent: true,
-      });
-    } else if (fileName.endsWith(".gz")) {
-      // Extract .gz files (single file compression)
-      logger.debug(`Extracting gz file: ${archivePath}`);
-      const outputFile = path.join(
-        tempExtractDir,
-        path.basename(archivePath, ".gz"),
-      );
-      await exec.exec("gunzip", ["-c", archivePath], {
-        outStream: fs.createWriteStream(outputFile),
-        silent: true,
-      });
-    } else if (fileName.endsWith(".zip")) {
-      // Extract zip files
-      logger.debug(`Extracting zip file: ${archivePath}`);
-      await exec.exec(
-        "unzip",
-        ["-q", "-o", archivePath, "-d", tempExtractDir],
-        {
-          silent: true,
-        },
-      );
-    }
-
-    // Scan the extracted contents
-    const scanResult = await scanDirectory(
-      tempExtractDir,
-      relativeArchivePath,
-      logger,
-      depth + 1,
-    );
-    result.scannedFiles += scanResult.scannedFiles;
-    result.findings.push(...scanResult.findings);
-
-    // Clean up extracted files
-    fs.rmSync(tempExtractDir, { recursive: true, force: true });
-  } catch (e) {
-    logger.debug(
-      `Could not extract or scan archive file ${archivePath}: ${getErrorMessage(e)}`,
-    );
-  }
-
-  return result;
-}
-
-/**
- * Scans a single file, including recursive archive extraction if applicable.
- *
- * @param fullPath Full path to the file
- * @param relativePath Relative path for display
- * @param extractDir Directory to use for extraction (for archive files)
- * @param logger Logger instance
- * @param depth Current recursion depth
- * @returns Scan results
- */
-async function scanFile(
-  fullPath: string,
-  relativePath: string,
-  extractDir: string,
-  logger: Logger,
-  depth: number = 0,
-): Promise {
-  const result: ScanResult = {
-    scannedFiles: 1,
-    findings: [],
-  };
-
-  // Check if it's an archive file and recursively scan it
-  const fileName = path.basename(fullPath).toLowerCase();
-  const isArchive =
-    fileName.endsWith(".zip") ||
-    fileName.endsWith(".tar.gz") ||
-    fileName.endsWith(".tgz") ||
-    fileName.endsWith(".tar.zst") ||
-    fileName.endsWith(".zst") ||
-    fileName.endsWith(".gz");
-
-  if (isArchive) {
-    const archiveResult = await scanArchiveFile(
-      fullPath,
-      relativePath,
-      extractDir,
-      logger,
-      depth,
-    );
-    result.scannedFiles += archiveResult.scannedFiles;
-    result.findings.push(...archiveResult.findings);
-  }
-
-  // Scan the file itself for tokens (unless it's a pure binary archive format)
-  const fileFindings = scanFileForTokens(fullPath, relativePath, logger);
-  result.findings.push(...fileFindings);
-
-  return result;
-}
-
-/**
- * Recursively scans a directory for GitHub tokens.
- *
- * @param dirPath Directory path to scan
- * @param baseRelativePath Base relative path for computing display paths
- * @param logger Logger instance
- * @param depth Current recursion depth
- * @returns Scan results
- */
-async function scanDirectory(
-  dirPath: string,
-  baseRelativePath: string,
-  logger: Logger,
-  depth: number = 0,
-): Promise {
-  const result: ScanResult = {
-    scannedFiles: 0,
-    findings: [],
-  };
-
-  const entries = fs.readdirSync(dirPath, { withFileTypes: true });
-
-  for (const entry of entries) {
-    const fullPath = path.join(dirPath, entry.name);
-    const relativePath = path.join(baseRelativePath, entry.name);
-
-    if (entry.isDirectory()) {
-      const subResult = await scanDirectory(
-        fullPath,
-        relativePath,
-        logger,
-        depth,
-      );
-      result.scannedFiles += subResult.scannedFiles;
-      result.findings.push(...subResult.findings);
-    } else if (entry.isFile()) {
-      const fileResult = await scanFile(
-        fullPath,
-        relativePath,
-        path.dirname(fullPath),
-        logger,
-        depth,
-      );
-      result.scannedFiles += fileResult.scannedFiles;
-      result.findings.push(...fileResult.findings);
-    }
-  }
-
-  return result;
-}
-
-/**
- * Scans a list of files and directories for GitHub tokens.
- * Recursively extracts and scans archive files (.zip, .gz, .tar.gz).
- *
- * @param filesToScan List of file paths to scan
- * @param logger Logger instance
- * @returns Scan results
- */
-export async function scanArtifactsForTokens(
-  filesToScan: string[],
-  logger: Logger,
-): Promise {
-  logger.info(
-    "Starting best-effort check for potential GitHub tokens in debug artifacts (for testing purposes only)...",
-  );
-
-  const result: ScanResult = {
-    scannedFiles: 0,
-    findings: [],
-  };
-
-  // Create a temporary directory for extraction
-  const tempScanDir = fs.mkdtempSync(path.join(os.tmpdir(), "artifact-scan-"));
-
-  try {
-    for (const filePath of filesToScan) {
-      const stats = fs.statSync(filePath);
-      const fileName = path.basename(filePath);
-
-      if (stats.isDirectory()) {
-        const dirResult = await scanDirectory(filePath, fileName, logger);
-        result.scannedFiles += dirResult.scannedFiles;
-        result.findings.push(...dirResult.findings);
-      } else if (stats.isFile()) {
-        const fileResult = await scanFile(
-          filePath,
-          fileName,
-          tempScanDir,
-          logger,
-        );
-        result.scannedFiles += fileResult.scannedFiles;
-        result.findings.push(...fileResult.findings);
-      }
-    }
-
-    // Compute statistics from findings
-    const tokenTypesCounts = new Map();
-    const filesWithTokens = new Set();
-    for (const finding of result.findings) {
-      tokenTypesCounts.set(
-        finding.tokenType,
-        (tokenTypesCounts.get(finding.tokenType) || 0) + 1,
-      );
-      filesWithTokens.add(finding.filePath);
-    }
-
-    const tokenTypesSummary = Array.from(tokenTypesCounts.entries())
-      .map(([type, count]) => `${count} ${type}${count > 1 ? "s" : ""}`)
-      .join(", ");
-
-    const baseSummary = `scanned ${result.scannedFiles} files, found ${result.findings.length} potential token(s) in ${filesWithTokens.size} file(s)`;
-    const summaryWithTypes = tokenTypesSummary
-      ? `${baseSummary} (${tokenTypesSummary})`
-      : baseSummary;
-
-    logger.info(`Artifact check complete: ${summaryWithTypes}`);
-
-    if (result.findings.length > 0) {
-      const fileList = Array.from(filesWithTokens).join(", ");
-      throw new Error(
-        `Found ${result.findings.length} potential GitHub token(s) (${tokenTypesSummary}) in debug artifacts at: ${fileList}. This is a best-effort check for testing purposes only.`,
-      );
-    }
-  } finally {
-    // Clean up temporary directory
-    try {
-      fs.rmSync(tempScanDir, { recursive: true, force: true });
-    } catch (e) {
-      logger.debug(
-        `Could not clean up temporary scan directory: ${getErrorMessage(e)}`,
-      );
-    }
-  }
-}
diff --git a/src/autobuild-action.ts b/src/autobuild-action.ts
deleted file mode 100644
index 9fa8016578..0000000000
--- a/src/autobuild-action.ts
+++ /dev/null
@@ -1,151 +0,0 @@
-import * as core from "@actions/core";
-
-import { Action, ActionState, runInActions } from "./action-common";
-import {
-  getActionVersion,
-  getOptionalInput,
-  getTemporaryDirectory,
-} from "./actions-util";
-import { getGitHubVersion } from "./api-client";
-import { determineAutobuildLanguages, runAutobuild } from "./autobuild";
-import { getCodeQL } from "./codeql";
-import { Config, getConfig } from "./config-utils";
-import { EnvVar } from "./environment";
-import { Language } from "./languages";
-import { Logger } from "./logging";
-import {
-  StatusReportBase,
-  getActionsStatus,
-  createStatusReportBase,
-  sendStatusReport,
-  ActionName,
-} from "./status-report";
-import { endTracingForCluster } from "./tracer-config";
-import {
-  checkActionVersion,
-  checkDiskUsage,
-  checkGitHubVersionInRange,
-  ConfigurationError,
-  initializeEnvironment,
-  wrapError,
-} from "./util";
-
-interface AutobuildStatusReport extends StatusReportBase {
-  /** Comma-separated set of languages being auto-built. */
-  autobuild_languages: string;
-  /** Language that failed autobuilding (or undefined if all languages succeeded). */
-  autobuild_failure?: string;
-}
-
-async function sendCompletedStatusReport(
-  config: Config | undefined,
-  logger: Logger,
-  startedAt: Date,
-  allLanguages: string[],
-  failingLanguage?: string,
-  cause?: Error,
-) {
-  initializeEnvironment(getActionVersion());
-
-  const status = getActionsStatus(cause, failingLanguage);
-  const statusReportBase = await createStatusReportBase(
-    ActionName.Autobuild,
-    status,
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger,
-    cause?.message,
-    cause?.stack,
-  );
-  if (statusReportBase !== undefined) {
-    const statusReport: AutobuildStatusReport = {
-      ...statusReportBase,
-      autobuild_languages: allLanguages.join(","),
-      autobuild_failure: failingLanguage,
-    };
-    await sendStatusReport(statusReport);
-  }
-}
-
-async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-
-  let config: Config | undefined;
-  let currentLanguage: Language | undefined;
-  let languages: Language[] | undefined;
-  try {
-    const statusReportBase = await createStatusReportBase(
-      ActionName.Autobuild,
-      "starting",
-      startedAt,
-      config,
-      await checkDiskUsage(logger),
-      logger,
-    );
-    if (statusReportBase !== undefined) {
-      await sendStatusReport(statusReportBase);
-    }
-
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    checkActionVersion(getActionVersion(), gitHubVersion);
-
-    config = await getConfig(getTemporaryDirectory(), logger);
-    if (config === undefined) {
-      throw new ConfigurationError(
-        "Config file could not be found at expected location. Has the 'init' action been called?",
-      );
-    }
-
-    const codeql = await getCodeQL(logger, config.codeQLCmd);
-
-    languages = await determineAutobuildLanguages(codeql, config, logger);
-    if (languages !== undefined) {
-      const workingDirectory = getOptionalInput("working-directory");
-      if (workingDirectory) {
-        logger.info(
-          `Changing autobuilder working directory to ${workingDirectory}`,
-        );
-        process.chdir(workingDirectory);
-      }
-      for (const language of languages) {
-        currentLanguage = language;
-        await runAutobuild(config, language, logger);
-      }
-    }
-
-    // End tracing early to avoid tracing analyze. This improves the performance and reliability of
-    // the analyze step.
-    await endTracingForCluster(codeql, config, logger);
-  } catch (unwrappedError) {
-    const error = wrapError(unwrappedError);
-    core.setFailed(
-      `We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. ${error.message}`,
-    );
-    await sendCompletedStatusReport(
-      config,
-      logger,
-      startedAt,
-      languages ?? [],
-      currentLanguage,
-      error,
-    );
-    return;
-  }
-
-  core.exportVariable(EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY, "true");
-
-  await sendCompletedStatusReport(config, logger, startedAt, languages ?? []);
-}
-
-/** Defines the `autobuild` Action. */
-const autobuild: Action = {
-  name: ActionName.Autobuild,
-  run,
-};
-
-export async function runWrapper() {
-  await runInActions(autobuild);
-}
diff --git a/src/autobuild.ts b/src/autobuild.ts
deleted file mode 100644
index 49b790102d..0000000000
--- a/src/autobuild.ts
+++ /dev/null
@@ -1,171 +0,0 @@
-import * as core from "@actions/core";
-
-import { getTemporaryDirectory, getWorkflowEventName } from "./actions-util";
-import { getGitHubVersion } from "./api-client";
-import { CodeQL, getCodeQL } from "./codeql";
-import * as configUtils from "./config-utils";
-import { DocUrl } from "./doc-url";
-import { ActionsEnvVars, EnvVar } from "./environment";
-import { Feature, featureConfig, initFeatures } from "./feature-flags";
-import { BuiltInLanguage, Language } from "./languages";
-import { Logger } from "./logging";
-import { getRepositoryNwo } from "./repository";
-import { asyncFilter, BuildMode } from "./util";
-
-export async function determineAutobuildLanguages(
-  codeql: CodeQL,
-  config: configUtils.Config,
-  logger: Logger,
-): Promise {
-  if (
-    config.buildMode === BuildMode.None ||
-    config.buildMode === BuildMode.Manual
-  ) {
-    logger.info(
-      `Using build mode "${config.buildMode}", nothing to autobuild. ` +
-        `See ${DocUrl.CODEQL_BUILD_MODES} for more information.`,
-    );
-    return undefined;
-  }
-
-  // Attempt to find a language to autobuild
-  // We want pick the dominant language in the repo from the ones we're able to build
-  // The languages are sorted in order specified by user or by lines of code if we got
-  // them from the GitHub API, so try to build the first language on the list.
-  const autobuildLanguages = await asyncFilter(
-    config.languages,
-    async (language) => await codeql.isTracedLanguage(language),
-  );
-
-  if (autobuildLanguages.length === 0) {
-    logger.info(
-      "None of the languages in this project require extra build steps",
-    );
-    return undefined;
-  }
-
-  /**
-   * Additionally autobuild Go in the autobuild Action to ensure backwards
-   * compatibility for users performing a multi-language build within a single
-   * job.
-   *
-   * For example, consider a user with the following workflow file:
-   *
-   * ```yml
-   * - uses: github/codeql-action/init@v4
-   *   with:
-   *     languages: go, java
-   * - uses: github/codeql-action/autobuild@v4
-   * - uses: github/codeql-action/analyze@v4
-   * ```
-   *
-   * - With Go extraction disabled, we will run the Java autobuilder in the
-   *   autobuild Action, ensuring we extract both Java and Go code.
-   * - With Go extraction enabled, taking the previous behavior we'd run the Go
-   *   autobuilder, since Go is first on the list of languages. We wouldn't run
-   *   the Java autobuilder at all and so we'd only extract Go code.
-   *
-   * We therefore introduce a special case here such that we'll autobuild Go
-   * in addition to the primary non-Go traced language in the autobuild Action.
-   *
-   * This special case behavior should be removed as part of the next major
-   * version of the CodeQL Action.
-   */
-  const autobuildLanguagesWithoutGo = autobuildLanguages.filter(
-    (l) => l !== BuiltInLanguage.go,
-  );
-
-  const languages: Language[] = [];
-  // First run the autobuilder for the first non-Go traced language, if one
-  // exists.
-  if (autobuildLanguagesWithoutGo[0] !== undefined) {
-    languages.push(autobuildLanguagesWithoutGo[0]);
-  }
-  // If Go is requested, run the Go autobuilder last to ensure it doesn't
-  // interfere with the other autobuilder.
-  if (autobuildLanguages.length !== autobuildLanguagesWithoutGo.length) {
-    languages.push(BuiltInLanguage.go);
-  }
-
-  logger.debug(`Will autobuild ${languages.join(" and ")}.`);
-
-  // In general the autobuilders for other traced languages may conflict with
-  // each other. Therefore if a user has requested more than one non-Go traced
-  // language, we ask for manual build steps.
-  // Matrixing the build would also work, but that would change the SARIF
-  // categories, potentially leading to a "stale tips" situation where alerts
-  // that should be fixed remain on a repo since they are linked to SARIF
-  // categories that are no longer updated.
-  if (autobuildLanguagesWithoutGo.length > 1) {
-    logger.warning(
-      `We will only automatically build ${languages.join(
-        " and ",
-      )} code. If you wish to scan ${autobuildLanguagesWithoutGo
-        .slice(1)
-        .join(
-          " and ",
-        )}, you must replace the autobuild step of your workflow with custom build steps. ` +
-        `See ${DocUrl.SPECIFY_BUILD_STEPS_MANUALLY} for more information.`,
-    );
-  }
-
-  return languages;
-}
-
-export async function setupCppAutobuild(codeql: CodeQL, logger: Logger) {
-  const envVar = featureConfig[Feature.CppDependencyInstallation].envVar;
-  const featureName = "C++ automatic installation of dependencies";
-  const gitHubVersion = await getGitHubVersion();
-  const repositoryNwo = getRepositoryNwo();
-  const features = initFeatures(
-    gitHubVersion,
-    repositoryNwo,
-    getTemporaryDirectory(),
-    logger,
-  );
-  if (await features.getValue(Feature.CppDependencyInstallation, codeql)) {
-    // disable autoinstall on self-hosted runners unless explicitly requested
-    if (
-      process.env[ActionsEnvVars.RUNNER_ENVIRONMENT] === "self-hosted" &&
-      process.env[envVar] !== "true"
-    ) {
-      logger.info(
-        `Disabling ${featureName} as we are on a self-hosted runner.${
-          getWorkflowEventName() !== "dynamic"
-            ? ` To override this, set the ${envVar} environment variable to 'true' in your workflow. See ${DocUrl.DEFINE_ENV_VARIABLES} for more information.`
-            : ""
-        }`,
-      );
-      core.exportVariable(envVar, "false");
-    } else {
-      logger.info(
-        `Enabling ${featureName}. This can be disabled by setting the ${envVar} environment variable to 'false'. See ${DocUrl.DEFINE_ENV_VARIABLES} for more information.`,
-      );
-      core.exportVariable(envVar, "true");
-    }
-  } else {
-    logger.info(`Disabling ${featureName}.`);
-    core.exportVariable(envVar, "false");
-  }
-}
-
-export async function runAutobuild(
-  config: configUtils.Config,
-  language: Language,
-  logger: Logger,
-) {
-  logger.startGroup(`Attempting to automatically build ${language} code`);
-  const codeQL = await getCodeQL(logger, config.codeQLCmd);
-  if (language === BuiltInLanguage.cpp) {
-    await setupCppAutobuild(codeQL, logger);
-  }
-  if (config.buildMode) {
-    await codeQL.extractUsingBuildMode(config, language);
-  } else {
-    await codeQL.runAutobuild(config, language);
-  }
-  if (language === BuiltInLanguage.go) {
-    core.exportVariable(EnvVar.DID_AUTOBUILD_GOLANG, "true");
-  }
-  logger.endGroup();
-}
diff --git a/src/caching-utils.ts b/src/caching-utils.ts
deleted file mode 100644
index 33dac7cfb4..0000000000
--- a/src/caching-utils.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-import * as crypto from "crypto";
-
-import * as core from "@actions/core";
-
-import { getOptionalInput, isDefaultSetup } from "./actions-util";
-import { EnvVar } from "./environment";
-import { Logger } from "./logging";
-import { isHostedRunner, tryGetFolderBytes } from "./util";
-
-/**
- * Returns the total size of all the specified paths.
- * @param paths The paths for which to calculate the total size.
- * @param logger A logger to record some informational messages to.
- * @param quiet A value indicating whether to suppress logging warnings (default: false).
- * @returns The total size of all specified paths.
- */
-export async function getTotalCacheSize(
-  paths: string[],
-  logger: Logger,
-  quiet: boolean = false,
-): Promise {
-  const sizes = await Promise.all(
-    paths.map((cacheDir) => tryGetFolderBytes(cacheDir, logger, quiet)),
-  );
-  return sizes.map((a) => a || 0).reduce((a, b) => a + b, 0);
-}
-
-/* Enumerates caching modes. */
-export enum CachingKind {
-  /** Do not restore or store any caches. */
-  None = "none",
-  /** Store caches, but do not restore any existing ones. */
-  Store = "store",
-  /** Restore existing caches, but do not store any new ones. */
-  Restore = "restore",
-  /** Restore existing caches, and store new ones. */
-  Full = "full",
-}
-
-/** Returns a value indicating whether new caches should be stored, based on `kind`. */
-export function shouldStoreCache(kind: CachingKind): boolean {
-  return kind === CachingKind.Full || kind === CachingKind.Store;
-}
-
-/** Returns a value indicating whether existing caches should be restored, based on `kind`. */
-export function shouldRestoreCache(kind: CachingKind): boolean {
-  return kind === CachingKind.Full || kind === CachingKind.Restore;
-}
-
-/**
- * Parses the `upload` input into an `UploadKind`.
- */
-export function getCachingKind(input: string | undefined): CachingKind {
-  switch (input) {
-    case undefined:
-    case "none":
-    case "off":
-    case "false":
-      return CachingKind.None;
-    case "full":
-    case "on":
-    case "true":
-      return CachingKind.Full;
-    case "store":
-      return CachingKind.Store;
-    case "restore":
-      return CachingKind.Restore;
-    default:
-      core.warning(
-        `Unrecognized 'dependency-caching' input: ${input}. Defaulting to 'none'.`,
-      );
-      return CachingKind.None;
-  }
-}
-
-// The length to which `createCacheKeyHash` truncates hash strings.
-export const cacheKeyHashLength = 16;
-
-/**
- * Creates a SHA-256 hash of the cache key components to ensure uniqueness
- * while keeping the cache key length manageable.
- *
- * @param components Object containing all components that should influence cache key uniqueness
- * @returns A short SHA-256 hash (first 16 characters) of the components
- */
-export function createCacheKeyHash(components: Record): string {
-  // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
-  //
-  // "Properties are visited using the same algorithm as Object.keys(), which
-  // has a well-defined order and is stable across implementations. For example,
-  // JSON.stringify on the same object will always produce the same string, and
-  // JSON.parse(JSON.stringify(obj)) would produce an object with the same key
-  // ordering as the original (assuming the object is completely
-  // JSON-serializable)."
-  const componentsJson = JSON.stringify(components);
-  return crypto
-    .createHash("sha256")
-    .update(componentsJson)
-    .digest("hex")
-    .substring(0, cacheKeyHashLength);
-}
-
-/** Determines whether dependency caching is enabled. */
-export function getDependencyCachingEnabled(): CachingKind {
-  // If the workflow specified something always respect that
-  const dependencyCaching =
-    getOptionalInput("dependency-caching") ||
-    process.env[EnvVar.DEPENDENCY_CACHING];
-  if (dependencyCaching !== undefined) return getCachingKind(dependencyCaching);
-
-  // On self-hosted runners which may have dependencies installed centrally, disable caching by default
-  if (!isHostedRunner()) return CachingKind.None;
-
-  // Disable in advanced workflows by default.
-  if (!isDefaultSetup()) return CachingKind.None;
-
-  // On hosted runners, disable dependency caching by default.
-  // TODO: Review later whether we can enable this by default.
-  return CachingKind.None;
-}
diff --git a/src/cli-errors.test.ts b/src/cli-errors.test.ts
deleted file mode 100644
index 9e2d7dc799..0000000000
--- a/src/cli-errors.test.ts
+++ /dev/null
@@ -1,432 +0,0 @@
-import test from "ava";
-import * as sinon from "sinon";
-
-import { CommandInvocationError } from "./actions-util";
-import {
-  CliError,
-  CliConfigErrorCategory,
-  wrapCliConfigurationError,
-} from "./cli-errors";
-import { setupTests } from "./testing-utils";
-import { ConfigurationError } from "./util";
-
-setupTests(test);
-
-test("CliError constructor with fatal errors", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "finalize"],
-    32,
-    "Running TRAP import for CodeQL database...\nA fatal error occurred: Evaluator heap must be at least 384.00 MiB\nA fatal error occurred: Dataset import failed with code 2",
-  );
-
-  const cliError = new CliError(commandError);
-
-  t.is(cliError.exitCode, 32);
-  t.is(
-    cliError.stderr,
-    "Running TRAP import for CodeQL database...\nA fatal error occurred: Evaluator heap must be at least 384.00 MiB\nA fatal error occurred: Dataset import failed with code 2",
-  );
-  t.true(
-    cliError.message.includes(
-      "A fatal error occurred: Dataset import failed with code 2.",
-    ),
-  );
-  t.true(
-    cliError.message.includes(
-      "Context: A fatal error occurred: Evaluator heap must be at least 384.00 MiB.",
-    ),
-  );
-});
-
-test("CliError constructor with single fatal error", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    "A fatal error occurred: Out of memory",
-  );
-
-  const cliError = new CliError(commandError);
-
-  t.is(cliError.exitCode, 1);
-  t.true(cliError.message.includes("A fatal error occurred: Out of memory"));
-  t.false(cliError.message.includes("Context:"));
-});
-
-test("CliError constructor with autobuild errors", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    "[autobuild] [ERROR] Build failed\n[autobuild] [ERROR] Compilation error",
-  );
-
-  const cliError = new CliError(commandError);
-
-  t.is(cliError.exitCode, 1);
-  t.true(
-    cliError.message.includes(
-      "We were unable to automatically build your code",
-    ),
-  );
-  t.true(cliError.message.includes("Build failed\nCompilation error"));
-});
-
-test("CliError constructor with truncated autobuild errors", (t) => {
-  const stderr = Array.from(
-    { length: 12 },
-    (_, i) => `[autobuild] [ERROR] Error ${i + 1}`,
-  ).join("\n");
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    stderr,
-  );
-
-  const cliError = new CliError(commandError);
-
-  t.true(cliError.message.includes("(truncated)"));
-  // Should only include first 10 errors plus truncation message
-  const errorLines = cliError.message
-    .split("Encountered the following error: ")[1]
-    .split("\n");
-  t.is(errorLines.length, 11); // 10 errors + "(truncated)"
-});
-
-test("CliError constructor with generic error", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["version"],
-    1,
-    "Some generic error message\nLast line of error",
-  );
-
-  const cliError = new CliError(commandError);
-
-  t.is(cliError.exitCode, 1);
-  t.true(
-    cliError.message.includes(
-      'Encountered a fatal error while running "codeql version"',
-    ),
-  );
-  t.true(
-    cliError.message.includes(
-      "Exit code was 1 and last log line was: Last line of error.",
-    ),
-  );
-});
-
-test("CliError constructor with empty stderr", (t) => {
-  const commandError = new CommandInvocationError("codeql", ["version"], 1, "");
-
-  const cliError = new CliError(commandError);
-
-  t.true(cliError.message.includes("last log line was: n/a"));
-});
-
-for (const [platform, arch] of [
-  ["weird_plat", "x64"],
-  ["linux", "arm64"],
-  ["win32", "arm64"],
-]) {
-  test.serial(
-    `wrapCliConfigurationError - ${platform}/${arch} unsupported`,
-    (t) => {
-      sinon.stub(process, "platform").value(platform);
-      sinon.stub(process, "arch").value(arch);
-      const commandError = new CommandInvocationError(
-        "codeql",
-        ["version"],
-        1,
-        "Some error",
-      );
-      const cliError = new CliError(commandError);
-
-      const wrappedError = wrapCliConfigurationError(cliError);
-
-      t.true(wrappedError instanceof ConfigurationError);
-      t.true(
-        wrappedError.message.includes(
-          "CodeQL CLI does not support the platform/architecture combination",
-        ),
-      );
-      t.true(wrappedError.message.includes(`${platform}/${arch}`));
-    },
-  );
-}
-
-test("wrapCliConfigurationError - supported platform", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["version"],
-    1,
-    "Some error",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  // Should return the original error since platform is supported
-  t.is(wrappedError, cliError);
-});
-
-test("wrapCliConfigurationError - autobuild error", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    "We were unable to automatically build your code",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-  t.true(
-    wrappedError.message.includes(
-      "We were unable to automatically build your code",
-    ),
-  );
-});
-
-test("wrapCliConfigurationError - init called twice", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    "Refusing to create databases /some/path but could not process any of it",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-  t.true(
-    wrappedError.message.includes(
-      'Is the "init" action called twice in the same job?',
-    ),
-  );
-});
-
-test("wrapCliConfigurationError - no source code seen by exit code", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "finalize"],
-    32,
-    "Some other error message",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - no source code seen by message", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "finalize"],
-    1,
-    "CodeQL detected code written in JavaScript but could not process any of it",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - out of memory error with additional message", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "analyze"],
-    1,
-    "CodeQL is out of memory.",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-  t.true(
-    wrappedError.message.includes(
-      "For more information, see https://gh.io/troubleshooting-code-scanning/out-of-disk-or-memory",
-    ),
-  );
-});
-
-test("wrapCliConfigurationError - gradle build failed", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    "[autobuild] FAILURE: Build failed with an exception.",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - maven build failed", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    "[autobuild] [ERROR] Failed to execute goal",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - swift build failed", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    "[autobuilder/build] [build-command-failed] `autobuild` failed to run the build command",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - swift incompatible os", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["swift/tools/autobuild.sh"],
-    1,
-    "2026-04-01 18:35:00 EST ERRO [extractor/main] [incompatible-os] Currently, Swift analysis is only supported on macOS. (IncompatibleOs.cpp:26)",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - pack cannot be found", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["pack", "install"],
-    1,
-    "Query pack my-pack cannot be found. Check the spelling of the pack.",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - unknown query file", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "init"],
-    2,
-    "my-query-file is not a .ql file, .qls file, a directory, or a query pack specification. See the logs for more details.",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - pack missing auth", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["pack", "download"],
-    1,
-    "GitHub Container registry returned 403 Forbidden",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - invalid config file", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["database", "create"],
-    1,
-    "Config file .codeql/config.yml is not valid",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - incompatible CLI version", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["version"],
-    1,
-    "is not compatible with this CodeQL CLI",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  t.true(wrappedError instanceof ConfigurationError);
-});
-
-test("wrapCliConfigurationError - unknown error remains unchanged", (t) => {
-  const commandError = new CommandInvocationError(
-    "codeql",
-    ["version"],
-    1,
-    "Some unknown error that doesn't match any patterns",
-  );
-  const cliError = new CliError(commandError);
-
-  const wrappedError = wrapCliConfigurationError(cliError);
-
-  // Should return the original CliError since it doesn't match any known patterns
-  t.is(wrappedError, cliError);
-  t.true(wrappedError instanceof CliError);
-  t.false(wrappedError instanceof ConfigurationError);
-});
-
-// Test all error categories to ensure they're properly configured
-test("all CLI config error categories have valid configurations", (t) => {
-  const allCategories = Object.values(CliConfigErrorCategory);
-
-  for (const category of allCategories) {
-    // Each category should be a string
-    t.is(typeof category, "string");
-
-    // Create a test error that matches this category
-    let testError: CliError;
-
-    switch (category) {
-      case CliConfigErrorCategory.NoSourceCodeSeen:
-        // This category matches by exit code
-        testError = new CliError(
-          new CommandInvocationError("codeql", [], 32, "some error"),
-        );
-        break;
-      default:
-        // For other categories, we'll test with a generic message that should not match
-        testError = new CliError(
-          new CommandInvocationError("codeql", [], 1, "generic error"),
-        );
-        break;
-    }
-
-    // The test should not throw an error when processing
-    t.notThrows(() => wrapCliConfigurationError(testError));
-  }
-});
diff --git a/src/cli-errors.ts b/src/cli-errors.ts
deleted file mode 100644
index 84ec1aa4e6..0000000000
--- a/src/cli-errors.ts
+++ /dev/null
@@ -1,379 +0,0 @@
-import {
-  CommandInvocationError,
-  ensureEndsInPeriod,
-  prettyPrintInvocation,
-} from "./actions-util";
-import { DocUrl } from "./doc-url";
-import { ConfigurationError } from "./util";
-
-const SUPPORTED_PLATFORMS = [
-  ["linux", "x64"],
-  ["win32", "x64"],
-  ["darwin", "x64"],
-  ["darwin", "arm64"],
-];
-
-/**
- * An error from a CodeQL CLI invocation, with associated exit code, stderr, etc.
- */
-export class CliError extends Error {
-  public readonly exitCode: number | undefined;
-  public readonly stderr: string;
-
-  constructor({ cmd, args, exitCode, stderr }: CommandInvocationError) {
-    const prettyCommand = prettyPrintInvocation(cmd, args);
-
-    const fatalErrors = extractFatalErrors(stderr);
-    const autobuildErrors = extractAutobuildErrors(stderr);
-    let message: string;
-
-    if (fatalErrors) {
-      message =
-        `Encountered a fatal error while running "${prettyCommand}". ` +
-        `Exit code was ${exitCode} and error was: ${ensureEndsInPeriod(
-          fatalErrors.trim(),
-        )} See the logs for more details.`;
-    } else if (autobuildErrors) {
-      message =
-        "We were unable to automatically build your code. Please provide manual build steps. " +
-        `See ${DocUrl.AUTOMATIC_BUILD_FAILED} for more information. ` +
-        `Encountered the following error: ${autobuildErrors}`;
-    } else {
-      const lastLine = ensureEndsInPeriod(
-        stderr.trim().split("\n").pop()?.trim() || "n/a",
-      );
-      message =
-        `Encountered a fatal error while running "${prettyCommand}". ` +
-        `Exit code was ${exitCode} and last log line was: ${lastLine} See the logs for more details.`;
-    }
-
-    super(message);
-    this.exitCode = exitCode;
-    this.stderr = stderr;
-  }
-}
-
-/**
- * Provide a better error message from the stderr of a CLI invocation that failed with a fatal
- * error.
- *
- * - If the CLI invocation failed with a fatal error, this returns that fatal error, followed by
- *   any fatal errors that occurred in plumbing commands.
- * - If the CLI invocation did not fail with a fatal error, this returns `undefined`.
- *
- * ### Example
- *
- * ```
- * Running TRAP import for CodeQL database at /home/runner/work/_temp/codeql_databases/javascript...
- * A fatal error occurred: Evaluator heap must be at least 384.00 MiB
- * A fatal error occurred: Dataset import for
- * /home/runner/work/_temp/codeql_databases/javascript/db-javascript failed with code 2
- * ```
- *
- * becomes
- *
- * ```
- * Encountered a fatal error while running "codeql-for-testing database finalize --finalize-dataset
- * --threads=2 --ram=2048 db". Exit code was 32 and error was: A fatal error occurred: Dataset
- * import for /home/runner/work/_temp/codeql_databases/javascript/db-javascript failed with code 2.
- * Context: A fatal error occurred: Evaluator heap must be at least 384.00 MiB.
- * ```
- *
- * Where possible, this tries to summarize the error into a single line, as this displays better in
- * the Actions UI.
- */
-function extractFatalErrors(error: string): string | undefined {
-  const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi;
-  let fatalErrors: string[] = [];
-  let lastFatalErrorIndex: number | undefined;
-  let match: RegExpMatchArray | null;
-  while ((match = fatalErrorRegex.exec(error)) !== null) {
-    if (lastFatalErrorIndex !== undefined) {
-      fatalErrors.push(error.slice(lastFatalErrorIndex, match.index).trim());
-    }
-    lastFatalErrorIndex = match.index;
-  }
-  if (lastFatalErrorIndex !== undefined) {
-    const lastError = error.slice(lastFatalErrorIndex).trim();
-    if (fatalErrors.length === 0) {
-      // No other errors
-      return lastError;
-    }
-    const isOneLiner = !fatalErrors.some((e) => e.includes("\n"));
-    if (isOneLiner) {
-      fatalErrors = fatalErrors.map(ensureEndsInPeriod);
-    }
-    return [
-      ensureEndsInPeriod(lastError),
-      "Context:",
-      ...fatalErrors.reverse(),
-    ].join(isOneLiner ? " " : "\n");
-  }
-  return undefined;
-}
-
-function extractAutobuildErrors(error: string): string | undefined {
-  const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi;
-  let errorLines = [...error.matchAll(pattern)].map((match) => match[1]);
-  // Truncate if there are more than 10 matching lines.
-  if (errorLines.length > 10) {
-    errorLines = errorLines.slice(0, 10);
-    errorLines.push("(truncated)");
-  }
-  return errorLines.join("\n") || undefined;
-}
-
-/** Error messages from the CLI that we consider configuration errors and handle specially. */
-export enum CliConfigErrorCategory {
-  AutobuildError = "AutobuildError",
-  CouldNotCreateTempDir = "CouldNotCreateTempDir",
-  ExternalRepositoryCloneFailed = "ExternalRepositoryCloneFailed",
-  GradleBuildFailed = "GradleBuildFailed",
-  IncompatibleWithActionVersion = "IncompatibleWithActionVersion",
-  InitCalledTwice = "InitCalledTwice",
-  InvalidConfigFile = "InvalidConfigFile",
-  InvalidExternalRepoSpecifier = "InvalidExternalRepoSpecifier",
-  InvalidSourceRoot = "InvalidSourceRoot",
-  MavenBuildFailed = "MavenBuildFailed",
-  NoBuildCommandAutodetected = "NoBuildCommandAutodetected",
-  NoBuildMethodAutodetected = "NoBuildMethodAutodetected",
-  NoSourceCodeSeen = "NoSourceCodeSeen",
-  NoSupportedBuildCommandSucceeded = "NoSupportedBuildCommandSucceeded",
-  NoSupportedBuildSystemDetected = "NoSupportedBuildSystemDetected",
-  NotFoundInRegistry = "NotFoundInRegistry",
-  OutOfMemoryOrDisk = "OutOfMemoryOrDisk",
-  PackCannotBeFound = "PackCannotBeFound",
-  PackMissingAuth = "PackMissingAuth",
-  SwiftIncompatibleOs = "SwiftIncompatibleOs",
-  SwiftBuildFailed = "SwiftBuildFailed",
-  UnsupportedBuildMode = "UnsupportedBuildMode",
-}
-
-type CliErrorConfiguration = {
-  /** One of these candidates, or the exit code, must be present in the error message. */
-  cliErrorMessageCandidates: RegExp[];
-  exitCode?: number;
-  additionalErrorMessageToAppend?: string;
-};
-
-/**
- * All of our caught CLI error messages that we handle specially: ie. if we
- * would like to categorize an error as a configuration error or not.
- */
-const cliErrorsConfig: Record = {
-  [CliConfigErrorCategory.AutobuildError]: {
-    cliErrorMessageCandidates: [
-      new RegExp("We were unable to automatically build your code"),
-    ],
-  },
-  [CliConfigErrorCategory.CouldNotCreateTempDir]: {
-    cliErrorMessageCandidates: [new RegExp("Could not create temp directory")],
-  },
-  [CliConfigErrorCategory.ExternalRepositoryCloneFailed]: {
-    cliErrorMessageCandidates: [
-      new RegExp("Failed to clone external Git repository"),
-    ],
-  },
-  [CliConfigErrorCategory.GradleBuildFailed]: {
-    cliErrorMessageCandidates: [
-      new RegExp("\\[autobuild\\] FAILURE: Build failed with an exception."),
-    ],
-  },
-  // Version of CodeQL CLI is incompatible with this version of the CodeQL Action
-  [CliConfigErrorCategory.IncompatibleWithActionVersion]: {
-    cliErrorMessageCandidates: [
-      new RegExp("is not compatible with this CodeQL CLI"),
-    ],
-  },
-  [CliConfigErrorCategory.InitCalledTwice]: {
-    cliErrorMessageCandidates: [
-      new RegExp(
-        "Refusing to create databases .* but could not process any of it",
-      ),
-    ],
-    additionalErrorMessageToAppend: `Is the "init" action called twice in the same job?`,
-  },
-  [CliConfigErrorCategory.InvalidConfigFile]: {
-    cliErrorMessageCandidates: [
-      new RegExp("Config file .* is not valid"),
-      new RegExp("The supplied config file is empty"),
-    ],
-  },
-  [CliConfigErrorCategory.InvalidExternalRepoSpecifier]: {
-    cliErrorMessageCandidates: [
-      new RegExp("Specifier for external repository is invalid"),
-    ],
-  },
-  // Expected source location for database creation does not exist
-  [CliConfigErrorCategory.InvalidSourceRoot]: {
-    cliErrorMessageCandidates: [new RegExp("Invalid source root")],
-  },
-  [CliConfigErrorCategory.MavenBuildFailed]: {
-    cliErrorMessageCandidates: [
-      new RegExp("\\[autobuild\\] \\[ERROR\\] Failed to execute goal"),
-    ],
-  },
-  [CliConfigErrorCategory.NoBuildCommandAutodetected]: {
-    cliErrorMessageCandidates: [
-      new RegExp("Could not auto-detect a suitable build method"),
-    ],
-  },
-  [CliConfigErrorCategory.NoBuildMethodAutodetected]: {
-    cliErrorMessageCandidates: [
-      new RegExp(
-        "Could not detect a suitable build command for the source checkout",
-      ),
-    ],
-  },
-  // Usually when a manual build script has failed, or if an autodetected language
-  // was unintended to have CodeQL analysis run on it.
-  [CliConfigErrorCategory.NoSourceCodeSeen]: {
-    exitCode: 32,
-    cliErrorMessageCandidates: [
-      new RegExp(
-        "CodeQL detected code written in .* but could not process any of it",
-      ),
-      new RegExp(
-        "CodeQL did not detect any code written in languages supported by CodeQL",
-      ),
-    ],
-  },
-  [CliConfigErrorCategory.NoSupportedBuildCommandSucceeded]: {
-    cliErrorMessageCandidates: [
-      new RegExp("No supported build command succeeded"),
-    ],
-  },
-  [CliConfigErrorCategory.NoSupportedBuildSystemDetected]: {
-    cliErrorMessageCandidates: [
-      new RegExp("No supported build system detected"),
-    ],
-  },
-  [CliConfigErrorCategory.OutOfMemoryOrDisk]: {
-    cliErrorMessageCandidates: [
-      new RegExp("CodeQL is out of memory."),
-      new RegExp("out of disk"),
-      new RegExp("No space left on device"),
-    ],
-    additionalErrorMessageToAppend:
-      "For more information, see https://gh.io/troubleshooting-code-scanning/out-of-disk-or-memory",
-  },
-  [CliConfigErrorCategory.PackCannotBeFound]: {
-    cliErrorMessageCandidates: [
-      new RegExp(
-        "Query pack .* cannot be found\\. Check the spelling of the pack\\.",
-      ),
-      new RegExp(
-        "is not a .ql file, .qls file, a directory, or a query pack specification.",
-      ),
-    ],
-  },
-  [CliConfigErrorCategory.PackMissingAuth]: {
-    cliErrorMessageCandidates: [
-      new RegExp("GitHub Container registry .* 403 Forbidden"),
-      new RegExp(
-        "Do you need to specify a token to authenticate to the registry?",
-      ),
-    ],
-  },
-  [CliConfigErrorCategory.SwiftBuildFailed]: {
-    cliErrorMessageCandidates: [
-      new RegExp(
-        "\\[autobuilder/build\\] \\[build-command-failed\\] `autobuild` failed to run the build command",
-      ),
-    ],
-  },
-  [CliConfigErrorCategory.SwiftIncompatibleOs]: {
-    cliErrorMessageCandidates: [
-      new RegExp("\\[incompatible-os\\]"),
-      new RegExp("Swift analysis is only supported on macOS"),
-    ],
-  },
-  [CliConfigErrorCategory.UnsupportedBuildMode]: {
-    cliErrorMessageCandidates: [
-      new RegExp(
-        "does not support the .* build mode. Please try using one of the following build modes instead",
-      ),
-    ],
-  },
-  [CliConfigErrorCategory.NotFoundInRegistry]: {
-    cliErrorMessageCandidates: [
-      new RegExp("'.*' not found in the registry '.*'"),
-    ],
-  },
-};
-
-/**
- * Check if the given CLI error or exit code, if applicable, apply to any known
- * CLI errors in the configuration record. If either the CLI error message matches one of
- * the error messages in the config record, or the exit codes match, return the error category;
- * if not, return undefined.
- */
-function getCliConfigCategoryIfExists(
-  cliError: CliError,
-): CliConfigErrorCategory | undefined {
-  for (const [category, configuration] of Object.entries(cliErrorsConfig)) {
-    if (
-      cliError.exitCode !== undefined &&
-      configuration.exitCode !== undefined &&
-      cliError.exitCode === configuration.exitCode
-    ) {
-      return category as CliConfigErrorCategory;
-    }
-
-    for (const e of configuration.cliErrorMessageCandidates) {
-      if (cliError.message.match(e) || cliError.stderr.match(e)) {
-        return category as CliConfigErrorCategory;
-      }
-    }
-  }
-
-  return undefined;
-}
-
-/**
- * Check if we are running on an unsupported platform/architecture combination.
- */
-function isUnsupportedPlatform(): boolean {
-  return !SUPPORTED_PLATFORMS.some(
-    ([platform, arch]) =>
-      platform === process.platform && arch === process.arch,
-  );
-}
-
-/**
- * Transform a CLI error into a ConfigurationError for an unsupported platform.
- */
-function getUnsupportedPlatformError(cliError: CliError): ConfigurationError {
-  return new ConfigurationError(
-    "The CodeQL CLI does not support the platform/architecture combination of " +
-      `${process.platform}/${process.arch} ` +
-      `(see ${DocUrl.SYSTEM_REQUIREMENTS}). ` +
-      `The underlying error was: ${cliError.message}`,
-  );
-}
-
-/**
- * Changes an error received from the CLI to a ConfigurationError with the message
- * optionally being transformed, if it is a known configuration error. Otherwise,
- * simply returns the original error.
- */
-export function wrapCliConfigurationError(cliError: CliError): Error {
-  if (isUnsupportedPlatform()) {
-    return getUnsupportedPlatformError(cliError);
-  }
-
-  const cliConfigErrorCategory = getCliConfigCategoryIfExists(cliError);
-  if (cliConfigErrorCategory === undefined) {
-    return cliError;
-  }
-
-  let errorMessageBuilder = cliError.message;
-
-  const additionalErrorMessageToAppend =
-    cliErrorsConfig[cliConfigErrorCategory].additionalErrorMessageToAppend;
-  if (additionalErrorMessageToAppend !== undefined) {
-    errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
-  }
-
-  return new ConfigurationError(errorMessageBuilder);
-}
diff --git a/src/cli/output-cache.test.ts b/src/cli/output-cache.test.ts
deleted file mode 100644
index d8d8629303..0000000000
--- a/src/cli/output-cache.test.ts
+++ /dev/null
@@ -1,128 +0,0 @@
-import * as fs from "fs";
-import path from "path";
-
-import test from "ava";
-
-import { EnvVar } from "../environment";
-import { getRunnerLogger } from "../logging";
-import { getTestEnv, setupTests } from "../testing-utils";
-import * as util from "../util";
-
-import * as outputCache from "./output-cache";
-
-setupTests(test);
-
-const logger = getRunnerLogger(true);
-
-test.serial(
-  "getCachedCodeQlVersion reuses a version persisted by an earlier step",
-  async (t) => {
-    await util.withTmpDir(async (tmpDir: string) => {
-      const cacheFile = path.join(tmpDir, "codeql-action-command-cache.json");
-      fs.writeFileSync(
-        cacheFile,
-        JSON.stringify({
-          cmd: "/path/to/codeql",
-          entries: { version: { version: "2.20.0" } },
-        }),
-        "utf8",
-      );
-      const env = getTestEnv({ [EnvVar.TEMP]: tmpDir });
-      t.deepEqual(
-        outputCache.getCachedCodeQlVersion(logger, env, "/path/to/codeql"),
-        {
-          version: "2.20.0",
-        },
-      );
-    });
-  },
-);
-
-test.serial(
-  "getCachedCodeQlVersion ignores a persisted version from a different CLI",
-  async (t) => {
-    await util.withTmpDir(async (tmpDir: string) => {
-      const cacheFile = path.join(tmpDir, "version.json");
-      fs.writeFileSync(
-        cacheFile,
-        JSON.stringify({
-          cmd: "/path/to/other-codeql",
-          version: { version: "2.20.0" },
-        }),
-        "utf8",
-      );
-      const env = getTestEnv({ [EnvVar.TEMP]: tmpDir });
-      t.is(
-        outputCache.getCachedCodeQlVersion(logger, env, "/path/to/codeql"),
-        undefined,
-      );
-    });
-  },
-);
-
-test.serial(
-  "getCachedCodeQlVersion ignores a malformed persisted value",
-  async (t) => {
-    await util.withTmpDir(async (tmpDir: string) => {
-      const cacheFile = path.join(tmpDir, "version.json");
-      fs.writeFileSync(cacheFile, "not valid json", "utf8");
-      const env = getTestEnv({ [EnvVar.TEMP]: tmpDir });
-      t.is(
-        outputCache.getCachedCodeQlVersion(logger, env, "/path/to/codeql"),
-        undefined,
-      );
-    });
-  },
-);
-
-test.serial(
-  "getCachedCodeQlVersion ignores a persisted value with the wrong structure",
-  async (t) => {
-    await util.withTmpDir(async (tmpDir: string) => {
-      const cacheFile = path.join(tmpDir, "version.json");
-      const env = getTestEnv({ [EnvVar.TEMP]: tmpDir });
-
-      const testValues = [
-        { cmd: "/path/to/codeql" },
-        { entries: { version: { version: "2.20.0" } } },
-        { cmd: "/path/to/codeql", entries: {} },
-        { cmd: "/path/to/codeql", entries: null },
-        { cmd: "/path/to/codeql", entries: { version: {} } },
-        { cmd: "/path/to/codeql", entries: { version: null } },
-        { cmd: "/path/to/codeql", entries: { version: "2.20.0" } },
-        { cmd: "/path/to/codeql", entries: { version: { version: null } } },
-        { cmd: "/path/to/codeql", entries: { version: { version: 2.2 } } },
-        { cmd: "/path/to/codeql", entries: { version: { version: 2 } } },
-        {
-          cmd: "/path/to/codeql",
-          entries: { version: { version: "2.20.0", overlayVersion: "1" } },
-        },
-        {
-          cmd: "/path/to/codeql",
-          entries: { version: { version: "2.20.0", features: "nope" } },
-        },
-      ].map((v) => JSON.stringify(v));
-
-      for (const value of testValues) {
-        fs.writeFileSync(cacheFile, value, "utf8");
-        t.is(
-          outputCache.getCachedCodeQlVersion(logger, env, "/path/to/codeql"),
-          undefined,
-          value,
-        );
-      }
-    });
-  },
-);
-
-test.serial("getCachedCodeQlVersion ignores non-existent file", async (t) => {
-  await util.withTmpDir(async (tmpDir: string) => {
-    const env = getTestEnv({ [EnvVar.TEMP]: tmpDir });
-    t.notThrows(() => {
-      t.is(
-        outputCache.getCachedCodeQlVersion(logger, env, "/path/to/codeql"),
-        undefined,
-      );
-    });
-  });
-});
diff --git a/src/cli/output-cache.ts b/src/cli/output-cache.ts
deleted file mode 100644
index 8bf8c27abe..0000000000
--- a/src/cli/output-cache.ts
+++ /dev/null
@@ -1,156 +0,0 @@
-import * as fs from "fs";
-import path from "path";
-
-import { getTemporaryDirectory } from "../actions-util";
-import { Env } from "../environment";
-import { Logger } from "../logging";
-
-import type { VersionInfo } from "./types";
-
-/**
- * The keys of the command cache. Each key corresponds to a command whose output we cache.
- */
-export type CommandCacheKey = string;
-
-/**
- * The type of the command cache that is persisted to disk.
- */
-export interface OutputCache {
-  cmd: string;
-  entries: Record;
-}
-
-/**
- * The name of the temporary file that backs the on-disk cache of
- * CLI responses between workflow steps.
- */
-const COMMAND_CACHE_FILENAME = "codeql-action-command-cache.json";
-
-/**
- * The module-global variable that caches the CodeQL CLI version in-memory.
- */
-let cachedCodeQlVersion: undefined | VersionInfo = undefined;
-
-/**
- * Resets the in-process cache of the CodeQL CLI version. Only for use in tests,
- * which exercise multiple "steps" within a single process.
- */
-export function resetCachedCodeQlVersion(): void {
-  cachedCodeQlVersion = undefined;
-}
-
-/**
- * Returns the path to the temporary file that backs the
- * on-disk cache of CLI responses between workflow steps.
- */
-function getCommandCacheFilePath(env: Env): string {
-  return path.join(getTemporaryDirectory(env), COMMAND_CACHE_FILENAME);
-}
-
-/**
- * Caches the CodeQL CLI version both in-memory and on disk.
- * @param env The environment variables to use.
- * @param cmd The path to the CodeQL CLI.
- * @param version The version information to cache.
- */
-export function cacheCodeQlVersion(
-  env: Env,
-  cmd: string,
-  version: VersionInfo,
-): void {
-  if (cachedCodeQlVersion !== undefined) {
-    throw new Error("cacheCodeQlVersion() should be called only once");
-  }
-  cachedCodeQlVersion = version;
-  const outputCache = {
-    cmd,
-    entries: { version },
-  } satisfies OutputCache;
-  // Persist the version so that subsequent Actions steps, which run in separate
-  // processes, can reuse it rather than invoking `codeql version` again. We
-  // record the CLI path so that a different step using a different CodeQL bundle
-  // doesn't pick up a stale version.
-  fs.writeFileSync(
-    getCommandCacheFilePath(env),
-    JSON.stringify(outputCache),
-    "utf8",
-  );
-}
-
-/**
- * Returns the cached CodeQL CLI version, if any.
- * @param logger The logger to use for logging messages.
- * @param env The environment variables to use.
- * @param cmd The path to the CodeQL CLI.
- */
-export function getCachedCodeQlVersion(
-  logger: Logger,
-  env: Env,
-  cmd?: string,
-): undefined | VersionInfo {
-  if (cachedCodeQlVersion !== undefined) {
-    return cachedCodeQlVersion;
-  }
-  // Fall back to the value persisted by an earlier Actions step, if any. This is
-  // best-effort: any malformed or mismatched value is ignored so that the caller
-  // invokes `codeql version` instead.
-  let serialized: string;
-  try {
-    serialized = fs.readFileSync(getCommandCacheFilePath(env), "utf8");
-  } catch (e) {
-    logger.debug(
-      `Cannot read CLI-cache file ${getCommandCacheFilePath(env)}: ${e}`,
-    );
-    return undefined;
-  }
-  let persisted: unknown;
-  try {
-    persisted = JSON.parse(serialized);
-  } catch (e) {
-    logger.debug(`Cannot parse CLI-cache data as JSON: ${e}`);
-    return undefined;
-  }
-  if (
-    !isOutputCache(persisted) ||
-    (cmd !== undefined && persisted.cmd !== cmd)
-  ) {
-    return undefined;
-  }
-  // Memoize the parsed value so that subsequent calls in this process don't
-  // re-parse the environment variable.
-  cachedCodeQlVersion = persisted.entries.version as VersionInfo;
-  return cachedCodeQlVersion;
-}
-
-/**
- * Determines whether a value is a `VersionInfo` object.
- * @param x The value to test
- */
-function isVersionInfo(x: unknown): x is VersionInfo {
-  const candidate = x as Partial | null;
-  return (
-    typeof candidate === "object" &&
-    candidate !== null &&
-    typeof candidate.version === "string" &&
-    (candidate.features === undefined ||
-      (typeof candidate.features === "object" &&
-        candidate.features !== null)) &&
-    (candidate.overlayVersion === undefined ||
-      typeof candidate.overlayVersion === "number")
-  );
-}
-
-/**
- * Determines whether a value is a `OutputCache` object.
- * @param x The value to test
- */
-function isOutputCache(x: unknown): x is OutputCache {
-  const candidate = x as Partial | null;
-  return (
-    typeof candidate === "object" &&
-    candidate !== null &&
-    typeof candidate.cmd === "string" &&
-    candidate.entries !== undefined &&
-    isVersionInfo(candidate.entries.version)
-  );
-}
diff --git a/src/cli/types.ts b/src/cli/types.ts
deleted file mode 100644
index ad48ff29b4..0000000000
--- a/src/cli/types.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export interface VersionInfo {
-  version: string;
-  features?: { [name: string]: boolean };
-  /**
-   * The overlay version helps deal with backward incompatible changes for
-   * overlay analysis. When a precompiled query pack reports the same overlay
-   * version as the CodeQL CLI, we can use the CodeQL CLI to perform overlay
-   * analysis with that pack. Otherwise, if the overlay versions are different,
-   * or if either the pack or the CLI does not report an overlay version,
-   * we need to revert to non-overlay analysis.
-   */
-  overlayVersion?: number;
-}
diff --git a/src/codeql.test.ts b/src/codeql.test.ts
deleted file mode 100644
index df4bafe295..0000000000
--- a/src/codeql.test.ts
+++ /dev/null
@@ -1,1132 +0,0 @@
-import * as fs from "fs";
-
-import { ExecOptions } from "@actions/exec";
-import * as toolrunner from "@actions/exec/lib/toolrunner";
-import * as io from "@actions/io";
-import * as toolcache from "@actions/tool-cache";
-import test, { ExecutionContext } from "ava";
-import * as yaml from "js-yaml";
-import nock from "nock";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import { GitHubApiDetails } from "./api-client";
-import { CliError } from "./cli-errors";
-import * as codeql from "./codeql";
-import {
-  AugmentationProperties,
-  generateCodeScanningConfig,
-  defaultAugmentationProperties,
-} from "./config/db-config";
-import type { Config } from "./config-utils";
-import * as defaults from "./defaults.json";
-import { DocUrl } from "./doc-url";
-import { BuiltInLanguage } from "./languages";
-import { getRunnerLogger } from "./logging";
-import { ToolsSource } from "./setup-codeql";
-import {
-  setupTests,
-  createFeatures,
-  setupActionsVars,
-  SAMPLE_DOTCOM_API_DETAILS,
-  SAMPLE_DEFAULT_CLI_VERSION,
-  mockBundleDownloadApi,
-  makeVersionInfo,
-  createTestConfig,
-  makeMacro,
-} from "./testing-utils";
-import { ToolsDownloadStatusReport } from "./tools-download";
-import * as util from "./util";
-import { initializeEnvironment } from "./util";
-
-setupTests(test);
-
-let stubConfig: Config;
-
-test.beforeEach(() => {
-  initializeEnvironment("1.2.3");
-
-  stubConfig = createTestConfig({
-    languages: [BuiltInLanguage.cpp],
-  });
-});
-
-test("isDiskConfigurationError - true for expected errors", async (t) => {
-  t.true(
-    codeql.isDiskConfigurationError(new Error("ENOSPC: Out of disk space")),
-  );
-  t.true(
-    codeql.isDiskConfigurationError(
-      new Error(
-        "EACCES: permission denied, mkdir /opt/hostedtoolcache/CodeQL/",
-      ),
-    ),
-  );
-});
-
-test("isDiskConfigurationError - false for other errors", async (t) => {
-  t.false(codeql.isDiskConfigurationError("Not an Error instance"));
-
-  const otherMessages = [
-    "Does not contain an error code we test for",
-    "ENOSP: Not quite the full error code",
-  ];
-  for (const otherMessage of otherMessages) {
-    t.false(codeql.isDiskConfigurationError(new Error(otherMessage)));
-  }
-});
-
-async function installIntoToolcache({
-  apiDetails = SAMPLE_DOTCOM_API_DETAILS,
-  cliVersion,
-  isPinned,
-  tagName,
-  tmpDir,
-}: {
-  apiDetails?: GitHubApiDetails;
-  cliVersion?: string;
-  isPinned: boolean;
-  tagName: string;
-  tmpDir: string;
-}) {
-  const url = mockBundleDownloadApi({ apiDetails, isPinned, tagName });
-  await codeql.setupCodeQL(
-    cliVersion !== undefined ? undefined : url,
-    apiDetails,
-    tmpDir,
-    util.GitHubVariant.GHES,
-    cliVersion !== undefined
-      ? { enabledVersions: [{ cliVersion, tagName }] }
-      : SAMPLE_DEFAULT_CLI_VERSION,
-    undefined, // rawLanguages
-    false, // useOverlayAwareDefaultCliVersion
-    createFeatures([]),
-    getRunnerLogger(true),
-    false,
-  );
-}
-
-function mockReleaseApi({
-  apiDetails = SAMPLE_DOTCOM_API_DETAILS,
-  assetNames,
-  tagName,
-}: {
-  apiDetails?: GitHubApiDetails;
-  assetNames: string[];
-  tagName: string;
-}): nock.Scope {
-  return nock(apiDetails.apiURL!)
-    .get(`/repos/github/codeql-action/releases/tags/${tagName}`)
-    .reply(200, {
-      assets: assetNames.map((name) => ({
-        name,
-      })),
-      tag_name: tagName,
-    });
-}
-
-function mockApiDetails(apiDetails: GitHubApiDetails) {
-  // This is a workaround to mock `api.getApiDetails()` since it doesn't seem to be possible to
-  // mock this directly. The difficulty is that `getApiDetails()` is called locally in
-  // `api-client.ts`, but `sinon.stub(api, "getApiDetails")` only affects calls to
-  // `getApiDetails()` via an imported `api` module.
-  sinon
-    .stub(actionsUtil, "getRequiredInput")
-    .withArgs("token")
-    .returns(apiDetails.auth);
-  process.env["GITHUB_SERVER_URL"] = apiDetails.url;
-  process.env["GITHUB_API_URL"] = apiDetails.apiURL || "";
-}
-
-async function stubCodeql(): Promise {
-  const codeqlObject = await codeql.getCodeQLForTesting();
-  sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.17.6"));
-  sinon
-    .stub(codeqlObject, "isTracedLanguage")
-    .withArgs(BuiltInLanguage.cpp)
-    .resolves(true);
-  return codeqlObject;
-}
-
-test.serial(
-  "downloads and caches explicitly requested bundles that aren't in the toolcache",
-  async (t) => {
-    const features = createFeatures([]);
-
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-
-      const versions = ["20200601", "20200610"];
-
-      for (let i = 0; i < versions.length; i++) {
-        const version = versions[i];
-
-        const url = mockBundleDownloadApi({
-          tagName: `codeql-bundle-${version}`,
-          isPinned: false,
-        });
-        const result = await codeql.setupCodeQL(
-          url,
-          SAMPLE_DOTCOM_API_DETAILS,
-          tmpDir,
-          util.GitHubVariant.DOTCOM,
-          SAMPLE_DEFAULT_CLI_VERSION,
-          undefined, // rawLanguages
-          false, // useOverlayAwareDefaultCliVersion
-          features,
-          getRunnerLogger(true),
-          false,
-        );
-
-        t.assert(toolcache.find("CodeQL", `0.0.0-${version}`));
-        t.is(result.toolsVersion, `0.0.0-${version}`);
-        t.is(result.toolsSource, ToolsSource.Download);
-        assertDownloadDurationInteger(t, result.toolsDownloadStatusReport);
-      }
-
-      t.is(toolcache.findAllVersions("CodeQL").length, 2);
-    });
-  },
-);
-
-test.serial(
-  "caches semantically versioned bundles using their semantic version number",
-  async (t) => {
-    const features = createFeatures([]);
-
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const url = mockBundleDownloadApi({
-        tagName: `codeql-bundle-v2.15.0`,
-        isPinned: false,
-      });
-      const result = await codeql.setupCodeQL(
-        url,
-        SAMPLE_DOTCOM_API_DETAILS,
-        tmpDir,
-        util.GitHubVariant.DOTCOM,
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        features,
-        getRunnerLogger(true),
-        false,
-      );
-
-      t.is(toolcache.findAllVersions("CodeQL").length, 1);
-      t.assert(toolcache.find("CodeQL", `2.15.0`));
-      t.is(result.toolsVersion, `2.15.0`);
-      t.is(result.toolsSource, ToolsSource.Download);
-      assertDownloadDurationInteger(t, result.toolsDownloadStatusReport);
-    });
-  },
-);
-
-test.serial(
-  "downloads an explicitly requested bundle even if a different version is cached",
-  async (t) => {
-    const features = createFeatures([]);
-
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-
-      await installIntoToolcache({
-        tagName: "codeql-bundle-20200601",
-        isPinned: true,
-        tmpDir,
-      });
-
-      const url = mockBundleDownloadApi({
-        tagName: "codeql-bundle-20200610",
-      });
-      const result = await codeql.setupCodeQL(
-        url,
-        SAMPLE_DOTCOM_API_DETAILS,
-        tmpDir,
-        util.GitHubVariant.DOTCOM,
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        features,
-        getRunnerLogger(true),
-        false,
-      );
-      t.assert(toolcache.find("CodeQL", "0.0.0-20200610"));
-      t.deepEqual(result.toolsVersion, "0.0.0-20200610");
-      t.is(result.toolsSource, ToolsSource.Download);
-      assertDownloadDurationInteger(t, result.toolsDownloadStatusReport);
-    });
-  },
-);
-
-const EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES = [
-  {
-    tagName: "codeql-bundle-2.17.6",
-    expectedToolcacheVersion: "2.17.6",
-  },
-  {
-    tagName: "codeql-bundle-20240805",
-    expectedToolcacheVersion: "0.0.0-20240805",
-  },
-];
-
-for (const {
-  tagName,
-  expectedToolcacheVersion,
-} of EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES) {
-  test.serial(
-    `caches explicitly requested bundle ${tagName} as ${expectedToolcacheVersion}`,
-    async (t) => {
-      const features = createFeatures([]);
-
-      await util.withTmpDir(async (tmpDir) => {
-        setupActionsVars(tmpDir, tmpDir);
-
-        mockApiDetails(SAMPLE_DOTCOM_API_DETAILS);
-        sinon.stub(actionsUtil, "isRunningLocalAction").returns(true);
-
-        const url = mockBundleDownloadApi({
-          tagName,
-        });
-
-        const result = await codeql.setupCodeQL(
-          url,
-          SAMPLE_DOTCOM_API_DETAILS,
-          tmpDir,
-          util.GitHubVariant.DOTCOM,
-          SAMPLE_DEFAULT_CLI_VERSION,
-          undefined, // rawLanguages
-          false, // useOverlayAwareDefaultCliVersion
-          features,
-          getRunnerLogger(true),
-          false,
-        );
-        t.assert(toolcache.find("CodeQL", expectedToolcacheVersion));
-        t.deepEqual(result.toolsVersion, expectedToolcacheVersion);
-        t.is(result.toolsSource, ToolsSource.Download);
-        assertDownloadDurationInteger(t, result.toolsDownloadStatusReport);
-      });
-    },
-  );
-}
-
-for (const toolcacheVersion of [
-  // Test that we use the tools from the toolcache when `SAMPLE_DEFAULT_CLI_VERSION` is requested
-  // and `SAMPLE_DEFAULT_CLI_VERSION-` is in the toolcache.
-  SAMPLE_DEFAULT_CLI_VERSION.enabledVersions[0].cliVersion,
-  `${SAMPLE_DEFAULT_CLI_VERSION.enabledVersions[0].cliVersion}-20230101`,
-]) {
-  test.serial(
-    `uses tools from toolcache when ${SAMPLE_DEFAULT_CLI_VERSION.enabledVersions[0].cliVersion} is requested and ` +
-      `${toolcacheVersion} is installed`,
-    async (t) => {
-      const features = createFeatures([]);
-
-      await util.withTmpDir(async (tmpDir) => {
-        setupActionsVars(tmpDir, tmpDir);
-
-        sinon
-          .stub(toolcache, "find")
-          .withArgs("CodeQL", toolcacheVersion)
-          .returns("path/to/cached/codeql");
-        sinon.stub(toolcache, "findAllVersions").returns([toolcacheVersion]);
-
-        const result = await codeql.setupCodeQL(
-          undefined,
-          SAMPLE_DOTCOM_API_DETAILS,
-          tmpDir,
-          util.GitHubVariant.DOTCOM,
-          SAMPLE_DEFAULT_CLI_VERSION,
-          undefined, // rawLanguages
-          false, // useOverlayAwareDefaultCliVersion
-          features,
-          getRunnerLogger(true),
-          false,
-        );
-        t.is(
-          result.toolsVersion,
-          SAMPLE_DEFAULT_CLI_VERSION.enabledVersions[0].cliVersion,
-        );
-        t.is(result.toolsSource, ToolsSource.Toolcache);
-        t.is(result.toolsDownloadStatusReport, undefined);
-      });
-    },
-  );
-}
-
-test.serial(
-  `uses a cached bundle when no tools input is given on GHES`,
-  async (t) => {
-    const features = createFeatures([]);
-
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-
-      await installIntoToolcache({
-        tagName: "codeql-bundle-20200601",
-        isPinned: true,
-        tmpDir,
-      });
-
-      const result = await codeql.setupCodeQL(
-        undefined,
-        SAMPLE_DOTCOM_API_DETAILS,
-        tmpDir,
-        util.GitHubVariant.GHES,
-        {
-          enabledVersions: [
-            {
-              cliVersion: defaults.cliVersion,
-              tagName: defaults.bundleVersion,
-            },
-          ],
-        },
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        features,
-        getRunnerLogger(true),
-        false,
-      );
-      t.deepEqual(result.toolsVersion, "0.0.0-20200601");
-      t.is(result.toolsSource, ToolsSource.Toolcache);
-      t.is(result.toolsDownloadStatusReport, undefined);
-
-      const cachedVersions = toolcache.findAllVersions("CodeQL");
-      t.is(cachedVersions.length, 1);
-    });
-  },
-);
-
-test.serial(
-  `downloads bundle if only an unpinned version is cached on GHES`,
-  async (t) => {
-    const features = createFeatures([]);
-
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-
-      await installIntoToolcache({
-        tagName: "codeql-bundle-20200601",
-        isPinned: false,
-        tmpDir,
-      });
-
-      mockBundleDownloadApi({
-        tagName: defaults.bundleVersion,
-      });
-      const result = await codeql.setupCodeQL(
-        undefined,
-        SAMPLE_DOTCOM_API_DETAILS,
-        tmpDir,
-        util.GitHubVariant.GHES,
-        {
-          enabledVersions: [
-            {
-              cliVersion: defaults.cliVersion,
-              tagName: defaults.bundleVersion,
-            },
-          ],
-        },
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        features,
-        getRunnerLogger(true),
-        false,
-      );
-      t.deepEqual(result.toolsVersion, defaults.cliVersion);
-      t.is(result.toolsSource, ToolsSource.Download);
-      t.truthy(result.toolsDownloadStatusReport);
-
-      const cachedVersions = toolcache.findAllVersions("CodeQL");
-      t.is(cachedVersions.length, 2);
-    });
-  },
-);
-
-test.serial(
-  'downloads bundle if "latest" tools specified but not cached',
-  async (t) => {
-    const features = createFeatures([]);
-
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-
-      await installIntoToolcache({
-        tagName: "codeql-bundle-20200601",
-        isPinned: true,
-        tmpDir,
-      });
-
-      mockBundleDownloadApi({
-        tagName: defaults.bundleVersion,
-      });
-      const result = await codeql.setupCodeQL(
-        "latest",
-        SAMPLE_DOTCOM_API_DETAILS,
-        tmpDir,
-        util.GitHubVariant.DOTCOM,
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        features,
-        getRunnerLogger(true),
-        false,
-      );
-      t.deepEqual(result.toolsVersion, defaults.cliVersion);
-      t.is(result.toolsSource, ToolsSource.Download);
-      t.truthy(result.toolsDownloadStatusReport);
-
-      const cachedVersions = toolcache.findAllVersions("CodeQL");
-      t.is(cachedVersions.length, 2);
-    });
-  },
-);
-
-test.serial(
-  "bundle URL from another repo is cached as 0.0.0-bundleVersion",
-  async (t) => {
-    const features = createFeatures([]);
-
-    await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-
-      mockApiDetails(SAMPLE_DOTCOM_API_DETAILS);
-      sinon.stub(actionsUtil, "isRunningLocalAction").returns(true);
-      const releasesApiMock = mockReleaseApi({
-        assetNames: ["cli-version-2.14.6.txt"],
-        tagName: "codeql-bundle-20230203",
-      });
-      mockBundleDownloadApi({
-        repo: "codeql-testing/codeql-cli-nightlies",
-        platformSpecific: false,
-        tagName: "codeql-bundle-20230203",
-      });
-      const result = await codeql.setupCodeQL(
-        "https://github.com/codeql-testing/codeql-cli-nightlies/releases/download/codeql-bundle-20230203/codeql-bundle.tar.gz",
-        SAMPLE_DOTCOM_API_DETAILS,
-        tmpDir,
-        util.GitHubVariant.DOTCOM,
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        features,
-        getRunnerLogger(true),
-        false,
-      );
-
-      t.is(result.toolsVersion, "0.0.0-20230203");
-      t.is(result.toolsSource, ToolsSource.Download);
-      assertDownloadDurationInteger(t, result.toolsDownloadStatusReport);
-
-      const cachedVersions = toolcache.findAllVersions("CodeQL");
-      t.is(cachedVersions.length, 1);
-      t.is(cachedVersions[0], "0.0.0-20230203");
-
-      t.false(releasesApiMock.isDone());
-    });
-  },
-);
-
-function assertDownloadDurationInteger(
-  t: ExecutionContext,
-  statusReport: ToolsDownloadStatusReport | undefined,
-) {
-  t.assert(Number.isInteger(statusReport?.downloadDurationMs));
-}
-
-test.serial("getExtraOptions works for explicit paths", (t) => {
-  t.deepEqual(codeql.getExtraOptions({}, ["foo"], []), []);
-
-  t.deepEqual(codeql.getExtraOptions({ foo: [42] }, ["foo"], []), ["42"]);
-
-  t.deepEqual(
-    codeql.getExtraOptions({ foo: { bar: [42] } }, ["foo", "bar"], []),
-    ["42"],
-  );
-});
-
-test.serial("getExtraOptions works for wildcards", (t) => {
-  t.deepEqual(codeql.getExtraOptions({ "*": [42] }, ["foo"], []), ["42"]);
-});
-
-test.serial("getExtraOptions works for wildcards and explicit paths", (t) => {
-  const o1 = { "*": [42], foo: [87] };
-  t.deepEqual(codeql.getExtraOptions(o1, ["foo"], []), ["42", "87"]);
-
-  const o2 = { "*": [42], foo: [87] };
-  t.deepEqual(codeql.getExtraOptions(o2, ["foo", "bar"], []), ["42"]);
-
-  const o3 = { "*": [42], foo: { "*": [87], bar: [99] } };
-  const p = ["foo", "bar"];
-  t.deepEqual(codeql.getExtraOptions(o3, p, []), ["42", "87", "99"]);
-});
-
-test.serial("getExtraOptions throws for bad content", (t) => {
-  t.throws(() => codeql.getExtraOptions({ "*": 42 }, ["foo"], []));
-
-  t.throws(() => codeql.getExtraOptions({ foo: 87 }, ["foo"], []));
-
-  t.throws(() =>
-    codeql.getExtraOptions(
-      { "*": [42], foo: { "*": 87, bar: [99] } },
-      ["foo", "bar"],
-      [],
-    ),
-  );
-});
-
-// Test macro for ensuring different variants of injected augmented configurations
-const injectedConfigMacro = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    augmentationProperties: AugmentationProperties,
-    configOverride: Partial,
-    expectedConfig: any,
-  ) => {
-    await util.withTmpDir(async (tempDir) => {
-      sinon.stub(actionsUtil, "isDefaultSetup").resolves(false);
-
-      const runnerConstructorStub = stubToolRunnerConstructor();
-      const codeqlObject = await stubCodeql();
-
-      const thisStubConfig: Config = {
-        ...stubConfig,
-        ...configOverride,
-        tempDir,
-      };
-      thisStubConfig.computedConfig = generateCodeScanningConfig(
-        getRunnerLogger(true),
-        thisStubConfig.originalUserInput,
-        augmentationProperties,
-      );
-
-      await codeqlObject.databaseInitCluster(
-        thisStubConfig,
-        "",
-        undefined,
-        undefined,
-      );
-
-      const args = runnerConstructorStub.firstCall.args[1] as string[];
-      // should have used an config file
-      const configArg = args.find((arg: string) =>
-        arg.startsWith("--codescanning-config="),
-      );
-      t.truthy(configArg, "Should have injected a codescanning config");
-      const configFile = configArg!.split("=")[1];
-      const augmentedConfig = yaml.load(fs.readFileSync(configFile, "utf8"));
-      t.deepEqual(augmentedConfig, expectedConfig);
-
-      await fs.promises.rm(configFile, { force: true });
-    });
-  },
-
-  title: (providedTitle = "") =>
-    `databaseInitCluster() injected config: ${providedTitle}`,
-});
-
-injectedConfigMacro.serial(
-  "basic",
-  {
-    ...defaultAugmentationProperties,
-  },
-  {},
-  {},
-);
-
-injectedConfigMacro.serial(
-  "injected packs from input",
-  {
-    ...defaultAugmentationProperties,
-    packsInput: ["xxx", "yyy"],
-  },
-  {},
-  {
-    packs: ["xxx", "yyy"],
-  },
-);
-
-injectedConfigMacro.serial(
-  "injected packs from input with existing packs combines",
-  {
-    ...defaultAugmentationProperties,
-    packsInputCombines: true,
-    packsInput: ["xxx", "yyy"],
-  },
-  {
-    originalUserInput: {
-      packs: {
-        cpp: ["codeql/something-else"],
-      },
-    },
-  },
-  {
-    packs: {
-      cpp: ["codeql/something-else", "xxx", "yyy"],
-    },
-  },
-);
-
-injectedConfigMacro.serial(
-  "injected packs from input with existing packs overrides",
-  {
-    ...defaultAugmentationProperties,
-    packsInput: ["xxx", "yyy"],
-  },
-  {
-    originalUserInput: {
-      packs: {
-        cpp: ["codeql/something-else"],
-      },
-    },
-  },
-  {
-    packs: ["xxx", "yyy"],
-  },
-);
-
-// similar, but with queries
-injectedConfigMacro.serial(
-  "injected queries from input",
-  {
-    ...defaultAugmentationProperties,
-    queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
-  },
-  {},
-  {
-    queries: [
-      {
-        uses: "xxx",
-      },
-      {
-        uses: "yyy",
-      },
-    ],
-  },
-);
-
-injectedConfigMacro.serial(
-  "injected queries from input overrides",
-  {
-    ...defaultAugmentationProperties,
-    queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
-  },
-  {
-    originalUserInput: {
-      queries: [{ uses: "zzz" }],
-    },
-  },
-  {
-    queries: [
-      {
-        uses: "xxx",
-      },
-      {
-        uses: "yyy",
-      },
-    ],
-  },
-);
-
-injectedConfigMacro.serial(
-  "injected queries from input combines",
-  {
-    ...defaultAugmentationProperties,
-    queriesInputCombines: true,
-    queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
-  },
-  {
-    originalUserInput: {
-      queries: [{ uses: "zzz" }],
-    },
-  },
-  {
-    queries: [
-      {
-        uses: "xxx",
-      },
-      {
-        uses: "yyy",
-      },
-      {
-        uses: "zzz",
-      },
-    ],
-  },
-);
-
-injectedConfigMacro.serial(
-  "injected queries from input combines 2",
-  {
-    ...defaultAugmentationProperties,
-    queriesInputCombines: true,
-    packsInputCombines: true,
-    queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
-  },
-  {},
-  {
-    queries: [
-      {
-        uses: "xxx",
-      },
-      {
-        uses: "yyy",
-      },
-    ],
-  },
-);
-
-injectedConfigMacro.serial(
-  "injected queries and packs, but empty",
-  {
-    ...defaultAugmentationProperties,
-    queriesInputCombines: true,
-    packsInputCombines: true,
-    queriesInput: [],
-    packsInput: [],
-  },
-  {
-    originalUserInput: {
-      packs: [],
-      queries: [],
-    },
-  },
-  {},
-);
-
-injectedConfigMacro.serial(
-  "repo property queries have the highest precedence",
-  {
-    ...defaultAugmentationProperties,
-    queriesInputCombines: true,
-    queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
-    repoPropertyQueries: {
-      combines: false,
-      input: [{ uses: "zzz" }, { uses: "aaa" }],
-    },
-  },
-  {
-    originalUserInput: {
-      queries: [{ uses: "uu" }, { uses: "vv" }],
-    },
-  },
-  {
-    queries: [{ uses: "zzz" }, { uses: "aaa" }],
-  },
-);
-
-injectedConfigMacro.serial(
-  "repo property queries combines with queries input",
-  {
-    ...defaultAugmentationProperties,
-    queriesInputCombines: false,
-    queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
-    repoPropertyQueries: {
-      combines: true,
-      input: [{ uses: "zzz" }, { uses: "aaa" }],
-    },
-  },
-  {
-    originalUserInput: {
-      queries: [{ uses: "uu" }, { uses: "vv" }],
-    },
-  },
-  {
-    queries: [
-      { uses: "zzz" },
-      { uses: "aaa" },
-      { uses: "xxx" },
-      { uses: "yyy" },
-    ],
-  },
-);
-
-injectedConfigMacro.serial(
-  "repo property queries combines everything else",
-  {
-    ...defaultAugmentationProperties,
-    queriesInputCombines: true,
-    queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
-    repoPropertyQueries: {
-      combines: true,
-      input: [{ uses: "zzz" }, { uses: "aaa" }],
-    },
-  },
-  {
-    originalUserInput: {
-      queries: [{ uses: "uu" }, { uses: "vv" }],
-    },
-  },
-  {
-    queries: [
-      { uses: "zzz" },
-      { uses: "aaa" },
-      { uses: "xxx" },
-      { uses: "yyy" },
-      { uses: "uu" },
-      { uses: "vv" },
-    ],
-  },
-);
-
-test.serial(
-  "passes a code scanning config AND qlconfig to the CLI",
-  async (t: ExecutionContext) => {
-    await util.withTmpDir(async (tempDir) => {
-      const runnerConstructorStub = stubToolRunnerConstructor();
-      const codeqlObject = await stubCodeql();
-      await codeqlObject.databaseInitCluster(
-        { ...stubConfig, tempDir },
-        "",
-        undefined,
-        "/path/to/qlconfig.yml",
-      );
-
-      const args = runnerConstructorStub.firstCall.args[1] as string[];
-      // should have used a config file
-      const hasCodeScanningConfigArg = args.some((arg: string) =>
-        arg.startsWith("--codescanning-config="),
-      );
-      t.true(hasCodeScanningConfigArg, "Should have injected a qlconfig");
-
-      // should have passed a qlconfig file
-      const hasQlconfigArg = args.some((arg: string) =>
-        arg.startsWith("--qlconfig-file="),
-      );
-      t.truthy(hasQlconfigArg, "Should have injected a codescanning config");
-    });
-  },
-);
-
-test.serial(
-  "does not pass a qlconfig to the CLI when it is undefined",
-  async (t: ExecutionContext) => {
-    await util.withTmpDir(async (tempDir) => {
-      const runnerConstructorStub = stubToolRunnerConstructor();
-      const codeqlObject = await stubCodeql();
-
-      await codeqlObject.databaseInitCluster(
-        { ...stubConfig, tempDir },
-        "",
-        undefined,
-        undefined, // undefined qlconfigFile
-      );
-
-      const args = runnerConstructorStub.firstCall.args[1] as any[];
-      const hasQlconfigArg = args.some((arg: string) =>
-        arg.startsWith("--qlconfig-file="),
-      );
-      t.false(hasQlconfigArg, "should NOT have injected a qlconfig");
-    });
-  },
-);
-
-test.serial("runTool summarizes several fatal errors", async (t) => {
-  const heapError =
-    "A fatal error occurred: Evaluator heap must be at least 384.00 MiB";
-  const datasetImportError =
-    "A fatal error occurred: Dataset import for /home/runner/work/_temp/codeql_databases/javascript/db-javascript failed with code 2";
-  const cliStderr =
-    `Running TRAP import for CodeQL database at /home/runner/work/_temp/codeql_databases/javascript...\n` +
-    `${heapError}\n${datasetImportError}.`;
-  stubToolRunnerConstructor(32, cliStderr);
-  const codeqlObject = await stubCodeql();
-  // io throws because of the test CodeQL object.
-  sinon.stub(io, "which").resolves("");
-
-  await t.throwsAsync(
-    async () =>
-      await codeqlObject.finalizeDatabase(
-        "db",
-        "--threads=2",
-        "--ram=2048",
-        false,
-      ),
-    {
-      instanceOf: util.ConfigurationError,
-      message: new RegExp(
-        'Encountered a fatal error while running \\"codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db\\"\\. ' +
-          `Exit code was 32 and error was: ${datasetImportError.replaceAll(
-            ".",
-            "\\.",
-          )}\\. Context: ${heapError.replaceAll(
-            ".",
-            "\\.",
-          )}\\. See the logs for more details\\.`,
-      ),
-    },
-  );
-});
-
-test.serial("runTool summarizes autobuilder errors", async (t) => {
-  const stderr = `
-    [2019-09-18 12:00:00] [autobuild] A non-error message
-    [2019-09-18 12:00:00] Untagged message
-    [2019-09-18 12:00:00] [autobuild] [ERROR] Start of the error message
-    [2019-09-18 12:00:00] [autobuild] An interspersed non-error message
-    [2019-09-18 12:00:01] [autobuild] [ERROR]   Some more context about the error message
-    [2019-09-18 12:00:01] [autobuild] [ERROR]   continued
-    [2019-09-18 12:00:01] [autobuild] [ERROR]   and finished here.
-    [2019-09-18 12:00:01] [autobuild] A non-error message
-  `;
-  stubToolRunnerConstructor(1, stderr);
-  const codeqlObject = await codeql.getCodeQLForTesting();
-  sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.17.6"));
-  sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
-  // io throws because of the test CodeQL object.
-  sinon.stub(io, "which").resolves("");
-
-  await t.throwsAsync(
-    async () =>
-      await codeqlObject.runAutobuild(stubConfig, BuiltInLanguage.java),
-    {
-      instanceOf: util.ConfigurationError,
-      message:
-        "We were unable to automatically build your code. Please provide manual build steps. " +
-        `See ${DocUrl.AUTOMATIC_BUILD_FAILED} for more information. ` +
-        "Encountered the following error: Start of the error message\n" +
-        "  Some more context about the error message\n" +
-        "  continued\n" +
-        "  and finished here.",
-    },
-  );
-});
-
-test.serial("runTool truncates long autobuilder errors", async (t) => {
-  const stderr = Array.from(
-    { length: 20 },
-    (_, i) => `[2019-09-18 12:00:00] [autobuild] [ERROR] line${i + 1}`,
-  ).join("\n");
-  stubToolRunnerConstructor(1, stderr);
-  const codeqlObject = await stubCodeql();
-  sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
-  // io throws because of the test CodeQL object.
-  sinon.stub(io, "which").resolves("");
-
-  await t.throwsAsync(
-    async () =>
-      await codeqlObject.runAutobuild(stubConfig, BuiltInLanguage.java),
-    {
-      instanceOf: util.ConfigurationError,
-      message:
-        "We were unable to automatically build your code. Please provide manual build steps. " +
-        `See ${DocUrl.AUTOMATIC_BUILD_FAILED} for more information. ` +
-        "Encountered the following error: " +
-        `${Array.from({ length: 10 }, (_, i) => `line${i + 1}`).join(
-          "\n",
-        )}\n(truncated)`,
-    },
-  );
-});
-
-test.serial("runTool recognizes fatal internal errors", async (t) => {
-  const stderr = `
-    [11/31 eval 8m19s] Evaluation done; writing results to codeql/go-queries/Security/CWE-020/MissingRegexpAnchor.bqrs.
-    Oops! A fatal internal error occurred. Details:
-    com.semmle.util.exception.CatastrophicError: An error occurred while evaluating ControlFlowGraph::ControlFlow::Root.isRootOf/1#dispred#f610e6ed/2@86282cc8
-    Severe disk cache trouble (corruption or out of space) at /home/runner/work/_temp/codeql_databases/go/db-go/default/cache/pages/28/33.pack: Failed to write item to disk`;
-  stubToolRunnerConstructor(1, stderr);
-  const codeqlObject = await codeql.getCodeQLForTesting();
-  sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.17.6"));
-  sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
-  // io throws because of the test CodeQL object.
-  sinon.stub(io, "which").resolves("");
-
-  await t.throwsAsync(
-    async () =>
-      await codeqlObject.databaseRunQueries(stubConfig.dbLocation, []),
-    {
-      instanceOf: CliError,
-      message: `Encountered a fatal error while running "codeql-for-testing database run-queries  --min-disk-free=1024 -v". Exit code was 1 and error was: Oops! A fatal internal error occurred. Details:
-    com.semmle.util.exception.CatastrophicError: An error occurred while evaluating ControlFlowGraph::ControlFlow::Root.isRootOf/1#dispred#f610e6ed/2@86282cc8
-    Severe disk cache trouble (corruption or out of space) at /home/runner/work/_temp/codeql_databases/go/db-go/default/cache/pages/28/33.pack: Failed to write item to disk. See the logs for more details.`,
-    },
-  );
-});
-
-test.serial(
-  "runTool outputs last line of stderr if fatal error could not be found",
-  async (t) => {
-    const cliStderr = "line1\nline2\nline3\nline4\nline5";
-    stubToolRunnerConstructor(32, cliStderr);
-    const codeqlObject = await stubCodeql();
-    // io throws because of the test CodeQL object.
-    sinon.stub(io, "which").resolves("");
-
-    await t.throwsAsync(
-      async () =>
-        await codeqlObject.finalizeDatabase(
-          "db",
-          "--threads=2",
-          "--ram=2048",
-          false,
-        ),
-      {
-        instanceOf: util.ConfigurationError,
-        message: new RegExp(
-          'Encountered a fatal error while running \\"codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db\\"\\. ' +
-            "Exit code was 32 and last log line was: line5\\. See the logs for more details\\.",
-        ),
-      },
-    );
-  },
-);
-
-test.serial(
-  "Avoids duplicating --force-overwrite flag if specified in CODEQL_ACTION_EXTRA_OPTIONS",
-  async (t) => {
-    const runnerConstructorStub = stubToolRunnerConstructor();
-    const codeqlObject = await stubCodeql();
-    // io throws because of the test CodeQL object.
-    sinon.stub(io, "which").resolves("");
-
-    process.env["CODEQL_ACTION_EXTRA_OPTIONS"] =
-      '{ "database": { "init": ["--force-overwrite"] } }';
-
-    await codeqlObject.databaseInitCluster(
-      stubConfig,
-      "sourceRoot",
-      undefined,
-      undefined,
-    );
-
-    t.true(runnerConstructorStub.calledOnce);
-    const args = runnerConstructorStub.firstCall.args[1] as string[];
-    t.is(
-      args.filter((option: string) => option === "--force-overwrite").length,
-      1,
-      "--force-overwrite should only be passed once",
-    );
-
-    // Clean up
-    const configArg = args.find((arg: string) =>
-      arg.startsWith("--codescanning-config="),
-    );
-    t.truthy(configArg, "Should have injected a codescanning config");
-    const configFile = configArg!.split("=")[1];
-    await fs.promises.rm(configFile, { force: true });
-  },
-);
-
-export function stubToolRunnerConstructor(
-  exitCode: number = 0,
-  stderr?: string,
-): sinon.SinonStub {
-  const runnerObjectStub = sinon.createStubInstance(toolrunner.ToolRunner);
-  const runnerConstructorStub = sinon.stub(
-    toolrunner,
-    "ToolRunner",
-  ) as sinon.SinonStub;
-  let stderrListener: ((data: Buffer) => void) | undefined = undefined;
-  runnerConstructorStub.callsFake((_cmd, _args, options: ExecOptions) => {
-    stderrListener = options.listeners?.stderr;
-    return runnerObjectStub;
-  });
-  runnerObjectStub.exec.callsFake(async () => {
-    if (stderrListener !== undefined && stderr !== undefined) {
-      stderrListener(Buffer.from(stderr));
-    }
-    return exitCode;
-  });
-  return runnerConstructorStub;
-}
diff --git a/src/codeql.ts b/src/codeql.ts
deleted file mode 100644
index 117b0d8e65..0000000000
--- a/src/codeql.ts
+++ /dev/null
@@ -1,1255 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as core from "@actions/core";
-import * as toolrunner from "@actions/exec/lib/toolrunner";
-import * as yaml from "js-yaml";
-
-import {
-  CommandInvocationError,
-  getActionVersion,
-  getOptionalInput,
-  runTool,
-} from "./actions-util";
-import * as api from "./api-client";
-import * as outputCache from "./cli/output-cache";
-import type { VersionInfo } from "./cli/types";
-import { CliError, wrapCliConfigurationError } from "./cli-errors";
-import { appendExtraQueryExclusions, type Config } from "./config-utils";
-import { DocUrl } from "./doc-url";
-import { EnvVar, getEnv } from "./environment";
-import {
-  CodeQLDefaultVersionInfo,
-  Feature,
-  FeatureEnablement,
-} from "./feature-flags";
-import { isAnalyzingDefaultBranch } from "./git-utils";
-import { Language } from "./languages";
-import { getRunnerLogger, Logger } from "./logging";
-import { writeBaseDatabaseOidsFile, writeOverlayChangesFile } from "./overlay";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import * as setupCodeql from "./setup-codeql";
-import { ToolsDownloadStatusReport } from "./tools-download";
-import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
-import { shouldEnableIndirectTracing } from "./tracer-config";
-import * as util from "./util";
-import { BuildMode, CleanupLevel, getErrorMessage } from "./util";
-
-type Options = Array;
-
-/**
- * Extra command line options for the codeql commands.
- */
-interface ExtraOptions {
-  "*"?: Options;
-  database?: {
-    "*"?: Options;
-    init?: Options;
-    "trace-command"?: Options;
-    analyze?: Options;
-    finalize?: Options;
-  };
-  resolve?: {
-    "*"?: Options;
-    extractor?: Options;
-    queries?: Options;
-  };
-  github?: {
-    "*"?: Options;
-    "merge-results"?: Options;
-  };
-}
-
-export interface CodeQL {
-  /**
-   * Get the path of the CodeQL executable.
-   */
-  getPath(): string;
-  /**
-   * Get a string containing the semver version of the CodeQL executable.
-   */
-  getVersion(): Promise;
-  /**
-   * Print version information about CodeQL.
-   */
-  printVersion(): Promise;
-  /**
-   * Returns whether the CodeQL executable supports the specified feature.
-   */
-  supportsFeature(feature: ToolsFeature): Promise;
-  /**
-   * Returns whether the provided language is traced.
-   */
-  isTracedLanguage(language: Language): Promise;
-  /**
-   * Returns whether the provided language is scanned.
-   */
-  isScannedLanguage(language: Language): Promise;
-  /**
-   * Run 'codeql database init --db-cluster'.
-   */
-  databaseInitCluster(
-    config: Config,
-    sourceRoot: string,
-    processName: string | undefined,
-    qlconfigFile: string | undefined,
-  ): Promise;
-  /**
-   * Runs the autobuilder for the given language.
-   */
-  runAutobuild(config: Config, language: Language): Promise;
-  /**
-   * Extract code for a scanned language using 'codeql database trace-command'
-   * and running the language extractor.
-   */
-  extractScannedLanguage(config: Config, language: Language): Promise;
-  /**
-   * Extract code with 'codeql database trace-command --use-build-mode'. This can only be used when
-   * the database specifies a build mode. This requires the `traceCommandUseBuildMode` tool feature.
-   */
-  extractUsingBuildMode(config: Config, language: Language): Promise;
-  /**
-   * Finalize a database using 'codeql database finalize'.
-   */
-  finalizeDatabase(
-    databasePath: string,
-    threadsFlag: string,
-    memoryFlag: string,
-    enableDebugLogging: boolean,
-  ): Promise;
-  /**
-   * Run 'codeql resolve languages' with '--format=betterjson'.
-   */
-  resolveLanguages(options?: {
-    filterToLanguagesWithQueries: boolean;
-  }): Promise;
-  /**
-   * Run 'codeql resolve build-environment'
-   */
-  resolveBuildEnvironment(
-    workingDir: string | undefined,
-    language: string,
-  ): Promise;
-
-  /**
-   * Clean up all the databases within a database cluster.
-   */
-  databaseCleanupCluster(
-    config: Config,
-    cleanupLevel: CleanupLevel,
-  ): Promise;
-  /**
-   * Run 'codeql database bundle'.
-   *
-   * @param alsoIncludeRelativePaths Additional paths that should be included in the bundle if
-   * supported by the version of the CodeQL CLI.
-   *
-   * These paths are relative to the database root.
-   *
-   * Older versions of the CodeQL CLI do not support including additional paths in the bundle.
-   * In those cases, this parameter will be ignored.
-   */
-  databaseBundle(
-    databasePath: string,
-    outputFilePath: string,
-    dbName: string,
-    includeDiagnostics: boolean,
-    alsoIncludeRelativePaths: string[],
-  ): Promise;
-  /**
-   * Run 'codeql database run-queries'. If no `queries` are specified, then the CLI
-   * will automatically use the `config-queries.qls` (if it exists) or default queries
-   * for the language.
-   */
-  databaseRunQueries(
-    databasePath: string,
-    flags: string[],
-    queries?: string[],
-  ): Promise;
-  /**
-   * Run 'codeql database interpret-results'.
-   */
-  databaseInterpretResults(
-    databasePath: string,
-    querySuitePaths: string[] | undefined,
-    sarifFile: string,
-    threadsFlag: string,
-    verbosityFlag: string | undefined,
-    sarifRunPropertyFlag: string | undefined,
-    automationDetailsId: string | undefined,
-    config: Config,
-    features: FeatureEnablement,
-  ): Promise;
-  /**
-   * Run 'codeql database export-diagnostics'
-   *
-   * Note that the "--sarif-include-diagnostics" option is always used, as the command should
-   * only be run if the ExportDiagnosticsEnabled feature flag is on.
-   */
-  databaseExportDiagnostics(
-    databasePath: string,
-    sarifFile: string,
-    automationDetailsId: string | undefined,
-  ): Promise;
-  /**
-   * Run 'codeql diagnostics export'.
-   */
-  diagnosticsExport(
-    sarifFile: string,
-    automationDetailsId: string | undefined,
-    config: Config,
-  ): Promise;
-  /** Get the location of an extractor for the specified language. */
-  resolveExtractor(language: Language): Promise;
-  /**
-   * Run 'codeql resolve queries --format=startingpacks'.
-   */
-  resolveQueriesStartingPacks(queries: string[]): Promise;
-  resolveDatabase(databasePath: string): Promise;
-  /**
-   * Run 'codeql github merge-results'.
-   */
-  mergeResults(
-    sarifFiles: string[],
-    outputFile: string,
-    options: { mergeRunsFromEqualCategory?: boolean },
-  ): Promise;
-}
-
-export interface ResolveDatabaseOutput {
-  overlayBaseSpecifier?: string;
-}
-
-export interface ResolveLanguagesOutput {
-  aliases?: {
-    [alias: string]: string;
-  };
-  extractors: {
-    [language: string]: Array<{
-      extractor_root: string;
-      extractor_options?: any;
-    }>;
-  };
-}
-
-export interface ResolveBuildEnvironmentOutput {
-  configuration?: {
-    [language: string]: {
-      [key: string]: unknown;
-    };
-  };
-}
-
-/**
- * Stores the CodeQL object, and is populated by `setupCodeQL` or `getCodeQL`.
- */
-let cachedCodeQL: CodeQL | undefined = undefined;
-
-/**
- * The oldest version of CodeQL that the Action will run with. This should be
- * at least three minor versions behind the current version and must include the
- * CLI versions shipped with each supported version of GHES.
- *
- * The version flags below can be used to conditionally enable certain features
- * on versions newer than this.
- */
-const CODEQL_MINIMUM_VERSION = "2.19.4";
-
-/**
- * This version will shortly become the oldest version of CodeQL that the Action will run with.
- */
-const CODEQL_NEXT_MINIMUM_VERSION = "2.20.7";
-
-/**
- * This is the version of GHES that was most recently deprecated.
- */
-const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.16";
-
-/**
- * This is the deprecation date for the version of GHES that was most recently deprecated.
- */
-const GHES_MOST_RECENT_DEPRECATION_DATE = "2026-07-01";
-
-/** The CLI verbosity level to use for extraction in debug mode. */
-const EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++";
-
-/**
- * Decides whether `e` is a disk-related error outside of our control
- * that should be classified as a `ConfigurationError`.
- *
- * @param e The error to check.
- * @returns True if the error should be treated as a `ConfigurationError` or false if not.
- */
-export function isDiskConfigurationError(e: unknown): boolean {
-  if (!(e instanceof Error)) {
-    return false;
-  }
-
-  return (
-    // out of disk space
-    e.message.includes("ENOSPC") ||
-    // access denied
-    e.message.includes("EACCES")
-  );
-}
-
-/**
- * Set up CodeQL CLI access.
- *
- * @param toolsInput
- * @param apiDetails
- * @param tempDir
- * @param variant
- * @param defaultCliVersion
- * @param rawLanguages Raw set of languages.
- * @param useOverlayAwareDefaultCliVersion Whether to select an overlay-aware default CLI version.
- * @param features Information about the features that are enabled.
- * @param logger
- * @param checkVersion Whether to check that CodeQL CLI meets the minimum
- *        version requirement. Must be set to true outside tests.
- * @returns a { CodeQL, toolsVersion } object.
- */
-export async function setupCodeQL(
-  toolsInput: string | undefined,
-  apiDetails: api.GitHubApiDetails,
-  tempDir: string,
-  variant: util.GitHubVariant,
-  defaultCliVersion: CodeQLDefaultVersionInfo,
-  rawLanguages: string[] | undefined,
-  useOverlayAwareDefaultCliVersion: boolean,
-  features: FeatureEnablement,
-  logger: Logger,
-  checkVersion: boolean,
-): Promise<{
-  codeql: CodeQL;
-  toolsDownloadStatusReport?: ToolsDownloadStatusReport;
-  toolsSource: setupCodeql.ToolsSource;
-  toolsVersion: string;
-}> {
-  try {
-    const {
-      codeqlFolder,
-      toolsDownloadStatusReport,
-      toolsSource,
-      toolsVersion,
-    } = await setupCodeql.setupCodeQLBundle(
-      toolsInput,
-      apiDetails,
-      tempDir,
-      variant,
-      defaultCliVersion,
-      rawLanguages,
-      useOverlayAwareDefaultCliVersion,
-      features,
-      logger,
-    );
-
-    let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql");
-    if (process.platform === "win32") {
-      codeqlCmd += ".exe";
-    } else if (process.platform !== "linux" && process.platform !== "darwin") {
-      throw new util.ConfigurationError(
-        `Unsupported platform: ${process.platform}`,
-      );
-    }
-
-    cachedCodeQL = await getCodeQLForCmd(logger, codeqlCmd, checkVersion);
-    return {
-      codeql: cachedCodeQL,
-      toolsDownloadStatusReport,
-      toolsSource,
-      toolsVersion,
-    };
-  } catch (rawError) {
-    const e = api.wrapApiConfigurationError(rawError);
-    const ErrorClass =
-      e instanceof util.ConfigurationError || isDiskConfigurationError(e)
-        ? util.ConfigurationError
-        : Error;
-
-    throw new ErrorClass(
-      `Unable to download and extract CodeQL CLI: ${getErrorMessage(e)}${
-        e instanceof Error && e.stack ? `\n\nDetails: ${e.stack}` : ""
-      }`,
-    );
-  }
-}
-
-/**
- * Use the CodeQL executable located at the given path.
- */
-export async function getCodeQL(logger: Logger, cmd: string): Promise {
-  if (cachedCodeQL === undefined) {
-    cachedCodeQL = await getCodeQLForCmd(logger, cmd, true);
-  }
-  return cachedCodeQL;
-}
-
-/**
- * Overrides the CodeQL object. Only for use in tests that cannot override
- * CodeQL via dependency injection.
- *
- * Accepts a partial object. Any undefined methods will be implemented
- * to immediately throw an exception indicating which method is missing.
- */
-export function setCodeQL(codeql: Partial): void {
-  cachedCodeQL = createStubCodeQL(codeql);
-}
-
-function resolveFunction(
-  partialCodeql: Partial,
-  methodName: string,
-  defaultImplementation?: T,
-): T {
-  if (typeof partialCodeql[methodName] !== "function") {
-    if (defaultImplementation !== undefined) {
-      return defaultImplementation;
-    }
-    const dummyMethod = () => {
-      throw new Error(`CodeQL ${methodName} method not correctly defined`);
-    };
-    return dummyMethod as T;
-  }
-  return partialCodeql[methodName] as T;
-}
-
-/**
- * Creates a stub CodeQL object. Only for use in tests.
- *
- * Accepts a partial object. Any undefined methods will be implemented
- * to immediately throw an exception indicating which method is missing.
- */
-export function createStubCodeQL(partialCodeql: Partial): CodeQL {
-  return {
-    getPath: resolveFunction(partialCodeql, "getPath", () => "/tmp/dummy-path"),
-    getVersion: resolveFunction(partialCodeql, "getVersion", async () => ({
-      version: "1.0.0",
-    })),
-    printVersion: resolveFunction(partialCodeql, "printVersion"),
-    supportsFeature: resolveFunction(
-      partialCodeql,
-      "supportsFeature",
-      async (feature) =>
-        !!partialCodeql.getVersion &&
-        isSupportedToolsFeature(await partialCodeql.getVersion(), feature),
-    ),
-    isTracedLanguage: resolveFunction(partialCodeql, "isTracedLanguage"),
-    isScannedLanguage: resolveFunction(partialCodeql, "isScannedLanguage"),
-    databaseInitCluster: resolveFunction(partialCodeql, "databaseInitCluster"),
-    runAutobuild: resolveFunction(partialCodeql, "runAutobuild"),
-    extractScannedLanguage: resolveFunction(
-      partialCodeql,
-      "extractScannedLanguage",
-    ),
-    extractUsingBuildMode: resolveFunction(
-      partialCodeql,
-      "extractUsingBuildMode",
-    ),
-    finalizeDatabase: resolveFunction(partialCodeql, "finalizeDatabase"),
-    resolveLanguages: resolveFunction(
-      partialCodeql,
-      "resolveLanguages",
-      async () => ({ aliases: {}, extractors: {} }),
-    ),
-    resolveBuildEnvironment: resolveFunction(
-      partialCodeql,
-      "resolveBuildEnvironment",
-    ),
-    databaseCleanupCluster: resolveFunction(
-      partialCodeql,
-      "databaseCleanupCluster",
-    ),
-    databaseBundle: resolveFunction(partialCodeql, "databaseBundle"),
-    databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"),
-    databaseInterpretResults: resolveFunction(
-      partialCodeql,
-      "databaseInterpretResults",
-    ),
-    databaseExportDiagnostics: resolveFunction(
-      partialCodeql,
-      "databaseExportDiagnostics",
-    ),
-    diagnosticsExport: resolveFunction(partialCodeql, "diagnosticsExport"),
-    resolveExtractor: resolveFunction(partialCodeql, "resolveExtractor"),
-    resolveQueriesStartingPacks: resolveFunction(
-      partialCodeql,
-      "resolveQueriesStartingPacks",
-    ),
-    resolveDatabase: resolveFunction(partialCodeql, "resolveDatabase"),
-    mergeResults: resolveFunction(partialCodeql, "mergeResults"),
-  };
-}
-
-/**
- * Get a real, newly created CodeQL instance for testing. The instance refers to
- * a non-existent placeholder codeql command, so tests that use this function
- * should also stub the toolrunner.ToolRunner constructor.
- */
-export async function getCodeQLForTesting(
-  cmd = "codeql-for-testing",
-  logger: Logger = getRunnerLogger(true),
-): Promise {
-  return getCodeQLForCmd(logger, cmd, false);
-}
-
-/**
- * Return a CodeQL object for CodeQL CLI access.
- *
- * @param cmd Path to CodeQL CLI
- * @param checkVersion Whether to check that CodeQL CLI meets the minimum
- *        version requirement. Must be set to true outside tests.
- * @returns A new CodeQL object
- */
-async function getCodeQLForCmd(
-  logger: Logger,
-  cmd: string,
-  checkVersion: boolean,
-): Promise {
-  const codeql: CodeQL = {
-    getPath() {
-      return cmd;
-    },
-    async getVersion() {
-      let result = outputCache.getCachedCodeQlVersion(logger, getEnv(), cmd);
-      if (result === undefined) {
-        result = await runCliJson(
-          cmd,
-          ["version", "--format=json"],
-          {
-            noStreamStdout: true,
-          },
-        );
-        outputCache.cacheCodeQlVersion(getEnv(), cmd, result);
-      }
-      return result;
-    },
-    async printVersion() {
-      // Reuse the cached version information rather than invoking the CLI again.
-      core.info(JSON.stringify(await this.getVersion(), null, 2));
-    },
-    async supportsFeature(feature: ToolsFeature) {
-      return isSupportedToolsFeature(await this.getVersion(), feature);
-    },
-    async isTracedLanguage(language: Language) {
-      const extractorPath = await this.resolveExtractor(language);
-      const tracingConfigPath = path.join(
-        extractorPath,
-        "tools",
-        "tracing-config.lua",
-      );
-      return fs.existsSync(tracingConfigPath);
-    },
-    async isScannedLanguage(language: Language) {
-      return !(await this.isTracedLanguage(language));
-    },
-    async databaseInitCluster(
-      config: Config,
-      sourceRoot: string,
-      processName: string | undefined,
-      qlconfigFile: string | undefined,
-    ) {
-      const extraArgs = config.languages.map(
-        (language) => `--language=${language}`,
-      );
-      if (await shouldEnableIndirectTracing(codeql, config)) {
-        extraArgs.push("--begin-tracing");
-        extraArgs.push(...(await getTrapCachingExtractorConfigArgs(config)));
-        extraArgs.push(`--trace-process-name=${processName}`);
-      }
-
-      const codeScanningConfigFile = await writeCodeScanningConfigFile(
-        config,
-        logger,
-      );
-      const externalRepositoryToken = getOptionalInput(
-        "external-repository-token",
-      );
-      extraArgs.push(`--codescanning-config=${codeScanningConfigFile}`);
-      if (externalRepositoryToken) {
-        extraArgs.push("--external-repository-token-stdin");
-      }
-
-      if (config.buildMode !== undefined) {
-        extraArgs.push(`--build-mode=${config.buildMode}`);
-      }
-      if (qlconfigFile !== undefined) {
-        extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
-      }
-
-      const overlayDatabaseMode = config.overlayDatabaseMode;
-      if (overlayDatabaseMode === OverlayDatabaseMode.Overlay) {
-        const overlayChangesFile = await writeOverlayChangesFile(
-          config,
-          sourceRoot,
-          logger,
-        );
-        extraArgs.push(`--overlay-changes=${overlayChangesFile}`);
-      } else if (overlayDatabaseMode === OverlayDatabaseMode.OverlayBase) {
-        extraArgs.push("--overlay-base");
-      }
-
-      const baselineFilesOptions = config.enableFileCoverageInformation
-        ? [
-            "--calculate-language-specific-baseline",
-            "--sublanguage-file-coverage",
-          ]
-        : ["--no-calculate-baseline"];
-
-      await runCli(
-        cmd,
-        [
-          "database",
-          "init",
-          ...(overlayDatabaseMode === OverlayDatabaseMode.Overlay
-            ? []
-            : ["--force-overwrite"]),
-          "--db-cluster",
-          config.dbLocation,
-          `--source-root=${sourceRoot}`,
-          ...baselineFilesOptions,
-          "--extractor-include-aliases",
-          ...extraArgs,
-          ...getExtraOptionsFromEnv(["database", "init"], {
-            // Some user configs specify `--no-calculate-baseline` as an additional
-            // argument to `codeql database init`. Therefore ignore the baseline file
-            // options here to avoid specifying the same argument twice and erroring.
-            //
-            // Ignore `--overwrite` to avoid passing both `--force-overwrite` and `--overwrite` if
-            // the user has configured `--overwrite`.
-            ignoringOptions: [
-              "--force-overwrite",
-              "--overwrite",
-              ...baselineFilesOptions,
-            ],
-          }),
-        ],
-        { stdin: externalRepositoryToken },
-      );
-
-      if (overlayDatabaseMode === OverlayDatabaseMode.OverlayBase) {
-        await writeBaseDatabaseOidsFile(config, sourceRoot);
-      }
-    },
-    async runAutobuild(config: Config, language: Language) {
-      applyAutobuildAzurePipelinesTimeoutFix();
-
-      const autobuildCmd = path.join(
-        await this.resolveExtractor(language),
-        "tools",
-        process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh",
-      );
-
-      // Bump the verbosity of the autobuild command if we're in debug mode
-      if (config.debugMode) {
-        process.env[EnvVar.CLI_VERBOSITY] =
-          process.env[EnvVar.CLI_VERBOSITY] || EXTRACTION_DEBUG_MODE_VERBOSITY;
-      }
-
-      // On macOS, System Integrity Protection (SIP) typically interferes with
-      // CodeQL build tracing of protected binaries.
-      // The usual workaround is to prefix `$CODEQL_RUNNER` to build commands:
-      // `$CODEQL_RUNNER` (not to be confused with the deprecated CodeQL Runner tool)
-      // points to a simple wrapper binary included with the CLI, and the extra layer of
-      // process indirection helps the tracer bypass SIP.
-
-      // The above SIP workaround is *not* needed here.
-      // At the `autobuild` step in the Actions workflow, we assume the `init` step
-      // has successfully run, and will have exported `DYLD_INSERT_LIBRARIES`
-      // into the environment of subsequent steps, to activate the tracer.
-      // When `DYLD_INSERT_LIBRARIES` is set in the environment for a step,
-      // the Actions runtime introduces its own workaround for SIP
-      // (https://github.com/actions/runner/pull/416).
-      await runCli(autobuildCmd);
-    },
-    async extractScannedLanguage(config: Config, language: Language) {
-      await runCli(cmd, [
-        "database",
-        "trace-command",
-        "--index-traceless-dbs",
-        ...(await getTrapCachingExtractorConfigArgsForLang(config, language)),
-        ...getExtractionVerbosityArguments(config.debugMode),
-        ...getExtraOptionsFromEnv(["database", "trace-command"]),
-        util.getCodeQLDatabasePath(config, language),
-      ]);
-    },
-    async extractUsingBuildMode(config: Config, language: Language) {
-      if (config.buildMode === BuildMode.Autobuild) {
-        applyAutobuildAzurePipelinesTimeoutFix();
-      }
-      try {
-        await runCli(cmd, [
-          "database",
-          "trace-command",
-          "--use-build-mode",
-          "--working-dir",
-          process.cwd(),
-          ...(await getTrapCachingExtractorConfigArgsForLang(config, language)),
-          ...getExtractionVerbosityArguments(config.debugMode),
-          ...getExtraOptionsFromEnv(["database", "trace-command"]),
-          util.getCodeQLDatabasePath(config, language),
-        ]);
-      } catch (e) {
-        if (config.buildMode === BuildMode.Autobuild) {
-          const prefix =
-            "We were unable to automatically build your code. " +
-            "Please change the build mode for this language to manual and specify build steps " +
-            `for your project. See ${DocUrl.AUTOMATIC_BUILD_FAILED} for more information.`;
-          throw new util.ConfigurationError(`${prefix} ${getErrorMessage(e)}`);
-        } else {
-          throw e;
-        }
-      }
-    },
-    async finalizeDatabase(
-      databasePath: string,
-      threadsFlag: string,
-      memoryFlag: string,
-      enableDebugLogging: boolean,
-    ) {
-      const args = [
-        "database",
-        "finalize",
-        "--finalize-dataset",
-        threadsFlag,
-        memoryFlag,
-        ...getExtractionVerbosityArguments(enableDebugLogging),
-        ...getExtraOptionsFromEnv(["database", "finalize"]),
-        databasePath,
-      ];
-      await runCli(cmd, args);
-    },
-    async resolveLanguages(
-      {
-        filterToLanguagesWithQueries,
-      }: {
-        filterToLanguagesWithQueries: boolean;
-      } = { filterToLanguagesWithQueries: false },
-    ) {
-      return runCliJson(cmd, [
-        "resolve",
-        "languages",
-        "--format=betterjson",
-        "--extractor-options-verbosity=4",
-        "--extractor-include-aliases",
-        // TODO: Unconditionally include `--filter-to-languages-with-queries`
-        //       once CODEQL_MINIMUM_VERSION is at least v2.23.0
-        //       — the first version to support this flag.
-        ...(filterToLanguagesWithQueries
-          ? ["--filter-to-languages-with-queries"]
-          : []),
-        ...getExtraOptionsFromEnv(["resolve", "languages"]),
-      ]);
-    },
-    async resolveBuildEnvironment(
-      workingDir: string | undefined,
-      language: string,
-    ) {
-      const codeqlArgs = [
-        "resolve",
-        "build-environment",
-        `--language=${language}`,
-        "--extractor-include-aliases",
-        ...getExtraOptionsFromEnv(["resolve", "build-environment"]),
-      ];
-      if (workingDir !== undefined) {
-        codeqlArgs.push("--working-dir", workingDir);
-      }
-      return await runCliJson(cmd, codeqlArgs);
-    },
-    async databaseRunQueries(
-      databasePath: string,
-      flags: string[],
-      queries: string[] = [],
-    ): Promise {
-      const codeqlArgs = [
-        "database",
-        "run-queries",
-        ...flags,
-        databasePath,
-        "--min-disk-free=1024", // Try to leave at least 1GB free
-        "-v",
-        ...queries,
-        ...getExtraOptionsFromEnv(["database", "run-queries"], {
-          ignoringOptions: ["--expect-discarded-cache"],
-        }),
-      ];
-      await runCli(cmd, codeqlArgs);
-    },
-    async databaseInterpretResults(
-      databasePath: string,
-      querySuitePaths: string[] | undefined,
-      sarifFile: string,
-      threadsFlag: string,
-      verbosityFlag: string,
-      sarifRunPropertyFlag: string | undefined,
-      automationDetailsId: string | undefined,
-      config: Config,
-      features: FeatureEnablement,
-    ): Promise {
-      const shouldExportDiagnostics = await features.getValue(
-        Feature.ExportDiagnosticsEnabled,
-        this,
-      );
-      const codeqlArgs = [
-        "database",
-        "interpret-results",
-        threadsFlag,
-        "--format=sarif-latest",
-        verbosityFlag,
-        `--output=${sarifFile}`,
-        "--print-diagnostics-summary",
-        "--print-metrics-summary",
-        "--sarif-add-baseline-file-info",
-        `--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
-          config,
-        )}`,
-        "--sarif-group-rules-by-pack",
-        "--sarif-include-query-help=always",
-        "--sublanguage-file-coverage",
-        ...(await getJobRunUuidSarifOptions()),
-        ...getExtraOptionsFromEnv(["database", "interpret-results"]),
-      ];
-      if (sarifRunPropertyFlag !== undefined) {
-        codeqlArgs.push(sarifRunPropertyFlag);
-      }
-      if (automationDetailsId !== undefined) {
-        codeqlArgs.push("--sarif-category", automationDetailsId);
-      }
-      if (shouldExportDiagnostics) {
-        codeqlArgs.push("--sarif-include-diagnostics");
-      } else {
-        codeqlArgs.push("--no-sarif-include-diagnostics");
-      }
-      codeqlArgs.push(databasePath);
-      if (querySuitePaths) {
-        codeqlArgs.push(...querySuitePaths);
-      }
-      // Capture the stdout, which contains the analysis summary. Don't stream it to the Actions
-      // logs to avoid printing it twice.
-      return await runCli(cmd, codeqlArgs, {
-        noStreamStdout: true,
-      });
-    },
-    async databaseCleanupCluster(
-      config: Config,
-      cleanupLevel: CleanupLevel,
-    ): Promise {
-      for (const language of config.languages) {
-        const databasePath = util.getCodeQLDatabasePath(config, language);
-        const codeqlArgs = [
-          "database",
-          "cleanup",
-          databasePath,
-          `--cache-cleanup=${cleanupLevel}`,
-          ...getExtraOptionsFromEnv(["database", "cleanup"]),
-        ];
-        await runCli(cmd, codeqlArgs);
-      }
-    },
-    async databaseBundle(
-      databasePath: string,
-      outputFilePath: string,
-      databaseName: string,
-      includeDiagnostics: boolean,
-      alsoIncludeRelativePaths: string[],
-    ): Promise {
-      const includeDiagnosticsArgs = includeDiagnostics
-        ? ["--include-diagnostics"]
-        : [];
-      const args = [
-        "database",
-        "bundle",
-        databasePath,
-        `--output=${outputFilePath}`,
-        `--name=${databaseName}`,
-        ...includeDiagnosticsArgs,
-        ...getExtraOptionsFromEnv(["database", "bundle"], {
-          ignoringOptions: includeDiagnosticsArgs,
-        }),
-      ];
-      if (
-        await this.supportsFeature(ToolsFeature.BundleSupportsIncludeOption)
-      ) {
-        args.push(
-          ...alsoIncludeRelativePaths.flatMap((relativePath) => [
-            "--include",
-            relativePath,
-          ]),
-        );
-      }
-      await new toolrunner.ToolRunner(cmd, args).exec();
-    },
-    async databaseExportDiagnostics(
-      databasePath: string,
-      sarifFile: string,
-      automationDetailsId: string | undefined,
-    ): Promise {
-      const args = [
-        "database",
-        "export-diagnostics",
-        `${databasePath}`,
-        "--db-cluster", // Database is always a cluster for CodeQL versions that support diagnostics.
-        "--format=sarif-latest",
-        `--output=${sarifFile}`,
-        "--sarif-include-diagnostics", // ExportDiagnosticsEnabled is always true if this command is run.
-        "-vvv",
-        ...getExtraOptionsFromEnv(["diagnostics", "export"]),
-      ];
-      if (automationDetailsId !== undefined) {
-        args.push("--sarif-category", automationDetailsId);
-      }
-      await new toolrunner.ToolRunner(cmd, args).exec();
-    },
-    async diagnosticsExport(
-      sarifFile: string,
-      automationDetailsId: string | undefined,
-      config: Config,
-    ): Promise {
-      const args = [
-        "diagnostics",
-        "export",
-        "--format=sarif-latest",
-        `--output=${sarifFile}`,
-        `--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
-          config,
-        )}`,
-        ...getExtraOptionsFromEnv(["diagnostics", "export"]),
-      ];
-      if (automationDetailsId !== undefined) {
-        args.push("--sarif-category", automationDetailsId);
-      }
-      await new toolrunner.ToolRunner(cmd, args).exec();
-    },
-    async resolveExtractor(language: Language): Promise {
-      // Request it using `format=json` so we don't need to strip the trailing new line generated by
-      // the CLI.
-      let extractorPath = "";
-      await new toolrunner.ToolRunner(
-        cmd,
-        [
-          "resolve",
-          "extractor",
-          "--format=json",
-          `--language=${language}`,
-          "--extractor-include-aliases",
-          ...getExtraOptionsFromEnv(["resolve", "extractor"]),
-        ],
-        {
-          silent: true,
-          listeners: {
-            stdout: (data) => {
-              extractorPath += data.toString();
-            },
-            stderr: (data) => {
-              process.stderr.write(data);
-            },
-          },
-        },
-      ).exec();
-      return JSON.parse(extractorPath) as string;
-    },
-    async resolveQueriesStartingPacks(queries: string[]): Promise {
-      const codeqlArgs = [
-        "resolve",
-        "queries",
-        "--format=startingpacks",
-        ...getExtraOptionsFromEnv(["resolve", "queries"]),
-        ...queries,
-      ];
-      return await runCliJson(cmd, codeqlArgs, {
-        noStreamStdout: true,
-      });
-    },
-    async resolveDatabase(
-      databasePath: string,
-    ): Promise {
-      const codeqlArgs = [
-        "resolve",
-        "database",
-        databasePath,
-        "--format=json",
-        ...getExtraOptionsFromEnv(["resolve", "database"]),
-      ];
-      return await runCliJson(cmd, codeqlArgs, {
-        noStreamStdout: true,
-      });
-    },
-    async mergeResults(
-      sarifFiles: string[],
-      outputFile: string,
-      {
-        mergeRunsFromEqualCategory = false,
-      }: { mergeRunsFromEqualCategory?: boolean },
-    ): Promise {
-      const args = [
-        "github",
-        "merge-results",
-        "--output",
-        outputFile,
-        ...getExtraOptionsFromEnv(["github", "merge-results"]),
-      ];
-
-      for (const sarifFile of sarifFiles) {
-        args.push("--sarif", sarifFile);
-      }
-
-      if (mergeRunsFromEqualCategory) {
-        args.push("--sarif-merge-runs-from-equal-category");
-      }
-
-      await runCli(cmd, args);
-    },
-  };
-  // To ensure that status reports include the CodeQL CLI version wherever
-  // possible, we want to call getVersion(), which populates the version value
-  // used by status reporting, at the earliest opportunity. But invoking
-  // getVersion() directly here breaks tests that only pretend to create a
-  // CodeQL object. So instead we rely on the assumption that all non-test
-  // callers would set checkVersion to true, and util.codeQlVersionAbove()
-  // would call getVersion(), so the CLI version would be cached as soon as the
-  // CodeQL object is created.
-  if (
-    checkVersion &&
-    !(await util.codeQlVersionAtLeast(codeql, CODEQL_MINIMUM_VERSION))
-  ) {
-    throw new util.ConfigurationError(
-      `Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${
-        (await codeql.getVersion()).version
-      }`,
-    );
-  } else if (
-    checkVersion &&
-    process.env[EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
-    !(await util.codeQlVersionAtLeast(codeql, CODEQL_NEXT_MINIMUM_VERSION))
-  ) {
-    const result = await codeql.getVersion();
-    core.warning(
-      `CodeQL CLI version ${result.version} was discontinued on ` +
-        `${GHES_MOST_RECENT_DEPRECATION_DATE} alongside GitHub Enterprise Server ` +
-        `${GHES_VERSION_MOST_RECENTLY_DEPRECATED} and will not be supported by the next minor ` +
-        `release of the CodeQL Action. Please update to CodeQL CLI version ` +
-        `${CODEQL_NEXT_MINIMUM_VERSION} or later. For instance, if you have specified a custom ` +
-        "version of the CLI using the 'tools' input to the 'init' Action, you can remove this " +
-        "input to use the default version.\n\n" +
-        "Alternatively, if you want to continue using CodeQL CLI version " +
-        `${result.version}, you can replace 'github/codeql-action/*@v${
-          getActionVersion().split(".")[0]
-        }' by 'github/codeql-action/*@v${getActionVersion()}' in your code scanning workflow to ` +
-        "continue using this version of the CodeQL Action.",
-    );
-    core.exportVariable(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true");
-  }
-  return codeql;
-}
-
-/**
- * Gets the options for `path` of `options` as an array of extra option strings.
- *
- * @param paths The CLI command components to get extra options for.
- * @param args Additional arguments for this function.
- * @param args.ignoringOptions
- *   Options that should be ignored, for example because they have already
- *   been passed and it is an error to pass them more than once.
- */
-function getExtraOptionsFromEnv(
-  paths: string[],
-  { ignoringOptions }: { ignoringOptions?: string[] } = {},
-) {
-  const options: ExtraOptions = util.getExtraOptionsEnvParam();
-  return getExtraOptions(options, paths, []).filter(
-    (option) => !ignoringOptions?.includes(option),
-  );
-}
-
-/**
- * Gets `options` as an array of extra option strings.
- *
- * - throws an exception mentioning `pathInfo` if this conversion is impossible.
- */
-function asExtraOptions(options: any, pathInfo: string[]): string[] {
-  if (options === undefined) {
-    return [];
-  }
-  if (!Array.isArray(options)) {
-    const msg = `The extra options for '${pathInfo.join(
-      ".",
-    )}' ('${JSON.stringify(options)}') are not in an array.`;
-    throw new Error(msg);
-  }
-  return options.map((o) => {
-    const t = typeof o;
-    if (t !== "string" && t !== "number" && t !== "boolean") {
-      const msg = `The extra option for '${pathInfo.join(
-        ".",
-      )}' ('${JSON.stringify(o)}') is not a primitive value.`;
-      throw new Error(msg);
-    }
-    return `${o}`;
-  });
-}
-
-/**
- * Gets the options for `path` of `options` as an array of extra option strings.
- *
- * - the special terminal step name '*' in `options` matches all path steps
- * - throws an exception if this conversion is impossible.
- *
- * Exported for testing.
- */
-export function getExtraOptions(
-  options: any,
-  paths: string[],
-  pathInfo: string[],
-): string[] {
-  const all = asExtraOptions(options?.["*"], pathInfo.concat("*"));
-  const specific =
-    paths.length === 0
-      ? asExtraOptions(options, pathInfo)
-      : getExtraOptions(
-          options?.[paths[0]],
-          paths?.slice(1),
-          pathInfo.concat(paths[0]),
-        );
-  return all.concat(specific);
-}
-
-async function runCli(
-  cmd: string,
-  args: string[] = [],
-  opts: { stdin?: string; noStreamStdout?: boolean } = {},
-): Promise {
-  try {
-    return await runTool(cmd, args, opts);
-  } catch (e) {
-    if (e instanceof CommandInvocationError) {
-      throw wrapCliConfigurationError(new CliError(e));
-    }
-    throw e;
-  }
-}
-
-/**
- * Wraps the command executor {@link runCli} and tries to parse the output as JSON.
- * @param cmd The command to run.
- * @param args The arguments to pass to the command.
- * @param opts The options for running the command.
- * @param opts.stdin Optional string to pass to the command's standard input.
- * @param opts.noStreamStdout Optional boolean to indicate whether to stream the command's standard output.
- * @returns The parsed JSON output from the command.
- */
-async function runCliJson(
-  cmd: string,
-  args: string[] = [],
-  opts: { stdin?: string; noStreamStdout?: boolean } = {},
-): Promise {
-  const output = await runCli(cmd, args, opts);
-  try {
-    return JSON.parse(output) as T;
-  } catch (e) {
-    throw Error(
-      `Unexpected output from codeql ${args.join(" ")}: ${getErrorMessage(e)}`,
-    );
-  }
-}
-
-/**
- * Writes the code scanning configuration that is to be used by the CLI.
- *
- * @param config The CodeQL Action state to write.
- * @param logger The logger to use.
- *
- * @returns The path to the generated user configuration file.
- */
-async function writeCodeScanningConfigFile(
-  config: Config,
-  logger: Logger,
-): Promise {
-  const codeScanningConfigFile = getGeneratedCodeScanningConfigPath(config);
-
-  // Apply the `extraQueryExclusions` from the CodeQL Action state to the CLI configuration.
-  // We do this here at the latest possible point before passing the CLI configuration on to
-  // the CLI so that the `extraQueryExclusions` appear after all user-configured `query-filters`.
-  // See the comment in `applyExtraQueryExclusions` for more information, as well as
-  // https://github.com/github/codeql-action/pull/2938
-  const augmentedConfig = appendExtraQueryExclusions(
-    config.extraQueryExclusions,
-    config.computedConfig,
-  );
-
-  logger.info(
-    `Writing augmented user configuration file to ${codeScanningConfigFile}`,
-  );
-  logger.startGroup("Augmented user configuration file contents");
-  logger.info(yaml.dump(augmentedConfig));
-  logger.endGroup();
-
-  fs.writeFileSync(codeScanningConfigFile, yaml.dump(augmentedConfig));
-  return codeScanningConfigFile;
-}
-
-// This constant sets the size of each TRAP cache in megabytes.
-const TRAP_CACHE_SIZE_MB = 1024;
-
-export async function getTrapCachingExtractorConfigArgs(
-  config: Config,
-): Promise {
-  const result: string[][] = [];
-  for (const language of config.languages)
-    result.push(
-      await getTrapCachingExtractorConfigArgsForLang(config, language),
-    );
-  return result.flat();
-}
-
-export async function getTrapCachingExtractorConfigArgsForLang(
-  config: Config,
-  language: Language,
-): Promise {
-  const cacheDir = config.trapCaches[language];
-  if (cacheDir === undefined) return [];
-  const write = await isAnalyzingDefaultBranch();
-  return [
-    `-O=${language}.trap.cache.dir=${cacheDir}`,
-    `-O=${language}.trap.cache.bound=${TRAP_CACHE_SIZE_MB}`,
-    `-O=${language}.trap.cache.write=${write}`,
-  ];
-}
-
-/**
- * Get the path to the code scanning configuration generated by the CLI.
- *
- * This will not exist if the configuration is being parsed in the Action.
- */
-function getGeneratedCodeScanningConfigPath(config: Config): string {
-  return path.resolve(config.tempDir, "user-config.yaml");
-}
-
-function getExtractionVerbosityArguments(
-  enableDebugLogging: boolean,
-): string[] {
-  return enableDebugLogging
-    ? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`]
-    : [];
-}
-
-/**
- * Updates the `JAVA_TOOL_OPTIONS` environment variable to resolve an issue with Azure Pipelines
- * timing out connections after 4 minutes and Maven not properly handling closed connections.
- *
- * Without the fix, long build processes will timeout when pulling down Java packages
- * https://developercommunity.visualstudio.com/content/problem/292284/maven-hosted-agent-connection-timeout.html
- */
-function applyAutobuildAzurePipelinesTimeoutFix() {
-  const javaToolOptions = process.env["JAVA_TOOL_OPTIONS"] || "";
-  process.env["JAVA_TOOL_OPTIONS"] = [
-    ...javaToolOptions.split(/\s+/),
-    "-Dhttp.keepAlive=false",
-    "-Dmaven.wagon.http.pool=false",
-  ].join(" ");
-}
-
-async function getJobRunUuidSarifOptions() {
-  const jobRunUuid = process.env[EnvVar.JOB_RUN_UUID];
-
-  return jobRunUuid ? [`--sarif-run-property=jobRunUuid=${jobRunUuid}`] : [];
-}
diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts
deleted file mode 100644
index aec214cd64..0000000000
--- a/src/config-utils.test.ts
+++ /dev/null
@@ -1,2686 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as github from "@actions/github";
-import test, { ExecutionContext } from "ava";
-import * as yaml from "js-yaml";
-import * as sinon from "sinon";
-
-import { ActionState } from "./action-common";
-import * as actionsUtil from "./actions-util";
-import { AnalysisKind, supportedAnalysisKinds } from "./analyses";
-import * as api from "./api-client";
-import { CachingKind } from "./caching-utils";
-import { createStubCodeQL } from "./codeql";
-import { UserConfig } from "./config/db-config";
-import * as file from "./config/file";
-import * as configUtils from "./config-utils";
-import * as errorMessages from "./error-messages";
-import { Feature } from "./feature-flags";
-import { RepositoryProperties } from "./feature-flags/properties";
-import * as gitUtils from "./git-utils";
-import { GitVersionInfo } from "./git-utils";
-import { BuiltInLanguage, Language } from "./languages";
-import { getRunnerLogger } from "./logging";
-import { CODEQL_OVERLAY_MINIMUM_VERSION } from "./overlay";
-import * as overlayDiagnostics from "./overlay/diagnostics";
-import { OverlayDisabledReason } from "./overlay/diagnostics";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import * as overlayStatus from "./overlay/status";
-import { parseRepositoryNwo } from "./repository";
-import {
-  setupTests,
-  setupActionsVars,
-  mockLanguagesInRepo as mockLanguagesInRepo,
-  createFeatures,
-  getRecordingLogger,
-  LoggedMessage,
-  mockCodeQLVersion,
-  createTestConfig,
-  makeMacro,
-  initAllState,
-  callee,
-  SAMPLE_DOTCOM_API_DETAILS,
-  AssertableTarget,
-} from "./testing-utils";
-import {
-  GitHubVariant,
-  GitHubVersion,
-  ConfigurationError,
-  withTmpDir,
-  BuildMode,
-  DiskUsage,
-  Success,
-  Failure,
-} from "./util";
-import * as util from "./util";
-
-setupTests(test);
-
-const githubVersion = { type: GitHubVariant.DOTCOM } as GitHubVersion;
-
-function createTestInitConfigInputs(
-  overrides: Partial,
-): configUtils.InitConfigInputs {
-  return Object.assign(
-    {},
-    {
-      analysisKinds: [AnalysisKind.CodeScanning],
-      languagesInput: undefined,
-      queriesInput: undefined,
-      packsInput: undefined,
-      configFile: undefined,
-      dbLocation: undefined,
-      configInput: undefined,
-      buildModeInput: undefined,
-      ramInput: undefined,
-      dependencyCachingEnabled: CachingKind.None,
-      debugMode: false,
-      debugArtifactName: "",
-      debugDatabaseName: "",
-      repository: { owner: "github", repo: "example" },
-      tempDir: "",
-      codeql: createStubCodeQL({
-        async resolveLanguages() {
-          return {
-            extractors: {
-              html: [{ extractor_root: "" }],
-              javascript: [{ extractor_root: "" }],
-            },
-          };
-        },
-      }),
-      workspacePath: "",
-      sourceRoot: "",
-      githubVersion,
-      apiDetails: {
-        auth: "token",
-        externalRepoAuth: "token",
-        url: "https://github.example.com",
-        apiURL: undefined,
-      },
-      features: createFeatures([]),
-      repositoryProperties: {},
-      enableFileCoverageInformation: true,
-      logger: getRunnerLogger(true),
-    } satisfies configUtils.InitConfigInputs,
-    overrides,
-  );
-}
-
-// Returns the filepath of the newly-created file
-function createConfigFile(inputFileContents: string, tmpDir: string): string {
-  const configFilePath = path.join(tmpDir, "input");
-  fs.writeFileSync(configFilePath, inputFileContents, "utf8");
-  return configFilePath;
-}
-
-type GetContentsResponse = { content?: string } | object[];
-
-function mockGetContents(
-  content: GetContentsResponse,
-): sinon.SinonStub {
-  // Passing an auth token is required, so we just use a dummy value
-  const client = github.getOctokit("123");
-  const response = {
-    data: content,
-  };
-  const spyGetContents = sinon
-    .stub(client.rest.repos, "getContent")
-    // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-    .resolves(response as any);
-  sinon.stub(api, "getApiClient").value(() => client);
-  sinon.stub(api, "getApiClientWithExternalAuth").value(() => client);
-  return spyGetContents;
-}
-
-function mockListLanguages(languages: string[]) {
-  // Passing an auth token is required, so we just use a dummy value
-  const client = github.getOctokit("123");
-  const response = {
-    data: {},
-  };
-  for (const language of languages) {
-    response.data[language] = 123;
-  }
-  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-  sinon.stub(client.rest.repos, "listLanguages").resolves(response as any);
-  sinon.stub(api, "getApiClient").value(() => client);
-}
-
-test.serial("load empty config", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    const logger = getRunnerLogger(true);
-    const languages = "javascript,python";
-
-    setupActionsVars(tempDir, tempDir);
-
-    const codeql = createStubCodeQL({
-      async resolveLanguages() {
-        return {
-          extractors: {
-            javascript: [{ extractor_root: "" }],
-            python: [{ extractor_root: "" }],
-          },
-        };
-      },
-    });
-
-    const state = initAllState({ logger });
-    const config = await configUtils.initConfig(
-      state,
-      createTestInitConfigInputs({
-        languagesInput: languages,
-        repository: { owner: "github", repo: "example" },
-        tempDir,
-        codeql,
-        logger,
-      }),
-    );
-
-    const expectedConfig = await configUtils.initActionState(
-      createTestInitConfigInputs({
-        languagesInput: languages,
-        tempDir,
-        codeql,
-        logger,
-      }),
-      {},
-    );
-
-    t.deepEqual(config, expectedConfig);
-  });
-});
-
-test.serial("load code quality config", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    const logger = getRunnerLogger(true);
-    const languages = "actions";
-
-    setupActionsVars(tempDir, tempDir);
-
-    const codeql = createStubCodeQL({
-      async resolveLanguages() {
-        return {
-          extractors: {
-            actions: [{ extractor_root: "" }],
-          },
-        };
-      },
-    });
-
-    const state = initAllState({ logger });
-    const config = await configUtils.initConfig(
-      state,
-      createTestInitConfigInputs({
-        analysisKinds: [AnalysisKind.CodeQuality],
-        languagesInput: languages,
-        repository: { owner: "github", repo: "example" },
-        tempDir,
-        codeql,
-        logger,
-      }),
-    );
-
-    // And the config we expect it to result in
-    const expectedConfig = createTestConfig({
-      analysisKinds: [AnalysisKind.CodeQuality],
-      languages: [BuiltInLanguage.actions],
-      // This gets set because we only have `AnalysisKind.CodeQuality`
-      computedConfig: {
-        "disable-default-queries": true,
-        queries: [{ uses: "code-quality" }],
-        "query-filters": [],
-      },
-      tempDir,
-      codeQLCmd: codeql.getPath(),
-      gitHubVersion: githubVersion,
-      dbLocation: path.resolve(tempDir, "codeql_databases"),
-      debugMode: false,
-      debugArtifactName: "",
-      debugDatabaseName: "",
-    });
-
-    t.deepEqual(config, expectedConfig);
-  });
-});
-
-test.serial(
-  "initActionState doesn't throw if there are queries configured in the repository properties",
-  async (t) => {
-    return await withTmpDir(async (tempDir) => {
-      const logger = getRunnerLogger(true);
-      const languages = "javascript";
-
-      setupActionsVars(tempDir, tempDir);
-
-      const codeql = createStubCodeQL({
-        async resolveLanguages() {
-          return {
-            extractors: {
-              javascript: [{ extractor_root: "" }],
-            },
-          };
-        },
-      });
-
-      // This should be ignored and no error should be thrown.
-      const repositoryProperties = {
-        "github-codeql-extra-queries": "+foo",
-      };
-
-      // Expected configuration for a CQ-only analysis.
-      const computedConfig: UserConfig = {
-        "disable-default-queries": true,
-        queries: [{ uses: "code-quality" }],
-        "query-filters": [],
-      };
-
-      const expectedConfig = createTestConfig({
-        analysisKinds: [AnalysisKind.CodeQuality],
-        languages: [BuiltInLanguage.javascript],
-        codeQLCmd: codeql.getPath(),
-        computedConfig,
-        dbLocation: path.resolve(tempDir, "codeql_databases"),
-        debugArtifactName: "",
-        debugDatabaseName: "",
-        tempDir,
-        repositoryProperties,
-      });
-
-      const state = initAllState({ logger });
-      await t.notThrowsAsync(async () => {
-        const config = await configUtils.initConfig(
-          state,
-          createTestInitConfigInputs({
-            analysisKinds: [AnalysisKind.CodeQuality],
-            languagesInput: languages,
-            repository: { owner: "github", repo: "example" },
-            tempDir,
-            codeql,
-            repositoryProperties,
-            logger,
-          }),
-        );
-
-        t.deepEqual(config, expectedConfig);
-      });
-    });
-  },
-);
-
-test.serial("loading a saved config produces the same config", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    const logger = getRunnerLogger(true);
-
-    const codeql = createStubCodeQL({
-      async resolveLanguages() {
-        return {
-          extractors: {
-            javascript: [{ extractor_root: "" }],
-            python: [{ extractor_root: "" }],
-          },
-        };
-      },
-    });
-
-    // Sanity check the saved config file does not already exist
-    t.false(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
-
-    // Sanity check that getConfig returns undefined before we have called initConfig
-    t.deepEqual(await configUtils.getConfig(tempDir, logger), undefined);
-
-    const state = initAllState({ logger });
-    const config1 = await configUtils.initConfig(
-      state,
-      createTestInitConfigInputs({
-        languagesInput: "javascript,python",
-        tempDir,
-        codeql,
-        workspacePath: tempDir,
-        logger,
-      }),
-    );
-    await configUtils.saveConfig(config1, logger);
-
-    // The saved config file should now exist
-    t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
-
-    // And that same newly-initialised config should now be returned by getConfig
-    const config2 = await configUtils.getConfig(tempDir, logger);
-    t.not(config2, undefined);
-    if (config2 !== undefined) {
-      // removes properties assigned to undefined.
-      const expectedConfig = JSON.parse(JSON.stringify(config1));
-      t.deepEqual(expectedConfig, config2);
-    }
-  });
-});
-
-test.serial("loading config with version mismatch throws", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    const logger = getRunnerLogger(true);
-
-    const codeql = createStubCodeQL({
-      async resolveLanguages() {
-        return {
-          extractors: {
-            javascript: [{ extractor_root: "" }],
-            python: [{ extractor_root: "" }],
-          },
-        };
-      },
-    });
-
-    // Sanity check the saved config file does not already exist
-    t.false(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
-
-    // Sanity check that getConfig returns undefined before we have called initConfig
-    t.deepEqual(await configUtils.getConfig(tempDir, logger), undefined);
-
-    // Stub `getActionVersion` to return some nonsense.
-    const getActionVersionStub = sinon
-      .stub(actionsUtil, "getActionVersion")
-      .returns("does-not-exist");
-
-    const state = initAllState({ logger });
-    const config = await configUtils.initConfig(
-      state,
-      createTestInitConfigInputs({
-        languagesInput: "javascript,python",
-        tempDir,
-        codeql,
-        workspacePath: tempDir,
-        logger,
-      }),
-    );
-    // initConfig does not save the config, so we do it here.
-    await configUtils.saveConfig(config, logger);
-
-    // Restore `getActionVersion`.
-    getActionVersionStub.restore();
-
-    // The saved config file should now exist
-    t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
-
-    // Trying to read the configuration should now throw an error.
-    await t.throwsAsync(configUtils.getConfig(tempDir, logger), {
-      instanceOf: ConfigurationError,
-    });
-  });
-});
-
-test.serial("load input outside of workspace", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    try {
-      const state = initAllState();
-      await configUtils.initConfig(
-        state,
-        createTestInitConfigInputs({
-          configFile: "../input",
-          tempDir,
-          workspacePath: tempDir,
-        }),
-      );
-      throw new Error("initConfig did not throw error");
-    } catch (err) {
-      t.deepEqual(
-        err,
-        new ConfigurationError(
-          errorMessages.getConfigFileOutsideWorkspaceErrorMessage(
-            path.join(tempDir, "../input"),
-          ),
-        ),
-      );
-    }
-  });
-});
-
-test.serial("load non-existent input", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    const languagesInput = "javascript";
-    const configFile = "input";
-    t.false(fs.existsSync(path.join(tempDir, configFile)));
-
-    try {
-      const state = initAllState();
-      await configUtils.initConfig(
-        state,
-        createTestInitConfigInputs({
-          languagesInput,
-          configFile,
-          tempDir,
-          workspacePath: tempDir,
-        }),
-      );
-      throw new Error("initConfig did not throw error");
-    } catch (err) {
-      t.deepEqual(
-        err,
-        new ConfigurationError(
-          errorMessages.getConfigFileDoesNotExistErrorMessage(
-            path.join(tempDir, "input"),
-          ),
-        ),
-      );
-    }
-  });
-});
-
-/** A non-empty, but fairly minimal configuration file. */
-const simpleConfigFileContents = `
-  name: my config
-  queries:
-    - uses: ./foo_file`;
-
-/** A less minimal configuration file. */
-const otherConfigFileContents = `
-  name: my config
-  disable-default-queries: true
-  queries:
-    - uses: ./foo
-  paths-ignore:
-    - a
-    - b
-  paths:
-    - c/d`;
-
-test.serial("load non-empty input", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    setupActionsVars(tempDir, tempDir);
-
-    const codeql = createStubCodeQL({
-      async resolveLanguages() {
-        return {
-          extractors: {
-            javascript: [{ extractor_root: "" }],
-          },
-        };
-      },
-    });
-
-    fs.mkdirSync(path.join(tempDir, "foo"));
-
-    const userConfig: UserConfig = {
-      name: "my config",
-      "disable-default-queries": true,
-      queries: [{ uses: "./foo" }],
-      "paths-ignore": ["a", "b"],
-      paths: ["c/d"],
-    };
-
-    // And the config we expect it to parse to
-    const expectedConfig = createTestConfig({
-      languages: [BuiltInLanguage.javascript],
-      buildMode: BuildMode.None,
-      originalUserInput: userConfig,
-      computedConfig: userConfig,
-      tempDir,
-      codeQLCmd: codeql.getPath(),
-      gitHubVersion: githubVersion,
-      dbLocation: path.resolve(tempDir, "codeql_databases"),
-      debugMode: false,
-      debugArtifactName: "my-artifact",
-      debugDatabaseName: "my-db",
-    });
-
-    const languagesInput = "javascript";
-    const configFilePath = createConfigFile(otherConfigFileContents, tempDir);
-
-    const state = initAllState();
-    const actualConfig = await configUtils.initConfig(
-      state,
-      createTestInitConfigInputs({
-        languagesInput,
-        buildModeInput: "none",
-        configFile: configFilePath,
-        debugArtifactName: "my-artifact",
-        debugDatabaseName: "my-db",
-        tempDir,
-        codeql,
-        workspacePath: tempDir,
-      }),
-    );
-
-    // Should exactly equal the object we constructed earlier
-    t.deepEqual(actualConfig, expectedConfig);
-  });
-});
-
-test.serial(
-  "Using config input and file together, config input should be used.",
-  async (t) => {
-    return await withTmpDir(async (tempDir) => {
-      setupActionsVars(tempDir, tempDir);
-
-      const configFilePath = createConfigFile(
-        simpleConfigFileContents,
-        tempDir,
-      );
-
-      const configInput = `
-      name: my config
-      queries:
-        - uses: ./foo
-      packs:
-        javascript:
-          - a/b@1.2.3
-        python:
-          - c/d@1.2.3
-    `;
-
-      fs.mkdirSync(path.join(tempDir, "foo"));
-
-      const codeql = createStubCodeQL({
-        async resolveLanguages() {
-          return {
-            extractors: {
-              javascript: [{ extractor_root: "" }],
-              python: [{ extractor_root: "" }],
-            },
-          };
-        },
-      });
-
-      // Only JS, python packs will be ignored
-      const languagesInput = "javascript";
-
-      const state = initAllState({ env: util.getEnv() });
-      const config = await configUtils.initConfig(
-        state,
-        createTestInitConfigInputs({
-          languagesInput,
-          configFile: configFilePath,
-          configInput,
-          tempDir,
-          codeql,
-          workspacePath: tempDir,
-        }),
-      );
-
-      t.deepEqual(config.originalUserInput, yaml.load(configInput));
-    });
-  },
-);
-
-test.serial("API client used when reading remote config", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    const codeql = createStubCodeQL({
-      async resolveLanguages() {
-        return {
-          extractors: {
-            javascript: [{ extractor_root: "" }],
-          },
-        };
-      },
-    });
-
-    const inputFileContents = `
-      name: my config
-      disable-default-queries: true
-      queries:
-        - uses: ./
-        - uses: ./foo
-        - uses: foo/bar@dev
-      paths-ignore:
-        - a
-        - b
-      paths:
-        - c/d`;
-    const dummyResponse = {
-      content: Buffer.from(inputFileContents).toString("base64"),
-    };
-    const spyGetContents = mockGetContents(dummyResponse);
-
-    // Create checkout directory for remote queries repository
-    fs.mkdirSync(path.join(tempDir, "foo/bar/dev"), { recursive: true });
-
-    const configFile = "octo-org/codeql-config/config.yaml@main";
-    const languagesInput = "javascript";
-
-    const state = initAllState();
-    await configUtils.initConfig(
-      state,
-      createTestInitConfigInputs({
-        languagesInput,
-        configFile,
-        tempDir,
-        codeql,
-        workspacePath: tempDir,
-      }),
-    );
-    t.assert(spyGetContents.called);
-  });
-});
-
-test.serial(
-  "Remote config handles the case where a directory is provided",
-  async (t) => {
-    return await withTmpDir(async (tempDir) => {
-      const dummyResponse = []; // directories are returned as arrays
-      mockGetContents(dummyResponse);
-
-      const repoReference = "octo-org/codeql-config/config.yaml@main";
-      const state = initAllState();
-      try {
-        await configUtils.initConfig(
-          state,
-          createTestInitConfigInputs({
-            configFile: repoReference,
-            tempDir,
-            workspacePath: tempDir,
-          }),
-        );
-        throw new Error("initConfig did not throw error");
-      } catch (err) {
-        t.deepEqual(
-          err,
-          new ConfigurationError(
-            errorMessages.getConfigFileDirectoryGivenMessage(repoReference),
-          ),
-        );
-      }
-    });
-  },
-);
-
-test.serial("Invalid format of remote config handled correctly", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    const dummyResponse = {
-      // note no "content" property here
-    };
-    mockGetContents(dummyResponse);
-
-    const repoReference = "octo-org/codeql-config/config.yaml@main";
-    const state = initAllState();
-    try {
-      await configUtils.initConfig(
-        state,
-        createTestInitConfigInputs({
-          configFile: repoReference,
-          tempDir,
-          workspacePath: tempDir,
-        }),
-      );
-      throw new Error("initConfig did not throw error");
-    } catch (err) {
-      t.deepEqual(
-        err,
-        new ConfigurationError(
-          errorMessages.getConfigFileFormatInvalidMessage(repoReference),
-        ),
-      );
-    }
-  });
-});
-
-test.serial("No detected languages", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    mockListLanguages([]);
-    const codeql = createStubCodeQL({
-      async resolveLanguages() {
-        return { extractors: {} };
-      },
-    });
-
-    const state = initAllState();
-    try {
-      await configUtils.initConfig(
-        state,
-        createTestInitConfigInputs({
-          tempDir,
-          codeql,
-          workspacePath: tempDir,
-        }),
-      );
-      throw new Error("initConfig did not throw error");
-    } catch (err) {
-      t.deepEqual(
-        err,
-        new ConfigurationError(errorMessages.getNoLanguagesError()),
-      );
-    }
-  });
-});
-
-test.serial("Unknown languages", async (t) => {
-  return await withTmpDir(async (tempDir) => {
-    const languagesInput = "rubbish,english";
-
-    const state = initAllState();
-    try {
-      await configUtils.initConfig(
-        state,
-        createTestInitConfigInputs({
-          languagesInput,
-          tempDir,
-          workspacePath: tempDir,
-        }),
-      );
-      throw new Error("initConfig did not throw error");
-    } catch (err) {
-      t.deepEqual(
-        err,
-        new ConfigurationError(
-          errorMessages.getUnknownLanguagesError(["rubbish", "english"]),
-        ),
-      );
-    }
-  });
-});
-
-const mockLogger = getRunnerLogger(true);
-
-test.serial("no generateRegistries when registries is undefined", async (t) => {
-  return await withTmpDir(async (tmpDir) => {
-    const registriesInput = undefined;
-    const logger = getRunnerLogger(true);
-    const { registriesAuthTokens, qlconfigFile } =
-      await configUtils.generateRegistries(registriesInput, tmpDir, logger);
-
-    t.is(registriesAuthTokens, undefined);
-    t.is(qlconfigFile, undefined);
-  });
-});
-
-test.serial(
-  "generateRegistries prefers original CODEQL_REGISTRIES_AUTH",
-  async (t) => {
-    return await withTmpDir(async (tmpDir) => {
-      process.env.CODEQL_REGISTRIES_AUTH = "original";
-      const registriesInput = yaml.dump([
-        {
-          url: "http://ghcr.io",
-          packages: ["codeql/*", "codeql-testing/*"],
-          token: "not-a-token",
-        },
-      ]);
-      const logger = getRunnerLogger(true);
-      const { registriesAuthTokens, qlconfigFile } =
-        await configUtils.generateRegistries(registriesInput, tmpDir, logger);
-
-      t.is(registriesAuthTokens, "original");
-      t.is(qlconfigFile, path.join(tmpDir, "qlconfig.yml"));
-    });
-  },
-);
-
-// getLanguages
-
-const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-// eslint-disable-next-line github/array-foreach
-[
-  {
-    name: "languages from input",
-    languagesInput: "jAvAscript, \n jaVa",
-    languagesInRepository: ["SwiFt", "other"],
-    expectedLanguages: ["javascript", "java"],
-    expectedApiCall: false,
-  },
-  {
-    name: "languages from github api",
-    languagesInput: "",
-    languagesInRepository: ["  jAvAscript\n \t", " jaVa", "SwiFt", "other"],
-    expectedLanguages: ["javascript", "java"],
-    expectedApiCall: true,
-  },
-  {
-    name: "aliases from input",
-    languagesInput: "  typEscript\n \t, C#, c , KoTlin",
-    languagesInRepository: ["SwiFt", "other"],
-    expectedLanguages: ["javascript", "csharp", "cpp", "java"],
-    expectedApiCall: false,
-  },
-  {
-    name: "duplicate languages from input",
-    languagesInput: "jAvAscript, \n jaVa, kotlin, typescript",
-    languagesInRepository: ["SwiFt", "other"],
-    expectedLanguages: ["javascript", "java"],
-    expectedApiCall: false,
-  },
-  {
-    name: "aliases from github api",
-    languagesInput: "",
-    languagesInRepository: ["  typEscript\n \t", " C#", "c", "other"],
-    expectedLanguages: ["javascript", "csharp", "cpp"],
-    expectedApiCall: true,
-  },
-  {
-    name: "unsupported languages from github api",
-    languagesInput: "",
-    languagesInRepository: ["html"],
-    expectedApiCall: true,
-    expectedError: errorMessages.getNoLanguagesError(),
-  },
-  {
-    name: "no languages",
-    languagesInput: "",
-    languagesInRepository: [],
-    expectedApiCall: true,
-    expectedError: errorMessages.getNoLanguagesError(),
-  },
-  {
-    name: "unrecognized languages from input",
-    languagesInput: "a, b, c, javascript",
-    languagesInRepository: [],
-    expectedApiCall: false,
-    expectedError: errorMessages.getUnknownLanguagesError(["a", "b"]),
-  },
-  {
-    name: "extractors that aren't languages aren't included (specified)",
-    languagesInput: "html",
-    languagesInRepository: [],
-    expectedApiCall: false,
-    expectedError: errorMessages.getUnknownLanguagesError(["html"]),
-  },
-  {
-    name: "extractors that aren't languages aren't included (autodetected)",
-    languagesInput: "",
-    languagesInRepository: ["html", "javascript"],
-    expectedApiCall: true,
-    expectedLanguages: ["javascript"],
-  },
-].forEach((args) => {
-  test.serial(`getLanguages: ${args.name}`, async (t) => {
-    const mockRequest = mockLanguagesInRepo(args.languagesInRepository);
-    const stubExtractorEntry = {
-      extractor_root: "",
-    };
-    const codeQL = createStubCodeQL({
-      resolveLanguages: (options) =>
-        Promise.resolve({
-          aliases: {
-            "c#": BuiltInLanguage.csharp,
-            c: BuiltInLanguage.cpp,
-            kotlin: BuiltInLanguage.java,
-            typescript: BuiltInLanguage.javascript,
-          },
-          extractors: {
-            cpp: [stubExtractorEntry],
-            csharp: [stubExtractorEntry],
-            java: [stubExtractorEntry],
-            javascript: [stubExtractorEntry],
-            python: [stubExtractorEntry],
-            ...(options?.filterToLanguagesWithQueries
-              ? {}
-              : {
-                  html: [stubExtractorEntry],
-                }),
-          },
-        }),
-    });
-
-    if (args.expectedLanguages) {
-      // happy path
-      const actualLanguages = await configUtils.getLanguages(
-        codeQL,
-        args.languagesInput,
-        mockRepositoryNwo,
-        ".",
-        mockLogger,
-      );
-
-      t.deepEqual(actualLanguages.sort(), args.expectedLanguages.sort());
-    } else {
-      // there is an error
-      await t.throwsAsync(
-        async () =>
-          await configUtils.getLanguages(
-            codeQL,
-            args.languagesInput,
-            mockRepositoryNwo,
-            ".",
-            mockLogger,
-          ),
-        { message: args.expectedError },
-      );
-    }
-    t.deepEqual(mockRequest.called, args.expectedApiCall);
-  });
-});
-
-for (const { displayName, language, feature } of [
-  {
-    displayName: "Java",
-    language: BuiltInLanguage.java,
-    feature: Feature.DisableJavaBuildlessEnabled,
-  },
-  {
-    displayName: "C#",
-    language: BuiltInLanguage.csharp,
-    feature: Feature.DisableCsharpBuildless,
-  },
-]) {
-  test(`Build mode not overridden when disable ${displayName} buildless feature flag disabled`, async (t) => {
-    const messages: LoggedMessage[] = [];
-    const buildMode = await configUtils.parseBuildModeInput(
-      "none",
-      [language],
-      createFeatures([]),
-      getRecordingLogger(messages),
-    );
-    t.is(buildMode, BuildMode.None);
-    t.deepEqual(messages, []);
-  });
-
-  test(`Build mode not overridden for other languages when disable ${displayName} buildless feature flag enabled`, async (t) => {
-    const messages: LoggedMessage[] = [];
-    const buildMode = await configUtils.parseBuildModeInput(
-      "none",
-      [BuiltInLanguage.python],
-      createFeatures([feature]),
-      getRecordingLogger(messages),
-    );
-    t.is(buildMode, BuildMode.None);
-    t.deepEqual(messages, []);
-  });
-
-  test(`Build mode overridden when analyzing ${displayName} and disable ${displayName} buildless feature flag enabled`, async (t) => {
-    const messages: LoggedMessage[] = [];
-    const buildMode = await configUtils.parseBuildModeInput(
-      "none",
-      [language],
-      createFeatures([feature]),
-      getRecordingLogger(messages),
-    );
-    t.is(buildMode, BuildMode.Autobuild);
-    t.deepEqual(messages, [
-      {
-        message: `Scanning ${displayName} code without a build is temporarily unavailable. Falling back to 'autobuild' build mode.`,
-        type: "warning",
-      },
-    ]);
-  });
-}
-
-interface OverlayDatabaseModeTestSetup {
-  overlayDatabaseEnvVar: string | undefined;
-  features: Feature[];
-  isPullRequest: boolean;
-  isDefaultBranch: boolean;
-  buildMode: BuildMode | undefined;
-  languages: Language[];
-  codeqlVersion: string;
-  gitRoot: string | undefined;
-  gitVersion: GitVersionInfo | undefined;
-  hasSubmodules: boolean;
-  codeScanningConfig: UserConfig;
-  diskUsage: DiskUsage | undefined;
-  memoryFlagValue: number;
-  shouldSkipOverlayAnalysisDueToCachedStatus: boolean;
-  repositoryProperties: RepositoryProperties;
-}
-
-const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = {
-  overlayDatabaseEnvVar: undefined,
-  features: [],
-  isPullRequest: false,
-  isDefaultBranch: false,
-  buildMode: BuildMode.None,
-  languages: [BuiltInLanguage.javascript],
-  codeqlVersion: CODEQL_OVERLAY_MINIMUM_VERSION,
-  gitRoot: "/some/git/root",
-  gitVersion: new GitVersionInfo("2.39.0", "2.39.0"),
-  hasSubmodules: false,
-  codeScanningConfig: {},
-  diskUsage: {
-    numAvailableBytes: 50_000_000_000,
-    numTotalBytes: 100_000_000_000,
-  },
-  memoryFlagValue: 6920,
-  shouldSkipOverlayAnalysisDueToCachedStatus: false,
-  repositoryProperties: {},
-};
-
-const checkOverlayEnablementMacro = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    setupOverrides: Partial,
-    expected:
-      | {
-          overlayDatabaseMode: OverlayDatabaseMode;
-          useOverlayDatabaseCaching: boolean;
-          overlayModeSetExplicitly?: boolean;
-        }
-      | {
-          disabledReason: OverlayDisabledReason;
-        },
-  ) => {
-    return await withTmpDir(async (tempDir) => {
-      const messages: LoggedMessage[] = [];
-      const logger = getRecordingLogger(messages);
-
-      // Save the original environment
-      const originalEnv = { ...process.env };
-
-      try {
-        const setup = {
-          ...defaultOverlayDatabaseModeTestSetup,
-          ...setupOverrides,
-        };
-
-        // Set up environment variable if specified
-        delete process.env.CODEQL_OVERLAY_DATABASE_MODE;
-        if (setup.overlayDatabaseEnvVar !== undefined) {
-          process.env.CODEQL_OVERLAY_DATABASE_MODE =
-            setup.overlayDatabaseEnvVar;
-        }
-
-        sinon.stub(util, "checkDiskUsage").resolves(setup.diskUsage);
-
-        sinon
-          .stub(overlayStatus, "shouldSkipOverlayAnalysis")
-          .resolves(setup.shouldSkipOverlayAnalysisDueToCachedStatus);
-
-        // Mock feature flags
-        const features = createFeatures(setup.features);
-
-        // Mock isAnalyzingPullRequest function
-        sinon
-          .stub(actionsUtil, "isAnalyzingPullRequest")
-          .returns(setup.isPullRequest);
-
-        sinon.stub(util, "getCodeQLMemoryLimit").returns(setup.memoryFlagValue);
-
-        // Set up CodeQL mock
-        const codeql = mockCodeQLVersion(setup.codeqlVersion);
-
-        // Mock traced languages
-        sinon
-          .stub(codeql, "isTracedLanguage")
-          .callsFake(async (lang: Language) => {
-            return lang === BuiltInLanguage.java;
-          });
-
-        // Mock git root detection
-        if (setup.gitRoot !== undefined) {
-          sinon.stub(gitUtils, "getGitRoot").resolves(setup.gitRoot);
-        }
-
-        // Mock submodule detection
-        sinon.stub(gitUtils, "hasSubmodules").returns(setup.hasSubmodules);
-
-        // Mock default branch detection
-        sinon
-          .stub(gitUtils, "isAnalyzingDefaultBranch")
-          .resolves(setup.isDefaultBranch);
-
-        const result = await configUtils.checkOverlayEnablement(
-          codeql,
-          features,
-          setup.languages,
-          tempDir, // sourceRoot
-          setup.buildMode,
-          undefined,
-          setup.codeScanningConfig,
-          setup.repositoryProperties,
-          setup.gitVersion,
-          logger,
-        );
-
-        if ("disabledReason" in expected) {
-          t.deepEqual(result, new Failure(expected.disabledReason));
-        } else {
-          t.deepEqual(
-            result,
-            new Success({
-              overlayModeSetExplicitly: false,
-              ...expected,
-            }),
-          );
-        }
-      } finally {
-        // Restore the original environment
-        process.env = originalEnv;
-      }
-    });
-  },
-  title: (title) => `checkOverlayEnablement: ${title}`,
-});
-
-checkOverlayEnablementMacro.serial(
-  "Environment variable override - Overlay",
-  {
-    overlayDatabaseEnvVar: "overlay",
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: false,
-    overlayModeSetExplicitly: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Environment variable override - OverlayBase",
-  {
-    overlayDatabaseEnvVar: "overlay-base",
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-    useOverlayDatabaseCaching: false,
-    overlayModeSetExplicitly: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Environment variable override - None",
-  {
-    overlayDatabaseEnvVar: "none",
-  },
-  {
-    disabledReason: OverlayDisabledReason.DisabledByEnvironmentVariable,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Ignore invalid environment variable",
-  {
-    overlayDatabaseEnvVar: "invalid-mode",
-  },
-  {
-    disabledReason: OverlayDisabledReason.OverallFeatureNotEnabled,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Ignore feature flag when analyzing non-default branch",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
-  },
-  {
-    disabledReason: OverlayDisabledReason.NotPullRequestOrDefaultBranch,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay-base database on default branch when feature enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
-    isDefaultBranch: true,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay-base database on default branch when feature enabled with custom analysis",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
-    codeScanningConfig: {
-      packs: ["some-custom-pack@1.0.0"],
-    },
-    isDefaultBranch: true,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay-base database on default branch when code-scanning feature enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isDefaultBranch: true,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch if runner disk space is too low",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isDefaultBranch: true,
-    diskUsage: {
-      numAvailableBytes: 1_000_000_000,
-      numTotalBytes: 100_000_000_000,
-    },
-  },
-  {
-    disabledReason: OverlayDisabledReason.InsufficientDiskSpace,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch if we can't determine runner disk space",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isDefaultBranch: true,
-    diskUsage: undefined,
-  },
-  {
-    disabledReason: OverlayDisabledReason.UnableToDetermineDiskUsage,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay-base database on default branch if runner disk space is too low and skip resource checks flag is enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-      Feature.OverlayAnalysisSkipResourceChecks,
-    ],
-    isDefaultBranch: true,
-    diskUsage: {
-      numAvailableBytes: 1_000_000_000,
-      numTotalBytes: 100_000_000_000,
-    },
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch if runner disk space is below minimum",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isDefaultBranch: true,
-    diskUsage: {
-      numAvailableBytes: 5_000_000_000,
-      numTotalBytes: 100_000_000_000,
-    },
-  },
-  {
-    disabledReason: OverlayDisabledReason.InsufficientDiskSpace,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay-base database on default branch if runner disk space is above minimum",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isDefaultBranch: true,
-    diskUsage: {
-      numAvailableBytes: 15_000_000_000,
-      numTotalBytes: 100_000_000_000,
-    },
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch if memory flag is too low",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isDefaultBranch: true,
-    memoryFlagValue: 3072,
-  },
-  {
-    disabledReason: OverlayDisabledReason.InsufficientMemory,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay-base database on default branch if memory flag is too low but CodeQL >= 2.24.3",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isDefaultBranch: true,
-    memoryFlagValue: 3072,
-    codeqlVersion: "2.24.3",
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay-base database on default branch if memory flag is too low and skip resource checks flag is enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-      Feature.OverlayAnalysisSkipResourceChecks,
-    ],
-    isDefaultBranch: true,
-    memoryFlagValue: 3072,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch when cached status indicates previous failure",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisJavascript,
-      Feature.OverlayAnalysisStatusCheck,
-    ],
-    isDefaultBranch: true,
-    shouldSkipOverlayAnalysisDueToCachedStatus: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.SkippedDueToCachedStatus,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR when cached status indicates previous failure",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisJavascript,
-      Feature.OverlayAnalysisStatusCheck,
-    ],
-    isPullRequest: true,
-    shouldSkipOverlayAnalysisDueToCachedStatus: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.SkippedDueToCachedStatus,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch when code-scanning feature enabled with disable-default-queries",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    codeScanningConfig: {
-      "disable-default-queries": true,
-    },
-    isDefaultBranch: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NonDefaultQueries,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch when code-scanning feature enabled with packs",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    codeScanningConfig: {
-      packs: ["some-custom-pack@1.0.0"],
-    },
-    isDefaultBranch: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NonDefaultQueries,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch when code-scanning feature enabled with queries",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    codeScanningConfig: {
-      queries: [{ uses: "some-query.ql" }],
-    },
-    isDefaultBranch: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NonDefaultQueries,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch when code-scanning feature enabled with query-filters",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    codeScanningConfig: {
-      "query-filters": [{ include: { "security-severity": "high" } }],
-    },
-    isDefaultBranch: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NonDefaultQueries,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch when only language-specific feature enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysisJavascript],
-    isDefaultBranch: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.OverallFeatureNotEnabled,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch when only code-scanning feature enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysisCodeScanningJavascript],
-    isDefaultBranch: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.OverallFeatureNotEnabled,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay-base database on default branch when language-specific feature disabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis],
-    isDefaultBranch: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.LanguageNotEnabled,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay analysis on PR when feature enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
-    isPullRequest: true,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay analysis on PR when feature enabled with custom analysis",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
-    codeScanningConfig: {
-      packs: ["some-custom-pack@1.0.0"],
-    },
-    isPullRequest: true,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay analysis on PR when code-scanning feature enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isPullRequest: true,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR if runner disk space is too low",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isPullRequest: true,
-    diskUsage: {
-      numAvailableBytes: 1_000_000_000,
-      numTotalBytes: 100_000_000_000,
-    },
-  },
-  {
-    disabledReason: OverlayDisabledReason.InsufficientDiskSpace,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay analysis on PR if runner disk space is too low and skip resource checks flag is enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-      Feature.OverlayAnalysisSkipResourceChecks,
-    ],
-    isPullRequest: true,
-    diskUsage: {
-      numAvailableBytes: 1_000_000_000,
-      numTotalBytes: 100_000_000_000,
-    },
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR if we can't determine runner disk space",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isPullRequest: true,
-    diskUsage: undefined,
-  },
-  {
-    disabledReason: OverlayDisabledReason.UnableToDetermineDiskUsage,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR if memory flag is too low",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isPullRequest: true,
-    memoryFlagValue: 3072,
-  },
-  {
-    disabledReason: OverlayDisabledReason.InsufficientMemory,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay analysis on PR if memory flag is too low but CodeQL >= 2.24.3",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    isPullRequest: true,
-    memoryFlagValue: 3072,
-    codeqlVersion: "2.24.3",
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay analysis on PR if memory flag is too low and skip resource checks flag is enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-      Feature.OverlayAnalysisSkipResourceChecks,
-    ],
-    isPullRequest: true,
-    memoryFlagValue: 3072,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR when code-scanning feature enabled with disable-default-queries",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    codeScanningConfig: {
-      "disable-default-queries": true,
-    },
-    isPullRequest: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NonDefaultQueries,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR when code-scanning feature enabled with packs",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    codeScanningConfig: {
-      packs: ["some-custom-pack@1.0.0"],
-    },
-    isPullRequest: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NonDefaultQueries,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR when code-scanning feature enabled with queries",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    codeScanningConfig: {
-      queries: [{ uses: "some-query.ql" }],
-    },
-    isPullRequest: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NonDefaultQueries,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR when code-scanning feature enabled with query-filters",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [
-      Feature.OverlayAnalysis,
-      Feature.OverlayAnalysisCodeScanningJavascript,
-    ],
-    codeScanningConfig: {
-      "query-filters": [{ include: { "security-severity": "high" } }],
-    },
-    isPullRequest: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NonDefaultQueries,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR when only language-specific feature enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysisJavascript],
-    isPullRequest: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.OverallFeatureNotEnabled,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR when only code-scanning feature enabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysisCodeScanningJavascript],
-    isPullRequest: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.OverallFeatureNotEnabled,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis on PR when language-specific feature disabled",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis],
-    isPullRequest: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.LanguageNotEnabled,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay PR analysis by env",
-  {
-    overlayDatabaseEnvVar: "overlay",
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: false,
-    overlayModeSetExplicitly: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay PR analysis by env on a runner with low disk space",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    diskUsage: { numAvailableBytes: 0, numTotalBytes: 100_000_000_000 },
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: false,
-    overlayModeSetExplicitly: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay PR analysis by feature flag",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
-    isPullRequest: true,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Fallback due to autobuild with traced language",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    buildMode: BuildMode.Autobuild,
-    languages: [BuiltInLanguage.java],
-  },
-  {
-    disabledReason: OverlayDisabledReason.IncompatibleBuildMode,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Fallback due to no build mode with traced language",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    buildMode: undefined,
-    languages: [BuiltInLanguage.java],
-  },
-  {
-    disabledReason: OverlayDisabledReason.IncompatibleBuildMode,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Fallback due to old CodeQL version",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    codeqlVersion: "2.14.0",
-  },
-  {
-    disabledReason: OverlayDisabledReason.IncompatibleCodeQl,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Fallback due to missing git root",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    gitRoot: undefined,
-  },
-  {
-    disabledReason: OverlayDisabledReason.NoGitRoot,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Fallback due to old git version with submodules",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    gitVersion: new GitVersionInfo("2.34.1", "2.34.1"), // Above 2.11.0 but below 2.36.0
-    hasSubmodules: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.IncompatibleGit,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Fallback when git version cannot be determined and repo has submodules",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    gitVersion: undefined,
-    hasSubmodules: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.IncompatibleGit,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay enabled when git version cannot be determined and repo has no submodules",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    gitVersion: undefined,
-    hasSubmodules: false,
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: false,
-    overlayModeSetExplicitly: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "No overlay when disabled via repository property",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
-    isPullRequest: true,
-    repositoryProperties: {
-      "github-codeql-disable-overlay": true,
-    },
-  },
-  {
-    disabledReason: OverlayDisabledReason.DisabledByRepositoryProperty,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Overlay not disabled when repository property is false",
-  {
-    languages: [BuiltInLanguage.javascript],
-    features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
-    isPullRequest: true,
-    repositoryProperties: {
-      "github-codeql-disable-overlay": false,
-    },
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: true,
-  },
-);
-
-checkOverlayEnablementMacro.serial(
-  "Environment variable override takes precedence over repository property",
-  {
-    overlayDatabaseEnvVar: "overlay",
-    repositoryProperties: {
-      "github-codeql-disable-overlay": true,
-    },
-  },
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    useOverlayDatabaseCaching: false,
-    overlayModeSetExplicitly: true,
-  },
-);
-
-// Exercise language-specific overlay analysis features code paths
-for (const language in BuiltInLanguage) {
-  checkOverlayEnablementMacro.serial(
-    `Check default overlay analysis feature for ${language}`,
-    {
-      languages: [language],
-      features: [Feature.OverlayAnalysis],
-      isPullRequest: true,
-    },
-    {
-      disabledReason: OverlayDisabledReason.LanguageNotEnabled,
-    },
-  );
-}
-
-// Verify that a language without a per-language overlay feature flag cannot have
-// overlay analysis enabled, even when the base overlay feature flag is on.
-// Using swift here as it doesn't currently have overlay support — update this if
-// swift gains overlay support.
-checkOverlayEnablementMacro.serial(
-  "No overlay analysis for language without per-language overlay feature flag",
-  {
-    languages: [BuiltInLanguage.swift],
-    features: [Feature.OverlayAnalysis],
-    isPullRequest: true,
-  },
-  {
-    disabledReason: OverlayDisabledReason.LanguageNotEnabled,
-  },
-);
-
-test.serial(
-  "hasActionsWorkflows doesn't throw if workflows folder doesn't exist",
-  async (t) => {
-    return withTmpDir(async (tmpDir) => {
-      t.notThrows(() => configUtils.hasActionsWorkflows(tmpDir));
-    });
-  },
-);
-
-test.serial("getPrimaryAnalysisConfig - single analysis kind", (t) => {
-  // If only one analysis kind is configured, we expect to get the matching configuration.
-  for (const analysisKind of supportedAnalysisKinds) {
-    const singleKind = createTestConfig({ analysisKinds: [analysisKind] });
-    t.is(configUtils.getPrimaryAnalysisConfig(singleKind).kind, analysisKind);
-  }
-});
-
-test.serial("getPrimaryAnalysisConfig - Code Scanning + Code Quality", (t) => {
-  // For CS+CQ, we expect to get the Code Scanning configuration.
-  const codeScanningAndCodeQuality = createTestConfig({
-    analysisKinds: [AnalysisKind.CodeScanning, AnalysisKind.CodeQuality],
-  });
-  t.is(
-    configUtils.getPrimaryAnalysisConfig(codeScanningAndCodeQuality).kind,
-    AnalysisKind.CodeScanning,
-  );
-});
-
-test.serial(
-  "isTrapCachingEnabled: explicit input true is respected",
-  async (t) => {
-    return await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getOptionalInput")
-        .withArgs("trap-caching")
-        .returns("true");
-      t.true(
-        await configUtils.isTrapCachingEnabled(
-          createFeatures([]),
-          OverlayDatabaseMode.None,
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "isTrapCachingEnabled: disabled on self-hosted runner by default",
-  async (t) => {
-    return await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getOptionalInput")
-        .withArgs("trap-caching")
-        .returns(undefined);
-      t.false(
-        await configUtils.isTrapCachingEnabled(
-          createFeatures([]),
-          OverlayDatabaseMode.None,
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "isTrapCachingEnabled: enabled on hosted runner by default",
-  async (t) => {
-    return await withTmpDir(async (tmpDir) => {
-      const hostedToolCache = path.join(tmpDir, "hostedtoolcache");
-      setupActionsVars(tmpDir, hostedToolCache);
-      sinon
-        .stub(actionsUtil, "getOptionalInput")
-        .withArgs("trap-caching")
-        .returns(undefined);
-      t.true(
-        await configUtils.isTrapCachingEnabled(
-          createFeatures([]),
-          OverlayDatabaseMode.None,
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "isTrapCachingEnabled: enabled on hosted runner when overlay enabled but feature flag off",
-  async (t) => {
-    return await withTmpDir(async (tmpDir) => {
-      const hostedToolCache = path.join(tmpDir, "hostedtoolcache");
-      setupActionsVars(tmpDir, hostedToolCache);
-      sinon
-        .stub(actionsUtil, "getOptionalInput")
-        .withArgs("trap-caching")
-        .returns(undefined);
-      t.true(
-        await configUtils.isTrapCachingEnabled(
-          createFeatures([]),
-          OverlayDatabaseMode.Overlay,
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "isTrapCachingEnabled: disabled on hosted runner when overlay enabled and feature flag on",
-  async (t) => {
-    return await withTmpDir(async (tmpDir) => {
-      const hostedToolCache = path.join(tmpDir, "hostedtoolcache");
-      setupActionsVars(tmpDir, hostedToolCache);
-      sinon
-        .stub(actionsUtil, "getOptionalInput")
-        .withArgs("trap-caching")
-        .returns(undefined);
-      t.false(
-        await configUtils.isTrapCachingEnabled(
-          createFeatures([Feature.OverlayAnalysisDisableTrapCaching]),
-          OverlayDatabaseMode.Overlay,
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "isTrapCachingEnabled: enabled on hosted runner when overlay is None even with feature flag on",
-  async (t) => {
-    return await withTmpDir(async (tmpDir) => {
-      const hostedToolCache = path.join(tmpDir, "hostedtoolcache");
-      setupActionsVars(tmpDir, hostedToolCache);
-      sinon
-        .stub(actionsUtil, "getOptionalInput")
-        .withArgs("trap-caching")
-        .returns(undefined);
-      t.true(
-        await configUtils.isTrapCachingEnabled(
-          createFeatures([Feature.OverlayAnalysisDisableTrapCaching]),
-          OverlayDatabaseMode.None,
-        ),
-      );
-    });
-  },
-);
-
-test("applyIncrementalAnalysisSettings: no-op when mode is not Overlay and diff ranges are unavailable", async (t) => {
-  const config = createTestConfig({});
-  config.overlayDatabaseMode = OverlayDatabaseMode.None;
-  const codeql = createStubCodeQL({});
-  const logger = getRunnerLogger(true);
-
-  await configUtils.applyIncrementalAnalysisSettings(
-    config,
-    false,
-    codeql,
-    logger,
-  );
-
-  t.is(config.overlayDatabaseMode, OverlayDatabaseMode.None);
-  t.deepEqual(config.extraQueryExclusions, []);
-});
-
-test("applyIncrementalAnalysisSettings: keeps overlay mode and adds exclusions when diff ranges are available", async (t) => {
-  const config = createTestConfig({
-    overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-  });
-  const codeql = createStubCodeQL({});
-  const logger = getRunnerLogger(true);
-
-  await configUtils.applyIncrementalAnalysisSettings(
-    config,
-    true,
-    codeql,
-    logger,
-  );
-
-  t.is(config.overlayDatabaseMode, OverlayDatabaseMode.Overlay);
-  t.deepEqual(config.extraQueryExclusions, [
-    { exclude: { tags: "exclude-from-incremental" } },
-  ]);
-});
-
-test.serial(
-  "applyIncrementalAnalysisSettings: disables overlay analysis when diff ranges are unavailable",
-  async (t) => {
-    const config = createTestConfig({
-      overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    });
-    config.useOverlayDatabaseCaching = true;
-    const codeql = createStubCodeQL({});
-    const logger = getRunnerLogger(true);
-    const addDiagnosticsStub = sinon
-      .stub(overlayDiagnostics, "addOverlayDisablementDiagnostics")
-      .resolves();
-
-    await configUtils.applyIncrementalAnalysisSettings(
-      config,
-      false,
-      codeql,
-      logger,
-    );
-
-    t.is(config.overlayDatabaseMode, OverlayDatabaseMode.None);
-    t.is(config.useOverlayDatabaseCaching, false);
-    t.deepEqual(config.extraQueryExclusions, []);
-    t.true(addDiagnosticsStub.calledOnce);
-    t.is(
-      addDiagnosticsStub.firstCall.args[2],
-      OverlayDisabledReason.DiffInformedAnalysisNotEnabled,
-    );
-  },
-);
-
-test.serial(
-  "applyIncrementalAnalysisSettings: keeps overlay mode when set explicitly and diff ranges are unavailable",
-  async (t) => {
-    const config = createTestConfig({
-      overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-    });
-    config.useOverlayDatabaseCaching = false;
-    config.overlayModeSetExplicitly = true;
-    const codeql = createStubCodeQL({});
-    const logger = getRunnerLogger(true);
-    const addDiagnosticsStub = sinon
-      .stub(overlayDiagnostics, "addOverlayDisablementDiagnostics")
-      .resolves();
-
-    await configUtils.applyIncrementalAnalysisSettings(
-      config,
-      false,
-      codeql,
-      logger,
-    );
-
-    t.is(config.overlayDatabaseMode, OverlayDatabaseMode.Overlay);
-    t.is(config.useOverlayDatabaseCaching, false);
-    t.deepEqual(config.extraQueryExclusions, []);
-    t.true(addDiagnosticsStub.notCalled);
-  },
-);
-
-test("applyIncrementalAnalysisSettings: adds exclusions for diff-informed-only runs", async (t) => {
-  const config = createTestConfig({});
-  config.overlayDatabaseMode = OverlayDatabaseMode.None;
-  const codeql = createStubCodeQL({});
-  const logger = getRunnerLogger(true);
-
-  await configUtils.applyIncrementalAnalysisSettings(
-    config,
-    true,
-    codeql,
-    logger,
-  );
-
-  t.is(config.overlayDatabaseMode, OverlayDatabaseMode.None);
-  t.deepEqual(config.extraQueryExclusions, [
-    { exclude: { tags: "exclude-from-incremental" } },
-  ]);
-});
-
-test("determineUserConfig - empty config when neither input is specified", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const target = callee(configUtils.determineUserConfig)
-      .withDefaultActionsEnv()
-      .withFeatures([])
-      .withArgs(
-        tmpDir,
-        createTestInitConfigInputs({
-          configInput: undefined,
-          configFile: undefined,
-          workspacePath: tmpDir,
-        }),
-      );
-
-    // The returned configuration should be empty.
-    await target
-      // The fact that no configuration was provided should have been logged,
-      .logs(t, "No configuration file was provided")
-      // But not the messages for the two input sources
-      // or the warning about both inputs.
-      .notLogs(
-        t,
-        "Using config from action input:",
-        "Using configuration file:",
-        "Both a config file and config input were provided. Ignoring config file.",
-      )
-      .passes(t.deepEqual, {});
-  });
-});
-
-test("determineUserConfig - loads config file", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const configFilePath = createConfigFile(simpleConfigFileContents, tmpDir);
-
-    const inputs = createTestInitConfigInputs({
-      configInput: undefined,
-      configFile: configFilePath,
-      workspacePath: tmpDir,
-    });
-    const target = callee(configUtils.determineUserConfig)
-      .withDefaultActionsEnv()
-      .withArgs(tmpDir, inputs);
-
-    await target
-      // The path of the input config file should have been logged,
-      .logs(t, `Using configuration file: ${configFilePath}`)
-      .notLogs(
-        t,
-        // The other two origin messages and the warning about both inputs should
-        // not have been logged.
-        "No configuration file was provided",
-        "Using config from action input:",
-        "Both a config file and config input were provided. Ignoring config file.",
-      )
-      // The loaded configuration should match `simpleConfigFileContents`.
-      .passes(t.deepEqual, {
-        name: "my config",
-        queries: [{ uses: "./foo_file" }],
-      });
-
-    // The `configFile` input should not have changed.
-    t.is(inputs.configFile, configFilePath);
-  });
-});
-
-test("determineUserConfig - loads config input", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const expectedConfigPath = configUtils.userConfigFromActionPath(tmpDir);
-
-    const inputs = createTestInitConfigInputs({
-      configInput: simpleConfigFileContents,
-      configFile: undefined,
-      workspacePath: tmpDir,
-    });
-    const target = callee(configUtils.determineUserConfig)
-      .withDefaultActionsEnv()
-      .withArgs(tmpDir, inputs);
-
-    await target
-      // The input source and path of the generated config file should have been logged.
-      .logs(
-        t,
-        "Using config from action input:",
-        `Using configuration file: ${expectedConfigPath}`,
-      )
-      // The message about no configuration input and
-      // the warning about both inputs should not have been logged.
-      .notLogs(
-        t,
-        "No configuration file was provided",
-        "Both a config file and config input were provided. Ignoring config file.",
-      )
-      // The loaded configuration should match `simpleConfigFileContents`.
-      .passes(t.deepEqual, {
-        name: "my config",
-        queries: [{ uses: "./foo_file" }],
-      });
-
-    // The `configFile` input should have been mutated to the generated path.
-    t.is(inputs.configFile, expectedConfigPath);
-  });
-});
-
-test("determineUserConfig - ignores config file input when both specified", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const configFilePath = createConfigFile(otherConfigFileContents, tmpDir);
-    const expectedConfigPath = configUtils.userConfigFromActionPath(tmpDir);
-
-    const inputs = createTestInitConfigInputs({
-      configInput: simpleConfigFileContents,
-      configFile: configFilePath,
-      workspacePath: tmpDir,
-    });
-    const target = callee(configUtils.determineUserConfig)
-      .withDefaultActionsEnv()
-      .withArgs(tmpDir, inputs);
-
-    await target
-      // The path of the generated config file and
-      // the warning about both inputs should have been logged.
-      .logs(
-        t,
-        `Using config from action input: ${expectedConfigPath}`,
-        `Using configuration file: ${expectedConfigPath}`,
-        "Both a config file and config input were provided. Ignoring config file.",
-      )
-      .notLogs(t, "No configuration file was provided")
-      // The loaded configuration should match `simpleConfigFileContents`.
-      .passes(t.deepEqual, {
-        name: "my config",
-        queries: [{ uses: "./foo_file" }],
-      });
-
-    // The `configFile` input should have been mutated to the generated path.
-    t.is(inputs.configFile, expectedConfigPath);
-  });
-});
-
-/** A `config` input that we might get from Default Setup. */
-const defaultSetupConfigInput = `
-  threat-models: [local, remote]
-  default-setup:
-    org:
-      model-packs: [foo, bar]`;
-
-test("determineUserConfig - merges configs if FF is enabled in Default Setup", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const configFilePath = createConfigFile(simpleConfigFileContents, tmpDir);
-    const expectedConfigPath = configUtils.userConfigFromActionPath(tmpDir);
-
-    const inputs = createTestInitConfigInputs({
-      configInput: defaultSetupConfigInput,
-      configFile: configFilePath,
-      workspacePath: tmpDir,
-    });
-    const target = callee(configUtils.determineUserConfig)
-      .withDefaultActionsEnv({ GITHUB_EVENT_NAME: "dynamic" })
-      .withFeatures([Feature.AllowMergeConfigFiles])
-      .withArgs(tmpDir, inputs);
-
-    // The loaded configuration should match the result of merging
-    // `defaultSetupConfigInput` and `simpleConfigFileContents`.
-    const expectedConfig = {
-      name: "my config",
-      queries: [{ uses: "./foo_file" }],
-      "threat-models": ["local", "remote"],
-      "default-setup": {
-        org: {
-          "model-packs": ["foo", "bar"],
-        },
-      },
-    } satisfies UserConfig;
-
-    await target
-      .logs(
-        t,
-        `Using merged configurations from 'config' input with configuration from '${configFilePath}': ${expectedConfigPath}`,
-      )
-      .notLogs(
-        t,
-        `Using configuration file: ${expectedConfigPath}`,
-        "No configuration file was provided",
-        `Using config from action input: ${expectedConfigPath}`,
-        "Both a config file and config input were provided. Ignoring config file.",
-      )
-      .passes(t.deepEqual, expectedConfig);
-
-    // The `configFile` input should have been mutated to the generated path.
-    t.is(inputs.configFile, expectedConfigPath);
-
-    // Since `result` is the result of merging the configurations in-memory,
-    // also check whether loading the configuration from disk that was written
-    // by `determineUserConfig` matches our expectations.
-    const loadedFromDisk = configUtils.getLocalConfig(
-      getRunnerLogger(true),
-      expectedConfigPath,
-      false,
-    );
-    t.deepEqual(loadedFromDisk, expectedConfig);
-  });
-});
-
-test("determineUserConfig - ignores config file input in Default Setup if FF is off", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const configFilePath = createConfigFile(otherConfigFileContents, tmpDir);
-    const expectedConfigPath = configUtils.userConfigFromActionPath(tmpDir);
-
-    const target = callee(configUtils.determineUserConfig)
-      .withDefaultActionsEnv({ GITHUB_EVENT_NAME: "dynamic" })
-      .withArgs(
-        tmpDir,
-        createTestInitConfigInputs({
-          configInput: simpleConfigFileContents,
-          configFile: configFilePath,
-          workspacePath: tmpDir,
-        }),
-      );
-
-    await target
-      .logs(
-        t,
-        `Using config from action input: ${expectedConfigPath}`,
-        `Using configuration file: ${expectedConfigPath}`,
-        "Both a config file and config input were provided. Ignoring config file.",
-      )
-      .notLogs(t, "No configuration file was provided")
-      .passes(t.deepEqual, {
-        name: "my config",
-        queries: [{ uses: "./foo_file" }],
-      });
-  });
-});
-
-test("determineUserConfig - ignores config file input outside Default Setup if FF is on", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const configFilePath = createConfigFile(otherConfigFileContents, tmpDir);
-    const expectedConfigPath = configUtils.userConfigFromActionPath(tmpDir);
-
-    const target = callee(configUtils.determineUserConfig)
-      .withDefaultActionsEnv()
-      .withFeatures([Feature.AllowMergeConfigFiles])
-      .withArgs(
-        tmpDir,
-        createTestInitConfigInputs({
-          configInput: simpleConfigFileContents,
-          configFile: configFilePath,
-          workspacePath: tmpDir,
-        }),
-      );
-
-    await target
-      .logs(
-        t,
-        `Using config from action input: ${expectedConfigPath}`,
-        `Using configuration file: ${expectedConfigPath}`,
-        "Both a config file and config input were provided. Ignoring config file.",
-      )
-      .notLogs(t, "No configuration file was provided")
-      .passes(t.deepEqual, {
-        name: "my config",
-        queries: [{ uses: "./foo_file" }],
-      });
-  });
-});
-
-test("loadUserConfig - loads local configuration files", async (t) => {
-  await withTmpDir(async (workspaceDir) => {
-    await withTmpDir(async (tmpDir) => {
-      // Construct the test target.
-      const loadUserConfig = (
-        actionState: ActionState<["Logger", "Env", "FeatureFlags"]>,
-        filePath: string,
-      ) =>
-        configUtils.loadUserConfig(
-          actionState,
-          filePath,
-          workspaceDir,
-          SAMPLE_DOTCOM_API_DETAILS,
-          tmpDir,
-        );
-      const target = callee(loadUserConfig);
-
-      // `loadUserConfig` should load local configuration files if they are inside the workspace:
-      const insideOfWorkspace = path.join(workspaceDir, "some-file.yml");
-      fs.writeFileSync(insideOfWorkspace, "test-key: present", "utf8");
-
-      await target
-        .withArgs(insideOfWorkspace)
-        .passes(t.deepEqual, { "test-key": "present" });
-
-      // `loadUserConfig` should normally throw if the path is outside of the workspace:
-      const outsideOfWorkspace = path.join(
-        tmpDir,
-        "not-the-generated-file.yml",
-      );
-      fs.writeFileSync(outsideOfWorkspace, "test-key: present", "utf8");
-
-      await target
-        .withArgs(outsideOfWorkspace)
-        .throws(t, { instanceOf: ConfigurationError });
-
-      // `loadUserConfig` does not throw if the path is the result of `userConfigFromActionPath`:
-      const generatedPath = configUtils.userConfigFromActionPath(tmpDir);
-      fs.writeFileSync(generatedPath, "test-key: present", "utf8");
-
-      await target
-        .withArgs(generatedPath)
-        .passes(t.deepEqual, { "test-key": "present" });
-    });
-  });
-});
-
-test.serial("loadUserConfig - loads remote configuration files", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const getRemoteConfig = sinon.stub(file, "getRemoteConfig").resolves({});
-
-    const remoteAddress = "owner/repo/file@ref";
-    await callee(configUtils.loadUserConfig)
-      .withArgs(remoteAddress, tmpDir, SAMPLE_DOTCOM_API_DETAILS, tmpDir)
-      .passes(t.deepEqual, {});
-
-    t.true(
-      getRemoteConfig.calledOnceWithExactly(
-        sinon.match.any,
-        remoteAddress,
-        SAMPLE_DOTCOM_API_DETAILS,
-      ),
-    );
-  });
-});
-
-test.serial(
-  "loadUserConfig - loads remote configuration files (new format, partial)",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const getRemoteConfig = sinon.stub(file, "getRemoteConfig").resolves({});
-
-      // Construct the basic test target.
-      const target = callee(configUtils.loadUserConfig).withDefaultActionsEnv();
-
-      // Utility function to assert that `targetWithArgs` has identified
-      // the input as a remote file address.
-      const checkIsRemote =
-        (address: string) =>
-        async (targetWithArgs: AssertableTarget) => {
-          // We have stubbed `getRemoteConfig` to resolve to `{}`, so we
-          // expect that result.
-          await targetWithArgs.passes(t.deepEqual, {});
-
-          // And `getRemoteConfig` should have been called exactly once.
-          t.is(getRemoteConfig.callCount, 1);
-
-          // Get the arguments for the call and check that there were three.
-          // We don't care about the first, but check that the other two
-          // match our expectations. We break it down like this to get
-          // more useful test output.
-          const args = getRemoteConfig.getCalls()[0].args;
-          t.is(args.length, 3);
-          t.deepEqual(args[1], address);
-          t.deepEqual(args[2], SAMPLE_DOTCOM_API_DETAILS);
-        };
-
-      // Utility function to assert that `targetWithArgs` has not identified
-      // the input as a remote file address.
-      const checkIsNotRemote = async (
-        targetWithArgs: AssertableTarget,
-      ) => {
-        // We expect `loadUserConfig` to have thrown if it thinks the path is local,
-        // since the inputs we provide aren't for files that exist.
-        await targetWithArgs.throws(t);
-
-        // Additionally, we expect that `getRemoteConfig` wasn't called.
-        t.is(getRemoteConfig.callCount, 0);
-      };
-
-      // Utility function to add the explicit `REMOTE_PATH_PREFIX` to the input.
-      const withExplicitPrefix = (str: string) =>
-        `${file.REMOTE_PATH_PREFIX}${str}`;
-
-      // Utility to set up a call to `loadUserConfig` with the provided `address`
-      // and pass it to `assertion`.
-      const testTargetWith = async (
-        address: string,
-        assertion: (
-          targetWithArgs: AssertableTarget>,
-        ) => Promise,
-      ) => {
-        // Reset the stub's history since we re-use it.
-        getRemoteConfig.resetHistory();
-
-        // Log the input we are testing so that, in the event of a failure,
-        // it is easier to see which input was responsible.
-        t.log(`testTargetWith("${address}")`);
-
-        // Prepare the test call to `loadUserConfig`.
-        const targetWithArgs = target.withArgs(
-          address,
-          tmpDir,
-          SAMPLE_DOTCOM_API_DETAILS,
-          tmpDir,
-        );
-
-        // Pass it to the provided assertion function.
-        await assertion(targetWithArgs);
-      };
-
-      // Since this input contains an '@' character, it is treated as a remote path
-      // by the old logic even without the explicit prefix.
-      const remoteWithoutPrefix = "repo@main";
-      await testTargetWith(
-        remoteWithoutPrefix,
-        checkIsRemote(remoteWithoutPrefix),
-      );
-      await testTargetWith(
-        withExplicitPrefix(remoteWithoutPrefix),
-        checkIsRemote(remoteWithoutPrefix),
-      );
-      // It is only treated as a local path with the corresponding prefix.
-      await testTargetWith(`./${remoteWithoutPrefix}`, checkIsNotRemote);
-
-      // The following test inputs are examples of ambiguous paths. They could refer to
-      // valid local or remote paths. For each, we check that they are treated as remote
-      // paths if the explicit remote file prefix is used and as local paths otherwise.
-      const testInputs = ["repo:file", "input", "../input"];
-
-      for (const testInput of testInputs) {
-        for (const addPrefix of [true, false]) {
-          await testTargetWith(
-            addPrefix ? withExplicitPrefix(testInput) : testInput,
-            addPrefix ? checkIsRemote(testInput) : checkIsNotRemote,
-          );
-        }
-      }
-    });
-  },
-);
diff --git a/src/config-utils.ts b/src/config-utils.ts
deleted file mode 100644
index 6d1efaa1ba..0000000000
--- a/src/config-utils.ts
+++ /dev/null
@@ -1,1648 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-import { performance } from "perf_hooks";
-
-import * as core from "@actions/core";
-import * as yaml from "js-yaml";
-
-import { ActionState } from "./action-common";
-import {
-  getActionVersion,
-  getOptionalInput,
-  isAnalyzingPullRequest,
-  isDefaultSetup,
-  isDynamicWorkflow,
-} from "./actions-util";
-import {
-  AnalysisConfig,
-  AnalysisKind,
-  codeQualityQueries,
-  getAnalysisConfig,
-} from "./analyses";
-import * as api from "./api-client";
-import { getCachingKind } from "./caching-utils";
-import { type CodeQL } from "./codeql";
-import { type Config } from "./config/action-config";
-import {
-  calculateAugmentation,
-  ExcludeQueryFilter,
-  generateCodeScanningConfig,
-  mergeDefaultSetupAndUserConfigs,
-  parseUserConfig,
-  UserConfig,
-} from "./config/db-config";
-import {
-  getRemoteConfig,
-  LOCAL_PATH_PREFIX,
-  REMOTE_PATH_PREFIX,
-} from "./config/file";
-import {
-  parseRegistries,
-  type RegistryConfigNoCredentials,
-  type RegistryConfigWithCredentials,
-} from "./config/pack-registries";
-import {
-  addNoLanguageDiagnostic,
-  makeTelemetryDiagnostic,
-} from "./diagnostics";
-import { prepareDiffInformedAnalysis } from "./diff-informed-analysis-utils";
-import { EnvVar } from "./environment";
-import * as errorMessages from "./error-messages";
-import { Feature, FeatureEnablement } from "./feature-flags";
-import {
-  RepositoryProperties,
-  RepositoryPropertyName,
-} from "./feature-flags/properties";
-import {
-  getGeneratedFiles,
-  getGitRoot,
-  getGitVersionOrThrow,
-  GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES,
-  GitVersionInfo,
-  hasSubmodules,
-  isAnalyzingDefaultBranch,
-} from "./git-utils";
-import { BuiltInLanguage, Language } from "./languages";
-import { Logger } from "./logging";
-import { CODEQL_OVERLAY_MINIMUM_VERSION } from "./overlay";
-import {
-  addOverlayDisablementDiagnostics,
-  OverlayDisabledReason,
-} from "./overlay/diagnostics";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import { shouldSkipOverlayAnalysis } from "./overlay/status";
-import { RepositoryNwo } from "./repository";
-import { ToolsFeature } from "./tools-features";
-import { downloadTrapCaches } from "./trap-caching";
-import {
-  GitHubVersion,
-  ConfigurationError,
-  BuildMode,
-  codeQlVersionAtLeast,
-  cloneObject,
-  isDefined,
-  checkDiskUsage,
-  getCodeQLMemoryLimit,
-  getErrorMessage,
-  isInTestMode,
-  joinAtMost,
-  DiskUsage,
-  Result,
-  Success,
-  Failure,
-  isHostedRunner,
-} from "./util";
-
-export { type Config } from "./config/action-config";
-
-/**
- * The minimum available disk space (in MB) required to perform overlay analysis.
- * If the available disk space on the runner is below the threshold when deciding
- * whether to perform overlay analysis, then the action will not perform overlay
- * analysis unless overlay analysis has been explicitly enabled via environment
- * variable.
- */
-const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 14000;
-const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES =
-  OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1_000_000;
-
-/**
- * The minimum memory (in MB) that must be available for CodeQL to perform overlay analysis. If
- * CodeQL will be given less memory than this threshold, then the action will not perform overlay
- * analysis unless overlay analysis has been explicitly enabled via environment variable.
- *
- * This check is not performed for CodeQL >= `CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE` since
- * improved memory usage in that version makes the check unnecessary.
- */
-const OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024;
-
-/**
- * Versions 2.24.3+ of CodeQL reduce overlay analysis's peak RAM usage.
- *
- * In particular, RAM usage with overlay analysis enabled should generally be no higher than it is
- * without overlay analysis for these versions.
- */
-const CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE = "2.24.3";
-
-async function getSupportedLanguageMap(
-  codeql: CodeQL,
-  logger: Logger,
-): Promise> {
-  const resolveSupportedLanguagesUsingCli = await codeql.supportsFeature(
-    ToolsFeature.BuiltinExtractorsSpecifyDefaultQueries,
-  );
-  const resolveResult = await codeql.resolveLanguages({
-    filterToLanguagesWithQueries: resolveSupportedLanguagesUsingCli,
-  });
-  if (resolveSupportedLanguagesUsingCli) {
-    logger.debug(
-      `The CodeQL CLI supports the following languages: ${Object.keys(resolveResult.extractors).join(", ")}`,
-    );
-  }
-  const supportedLanguages: Record = {};
-  // Populate canonical language names
-  for (const extractor of Object.keys(resolveResult.extractors)) {
-    // If the CLI supports resolving languages with default queries, use these
-    // as the set of supported languages. Otherwise, require the language to be
-    // a built-in language.
-    if (
-      resolveSupportedLanguagesUsingCli ||
-      BuiltInLanguage[extractor] !== undefined
-    ) {
-      supportedLanguages[extractor] = extractor;
-    }
-  }
-  // Populate language aliases
-  if (resolveResult.aliases) {
-    for (const [alias, extractor] of Object.entries(resolveResult.aliases)) {
-      supportedLanguages[alias] = extractor;
-    }
-  }
-  return supportedLanguages;
-}
-
-const baseWorkflowsPath = ".github/workflows";
-
-/**
- * Determines if there exists a `.github/workflows` directory with at least
- * one file in it, which we use as an indicator that there are Actions
- * workflows in the workspace. This doesn't perfectly detect whether there
- * are actually workflows, but should be a good approximation.
- *
- * Alternatively, we could check specifically for yaml files, or call the
- * API to check if it knows about workflows.
- *
- * @returns True if the non-empty directory exists, false if not.
- */
-export function hasActionsWorkflows(sourceRoot: string): boolean {
-  const workflowsPath = path.resolve(sourceRoot, baseWorkflowsPath);
-  const stats = fs.lstatSync(workflowsPath, { throwIfNoEntry: false });
-  return (
-    stats !== undefined &&
-    stats.isDirectory() &&
-    fs.readdirSync(workflowsPath).length > 0
-  );
-}
-
-/**
- * Gets the set of languages in the current repository.
- */
-async function getRawLanguagesInRepo(
-  repository: RepositoryNwo,
-  sourceRoot: string,
-  logger: Logger,
-): Promise {
-  logger.debug(
-    `Automatically detecting languages (${repository.owner}/${repository.repo})`,
-  );
-  const response = await api.getApiClient().rest.repos.listLanguages({
-    owner: repository.owner,
-    repo: repository.repo,
-  });
-
-  logger.debug(`Languages API response: ${JSON.stringify(response)}`);
-  const result = Object.keys(response.data as Record).map(
-    (language) => language.trim().toLowerCase(),
-  );
-
-  if (hasActionsWorkflows(sourceRoot)) {
-    logger.debug(`Found a .github/workflows directory`);
-    result.push("actions");
-  }
-
-  logger.debug(`Raw languages in repository: ${result.join(", ")}`);
-
-  return result;
-}
-
-/**
- * Get the languages to analyse.
- *
- * The result is obtained from the action input parameter 'languages' if that
- * has been set, otherwise it is deduced as all languages in the repo that
- * can be analysed.
- *
- * If no languages could be detected from either the workflow or the repository
- * then throw an error.
- */
-export async function getLanguages(
-  codeql: CodeQL,
-  languagesInput: string | undefined,
-  repository: RepositoryNwo,
-  sourceRoot: string,
-  logger: Logger,
-): Promise {
-  // Obtain languages without filtering them.
-  const { rawLanguages, autodetected } = await getRawLanguages(
-    languagesInput,
-    repository,
-    sourceRoot,
-    logger,
-  );
-
-  const languageMap = await getSupportedLanguageMap(codeql, logger);
-  const languagesSet = new Set();
-  const unknownLanguages: string[] = [];
-
-  // Make sure they are supported
-  for (const language of rawLanguages) {
-    const extractorName = languageMap[language];
-    if (extractorName === undefined) {
-      unknownLanguages.push(language);
-    } else {
-      languagesSet.add(extractorName);
-    }
-  }
-
-  const languages = Array.from(languagesSet);
-
-  if (!autodetected && unknownLanguages.length > 0) {
-    throw new ConfigurationError(
-      errorMessages.getUnknownLanguagesError(unknownLanguages),
-    );
-  }
-
-  // If the languages parameter was not given and no languages were
-  // detected then fail here as this is a workflow configuration error.
-  if (languages.length === 0) {
-    throw new ConfigurationError(errorMessages.getNoLanguagesError());
-  }
-
-  if (autodetected) {
-    logger.info(`Autodetected languages: ${languages.join(", ")}`);
-  } else {
-    logger.info(`Languages from configuration: ${languages.join(", ")}`);
-  }
-
-  return languages;
-}
-
-/** Splits the `languages` input into a list of raw languages without checking if they are supported by CodeQL. */
-export function getRawLanguagesNoAutodetect(
-  languagesInput: string | undefined,
-): string[] {
-  return (languagesInput || "")
-    .split(",")
-    .map((x) => x.trim().toLowerCase())
-    .filter((x) => x.length > 0);
-}
-
-/**
- * Gets the set of languages in the current repository without checking to
- * see if these languages are actually supported by CodeQL.
- *
- * @param languagesInput The languages from the workflow input
- * @param repository the owner/name of the repository
- * @param logger a logger
- * @returns A tuple containing a list of languages in this repository that might be
- * analyzable and whether or not this list was determined automatically.
- */
-async function getRawLanguages(
-  languagesInput: string | undefined,
-  repository: RepositoryNwo,
-  sourceRoot: string,
-  logger: Logger,
-): Promise<{
-  rawLanguages: string[];
-  autodetected: boolean;
-}> {
-  // If the user has specified languages, use those.
-  const languagesFromInput = getRawLanguagesNoAutodetect(languagesInput);
-  if (languagesFromInput.length > 0) {
-    return { rawLanguages: languagesFromInput, autodetected: false };
-  }
-  // Otherwise, autodetect languages in the repository.
-  return {
-    rawLanguages: await getRawLanguagesInRepo(repository, sourceRoot, logger),
-    autodetected: true,
-  };
-}
-
-/** Inputs required to initialize a configuration. */
-export interface InitConfigInputs {
-  languagesInput: string | undefined;
-  queriesInput: string | undefined;
-  packsInput: string | undefined;
-  configFile: string | undefined;
-  dbLocation: string | undefined;
-  configInput: string | undefined;
-  buildModeInput: string | undefined;
-  ramInput: string | undefined;
-  dependencyCachingEnabled: string | undefined;
-  debugMode: boolean;
-  debugArtifactName: string;
-  debugDatabaseName: string;
-  repository: RepositoryNwo;
-  tempDir: string;
-  codeql: CodeQL;
-  workspacePath: string;
-  sourceRoot: string;
-  githubVersion: GitHubVersion;
-  apiDetails: api.GitHubApiCombinedDetails;
-  features: FeatureEnablement;
-  repositoryProperties: RepositoryProperties;
-  enableFileCoverageInformation: boolean;
-  analysisKinds: AnalysisKind[];
-  logger: Logger;
-}
-
-/**
- * Initialise the CodeQL Action state, which includes the base configuration for the Action
- * and computes the configuration for the CodeQL CLI.
- */
-export async function initActionState(
-  {
-    languagesInput,
-    queriesInput,
-    packsInput,
-    buildModeInput,
-    dbLocation,
-    dependencyCachingEnabled,
-    debugMode,
-    debugArtifactName,
-    debugDatabaseName,
-    repository,
-    tempDir,
-    codeql,
-    sourceRoot,
-    githubVersion,
-    features,
-    repositoryProperties,
-    analysisKinds,
-    logger,
-    enableFileCoverageInformation,
-  }: InitConfigInputs,
-  userConfig: UserConfig,
-): Promise {
-  const languages = await getLanguages(
-    codeql,
-    languagesInput,
-    repository,
-    sourceRoot,
-    logger,
-  );
-
-  const buildMode = await parseBuildModeInput(
-    buildModeInput,
-    languages,
-    features,
-    logger,
-  );
-
-  const augmentationProperties = await calculateAugmentation(
-    packsInput,
-    queriesInput,
-    repositoryProperties,
-    languages,
-  );
-
-  // If `code-quality` is the only enabled analysis kind, we don't support query customisation.
-  // It would be a problem if queries that are configured in repository properties cause `code-quality`-only
-  // analyses to break. We therefore ignore query customisations that are configured in repository properties
-  // if `code-quality` is the only enabled analysis kind.
-  if (
-    analysisKinds.length === 1 &&
-    analysisKinds.includes(AnalysisKind.CodeQuality) &&
-    augmentationProperties.repoPropertyQueries.input
-  ) {
-    logger.info(
-      `Ignoring queries configured in the repository properties, because query customisations are not supported for Code Quality analyses.`,
-    );
-    augmentationProperties.repoPropertyQueries = {
-      combines: false,
-      input: undefined,
-    };
-  }
-
-  // Compute the full Code Scanning configuration that combines the configuration from the
-  // configuration file / `config` input with other inputs, such as `queries`.
-  const computedConfig = generateCodeScanningConfig(
-    logger,
-    userConfig,
-    augmentationProperties,
-  );
-
-  return {
-    version: getActionVersion(),
-    analysisKinds,
-    languages,
-    buildMode,
-    originalUserInput: userConfig,
-    computedConfig,
-    tempDir,
-    codeQLCmd: codeql.getPath(),
-    gitHubVersion: githubVersion,
-    dbLocation: dbLocationOrDefault(dbLocation, tempDir),
-    debugMode,
-    debugArtifactName,
-    debugDatabaseName,
-    trapCaches: {},
-    trapCacheDownloadTime: 0,
-    dependencyCachingEnabled: getCachingKind(dependencyCachingEnabled),
-    dependencyCachingRestoredKeys: [],
-    extraQueryExclusions: [],
-    overlayDatabaseMode: OverlayDatabaseMode.None,
-    useOverlayDatabaseCaching: false,
-    overlayModeSetExplicitly: false,
-    repositoryProperties,
-    enableFileCoverageInformation,
-  };
-}
-
-async function downloadCacheWithTime(
-  codeQL: CodeQL,
-  languages: Language[],
-  logger: Logger,
-): Promise<{
-  trapCaches: { [language: string]: string };
-  trapCacheDownloadTime: number;
-}> {
-  const start = performance.now();
-  const trapCaches = await downloadTrapCaches(codeQL, languages, logger);
-  const trapCacheDownloadTime = performance.now() - start;
-  return { trapCaches, trapCacheDownloadTime };
-}
-
-/**
- * Loads a CLI configuration file from `configFile`.
- *
- * @param actionState The Action state.
- * @param configFile The address of the configuration file.
- * @param workspacePath The workspace path, used to check that the configuration file exists relative to it.
- * @param apiDetails Information for how to access the API to fetch remote files.
- * @param tempDir The temporary directory which may contain a CodeQL Action-generated configuration file.
- * @returns The loaded configuration file, if successful.
- */
-export async function loadUserConfig(
-  actionState: ActionState<["Logger", "Env", "FeatureFlags"]>,
-  configFile: string,
-  workspacePath: string,
-  apiDetails: api.GitHubApiCombinedDetails,
-  tempDir: string,
-): Promise {
-  if (isLocal(configFile)) {
-    if (configFile !== userConfigFromActionPath(tempDir)) {
-      // If the config file is not generated by the Action, it should be relative to the workspace.
-      configFile = path.resolve(workspacePath, configFile);
-      // Error if the config file is now outside of the workspace
-      if (!(configFile + path.sep).startsWith(workspacePath + path.sep)) {
-        throw new ConfigurationError(
-          errorMessages.getConfigFileOutsideWorkspaceErrorMessage(configFile),
-        );
-      }
-    }
-    const validateConfig = await actionState.features.getValue(
-      Feature.ValidateDbConfig,
-    );
-    return getLocalConfig(actionState.logger, configFile, validateConfig);
-  } else {
-    // Drop the explicit prefix if it is present. Since `REMOTE_PATH_PREFIX` is chosen
-    // to not conflict with permissible characters in "owner" or "repo" components,
-    // this does not risk removing valid parts of either component by accident.
-    if (isExplicitRemotePath(configFile)) {
-      configFile = configFile.substring(REMOTE_PATH_PREFIX.length);
-    }
-    return await getRemoteConfig(actionState, configFile, apiDetails);
-  }
-}
-
-/**
- * Maps languages to their overlay analysis feature flags. Only languages that
- * are GA or in staff-ship for overlay analysis are included here. Languages
- * without an entry will have overlay analysis disabled.
- */
-const OVERLAY_ANALYSIS_FEATURES: Partial> = {
-  cpp: Feature.OverlayAnalysisCpp,
-  csharp: Feature.OverlayAnalysisCsharp,
-  go: Feature.OverlayAnalysisGo,
-  java: Feature.OverlayAnalysisJava,
-  javascript: Feature.OverlayAnalysisJavascript,
-  python: Feature.OverlayAnalysisPython,
-  ruby: Feature.OverlayAnalysisRuby,
-};
-
-const OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES: Partial<
-  Record
-> = {
-  cpp: Feature.OverlayAnalysisCodeScanningCpp,
-  csharp: Feature.OverlayAnalysisCodeScanningCsharp,
-  go: Feature.OverlayAnalysisCodeScanningGo,
-  java: Feature.OverlayAnalysisCodeScanningJava,
-  javascript: Feature.OverlayAnalysisCodeScanningJavascript,
-  python: Feature.OverlayAnalysisCodeScanningPython,
-  ruby: Feature.OverlayAnalysisCodeScanningRuby,
-};
-
-/**
- * Checks whether the overlay analysis feature is enabled for the given
- * languages and configuration.
- */
-async function checkOverlayAnalysisFeatureEnabled(
-  features: FeatureEnablement,
-  codeql: CodeQL,
-  languages: Language[],
-  codeScanningConfig: UserConfig,
-): Promise> {
-  if (!(await features.getValue(Feature.OverlayAnalysis, codeql))) {
-    return new Failure(OverlayDisabledReason.OverallFeatureNotEnabled);
-  }
-  let enableForCodeScanningOnly = false;
-  for (const language of languages) {
-    const feature = OVERLAY_ANALYSIS_FEATURES[language];
-    if (feature && (await features.getValue(feature, codeql))) {
-      continue;
-    }
-    const codeScanningFeature =
-      OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES[language];
-    if (
-      codeScanningFeature &&
-      (await features.getValue(codeScanningFeature, codeql))
-    ) {
-      enableForCodeScanningOnly = true;
-      continue;
-    }
-    return new Failure(OverlayDisabledReason.LanguageNotEnabled);
-  }
-  if (enableForCodeScanningOnly) {
-    // A code-scanning configuration runs only the (default) code-scanning suite
-    // if the default queries are not disabled, and no packs, queries, or
-    // query-filters are specified.
-    const usesDefaultQueriesOnly =
-      codeScanningConfig["disable-default-queries"] !== true &&
-      codeScanningConfig.packs === undefined &&
-      codeScanningConfig.queries === undefined &&
-      codeScanningConfig["query-filters"] === undefined;
-    if (!usesDefaultQueriesOnly) {
-      return new Failure(OverlayDisabledReason.NonDefaultQueries);
-    }
-  }
-  return new Success(undefined);
-}
-
-/** Checks if the runner has enough disk space for overlay analysis. */
-function runnerHasSufficientDiskSpace(
-  diskUsage: DiskUsage,
-  logger: Logger,
-): boolean {
-  const minimumDiskSpaceBytes = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES;
-  if (diskUsage.numAvailableBytes < minimumDiskSpaceBytes) {
-    const diskSpaceMb = Math.round(diskUsage.numAvailableBytes / 1_000_000);
-    const minimumDiskSpaceMb = Math.round(minimumDiskSpaceBytes / 1_000_000);
-    logger.info(
-      `Setting overlay database mode to ${OverlayDatabaseMode.None} ` +
-        `due to insufficient disk space (${diskSpaceMb} MB, needed ${minimumDiskSpaceMb} MB).`,
-    );
-    return false;
-  }
-  return true;
-}
-
-/** Checks if the runner has enough memory for overlay analysis. */
-async function runnerHasSufficientMemory(
-  codeql: CodeQL,
-  ramInput: string | undefined,
-  logger: Logger,
-): Promise {
-  if (
-    await codeQlVersionAtLeast(
-      codeql,
-      CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE,
-    )
-  ) {
-    logger.debug(
-      `Skipping memory check for overlay analysis because CodeQL version is at least ${CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE}.`,
-    );
-    return true;
-  }
-
-  const memoryFlagValue = getCodeQLMemoryLimit(ramInput, logger);
-  if (memoryFlagValue < OVERLAY_MINIMUM_MEMORY_MB) {
-    logger.info(
-      `Setting overlay database mode to ${OverlayDatabaseMode.None} ` +
-        `due to insufficient memory for CodeQL analysis (${memoryFlagValue} MB, needed ${OVERLAY_MINIMUM_MEMORY_MB} MB).`,
-    );
-    return false;
-  }
-
-  logger.debug(
-    `Memory available for CodeQL analysis is ${memoryFlagValue} MB, which is above the minimum of ${OVERLAY_MINIMUM_MEMORY_MB} MB.`,
-  );
-  return true;
-}
-
-/**
- * Checks if the runner has sufficient disk space and memory for overlay
- * analysis.
- */
-async function checkRunnerResources(
-  codeql: CodeQL,
-  diskUsage: DiskUsage,
-  ramInput: string | undefined,
-  logger: Logger,
-): Promise> {
-  if (!runnerHasSufficientDiskSpace(diskUsage, logger)) {
-    return new Failure(OverlayDisabledReason.InsufficientDiskSpace);
-  }
-  if (!(await runnerHasSufficientMemory(codeql, ramInput, logger))) {
-    return new Failure(OverlayDisabledReason.InsufficientMemory);
-  }
-  return new Success(undefined);
-}
-
-interface EnabledOverlayConfig {
-  overlayDatabaseMode: Exclude;
-  useOverlayDatabaseCaching: boolean;
-  overlayModeSetExplicitly: boolean;
-}
-
-/**
- * Calculate and validate the overlay database mode and caching to use.
- *
- * - If the environment variable `CODEQL_OVERLAY_DATABASE_MODE` is set, use it.
- *   In this case, the workflow is responsible for managing database storage and
- *   retrieval, and the action will not perform overlay database caching. Think
- *   of it as a "manual control" mode where the calling workflow is responsible
- *   for making sure that everything is set up correctly.
- * - Otherwise, if `Feature.OverlayAnalysis` is enabled, calculate the mode
- *   based on what we are analyzing. Think of it as a "automatic control" mode
- *   where the action will do the right thing by itself.
- *   - If we are analyzing a pull request, use `Overlay` with caching.
- *   - If we are analyzing the default branch, use `OverlayBase` with caching.
- * - Otherwise, use `None`.
- *
- * For `Overlay` and `OverlayBase`, the function performs further checks and
- * reverts to `None` if any check should fail.
- *
- * @returns A `Success` containing the overlay database mode and whether the
- * action should perform overlay-base database caching, or a `Failure`
- * containing the reason why overlay analysis is disabled.
- */
-export async function checkOverlayEnablement(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  languages: Language[],
-  sourceRoot: string,
-  buildMode: BuildMode | undefined,
-  ramInput: string | undefined,
-  codeScanningConfig: UserConfig,
-  repositoryProperties: RepositoryProperties,
-  gitVersion: GitVersionInfo | undefined,
-  logger: Logger,
-): Promise> {
-  const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE;
-  // Any unrecognized CODEQL_OVERLAY_DATABASE_MODE value will be ignored and
-  // treated as if the environment variable was not set.
-  if (
-    modeEnv === OverlayDatabaseMode.Overlay ||
-    modeEnv === OverlayDatabaseMode.OverlayBase ||
-    modeEnv === OverlayDatabaseMode.None
-  ) {
-    logger.info(
-      `Setting overlay database mode to ${modeEnv} ` +
-        "from the CODEQL_OVERLAY_DATABASE_MODE environment variable.",
-    );
-    if (modeEnv === OverlayDatabaseMode.None) {
-      return new Failure(OverlayDisabledReason.DisabledByEnvironmentVariable);
-    }
-    return validateOverlayDatabaseMode(
-      modeEnv,
-      false,
-      true,
-      codeql,
-      languages,
-      sourceRoot,
-      buildMode,
-      gitVersion,
-      logger,
-    );
-  }
-
-  if (repositoryProperties[RepositoryPropertyName.DISABLE_OVERLAY] === true) {
-    logger.info(
-      `Setting overlay database mode to ${OverlayDatabaseMode.None} ` +
-        `because the ${RepositoryPropertyName.DISABLE_OVERLAY} repository property is set to true.`,
-    );
-    return new Failure(OverlayDisabledReason.DisabledByRepositoryProperty);
-  }
-
-  const featureResult = await checkOverlayAnalysisFeatureEnabled(
-    features,
-    codeql,
-    languages,
-    codeScanningConfig,
-  );
-  if (featureResult.isFailure()) {
-    return featureResult;
-  }
-
-  const performResourceChecks = !(await features.getValue(
-    Feature.OverlayAnalysisSkipResourceChecks,
-    codeql,
-  ));
-  const checkOverlayStatus = await features.getValue(
-    Feature.OverlayAnalysisStatusCheck,
-  );
-  const needDiskUsage = performResourceChecks || checkOverlayStatus;
-  const diskUsage = needDiskUsage ? await checkDiskUsage(logger) : undefined;
-  if (needDiskUsage && diskUsage === undefined) {
-    logger.warning(
-      `Unable to determine disk usage, therefore setting overlay database mode to ${OverlayDatabaseMode.None}.`,
-    );
-    return new Failure(OverlayDisabledReason.UnableToDetermineDiskUsage);
-  }
-  const resourceResult =
-    performResourceChecks && diskUsage !== undefined
-      ? await checkRunnerResources(codeql, diskUsage, ramInput, logger)
-      : new Success(undefined);
-  if (resourceResult.isFailure()) {
-    return resourceResult;
-  }
-  if (
-    checkOverlayStatus &&
-    diskUsage !== undefined &&
-    (await shouldSkipOverlayAnalysis(codeql, languages, diskUsage, logger))
-  ) {
-    logger.info(
-      `Setting overlay database mode to ${OverlayDatabaseMode.None} ` +
-        "because overlay analysis previously failed with this combination of languages, " +
-        "disk space, and CodeQL version.",
-    );
-    return new Failure(OverlayDisabledReason.SkippedDueToCachedStatus);
-  }
-
-  let overlayDatabaseMode: OverlayDatabaseMode;
-  if (isAnalyzingPullRequest()) {
-    overlayDatabaseMode = OverlayDatabaseMode.Overlay;
-    logger.info(
-      `Setting overlay database mode to ${overlayDatabaseMode} ` +
-        "with caching because we are analyzing a pull request.",
-    );
-  } else if (await isAnalyzingDefaultBranch()) {
-    overlayDatabaseMode = OverlayDatabaseMode.OverlayBase;
-    logger.info(
-      `Setting overlay database mode to ${overlayDatabaseMode} ` +
-        "with caching because we are analyzing the default branch.",
-    );
-  } else {
-    return new Failure(OverlayDisabledReason.NotPullRequestOrDefaultBranch);
-  }
-
-  return validateOverlayDatabaseMode(
-    overlayDatabaseMode,
-    true,
-    false,
-    codeql,
-    languages,
-    sourceRoot,
-    buildMode,
-    gitVersion,
-    logger,
-  );
-}
-
-/**
- * Validates that the given overlay database mode is compatible with the current
- * configuration (build mode, CodeQL version, git repository, git version). Returns
- * the mode unchanged if all checks pass, or falls back to `None` with the
- * appropriate disabled reason.
- */
-async function validateOverlayDatabaseMode(
-  overlayDatabaseMode: Exclude,
-  useOverlayDatabaseCaching: boolean,
-  overlayModeSetExplicitly: boolean,
-  codeql: CodeQL,
-  languages: Language[],
-  sourceRoot: string,
-  buildMode: BuildMode | undefined,
-  gitVersion: GitVersionInfo | undefined,
-  logger: Logger,
-): Promise> {
-  if (
-    buildMode !== BuildMode.None &&
-    (
-      await Promise.all(
-        languages.map(
-          async (l) =>
-            l !== BuiltInLanguage.go && // Workaround to allow overlay analysis for Go with any build
-            // mode, since it does not yet support BMN. The Go autobuilder and/or extractor will
-            // ensure that overlay-base databases are only created for supported Go build setups,
-            // and that we'll fall back to full databases in other cases.
-            (await codeql.isTracedLanguage(l)),
-        ),
-      )
-    ).some(Boolean)
-  ) {
-    logger.warning(
-      `Cannot build an ${overlayDatabaseMode} database because ` +
-        `build-mode is set to "${buildMode}" instead of "none". ` +
-        "Falling back to creating a normal full database instead.",
-    );
-    return new Failure(OverlayDisabledReason.IncompatibleBuildMode);
-  }
-  if (!(await codeQlVersionAtLeast(codeql, CODEQL_OVERLAY_MINIMUM_VERSION))) {
-    logger.warning(
-      `Cannot build an ${overlayDatabaseMode} database because ` +
-        `the CodeQL CLI is older than ${CODEQL_OVERLAY_MINIMUM_VERSION}. ` +
-        "Falling back to creating a normal full database instead.",
-    );
-    return new Failure(OverlayDisabledReason.IncompatibleCodeQl);
-  }
-  const gitRoot = await getGitRoot(sourceRoot);
-  if (gitRoot === undefined) {
-    logger.warning(
-      `Cannot build an ${overlayDatabaseMode} database because ` +
-        `the source root "${sourceRoot}" is not inside a git repository. ` +
-        "Falling back to creating a normal full database instead.",
-    );
-    return new Failure(OverlayDisabledReason.NoGitRoot);
-  }
-  if (hasSubmodules(gitRoot)) {
-    if (gitVersion === undefined) {
-      logger.warning(
-        `Cannot build an ${overlayDatabaseMode} database because ` +
-          "the repository has submodules and the Git version could not be determined. " +
-          "Falling back to creating a normal full database instead.",
-      );
-      return new Failure(OverlayDisabledReason.IncompatibleGit);
-    }
-    if (
-      !gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES)
-    ) {
-      logger.warning(
-        `Cannot build an ${overlayDatabaseMode} database because ` +
-          "the repository has submodules and the installed Git version is older " +
-          `than ${GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES}. ` +
-          "Falling back to creating a normal full database instead.",
-      );
-      return new Failure(OverlayDisabledReason.IncompatibleGit);
-    }
-  }
-
-  return new Success({
-    overlayDatabaseMode,
-    useOverlayDatabaseCaching,
-    overlayModeSetExplicitly,
-  });
-}
-
-export async function isTrapCachingEnabled(
-  features: FeatureEnablement,
-  overlayDatabaseMode: OverlayDatabaseMode,
-): Promise {
-  // If the workflow specified something, always respect that.
-  const trapCaching = getOptionalInput("trap-caching");
-  if (trapCaching !== undefined) return trapCaching === "true";
-
-  // On self-hosted runners which may have slow network access, disable TRAP caching by default.
-  if (!isHostedRunner()) return false;
-
-  // If overlay analysis is enabled, then disable TRAP caching since overlay analysis supersedes it.
-  // This change is gated behind a feature flag.
-  if (
-    overlayDatabaseMode !== OverlayDatabaseMode.None &&
-    (await features.getValue(Feature.OverlayAnalysisDisableTrapCaching))
-  ) {
-    return false;
-  }
-
-  // Otherwise, enable TRAP caching.
-  return true;
-}
-
-async function setCppTrapCachingEnvironmentVariables(
-  config: Config,
-  logger: Logger,
-): Promise {
-  if (config.languages.includes(BuiltInLanguage.cpp)) {
-    const envVar = "CODEQL_EXTRACTOR_CPP_TRAP_CACHING";
-    if (process.env[envVar]) {
-      logger.info(
-        `Environment variable ${envVar} already set, leaving it unchanged.`,
-      );
-    } else if (config.trapCaches[BuiltInLanguage.cpp]) {
-      logger.info("Enabling TRAP caching for C/C++.");
-      core.exportVariable(envVar, "true");
-    } else {
-      logger.debug(`Disabling TRAP caching for C/C++.`);
-      core.exportVariable(envVar, "false");
-    }
-  }
-}
-
-function dbLocationOrDefault(
-  dbLocation: string | undefined,
-  tempDir: string,
-): string {
-  return dbLocation || path.resolve(tempDir, "codeql_databases");
-}
-
-/**
- * Gets the path for the CodeQL Action-generated configuration file,
- * which is used to store the `config` input.
- */
-export function userConfigFromActionPath(tempDir: string): string {
-  return path.resolve(tempDir, "user-config-from-action.yml");
-}
-
-/**
- * Checks whether the given `UserConfig` contains any query customisations.
- *
- * @returns Returns `true` if the `UserConfig` customises which queries are run.
- */
-function hasQueryCustomisation(userConfig: UserConfig): boolean {
-  return (
-    isDefined(userConfig["disable-default-queries"]) ||
-    isDefined(userConfig.queries) ||
-    isDefined(userConfig["query-filters"])
-  );
-}
-
-/**
- * Finalize the incremental-analysis configuration for this run.
- *
- * Overlay analysis has only been validated in combination with diff-informed analysis, so if
- * `Overlay` mode was selected for a pull request but the diff ranges could not be computed, fall
- * back to a full non-overlay analysis. If the overlay mode was set explicitly, this fallback does
- * not apply.
- *
- * Query exclusions for incremental-only queries are then applied whenever the diff ranges are
- * available — which, after the fallback above, is exactly the set of runs where any kind of
- * incremental analysis (overlay or diff-informed) is in effect.
- */
-export async function applyIncrementalAnalysisSettings(
-  config: Config,
-  hasDiffRanges: boolean,
-  codeql: CodeQL,
-  logger: Logger,
-): Promise {
-  if (
-    config.overlayDatabaseMode === OverlayDatabaseMode.Overlay &&
-    !hasDiffRanges &&
-    !config.overlayModeSetExplicitly
-  ) {
-    logger.info(
-      `Reverting overlay database mode to ${OverlayDatabaseMode.None} ` +
-        "because the PR diff ranges could not be computed.",
-    );
-    config.overlayDatabaseMode = OverlayDatabaseMode.None;
-    config.useOverlayDatabaseCaching = false;
-    await addOverlayDisablementDiagnostics(
-      config,
-      codeql,
-      OverlayDisabledReason.DiffInformedAnalysisNotEnabled,
-    );
-  }
-
-  if (hasDiffRanges) {
-    config.extraQueryExclusions.push({
-      exclude: { tags: "exclude-from-incremental" },
-    });
-  }
-}
-
-/**
- * Determines where to load the `UserConfig` for the CLI from and loads it.
- *
- * @param inputs The Action inputs. The `configFile` value will be mutated
- *               if a CodeQL Action-generated file should be used.
- *
- * @returns The loaded `UserConfig`, which might be empty if no configuration
- *          was specified.
- */
-export async function determineUserConfig(
-  action: ActionState<["Logger", "Env", "FeatureFlags"]>,
-  tempDir: string,
-  inputs: InitConfigInputs,
-): Promise {
-  const validateConfig = await action.features.getValue(
-    Feature.ValidateDbConfig,
-  );
-
-  // We have the following cases:
-  // 1. A `config` or `config-file` input is provided, but not both: use the provided one.
-  // 2. Both are provided and we are in an advanced workflow: ignore the `config-file` input.
-  // 3. Both are provided and we are in Default Setup: the `config` input uses a limited
-  //    set of options, which are supported by `mergeDefaultSetupAndUserConfigs`,
-  //    and we merge the two configs.
-  if (inputs.configInput) {
-    const computedConfigPath = userConfigFromActionPath(tempDir);
-
-    // Get a function which enables us to determine whether the FF that allows us to
-    // merge supported configuration file properties is enabled. We only execute
-    // this lazily if the other checks pass.
-    const allowMergeConfigs = () =>
-      action.features.getValue(Feature.AllowMergeConfigFiles);
-
-    // Check whether we also have a `config-file` input and decide what to do.
-    if (
-      inputs.configFile &&
-      isDefaultSetup(action.env) &&
-      (await allowMergeConfigs())
-    ) {
-      // If the FF is enabled and we are in Default Setup, combine the supported
-      // configuration file properties and write the result to disk.
-      const fromConfigInput = parseUserConfig(
-        action.logger,
-        "`config` input",
-        inputs.configInput,
-        validateConfig,
-      );
-      const fromConfigFile = await loadUserConfig(
-        action,
-        inputs.configFile,
-        inputs.workspacePath,
-        inputs.apiDetails,
-        tempDir,
-      );
-
-      // Write the merged configuration to disk so that it can be loaded subsequently by
-      // the CLI or other CodeQL Action steps.
-      const mergedConfig = mergeDefaultSetupAndUserConfigs(
-        action.logger,
-        fromConfigInput,
-        fromConfigFile,
-      );
-      fs.writeFileSync(computedConfigPath, yaml.dump(mergedConfig));
-      action.logger.debug(
-        `Using merged configurations from 'config' input with configuration from '${inputs.configFile}': ${computedConfigPath}`,
-      );
-
-      inputs.configFile = computedConfigPath;
-      return mergedConfig;
-    } else {
-      // If we are in this branch and there is a `config-file` input, then it means
-      // we didn't meet the conditions for merging the configurations. Warn the user
-      // that the configuration file will be ignored.
-      if (inputs.configFile) {
-        action.logger.warning(
-          `Both a config file and config input were provided. Ignoring config file.`,
-        );
-      }
-
-      // Write the `config` input straight to disk.
-      fs.writeFileSync(computedConfigPath, inputs.configInput);
-      inputs.configFile = computedConfigPath;
-      action.logger.debug(
-        `Using config from action input: ${inputs.configFile}`,
-      );
-    }
-  }
-
-  // Load whatever configuration file we have, if any.
-  if (!inputs.configFile) {
-    action.logger.debug("No configuration file was provided");
-    return {};
-  } else {
-    action.logger.debug(`Using configuration file: ${inputs.configFile}`);
-    return await loadUserConfig(
-      action,
-      inputs.configFile,
-      inputs.workspacePath,
-      inputs.apiDetails,
-      tempDir,
-    );
-  }
-}
-
-/**
- * Load and return the config.
- *
- * This will parse the config from the user input if present, or generate
- * a default config. The parsed config is then stored to a known location.
- */
-export async function initConfig(
-  actionState: ActionState<["Logger", "Env", "FeatureFlags"]>,
-  inputs: InitConfigInputs,
-): Promise {
-  const { logger, features } = actionState;
-  const { tempDir } = inputs;
-
-  const userConfig = await determineUserConfig(actionState, tempDir, inputs);
-
-  const config = await initActionState(inputs, userConfig);
-
-  // If Code Quality analysis is the only enabled analysis kind, then we will initialise
-  // the database for Code Quality. That entails disabling the default queries and only
-  // running quality queries. We do not currently support query customisations in that case.
-  if (config.analysisKinds.length === 1 && isCodeQualityEnabled(config)) {
-    // Warn if any query customisations are present in the computed configuration.
-    if (hasQueryCustomisation(config.computedConfig)) {
-      throw new ConfigurationError(
-        "Query customizations are unsupported, because only `code-quality` analysis is enabled.",
-      );
-    }
-
-    const queries = codeQualityQueries.map((v) => ({ uses: v }));
-
-    // Set the query customisation options for Code Quality only analysis.
-    config.computedConfig["disable-default-queries"] = true;
-    config.computedConfig.queries = queries;
-    config.computedConfig["query-filters"] = [];
-  }
-
-  let gitVersion: GitVersionInfo | undefined = undefined;
-  try {
-    gitVersion = await getGitVersionOrThrow();
-    logger.info(`Using Git version ${gitVersion.fullVersion}`);
-  } catch (e) {
-    logger.warning(`Could not determine Git version: ${getErrorMessage(e)}`);
-    // Throw the error in test mode so it's more visible, unless the environment
-    // variable is set to tolerate this, for example because we're running in a
-    // Docker container where git may not be available.
-    if (
-      isInTestMode() &&
-      process.env[EnvVar.TOLERATE_MISSING_GIT_VERSION] !== "true"
-    ) {
-      throw e;
-    }
-  }
-
-  // If we are in a dynamic workflow or the corresponding FF is enabled, try to determine
-  // which files in the repository are marked as generated and add them to
-  // the `paths-ignore` configuration.
-  if (
-    (await features.getValue(Feature.IgnoreGeneratedFiles)) &&
-    isDynamicWorkflow()
-  ) {
-    try {
-      const generatedFilesCheckStartedAt = performance.now();
-      const generatedFiles = await getGeneratedFiles(inputs.sourceRoot);
-      const generatedFilesDuration = Math.round(
-        performance.now() - generatedFilesCheckStartedAt,
-      );
-
-      if (generatedFiles.length > 0) {
-        config.computedConfig["paths-ignore"] ??= [];
-        config.computedConfig["paths-ignore"].push(...generatedFiles);
-        logger.info(
-          `Detected ${generatedFiles.length} generated file(s), which will be excluded from analysis: ${joinAtMost(generatedFiles, ", ", 10)}`,
-        );
-      } else {
-        logger.info(`Found no generated files.`);
-      }
-
-      await logGeneratedFilesTelemetry(
-        config,
-        generatedFilesDuration,
-        generatedFiles.length,
-      );
-    } catch (error) {
-      logger.info(`Cannot ignore generated files: ${getErrorMessage(error)}`);
-    }
-  } else {
-    logger.debug(`Skipping check for generated files.`);
-  }
-
-  // The choice of overlay database mode depends on the selection of languages
-  // and queries, which in turn depends on the user config and the augmentation
-  // properties. So we need to calculate the overlay database mode after the
-  // rest of the config has been populated.
-  const overlayDatabaseModeResult = await checkOverlayEnablement(
-    inputs.codeql,
-    inputs.features,
-    config.languages,
-    inputs.sourceRoot,
-    config.buildMode,
-    inputs.ramInput,
-    config.computedConfig,
-    config.repositoryProperties,
-    gitVersion,
-    logger,
-  );
-  if (overlayDatabaseModeResult.isSuccess()) {
-    const {
-      overlayDatabaseMode,
-      useOverlayDatabaseCaching,
-      overlayModeSetExplicitly,
-    } = overlayDatabaseModeResult.value;
-    logger.info(
-      `Using overlay database mode: ${overlayDatabaseMode} ` +
-        `${useOverlayDatabaseCaching ? "with" : "without"} caching.`,
-    );
-    config.overlayDatabaseMode = overlayDatabaseMode;
-    config.useOverlayDatabaseCaching = useOverlayDatabaseCaching;
-    config.overlayModeSetExplicitly = overlayModeSetExplicitly;
-  } else {
-    const overlayDisabledReason = overlayDatabaseModeResult.value;
-    logger.info(
-      `Using overlay database mode: ${OverlayDatabaseMode.None} without caching.`,
-    );
-    config.overlayDatabaseMode = OverlayDatabaseMode.None;
-    config.useOverlayDatabaseCaching = false;
-    await addOverlayDisablementDiagnostics(
-      config,
-      inputs.codeql,
-      overlayDisabledReason,
-    );
-  }
-
-  const hasDiffRanges = await prepareDiffInformedAnalysis(
-    inputs.codeql,
-    inputs.features,
-    logger,
-  );
-
-  await applyIncrementalAnalysisSettings(
-    config,
-    hasDiffRanges,
-    inputs.codeql,
-    logger,
-  );
-
-  if (await isTrapCachingEnabled(features, config.overlayDatabaseMode)) {
-    const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(
-      inputs.codeql,
-      config.languages,
-      logger,
-    );
-    config.trapCaches = trapCaches;
-    config.trapCacheDownloadTime = trapCacheDownloadTime;
-  }
-
-  await setCppTrapCachingEnvironmentVariables(config, logger);
-
-  return config;
-}
-
-/**
- * Determines if `configPath` is explicitly local. That is, it starts with `LOCAL_PATH_PREFIX`.
- * A configuration file path that starts with `LOCAL_PATH_PREFIX` is always treated as a local path.
- *
- * @param configPath The path to test.
- */
-function isExplicitLocalPath(configPath: string): boolean {
-  return configPath.startsWith(LOCAL_PATH_PREFIX);
-}
-
-/**
- * Determines if `configPath` starts with the prefix used to explicitly mark a path
- * as a remote path (`REMOTE_PATH_PREFIX`).
- *
- * @param configPath The path to test.
- */
-function isExplicitRemotePath(configPath: string): boolean {
-  return configPath.startsWith(REMOTE_PATH_PREFIX);
-}
-
-/**
- * Determines if `configPath` contains a '@' character.
- *
- * @param configPath The path to test.
- */
-function containsAtRef(configPath: string): boolean {
-  return configPath.includes("@");
-}
-
-/**
- * Determines if `configPath` refers to a local configuration file.
- *
- * @param configPath The path to test.
- * @returns True if it is local, or false otherwise.
- */
-function isLocal(configPath: string): boolean {
-  // If the path starts with `LOCAL_PATH_PREFIX`, it is explicitly local.
-  // This allows local paths that would otherwise contain '@'
-  // to be used with a `LOCAL_PATH_PREFIX` prefix.
-  if (isExplicitLocalPath(configPath)) {
-    return true;
-  }
-  // If the path starts with `REMOTE_PATH_PREFIX`, it is explicitly remote.
-  // This allows users to resolve ambiguity by specifying `REMOTE_PATH_PREFIX`.
-  if (isExplicitRemotePath(configPath)) {
-    return false;
-  }
-
-  // Otherwise, the path is also local if it does not contain '@'.
-  // This assumes the `OLD_REMOTE_ADDRESS_FORMAT` which must contain a '@'
-  // character for remote addresses.
-  return !containsAtRef(configPath);
-}
-
-export function getLocalConfig(
-  logger: Logger,
-  configFile: string,
-  validateConfig: boolean,
-): UserConfig {
-  // Error if the file does not exist
-  if (!fs.existsSync(configFile)) {
-    throw new ConfigurationError(
-      errorMessages.getConfigFileDoesNotExistErrorMessage(configFile),
-    );
-  }
-
-  return parseUserConfig(
-    logger,
-    configFile,
-    fs.readFileSync(configFile, "utf-8"),
-    validateConfig,
-  );
-}
-
-/**
- * Get the file path where the parsed config will be stored.
- */
-export function getPathToParsedConfigFile(tempDir: string): string {
-  return path.join(tempDir, "config");
-}
-
-/**
- * Store the given config to the path returned from getPathToParsedConfigFile.
- */
-export async function saveConfig(config: Config, logger: Logger) {
-  const configString = JSON.stringify(config);
-  const configFile = getPathToParsedConfigFile(config.tempDir);
-  fs.mkdirSync(path.dirname(configFile), { recursive: true });
-  fs.writeFileSync(configFile, configString, "utf8");
-  logger.debug("Saved config:");
-  logger.debug(configString);
-}
-
-/**
- * Get the config that has been saved to the given temp dir.
- * If the config could not be found then returns undefined.
- */
-export async function getConfig(
-  tempDir: string,
-  logger: Logger,
-): Promise {
-  const configFile = getPathToParsedConfigFile(tempDir);
-  if (!fs.existsSync(configFile)) {
-    return undefined;
-  }
-  const configString = fs.readFileSync(configFile, "utf8");
-  logger.debug("Loaded config:");
-  logger.debug(configString);
-
-  const config = JSON.parse(configString) as Partial;
-
-  if (config.version === undefined) {
-    throw new ConfigurationError(
-      `Loaded configuration file, but it does not contain the expected 'version' field.`,
-    );
-  }
-  if (config.version !== getActionVersion()) {
-    throw new ConfigurationError(
-      `Loaded a configuration file for version '${config.version}', but running version '${getActionVersion()}'`,
-    );
-  }
-
-  return config as Config;
-}
-
-/**
- * Generate a `qlconfig.yml` file from the `registries` input.
- * This file is used by the CodeQL CLI to list the registries to use for each
- * pack.
- *
- * @param registriesInput The value of the `registries` input.
- * @param tempDir a temporary directory to store the generated qlconfig.yml file.
- * @param logger a logger object.
- * @returns The path to the generated `qlconfig.yml` file and the auth tokens to
- *        use for each registry.
- */
-export async function generateRegistries(
-  registriesInput: string | undefined,
-  tempDir: string,
-  logger: Logger,
-) {
-  const registries = parseRegistries(registriesInput);
-  let registriesAuthTokens: string | undefined;
-  let qlconfigFile: string | undefined;
-  if (registries) {
-    // generate a qlconfig.yml file to hold the registry configs.
-    const qlconfig = createRegistriesBlock(registries);
-    qlconfigFile = path.join(tempDir, "qlconfig.yml");
-    const qlconfigContents = yaml.dump(qlconfig);
-    fs.writeFileSync(qlconfigFile, qlconfigContents, "utf8");
-
-    logger.debug("Generated qlconfig.yml:");
-    logger.debug(qlconfigContents);
-    registriesAuthTokens = registries
-      .map((registry) => `${registry.url}=${registry.token}`)
-      .join(",");
-  }
-
-  if (typeof process.env.CODEQL_REGISTRIES_AUTH === "string") {
-    logger.debug(
-      "Using CODEQL_REGISTRIES_AUTH environment variable to authenticate with registries.",
-    );
-  }
-
-  return {
-    registriesAuthTokens:
-      // if the user has explicitly set the CODEQL_REGISTRIES_AUTH env var then use that
-      process.env.CODEQL_REGISTRIES_AUTH ?? registriesAuthTokens,
-    qlconfigFile,
-  };
-}
-
-function createRegistriesBlock(registries: RegistryConfigWithCredentials[]): {
-  registries: RegistryConfigNoCredentials[];
-} {
-  if (
-    !Array.isArray(registries) ||
-    registries.some((r) => !r.url || !r.packages)
-  ) {
-    throw new ConfigurationError(
-      "Invalid 'registries' input. Must be an array of objects with 'url' and 'packages' properties.",
-    );
-  }
-
-  // be sure to remove the `token` field from the registry before writing it to disk.
-  const safeRegistries = registries.map((registry) => ({
-    // ensure the url ends with a slash to avoid a bug in the CLI 2.10.4
-    url: !registry?.url.endsWith("/") ? `${registry.url}/` : registry.url,
-    packages: registry.packages,
-    kind: registry.kind,
-  }));
-  const qlconfig = {
-    registries: safeRegistries,
-  };
-  return qlconfig;
-}
-
-/**
- * Create a temporary environment based on the existing environment and overridden
- * by the given environment variables that are passed in as arguments.
- *
- * Use this new environment in the context of the given operation. After completing
- * the operation, restore the original environment.
- *
- * This function does not support un-setting environment variables.
- *
- * @param env
- * @param operation
- */
-export async function wrapEnvironment(
-  env: Record,
-  operation: () => Promise,
-) {
-  // Remember the original env
-  const oldEnv = { ...process.env };
-
-  // Set the new env
-  for (const [key, value] of Object.entries(env)) {
-    // Ignore undefined keys
-    if (value !== undefined) {
-      process.env[key] = value;
-    }
-  }
-
-  try {
-    // Run the operation
-    await operation();
-  } finally {
-    // Restore the old env
-    for (const [key, value] of Object.entries(oldEnv)) {
-      process.env[key] = value;
-    }
-  }
-}
-
-// Exported for testing
-export async function parseBuildModeInput(
-  input: string | undefined,
-  languages: Language[],
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  if (input === undefined) {
-    return undefined;
-  }
-
-  if (!Object.values(BuildMode).includes(input as BuildMode)) {
-    throw new ConfigurationError(
-      `Invalid build mode: '${input}'. Supported build modes are: ${Object.values(
-        BuildMode,
-      ).join(", ")}.`,
-    );
-  }
-
-  if (
-    languages.includes(BuiltInLanguage.csharp) &&
-    (await features.getValue(Feature.DisableCsharpBuildless))
-  ) {
-    logger.warning(
-      "Scanning C# code without a build is temporarily unavailable. Falling back to 'autobuild' build mode.",
-    );
-    return BuildMode.Autobuild;
-  }
-
-  if (
-    languages.includes(BuiltInLanguage.java) &&
-    (await features.getValue(Feature.DisableJavaBuildlessEnabled))
-  ) {
-    logger.warning(
-      "Scanning Java code without a build is temporarily unavailable. Falling back to 'autobuild' build mode.",
-    );
-    return BuildMode.Autobuild;
-  }
-  return input as BuildMode;
-}
-
-/**
- * Appends `extraQueryExclusions` to `cliConfig`'s `query-filters`.
- *
- * @param extraQueryExclusions The extra query exclusions to append to the `query-filters`.
- * @param cliConfig The CodeQL CLI configuration to extend.
- * @returns Returns `cliConfig` if there are no extra query exclusions
- *          or a copy of `cliConfig` where the extra query exclusions
- *          have been appended to `query-filters`.
- */
-export function appendExtraQueryExclusions(
-  extraQueryExclusions: ExcludeQueryFilter[],
-  cliConfig: UserConfig,
-): Readonly {
-  // make a copy so we can modify it and so that modifications to the input
-  // object do not affect the result that is marked as `Readonly`.
-  const augmentedConfig = cloneObject(cliConfig);
-
-  if (extraQueryExclusions.length === 0) {
-    return augmentedConfig;
-  }
-
-  augmentedConfig["query-filters"] = [
-    // Ordering matters. If the first filter is an inclusion, it implicitly
-    // excludes all queries that are not included. If it is an exclusion,
-    // it implicitly includes all queries that are not excluded. So user
-    // filters (if any) should always be first to preserve intent.
-    ...(augmentedConfig["query-filters"] || []),
-    ...extraQueryExclusions,
-  ];
-  if (augmentedConfig["query-filters"]?.length === 0) {
-    delete augmentedConfig["query-filters"];
-  }
-
-  return augmentedConfig;
-}
-
-/**
- * Returns `true` if Code Scanning analysis is enabled, or `false` if not.
- */
-export function isCodeScanningEnabled(config: Config): boolean {
-  return config.analysisKinds.includes(AnalysisKind.CodeScanning);
-}
-
-/**
- * Returns `true` if Code Quality analysis is enabled, or `false` if not.
- */
-export function isCodeQualityEnabled(config: Config): boolean {
-  return config.analysisKinds.includes(AnalysisKind.CodeQuality);
-}
-
-/**
- * Returns `true` if Code Scanning Risk Assessment analysis is enabled, or `false` if not.
- */
-export function isRiskAssessmentEnabled(config: Config): boolean {
-  return config.analysisKinds.includes(AnalysisKind.RiskAssessment);
-}
-
-/**
- * Returns the primary analysis kind that the Action is initialised with. If there is only
- * one analysis kind, then that is returned.
- *
- * The special case is Code Scanning + Code Quality, which can be enabled at the same time.
- * In that case, this function returns Code Scanning.
- */
-function getPrimaryAnalysisKind(config: Config): AnalysisKind {
-  if (config.analysisKinds.length === 1) {
-    return config.analysisKinds[0];
-  }
-
-  return isCodeScanningEnabled(config)
-    ? AnalysisKind.CodeScanning
-    : AnalysisKind.CodeQuality;
-}
-
-/**
- * Returns the primary analysis configuration that the Action is initialised with.
- */
-export function getPrimaryAnalysisConfig(config: Config): AnalysisConfig {
-  return getAnalysisConfig(getPrimaryAnalysisKind(config));
-}
-
-/**
- * Logs the time it took to identify generated files and how many were discovered as
- * a telemetry diagnostic.
- * */
-async function logGeneratedFilesTelemetry(
-  config: Config,
-  duration: number,
-  generatedFilesCount: number,
-): Promise {
-  if (config.languages.length < 1) {
-    return;
-  }
-
-  addNoLanguageDiagnostic(
-    config,
-    makeTelemetryDiagnostic(
-      "codeql-action/generated-files-telemetry",
-      "Generated files telemetry",
-      {
-        duration,
-        generatedFilesCount,
-      },
-    ),
-  );
-}
diff --git a/src/config/action-config.ts b/src/config/action-config.ts
deleted file mode 100644
index de6882e77e..0000000000
--- a/src/config/action-config.ts
+++ /dev/null
@@ -1,128 +0,0 @@
-import type { AnalysisKind } from "../analyses";
-import type { CachingKind } from "../caching-utils";
-import type { RepositoryProperties } from "../feature-flags/properties";
-import type { Language } from "../languages";
-import type { OverlayDatabaseMode } from "../overlay/overlay-database-mode";
-import type { BuildMode, GitHubVersion } from "../util";
-
-import type { ExcludeQueryFilter, UserConfig } from "./db-config";
-
-/**
- * Format of the CodeQL Action configuration state that is persisted
- * between steps of the CodeQL Action in a CodeQL workflow.
- */
-export interface Config {
-  /**
-   * The version of the CodeQL Action that the configuration is for.
-   */
-  version: string;
-  /**
-   * Set of analysis kinds that are enabled.
-   */
-  analysisKinds: AnalysisKind[];
-  /**
-   * Set of languages to run analysis for.
-   */
-  languages: Language[];
-  /**
-   * Build mode, if set. Currently only a single build mode is supported per job.
-   */
-  buildMode: BuildMode | undefined;
-  /**
-   * A unaltered copy of the original user input.
-   * Mainly intended to be used for status reporting.
-   * If any field is useful for the actual processing
-   * of the action then consider pulling it out to a
-   * top-level field above.
-   */
-  originalUserInput: UserConfig;
-  /**
-   * Directory to use for temporary files that should be
-   * deleted at the end of the job.
-   */
-  tempDir: string;
-  /**
-   * Path of the CodeQL executable.
-   */
-  codeQLCmd: string;
-  /**
-   * Version of GitHub we are talking to.
-   */
-  gitHubVersion: GitHubVersion;
-  /**
-   * The location where CodeQL databases should be stored.
-   */
-  dbLocation: string;
-  /**
-   * Specifies whether we are debugging mode and should try to produce extra
-   * output for debugging purposes when possible.
-   */
-  debugMode: boolean;
-  /**
-   * Specifies the name of the debugging artifact if we are in debug mode.
-   */
-  debugArtifactName: string;
-  /**
-   * Specifies the name of the database in the debugging artifact.
-   */
-  debugDatabaseName: string;
-  /**
-   * The configuration we computed by combining `originalUserInput` with `augmentationProperties`,
-   * as well as adjustments made to it based on unsupported or required options.
-   */
-  computedConfig: UserConfig;
-
-  /**
-   * Partial map from languages to locations of TRAP caches for that language.
-   * If a key is omitted, then TRAP caching should not be used for that language.
-   */
-  trapCaches: { [language: Language]: string };
-
-  /**
-   * Time taken to download TRAP caches. Used for status reporting.
-   */
-  trapCacheDownloadTime: number;
-
-  /** A value indicating how dependency caching should be used. */
-  dependencyCachingEnabled: CachingKind;
-
-  /** The keys of caches that we restored, if any. */
-  dependencyCachingRestoredKeys: string[];
-
-  /**
-   * Extra query exclusions to append to the config.
-   */
-  extraQueryExclusions: ExcludeQueryFilter[];
-
-  /**
-   * The overlay database mode to use.
-   */
-  overlayDatabaseMode: OverlayDatabaseMode;
-
-  /**
-   * Whether to use caching for overlay databases. If it is true, the action
-   * will upload the created overlay-base database to the actions cache, and
-   * download an overlay-base database from the actions cache before it creates
-   * a new overlay database. If it is false, the action assumes that the
-   * workflow will be responsible for managing database storage and retrieval.
-   *
-   * This property has no effect unless `overlayDatabaseMode` is `Overlay` or
-   * `OverlayBase`.
-   */
-  useOverlayDatabaseCaching: boolean;
-
-  /**
-   * Whether the overlay database mode was set explicitly.
-   */
-  overlayModeSetExplicitly: boolean;
-
-  /**
-   * A partial mapping from repository properties that affect us to their values.
-   */
-  repositoryProperties: RepositoryProperties;
-
-  /**
-   * Whether to enable file coverage information.
-   */
-  enableFileCoverageInformation: boolean;
-}
diff --git a/src/config/db-config.test.ts b/src/config/db-config.test.ts
deleted file mode 100644
index 63d9d2ffec..0000000000
--- a/src/config/db-config.test.ts
+++ /dev/null
@@ -1,627 +0,0 @@
-import test, { ExecutionContext } from "ava";
-
-import { RepositoryProperties } from "../feature-flags/properties";
-import { BuiltInLanguage, Language } from "../languages";
-import { getRunnerLogger } from "../logging";
-import {
-  checkExpectedLogMessages,
-  getRecordingLogger,
-  LoggedMessage,
-  makeMacro,
-  RecordingLogger,
-} from "../testing-utils";
-import { ConfigurationError, prettyPrintPack } from "../util";
-
-import * as dbConfig from "./db-config";
-
-/**
- * Test macro for ensuring the packs block is valid
- */
-const parsePacksMacro = makeMacro({
-  exec: (
-    t: ExecutionContext,
-    packsInput: string,
-    languages: Language[],
-    expected: dbConfig.Packs | undefined,
-  ) =>
-    t.deepEqual(
-      dbConfig.parsePacksFromInput(packsInput, languages, false),
-      expected,
-    ),
-
-  title: (providedTitle = "") => `Parse Packs: ${providedTitle}`,
-});
-
-/**
- * Test macro for testing when the packs block is invalid
- */
-const parsePacksErrorMacro = makeMacro({
-  exec: (
-    t: ExecutionContext,
-    packsInput: string,
-    languages: Language[],
-    expected: RegExp,
-  ) =>
-    t.throws(() => dbConfig.parsePacksFromInput(packsInput, languages, false), {
-      message: expected,
-    }),
-  title: (providedTitle = "") => `Parse Packs Error: ${providedTitle}`,
-});
-
-/**
- * Test macro for testing when the packs block is invalid
- */
-const invalidPackNameMacro = makeMacro({
-  exec: (t: ExecutionContext, arg: string) =>
-    parsePacksErrorMacro.fn(
-      t,
-      arg,
-      [BuiltInLanguage.cpp],
-      new RegExp(`^"${arg}" is not a valid pack$`),
-    ),
-  title: (_providedTitle: string | undefined, arg: string | undefined) =>
-    `Invalid pack string: ${arg}`,
-});
-
-parsePacksMacro("no packs", "", [], undefined);
-parsePacksMacro("two packs", "a/b,c/d@1.2.3", [BuiltInLanguage.cpp], {
-  [BuiltInLanguage.cpp]: ["a/b", "c/d@1.2.3"],
-});
-parsePacksMacro(
-  "two packs with spaces",
-  " a/b , c/d@1.2.3 ",
-  [BuiltInLanguage.cpp],
-  {
-    [BuiltInLanguage.cpp]: ["a/b", "c/d@1.2.3"],
-  },
-);
-parsePacksErrorMacro(
-  "two packs with language",
-  "a/b,c/d@1.2.3",
-  [BuiltInLanguage.cpp, BuiltInLanguage.java],
-  new RegExp(
-    "Cannot specify a 'packs' input in a multi-language analysis. " +
-      "Use a codeql-config.yml file instead and specify packs by language.",
-  ),
-);
-
-parsePacksMacro(
-  "packs with other valid names",
-  [
-    // ranges are ok
-    "c/d@1.0",
-    "c/d@~1.0.0",
-    "c/d@~1.0.0:a/b",
-    "c/d@~1.0.0+abc:a/b",
-    "c/d@~1.0.0-abc:a/b",
-    "c/d:a/b",
-    // whitespace is removed
-    " c/d      @     ~1.0.0    :    b.qls   ",
-    // and it is retained within a path
-    " c/d      @     ~1.0.0    :    b/a path with/spaces.qls   ",
-    // this is valid. the path is '@'. It will probably fail when passed to the CLI
-    "c/d@1.2.3:@",
-    // this is valid, too. It will fail if it doesn't match a path
-    // (globbing is not done)
-    "c/d@1.2.3:+*)_(",
-  ].join(","),
-  [BuiltInLanguage.cpp],
-  {
-    [BuiltInLanguage.cpp]: [
-      "c/d@1.0",
-      "c/d@~1.0.0",
-      "c/d@~1.0.0:a/b",
-      "c/d@~1.0.0+abc:a/b",
-      "c/d@~1.0.0-abc:a/b",
-      "c/d:a/b",
-      "c/d@~1.0.0:b.qls",
-      "c/d@~1.0.0:b/a path with/spaces.qls",
-      "c/d@1.2.3:@",
-      "c/d@1.2.3:+*)_(",
-    ],
-  },
-);
-
-invalidPackNameMacro.test("c"); // all packs require at least a scope and a name
-invalidPackNameMacro.test("c-/d");
-invalidPackNameMacro.test("-c/d");
-invalidPackNameMacro.test("c/d_d");
-invalidPackNameMacro.test("c/d@@");
-invalidPackNameMacro.test("c/d@1.0.0:");
-invalidPackNameMacro.test("c/d:");
-invalidPackNameMacro.test("c/d:/a");
-invalidPackNameMacro.test("@1.0.0:a");
-invalidPackNameMacro.test("c/d@../a");
-invalidPackNameMacro.test("c/d@b/../a");
-invalidPackNameMacro.test("c/d:z@1");
-
-/**
- * Test macro for pretty printing pack specs
- */
-const packSpecPrettyPrintingMacro = makeMacro({
-  exec: (t: ExecutionContext, packStr: string, packObj: dbConfig.Pack) => {
-    const parsed = dbConfig.parsePacksSpecification(packStr);
-    t.deepEqual(parsed, packObj, "parsed pack spec is correct");
-    const stringified = prettyPrintPack(packObj);
-    t.deepEqual(
-      stringified,
-      packStr.trim(),
-      "pretty-printed pack spec is correct",
-    );
-
-    t.deepEqual(
-      dbConfig.validatePackSpecification(packStr),
-      packStr.trim(),
-      "pack spec is valid",
-    );
-  },
-  title: (
-    _providedTitle: string | undefined,
-    packStr: string,
-    _packObj: dbConfig.Pack,
-  ) => `Prettyprint pack spec: '${packStr}'`,
-});
-
-packSpecPrettyPrintingMacro.test("a/b", {
-  name: "a/b",
-  version: undefined,
-  path: undefined,
-});
-packSpecPrettyPrintingMacro.test("a/b@~1.2.3", {
-  name: "a/b",
-  version: "~1.2.3",
-  path: undefined,
-});
-packSpecPrettyPrintingMacro.test("a/b@~1.2.3:abc/def", {
-  name: "a/b",
-  version: "~1.2.3",
-  path: "abc/def",
-});
-packSpecPrettyPrintingMacro.test("a/b:abc/def", {
-  name: "a/b",
-  version: undefined,
-  path: "abc/def",
-});
-packSpecPrettyPrintingMacro.test("    a/b:abc/def    ", {
-  name: "a/b",
-  version: undefined,
-  path: "abc/def",
-});
-
-const calculateAugmentationMacro = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    rawPacksInput: string | undefined,
-    rawQueriesInput: string | undefined,
-    languages: Language[],
-    repositoryProperties: RepositoryProperties,
-    expectedAugmentationProperties: dbConfig.AugmentationProperties,
-  ) => {
-    const actualAugmentationProperties = await dbConfig.calculateAugmentation(
-      rawPacksInput,
-      rawQueriesInput,
-      repositoryProperties,
-      languages,
-    );
-    t.deepEqual(actualAugmentationProperties, expectedAugmentationProperties);
-  },
-  title: (title) => `Calculate Augmentation: ${title}`,
-});
-
-calculateAugmentationMacro(
-  "All empty",
-  undefined,
-  undefined,
-  [BuiltInLanguage.javascript],
-  {},
-  {
-    ...dbConfig.defaultAugmentationProperties,
-  },
-);
-
-calculateAugmentationMacro(
-  "With queries",
-  undefined,
-  " a, b , c, d",
-  [BuiltInLanguage.javascript],
-  {},
-  {
-    ...dbConfig.defaultAugmentationProperties,
-    queriesInput: [{ uses: "a" }, { uses: "b" }, { uses: "c" }, { uses: "d" }],
-  },
-);
-
-calculateAugmentationMacro(
-  "With queries combining",
-  undefined,
-  "   +   a, b , c, d ",
-  [BuiltInLanguage.javascript],
-  {},
-  {
-    ...dbConfig.defaultAugmentationProperties,
-    queriesInputCombines: true,
-    queriesInput: [{ uses: "a" }, { uses: "b" }, { uses: "c" }, { uses: "d" }],
-  },
-);
-
-calculateAugmentationMacro(
-  "With packs",
-  "   codeql/a , codeql/b   , codeql/c  , codeql/d  ",
-  undefined,
-  [BuiltInLanguage.javascript],
-  {},
-  {
-    ...dbConfig.defaultAugmentationProperties,
-    packsInput: ["codeql/a", "codeql/b", "codeql/c", "codeql/d"],
-  },
-);
-
-calculateAugmentationMacro(
-  "With packs combining",
-  "   +   codeql/a, codeql/b, codeql/c, codeql/d",
-  undefined,
-  [BuiltInLanguage.javascript],
-  {},
-  {
-    ...dbConfig.defaultAugmentationProperties,
-    packsInputCombines: true,
-    packsInput: ["codeql/a", "codeql/b", "codeql/c", "codeql/d"],
-  },
-);
-
-calculateAugmentationMacro(
-  "With repo property queries",
-  undefined,
-  undefined,
-  [BuiltInLanguage.javascript],
-  {
-    "github-codeql-extra-queries": "a, b, c, d",
-  },
-  {
-    ...dbConfig.defaultAugmentationProperties,
-    repoPropertyQueries: {
-      combines: false,
-      input: [{ uses: "a" }, { uses: "b" }, { uses: "c" }, { uses: "d" }],
-    },
-  },
-);
-
-calculateAugmentationMacro(
-  "With repo property queries combining",
-  undefined,
-  undefined,
-  [BuiltInLanguage.javascript],
-  {
-    "github-codeql-extra-queries": "+ a, b, c, d",
-  },
-  {
-    ...dbConfig.defaultAugmentationProperties,
-    repoPropertyQueries: {
-      combines: true,
-      input: [{ uses: "a" }, { uses: "b" }, { uses: "c" }, { uses: "d" }],
-    },
-  },
-);
-
-const calculateAugmentationErrorMacro = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    rawPacksInput: string | undefined,
-    rawQueriesInput: string | undefined,
-    languages: Language[],
-    repositoryProperties: RepositoryProperties,
-    expectedError: RegExp | string,
-  ) => {
-    await t.throwsAsync(
-      () =>
-        dbConfig.calculateAugmentation(
-          rawPacksInput,
-          rawQueriesInput,
-          repositoryProperties,
-          languages,
-        ),
-      { message: expectedError },
-    );
-  },
-  title: (title) => `Calculate Augmentation Error: ${title}`,
-});
-
-calculateAugmentationErrorMacro(
-  "Plus (+) with nothing else (queries)",
-  undefined,
-  "   +   ",
-  [BuiltInLanguage.javascript],
-  {},
-  /The workflow property "queries" is invalid/,
-);
-
-calculateAugmentationErrorMacro(
-  "Plus (+) with nothing else (packs)",
-  "   +   ",
-  undefined,
-  [BuiltInLanguage.javascript],
-  {},
-  /The workflow property "packs" is invalid/,
-);
-
-calculateAugmentationErrorMacro(
-  "Plus (+) with nothing else (repo property queries)",
-  undefined,
-  undefined,
-  [BuiltInLanguage.javascript],
-  {
-    "github-codeql-extra-queries": "    + ",
-  },
-  /The repository property "github-codeql-extra-queries" is invalid/,
-);
-
-calculateAugmentationErrorMacro(
-  "Packs input with multiple languages",
-  "   +  a/b, c/d ",
-  undefined,
-  [BuiltInLanguage.javascript, BuiltInLanguage.java],
-  {},
-  /Cannot specify a 'packs' input in a multi-language analysis/,
-);
-
-calculateAugmentationErrorMacro(
-  "Packs input with no languages",
-  "   +  a/b, c/d ",
-  undefined,
-  [],
-  {},
-  /No languages specified/,
-);
-
-calculateAugmentationErrorMacro(
-  "Invalid packs",
-  " a-pack-without-a-scope ",
-  undefined,
-  [BuiltInLanguage.javascript],
-  {},
-  /"a-pack-without-a-scope" is not a valid pack/,
-);
-
-test("parseUserConfig - successfully parses valid YAML", (t) => {
-  const result = dbConfig.parseUserConfig(
-    getRunnerLogger(true),
-    "test",
-    `
-    paths-ignore:
-      - "some/path"
-    queries:
-      - uses: foo
-    some-unknown-option: true
-    `,
-    true,
-  );
-  t.truthy(result);
-  if (t.truthy(result["paths-ignore"])) {
-    t.is(result["paths-ignore"].length, 1);
-    t.is(result["paths-ignore"][0], "some/path");
-  }
-  if (t.truthy(result["queries"])) {
-    t.is(result["queries"].length, 1);
-    t.deepEqual(result["queries"][0], { uses: "foo" });
-  }
-});
-
-test("parseUserConfig - throws a ConfigurationError if the file is not valid YAML", (t) => {
-  t.throws(
-    () =>
-      dbConfig.parseUserConfig(
-        getRunnerLogger(true),
-        "test",
-        `
-        paths-ignore:
-         - "some/path"
-         queries:
-         - foo
-        `,
-        true,
-      ),
-    {
-      instanceOf: ConfigurationError,
-    },
-  );
-});
-
-test("parseUserConfig - validation isn't picky about `query-filters`", (t) => {
-  const loggedMessages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(loggedMessages);
-
-  t.notThrows(() =>
-    dbConfig.parseUserConfig(
-      logger,
-      "test",
-      `
-        query-filters:
-          - something
-          - include: foo
-          - exclude: bar
-        `,
-      true,
-    ),
-  );
-});
-
-test("parseUserConfig - throws a ConfigurationError if validation fails", (t) => {
-  const loggedMessages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(loggedMessages);
-
-  t.throws(
-    () =>
-      dbConfig.parseUserConfig(
-        logger,
-        "test",
-        `
-        paths-ignore:
-         - "some/path"
-        queries: true
-        `,
-        true,
-      ),
-    {
-      instanceOf: ConfigurationError,
-      message:
-        'The configuration file "test" is invalid: instance.queries is not of a type(s) array.',
-    },
-  );
-
-  const expectedMessages = ["instance.queries is not of a type(s) array"];
-  checkExpectedLogMessages(t, loggedMessages, expectedMessages);
-});
-
-test("parseUserConfig - throws no ConfigurationError if validation should fail, but feature is disabled", (t) => {
-  const loggedMessages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(loggedMessages);
-
-  t.notThrows(() =>
-    dbConfig.parseUserConfig(
-      logger,
-      "test",
-      `
-        paths-ignore:
-         - "some/path"
-        queries: true
-        `,
-      false,
-    ),
-  );
-});
-
-test("mergeDefaultSetupAndUserConfigs - combines threat models", async (t) => {
-  const logger = new RecordingLogger();
-  const result = dbConfig.mergeDefaultSetupAndUserConfigs(
-    logger,
-    { "threat-models": ["a", "b"] },
-    { "threat-models": ["local", "remote"] },
-  );
-
-  const threatModels = result["threat-models"];
-
-  if (t.truthy(threatModels)) {
-    t.deepEqual(threatModels, ["a", "b", "local", "remote"]);
-  }
-});
-
-test("mergeDefaultSetupAndUserConfigs - warns if user-supplied config contains default setup key", async (t) => {
-  const logger = new RecordingLogger();
-  const result = dbConfig.mergeDefaultSetupAndUserConfigs(
-    logger,
-    {},
-    { "default-setup": {} },
-  );
-
-  // User-supplied value is ignored.
-  t.deepEqual(result, {});
-
-  // Warning is logged.
-  t.true(
-    logger.hasMessage(
-      "The 'default-setup' configuration key is not supported in user-supplied configuration files",
-    ),
-  );
-});
-
-test("mergeDefaultSetupAndUserConfigs - keeps default setup key from 'config' input", async (t) => {
-  const logger = new RecordingLogger();
-  const expected: dbConfig.DefaultSetupConfig = {
-    org: { "model-packs": ["some-pack"] },
-  };
-  const result = dbConfig.mergeDefaultSetupAndUserConfigs(
-    logger,
-    { "default-setup": expected },
-    {},
-  );
-
-  // Result matches the input.
-  t.deepEqual(result["default-setup"], expected);
-
-  // No warning is logged.
-  t.false(
-    logger.hasMessage(
-      "The 'default-setup' configuration key is not supported in user-supplied configuration files",
-    ),
-  );
-});
-
-test("mergeDefaultSetupAndUserConfigs - keeps other properties from user-supplied configuration", async (t) => {
-  const logger = new RecordingLogger();
-  const configFile: dbConfig.UserConfig = {
-    "query-filters": [{ exclude: { a: "b" } }],
-    "paths-ignore": ["path"],
-  };
-
-  const result = dbConfig.mergeDefaultSetupAndUserConfigs(
-    logger,
-    {},
-    configFile,
-  );
-
-  t.deepEqual(result, configFile);
-});
-
-test("mergeDefaultSetupAndUserConfigs - ignores, but warns about, unknown keys from Default Setup", async (t) => {
-  const logger = new RecordingLogger();
-  const configFile: dbConfig.UserConfig = {
-    "query-filters": [{ exclude: { a: "b" } }],
-    "paths-ignore": ["path"],
-  };
-
-  const result = dbConfig.mergeDefaultSetupAndUserConfigs(
-    logger,
-    {
-      "default-setup": {
-        borg: [],
-        org: {
-          unknown: "foo",
-          "model-packs": [],
-        },
-      } as unknown as dbConfig.DefaultSetupConfig,
-      "paths-ignore": ["other-path"],
-    },
-    configFile,
-  );
-
-  t.deepEqual(result, {
-    ...configFile,
-    "default-setup": { org: { "model-packs": [] } },
-  });
-
-  const expectedUnrecognisedKeys = [
-    ".default-setup.org.unknown",
-    ".default-setup.borg",
-    ".paths-ignore",
-  ].join(", ");
-  checkExpectedLogMessages(t, logger.messages, [
-    `Unrecognised keys in Default Setup configuration: ${expectedUnrecognisedKeys}`,
-  ]);
-});
-
-test("mergeDefaultSetupAndUserConfigs - warns about invalid keys from Default Setup", async (t) => {
-  const logger = new RecordingLogger();
-  const configFile: dbConfig.UserConfig = {};
-
-  const result = dbConfig.mergeDefaultSetupAndUserConfigs(
-    logger,
-    {
-      "default-setup": {
-        org: {
-          "model-packs": [123],
-        },
-      } as unknown as dbConfig.DefaultSetupConfig,
-    },
-    configFile,
-  );
-
-  t.deepEqual(result, {
-    ...configFile,
-    "default-setup": { org: { "model-packs": [123] } },
-  });
-
-  const expectedInvalidKeys = [".default-setup.org.model-packs[0]"].join(", ");
-  checkExpectedLogMessages(t, logger.messages, [
-    `Invalid keys in Default Setup configuration: ${expectedInvalidKeys}`,
-  ]);
-});
diff --git a/src/config/db-config.ts b/src/config/db-config.ts
deleted file mode 100644
index 7b5bdbd8ce..0000000000
--- a/src/config/db-config.ts
+++ /dev/null
@@ -1,657 +0,0 @@
-import * as path from "path";
-
-import * as yaml from "js-yaml";
-import * as jsonschema from "jsonschema";
-import * as semver from "semver";
-
-import {
-  addNoLanguageDiagnostic,
-  makeTelemetryDiagnostic,
-} from "../diagnostics";
-import * as errorMessages from "../error-messages";
-import {
-  RepositoryProperties,
-  RepositoryPropertyName,
-} from "../feature-flags/properties";
-import * as json from "../json";
-import { Language } from "../languages";
-import { Logger } from "../logging";
-import { cloneObject, ConfigurationError, prettyPrintPack } from "../util";
-
-export interface ExcludeQueryFilter {
-  exclude: Record;
-}
-
-export interface IncludeQueryFilter {
-  include: Record;
-}
-
-export type QueryFilter = ExcludeQueryFilter | IncludeQueryFilter;
-
-export interface QuerySpec {
-  name?: string;
-  uses: string;
-}
-
-const ORG_SCHEMA = {
-  /** An array of model pack names. */
-  "model-packs": json.optional(json.array(json.string)),
-} as const satisfies json.Schema;
-
-/** Not intended to be provided directly by a user. */
-export type OrgType = json.FromSchema;
-
-const DEFAULT_SETUP_SCHEMA = {
-  org: json.optional(json.object(ORG_SCHEMA)),
-} as const satisfies json.Schema;
-
-/** Not intended to be provided directly by a user. */
-export type DefaultSetupConfig = json.FromSchema;
-
-/**
- * Format of the config file supplied by the user.
- */
-export interface UserConfig {
-  name?: string;
-  "disable-default-queries"?: boolean;
-  queries?: QuerySpec[];
-  "paths-ignore"?: string[];
-  paths?: string[];
-
-  // If this is a multi-language analysis, then the packages must be split by
-  // language. If this is a single language analysis, then no split by
-  // language is necessary.
-  packs?: Record | string[];
-
-  // Set of query filters to include and exclude extra queries based on
-  // codeql query suite `include` and `exclude` properties
-  "query-filters"?: QueryFilter[];
-
-  /** An array (possibly empty or absent) of threat models to use. */
-  "threat-models"?: string[];
-
-  /**
-   * Configuration options that are reserved for us in Default Setup and
-   * not intended to be supplied directly by users.
-   */
-  "default-setup"?: DefaultSetupConfig;
-}
-
-/** A subset of the `UserConfig` schema that is used by Default Setup. */
-const DEFAULT_SETUP_CONFIG_SCHEMA = {
-  "threat-models": json.optional(json.array(json.string)),
-  "default-setup": json.optional(
-    json.object(DEFAULT_SETUP_SCHEMA),
-  ),
-} as const satisfies json.Schema;
-
-/**
- * Merges supported properties from two configuration files. This is intended only for
- * use with merging the `config` input provided by Default Setup with a potentially
- * richer configuration file provided by a user.
- *
- * @param logger The logger to use.
- * @param fromConfigInput The configuration from Default Setup.
- * @param fromConfigFile The user-supplied configuration.
- * @returns The combination of both configuration files.
- */
-export function mergeDefaultSetupAndUserConfigs(
-  logger: Logger,
-  fromConfigInput: UserConfig,
-  fromConfigFile: UserConfig,
-): UserConfig {
-  logger.debug(
-    "Combining configuration files from 'config' and 'config-file' inputs",
-  );
-
-  // Check for unexpected keys in the configuration from the `config` input
-  // that was provided by Default Setup. This should only contain the keys
-  // we would expect to receive from Default Setup.
-  const schemaCheckResult = json.checkSchema(
-    DEFAULT_SETUP_CONFIG_SCHEMA,
-    fromConfigInput as json.UnvalidatedObject,
-  );
-
-  // Report any invalid or unrecognised keys.
-  if (schemaCheckResult.invalidKeys.length > 0) {
-    logger.warning(
-      `Invalid keys in Default Setup configuration: ${schemaCheckResult.invalidKeys.join(", ")}`,
-    );
-    addNoLanguageDiagnostic(
-      undefined,
-      makeTelemetryDiagnostic(
-        "codeql-action/invalid-default-setup-config-keys",
-        "Invalid Default Setup configuration keys",
-        {
-          invalidKeys: schemaCheckResult.invalidKeys,
-        },
-        ["internal-error"],
-      ),
-    );
-  }
-  if (schemaCheckResult.unknownKeys.length > 0) {
-    logger.warning(
-      `Unrecognised keys in Default Setup configuration: ${schemaCheckResult.unknownKeys.join(", ")}`,
-    );
-    addNoLanguageDiagnostic(
-      undefined,
-      makeTelemetryDiagnostic(
-        "codeql-action/unrecognised-default-setup-config-keys",
-        "Unrecognised Default Setup configuration keys",
-        {
-          unrecognisedKeys: schemaCheckResult.unknownKeys,
-        },
-        ["internal-error"],
-      ),
-    );
-  }
-
-  // Combine all specified threat models from both sources.
-  const threatModels = new Set(fromConfigInput["threat-models"] || []);
-  for (const configFileThreatModel of fromConfigFile["threat-models"] || []) {
-    threatModels.add(configFileThreatModel);
-  }
-
-  // Warn if there is a 'default-setup' configuration key in the user-supplied configuration,
-  // since it is not meant to be used and we therefore ignore it here.
-  if (fromConfigFile["default-setup"]) {
-    logger.warning(
-      `The 'default-setup' configuration key is not supported in user-supplied configuration files and will be ignored.`,
-    );
-  }
-
-  // Since we expect the `fromConfigInput` configuration to be provided by Default Setup,
-  // we expect a limited set of options. Therefore, we base the overall configuration on
-  // the one provided via the `config-file` input, which may be richer.
-  const result = { ...fromConfigFile };
-  delete result["threat-models"];
-  delete result["default-setup"];
-
-  if (fromConfigInput["default-setup"]?.org?.["model-packs"]) {
-    result["default-setup"] = {
-      org: {
-        "model-packs": fromConfigInput["default-setup"].org["model-packs"],
-      },
-    };
-  }
-  if (threatModels.size > 0) {
-    result["threat-models"] = Array.from(threatModels);
-  }
-
-  return result;
-}
-
-/**
- * Represents additional configuration data from a source other than
- * a configuration file.
- */
-interface Augmentation {
-  /** Whether or not the `input` combines with data in the base config. */
-  combines: boolean;
-  /** The additional input data. */
-  input?: T;
-}
-
-/**
- * Describes how to augment the user config with inputs from the action.
- *
- * When running a CodeQL analysis, the user can supply a config file. When
- * running a CodeQL analysis from a GitHub action, the user can supply a
- * config file _and_ a set of inputs.
- *
- * The inputs from the action are used to augment the user config before
- * passing the user config to the CodeQL CLI invocation.
- */
-export interface AugmentationProperties {
-  /**
-   * Whether or not the queries input combines with the queries in the config.
-   */
-  queriesInputCombines: boolean;
-
-  /**
-   * The queries input from the `with` block of the action declaration
-   */
-  queriesInput?: QuerySpec[];
-
-  /**
-   * Whether or not the packs input combines with the packs in the config.
-   */
-  packsInputCombines: boolean;
-
-  /**
-   * The packs input from the `with` block of the action declaration
-   */
-  packsInput?: string[];
-
-  /**
-   * Extra queries from the corresponding repository property.
-   */
-  repoPropertyQueries: Augmentation;
-}
-
-/**
- * The default, empty augmentation properties. This is most useful
- * for tests.
- */
-export const defaultAugmentationProperties: AugmentationProperties = {
-  queriesInputCombines: false,
-  packsInputCombines: false,
-  packsInput: undefined,
-  queriesInput: undefined,
-  repoPropertyQueries: {
-    combines: false,
-    input: undefined,
-  },
-};
-
-/**
- * The convention in this action is that an input value that is prefixed with a '+' will
- * be combined with the corresponding value in the config file.
- *
- * Without a '+', an input value will override the corresponding value in the config file.
- *
- * @param inputValue The input value to process.
- * @returns true if the input value should replace the corresponding value in the config file,
- *          false if it should be appended.
- */
-function shouldCombine(inputValue?: string): boolean {
-  return !!inputValue?.trim().startsWith("+");
-}
-
-export type Packs = Partial>;
-
-export interface Pack {
-  name: string;
-  version?: string;
-  path?: string;
-}
-
-/**
- * Pack names must be in the form of `scope/name`, with only alpha-numeric characters,
- * and `-` allowed as long as not the first or last char.
- **/
-const PACK_IDENTIFIER_PATTERN = (function () {
-  const alphaNumeric = "[a-z0-9]";
-  const alphaNumericDash = "[a-z0-9-]";
-  const component = `${alphaNumeric}(${alphaNumericDash}*${alphaNumeric})?`;
-  return new RegExp(`^${component}/${component}$`);
-})();
-
-/**
- * Validates that this package specification is syntactically correct.
- * It may not point to any real package, but after this function returns
- * without throwing, we are guaranteed that the package specification
- * is roughly correct.
- *
- * The CLI itself will do a more thorough validation of the package
- * specification.
- *
- * A package specification looks like this:
- *
- * `scope/name@version:path`
- *
- * Version and path are optional.
- *
- * @param packStr the package specification to verify.
- */
-export function parsePacksSpecification(packStr: string): Pack {
-  if (typeof packStr !== "string") {
-    throw new ConfigurationError(errorMessages.getPacksStrInvalid(packStr));
-  }
-
-  packStr = packStr.trim();
-  const atIndex = packStr.indexOf("@");
-  const colonIndex = packStr.indexOf(":", atIndex);
-  const packStart = 0;
-  const versionStart = atIndex + 1 || undefined;
-  const pathStart = colonIndex + 1 || undefined;
-  const packEnd = Math.min(
-    atIndex > 0 ? atIndex : Infinity,
-    colonIndex > 0 ? colonIndex : Infinity,
-    packStr.length,
-  );
-  const versionEnd = versionStart
-    ? Math.min(colonIndex > 0 ? colonIndex : Infinity, packStr.length)
-    : undefined;
-  const pathEnd = pathStart ? packStr.length : undefined;
-
-  const packName = packStr.slice(packStart, packEnd).trim();
-  const version = versionStart
-    ? packStr.slice(versionStart, versionEnd).trim()
-    : undefined;
-  const packPath = pathStart
-    ? packStr.slice(pathStart, pathEnd).trim()
-    : undefined;
-
-  if (!PACK_IDENTIFIER_PATTERN.test(packName)) {
-    throw new ConfigurationError(errorMessages.getPacksStrInvalid(packStr));
-  }
-  if (version) {
-    try {
-      new semver.Range(version);
-    } catch {
-      // The range string is invalid. OK to ignore the caught error
-      throw new ConfigurationError(errorMessages.getPacksStrInvalid(packStr));
-    }
-  }
-
-  if (
-    packPath &&
-    (path.isAbsolute(packPath) ||
-      // Permit using "/" instead of "\" on Windows
-      // Use `x.split(y).join(z)` as a polyfill for `x.replaceAll(y, z)` since
-      // if we used a regex we'd need to escape the path separator on Windows
-      // which seems more awkward.
-      path.normalize(packPath).split(path.sep).join("/") !==
-        packPath.split(path.sep).join("/"))
-  ) {
-    throw new ConfigurationError(errorMessages.getPacksStrInvalid(packStr));
-  }
-
-  if (!packPath && pathStart) {
-    // 0 length path
-    throw new ConfigurationError(errorMessages.getPacksStrInvalid(packStr));
-  }
-
-  return {
-    name: packName,
-    version,
-    path: packPath,
-  };
-}
-
-export function validatePackSpecification(pack: string) {
-  return prettyPrintPack(parsePacksSpecification(pack));
-}
-
-// Exported for testing
-export function parsePacksFromInput(
-  rawPacksInput: string | undefined,
-  languages: Language[],
-  packsInputCombines: boolean,
-): Packs | undefined {
-  if (!rawPacksInput?.trim()) {
-    return undefined;
-  }
-
-  if (languages.length > 1) {
-    throw new ConfigurationError(
-      "Cannot specify a 'packs' input in a multi-language analysis. Use a codeql-config.yml file instead and specify packs by language.",
-    );
-  } else if (languages.length === 0) {
-    throw new ConfigurationError(
-      "No languages specified. Cannot process the packs input.",
-    );
-  }
-
-  rawPacksInput = rawPacksInput.trim();
-  if (packsInputCombines) {
-    rawPacksInput = rawPacksInput.trim().substring(1).trim();
-    if (!rawPacksInput) {
-      throw new ConfigurationError(
-        errorMessages.getConfigFilePropertyError(
-          undefined,
-          "packs",
-          "A '+' was used in the 'packs' input to specify that you wished to add some packs to your CodeQL analysis. However, no packs were specified. Please either remove the '+' or specify some packs.",
-        ),
-      );
-    }
-  }
-
-  return {
-    [languages[0]]: rawPacksInput.split(",").reduce((packs, pack) => {
-      packs.push(validatePackSpecification(pack));
-      return packs;
-    }, [] as string[]),
-  };
-}
-
-/**
- * Calculates how the codeql config file needs to be augmented before passing
- * it to the CLI. The reason this is necessary is the codeql-action can be called
- * with extra inputs from the workflow. These inputs are not part of the config
- * and the CLI does not know about these inputs so we need to inject them into
- * the config file sent to the CLI.
- *
- * @param rawPacksInput The packs input from the action configuration.
- * @param rawQueriesInput The queries input from the action configuration.
- * @param repositoryProperties The dictionary of repository properties.
- * @param languages The languages that the config file is for. If the packs input
- *    is non-empty, then there must be exactly one language. Otherwise, an
- *    error is thrown.
- *
- * @returns The properties that need to be augmented in the config file.
- *
- * @throws An error if the packs input is non-empty and the languages input does
- *     not have exactly one language.
- */
-export async function calculateAugmentation(
-  rawPacksInput: string | undefined,
-  rawQueriesInput: string | undefined,
-  repositoryProperties: RepositoryProperties,
-  languages: Language[],
-): Promise {
-  const packsInputCombines = shouldCombine(rawPacksInput);
-  const packsInput = parsePacksFromInput(
-    rawPacksInput,
-    languages,
-    packsInputCombines,
-  );
-  const queriesInputCombines = shouldCombine(rawQueriesInput);
-  const queriesInput = parseQueriesFromInput(
-    rawQueriesInput,
-    queriesInputCombines,
-  );
-
-  const repoExtraQueries =
-    repositoryProperties[RepositoryPropertyName.EXTRA_QUERIES];
-  const repoExtraQueriesCombines = shouldCombine(repoExtraQueries);
-  const repoPropertyQueries = {
-    combines: repoExtraQueriesCombines,
-    input: parseQueriesFromInput(
-      repoExtraQueries,
-      repoExtraQueriesCombines,
-      new ConfigurationError(
-        errorMessages.getRepoPropertyError(
-          RepositoryPropertyName.EXTRA_QUERIES,
-          errorMessages.getEmptyCombinesError(),
-        ),
-      ),
-    ),
-  };
-
-  return {
-    packsInputCombines,
-    packsInput: packsInput?.[languages[0]],
-    queriesInput,
-    queriesInputCombines,
-    repoPropertyQueries,
-  };
-}
-
-function parseQueriesFromInput(
-  rawQueriesInput: string | undefined,
-  queriesInputCombines: boolean,
-  errorToThrow?: ConfigurationError,
-) {
-  if (!rawQueriesInput) {
-    return undefined;
-  }
-
-  const trimmedInput = queriesInputCombines
-    ? rawQueriesInput.trim().slice(1).trim()
-    : (rawQueriesInput?.trim() ?? "");
-  if (queriesInputCombines && trimmedInput.length === 0) {
-    if (errorToThrow) {
-      throw errorToThrow;
-    }
-    throw new ConfigurationError(
-      errorMessages.getConfigFilePropertyError(
-        undefined,
-        "queries",
-        "A '+' was used in the 'queries' input to specify that you wished to add some packs to your CodeQL analysis. However, no packs were specified. Please either remove the '+' or specify some packs.",
-      ),
-    );
-  }
-  return trimmedInput.split(",").map((query) => ({ uses: query.trim() }));
-}
-
-/**
- * Combines queries from various configuration sources.
- *
- * @param logger The logger to use.
- * @param config The loaded configuration file (either `config-file` or `config` input).
- * @param augmentationProperties Additional configuration data from other sources.
- * @returns Returns `augmentedConfig` with `queries` set to the computed array of queries.
- */
-function combineQueries(
-  logger: Logger,
-  config: UserConfig,
-  augmentationProperties: AugmentationProperties,
-): QuerySpec[] {
-  const result: QuerySpec[] = [];
-
-  // Query settings obtained from the repository properties have the highest precedence.
-  if (augmentationProperties.repoPropertyQueries?.input) {
-    logger.info(
-      `Found query configuration in the repository properties (${RepositoryPropertyName.EXTRA_QUERIES}): ` +
-        `${augmentationProperties.repoPropertyQueries.input.map((q) => q.uses).join(", ")}`,
-    );
-
-    // If there are queries configured as a repository property, these may be organisational
-    // settings. If they don't allow combining with other query configurations, return just the
-    // ones configured in the repository properties.
-    if (!augmentationProperties.repoPropertyQueries.combines) {
-      logger.info(
-        `The queries configured in the repository properties don't allow combining with other query settings. ` +
-          `Any queries configured elsewhere will be ignored.`,
-      );
-      return augmentationProperties.repoPropertyQueries.input;
-    } else {
-      // Otherwise, add them to the query array and continue.
-      result.push(...augmentationProperties.repoPropertyQueries.input);
-    }
-  }
-
-  // If there is a `queries` input to the Action, it has the next highest precedence.
-  if (augmentationProperties.queriesInput) {
-    // If there is a `queries` input and `queriesInputCombines` is `false`, then we don't
-    // combine it with the queries configured in the configuration file (if any). That is the
-    // original behaviour of this property. However, we DO combine it with any queries that
-    // we obtained from the repository properties, since that may be enforced by the organisation.
-    if (!augmentationProperties.queriesInputCombines) {
-      return result.concat(augmentationProperties.queriesInput);
-    } else {
-      // If they combine, add them to the query array and continue.
-      result.push(...augmentationProperties.queriesInput);
-    }
-  }
-
-  // If we get to this point, we either don't have any extra configuration inputs or all of them
-  // allow themselves to be combined with the settings from the configuration file.
-  if (config.queries) {
-    result.push(...config.queries);
-  }
-
-  return result;
-}
-
-export function generateCodeScanningConfig(
-  logger: Logger,
-  originalUserInput: UserConfig,
-  augmentationProperties: AugmentationProperties,
-): UserConfig {
-  // make a copy so we can modify it
-  const augmentedConfig = cloneObject(originalUserInput);
-
-  // Inject the queries from the input
-  augmentedConfig.queries = combineQueries(
-    logger,
-    augmentedConfig,
-    augmentationProperties,
-  );
-  logger.debug(
-    `Combined queries: ${augmentedConfig.queries?.map((q) => q.uses).join(",")}`,
-  );
-  if (augmentedConfig.queries?.length === 0) {
-    delete augmentedConfig.queries;
-  }
-
-  // Inject the packs from the input
-  if (augmentationProperties.packsInput) {
-    if (augmentationProperties.packsInputCombines) {
-      // At this point, we already know that this is a single-language analysis
-      if (Array.isArray(augmentedConfig.packs)) {
-        augmentedConfig.packs = (augmentedConfig.packs || []).concat(
-          augmentationProperties.packsInput,
-        );
-      } else if (!augmentedConfig.packs) {
-        augmentedConfig.packs = augmentationProperties.packsInput;
-      } else {
-        // At this point, we know there is only one language.
-        // If there were more than one language, an error would already have been thrown.
-        const language = Object.keys(augmentedConfig.packs)[0];
-        augmentedConfig.packs[language] = augmentedConfig.packs[
-          language
-        ].concat(augmentationProperties.packsInput);
-      }
-    } else {
-      augmentedConfig.packs = augmentationProperties.packsInput;
-    }
-  }
-  if (Array.isArray(augmentedConfig.packs) && !augmentedConfig.packs.length) {
-    delete augmentedConfig.packs;
-  }
-
-  return augmentedConfig;
-}
-
-/**
- * Attempts to parse `contents` into a `UserConfig` value.
- *
- * @param logger The logger to use.
- * @param pathInput The path to the file where `contents` was obtained from, for use in error messages.
- * @param contents The string contents of a YAML file to try and parse as a `UserConfig`.
- * @param validateConfig Whether to validate the configuration file against the schema.
- * @returns The `UserConfig` corresponding to `contents`, if parsing was successful.
- * @throws A `ConfigurationError` if parsing failed.
- */
-export function parseUserConfig(
-  logger: Logger,
-  pathInput: string,
-  contents: string,
-  validateConfig: boolean,
-): UserConfig {
-  try {
-    const schema =
-      // eslint-disable-next-line @typescript-eslint/no-require-imports
-      require("../../src/db-config-schema.json") as jsonschema.Schema;
-
-    const doc = yaml.load(contents);
-
-    if (validateConfig) {
-      const result = new jsonschema.Validator().validate(doc, schema);
-
-      if (result.errors.length > 0) {
-        for (const error of result.errors) {
-          logger.error(error.stack);
-        }
-        throw new ConfigurationError(
-          errorMessages.getInvalidConfigFileMessage(
-            pathInput,
-            result.errors.map((e) => e.stack),
-          ),
-        );
-      }
-    }
-
-    return doc as UserConfig;
-  } catch (error) {
-    if (error instanceof yaml.YAMLException) {
-      throw new ConfigurationError(
-        errorMessages.getConfigFileParseErrorMessage(pathInput, error.message),
-      );
-    }
-    throw error;
-  }
-}
diff --git a/src/config/file.test.ts b/src/config/file.test.ts
deleted file mode 100644
index 0833ad3d06..0000000000
--- a/src/config/file.test.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-import * as github from "@actions/github";
-import test from "ava";
-import sinon from "sinon";
-
-import { AnalysisKind } from "../analyses";
-import * as api from "../api-client";
-import { RegistryProxyVars } from "../environment";
-import { Feature } from "../feature-flags";
-import { RepositoryPropertyName } from "../feature-flags/properties";
-import {
-  callee,
-  SAMPLE_DOTCOM_API_DETAILS,
-  setupTests,
-} from "../testing-utils";
-
-import { getConfigFileInput, getRemoteConfig } from "./file";
-
-setupTests(test);
-
-test("getConfigFileInput returns undefined by default", async (t) => {
-  await callee(getConfigFileInput)
-    .withArgs({}, undefined)
-    .withFeatures([Feature.ConfigFileRepositoryProperty])
-    .passes(t.is, undefined);
-});
-
-const repositoryProperties = {
-  [RepositoryPropertyName.CONFIG_FILE]: "/path/from/property",
-};
-
-test("getConfigFileInput returns input value", async (t) => {
-  const testInput = "/some/path";
-
-  // Even though both an input and repository property are configured,
-  // we prefer the direct input to the Action.
-  await callee(getConfigFileInput)
-    .withFeatures([Feature.ConfigFileRepositoryProperty])
-    .withActions((actionsEnv) => {
-      sinon
-        .stub(actionsEnv, "getOptionalInput")
-        .withArgs("config-file")
-        .returns(testInput);
-    })
-    .withArgs(repositoryProperties, undefined)
-    .logs(t, "Using configuration file input from workflow")
-    .passes(t.is, testInput);
-});
-
-test("getConfigFileInput returns repository property value", async (t) => {
-  // Since there is no direct input, we should use the repository property.
-  await callee(getConfigFileInput)
-    .withFeatures([Feature.ConfigFileRepositoryProperty])
-    .withArgs(repositoryProperties, undefined)
-    .logs(t, "Using configuration file input from repository property")
-    .passes(t.is, repositoryProperties[RepositoryPropertyName.CONFIG_FILE]);
-});
-
-test("getConfigFileInput returns repository property value for Code Scanning", async (t) => {
-  // Since there is no direct input, we should use the repository property.
-  await callee(getConfigFileInput)
-    .withFeatures([Feature.ConfigFileRepositoryProperty])
-    .withArgs(repositoryProperties, [AnalysisKind.CodeScanning])
-    .logs(t, "Using configuration file input from repository property")
-    .passes(t.is, repositoryProperties[RepositoryPropertyName.CONFIG_FILE]);
-});
-
-test("getConfigFileInput ignores repository property for other analysis kinds", async (t) => {
-  const unsupportedCases = [
-    [AnalysisKind.CodeQuality],
-    [AnalysisKind.RiskAssessment],
-    [AnalysisKind.CodeScanning, AnalysisKind.CodeQuality],
-  ];
-
-  const target = callee(getConfigFileInput).withFeatures([
-    Feature.ConfigFileRepositoryProperty,
-  ]);
-
-  for (const unsupportedCase of unsupportedCases) {
-    // Since the analysis kind is unsupported, we should ignore the repository property.
-    await target
-      .withArgs(repositoryProperties, unsupportedCase)
-      .logs(
-        t,
-        "Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind.",
-      )
-      .passes(t.is, undefined);
-  }
-});
-
-test("getConfigFileInput ignores empty repository property value", async (t) => {
-  // Since the repository property value is an empty/whitespace string, we should ignore it.
-  await callee(getConfigFileInput)
-    .withFeatures([Feature.ConfigFileRepositoryProperty])
-    .withArgs({ [RepositoryPropertyName.CONFIG_FILE]: "   " }, undefined)
-    .passes(t.is, undefined);
-});
-
-test("getConfigFileInput ignores repository property value when FF is off", async (t) => {
-  // Since the FF is off, we should ignore the repository property value.
-  await callee(getConfigFileInput)
-    .withFeatures([])
-    .withArgs(repositoryProperties, undefined)
-    .notLogs(t, "Using configuration file input from repository property")
-    .logs(
-      t,
-      "Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",
-    )
-    .passes(t.is, undefined);
-});
-
-test.serial("getRemoteConfig uses proxy when it is supposed to", async (t) => {
-  const client = github.getOctokit("123");
-  const response = {
-    data: {
-      content: Buffer.from("disable-default-queries: false").toString("base64"),
-    },
-  };
-  sinon
-    .stub(client.rest.repos, "getContent")
-    // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-    .resolves(response as any);
-
-  // We stub `getApiClientWithExternalAuth` so that it throws if no
-  // proxy is provided and returns the client otherwise. This allows us
-  // to verify the result in the following test cases.
-  const errorMessage = "No `proxy` was provided by the caller.";
-  sinon
-    .stub(api, "getApiClientWithExternalAuth")
-    .callsFake((_details, proxy) => {
-      // Throw if proxy isn't defined.
-      if (proxy === undefined) {
-        throw new Error(errorMessage);
-      }
-      // Otherwise return the client object.
-      return client;
-    });
-
-  const target = callee(getRemoteConfig)
-    .withDefaultActionsEnv()
-    .withArgs("file.yml", SAMPLE_DOTCOM_API_DETAILS);
-
-  // Should use it when the FF is enabled and the environment variables are set.
-  await target
-    .withFeatures([Feature.ProxyApiRequests])
-    .withEnv((env) => {
-      env.set(RegistryProxyVars.PROXY_HOST, "localhost");
-      env.set(RegistryProxyVars.PROXY_PORT, "1234");
-    })
-    .logs(t, "Using private registry proxy at 'http://localhost:1234'")
-    .passes(t.truthy);
-
-  // But not when the FF is not enabled.
-  await target
-    .withEnv((env) => {
-      env.set(RegistryProxyVars.PROXY_HOST, "localhost");
-      env.set(RegistryProxyVars.PROXY_PORT, "1234");
-    })
-    .notLogs(t, "Using private registry proxy at 'http://localhost:1234'")
-    .throws(t, { message: errorMessage });
-
-  // And not when the environment variables aren't set.
-  await target
-    .withFeatures([Feature.ProxyApiRequests])
-    .notLogs(t, "Using private registry proxy at 'http://localhost:1234'")
-    .throws(t, { message: errorMessage });
-});
diff --git a/src/config/file.ts b/src/config/file.ts
deleted file mode 100644
index be0e415a38..0000000000
--- a/src/config/file.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import { ActionState } from "../action-common";
-import { AnalysisKind } from "../analyses";
-import * as api from "../api-client";
-import * as errorMessages from "../error-messages";
-import { Feature } from "../feature-flags";
-import {
-  RepositoryProperties,
-  RepositoryPropertyName,
-} from "../feature-flags/properties";
-import { ConfigurationError } from "../util";
-
-import { parseUserConfig, UserConfig } from "./db-config";
-import { parseRemoteFileAddress } from "./remote-file";
-
-/**
- * The prefix that can be specified to indicate that a path should be treated as a local file address.
- */
-export const LOCAL_PATH_PREFIX = "./";
-
-/**
- * The prefix that can be specified to indicate that a path should be treated as a remote file address.
- * The new remote file address format must start with either an owner or repository name. Both
- * are restricted to ASCII characters, '.', and '-'. The prefix chosen here does not interfere with
- * those (since it contains an `=`) and is _unlikely_ (but not impossible) to appear in a local file path.
- */
-export const REMOTE_PATH_PREFIX = "remote=";
-
-/**
- * Gets the value that is configured for the configuration file, if any.
- */
-export async function getConfigFileInput(
-  {
-    logger,
-    actions,
-    features,
-  }: ActionState<["Logger", "Actions", "FeatureFlags"]>,
-  repositoryProperties: Partial,
-  analysisKinds: AnalysisKind[] | undefined,
-): Promise {
-  const input = actions.getOptionalInput("config-file");
-
-  if (input !== undefined) {
-    logger.info(`Using configuration file input from workflow: ${input}`);
-    return input;
-  }
-
-  const propertyValue =
-    repositoryProperties[RepositoryPropertyName.CONFIG_FILE];
-
-  // Only allow the repository property to be used for standard Code Scanning analyses,
-  // since we don't currently support some customisation options for Code Quality.
-  // We don't expect customisations for Risk Assessments either.
-  const analysisKindSupported =
-    analysisKinds === undefined ||
-    (analysisKinds.includes(AnalysisKind.CodeScanning) &&
-      analysisKinds.length === 1);
-
-  if (propertyValue !== undefined && propertyValue.trim().length > 0) {
-    // Only use the repository property value if the FF is enabled.
-    const useRepositoryProperty = await features.getValue(
-      Feature.ConfigFileRepositoryProperty,
-    );
-
-    if (analysisKindSupported && useRepositoryProperty) {
-      logger.info(
-        `Using configuration file input from repository property: ${propertyValue}`,
-      );
-      return propertyValue;
-    } else if (!analysisKindSupported) {
-      logger.info(
-        "Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind.",
-      );
-    } else {
-      logger.info(
-        "Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",
-      );
-    }
-  }
-
-  return undefined;
-}
-
-/**
- * Attempts to fetch a `UserConfig` from a remote `address`.
- *
- * @param actionState The current Action state.
- * @param configFile The remote address of the configuration file.
- * @param apiDetails Information about how to connect to the API.
- *
- * @returns The `UserConfig`, if it could be fetched and parsed successfully.
- */
-export async function getRemoteConfig(
-  actionState: ActionState<["Logger", "Env", "FeatureFlags"]>,
-  configFile: string,
-  apiDetails: api.GitHubApiCombinedDetails,
-): Promise {
-  const address = await parseRemoteFileAddress(actionState, configFile);
-
-  const shouldProxyRequest = await actionState.features.getValue(
-    Feature.ProxyApiRequests,
-  );
-  const proxy = shouldProxyRequest
-    ? api.getRegistryProxy(actionState)
-    : undefined;
-
-  const response = await api
-    .getApiClientWithExternalAuth(apiDetails, proxy)
-    .rest.repos.getContent({
-      owner: address.owner,
-      repo: address.repo,
-      path: address.path,
-      ref: address.ref,
-    });
-
-  let fileContents: string;
-  if ("content" in response.data && response.data.content !== undefined) {
-    fileContents = response.data.content;
-  } else if (Array.isArray(response.data)) {
-    throw new ConfigurationError(
-      errorMessages.getConfigFileDirectoryGivenMessage(configFile),
-    );
-  } else {
-    throw new ConfigurationError(
-      errorMessages.getConfigFileFormatInvalidMessage(configFile),
-    );
-  }
-
-  const validateConfig = await actionState.features.getValue(
-    Feature.ValidateDbConfig,
-  );
-  return parseUserConfig(
-    actionState.logger,
-    configFile,
-    Buffer.from(fileContents, "base64").toString("binary"),
-    validateConfig,
-  );
-}
diff --git a/src/config/inputs.test.ts b/src/config/inputs.test.ts
deleted file mode 100644
index 851dd72e2f..0000000000
--- a/src/config/inputs.test.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-import test from "ava";
-import sinon from "sinon";
-
-import { ActionsEnv } from "../actions-util";
-import { Feature } from "../feature-flags";
-import { RepositoryPropertyName } from "../feature-flags/properties";
-import { callee } from "../testing-utils";
-
-import { ComputedInput, getToolsInput, InputName, InputSource } from "./inputs";
-
-test("getToolsInput - undefined if there's no input", async (t) => {
-  await callee(getToolsInput).withArgs({}).passes(t.is, undefined);
-});
-
-const expectedWorkflowResult: ComputedInput = {
-  source: InputSource.Workflow,
-  value: "workflow-input-value",
-};
-
-const expectedRepositoryPropertyResult: ComputedInput = {
-  source: InputSource.RepositoryProperty,
-  value: "repo-property-input-value",
-};
-
-function stubGetToolsInput(actions: ActionsEnv) {
-  sinon
-    .stub(actions, "getOptionalInput")
-    .withArgs(InputName.Tools)
-    .returns(expectedWorkflowResult.value);
-}
-
-const workflowLogMessage = `Using ${InputName.Tools} input from workflow:`;
-
-test("getToolsInput - returns workflow input if available", async (t) => {
-  await callee(getToolsInput)
-    .withActions(stubGetToolsInput)
-    .withArgs({})
-    .logs(t, workflowLogMessage)
-    .passes(t.deepEqual, expectedWorkflowResult);
-});
-
-test("getToolsInput - returns repository property value if enforced", async (t) => {
-  const target = callee(getToolsInput)
-    .withActions(stubGetToolsInput)
-    .withArgs({
-      [RepositoryPropertyName.TOOLS]: `!${expectedRepositoryPropertyResult.value}`,
-    });
-
-  // We expect the repository value if provided and the FF is enabled.
-  const enforcedLogMessage = `Using ${InputName.Tools} input from repository property (enforced):`;
-  await target
-    .withFeatures([Feature.ToolsRepositoryProperty])
-    .logs(t, enforcedLogMessage)
-    .passes(t.deepEqual, expectedRepositoryPropertyResult);
-  await target
-    .notLogs(t, enforcedLogMessage)
-    .logs(t, workflowLogMessage)
-    .passes(t.deepEqual, expectedWorkflowResult);
-});
-
-test("getToolsInput - prefers workflow input", async (t) => {
-  const target = callee(getToolsInput)
-    .withActions(stubGetToolsInput)
-    .withArgs({
-      [RepositoryPropertyName.TOOLS]: expectedRepositoryPropertyResult.value,
-    });
-
-  // We expect the workflow input regardless of the FF state.
-  await target
-    .withFeatures([Feature.ToolsRepositoryProperty])
-    .logs(t, workflowLogMessage)
-    .passes(t.deepEqual, expectedWorkflowResult);
-  await target
-    .logs(t, workflowLogMessage)
-    .passes(t.deepEqual, expectedWorkflowResult);
-});
-
-test("getToolsInput - returns repository property", async (t) => {
-  const target = callee(getToolsInput).withArgs({
-    [RepositoryPropertyName.TOOLS]: expectedRepositoryPropertyResult.value,
-  });
-
-  // We expect the repository property if the FF is enabled or undefined otherwise.
-  await target
-    .withFeatures([Feature.ToolsRepositoryProperty])
-    .logs(t, `Using ${InputName.Tools} input from repository property:`)
-    .passes(t.deepEqual, expectedRepositoryPropertyResult);
-  await target.passes(t.is, undefined);
-});
diff --git a/src/config/inputs.ts b/src/config/inputs.ts
deleted file mode 100644
index 32a8dfd6f6..0000000000
--- a/src/config/inputs.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { ActionState } from "../action-common";
-import { Feature } from "../feature-flags";
-import {
-  RepositoryProperties,
-  RepositoryPropertyName,
-} from "../feature-flags/properties";
-
-/** Enumerates input names. */
-export enum InputName {
-  Tools = "tools",
-}
-
-/** Enumerates input sources. */
-export enum InputSource {
-  Workflow = "workflow",
-  RepositoryProperty = "repository-property",
-}
-
-/**
- * Represents an effective input to the CodeQL Action. That is,
- * the input value that was computed or selected from multiple sources.
- */
-export type ComputedInput = {
-  /** The value of the property. */
-  value: string;
-  /** The source of the property. */
-  source: InputSource;
-};
-
-/**
- * Gets the computed `tools` input. This comes from either the workflow or
- * the repository property.
- *
- * @param action The Action state.
- * @param repositoryProperties The values of known repository properties.
- * @returns The computed input or `undefined` if there is no input.
- */
-export async function getToolsInput(
-  action: ActionState<["Logger", "Actions", "FeatureFlags"]>,
-  repositoryProperties: Partial,
-): Promise {
-  const name = InputName.Tools;
-  const input = action.actions.getOptionalInput(name);
-  const propertyValue = repositoryProperties[RepositoryPropertyName.TOOLS];
-  const allowRepositoryProperty = await action.features.getValue(
-    Feature.ToolsRepositoryProperty,
-  );
-
-  // The repository property takes precedence if it starts with an '!'.
-  if (allowRepositoryProperty && propertyValue?.startsWith("!")) {
-    action.logger.info(
-      `Using ${name} input from repository property (enforced): ${propertyValue}`,
-    );
-    return {
-      // Drop the '!' from the value.
-      value: propertyValue.substring(1),
-      source: InputSource.RepositoryProperty,
-    };
-  }
-
-  // Otherwise, the input from the workflow takes precedence.
-  if (input !== undefined) {
-    action.logger.info(`Using ${name} input from workflow: ${input}`);
-    return { value: input, source: InputSource.Workflow };
-  }
-
-  // Use the repository property if there's no workflow input.
-  if (allowRepositoryProperty && propertyValue !== undefined) {
-    action.logger.info(
-      `Using ${name} input from repository property: ${propertyValue}`,
-    );
-    return {
-      value: propertyValue,
-      source: InputSource.RepositoryProperty,
-    };
-  }
-
-  // There's no input.
-  return undefined;
-}
diff --git a/src/config/pack-registries.ts b/src/config/pack-registries.ts
deleted file mode 100644
index 76d2f6cd47..0000000000
--- a/src/config/pack-registries.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import * as yaml from "js-yaml";
-
-import { ConfigurationError } from "../util";
-
-export type RegistryConfigWithCredentials = RegistryConfigNoCredentials & {
-  // Token to use when downloading packs from this registry.
-  token: string;
-};
-
-/**
- * The list of registries and the associated pack globs that determine where each
- * pack can be downloaded from.
- */
-export interface RegistryConfigNoCredentials {
-  // URL of a package registry, eg- https://ghcr.io/v2/
-  url: string;
-
-  // List of globs that determine which packs are associated with this registry.
-  packages: string[] | string;
-
-  // Kind of registry, either "github" or "docker". Default is "docker".
-  // "docker" refers specifically to the GitHub Container Registry, which is the usual way of sharing CodeQL packs.
-  // "github" refers to packs published as content in a GitHub repository. This kind of registry is used in scenarios
-  // where GHCR is not available, such as certain GHES environments.
-  kind?: "github" | "docker";
-}
-
-export function parseRegistries(
-  registriesInput: string | undefined,
-): RegistryConfigWithCredentials[] | undefined {
-  try {
-    return registriesInput
-      ? (yaml.load(registriesInput) as RegistryConfigWithCredentials[])
-      : undefined;
-  } catch {
-    throw new ConfigurationError(
-      "Invalid registries input. Must be a YAML string.",
-    );
-  }
-}
-
-export function parseRegistriesWithoutCredentials(
-  registriesInput?: string,
-): RegistryConfigNoCredentials[] | undefined {
-  return parseRegistries(registriesInput)?.map((r) => {
-    const { url, packages, kind } = r;
-    return { url, packages, kind };
-  });
-}
diff --git a/src/config/remote-file.test.ts b/src/config/remote-file.test.ts
deleted file mode 100644
index e263e6d79a..0000000000
--- a/src/config/remote-file.test.ts
+++ /dev/null
@@ -1,229 +0,0 @@
-import test from "ava";
-import sinon from "sinon";
-
-import { ActionsEnvVars } from "../environment";
-import { callee } from "../testing-utils";
-import { ConfigurationError } from "../util";
-
-import {
-  DEFAULT_CONFIG_FILE_NAME,
-  DEFAULT_CONFIG_FILE_REF,
-  parseRemoteFileAddress,
-  RemoteFileAddress,
-} from "./remote-file";
-
-type ParseRemoteFileAddressTest = {
-  input: string;
-  expected: RemoteFileAddress;
-};
-
-test("parseRemoteFileAddress accepts full remote addresses", async (t) => {
-  const target = callee(parseRemoteFileAddress);
-
-  const expected: RemoteFileAddress = {
-    owner: "owner",
-    repo: "repo",
-    path: "path",
-    ref: "ref",
-  };
-
-  const oldFormatInputs: ParseRemoteFileAddressTest[] = [
-    { input: "owner/repo/path@ref", expected },
-    { input: "owner  /repo/path@ref", expected },
-    { input: "owner/   repo/path@ref", expected },
-    { input: "owner/repo   /path@ref", expected },
-    { input: "owner/repo/   path@ref", expected },
-    { input: "owner/repo/path   @ref", expected },
-    { input: "owner/repo/path@   ref", expected },
-    {
-      input: "owner/repo/path/to/codeql.yml@ref/feature",
-      expected: { ...expected, path: "path/to/codeql.yml", ref: "ref/feature" },
-    },
-    {
-      input: "  owner/repo/path/to/codeql.yml@ref/feature  ",
-      expected: { ...expected, path: "path/to/codeql.yml", ref: "ref/feature" },
-    },
-  ];
-
-  for (const oldFormatInput of oldFormatInputs) {
-    await target
-      .withArgs(oldFormatInput.input)
-      .passes(t.deepEqual, oldFormatInput.expected);
-  }
-
-  // New format.
-  const newFormatInputs: ParseRemoteFileAddressTest[] = [
-    { input: "owner/repo@ref:path", expected },
-    { input: "owner  /repo@ref:path", expected },
-    { input: "owner/   repo@ref:path", expected },
-    { input: "owner/repo   @ref:path", expected },
-    { input: "owner/repo@   ref:path", expected },
-    { input: "owner/repo@ref   :path", expected },
-    { input: "owner/repo@ref:   path", expected },
-    {
-      input: "owner/repo@ref/feature:path/to/codeql.yml",
-      expected: { ...expected, path: "path/to/codeql.yml", ref: "ref/feature" },
-    },
-    {
-      input: "  owner/repo@ref/feature:path/to/codeql.yml  ",
-      expected: { ...expected, path: "path/to/codeql.yml", ref: "ref/feature" },
-    },
-  ];
-
-  for (const newFormatInput of newFormatInputs) {
-    const targetWithArgs = target.withArgs(newFormatInput.input);
-
-    await targetWithArgs.passes(t.deepEqual, newFormatInput.expected);
-  }
-});
-
-test("parseRemoteFileAddress accepts remote address without an owner", async (t) => {
-  const owner = "test-owner";
-  const target = callee(parseRemoteFileAddress).withEnv((env) => {
-    const getRequired = sinon.stub(env, "getRequired");
-    getRequired
-      .withArgs(ActionsEnvVars.GITHUB_REPOSITORY)
-      .returns(`${owner}/current-repo`);
-  });
-
-  const testCases: ParseRemoteFileAddressTest[] = [
-    {
-      input: "repo@ref:path.yml",
-      expected: {
-        owner,
-        repo: "repo",
-        path: "path.yml",
-        ref: "ref",
-      },
-    },
-    {
-      input: "repo@ref",
-      expected: {
-        owner,
-        repo: "repo",
-        path: DEFAULT_CONFIG_FILE_NAME,
-        ref: "ref",
-      },
-    },
-    {
-      input: "repo:path.yml",
-      expected: {
-        owner,
-        repo: "repo",
-        path: "path.yml",
-        ref: DEFAULT_CONFIG_FILE_REF,
-      },
-    },
-    {
-      input: "repo",
-      expected: {
-        owner,
-        repo: "repo",
-        path: DEFAULT_CONFIG_FILE_NAME,
-        ref: DEFAULT_CONFIG_FILE_REF,
-      },
-    },
-  ];
-
-  for (const testCase of testCases) {
-    const targetWithArgs = target.withArgs(testCase.input);
-
-    await targetWithArgs.passes(t.deepEqual, testCase.expected);
-  }
-});
-
-test("parseRemoteFileAddress throws for invalid `GITHUB_REPOSITORY`", async (t) => {
-  const getRequired: sinon.SinonStub = sinon.stub();
-  getRequired.withArgs(ActionsEnvVars.GITHUB_REPOSITORY).returns(`not-valid`);
-
-  const target = callee(parseRemoteFileAddress)
-    .withArgs("repo@ref")
-    .withEnv((env) => {
-      sinon.define(env, "getRequired", getRequired);
-    });
-
-  await target.throws(t, { instanceOf: Error });
-
-  t.assert(getRequired.calledOnceWith(ActionsEnvVars.GITHUB_REPOSITORY));
-});
-
-test("parseRemoteFileAddress accepts remote address without a path", async (t) => {
-  const target = callee(parseRemoteFileAddress);
-
-  const testCases: ParseRemoteFileAddressTest[] = [
-    {
-      input: "owner/repo@ref",
-      expected: {
-        owner: "owner",
-        repo: "repo",
-        path: DEFAULT_CONFIG_FILE_NAME,
-        ref: "ref",
-      },
-    },
-    {
-      input: "owner/repo",
-      expected: {
-        owner: "owner",
-        repo: "repo",
-        path: DEFAULT_CONFIG_FILE_NAME,
-        ref: DEFAULT_CONFIG_FILE_REF,
-      },
-    },
-  ];
-
-  for (const testCase of testCases) {
-    const targetWithArgs = target.withArgs(testCase.input);
-
-    await targetWithArgs.passes(t.deepEqual, testCase.expected);
-  }
-});
-
-test("parseRemoteFileAddress accepts remote address without a ref", async (t) => {
-  const target = callee(parseRemoteFileAddress).withArgs("owner/repo:path");
-
-  await target.passes(t.deepEqual, {
-    owner: "owner",
-    repo: "repo",
-    path: "path",
-    ref: DEFAULT_CONFIG_FILE_REF,
-  } satisfies RemoteFileAddress);
-});
-
-test("parseRemoteFileAddress rejects invalid values", async (t) => {
-  const owner = "owner";
-  const target = callee(parseRemoteFileAddress).withEnv((env) => {
-    const getRequired = sinon.stub(env, "getRequired");
-    getRequired
-      .withArgs(ActionsEnvVars.GITHUB_REPOSITORY)
-      .returns(`${owner}/current-repo`);
-  });
-
-  const testInputs = [
-    "  ",
-    "repo//absolute",
-    "repo:/absolute",
-    "/repo@ref",
-    "   /repo@ref",
-    "repo@",
-    "repo:",
-    "repo/",
-    "/repo",
-    ":path",
-    "@ref",
-    "@ref:path",
-    "owner/@ref:path",
-    "owner/@ref",
-    "owner/:path",
-  ];
-
-  for (const testInput of testInputs) {
-    const targetWithArgs = target.withArgs(testInput);
-
-    await targetWithArgs.throws(t, {
-      // When the new format is accepted, there are some more specific
-      // errors in some cases. It is sufficient for us to check that
-      // an exception is thrown.
-      instanceOf: ConfigurationError,
-    });
-  }
-});
diff --git a/src/config/remote-file.ts b/src/config/remote-file.ts
deleted file mode 100644
index 1052072a28..0000000000
--- a/src/config/remote-file.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-import { ActionState } from "../action-common";
-import { ActionsEnvVars, ReadOnlyEnv } from "../environment";
-import * as errorMessages from "../error-messages";
-import { ConfigurationError, Failure, Result, Success } from "../util";
-
-/** Represents remote file addresses. */
-export interface RemoteFileAddress {
-  /** The owner of the repository. */
-  owner: string;
-  /** The repository name. */
-  repo: string;
-  /** The path of the file. */
-  path: string;
-  /** The ref of the repository. */
-  ref: string;
-}
-
-/** The default file path to use in configuration file shorthands. */
-export const DEFAULT_CONFIG_FILE_NAME = ".github/codeql-config.yml";
-
-/** The default ref to use in configuration file shorthands. */
-export const DEFAULT_CONFIG_FILE_REF = "main";
-
-/** Extracts the owner from the `GITHUB_REPOSITORY` environment variable. */
-function getDefaultOwner(env: ReadOnlyEnv): string {
-  const currentRepoNwo = env.getRequired(ActionsEnvVars.GITHUB_REPOSITORY);
-  const nwoParts = currentRepoNwo.split("/");
-
-  if (nwoParts.length !== 2 || nwoParts[0].trim().length === 0) {
-    // This shouldn't happen, so we should throw if `GITHUB_REPOSITORY` doesn't match
-    // our expectations.
-    throw new Error(
-      `Expected ${ActionsEnvVars.GITHUB_REPOSITORY} to contain a name with owner, but got '${currentRepoNwo}'.`,
-    );
-  }
-
-  return nwoParts[0].trim();
-}
-
-/**
- * The old remote address format that's always been supported for the `config-file` input.
- * All the components are required. Unchanged from the previous implementation.
- */
-const OLD_REMOTE_ADDRESS_FORMAT = new RegExp(
-  "(?[^/]+)/(?[^/]+)/(?[^@]+)@(?.*)",
-);
-
-/**
- * Attempts to parse `input` as a `RemoteFileAddress` using the old format.
- *
- * @param input The input to try and parse.
- * @returns A `RemoteFileAddress` value if successful or `undefined` otherwise.
- */
-function parseOldRemoteFileAddress(
-  input: string,
-): Result {
-  const pieces = OLD_REMOTE_ADDRESS_FORMAT.exec(input);
-
-  // 5 = 4 groups + the whole expression
-  if (pieces?.groups === undefined || pieces.length < 5) {
-    return new Failure(undefined);
-  }
-
-  return new Success({
-    owner: pieces.groups.owner.trim(),
-    repo: pieces.groups.repo.trim(),
-    path: pieces.groups.path.trim(),
-    ref: pieces.groups.ref.trim(),
-  });
-}
-
-/**
- * Attempts to parse `input` as a `RemoteFileAddress` using the new format.
- *
- * @param env The read-only environment to obtain the owner name from if needed.
- * @param configFile The input to try and parse.
- * @returns A `RemoteFileAddress` value if successful or `undefined` otherwise.
- */
-export function parseNewRemoteFileAddress(
-  env: ReadOnlyEnv,
-  configFile: string,
-): Result {
-  // retrieve the various parts of the config location, and ensure they're present
-  const format = new RegExp(
-    "^((?[^:@/]+)/)?(?[^:@/]+)(@(?[^:]+))?(:(?.+))?$",
-  );
-  const pieces = format.exec(configFile.trim());
-
-  const repo: string | undefined = pieces?.groups?.repo?.trim();
-
-  // Check that the regular expression matched and that we have at least the repo name.
-  if (!pieces?.groups || !repo || repo.length === 0) {
-    return new Failure(undefined);
-  }
-
-  const owner: string | undefined = pieces.groups.owner?.trim();
-  const path: string | undefined = pieces.groups.path?.trim();
-  const ref: string | undefined = pieces.groups.ref?.trim();
-
-  return new Success({
-    owner: owner || getDefaultOwner(env),
-    repo,
-    path: path || DEFAULT_CONFIG_FILE_NAME,
-    ref: ref || DEFAULT_CONFIG_FILE_REF,
-  });
-}
-
-/**
- * Attempts to parse `configFile` into an array of `RemoteFileAddress` components.
- *
- * @param actionState The current Action state.
- * @param configFile The string to try and parse.
- * @returns The successful result of executing the regex.
- * @throws `ConfigurationError` if the format of `configFile` is not valid.
- */
-export async function parseRemoteFileAddress(
-  actionState: ActionState<["FeatureFlags", "Env"]>,
-  configFile: string,
-): Promise {
-  // Try to parse the input using the old format. If successful, return the
-  // resulting `RemoteFileAddress`. Otherwise, continue using the new format.
-  const oldFormatAddressResult = parseOldRemoteFileAddress(configFile);
-
-  if (oldFormatAddressResult.isSuccess()) {
-    return oldFormatAddressResult.value;
-  }
-
-  // retrieve the various parts of the config location, and ensure they're present
-  const newFormatAddressResult = parseNewRemoteFileAddress(
-    actionState.env,
-    configFile,
-  );
-
-  if (newFormatAddressResult.isFailure()) {
-    // Neither the old format nor the new format worked. Throw an error that
-    // explains the format we accept. We only mention the new format, since that's
-    // what we want to be used going forward.
-    throw new ConfigurationError(
-      errorMessages.getConfigFileRepoFormatInvalidMessage(configFile),
-    );
-  }
-
-  const address = newFormatAddressResult.value;
-
-  // Ensure that the path is a relative path.
-  if (address.path.startsWith("/")) {
-    throw new ConfigurationError(
-      `The path component of '${configFile}' cannot be an absolute path.`,
-    );
-  }
-
-  return address;
-}
diff --git a/src/database-upload.test.ts b/src/database-upload.test.ts
deleted file mode 100644
index bcaf9f1c9e..0000000000
--- a/src/database-upload.test.ts
+++ /dev/null
@@ -1,528 +0,0 @@
-import * as fs from "fs";
-
-import * as github from "@actions/github";
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import { AnalysisKind } from "./analyses";
-import { GitHubApiDetails } from "./api-client";
-import * as apiClient from "./api-client";
-import { createStubCodeQL } from "./codeql";
-import { Config } from "./config-utils";
-import { cleanupAndUploadDatabases } from "./database-upload";
-import { Feature } from "./feature-flags";
-import * as gitUtils from "./git-utils";
-import { BuiltInLanguage } from "./languages";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import { RepositoryNwo } from "./repository";
-import {
-  checkExpectedLogMessages,
-  createFeatures,
-  createTestConfig,
-  getRecordingLogger,
-  LoggedMessage,
-  setupActionsVars,
-  setupTests,
-} from "./testing-utils";
-import {
-  CleanupLevel,
-  GitHubVariant,
-  HTTPError,
-  initializeEnvironment,
-  withTmpDir,
-} from "./util";
-
-setupTests(test);
-
-test.beforeEach(() => {
-  initializeEnvironment("1.2.3");
-});
-
-const testRepoName: RepositoryNwo = { owner: "github", repo: "example" };
-const testApiDetails: GitHubApiDetails = {
-  auth: "1234",
-  url: "https://github.com",
-  apiURL: undefined,
-};
-
-function getTestConfig(tmpDir: string): Config {
-  return createTestConfig({
-    languages: [BuiltInLanguage.javascript],
-    dbLocation: tmpDir,
-  });
-}
-
-async function mockHttpRequests(databaseUploadStatusCode: number) {
-  // Passing an auth token is required, so we just use a dummy value
-  const client = github.getOctokit("123");
-
-  const requestSpy = sinon.stub(client, "request");
-
-  const url =
-    "POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid";
-  const databaseUploadSpy = requestSpy.withArgs(url);
-  if (databaseUploadStatusCode < 300) {
-    databaseUploadSpy.resolves(undefined);
-  } else {
-    databaseUploadSpy.throws(
-      new HTTPError("some error message", databaseUploadStatusCode),
-    );
-  }
-
-  sinon.stub(apiClient, "getApiClient").value(() => client);
-
-  return databaseUploadSpy;
-}
-
-function getCodeQL() {
-  return createStubCodeQL({
-    async databaseBundle(_: string, outputFilePath: string) {
-      fs.writeFileSync(outputFilePath, "");
-    },
-    async databaseCleanupCluster() {
-      // Do nothing, as we are not testing cleanup here.
-    },
-  });
-}
-
-test.serial(
-  "Abort database upload if 'upload-database' input set to false",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getRequiredInput")
-        .withArgs("upload-database")
-        .returns("false");
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-      const loggedMessages: LoggedMessage[] = [];
-      await cleanupAndUploadDatabases(
-        testRepoName,
-        getCodeQL(),
-        getTestConfig(tmpDir),
-        testApiDetails,
-        createFeatures([]),
-        getRecordingLogger(loggedMessages),
-      );
-      checkExpectedLogMessages(t, loggedMessages, [
-        "Database upload disabled in workflow. Skipping upload.",
-      ]);
-    });
-  },
-);
-
-test.serial(
-  "Abort database upload if 'analysis-kinds: code-scanning' is not enabled",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getRequiredInput")
-        .withArgs("upload-database")
-        .returns("true");
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-      await mockHttpRequests(201);
-
-      const loggedMessages: LoggedMessage[] = [];
-      await cleanupAndUploadDatabases(
-        testRepoName,
-        getCodeQL(),
-        {
-          ...getTestConfig(tmpDir),
-          analysisKinds: [AnalysisKind.CodeQuality],
-        },
-        testApiDetails,
-        createFeatures([]),
-        getRecordingLogger(loggedMessages),
-      );
-      checkExpectedLogMessages(t, loggedMessages, [
-        "Not uploading database because 'analysis-kinds: code-scanning' is not enabled.",
-      ]);
-    });
-  },
-);
-
-test.serial("Abort database upload if running against GHES", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-    sinon
-      .stub(actionsUtil, "getRequiredInput")
-      .withArgs("upload-database")
-      .returns("true");
-    sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-    const config = getTestConfig(tmpDir);
-    config.gitHubVersion = { type: GitHubVariant.GHES, version: "3.0" };
-
-    const loggedMessages: LoggedMessage[] = [];
-    await cleanupAndUploadDatabases(
-      testRepoName,
-      getCodeQL(),
-      config,
-      testApiDetails,
-      createFeatures([]),
-      getRecordingLogger(loggedMessages),
-    );
-    checkExpectedLogMessages(t, loggedMessages, [
-      "Not running against github.com or GHEC-DR. Skipping upload.",
-    ]);
-  });
-});
-
-test.serial(
-  "Abort database upload if not analyzing default branch",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getRequiredInput")
-        .withArgs("upload-database")
-        .returns("true");
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(false);
-
-      const loggedMessages: LoggedMessage[] = [];
-      await cleanupAndUploadDatabases(
-        testRepoName,
-        getCodeQL(),
-        getTestConfig(tmpDir),
-        testApiDetails,
-        createFeatures([]),
-        getRecordingLogger(loggedMessages),
-      );
-      checkExpectedLogMessages(t, loggedMessages, [
-        "Not analyzing default branch. Skipping upload.",
-      ]);
-    });
-  },
-);
-
-test.serial(
-  "Don't crash if uploading a database fails with a non-retryable error",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getRequiredInput")
-        .withArgs("upload-database")
-        .returns("true");
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-      const databaseUploadSpy = await mockHttpRequests(422);
-
-      const loggedMessages: LoggedMessage[] = [];
-      await cleanupAndUploadDatabases(
-        testRepoName,
-        getCodeQL(),
-        getTestConfig(tmpDir),
-        testApiDetails,
-        createFeatures([]),
-        getRecordingLogger(loggedMessages),
-      );
-
-      checkExpectedLogMessages(t, loggedMessages, [
-        "Failed to upload database for javascript: some error message",
-      ]);
-
-      // Non-retryable errors should not be retried.
-      t.is(databaseUploadSpy.callCount, 1);
-    });
-  },
-);
-
-test.serial(
-  "Don't crash if uploading a database fails with a retryable error",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getRequiredInput")
-        .withArgs("upload-database")
-        .returns("true");
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-      const databaseUploadSpy = await mockHttpRequests(500);
-
-      // Stub setTimeout to fire immediately to avoid real delays from retry backoff.
-      const originalSetTimeout = global.setTimeout;
-      const setTimeoutStub = sinon
-        .stub(global, "setTimeout")
-        .callsFake((fn: () => void) => originalSetTimeout(fn, 0));
-
-      const loggedMessages: LoggedMessage[] = [];
-      await cleanupAndUploadDatabases(
-        testRepoName,
-        getCodeQL(),
-        getTestConfig(tmpDir),
-        testApiDetails,
-        createFeatures([]),
-        getRecordingLogger(loggedMessages),
-      );
-
-      checkExpectedLogMessages(t, loggedMessages, [
-        "Failed to upload database for javascript: some error message",
-      ]);
-
-      // Retryable errors should be retried the expected number of times.
-      t.is(databaseUploadSpy.callCount, 4);
-
-      // setTimeout should have been called with the expected backoff delays.
-      const setTimeoutDelays = setTimeoutStub.args.map(
-        (args) => args[1] as number,
-      );
-      t.deepEqual(setTimeoutDelays, [15_000, 30_000, 60_000]);
-    });
-  },
-);
-
-test.serial("Successfully uploading a database to github.com", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-    sinon
-      .stub(actionsUtil, "getRequiredInput")
-      .withArgs("upload-database")
-      .returns("true");
-    sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-    await mockHttpRequests(201);
-
-    const loggedMessages: LoggedMessage[] = [];
-    await cleanupAndUploadDatabases(
-      testRepoName,
-      getCodeQL(),
-      getTestConfig(tmpDir),
-      testApiDetails,
-      createFeatures([]),
-      getRecordingLogger(loggedMessages),
-    );
-    checkExpectedLogMessages(t, loggedMessages, [
-      "Successfully uploaded database for javascript",
-    ]);
-  });
-});
-
-test.serial("Successfully uploading a database to GHEC-DR", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-    sinon
-      .stub(actionsUtil, "getRequiredInput")
-      .withArgs("upload-database")
-      .returns("true");
-    sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-    const databaseUploadSpy = await mockHttpRequests(201);
-
-    const loggedMessages: LoggedMessage[] = [];
-    await cleanupAndUploadDatabases(
-      testRepoName,
-      getCodeQL(),
-      getTestConfig(tmpDir),
-      {
-        auth: "1234",
-        url: "https://tenant.ghe.com",
-        apiURL: undefined,
-      },
-      createFeatures([]),
-      getRecordingLogger(loggedMessages),
-    );
-    checkExpectedLogMessages(t, loggedMessages, [
-      "Successfully uploaded database for javascript",
-    ]);
-    t.assert(
-      databaseUploadSpy.calledOnceWith(
-        sinon.match.string,
-        sinon.match.has("baseUrl", "https://uploads.tenant.ghe.com"),
-      ),
-    );
-  });
-});
-
-test.serial(
-  "Records overlay and clear cleanup sizes when uploading an overlay-base database",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getRequiredInput")
-        .withArgs("upload-database")
-        .returns("true");
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-      await mockHttpRequests(201);
-
-      // Track the cleanup level passed to each cleanup so that the database
-      // bundle stub can write a differently-sized bundle for each level.
-      const cleanupLevels: CleanupLevel[] = [];
-      let lastCleanupLevel: CleanupLevel | undefined;
-      const overlaySizeBytes = 100;
-      const clearSizeBytes = 50;
-      const codeql = createStubCodeQL({
-        async databaseCleanupCluster(_config, cleanupLevel) {
-          cleanupLevels.push(cleanupLevel);
-          lastCleanupLevel = cleanupLevel;
-        },
-        async databaseBundle(_databasePath, outputFilePath) {
-          const sizeBytes =
-            lastCleanupLevel === CleanupLevel.Overlay
-              ? overlaySizeBytes
-              : clearSizeBytes;
-          fs.writeFileSync(outputFilePath, "x".repeat(sizeBytes));
-        },
-      });
-
-      const config = getTestConfig(tmpDir);
-      config.overlayDatabaseMode = OverlayDatabaseMode.OverlayBase;
-
-      const loggedMessages: LoggedMessage[] = [];
-      const results = await cleanupAndUploadDatabases(
-        testRepoName,
-        codeql,
-        config,
-        testApiDetails,
-        createFeatures([Feature.UploadOverlayDbToApi]),
-        getRecordingLogger(loggedMessages),
-      );
-
-      // The database should be cleaned up at the `overlay` level for the upload
-      // and then re-cleaned at the `clear` level to measure its size.
-      t.deepEqual(cleanupLevels, [CleanupLevel.Overlay, CleanupLevel.Clear]);
-
-      t.is(results.length, 1);
-      t.is(results[0].is_overlay_base, true);
-      t.is(results[0].zipped_upload_size_bytes, overlaySizeBytes);
-      t.is(results[0].clear_cleanup_zipped_size_bytes, clearSizeBytes);
-      t.is(typeof results[0].clear_cleanup_measurement_duration_ms, "number");
-    });
-  },
-);
-
-test.serial(
-  "Does not measure clear cleanup size for a regular (non-overlay-base) upload",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getRequiredInput")
-        .withArgs("upload-database")
-        .returns("true");
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-      await mockHttpRequests(201);
-
-      const cleanupLevels: CleanupLevel[] = [];
-      const codeql = createStubCodeQL({
-        async databaseCleanupCluster(_config, cleanupLevel) {
-          cleanupLevels.push(cleanupLevel);
-        },
-        async databaseBundle(_databasePath, outputFilePath) {
-          fs.writeFileSync(outputFilePath, "");
-        },
-      });
-
-      const results = await cleanupAndUploadDatabases(
-        testRepoName,
-        codeql,
-        getTestConfig(tmpDir),
-        testApiDetails,
-        createFeatures([Feature.UploadOverlayDbToApi]),
-        getRecordingLogger([]),
-      );
-
-      // A regular upload is cleaned only once, at the `clear` level.
-      t.deepEqual(cleanupLevels, [CleanupLevel.Clear]);
-      t.is(results[0].is_overlay_base, false);
-      t.is(results[0].clear_cleanup_zipped_size_bytes, undefined);
-      t.is(results[0].clear_cleanup_measurement_duration_ms, undefined);
-    });
-  },
-);
-
-test.serial("Does not measure clear cleanup size in debug mode", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-    sinon
-      .stub(actionsUtil, "getRequiredInput")
-      .withArgs("upload-database")
-      .returns("true");
-    sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-    await mockHttpRequests(201);
-
-    const cleanupLevels: CleanupLevel[] = [];
-    const codeql = createStubCodeQL({
-      async databaseCleanupCluster(_config, cleanupLevel) {
-        cleanupLevels.push(cleanupLevel);
-      },
-      async databaseBundle(_databasePath, outputFilePath) {
-        fs.writeFileSync(outputFilePath, "");
-      },
-    });
-
-    const config = getTestConfig(tmpDir);
-    config.overlayDatabaseMode = OverlayDatabaseMode.OverlayBase;
-    config.debugMode = true;
-
-    const results = await cleanupAndUploadDatabases(
-      testRepoName,
-      codeql,
-      config,
-      testApiDetails,
-      createFeatures([Feature.UploadOverlayDbToApi]),
-      getRecordingLogger([]),
-    );
-
-    // In debug mode we clean up at the `overlay` level for the upload but skip
-    // the additional `clear` cleanup, to preserve the database for debugging.
-    t.deepEqual(cleanupLevels, [CleanupLevel.Overlay]);
-    t.is(results[0].is_overlay_base, true);
-    t.is(results[0].clear_cleanup_zipped_size_bytes, undefined);
-    t.is(results[0].clear_cleanup_measurement_duration_ms, undefined);
-  });
-});
-
-test.serial(
-  "Does not record a clear cleanup duration when the clear cleanup fails",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      sinon
-        .stub(actionsUtil, "getRequiredInput")
-        .withArgs("upload-database")
-        .returns("true");
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-
-      await mockHttpRequests(201);
-
-      const codeql = createStubCodeQL({
-        async databaseCleanupCluster(_config, cleanupLevel) {
-          if (cleanupLevel === CleanupLevel.Clear) {
-            throw new Error("clear cleanup failed");
-          }
-        },
-        async databaseBundle(_databasePath, outputFilePath) {
-          fs.writeFileSync(outputFilePath, "x".repeat(100));
-        },
-      });
-
-      const config = getTestConfig(tmpDir);
-      config.overlayDatabaseMode = OverlayDatabaseMode.OverlayBase;
-
-      const results = await cleanupAndUploadDatabases(
-        testRepoName,
-        codeql,
-        config,
-        testApiDetails,
-        createFeatures([Feature.UploadOverlayDbToApi]),
-        getRecordingLogger([]),
-      );
-
-      // When the `clear` cleanup fails, no size is measured, so we should not
-      // report a measurement duration either.
-      t.is(results[0].is_overlay_base, true);
-      t.is(results[0].clear_cleanup_zipped_size_bytes, undefined);
-      t.is(results[0].clear_cleanup_measurement_duration_ms, undefined);
-    });
-  },
-);
diff --git a/src/database-upload.ts b/src/database-upload.ts
deleted file mode 100644
index 0189bef1e6..0000000000
--- a/src/database-upload.ts
+++ /dev/null
@@ -1,308 +0,0 @@
-import * as fs from "fs";
-
-import * as actionsUtil from "./actions-util";
-import { AnalysisKind } from "./analyses";
-import {
-  DO_NOT_RETRY_STATUSES,
-  getApiClient,
-  GitHubApiDetails,
-} from "./api-client";
-import { type CodeQL } from "./codeql";
-import { Config } from "./config-utils";
-import { Feature, FeatureEnablement } from "./feature-flags";
-import * as gitUtils from "./git-utils";
-import { Logger, withGroupAsync } from "./logging";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import { RepositoryNwo } from "./repository";
-import * as util from "./util";
-import { asHTTPError, bundleDb, CleanupLevel, parseGitHubUrl } from "./util";
-
-/** Information about a database upload. */
-export interface DatabaseUploadResult {
-  /** Language of the database. */
-  language: string;
-  /** Size of the zipped database in bytes. */
-  zipped_upload_size_bytes?: number;
-  /** Whether the uploaded database is an overlay base. */
-  is_overlay_base?: boolean;
-  /**
-   * For overlay-base uploads only: the size in bytes that the zipped database
-   * would have been if it had been cleaned at the `clear` cleanup level instead
-   * of the `overlay` level.
-   */
-  clear_cleanup_zipped_size_bytes?: number;
-  /**
-   * For overlay-base uploads only: the time in milliseconds spent measuring the
-   * `clear` cleanup size (cleaning up the cluster at the `clear` level and
-   * bundling each database). This is a cluster-wide measurement, so it is the
-   * same for every language in a run.
-   */
-  clear_cleanup_measurement_duration_ms?: number;
-  /** Time taken to upload database in milliseconds. */
-  upload_duration_ms?: number;
-  /** If there was an error during database upload, this is its message. */
-  error?: string;
-}
-
-export async function cleanupAndUploadDatabases(
-  repositoryNwo: RepositoryNwo,
-  codeql: CodeQL,
-  config: Config,
-  apiDetails: GitHubApiDetails,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  if (actionsUtil.getRequiredInput("upload-database") !== "true") {
-    logger.debug("Database upload disabled in workflow. Skipping upload.");
-    return [];
-  }
-
-  if (!config.analysisKinds.includes(AnalysisKind.CodeScanning)) {
-    logger.debug(
-      `Not uploading database because 'analysis-kinds: ${AnalysisKind.CodeScanning}' is not enabled.`,
-    );
-    return [];
-  }
-
-  if (util.isInTestMode()) {
-    logger.debug("In test mode. Skipping database upload.");
-    return [];
-  }
-
-  // Do nothing when not running against github.com
-  if (
-    config.gitHubVersion.type !== util.GitHubVariant.DOTCOM &&
-    config.gitHubVersion.type !== util.GitHubVariant.GHEC_DR
-  ) {
-    logger.debug("Not running against github.com or GHEC-DR. Skipping upload.");
-    return [];
-  }
-
-  if (!(await gitUtils.isAnalyzingDefaultBranch())) {
-    // We only want to upload a database if we are analyzing the default branch.
-    logger.debug("Not analyzing default branch. Skipping upload.");
-    return [];
-  }
-
-  // If config.overlayDatabaseMode is OverlayBase, then we have overlay base databases for all languages.
-  const shouldUploadOverlayBase =
-    config.overlayDatabaseMode === OverlayDatabaseMode.OverlayBase &&
-    (await features.getValue(Feature.UploadOverlayDbToApi, codeql));
-  const cleanupLevel = shouldUploadOverlayBase
-    ? CleanupLevel.Overlay
-    : CleanupLevel.Clear;
-
-  // Clean up the database, since intermediate results may still be written to the
-  // database if there is high RAM pressure.
-  await withGroupAsync("Cleaning up databases", async () => {
-    await codeql.databaseCleanupCluster(config, cleanupLevel);
-  });
-
-  const reports: DatabaseUploadResult[] = [];
-  for (const language of config.languages) {
-    let bundledDbSize: number | undefined = undefined;
-    try {
-      // Upload the database bundle.
-      // Although we are uploading arbitrary file contents to the API, it's worth
-      // noting that it's the API's job to validate that the contents is acceptable.
-      // This API method is available to anyone with write access to the repo.
-      const bundledDb = await bundleDb(config, language, codeql, language, {
-        includeDiagnostics: false,
-      });
-      bundledDbSize = fs.statSync(bundledDb).size;
-      const commitOid = await gitUtils.getCommitOid(
-        actionsUtil.getRequiredInput("checkout_path"),
-      );
-      // Upload with manual retry logic. We disable Octokit's built-in retries
-      // because the request body is a ReadStream, which can only be consumed
-      // once.
-      const maxAttempts = 4; // 1 initial attempt + 3 retries, identical to the default retry behavior of Octokit
-      let uploadDurationMs: number | undefined;
-      for (let attempt = 1; attempt <= maxAttempts; attempt++) {
-        try {
-          uploadDurationMs = await uploadBundledDatabase(
-            repositoryNwo,
-            language,
-            commitOid,
-            bundledDb,
-            bundledDbSize,
-            apiDetails,
-          );
-          break;
-        } catch (e) {
-          const httpError = asHTTPError(e);
-          const isRetryable =
-            !httpError || !DO_NOT_RETRY_STATUSES.includes(httpError.status);
-          if (!isRetryable) {
-            throw e;
-          } else if (attempt === maxAttempts) {
-            logger.error(
-              `Maximum retry attempts exhausted (${attempt}), aborting database upload`,
-            );
-            throw e;
-          }
-          const backoffMs = 15_000 * Math.pow(2, attempt - 1); // 15s, 30s, 60s
-          logger.debug(
-            `Database upload attempt ${attempt} of ${maxAttempts} failed for ${language}: ${util.getErrorMessage(e)}. Retrying in ${backoffMs / 1000}s...`,
-          );
-          await new Promise((resolve) => setTimeout(resolve, backoffMs));
-        }
-      }
-      reports.push({
-        language,
-        zipped_upload_size_bytes: bundledDbSize,
-        is_overlay_base: shouldUploadOverlayBase,
-        upload_duration_ms: uploadDurationMs,
-      });
-      logger.debug(`Successfully uploaded database for ${language}`);
-    } catch (e) {
-      // Log a warning but don't fail the workflow
-      logger.warning(
-        `Failed to upload database for ${language}: ${util.getErrorMessage(e)}`,
-      );
-      reports.push({
-        language,
-        error: util.getErrorMessage(e),
-        ...(bundledDbSize !== undefined
-          ? { zipped_upload_size_bytes: bundledDbSize }
-          : {}),
-      });
-    }
-  }
-
-  // When we upload an overlay-base database, we cleaned the databases at the `overlay` level, which
-  // retains more data than the `clear` level used for regular uploads. Measure what the zipped size
-  // would have been at the `clear` level too, so we can compare the storage cost of overlay-base
-  // databases against regular databases for the same repository.
-  //
-  // We skip this in debug mode, where the databases are preserved and uploaded as debug artifacts,
-  // since cleaning them up at the `clear` level would discard data that is useful for debugging.
-  if (shouldUploadOverlayBase && !config.debugMode) {
-    await withGroupAsync(
-      "Measuring database size at the clear cleanup level",
-      () => recordClearCleanupSizes(codeql, config, reports, logger),
-    );
-  }
-
-  return reports;
-}
-
-/**
- * Cleans up the databases at the `clear` cleanup level and records the resulting zipped size for
- * each language in `clear_cleanup_zipped_size_bytes`. If the cleanup succeeds, also records the
- * time spent taking the measurement in `clear_cleanup_measurement_duration_ms`.
- *
- * This mutates the entries of `reports` in place. It must run only after all overlay-base uploads
- * have completed, since the `clear` cleanup discards overlay data that the uploaded database
- * depends on.
- *
- * Failures here are non-fatal: this is telemetry-only, so we log and move on rather than failing
- * the workflow.
- */
-async function recordClearCleanupSizes(
-  codeql: CodeQL,
-  config: Config,
-  reports: DatabaseUploadResult[],
-  logger: Logger,
-): Promise {
-  // Include both the cleanup and the re-bundling to record how much time taking this measurement adds
-  // to the run.
-  const startTime = performance.now();
-
-  try {
-    await codeql.databaseCleanupCluster(config, CleanupLevel.Clear);
-  } catch (e) {
-    // The cleanup didn't run, so there are no sizes to measure. Return without recording a
-    // duration, so that we don't report a measurement duration with no accompanying sizes.
-    logger.warning(
-      `Failed to clean up databases at the '${CleanupLevel.Clear}' level for ` +
-        `size measurement: ${util.getErrorMessage(e)}`,
-    );
-    return;
-  }
-
-  for (const language of config.languages) {
-    const report = reports.find((r) => r.language === language);
-    if (report === undefined) {
-      continue;
-    }
-    try {
-      const bundledDb = await bundleDb(config, language, codeql, language, {
-        includeDiagnostics: false,
-      });
-      report.clear_cleanup_zipped_size_bytes = fs.statSync(bundledDb).size;
-      logger.debug(
-        `Database for ${language} is ` +
-          `${report.clear_cleanup_zipped_size_bytes} bytes zipped at the ` +
-          `'${CleanupLevel.Clear}' cleanup level ` +
-          `(vs. ${report.zipped_upload_size_bytes ?? "unknown"} bytes at the ` +
-          `'${CleanupLevel.Overlay}' level).`,
-      );
-    } catch (e) {
-      logger.warning(
-        `Failed to measure the '${CleanupLevel.Clear}' cleanup database size ` +
-          `for ${language}: ${util.getErrorMessage(e)}`,
-      );
-    }
-  }
-
-  const durationMs = performance.now() - startTime;
-  for (const report of reports) {
-    report.clear_cleanup_measurement_duration_ms = durationMs;
-  }
-}
-
-/**
- * Uploads a bundled database to the GitHub API.
- *
- * @returns the duration of the upload in milliseconds
- */
-async function uploadBundledDatabase(
-  repositoryNwo: RepositoryNwo,
-  language: string,
-  commitOid: string,
-  bundledDb: string,
-  bundledDbSize: number,
-  apiDetails: GitHubApiDetails,
-): Promise {
-  const client = getApiClient();
-
-  const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url));
-  uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`;
-
-  // Octokit expects the baseUrl to not have a trailing slash,
-  // but it is included by default in a URL.
-  let uploadsBaseUrl = uploadsUrl.toString();
-  if (uploadsBaseUrl.endsWith("/")) {
-    uploadsBaseUrl = uploadsBaseUrl.slice(0, -1);
-  }
-
-  const bundledDbReadStream = fs.createReadStream(bundledDb);
-  try {
-    const startTime = performance.now();
-    await client.request(
-      `POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`,
-      {
-        baseUrl: uploadsBaseUrl,
-        owner: repositoryNwo.owner,
-        repo: repositoryNwo.repo,
-        language,
-        name: `${language}-database`,
-        commit_oid: commitOid,
-        data: bundledDbReadStream,
-        headers: {
-          authorization: `token ${apiDetails.auth}`,
-          "Content-Type": "application/zip",
-          "Content-Length": bundledDbSize,
-        },
-        // Disable `octokit/plugin-retry.js`, since the request body is a ReadStream which can only be consumed once.
-        request: {
-          retries: 0,
-        },
-      },
-    );
-    return performance.now() - startTime;
-  } finally {
-    bundledDbReadStream.close();
-  }
-}
diff --git a/src/db-config-schema.json b/src/db-config-schema.json
deleted file mode 100644
index 9cede94aea..0000000000
--- a/src/db-config-schema.json
+++ /dev/null
@@ -1,145 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "title": "CodeQL Database Configuration",
-  "description": "Format of the config file supplied by the user for CodeQL analysis",
-  "type": "object",
-  "properties": {
-    "name": {
-      "type": "string",
-      "description": "Name of the configuration"
-    },
-    "disable-default-queries": {
-      "type": "boolean",
-      "description": "Whether to disable default queries"
-    },
-    "queries": {
-      "type": "array",
-      "description": "List of additional queries to run",
-      "items": {
-        "$ref": "#/definitions/QuerySpec"
-      }
-    },
-    "paths-ignore": {
-      "type": "array",
-      "description": "Paths to ignore during analysis",
-      "items": {
-        "type": "string"
-      }
-    },
-    "paths": {
-      "type": "array",
-      "description": "Paths to include in analysis",
-      "items": {
-        "type": "string"
-      }
-    },
-    "packs": {
-      "description": "Query packs to include. Can be a simple array for single-language analysis or an object with language-specific arrays for multi-language analysis",
-      "oneOf": [
-        {
-          "type": "array",
-          "items": {
-            "type": "string"
-          }
-        },
-        {
-          "type": "object",
-          "additionalProperties": {
-            "type": "array",
-            "items": {
-              "type": "string"
-            }
-          }
-        }
-      ]
-    },
-    "query-filters": {
-      "type": "array",
-      "description": "Set of query filters to include and exclude extra queries based on CodeQL query suite include and exclude properties",
-      "items": {
-        "$ref": "#/definitions/QueryFilter"
-      }
-    }
-  },
-  "additionalProperties": true,
-  "definitions": {
-    "QuerySpec": {
-      "type": "object",
-      "description": "Detailed query specification object",
-      "properties": {
-        "name": {
-          "type": "string",
-          "description": "Optional name for the query"
-        },
-        "uses": {
-          "type": "string",
-          "description": "The query or query suite to use"
-        }
-      },
-      "required": ["uses"],
-      "additionalProperties": false
-    },
-    "QueryFilter": {
-      "description": "Query filter that can either include or exclude queries",
-      "oneOf": [
-        {
-          "$ref": "#/definitions/ExcludeQueryFilter"
-        },
-        {
-          "$ref": "#/definitions/IncludeQueryFilter"
-        },
-        {}
-      ]
-    },
-    "ExcludeQueryFilter": {
-      "type": "object",
-      "description": "Filter to exclude queries",
-      "properties": {
-        "exclude": {
-          "type": "object",
-          "description": "Queries to exclude",
-          "additionalProperties": {
-            "oneOf": [
-              {
-                "type": "array",
-                "items": {
-                  "type": "string"
-                }
-              },
-              {
-                "type": "string"
-              }
-            ]
-          }
-        }
-      },
-      "required": ["exclude"],
-      "additionalProperties": false
-    },
-    "IncludeQueryFilter": {
-      "type": "object",
-      "description": "Filter to include queries",
-      "properties": {
-        "include": {
-          "type": "object",
-          "description": "Queries to include",
-          "additionalProperties": {
-            "oneOf": [
-              {
-                "type": "array",
-                "items": {
-                  "type": "string"
-                }
-              },
-              {
-                "type": "string"
-              }
-            ]
-          }
-        }
-      },
-      "required": ["include"],
-      "additionalProperties": false
-    }
-  }
-}
diff --git a/src/debug-artifacts.test.ts b/src/debug-artifacts.test.ts
deleted file mode 100644
index 370816aef5..0000000000
--- a/src/debug-artifacts.test.ts
+++ /dev/null
@@ -1,146 +0,0 @@
-import test from "ava";
-
-import * as debugArtifacts from "./debug-artifacts";
-import { getActionsLogger } from "./logging";
-import { GitHubVariant } from "./util";
-
-test("sanitizeArtifactName", (t) => {
-  t.deepEqual(
-    debugArtifacts.sanitizeArtifactName("hello-world_"),
-    "hello-world_",
-  );
-  t.deepEqual(
-    debugArtifacts.sanitizeArtifactName("hello`world`"),
-    "helloworld",
-  );
-  t.deepEqual(debugArtifacts.sanitizeArtifactName("hello===123"), "hello123");
-  t.deepEqual(
-    debugArtifacts.sanitizeArtifactName("*m)a&n^y%i££n+v!a:l[i]d"),
-    "manyinvalid",
-  );
-  t.deepEqual(
-    debugArtifacts.sanitizeArtifactName("\\foo\\bar//baz"),
-    "foobarbaz",
-  );
-});
-
-test("getArtifactSuffix", (t) => {
-  // No suffix if there's no `matrix` input, it is invalid, or has no keys.
-  t.is(debugArtifacts.getArtifactSuffix(undefined), "");
-  t.is(debugArtifacts.getArtifactSuffix(""), "");
-  t.is(debugArtifacts.getArtifactSuffix("invalid json"), "");
-  t.is(debugArtifacts.getArtifactSuffix("{}"), "");
-  t.is(debugArtifacts.getArtifactSuffix("null"), "");
-  t.is(debugArtifacts.getArtifactSuffix("123"), "");
-  t.is(debugArtifacts.getArtifactSuffix('"string"'), "");
-
-  // Suffixes for non-empty, valid `matrix` inputs.
-  const testMatrices = [
-    { matrix: { language: "go" }, expected: "-go" },
-    {
-      matrix: { language: "javascript", "build-mode": "none" },
-      expected: "-none-javascript",
-    },
-    {
-      matrix: { "build-mode": "none", language: "javascript" },
-      expected: "-none-javascript",
-    },
-  ];
-
-  for (const testMatrix of testMatrices) {
-    const suffix = debugArtifacts.getArtifactSuffix(
-      JSON.stringify(testMatrix.matrix),
-    );
-    t.is(suffix, testMatrix.expected);
-  }
-});
-
-// These next tests check the correctness of the logic to determine whether or not
-// artifacts are uploaded in debug mode. Since it's not easy to mock the actual
-// call to upload an artifact, we just check that we get an "upload-failed" result,
-// instead of actually uploading the artifact.
-//
-// For tests where we expect artifact upload to be blocked, we check for a different
-// response from the function.
-
-test("uploadDebugArtifacts when artifacts empty should emit 'no-artifacts-to-upload'", async (t) => {
-  // Test that no error is thrown if artifacts list is empty.
-  const logger = getActionsLogger();
-  await t.notThrowsAsync(async () => {
-    const uploaded = await debugArtifacts.uploadDebugArtifacts(
-      logger,
-      [],
-      "i-dont-exist",
-      "artifactName",
-      GitHubVariant.DOTCOM,
-      undefined,
-    );
-    t.is(
-      uploaded,
-      "no-artifacts-to-upload",
-      "Should not have uploaded any artifacts",
-    );
-  });
-});
-
-test("uploadDebugArtifacts when no codeql version is used should invoke artifact upload", async (t) => {
-  // Test that the artifact is uploaded.
-  const logger = getActionsLogger();
-  await t.notThrowsAsync(async () => {
-    const uploaded = await debugArtifacts.uploadDebugArtifacts(
-      logger,
-      ["hucairz"],
-      "i-dont-exist",
-      "artifactName",
-      GitHubVariant.DOTCOM,
-      undefined,
-    );
-    t.is(
-      uploaded,
-      // The failure is expected since we don't want to actually upload any artifacts in unit tests.
-      "upload-failed",
-      "Expect failure to upload artifacts since root dir does not exist",
-    );
-  });
-});
-
-test("uploadDebugArtifacts when new codeql version is used should invoke artifact upload", async (t) => {
-  // Test that the artifact is uploaded.
-  const logger = getActionsLogger();
-  await t.notThrowsAsync(async () => {
-    const uploaded = await debugArtifacts.uploadDebugArtifacts(
-      logger,
-      ["hucairz"],
-      "i-dont-exist",
-      "artifactName",
-      GitHubVariant.DOTCOM,
-      "2.20.3",
-    );
-    t.is(
-      uploaded,
-      // The failure is expected since we don't want to actually upload any artifacts in unit tests.
-      "upload-failed",
-      "Expect failure to upload artifacts since root dir does not exist",
-    );
-  });
-});
-
-test("uploadDebugArtifacts when old codeql is used should avoid trying to upload artifacts", async (t) => {
-  // Test that the artifact is not uploaded.
-  const logger = getActionsLogger();
-  await t.notThrowsAsync(async () => {
-    const uploaded = await debugArtifacts.uploadDebugArtifacts(
-      logger,
-      ["hucairz"],
-      "i-dont-exist",
-      "artifactName",
-      GitHubVariant.DOTCOM,
-      "2.20.2",
-    );
-    t.is(
-      uploaded,
-      "upload-not-supported",
-      "Expected artifact upload to be blocked because of old CodeQL version",
-    );
-  });
-});
diff --git a/src/debug-artifacts.ts b/src/debug-artifacts.ts
deleted file mode 100644
index 9f5f1775d4..0000000000
--- a/src/debug-artifacts.ts
+++ /dev/null
@@ -1,436 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as artifact from "@actions/artifact";
-import * as artifactLegacy from "@actions/artifact-legacy";
-import * as core from "@actions/core";
-import { ZipArchive } from "archiver";
-
-import { getOptionalInput, getTemporaryDirectory } from "./actions-util";
-import { dbIsFinalized } from "./analyze";
-import { scanArtifactsForTokens } from "./artifact-scanner";
-import { type CodeQL } from "./codeql";
-import { Config } from "./config-utils";
-import { EnvVar } from "./environment";
-import * as json from "./json";
-import { Language } from "./languages";
-import { Logger, withGroup } from "./logging";
-import {
-  isSafeArtifactUpload,
-  SafeArtifactUploadVersion,
-} from "./tools-features";
-import {
-  bundleDb,
-  doesDirectoryExist,
-  getCodeQLDatabasePath,
-  getErrorMessage,
-  GitHubVariant,
-  isInTestMode,
-  listFolder,
-} from "./util";
-
-export function sanitizeArtifactName(name: string): string {
-  return name.replace(/[^a-zA-Z0-9_-]+/g, "");
-}
-
-/**
- * Upload Actions SARIF artifacts for debugging when CODEQL_ACTION_DEBUG_COMBINED_SARIF
- * environment variable is set
- */
-export async function uploadCombinedSarifArtifacts(
-  logger: Logger,
-  gitHubVariant: GitHubVariant,
-  codeQlVersion: string | undefined,
-) {
-  const tempDir = getTemporaryDirectory();
-
-  // Upload Actions SARIF artifacts for debugging when environment variable is set
-  if (process.env["CODEQL_ACTION_DEBUG_COMBINED_SARIF"] === "true") {
-    await withGroup("Uploading combined SARIF debug artifact", async () => {
-      logger.info(
-        "Uploading available combined SARIF files as Actions debugging artifact...",
-      );
-
-      const baseTempDir = path.resolve(tempDir, "combined-sarif");
-
-      const toUpload: string[] = [];
-
-      if (fs.existsSync(baseTempDir)) {
-        const outputDirs = fs.readdirSync(baseTempDir);
-
-        for (const outputDir of outputDirs) {
-          const sarifFiles = fs
-            .readdirSync(path.resolve(baseTempDir, outputDir))
-            .filter((f) => path.extname(f) === ".sarif");
-
-          for (const sarifFile of sarifFiles) {
-            toUpload.push(path.resolve(baseTempDir, outputDir, sarifFile));
-          }
-        }
-      }
-
-      try {
-        await uploadDebugArtifacts(
-          logger,
-          toUpload,
-          baseTempDir,
-          "combined-sarif-artifacts",
-          gitHubVariant,
-          codeQlVersion,
-        );
-      } catch (e) {
-        logger.warning(
-          `Failed to upload combined SARIF files as Actions debugging artifact. Reason: ${getErrorMessage(
-            e,
-          )}`,
-        );
-      }
-    });
-  }
-}
-
-/**
- * Try to prepare a SARIF result debug artifact for the given language.
- *
- * @return The path to that debug artifact, or undefined if an error occurs.
- */
-function tryPrepareSarifDebugArtifact(
-  config: Config,
-  language: Language,
-  logger: Logger,
-): string | undefined {
-  try {
-    const analyzeActionOutputDir = process.env[EnvVar.SARIF_RESULTS_OUTPUT_DIR];
-    if (
-      analyzeActionOutputDir !== undefined &&
-      fs.existsSync(analyzeActionOutputDir) &&
-      fs.lstatSync(analyzeActionOutputDir).isDirectory()
-    ) {
-      const sarifFile = path.resolve(
-        analyzeActionOutputDir,
-        `${language}.sarif`,
-      );
-      // Move SARIF to DB location so that they can be uploaded with the same root directory as the other artifacts.
-      if (fs.existsSync(sarifFile)) {
-        const sarifInDbLocation = path.resolve(
-          config.dbLocation,
-          `${language}.sarif`,
-        );
-        fs.copyFileSync(sarifFile, sarifInDbLocation);
-        return sarifInDbLocation;
-      }
-    }
-  } catch (e) {
-    logger.warning(
-      `Failed to find SARIF results path for ${language}. Reason: ${getErrorMessage(
-        e,
-      )}`,
-    );
-  }
-  return undefined;
-}
-
-/**
- * Try to bundle the database for the given language.
- *
- * @return The path to the database bundle, or undefined if an error occurs.
- */
-async function tryBundleDatabase(
-  codeql: CodeQL,
-  config: Config,
-  language: Language,
-  logger: Logger,
-): Promise {
-  try {
-    if (dbIsFinalized(config, language, logger)) {
-      try {
-        return await createDatabaseBundleCli(codeql, config, language);
-      } catch (e) {
-        logger.warning(
-          `Failed to bundle database for ${language} using the CLI. ` +
-            `Falling back to a partial bundle. Reason: ${getErrorMessage(e)}`,
-        );
-      }
-    }
-    return await createPartialDatabaseBundle(config, language);
-  } catch (e) {
-    logger.warning(
-      `Failed to bundle database for ${language}. Reason: ${getErrorMessage(
-        e,
-      )}`,
-    );
-    return undefined;
-  }
-}
-
-/**
- * Attempt to upload all available debug artifacts.
- *
- * Logs and suppresses any errors that occur.
- */
-export async function tryUploadAllAvailableDebugArtifacts(
-  codeql: CodeQL,
-  config: Config,
-  logger: Logger,
-  codeQlVersion: string | undefined,
-) {
-  const filesToUpload: string[] = [];
-  try {
-    for (const language of config.languages) {
-      await withGroup(`Uploading debug artifacts for ${language}`, async () => {
-        logger.info("Preparing SARIF result debug artifact...");
-        const sarifResultDebugArtifact = tryPrepareSarifDebugArtifact(
-          config,
-          language,
-          logger,
-        );
-        if (sarifResultDebugArtifact) {
-          filesToUpload.push(sarifResultDebugArtifact);
-          logger.info("SARIF result debug artifact ready for upload.");
-        }
-
-        logger.info("Preparing database logs debug artifact...");
-        const databaseDirectory = getCodeQLDatabasePath(config, language);
-        const logsDirectory = path.resolve(databaseDirectory, "log");
-        if (doesDirectoryExist(logsDirectory)) {
-          filesToUpload.push(...listFolder(logsDirectory));
-          logger.info("Database logs debug artifact ready for upload.");
-        }
-
-        // Multilanguage tracing: there are additional logs in the root of the cluster
-        logger.info("Preparing database cluster logs debug artifact...");
-        const multiLanguageTracingLogsDirectory = path.resolve(
-          config.dbLocation,
-          "log",
-        );
-        if (doesDirectoryExist(multiLanguageTracingLogsDirectory)) {
-          filesToUpload.push(...listFolder(multiLanguageTracingLogsDirectory));
-          logger.info("Database cluster logs debug artifact ready for upload.");
-        }
-
-        // Add database bundle
-        logger.info("Preparing database bundle debug artifact...");
-        const databaseBundle = await tryBundleDatabase(
-          codeql,
-          config,
-          language,
-          logger,
-        );
-        if (databaseBundle) {
-          filesToUpload.push(databaseBundle);
-          logger.info("Database bundle debug artifact ready for upload.");
-        }
-      });
-    }
-  } catch (e) {
-    logger.warning(
-      `Failed to prepare debug artifacts. Reason: ${getErrorMessage(e)}`,
-    );
-    return;
-  }
-
-  try {
-    await withGroup("Uploading debug artifacts", async () =>
-      uploadDebugArtifacts(
-        logger,
-        filesToUpload,
-        config.dbLocation,
-        config.debugArtifactName,
-        config.gitHubVersion.type,
-        codeQlVersion,
-      ),
-    );
-  } catch (e) {
-    logger.warning(
-      `Failed to upload debug artifacts. Reason: ${getErrorMessage(e)}`,
-    );
-  }
-}
-
-/**
- * When a build matrix is used, multiple different jobs arising from the matrix may attempt to upload
- * workflow artifacts with the same base name. In that case, only one of the uploads will succeed and
- * the others will fail. This function inspects the matrix object to compute a suffix for the artifact
- * name that uniquely identifies the matrix values of the current job to avoid name clashes.
- *
- * @param matrix A stringified JSON value, usually the value of the `matrix` input.
- * @returns A suffix that uniquely identifies the `matrix` value for the current job, or `""` if there
- * is no matrix value.
- */
-export function getArtifactSuffix(matrix: string | undefined): string {
-  let suffix = "";
-  if (matrix) {
-    try {
-      const matrixObject = JSON.parse(matrix);
-      if (json.isObject(matrixObject)) {
-        for (const matrixKey of Object.keys(matrixObject).sort())
-          suffix += `-${matrixObject[matrixKey]}`;
-      } else {
-        core.warning("User-specified `matrix` input is not an object.");
-      }
-    } catch {
-      core.warning(
-        "Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input.",
-      );
-    }
-  }
-  return suffix;
-}
-
-// Enumerates different, possible outcomes for artifact uploads.
-export type UploadArtifactsResult =
-  | "no-artifacts-to-upload"
-  | "upload-successful"
-  | "upload-failed";
-
-export async function uploadDebugArtifacts(
-  logger: Logger,
-  toUpload: string[],
-  rootDir: string,
-  artifactName: string,
-  ghVariant: GitHubVariant,
-  codeQlVersion: string | undefined,
-): Promise {
-  const uploadSupported = isSafeArtifactUpload(codeQlVersion);
-
-  if (!uploadSupported) {
-    core.info(
-      `Skipping debug artifact upload because the current CLI does not support safe upload. Please upgrade to CLI v${SafeArtifactUploadVersion} or later.`,
-    );
-    return "upload-not-supported";
-  }
-
-  return uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant);
-}
-
-/**
- * Uploads the specified files as a single workflow artifact.
- *
- * @param logger The logger to use.
- * @param toUpload The list of paths to include in the artifact.
- * @param rootDir The root directory of the paths to include.
- * @param artifactName The base name for the artifact.
- * @param ghVariant The GitHub variant.
- *
- * @returns The outcome of the attempt to create and upload the artifact.
- */
-export async function uploadArtifacts(
-  logger: Logger,
-  toUpload: string[],
-  rootDir: string,
-  artifactName: string,
-  ghVariant: GitHubVariant,
-): Promise {
-  if (toUpload.length === 0) {
-    return "no-artifacts-to-upload";
-  }
-
-  // When running in test mode, perform a best effort scan of the debug artifacts. The artifact
-  // scanner is basic and not reliable or fast enough for production use, but it can help catch
-  // some issues early.
-  if (isInTestMode()) {
-    await scanArtifactsForTokens(toUpload, logger);
-    core.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true");
-  }
-
-  const suffix = getArtifactSuffix(getOptionalInput("matrix"));
-  const artifactUploader = await getArtifactUploaderClient(logger, ghVariant);
-
-  try {
-    await artifactUploader.uploadArtifact(
-      sanitizeArtifactName(`${artifactName}${suffix}`),
-      toUpload.map((file) => path.normalize(file)),
-      path.normalize(rootDir),
-      {
-        // ensure we don't keep the debug artifacts around for too long since they can be large.
-        retentionDays: 7,
-      },
-    );
-    return "upload-successful";
-  } catch (e) {
-    // A failure to upload debug artifacts should not fail the entire action.
-    core.warning(`Failed to upload debug artifacts: ${e}`);
-    return "upload-failed";
-  }
-}
-
-// `@actions/artifact@v2` is not yet supported on GHES so the legacy version of the client will be used on GHES
-// until it is supported. We also use the legacy version of the client if the feature flag is disabled.
-// The feature flag is named `ArtifactV4Upgrade` to reduce customer confusion; customers are primarily affected by
-// `actions/download-artifact`, whose upgrade to v4 must be accompanied by the `@actions/artifact@v2` upgrade.
-export async function getArtifactUploaderClient(
-  logger: Logger,
-  ghVariant: GitHubVariant,
-): Promise {
-  if (ghVariant === GitHubVariant.GHES) {
-    logger.info(
-      "Debug artifacts can be consumed with `actions/download-artifact@v3` because the `v4` version is not yet compatible on GHES.",
-    );
-    return artifactLegacy.create();
-  } else {
-    logger.info(
-      "Debug artifacts can be consumed with `actions/download-artifact@v4`.",
-    );
-    return new artifact.DefaultArtifactClient();
-  }
-}
-
-/**
- * If a database has not been finalized, we cannot run the `codeql database bundle`
- * command in the CLI because it will return an error. Instead we directly zip
- * all files in the database folder and return the path.
- */
-async function createPartialDatabaseBundle(
-  config: Config,
-  language: Language,
-): Promise {
-  const databasePath = getCodeQLDatabasePath(config, language);
-  const databaseBundlePath = path.resolve(
-    config.dbLocation,
-    `${config.debugDatabaseName}-${language}-partial.zip`,
-  );
-  core.info(
-    `${config.debugDatabaseName}-${language} is not finalized. Uploading partial database bundle at ${databaseBundlePath}...`,
-  );
-  // See `bundleDb` for explanation behind deleting existing db bundle.
-  if (fs.existsSync(databaseBundlePath)) {
-    await fs.promises.rm(databaseBundlePath, { force: true });
-  }
-  const output = fs.createWriteStream(databaseBundlePath);
-  const zip = new ZipArchive();
-
-  zip.on("error", (err) => {
-    throw err;
-  });
-
-  zip.on("warning", (err) => {
-    // Ignore ENOENT warnings. There's nothing anyone can do about it.
-    if (err.code !== "ENOENT") {
-      throw err;
-    }
-  });
-
-  zip.pipe(output);
-  zip.directory(databasePath, false);
-  await zip.finalize();
-
-  return databaseBundlePath;
-}
-
-/**
- * Runs `codeql database bundle` command and returns the path.
- */
-async function createDatabaseBundleCli(
-  codeql: CodeQL,
-  config: Config,
-  language: Language,
-): Promise {
-  const databaseBundlePath = await bundleDb(
-    config,
-    language,
-    codeql,
-    `${config.debugDatabaseName}-${language}`,
-    { includeDiagnostics: true },
-  );
-  return databaseBundlePath;
-}
diff --git a/src/defaults.json b/src/defaults.json
deleted file mode 100644
index b5d9f13644..0000000000
--- a/src/defaults.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "bundleVersion": "codeql-bundle-v2.26.3",
-  "cliVersion": "2.26.3",
-  "priorBundleVersion": "codeql-bundle-v2.26.2",
-  "priorCliVersion": "2.26.2"
-}
diff --git a/src/dependency-caching.test.ts b/src/dependency-caching.test.ts
deleted file mode 100644
index e611cd03eb..0000000000
--- a/src/dependency-caching.test.ts
+++ /dev/null
@@ -1,724 +0,0 @@
-import * as fs from "fs";
-import path from "path";
-
-import * as actionsCache from "@actions/cache";
-import * as glob from "@actions/glob";
-import test from "ava";
-import * as sinon from "sinon";
-
-import { cacheKeyHashLength } from "./caching-utils";
-import * as cachingUtils from "./caching-utils";
-import { createStubCodeQL } from "./codeql";
-import {
-  CacheConfig,
-  checkHashPatterns,
-  getCsharpHashPatterns,
-  getFeaturePrefix,
-  makePatternCheck,
-  internal,
-  CSHARP_BASE_PATTERNS,
-  CSHARP_EXTRA_PATTERNS,
-  downloadDependencyCaches,
-  CacheHitKind,
-  cacheKey,
-  getCsharpDependencyDirs,
-  getCsharpTempDependencyDir,
-  uploadDependencyCaches,
-  CacheStoreResult,
-} from "./dependency-caching";
-import { Feature } from "./feature-flags";
-import { BuiltInLanguage } from "./languages";
-import {
-  setupTests,
-  createFeatures,
-  getRecordingLogger,
-  checkExpectedLogMessages,
-  LoggedMessage,
-  createTestConfig,
-} from "./testing-utils";
-import { withTmpDir } from "./util";
-
-setupTests(test);
-
-function makeAbsolutePatterns(tmpDir: string, patterns: string[]): string[] {
-  return patterns.map((pattern) => path.join(tmpDir, pattern));
-}
-
-test.serial(
-  "getCsharpDependencyDirs - does not include BMN dir if FF is disabled",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      process.env["RUNNER_TEMP"] = tmpDir;
-      const codeql = createStubCodeQL({});
-      const features = createFeatures([]);
-
-      const results = await getCsharpDependencyDirs(codeql, features);
-      t.false(results.includes(getCsharpTempDependencyDir()));
-    });
-  },
-);
-
-test.serial(
-  "getCsharpDependencyDirs - includes BMN dir if FF is enabled",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      process.env["RUNNER_TEMP"] = tmpDir;
-      const codeql = createStubCodeQL({});
-      const features = createFeatures([Feature.CsharpCacheBuildModeNone]);
-
-      const results = await getCsharpDependencyDirs(codeql, features);
-      t.assert(results.includes(getCsharpTempDependencyDir()));
-    });
-  },
-);
-
-test("makePatternCheck - returns undefined if no patterns match", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    fs.writeFileSync(path.join(tmpDir, "test.java"), "");
-    const result = await makePatternCheck(
-      makeAbsolutePatterns(tmpDir, ["**/*.cs"]),
-    );
-    t.is(result, undefined);
-  });
-});
-
-test("makePatternCheck - returns all patterns if any pattern matches", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    fs.writeFileSync(path.join(tmpDir, "test.java"), "");
-    const patterns = makeAbsolutePatterns(tmpDir, ["**/*.cs", "**/*.java"]);
-    const result = await makePatternCheck(patterns);
-    t.deepEqual(result, patterns);
-  });
-});
-
-test.serial(
-  "getCsharpHashPatterns - returns base patterns if any pattern matches",
-  async (t) => {
-    const codeql = createStubCodeQL({});
-    const features = createFeatures([]);
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-    makePatternCheckStub.withArgs(CSHARP_EXTRA_PATTERNS).rejects();
-
-    await t.notThrowsAsync(async () => {
-      const result = await getCsharpHashPatterns(codeql, features);
-      t.deepEqual(result, CSHARP_BASE_PATTERNS);
-    });
-  },
-);
-
-test.serial(
-  "getCsharpHashPatterns - returns base patterns if any base pattern matches and CsharpNewCacheKey is enabled",
-  async (t) => {
-    const codeql = createStubCodeQL({});
-    const features = createFeatures([Feature.CsharpNewCacheKey]);
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-    makePatternCheckStub
-      .withArgs(CSHARP_EXTRA_PATTERNS)
-      .resolves(CSHARP_EXTRA_PATTERNS);
-
-    await t.notThrowsAsync(async () => {
-      const result = await getCsharpHashPatterns(codeql, features);
-      t.deepEqual(result, CSHARP_BASE_PATTERNS);
-    });
-  },
-);
-
-test.serial(
-  "getCsharpHashPatterns - returns extra patterns if any extra pattern matches and CsharpNewCacheKey is enabled",
-  async (t) => {
-    const codeql = createStubCodeQL({});
-    const features = createFeatures([Feature.CsharpNewCacheKey]);
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-
-    makePatternCheckStub.withArgs(CSHARP_BASE_PATTERNS).resolves(undefined);
-    makePatternCheckStub
-      .withArgs(CSHARP_EXTRA_PATTERNS)
-      .resolves(CSHARP_EXTRA_PATTERNS);
-
-    await t.notThrowsAsync(async () => {
-      const result = await getCsharpHashPatterns(codeql, features);
-      t.deepEqual(result, CSHARP_EXTRA_PATTERNS);
-    });
-  },
-);
-
-test.serial(
-  "getCsharpHashPatterns - returns undefined if neither base nor extra patterns match",
-  async (t) => {
-    const codeql = createStubCodeQL({});
-    const features = createFeatures([Feature.CsharpNewCacheKey]);
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-
-    makePatternCheckStub.withArgs(CSHARP_BASE_PATTERNS).resolves(undefined);
-    makePatternCheckStub.withArgs(CSHARP_EXTRA_PATTERNS).resolves(undefined);
-
-    await t.notThrowsAsync(async () => {
-      const result = await getCsharpHashPatterns(codeql, features);
-      t.deepEqual(result, undefined);
-    });
-  },
-);
-
-test("checkHashPatterns - logs when no patterns match", async (t) => {
-  const codeql = createStubCodeQL({});
-  const features = createFeatures([]);
-  const messages: LoggedMessage[] = [];
-  const config: CacheConfig = {
-    getDependencyPaths: async () => [],
-    getHashPatterns: async () => undefined,
-  };
-
-  const result = await checkHashPatterns(
-    codeql,
-    features,
-    BuiltInLanguage.csharp,
-    config,
-    "download",
-    getRecordingLogger(messages),
-  );
-
-  t.is(result, undefined);
-  checkExpectedLogMessages(t, messages, [
-    "Skipping download of dependency cache",
-  ]);
-});
-
-test("checkHashPatterns - returns patterns when patterns match", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const codeql = createStubCodeQL({});
-    const features = createFeatures([]);
-    const messages: LoggedMessage[] = [];
-    const patterns = makeAbsolutePatterns(tmpDir, ["**/*.cs", "**/*.java"]);
-
-    fs.writeFileSync(path.join(tmpDir, "test.java"), "");
-
-    const config: CacheConfig = {
-      getDependencyPaths: async () => [],
-      getHashPatterns: async () => makePatternCheck(patterns),
-    };
-
-    const result = await checkHashPatterns(
-      codeql,
-      features,
-      BuiltInLanguage.csharp,
-      config,
-      "upload",
-      getRecordingLogger(messages),
-    );
-
-    t.deepEqual(result, patterns);
-    t.deepEqual(messages, []);
-  });
-});
-
-type RestoreCacheFunc = (
-  paths: string[],
-  primaryKey: string,
-  restoreKeys: string[] | undefined,
-) => Promise;
-
-/**
- * Constructs a function that `actionsCache.restoreCache` can be stubbed with.
- *
- * @param mockCacheKeys The keys of caches that we want to exist in the Actions cache.
- *
- * @returns Returns a function that `actionsCache.restoreCache` can be stubbed with.
- */
-function makeMockCacheCheck(mockCacheKeys: string[]): RestoreCacheFunc {
-  return async (
-    _paths: string[],
-    primaryKey: string,
-    restoreKeys: string[] | undefined,
-  ) => {
-    // The behaviour here mirrors what the real `restoreCache` would do:
-    // - Starting with the primary restore key, check all caches for a match:
-    //   even for the primary restore key, this only has to be a prefix match.
-    // - If the primary restore key doesn't prefix-match any cache, then proceed
-    //   in the same way for each restore key in turn.
-    for (const restoreKey of [primaryKey, ...(restoreKeys || [])]) {
-      for (const mockCacheKey of mockCacheKeys) {
-        if (mockCacheKey.startsWith(restoreKey)) {
-          return mockCacheKey;
-        }
-      }
-    }
-    // Only if no restore key matches any cache key prefix, there is no matching
-    // cache and we return `undefined`.
-    return undefined;
-  };
-}
-
-test.serial(
-  "downloadDependencyCaches - does not restore caches with feature keys if no features are enabled",
-  async (t) => {
-    process.env["RUNNER_OS"] = "Linux";
-
-    const codeql = createStubCodeQL({});
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-
-    sinon.stub(glob, "hashFiles").resolves("abcdef");
-
-    const keyWithFeature = await cacheKey(
-      codeql,
-      createFeatures([Feature.CsharpNewCacheKey]),
-      BuiltInLanguage.csharp,
-      // Patterns don't matter here because we have stubbed `hashFiles` to always return a specific hash above.
-      [],
-    );
-
-    const restoreCacheStub = sinon
-      .stub(actionsCache, "restoreCache")
-      .callsFake(makeMockCacheCheck([keyWithFeature]));
-
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-    makePatternCheckStub.withArgs(CSHARP_EXTRA_PATTERNS).resolves(undefined);
-
-    const result = await downloadDependencyCaches(
-      codeql,
-      createFeatures([]),
-      [BuiltInLanguage.csharp],
-      logger,
-    );
-    const statusReport = result.statusReport;
-    t.is(statusReport.length, 1);
-    t.is(statusReport[0].language, BuiltInLanguage.csharp);
-    t.is(statusReport[0].hit_kind, CacheHitKind.Miss);
-    t.deepEqual(result.restoredKeys, []);
-    t.assert(restoreCacheStub.calledOnce);
-  },
-);
-
-test.serial(
-  "downloadDependencyCaches - restores caches with feature keys if features are enabled",
-  async (t) => {
-    process.env["RUNNER_OS"] = "Linux";
-
-    const codeql = createStubCodeQL({});
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-    const features = createFeatures([Feature.CsharpNewCacheKey]);
-
-    const mockHash = "abcdef";
-    sinon.stub(glob, "hashFiles").resolves(mockHash);
-
-    const keyWithFeature = await cacheKey(
-      codeql,
-      features,
-      BuiltInLanguage.csharp,
-      // Patterns don't matter here because we have stubbed `hashFiles` to always return a specific hash above.
-      [],
-    );
-
-    const restoreCacheStub = sinon
-      .stub(actionsCache, "restoreCache")
-      .callsFake(makeMockCacheCheck([keyWithFeature]));
-
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-    makePatternCheckStub.withArgs(CSHARP_EXTRA_PATTERNS).resolves(undefined);
-
-    const result = await downloadDependencyCaches(
-      codeql,
-      features,
-      [BuiltInLanguage.csharp],
-      logger,
-    );
-
-    // Check that the status report for telemetry indicates that one cache was restored with an exact match.
-    const statusReport = result.statusReport;
-    t.is(statusReport.length, 1);
-    t.is(statusReport[0].language, BuiltInLanguage.csharp);
-    t.is(statusReport[0].hit_kind, CacheHitKind.Exact);
-
-    // Check that the restored key has been returned.
-    const restoredKeys = result.restoredKeys;
-    t.is(restoredKeys.length, 1);
-    t.assert(
-      restoredKeys[0].endsWith(mockHash),
-      "Expected restored key to end with hash returned by `hashFiles`",
-    );
-
-    // `restoreCache` should have been called exactly once.
-    t.assert(restoreCacheStub.calledOnce);
-  },
-);
-
-test.serial(
-  "downloadDependencyCaches - restores caches with feature keys if features are enabled for partial matches",
-  async (t) => {
-    process.env["RUNNER_OS"] = "Linux";
-
-    const codeql = createStubCodeQL({});
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-    const features = createFeatures([Feature.CsharpNewCacheKey]);
-
-    // We expect two calls to `hashFiles`: the first by the call to `cacheKey` below,
-    // and the second by `downloadDependencyCaches`. We use the result of the first
-    // call as part of the cache key that identifies a mock, existing cache. The result
-    // of the second call is for the primary restore key, which we don't want to match
-    // the first key so that we can test the restore keys logic.
-    const restoredHash = "abcdef";
-    const hashFilesStub = sinon.stub(glob, "hashFiles");
-    hashFilesStub.onFirstCall().resolves(restoredHash);
-    hashFilesStub.onSecondCall().resolves("123456");
-
-    const keyWithFeature = await cacheKey(
-      codeql,
-      features,
-      BuiltInLanguage.csharp,
-      // Patterns don't matter here because we have stubbed `hashFiles` to always return a specific hash above.
-      [],
-    );
-
-    const restoreCacheStub = sinon
-      .stub(actionsCache, "restoreCache")
-      .callsFake(makeMockCacheCheck([keyWithFeature]));
-
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-    makePatternCheckStub.withArgs(CSHARP_EXTRA_PATTERNS).resolves(undefined);
-
-    const result = await downloadDependencyCaches(
-      codeql,
-      features,
-      [BuiltInLanguage.csharp],
-      logger,
-    );
-
-    // Check that the status report for telemetry indicates that one cache was restored with a partial match.
-    const statusReport = result.statusReport;
-    t.is(statusReport.length, 1);
-    t.is(statusReport[0].language, BuiltInLanguage.csharp);
-    t.is(statusReport[0].hit_kind, CacheHitKind.Partial);
-
-    // Check that the restored key has been returned.
-    const restoredKeys = result.restoredKeys;
-    t.is(restoredKeys.length, 1);
-    t.assert(
-      restoredKeys[0].endsWith(restoredHash),
-      "Expected restored key to end with hash returned by `hashFiles`",
-    );
-
-    t.assert(restoreCacheStub.calledOnce);
-  },
-);
-
-test("uploadDependencyCaches - skips upload for a language with no cache config", async (t) => {
-  const codeql = createStubCodeQL({});
-  const messages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(messages);
-  const features = createFeatures([]);
-  const config = createTestConfig({
-    languages: [BuiltInLanguage.actions],
-  });
-
-  const result = await uploadDependencyCaches(codeql, features, config, logger);
-  t.is(result.length, 0);
-  checkExpectedLogMessages(t, messages, [
-    "Skipping upload of dependency cache for actions",
-  ]);
-});
-
-test.serial(
-  "uploadDependencyCaches - skips upload if no files for the hash exist",
-  async (t) => {
-    const codeql = createStubCodeQL({});
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-    const features = createFeatures([]);
-    const config = createTestConfig({
-      languages: [BuiltInLanguage.go],
-    });
-
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-    makePatternCheckStub.resolves(undefined);
-
-    const result = await uploadDependencyCaches(
-      codeql,
-      features,
-      config,
-      logger,
-    );
-    t.is(result.length, 1);
-    t.is(result[0].language, BuiltInLanguage.go);
-    t.is(result[0].result, CacheStoreResult.NoHash);
-  },
-);
-
-test.serial(
-  "uploadDependencyCaches - skips upload if we know the cache already exists",
-  async (t) => {
-    process.env["RUNNER_OS"] = "Linux";
-
-    const codeql = createStubCodeQL({});
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-    const features = createFeatures([]);
-
-    const mockHash = "abcdef";
-    sinon.stub(glob, "hashFiles").resolves(mockHash);
-
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-
-    const primaryCacheKey = await cacheKey(
-      codeql,
-      features,
-      BuiltInLanguage.csharp,
-      CSHARP_BASE_PATTERNS,
-    );
-
-    const config = createTestConfig({
-      languages: [BuiltInLanguage.csharp],
-      dependencyCachingRestoredKeys: [primaryCacheKey],
-    });
-
-    const result = await uploadDependencyCaches(
-      codeql,
-      features,
-      config,
-      logger,
-    );
-    t.is(result.length, 1);
-    t.is(result[0].language, BuiltInLanguage.csharp);
-    t.is(result[0].result, CacheStoreResult.Duplicate);
-  },
-);
-
-test.serial(
-  "uploadDependencyCaches - skips upload if cache size is 0",
-  async (t) => {
-    process.env["RUNNER_OS"] = "Linux";
-
-    const codeql = createStubCodeQL({});
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-    const features = createFeatures([]);
-
-    const mockHash = "abcdef";
-    sinon.stub(glob, "hashFiles").resolves(mockHash);
-
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-
-    sinon.stub(cachingUtils, "getTotalCacheSize").resolves(0);
-
-    const config = createTestConfig({
-      languages: [BuiltInLanguage.csharp],
-    });
-
-    const result = await uploadDependencyCaches(
-      codeql,
-      features,
-      config,
-      logger,
-    );
-    t.is(result.length, 1);
-    t.is(result[0].language, BuiltInLanguage.csharp);
-    t.is(result[0].result, CacheStoreResult.Empty);
-
-    checkExpectedLogMessages(t, messages, [
-      "Skipping upload of dependency cache",
-    ]);
-  },
-);
-
-test.serial(
-  "uploadDependencyCaches - uploads caches when all requirements are met",
-  async (t) => {
-    process.env["RUNNER_OS"] = "Linux";
-
-    const codeql = createStubCodeQL({});
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-    const features = createFeatures([]);
-
-    const mockHash = "abcdef";
-    sinon.stub(glob, "hashFiles").resolves(mockHash);
-
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-
-    sinon.stub(cachingUtils, "getTotalCacheSize").resolves(1024);
-    sinon.stub(actionsCache, "saveCache").resolves();
-
-    const config = createTestConfig({
-      languages: [BuiltInLanguage.csharp],
-    });
-
-    const result = await uploadDependencyCaches(
-      codeql,
-      features,
-      config,
-      logger,
-    );
-    t.is(result.length, 1);
-    t.is(result[0].language, BuiltInLanguage.csharp);
-    t.is(result[0].result, CacheStoreResult.Stored);
-    t.is(result[0].upload_size_bytes, 1024);
-
-    checkExpectedLogMessages(t, messages, ["Uploading cache of size"]);
-  },
-);
-
-test.serial(
-  "uploadDependencyCaches - catches `ReserveCacheError` exceptions",
-  async (t) => {
-    process.env["RUNNER_OS"] = "Linux";
-
-    const codeql = createStubCodeQL({});
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-    const features = createFeatures([]);
-
-    const mockHash = "abcdef";
-    sinon.stub(glob, "hashFiles").resolves(mockHash);
-
-    const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-    makePatternCheckStub
-      .withArgs(CSHARP_BASE_PATTERNS)
-      .resolves(CSHARP_BASE_PATTERNS);
-
-    sinon.stub(cachingUtils, "getTotalCacheSize").resolves(1024);
-    sinon
-      .stub(actionsCache, "saveCache")
-      .throws(new actionsCache.ReserveCacheError("Already in use"));
-
-    const config = createTestConfig({
-      languages: [BuiltInLanguage.csharp],
-    });
-
-    await t.notThrowsAsync(async () => {
-      const result = await uploadDependencyCaches(
-        codeql,
-        features,
-        config,
-        logger,
-      );
-      t.is(result.length, 1);
-      t.is(result[0].language, BuiltInLanguage.csharp);
-      t.is(result[0].result, CacheStoreResult.Duplicate);
-
-      checkExpectedLogMessages(t, messages, ["Not uploading cache for"]);
-    });
-  },
-);
-
-test.serial("uploadDependencyCaches - throws other exceptions", async (t) => {
-  process.env["RUNNER_OS"] = "Linux";
-
-  const codeql = createStubCodeQL({});
-  const messages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(messages);
-  const features = createFeatures([]);
-
-  const mockHash = "abcdef";
-  sinon.stub(glob, "hashFiles").resolves(mockHash);
-
-  const makePatternCheckStub = sinon.stub(internal, "makePatternCheck");
-  makePatternCheckStub
-    .withArgs(CSHARP_BASE_PATTERNS)
-    .resolves(CSHARP_BASE_PATTERNS);
-
-  sinon.stub(cachingUtils, "getTotalCacheSize").resolves(1024);
-  sinon.stub(actionsCache, "saveCache").throws();
-
-  const config = createTestConfig({
-    languages: [BuiltInLanguage.csharp],
-  });
-
-  await t.throwsAsync(async () => {
-    await uploadDependencyCaches(codeql, features, config, logger);
-  });
-});
-
-test("getFeaturePrefix - returns empty string if no features are enabled", async (t) => {
-  const codeql = createStubCodeQL({});
-  const features = createFeatures([]);
-
-  for (const knownLanguage of Object.values(BuiltInLanguage)) {
-    const result = await getFeaturePrefix(codeql, features, knownLanguage);
-    t.deepEqual(result, "", `Expected no feature prefix for ${knownLanguage}`);
-  }
-});
-
-test("getFeaturePrefix - C# - returns prefix if CsharpNewCacheKey is enabled", async (t) => {
-  const codeql = createStubCodeQL({});
-  const features = createFeatures([Feature.CsharpNewCacheKey]);
-
-  const result = await getFeaturePrefix(
-    codeql,
-    features,
-    BuiltInLanguage.csharp,
-  );
-  t.notDeepEqual(result, "");
-  t.assert(result.endsWith("-"));
-  // Check the length of the prefix, which should correspond to `cacheKeyHashLength` + 1 for the trailing `-`.
-  t.is(result.length, cacheKeyHashLength + 1);
-});
-
-test("getFeaturePrefix - non-C# - returns '' if CsharpNewCacheKey is enabled", async (t) => {
-  const codeql = createStubCodeQL({});
-  const features = createFeatures([Feature.CsharpNewCacheKey]);
-
-  for (const knownLanguage of Object.values(BuiltInLanguage)) {
-    // Skip C# since we expect a result for it, which is tested in the previous test.
-    if (knownLanguage === BuiltInLanguage.csharp) {
-      continue;
-    }
-    const result = await getFeaturePrefix(codeql, features, knownLanguage);
-    t.deepEqual(result, "", `Expected no feature prefix for ${knownLanguage}`);
-  }
-});
-
-test("getFeaturePrefix - C# - returns prefix if CsharpCacheBuildModeNone is enabled", async (t) => {
-  const codeql = createStubCodeQL({});
-  const features = createFeatures([Feature.CsharpCacheBuildModeNone]);
-
-  const result = await getFeaturePrefix(
-    codeql,
-    features,
-    BuiltInLanguage.csharp,
-  );
-  t.notDeepEqual(result, "");
-  t.assert(result.endsWith("-"));
-  // Check the length of the prefix, which should correspond to `cacheKeyHashLength` + 1 for the trailing `-`.
-  t.is(result.length, cacheKeyHashLength + 1);
-});
-
-test("getFeaturePrefix - non-C# - returns '' if CsharpCacheBuildModeNone is enabled", async (t) => {
-  const codeql = createStubCodeQL({});
-  const features = createFeatures([Feature.CsharpCacheBuildModeNone]);
-
-  for (const knownLanguage of Object.values(BuiltInLanguage)) {
-    // Skip C# since we expect a result for it, which is tested in the previous test.
-    if (knownLanguage === BuiltInLanguage.csharp) {
-      continue;
-    }
-    const result = await getFeaturePrefix(codeql, features, knownLanguage);
-    t.deepEqual(result, "", `Expected no feature prefix for ${knownLanguage}`);
-  }
-});
diff --git a/src/dependency-caching.ts b/src/dependency-caching.ts
deleted file mode 100644
index f04d38f46c..0000000000
--- a/src/dependency-caching.ts
+++ /dev/null
@@ -1,622 +0,0 @@
-import * as os from "os";
-import { join } from "path";
-
-import * as actionsCache from "@actions/cache";
-import * as glob from "@actions/glob";
-
-import { getTemporaryDirectory } from "./actions-util";
-import { listActionsCaches } from "./api-client";
-import { createCacheKeyHash, getTotalCacheSize } from "./caching-utils";
-import { CodeQL } from "./codeql";
-import { Config } from "./config-utils";
-import { EnvVar } from "./environment";
-import { Feature, FeatureEnablement } from "./feature-flags";
-import { BuiltInLanguage, Language } from "./languages";
-import { Logger } from "./logging";
-import { getErrorMessage, getRequiredEnvParam } from "./util";
-
-/**
- * Caching configuration for a particular language.
- */
-export interface CacheConfig {
-  /** Gets the paths of directories on the runner that should be included in the cache. */
-  getDependencyPaths: (
-    codeql: CodeQL,
-    features: FeatureEnablement,
-  ) => Promise;
-  /**
-   * Gets an array of glob patterns for the paths of files whose contents affect which dependencies are used
-   * by a project. This function also checks whether there are any matching files and returns
-   * `undefined` if no files match.
-   *
-   * The glob patterns are intended to be used for cache keys, where we find all files which match these
-   * patterns, calculate a hash for their contents, and use that hash as part of the cache key.
-   */
-  getHashPatterns: (
-    codeql: CodeQL,
-    features: FeatureEnablement,
-  ) => Promise;
-}
-
-const CODEQL_DEPENDENCY_CACHE_PREFIX = "codeql-dependencies";
-const CODEQL_DEPENDENCY_CACHE_VERSION = 1;
-
-/**
- * Returns a path to a directory intended to be used to store .jar files
- * for the Java `build-mode: none` extractor.
- * @returns The path to the directory that should be used by the `build-mode: none` extractor.
- */
-export function getJavaTempDependencyDir(): string {
-  return join(getTemporaryDirectory(), "codeql_java", "repository");
-}
-
-/**
- * Returns an array of paths of directories on the runner that should be included in a dependency cache
- * for a Java analysis. It is important that this is a function, because we call `getTemporaryDirectory`
- * which would otherwise fail in tests if we haven't had a chance to initialise `RUNNER_TEMP`.
- *
- * @returns The paths of directories on the runner that should be included in a dependency cache
- * for a Java analysis.
- */
-export async function getJavaDependencyDirs(): Promise {
-  return [
-    // Maven
-    join(os.homedir(), ".m2", "repository"),
-    // Gradle
-    join(os.homedir(), ".gradle", "caches"),
-    // CodeQL Java build-mode: none
-    getJavaTempDependencyDir(),
-  ];
-}
-
-/**
- * Returns a path to a directory intended to be used to store dependencies
- * for the C# `build-mode: none` extractor.
- * @returns The path to the directory that should be used by the `build-mode: none` extractor.
- */
-export function getCsharpTempDependencyDir(): string {
-  return join(getTemporaryDirectory(), "codeql_csharp", "repository");
-}
-
-/**
- * Returns an array of paths of directories on the runner that should be included in a dependency cache
- * for a C# analysis.
- *
- * @returns The paths of directories on the runner that should be included in a dependency cache
- * for a C# analysis.
- */
-export async function getCsharpDependencyDirs(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-): Promise {
-  const dirs = [
-    // Nuget
-    join(os.homedir(), ".nuget", "packages"),
-  ];
-
-  if (await features.getValue(Feature.CsharpCacheBuildModeNone, codeql)) {
-    dirs.push(getCsharpTempDependencyDir());
-  }
-
-  return dirs;
-}
-
-/**
- * Checks that there are files which match `patterns`. If there are matching files for any of the patterns,
- * this function returns all `patterns`. Otherwise, `undefined` is returned.
- *
- * @param patterns The glob patterns to find matching files for.
- * @returns The array of glob patterns if there are matching files, or `undefined` otherwise.
- */
-export async function makePatternCheck(
-  patterns: string[],
-): Promise {
-  const globber = await makeGlobber(patterns);
-
-  if ((await globber.glob()).length === 0) {
-    return undefined;
-  }
-
-  return patterns;
-}
-
-/** These files contain accurate information about dependencies, including the exact versions
- * that the relevant package manager has determined for the project. Using these gives us
- * stable hashes unless the dependencies change.
- */
-export const CSHARP_BASE_PATTERNS = [
-  // NuGet
-  "**/packages.lock.json",
-  // Paket
-  "**/paket.lock",
-];
-
-/** These are less accurate for use in cache key calculations, because they:
- *
- * - Don't contain the exact versions used. They may only contain version ranges or none at all.
- * - They contain information unrelated to dependencies, which we don't care about.
- *
- * As a result, the hash we compute from these files may change, even if
- * the dependencies haven't changed.
- */
-export const CSHARP_EXTRA_PATTERNS = [
-  "**/*.csproj",
-  "**/packages.config",
-  "**/nuget.config",
-];
-
-/**
- * Returns the list of glob patterns that should be used to calculate the cache key hash
- * for a C# dependency cache. This will try to use `CSHARP_BASE_PATTERNS` whenever possible.
- * As a fallback, it will also use `CSHARP_EXTRA_PATTERNS` if the corresponding FF is enabled.
- *
- * @param codeql The CodeQL instance to use.
- * @param features Information about which FFs are enabled.
- * @returns A list of glob patterns to use for hashing.
- */
-export async function getCsharpHashPatterns(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-): Promise {
-  const basePatterns = await internal.makePatternCheck(CSHARP_BASE_PATTERNS);
-
-  if (basePatterns !== undefined) {
-    return basePatterns;
-  }
-
-  if (await features.getValue(Feature.CsharpNewCacheKey, codeql)) {
-    return internal.makePatternCheck(CSHARP_EXTRA_PATTERNS);
-  }
-
-  // If we get to this point, we didn't find any files with `CSHARP_BASE_PATTERNS`,
-  // and `Feature.CsharpNewCacheKey` is not enabled.
-  return undefined;
-}
-
-/**
- * Default caching configurations per language.
- */
-const defaultCacheConfigs: { [language: string]: CacheConfig } = {
-  java: {
-    getDependencyPaths: getJavaDependencyDirs,
-    getHashPatterns: async () =>
-      internal.makePatternCheck([
-        // Maven
-        "**/pom.xml",
-        // Gradle
-        "**/*.gradle*",
-        "**/gradle-wrapper.properties",
-        "buildSrc/**/Versions.kt",
-        "buildSrc/**/Dependencies.kt",
-        "gradle/*.versions.toml",
-        "**/versions.properties",
-      ]),
-  },
-  csharp: {
-    getDependencyPaths: getCsharpDependencyDirs,
-    getHashPatterns: getCsharpHashPatterns,
-  },
-  go: {
-    getDependencyPaths: async () => [join(os.homedir(), "go", "pkg", "mod")],
-    getHashPatterns: async () => internal.makePatternCheck(["**/go.sum"]),
-  },
-};
-
-async function makeGlobber(patterns: string[]): Promise {
-  return glob.create(patterns.join("\n"));
-}
-
-/** Enumerates possible outcomes for cache hits. */
-export enum CacheHitKind {
-  /** We were unable to calculate a hash for the key. */
-  NoHash = "no-hash",
-  /** No cache was found. */
-  Miss = "miss",
-  /** The primary cache key matched. */
-  Exact = "exact",
-  /** A restore key matched. */
-  Partial = "partial",
-}
-
-/** Represents results of trying to restore a dependency cache for a language. */
-export interface DependencyCacheRestoreStatus {
-  language: Language;
-  hit_kind: CacheHitKind;
-  download_duration_ms?: number;
-}
-
-/** An array of `DependencyCacheRestoreStatus` objects for each analysed language with a caching configuration. */
-export type DependencyCacheRestoreStatusReport = DependencyCacheRestoreStatus[];
-
-/** Represents the results of `downloadDependencyCaches`. */
-export interface DownloadDependencyCachesResult {
-  /** The status report for telemetry */
-  statusReport: DependencyCacheRestoreStatusReport;
-  /** An array of cache keys that we have restored and therefore know to exist. */
-  restoredKeys: string[];
-}
-
-/**
- * A wrapper around `cacheConfig.getHashPatterns` which logs when there are no files to calculate
- * a hash for the cache key from.
- *
- * @param codeql The CodeQL instance to use.
- * @param features Information about which FFs are enabled.
- * @param language The language the `CacheConfig` is for. For use in the log message.
- * @param cacheConfig The caching configuration to call `getHashPatterns` on.
- * @param checkType Whether we are checking the patterns for a download or upload.
- * @param logger The logger to write the log message to if there is an error.
- * @returns An array of glob patterns to use for hashing files, or `undefined` if there are no matching files.
- */
-export async function checkHashPatterns(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  language: Language,
-  cacheConfig: CacheConfig,
-  checkType: "download" | "upload",
-  logger: Logger,
-): Promise {
-  const patterns = await cacheConfig.getHashPatterns(codeql, features);
-
-  if (patterns === undefined) {
-    logger.info(
-      `Skipping ${checkType} of dependency cache for ${language} as we cannot calculate a hash for the cache key.`,
-    );
-  }
-
-  return patterns;
-}
-
-/**
- * Attempts to restore dependency caches for the languages being analyzed.
- *
- * @param codeql The CodeQL instance to use.
- * @param features Information about which FFs are enabled.
- * @param languages The languages being analyzed.
- * @param logger A logger to record some informational messages to.
- *
- * @returns An array of `DependencyCacheRestoreStatus` objects for each analysed language with a caching configuration.
- */
-export async function downloadDependencyCaches(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  languages: Language[],
-  logger: Logger,
-): Promise {
-  const status: DependencyCacheRestoreStatusReport = [];
-  const restoredKeys: string[] = [];
-
-  for (const language of languages) {
-    const cacheConfig = defaultCacheConfigs[language];
-
-    if (cacheConfig === undefined) {
-      logger.info(
-        `Skipping download of dependency cache for ${language} as we have no caching configuration for it.`,
-      );
-      continue;
-    }
-
-    // Check that we can find files to calculate the hash for the cache key from, so we don't end up
-    // with an empty string.
-    const patterns = await checkHashPatterns(
-      codeql,
-      features,
-      language,
-      cacheConfig,
-      "download",
-      logger,
-    );
-    if (patterns === undefined) {
-      status.push({ language, hit_kind: CacheHitKind.NoHash });
-      continue;
-    }
-
-    const primaryKey = await cacheKey(codeql, features, language, patterns);
-    const restoreKeys: string[] = [
-      await cachePrefix(codeql, features, language),
-    ];
-
-    logger.info(
-      `Downloading cache for ${language} with key ${primaryKey} and restore keys ${restoreKeys.join(
-        ", ",
-      )}`,
-    );
-
-    const start = performance.now();
-    const hitKey = await actionsCache.restoreCache(
-      await cacheConfig.getDependencyPaths(codeql, features),
-      primaryKey,
-      restoreKeys,
-    );
-    const download_duration_ms = Math.round(performance.now() - start);
-
-    if (hitKey !== undefined) {
-      logger.info(`Cache hit on key ${hitKey} for ${language}.`);
-
-      // We have a partial cache hit, unless the key of the restored cache matches the
-      // primary restore key.
-      let hit_kind = CacheHitKind.Partial;
-      if (hitKey === primaryKey) {
-        hit_kind = CacheHitKind.Exact;
-      }
-
-      status.push({
-        language,
-        hit_kind,
-        download_duration_ms,
-      });
-      restoredKeys.push(hitKey);
-    } else {
-      status.push({ language, hit_kind: CacheHitKind.Miss });
-      logger.info(`No suitable cache found for ${language}.`);
-    }
-  }
-
-  return { statusReport: status, restoredKeys };
-}
-
-/** Enumerates possible outcomes for storing caches. */
-export enum CacheStoreResult {
-  /** We were unable to calculate a hash for the key. */
-  NoHash = "no-hash",
-  /** There is nothing to store in the cache. */
-  Empty = "empty",
-  /** There already exists a cache with the key we are trying to store. */
-  Duplicate = "duplicate",
-  /** The cache was stored successfully. */
-  Stored = "stored",
-}
-
-/** Represents results of trying to upload a dependency cache for a language. */
-export interface DependencyCacheUploadStatus {
-  language: Language;
-  result: CacheStoreResult;
-  upload_size_bytes?: number;
-  upload_duration_ms?: number;
-}
-
-/** An array of `DependencyCacheUploadStatus` objects for each analysed language with a caching configuration. */
-export type DependencyCacheUploadStatusReport = DependencyCacheUploadStatus[];
-
-/**
- * Attempts to store caches for the languages that were analyzed.
- *
- * @param codeql The CodeQL instance to use.
- * @param features Information about which FFs are enabled.
- * @param config The configuration for this workflow.
- * @param logger A logger to record some informational messages to.
- *
- * @returns An array of `DependencyCacheUploadStatus` objects for each analysed language with a caching configuration.
- */
-export async function uploadDependencyCaches(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  config: Config,
-  logger: Logger,
-): Promise {
-  const status: DependencyCacheUploadStatusReport = [];
-  for (const language of config.languages) {
-    const cacheConfig = defaultCacheConfigs[language];
-
-    if (cacheConfig === undefined) {
-      logger.info(
-        `Skipping upload of dependency cache for ${language} as we have no caching configuration for it.`,
-      );
-      continue;
-    }
-
-    // Check that we can find files to calculate the hash for the cache key from, so we don't end up
-    // with an empty string.
-    const patterns = await checkHashPatterns(
-      codeql,
-      features,
-      language,
-      cacheConfig,
-      "upload",
-      logger,
-    );
-    if (patterns === undefined) {
-      status.push({ language, result: CacheStoreResult.NoHash });
-      continue;
-    }
-
-    // Now that we have verified that there are suitable files, compute the hash for the cache key.
-    const key = await cacheKey(codeql, features, language, patterns);
-
-    // Check that we haven't previously restored this exact key. If a cache with this key
-    // already exists in the Actions Cache, performing the next steps is pointless as the cache
-    // will not get overwritten. We can therefore skip the expensive work of measuring the size
-    // of the cache contents and attempting to upload it if we know that the cache already exists.
-    if (config.dependencyCachingRestoredKeys.includes(key)) {
-      status.push({ language, result: CacheStoreResult.Duplicate });
-      continue;
-    }
-
-    // Calculate the size of the files that we would store in the cache. We use this to determine whether the
-    // cache should be saved or not. For example, if there are no files to store, then we skip creating the
-    // cache. In the future, we could also:
-    // - Skip uploading caches with a size below some threshold: this makes sense for avoiding the overhead
-    //   of storing and restoring small caches, but does not help with alert wobble if a package repository
-    //   cannot be reached in a given run.
-    // - Skip uploading caches with a size above some threshold: this could be a concern if other workflows
-    //   use the cache quota that we compete with. In that case, we do not wish to use up all of the quota
-    //   with the dependency caches. For this, we could use the Cache API to check whether other workflows
-    //   are using the quota and how full it is.
-    const size = await getTotalCacheSize(
-      await cacheConfig.getDependencyPaths(codeql, features),
-      logger,
-      true,
-    );
-
-    // Skip uploading an empty cache.
-    if (size === 0) {
-      status.push({ language, result: CacheStoreResult.Empty });
-      logger.info(
-        `Skipping upload of dependency cache for ${language} since it is empty.`,
-      );
-      continue;
-    }
-
-    logger.info(
-      `Uploading cache of size ${size} for ${language} with key ${key}...`,
-    );
-
-    try {
-      const start = performance.now();
-      await actionsCache.saveCache(
-        await cacheConfig.getDependencyPaths(codeql, features),
-        key,
-      );
-      const upload_duration_ms = Math.round(performance.now() - start);
-
-      status.push({
-        language,
-        result: CacheStoreResult.Stored,
-        upload_size_bytes: Math.round(size),
-        upload_duration_ms,
-      });
-    } catch (error) {
-      // `ReserveCacheError` indicates that the cache key is already in use, which means that a
-      // cache with that key already exists or is in the process of being uploaded by another
-      // workflow. We can ignore this.
-      if (error instanceof actionsCache.ReserveCacheError) {
-        logger.info(
-          `Not uploading cache for ${language}, because ${key} is already in use.`,
-        );
-        logger.debug(error.message);
-
-        status.push({ language, result: CacheStoreResult.Duplicate });
-      } else {
-        // Propagate other errors upwards.
-        throw error;
-      }
-    }
-  }
-
-  return status;
-}
-
-/**
- * Computes a cache key for the specified language.
- *
- * @param codeql The CodeQL instance to use.
- * @param features Information about which FFs are enabled.
- * @param language The language being analyzed.
- * @param patterns The file patterns to hash.
- *
- * @returns A cache key capturing information about the project(s) being analyzed in the specified language.
- */
-export async function cacheKey(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  language: Language,
-  patterns: string[],
-): Promise {
-  const hash = await glob.hashFiles(patterns.join("\n"));
-  return `${await cachePrefix(codeql, features, language)}${hash}`;
-}
-
-/**
- * If experimental features which the cache contents depend on are enabled for the current language,
- * this function returns a prefix that uniquely identifies the set of enabled features. The purpose of
- * this is to avoid restoring caches whose contents depended on experimental features, if those
- * experimental features are later disabled.
- *
- * @param codeql The CodeQL instance.
- * @param features Information about enabled features.
- * @param language The language we are creating the key for.
- *
- * @returns A cache key prefix identifying the enabled, experimental features that the cache depends on.
- */
-export async function getFeaturePrefix(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  language: Language,
-): Promise {
-  const enabledFeatures: Feature[] = [];
-
-  const addFeatureIfEnabled = async (feature: Feature) => {
-    if (await features.getValue(feature, codeql)) {
-      enabledFeatures.push(feature);
-    }
-  };
-
-  if (language === BuiltInLanguage.csharp) {
-    await addFeatureIfEnabled(Feature.CsharpNewCacheKey);
-    await addFeatureIfEnabled(Feature.CsharpCacheBuildModeNone);
-  }
-
-  // If any features that affect the cache are enabled, return a feature prefix by
-  // computing a hash of the feature array.
-  if (enabledFeatures.length > 0) {
-    return `${createCacheKeyHash(enabledFeatures)}-`;
-  }
-
-  // No feature prefix.
-  return "";
-}
-
-/**
- * Constructs a prefix for the cache key, comprised of a CodeQL-specific prefix, a version number that
- * can be changed to invalidate old caches, the runner's operating system, and the specified language name.
- *
- * @param codeql The CodeQL instance to use.
- * @param features Information about which FFs are enabled.
- * @param language The language being analyzed.
- * @returns The prefix that identifies what a cache is for.
- */
-async function cachePrefix(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  language: Language,
-): Promise {
-  const runnerOs = getRequiredEnvParam("RUNNER_OS");
-  const customPrefix = process.env[EnvVar.DEPENDENCY_CACHING_PREFIX];
-  let prefix = CODEQL_DEPENDENCY_CACHE_PREFIX;
-
-  if (customPrefix !== undefined && customPrefix.length > 0) {
-    prefix = `${prefix}-${customPrefix}`;
-  }
-
-  // Calculate the feature prefix for the cache, if any. This is a hash that identifies
-  // experimental features that affect the cache contents.
-  const featurePrefix = await getFeaturePrefix(codeql, features, language);
-
-  // Assemble the cache key.
-  return `${prefix}-${featurePrefix}${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`;
-}
-
-/** Represents information about our overall cache usage for CodeQL dependency caches. */
-export interface DependencyCachingUsageReport {
-  count: number;
-  size_bytes: number;
-}
-
-/**
- * Tries to determine the overall cache usage for CodeQL dependencies caches.
- *
- * @param logger The logger to log errors to.
- * @returns Returns the overall cache usage for CodeQL dependencies caches, or `undefined` if we couldn't determine it.
- */
-export async function getDependencyCacheUsage(
-  logger: Logger,
-): Promise {
-  try {
-    const caches = await listActionsCaches(CODEQL_DEPENDENCY_CACHE_PREFIX);
-    const totalSize = caches.reduce(
-      (acc, cache) => acc + (cache.size_in_bytes ?? 0),
-      0,
-    );
-    return { count: caches.length, size_bytes: totalSize };
-  } catch (err) {
-    logger.warning(
-      `Unable to retrieve information about dependency cache usage: ${getErrorMessage(err)}`,
-    );
-  }
-
-  return undefined;
-}
-
-export const internal = {
-  makePatternCheck,
-};
diff --git a/src/diagnostics.ts b/src/diagnostics.ts
deleted file mode 100644
index fa0e87c046..0000000000
--- a/src/diagnostics.ts
+++ /dev/null
@@ -1,288 +0,0 @@
-import { existsSync, mkdirSync, writeFileSync } from "fs";
-import path from "path";
-
-import type { Config } from "./config-utils";
-import { Language } from "./languages";
-import { getActionsLogger } from "./logging";
-import { getCodeQLDatabasePath } from "./util";
-
-/**
- * Known tags for diagnostics. There is currently only "internal-error",
- * but others may be added in the future.
- */
-export type DiagnosticTag = "internal-error";
-
-/** Optional information about the origin of a diagnostic. */
-export type DiagnosticSourceOptions = {
-  /**
-   * Name of the CodeQL extractor. This is used to identify which tool component the reporting
-   * descriptor object should be nested under in SARIF.
-   */
-  extractorName?: string;
-  /** An array of tags for the diagnostic. */
-  tags?: DiagnosticTag[];
-};
-
-/** Represents information about the origin of a diagnostic. */
-export type DiagnosticSource = {
-  /**
-   * An identifier under which it makes sense to group this diagnostic message.
-   * This is used to build the SARIF reporting descriptor object.
-   */
-  id: string;
-  /** Display name for the ID. This is used to build the SARIF reporting descriptor object. */
-  name: string;
-} & DiagnosticSourceOptions;
-
-/**
- * Represents a diagnostic message for the tool status page, etc.
- *
- * Unlike {@link DiagnosticMessage}, properties which can automatically
- * be populated are optional in this type.
- */
-export type DiagnosticMessageOptions = {
-  /** ISO 8601 timestamp */
-  timestamp?: string;
-  /** Information about the origin of the diagnostic. */
-  source?: DiagnosticSourceOptions;
-  /** GitHub flavored Markdown formatted message. Should include inline links to any help pages. */
-  markdownMessage?: string;
-  /** Plain text message. Used by components where the string processing needed to support Markdown is cumbersome. */
-  plaintextMessage?: string;
-  /** List of help links intended to supplement the `plaintextMessage`. */
-  helpLinks?: string[];
-  /** SARIF severity */
-  severity?: "error" | "warning" | "note";
-  visibility?: {
-    /** True if the message should be displayed on the status page (defaults to false) */
-    statusPage?: boolean;
-    /**
-     * True if the message should be counted in the diagnostics summary table printed by `codeql database analyze`
-     * (defaults to false)
-     */
-    cliSummaryTable?: boolean;
-    /** True if the message should be sent to telemetry (defaults to false) */
-    telemetry?: boolean;
-  };
-  location?: {
-    /** Path to the affected file if appropriate, relative to the source root */
-    file?: string;
-    startLine?: number;
-    startColumn?: number;
-    endLine?: number;
-    endColumn?: number;
-  };
-  /** Structured metadata about the diagnostic message */
-  attributes?: { [key: string]: any };
-};
-
-/** Represents a diagnostic message for the tool status page, etc. */
-export type DiagnosticMessage = DiagnosticMessageOptions & {
-  /** ISO 8601 timestamp */
-  timestamp: string;
-  /** Information about the origin of the diagnostic. */
-  source: DiagnosticSource;
-};
-
-/** Represents a diagnostic message that has not yet been written to the database. */
-interface UnwrittenDiagnostic {
-  /** The diagnostic message that has not yet been written. */
-  diagnostic: DiagnosticMessage;
-  /** The language the diagnostic is for. */
-  language: Language;
-}
-
-/** A list of diagnostics which have not yet been written to disk. */
-let unwrittenDiagnostics: UnwrittenDiagnostic[] = [];
-
-/**
- * A list of diagnostics which have not yet been written to disk,
- * and where the language does not matter.
- */
-let unwrittenDefaultLanguageDiagnostics: DiagnosticMessage[] = [];
-
-/**
- * Counter used to generate a unique suffix for each diagnostic filename, so that
- * two diagnostics produced within the same millisecond do not overwrite each
- * other on disk.
- */
-let diagnosticCounter = 0;
-
-/**
- * Constructs a new diagnostic message with the specified id and name, as well as optional additional data.
- *
- * @param id An identifier under which it makes sense to group this diagnostic message.
- * @param name Display name for the ID.
- * @param data Optional additional data to initialize the diagnostic with.
- * @returns Returns the new diagnostic message.
- */
-export function makeDiagnostic(
-  id: string,
-  name: string,
-  data: DiagnosticMessageOptions | undefined = undefined,
-): DiagnosticMessage {
-  return {
-    ...data,
-    timestamp: data?.timestamp ?? new Date().toISOString(),
-    source: { ...data?.source, id, name },
-  };
-}
-
-/**
- * Adds the given diagnostic to the database. If the database does not yet exist,
- * the diagnostic will be written to it once it has been created.
- *
- * @param config The configuration that tells us where to store the diagnostic.
- * @param language The language which the diagnostic is for.
- * @param diagnostic The diagnostic message to add to the database.
- */
-export function addDiagnostic(
-  config: Config,
-  language: Language,
-  diagnostic: DiagnosticMessage,
-) {
-  const logger = getActionsLogger();
-  const databasePath = language
-    ? getCodeQLDatabasePath(config, language)
-    : config.dbLocation;
-
-  // Check that the database exists before writing to it. If the database does not yet exist,
-  // store the diagnostic in memory and write it later.
-  if (existsSync(databasePath)) {
-    writeDiagnostic(config, language, diagnostic);
-  } else {
-    logger.debug(
-      `Writing a diagnostic for ${language}, but the database at ${databasePath} does not exist yet.`,
-    );
-
-    unwrittenDiagnostics.push({ diagnostic, language });
-  }
-}
-
-/** Adds a diagnostic that is not specific to any language. */
-export function addNoLanguageDiagnostic(
-  config: Config | undefined,
-  diagnostic: DiagnosticMessage,
-) {
-  if (config !== undefined) {
-    addDiagnostic(
-      config,
-      // Arbitrarily choose the first language. We could also choose all languages, but that
-      // increases the risk of misinterpreting the data.
-      config.languages[0],
-      diagnostic,
-    );
-  } else {
-    unwrittenDefaultLanguageDiagnostics.push(diagnostic);
-  }
-}
-
-/**
- * Writes the given diagnostic to the database.
- *
- * @param config The configuration that tells us where to store the diagnostic.
- * @param language The language which the diagnostic is for.
- * @param diagnostic The diagnostic message to add to the database.
- */
-function writeDiagnostic(
-  config: Config,
-  language: Language | undefined,
-  diagnostic: DiagnosticMessage,
-) {
-  const logger = getActionsLogger();
-  const databasePath = language
-    ? getCodeQLDatabasePath(config, language)
-    : config.dbLocation;
-  const diagnosticsPath = path.resolve(
-    databasePath,
-    "diagnostic",
-    "codeql-action",
-  );
-
-  try {
-    // Create the directory if it doesn't exist yet.
-    mkdirSync(diagnosticsPath, { recursive: true });
-
-    // Include a monotonically increasing suffix to avoid filename collisions
-    // between diagnostics produced within the same millisecond.
-    const uniqueSuffix = (diagnosticCounter++).toString();
-    // We should only need to remove colons, but to be defensive, only allow a restricted set of
-    // characters.
-    const sanitizedTimestamp = diagnostic.timestamp.replace(
-      /[^a-zA-Z0-9.-]/g,
-      "",
-    );
-    const jsonPath = path.resolve(
-      diagnosticsPath,
-      `codeql-action-${sanitizedTimestamp}-${uniqueSuffix}.json`,
-    );
-
-    writeFileSync(jsonPath, JSON.stringify(diagnostic));
-  } catch (err) {
-    logger.warning(`Unable to write diagnostic message to database: ${err}`);
-    logger.debug(JSON.stringify(diagnostic));
-  }
-}
-
-/** Report if there are unwritten diagnostics and write them to the log. */
-export function logUnwrittenDiagnostics() {
-  const logger = getActionsLogger();
-  const num = unwrittenDiagnostics.length;
-  if (num > 0) {
-    logger.warning(
-      `${num} diagnostic(s) could not be written to the database and will not appear on the Tool Status Page.`,
-    );
-
-    for (const unwritten of unwrittenDiagnostics) {
-      logger.debug(JSON.stringify(unwritten.diagnostic));
-    }
-  }
-}
-
-/** Writes all unwritten diagnostics to disk. */
-export function flushDiagnostics(config: Config) {
-  const logger = getActionsLogger();
-
-  const diagnosticsCount =
-    unwrittenDiagnostics.length + unwrittenDefaultLanguageDiagnostics.length;
-  logger.debug(`Writing ${diagnosticsCount} diagnostic(s) to database.`);
-
-  for (const unwritten of unwrittenDiagnostics) {
-    writeDiagnostic(config, unwritten.language, unwritten.diagnostic);
-  }
-  for (const unwritten of unwrittenDefaultLanguageDiagnostics) {
-    addNoLanguageDiagnostic(config, unwritten);
-  }
-
-  // Reset the unwritten diagnostics arrays.
-  unwrittenDiagnostics = [];
-  unwrittenDefaultLanguageDiagnostics = [];
-}
-
-/**
- * Creates a telemetry-only diagnostic message. This is a convenience function
- * for creating diagnostics that should only be sent to telemetry and not
- * displayed on the status page or CLI summary table.
- *
- * @param id An identifier under which it makes sense to group this diagnostic message
- * @param name Display name
- * @param attributes Structured metadata
- */
-export function makeTelemetryDiagnostic(
-  id: string,
-  name: string,
-  attributes: { [key: string]: any },
-  tags?: DiagnosticTag[],
-): DiagnosticMessage {
-  return makeDiagnostic(id, name, {
-    attributes,
-    visibility: {
-      cliSummaryTable: false,
-      statusPage: false,
-      telemetry: true,
-    },
-    source: {
-      tags,
-    },
-  });
-}
diff --git a/src/diff-informed-analysis-utils.test.ts b/src/diff-informed-analysis-utils.test.ts
deleted file mode 100644
index e07240e322..0000000000
--- a/src/diff-informed-analysis-utils.test.ts
+++ /dev/null
@@ -1,507 +0,0 @@
-import test, { ExecutionContext } from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import type { PullRequestBranches } from "./actions-util";
-import * as apiClient from "./api-client";
-import {
-  getDiffInformedAnalysisBranches,
-  prepareDiffInformedAnalysis,
-  exportedForTesting,
-} from "./diff-informed-analysis-utils";
-import { Feature, FeatureEnablement, initFeatures } from "./feature-flags";
-import { getRunnerLogger } from "./logging";
-import { parseRepositoryNwo } from "./repository";
-import {
-  setupTests,
-  createFeatures,
-  mockCodeQLVersion,
-  mockFeatureFlagApiEndpoint,
-  setupActionsVars,
-  makeMacro,
-} from "./testing-utils";
-import { GitHubVariant, withTmpDir } from "./util";
-import type { GitHubVersion } from "./util";
-
-setupTests(test);
-
-interface DiffInformedAnalysisTestCase {
-  featureEnabled: boolean;
-  gitHubVersion: GitHubVersion;
-  pullRequestBranches: PullRequestBranches;
-  codeQLVersion: string;
-  diffInformedQueriesEnvVar?: boolean;
-}
-
-const defaultTestCase: DiffInformedAnalysisTestCase = {
-  featureEnabled: true,
-  gitHubVersion: {
-    type: GitHubVariant.DOTCOM,
-  },
-  pullRequestBranches: {
-    base: "main",
-    head: "feature-branch",
-  },
-  codeQLVersion: "2.21.0",
-};
-
-const testShouldPerformDiffInformedAnalysis = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    partialTestCase: Partial,
-    expectedResult: boolean,
-  ) => {
-    return await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-
-      const testCase = { ...defaultTestCase, ...partialTestCase };
-      const logger = getRunnerLogger(true);
-      const codeql = mockCodeQLVersion(testCase.codeQLVersion);
-
-      if (testCase.diffInformedQueriesEnvVar !== undefined) {
-        process.env.CODEQL_ACTION_DIFF_INFORMED_QUERIES =
-          testCase.diffInformedQueriesEnvVar.toString();
-      } else {
-        delete process.env.CODEQL_ACTION_DIFF_INFORMED_QUERIES;
-      }
-
-      const features = initFeatures(
-        testCase.gitHubVersion,
-        parseRepositoryNwo("github/example"),
-        tmpDir,
-        logger,
-      );
-      mockFeatureFlagApiEndpoint(200, {
-        [Feature.DiffInformedQueries]: testCase.featureEnabled,
-      });
-
-      sinon
-        .stub(apiClient, "getGitHubVersion")
-        .resolves(testCase.gitHubVersion);
-      sinon
-        .stub(actionsUtil, "getPullRequestBranches")
-        .returns(testCase.pullRequestBranches);
-
-      const branches = await getDiffInformedAnalysisBranches(
-        codeql,
-        features,
-        logger,
-      );
-
-      t.is(branches !== undefined, expectedResult);
-
-      delete process.env.CODEQL_ACTION_DIFF_INFORMED_QUERIES;
-    });
-  },
-  title: (title) => `getDiffInformedAnalysisBranches: ${title}`,
-});
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns true in the default test case",
-  {},
-  true,
-);
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns false when feature flag is disabled from the API",
-  {
-    featureEnabled: false,
-  },
-  false,
-);
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns false when CODEQL_ACTION_DIFF_INFORMED_QUERIES is set to false",
-  {
-    featureEnabled: true,
-    diffInformedQueriesEnvVar: false,
-  },
-  false,
-);
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns true when CODEQL_ACTION_DIFF_INFORMED_QUERIES is set to true",
-  {
-    featureEnabled: false,
-    diffInformedQueriesEnvVar: true,
-  },
-  true,
-);
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns false for CodeQL version 2.20.0",
-  {
-    codeQLVersion: "2.20.0",
-  },
-  false,
-);
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns false for invalid GHES version",
-  {
-    gitHubVersion: {
-      type: GitHubVariant.GHES,
-      version: "invalid-version",
-    },
-  },
-  false,
-);
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns false for GHES version 3.18.5",
-  {
-    gitHubVersion: {
-      type: GitHubVariant.GHES,
-      version: "3.18.5",
-    },
-  },
-  false,
-);
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns true for GHES version 3.19.0",
-  {
-    gitHubVersion: {
-      type: GitHubVariant.GHES,
-      version: "3.19.0",
-    },
-  },
-  true,
-);
-
-testShouldPerformDiffInformedAnalysis.serial(
-  "returns false when not a pull request",
-  {
-    pullRequestBranches: undefined,
-  },
-  false,
-);
-
-test.serial(
-  "prepareDiffInformedAnalysis: returns false when not a pull request",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const logger = getRunnerLogger(true);
-      const codeql = mockCodeQLVersion("2.21.0");
-      const features = createFeatures([Feature.DiffInformedQueries]);
-
-      sinon.stub(actionsUtil, "getPullRequestBranches").returns(undefined);
-      sinon
-        .stub(apiClient, "getGitHubVersion")
-        .resolves({ type: GitHubVariant.DOTCOM });
-
-      const result = await prepareDiffInformedAnalysis(
-        codeql,
-        features,
-        logger,
-      );
-
-      t.false(result);
-    });
-  },
-);
-
-test.serial(
-  "prepareDiffInformedAnalysis: returns false when applicability check throws",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const logger = getRunnerLogger(true);
-      const codeql = mockCodeQLVersion("2.21.0");
-      // A features implementation whose getValue rejects, simulating an
-      // unexpected failure when determining whether diff-informed analysis
-      // should run.
-      const features: FeatureEnablement = {
-        getEnabledDefaultCliVersions: async () => {
-          throw new Error("not implemented");
-        },
-        getValue: async () => {
-          throw new Error("feature flag lookup failed");
-        },
-      };
-
-      const result = await prepareDiffInformedAnalysis(
-        codeql,
-        features,
-        logger,
-      );
-
-      t.false(result);
-    });
-  },
-);
-
-test.serial(
-  "prepareDiffInformedAnalysis: returns true when the diff is fetched successfully",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const logger = getRunnerLogger(true);
-      const codeql = mockCodeQLVersion("2.21.0");
-      const features = createFeatures([Feature.DiffInformedQueries]);
-
-      sinon
-        .stub(actionsUtil, "getPullRequestBranches")
-        .returns({ base: "main", head: "feature" });
-      sinon
-        .stub(apiClient, "getGitHubVersion")
-        .resolves({ type: GitHubVariant.DOTCOM });
-      // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-      sinon.stub(apiClient, "getApiClient").returns({
-        rest: {
-          repos: {
-            compareCommitsWithBasehead: sinon
-              .stub()
-              .resolves({ data: { files: [] } }),
-          },
-        },
-      } as any);
-
-      const result = await prepareDiffInformedAnalysis(
-        codeql,
-        features,
-        logger,
-      );
-
-      t.true(result);
-    });
-  },
-);
-
-test.serial(
-  "prepareDiffInformedAnalysis: returns false when the diff API call fails",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const logger = getRunnerLogger(true);
-      const codeql = mockCodeQLVersion("2.21.0");
-      const features = createFeatures([Feature.DiffInformedQueries]);
-
-      sinon
-        .stub(actionsUtil, "getPullRequestBranches")
-        .returns({ base: "main", head: "feature" });
-      sinon
-        .stub(apiClient, "getGitHubVersion")
-        .resolves({ type: GitHubVariant.DOTCOM });
-      const notFoundError: any = new Error("Not Found");
-      notFoundError.status = 404;
-      // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-      sinon.stub(apiClient, "getApiClient").returns({
-        rest: {
-          repos: {
-            compareCommitsWithBasehead: sinon.stub().rejects(notFoundError),
-          },
-        },
-      } as any);
-
-      const result = await prepareDiffInformedAnalysis(
-        codeql,
-        features,
-        logger,
-      );
-
-      t.false(result);
-    });
-  },
-);
-
-function runGetDiffRanges(changes: number, patch: string[] | undefined): any {
-  return exportedForTesting.getDiffRanges(
-    {
-      filename: "test.txt",
-      changes,
-      patch: patch?.join("\n"),
-    },
-    getRunnerLogger(true),
-  );
-}
-
-test.serial("getDiffRanges: file unchanged", async (t) => {
-  const diffRanges = runGetDiffRanges(0, undefined);
-  t.deepEqual(diffRanges, []);
-});
-
-test.serial("getDiffRanges: file diff too large", async (t) => {
-  const diffRanges = runGetDiffRanges(1000000, undefined);
-  t.deepEqual(diffRanges, [
-    {
-      path: "test.txt",
-      startLine: 0,
-      endLine: 0,
-    },
-  ]);
-});
-
-test.serial(
-  "getDiffRanges: diff thunk with single addition range",
-  async (t) => {
-    const diffRanges = runGetDiffRanges(2, [
-      "@@ -30,6 +50,8 @@",
-      " a",
-      " b",
-      " c",
-      "+1",
-      "+2",
-      " d",
-      " e",
-      " f",
-    ]);
-    t.deepEqual(diffRanges, [
-      {
-        path: "test.txt",
-        startLine: 53,
-        endLine: 54,
-      },
-    ]);
-  },
-);
-
-test.serial(
-  "getDiffRanges: diff thunk with single deletion range",
-  async (t) => {
-    const diffRanges = runGetDiffRanges(2, [
-      "@@ -30,8 +50,6 @@",
-      " a",
-      " b",
-      " c",
-      "-1",
-      "-2",
-      " d",
-      " e",
-      " f",
-    ]);
-    t.deepEqual(diffRanges, []);
-  },
-);
-
-test.serial("getDiffRanges: diff thunk with single update range", async (t) => {
-  const diffRanges = runGetDiffRanges(2, [
-    "@@ -30,7 +50,7 @@",
-    " a",
-    " b",
-    " c",
-    "-1",
-    "+2",
-    " d",
-    " e",
-    " f",
-  ]);
-  t.deepEqual(diffRanges, [
-    {
-      path: "test.txt",
-      startLine: 53,
-      endLine: 53,
-    },
-  ]);
-});
-
-test.serial("getDiffRanges: diff thunk with addition ranges", async (t) => {
-  const diffRanges = runGetDiffRanges(2, [
-    "@@ -30,7 +50,9 @@",
-    " a",
-    " b",
-    " c",
-    "+1",
-    " c",
-    "+2",
-    " d",
-    " e",
-    " f",
-  ]);
-  t.deepEqual(diffRanges, [
-    {
-      path: "test.txt",
-      startLine: 53,
-      endLine: 53,
-    },
-    {
-      path: "test.txt",
-      startLine: 55,
-      endLine: 55,
-    },
-  ]);
-});
-
-test.serial("getDiffRanges: diff thunk with mixed ranges", async (t) => {
-  const diffRanges = runGetDiffRanges(2, [
-    "@@ -30,7 +50,7 @@",
-    " a",
-    " b",
-    " c",
-    "-1",
-    " d",
-    "-2",
-    "+3",
-    " e",
-    " f",
-    "+4",
-    "+5",
-    " g",
-    " h",
-    " i",
-  ]);
-  t.deepEqual(diffRanges, [
-    {
-      path: "test.txt",
-      startLine: 54,
-      endLine: 54,
-    },
-    {
-      path: "test.txt",
-      startLine: 57,
-      endLine: 58,
-    },
-  ]);
-});
-
-test.serial("getDiffRanges: multiple diff thunks", async (t) => {
-  const diffRanges = runGetDiffRanges(2, [
-    "@@ -30,6 +50,8 @@",
-    " a",
-    " b",
-    " c",
-    "+1",
-    "+2",
-    " d",
-    " e",
-    " f",
-    "@@ -130,6 +150,8 @@",
-    " a",
-    " b",
-    " c",
-    "+1",
-    "+2",
-    " d",
-    " e",
-    " f",
-  ]);
-  t.deepEqual(diffRanges, [
-    {
-      path: "test.txt",
-      startLine: 53,
-      endLine: 54,
-    },
-    {
-      path: "test.txt",
-      startLine: 153,
-      endLine: 154,
-    },
-  ]);
-});
-
-test.serial("getDiffRanges: no diff context lines", async (t) => {
-  const diffRanges = runGetDiffRanges(2, ["@@ -30 +50,2 @@", "+1", "+2"]);
-  t.deepEqual(diffRanges, [
-    {
-      path: "test.txt",
-      startLine: 50,
-      endLine: 51,
-    },
-  ]);
-});
-
-test.serial("getDiffRanges: malformed thunk header", async (t) => {
-  const diffRanges = runGetDiffRanges(2, ["@@ 30 +50,2 @@", "+1", "+2"]);
-  t.deepEqual(diffRanges, undefined);
-});
diff --git a/src/diff-informed-analysis-utils.ts b/src/diff-informed-analysis-utils.ts
deleted file mode 100644
index b8e9c6915d..0000000000
--- a/src/diff-informed-analysis-utils.ts
+++ /dev/null
@@ -1,328 +0,0 @@
-import * as fs from "fs";
-
-import * as actionsUtil from "./actions-util";
-import type { PullRequestBranches } from "./actions-util";
-import { getApiClient, getGitHubVersion } from "./api-client";
-import type { CodeQL } from "./codeql";
-import { Feature, FeatureEnablement } from "./feature-flags";
-import { Logger } from "./logging";
-import { getRepositoryNwoFromEnv } from "./repository";
-import { getErrorMessage, GitHubVariant, satisfiesGHESVersion } from "./util";
-
-/**
- * This interface is an abbreviated version of the file diff object returned by
- * the GitHub API.
- */
-interface FileDiff {
-  filename: string;
-  changes: number;
-  // A patch may be absent if the file is binary, if the file diff is too large,
-  // or if the file is unchanged.
-  patch?: string | undefined;
-}
-
-/**
- * Get the branches to use for diff-informed analysis.
- *
- * @returns If the action should perform diff-informed analysis, return
- * the base and head branches that should be used to compute the diff ranges.
- * Otherwise return `undefined`.
- */
-export async function getDiffInformedAnalysisBranches(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  if (!(await features.getValue(Feature.DiffInformedQueries, codeql))) {
-    return undefined;
-  }
-
-  const gitHubVersion = await getGitHubVersion();
-  if (
-    gitHubVersion.type === GitHubVariant.GHES &&
-    satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)
-  ) {
-    return undefined;
-  }
-
-  const branches = actionsUtil.getPullRequestBranches();
-  if (!branches) {
-    logger.info(
-      "Not performing diff-informed analysis " +
-        "because we are not analyzing a pull request.",
-    );
-  }
-  return branches;
-}
-
-/**
- * Prepares the diff ranges needed for diff-informed analysis for the current
- * run.
- *
- * @returns `true` if the diff ranges were successfully computed and persisted
- *   and are therefore available for use, `false` otherwise.
- */
-export async function prepareDiffInformedAnalysis(
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  let branches: PullRequestBranches | undefined;
-  try {
-    branches = await getDiffInformedAnalysisBranches(codeql, features, logger);
-  } catch (e) {
-    // If we cannot determine whether diff-informed analysis applies (for
-    // example, because a feature-flag lookup failed), treat it as not
-    // applicable rather than triggering the overlay fallback.
-    logger.warning(
-      `Failed to determine branch information for diff-informed analysis: ${getErrorMessage(e)}`,
-    );
-    return false;
-  }
-  if (!branches) {
-    return false;
-  }
-
-  try {
-    return await computeAndPersistDiffRanges(branches, logger);
-  } catch (e) {
-    logger.warning(
-      `Failed to compute diff-informed analysis ranges: ${getErrorMessage(e)}`,
-    );
-    return false;
-  }
-}
-
-export interface DiffThunkRange {
-  /** Relative path from the repository root, using forward slashes as separators. */
-  path: string;
-  startLine: number;
-  endLine: number;
-}
-
-export function writeDiffRangesJsonFile(
-  logger: Logger,
-  ranges: DiffThunkRange[],
-): void {
-  const jsonContents = JSON.stringify(ranges, null, 2);
-  const jsonFilePath = actionsUtil.getDiffRangesJsonFilePath();
-  fs.writeFileSync(jsonFilePath, jsonContents);
-  logger.debug(
-    `Wrote pr-diff-range JSON file to ${jsonFilePath}:\n${jsonContents}`,
-  );
-}
-
-export function readDiffRangesJsonFile(
-  logger: Logger,
-): DiffThunkRange[] | undefined {
-  const jsonFilePath = actionsUtil.getDiffRangesJsonFilePath();
-  if (!fs.existsSync(jsonFilePath)) {
-    logger.debug(`Diff ranges JSON file does not exist at ${jsonFilePath}`);
-    return undefined;
-  }
-  const jsonContents = fs.readFileSync(jsonFilePath, "utf8");
-  logger.debug(
-    `Read pr-diff-range JSON file from ${jsonFilePath}:\n${jsonContents}`,
-  );
-  try {
-    return JSON.parse(jsonContents) as DiffThunkRange[];
-  } catch (e) {
-    logger.warning(
-      `Failed to parse diff ranges JSON file at ${jsonFilePath}: ${e}`,
-    );
-    return undefined;
-  }
-}
-
-/**
- * Return the file line ranges that were added or modified in the pull request.
- *
- * @param branches The base and head branches of the pull request.
- * @param logger
- * @returns An array of tuples, where each tuple contains the relative path of a
- * file (relative to the repository root, as returned by the GitHub compare API),
- * the start line and the end line (both 1-based and inclusive) of an
- * added or modified range in that file. Returns `undefined` if the action was
- * not triggered by a pull request or if there was an error.
- */
-export async function getPullRequestEditedDiffRanges(
-  branches: PullRequestBranches,
-  logger: Logger,
-): Promise {
-  const fileDiffs = await getFileDiffsWithBasehead(branches, logger);
-  if (fileDiffs === undefined) {
-    return undefined;
-  }
-  if (fileDiffs.length >= 300) {
-    // The "compare two commits" API returns a maximum of 300 changed files. If
-    // we see that many changed files, it is possible that there could be more,
-    // with the rest being truncated. In this case, we should not attempt to
-    // compute the diff ranges, as the result would be incomplete.
-    logger.warning(
-      `Cannot retrieve the full diff because there are too many ` +
-        `(${fileDiffs.length}) changed files in the pull request.`,
-    );
-    return undefined;
-  }
-  const results: DiffThunkRange[] = [];
-  for (const filediff of fileDiffs) {
-    const diffRanges = getDiffRanges(filediff, logger);
-    if (diffRanges === undefined) {
-      return undefined;
-    }
-    results.push(...diffRanges);
-  }
-  return results;
-}
-
-/**
- * Compute and persist the diff ranges for a pull request. This fetches the
- * diff from the GitHub API and writes it to the diff ranges JSON file so that
- * CodeQL can use it for diff-informed analysis.
- *
- * @param branches The base and head branches of the pull request, as returned
- *   by `getDiffInformedAnalysisBranches`.
- * @param logger
- * @returns `true` if the diff ranges were successfully computed and persisted,
- *   otherwise `false`.
- */
-export async function computeAndPersistDiffRanges(
-  branches: PullRequestBranches,
-  logger: Logger,
-): Promise {
-  logger.info("Computing PR diff ranges...");
-  const ranges = await getPullRequestEditedDiffRanges(branches, logger);
-  if (ranges === undefined) {
-    return false;
-  }
-  writeDiffRangesJsonFile(logger, ranges);
-  const distinctFiles = new Set(ranges.map((r) => r.path)).size;
-  logger.info(
-    `Persisted ${ranges.length} diff range(s) across ${distinctFiles} file(s).`,
-  );
-  return true;
-}
-
-async function getFileDiffsWithBasehead(
-  branches: PullRequestBranches,
-  logger: Logger,
-): Promise {
-  // Check CODE_SCANNING_REPOSITORY first. If it is empty or not set, fall back
-  // to GITHUB_REPOSITORY.
-  const repositoryNwo = getRepositoryNwoFromEnv(
-    "CODE_SCANNING_REPOSITORY",
-    "GITHUB_REPOSITORY",
-  );
-  const basehead = `${branches.base}...${branches.head}`;
-  try {
-    const response = await getApiClient().rest.repos.compareCommitsWithBasehead(
-      {
-        owner: repositoryNwo.owner,
-        repo: repositoryNwo.repo,
-        basehead,
-        per_page: 1,
-      },
-    );
-    logger.debug(
-      `Response from compareCommitsWithBasehead(${basehead}):` +
-        `\n${JSON.stringify(response, null, 2)}`,
-    );
-    return response.data.files;
-  } catch (error: any) {
-    if (error.status) {
-      logger.warning(`Error retrieving diff ${basehead}: ${error.message}`);
-      logger.debug(
-        `Error running compareCommitsWithBasehead(${basehead}):` +
-          `\nRequest: ${JSON.stringify(error.request, null, 2)}` +
-          `\nError Response: ${JSON.stringify(error.response, null, 2)}`,
-      );
-      return undefined;
-    } else {
-      throw error;
-    }
-  }
-}
-
-function getDiffRanges(
-  fileDiff: FileDiff,
-  logger: Logger,
-): DiffThunkRange[] | undefined {
-  if (fileDiff.patch === undefined) {
-    if (fileDiff.changes === 0) {
-      // There are situations where a changed file legitimately has no diff.
-      // For example, the file may be a binary file, or that the file may have
-      // been renamed with no changes to its contents. In these cases, the
-      // file would be reported as having 0 changes, and we can return an empty
-      // array to indicate no diff range in this file.
-      return [];
-    }
-    // If a file is reported to have nonzero changes but no patch, that may be
-    // due to the file diff being too large. In this case, we should fall back
-    // to a special diff range that covers the entire file.
-    return [
-      {
-        path: fileDiff.filename,
-        startLine: 0,
-        endLine: 0,
-      },
-    ];
-  }
-
-  // The 1-based file line number of the current line
-  let currentLine = 0;
-  // The 1-based file line number that starts the current range of added lines
-  let additionRangeStartLine: number | undefined = undefined;
-  const diffRanges: DiffThunkRange[] = [];
-
-  const diffLines = fileDiff.patch.split("\n");
-  // Adding a fake context line at the end ensures that the following loop will
-  // always terminate the last range of added lines.
-  diffLines.push(" ");
-
-  for (const diffLine of diffLines) {
-    if (diffLine.startsWith("-")) {
-      // Ignore deletions completely -- we do not even want to consider them when
-      // calculating consecutive ranges of added lines.
-      continue;
-    }
-    if (diffLine.startsWith("+")) {
-      if (additionRangeStartLine === undefined) {
-        additionRangeStartLine = currentLine;
-      }
-      currentLine++;
-      continue;
-    }
-    if (additionRangeStartLine !== undefined) {
-      // Any line that does not start with a "+" or "-" terminates the current
-      // range of added lines.
-      diffRanges.push({
-        path: fileDiff.filename,
-        startLine: additionRangeStartLine,
-        endLine: currentLine - 1,
-      });
-      additionRangeStartLine = undefined;
-    }
-    if (diffLine.startsWith("@@ ")) {
-      // A new hunk header line resets the current line number.
-      const match = diffLine.match(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/);
-      if (match === null) {
-        logger.warning(
-          `Cannot parse diff hunk header for ${fileDiff.filename}: ${diffLine}`,
-        );
-        return undefined;
-      }
-      currentLine = parseInt(match[1], 10);
-      continue;
-    }
-    if (diffLine.startsWith(" ")) {
-      // An unchanged context line advances the current line number.
-      currentLine++;
-      continue;
-    }
-  }
-  return diffRanges;
-}
-
-export const exportedForTesting = {
-  getDiffRanges,
-};
diff --git a/src/doc-url.ts b/src/doc-url.ts
deleted file mode 100644
index c624817e90..0000000000
--- a/src/doc-url.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * URLs to code scanning docs linked to from CodeQL Action logs.
- */
-
-export enum DocUrl {
-  ASSIGNING_PERMISSIONS_TO_JOBS = "https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs",
-  AUTOMATIC_BUILD_FAILED = "https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed",
-  CODEQL_BUILD_MODES = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes",
-  DEFINE_ENV_VARIABLES = "https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow",
-  DELETE_ACTIONS_CACHE_ENTRIES = "https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#deleting-cache-entries",
-  PRIVATE_REGISTRY_LOGS = "https://docs.github.com/en/code-security/reference/code-scanning/code-scanning-logs#diagnostic-information-for-private-package-registries",
-  SCANNING_ON_PUSH = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push",
-  SPECIFY_BUILD_STEPS_MANUALLY = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually",
-  SYSTEM_REQUIREMENTS = "https://codeql.github.com/docs/codeql-overview/system-requirements/",
-  TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS = "https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts",
-}
diff --git a/src/entry-wrapper.js.tpl b/src/entry-wrapper.js.tpl
deleted file mode 100644
index f84e7758ce..0000000000
--- a/src/entry-wrapper.js.tpl
+++ /dev/null
@@ -1,3 +0,0 @@
-export async function run__ACTION__() {
-  return await __ACTION__.runWrapper();
-}
diff --git a/src/environment.ts b/src/environment.ts
deleted file mode 100644
index 29665512c2..0000000000
--- a/src/environment.ts
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * Environment variables used by Default Setup to communicate the private registry proxy configuration.
- */
-export enum RegistryProxyVars {
-  PROXY_HOST = "CODEQL_PROXY_HOST",
-  PROXY_PORT = "CODEQL_PROXY_PORT",
-  PROXY_CA_CERTIFICATE = "CODEQL_PROXY_CA_CERTIFICATE",
-  PROXY_URLS = "CODEQL_PROXY_URLS",
-}
-
-/**
- * Environment variables used by the CodeQL Action.
- *
- * We recommend prefixing environment variables with `CODEQL_ACTION_`
- * to reduce the risk that they are overwritten by other steps.
- */
-export enum EnvVar {
-  /** Whether the `analyze` Action completes successfully. */
-  ANALYZE_DID_COMPLETE_SUCCESSFULLY = "CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY",
-
-  /** Whether the `autobuild` Action completes successfully. */
-  AUTOBUILD_DID_COMPLETE_SUCCESSFULLY = "CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY",
-
-  /**
-   * The verbosity level of the CLI. One of the following: `errors`, `warnings`, `progress`,
-   * `progress+`, `progress++`, `progress+++`.
-   */
-  CLI_VERBOSITY = "CODEQL_VERBOSITY",
-
-  /**
-   * Set by Default Setup to the base branch of the PR being analysed, if analysing a PR.
-   * This is needed because the `pull_request` context is not available for `dynamic` events.
-   */
-  CODE_SCANNING_BASE_BRANCH = "CODE_SCANNING_BASE_BRANCH",
-
-  /**
-   * Set by Default Setup to the full ref being analysed, if analysing a PR.
-   * This is needed because the `pull_request` context is not available for `dynamic` events.
-   */
-  CODE_SCANNING_REF = "CODE_SCANNING_REF",
-
-  /** Whether the CodeQL Action has invoked the Go autobuilder. */
-  DID_AUTOBUILD_GOLANG = "CODEQL_ACTION_DID_AUTOBUILD_GOLANG",
-
-  /**
-   * Whether the CodeQL Action is using its own deprecated and non-standard way of scanning for
-   * multiple languages.
-   */
-  FEATURE_MULTI_LANGUAGE = "CODEQL_ACTION_FEATURE_MULTI_LANGUAGE",
-
-  /** Whether the CodeQL Action is using its own sandwiched workflow mechanism. */
-  FEATURE_SANDWICH = "CODEQL_ACTION_FEATURE_SANDWICH",
-
-  /**
-   * Whether the CodeQL Action might combine SARIF output from several `interpret-results` runs for
-   * the same language.
-   */
-  FEATURE_SARIF_COMBINE = "CODEQL_ACTION_FEATURE_SARIF_COMBINE",
-
-  /** Whether the CodeQL Action will upload SARIF, not the CLI. */
-  FEATURE_WILL_UPLOAD = "CODEQL_ACTION_FEATURE_WILL_UPLOAD",
-
-  /** Whether the CodeQL Action has already warned the user about low disk space. */
-  HAS_WARNED_ABOUT_DISK_SPACE = "CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE",
-
-  /** Whether the `setup-codeql` action has been run. */
-  SETUP_CODEQL_ACTION_HAS_RUN = "CODEQL_ACTION_SETUP_CODEQL_HAS_RUN",
-
-  /** Whether the init action has been run. */
-  INIT_ACTION_HAS_RUN = "CODEQL_ACTION_INIT_HAS_RUN",
-
-  /** Whether the deprecation warning for file coverage on PRs has been logged. */
-  DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION = "CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION",
-
-  /**
-   * Set to `true` to opt out of the upcoming change that skips file coverage
-   * information on pull requests.
-   */
-  FILE_COVERAGE_ON_PRS = "CODEQL_ACTION_FILE_COVERAGE_ON_PRS",
-
-  /** Whether the error for a deprecated version of the CodeQL Action was logged. */
-  LOG_VERSION_DEPRECATION = "CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION",
-
-  /** UUID representing the current job run. */
-  JOB_RUN_UUID = "CODEQL_ACTION_JOB_RUN_UUID",
-
-  /** Status for the entire job, submitted to the status report in `init-post` */
-  JOB_STATUS = "CODEQL_ACTION_JOB_STATUS",
-
-  /** The value of the `output` input for the analyze action. */
-  SARIF_RESULTS_OUTPUT_DIR = "CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR",
-
-  /**
-   * What percentage of the total amount of RAM over 8 GB that the Action should reserve for the
-   * system.
-   */
-  SCALING_RESERVED_RAM_PERCENTAGE = "CODEQL_ACTION_SCALING_RESERVED_RAM_PERCENTAGE",
-
-  /** Whether to suppress the warning if the current CLI will soon be unsupported. */
-  SUPPRESS_DEPRECATED_SOON_WARNING = "CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING",
-
-  /** Used to dictate or persist the temporary directory used by the CodeQL Action. */
-  TEMP = "CODEQL_ACTION_TEMP",
-
-  /** Whether to disable uploading SARIF results or status reports to the GitHub API */
-  TEST_MODE = "CODEQL_ACTION_TEST_MODE",
-
-  TESTING_ENVIRONMENT = "CODEQL_ACTION_TESTING_ENVIRONMENT",
-
-  /** Semver of the CodeQL Action as specified in `package.json`. */
-  VERSION = "CODEQL_ACTION_VERSION",
-
-  /**
-   * The time at which the first action (normally init) started executing.
-   * If a workflow invokes a different action without first invoking the init
-   * action (i.e. the upload action is being used by a third-party integrator)
-   * then this variable will be assigned the start time of the action invoked
-   * rather that the init action.
-   */
-  WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT",
-
-  /**
-   * The path where we initially discovered the Go binary in the system path.
-   * We check this later to ensure that it hasn't been tampered with by a late e.g. `setup-go` step.
-   */
-  GO_BINARY_LOCATION = "CODEQL_ACTION_GO_BINARY",
-
-  /**
-   * Used as an alternative to the `dependency-caching` input for the `init` Action.
-   * Useful for experiments where it is easier to set an environment variable than
-   * change the inputs to the Action.
-   */
-  DEPENDENCY_CACHING = "CODEQL_ACTION_DEPENDENCY_CACHING",
-
-  /**
-   * An optional string to add into the cache key used by dependency caching.
-   * Useful for testing purposes where multiple caches may be stored in the same repository.
-   */
-  DEPENDENCY_CACHING_PREFIX = "CODEQL_ACTION_DEPENDENCY_CACHE_PREFIX",
-
-  /** Used by the Java extractor option to enable minimizing dependency JARs. */
-  JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS = "CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS",
-
-  /**
-   * Whether to enable experimental extractors for CodeQL.
-   */
-  EXPERIMENTAL_FEATURES = "CODEQL_ENABLE_EXPERIMENTAL_FEATURES",
-
-  /**
-   * Whether and where to dump the processed SARIF file that would be uploaded, regardless of
-   * whether the upload is disabled. This is intended for testing and debugging purposes.
-   */
-  SARIF_DUMP_DIR = "CODEQL_ACTION_SARIF_DUMP_DIR",
-
-  /**
-   * Whether to skip uploading SARIF results to GitHub. Intended for testing purposes.
-   * This setting is more specific than `CODEQL_ACTION_TEST_MODE`, which implies this option.
-   */
-  SKIP_SARIF_UPLOAD = "CODEQL_ACTION_SKIP_SARIF_UPLOAD",
-
-  /**
-   * Whether to skip workflow validation. Intended for internal use, where we know that
-   * the workflow is valid and validation is not necessary.
-   */
-  SKIP_WORKFLOW_VALIDATION = "CODEQL_ACTION_SKIP_WORKFLOW_VALIDATION",
-
-  /**
-   * Whether to tolerate failure to determine the git version (only applicable in test mode).
-   * Intended for use in environments where git may not be installed, such as Docker containers.
-   */
-  TOLERATE_MISSING_GIT_VERSION = "CODEQL_ACTION_TOLERATE_MISSING_GIT_VERSION",
-
-  /**
-   * Used to store the analysis key used by the CodeQL Action. This is normally populated by
-   * `getAnalysisKey`, but can also be set manually for testing and non-standard applications.
-   */
-  ANALYSIS_KEY = "CODEQL_ACTION_ANALYSIS_KEY",
-
-  /** Used by Code Scanning Risk Assessment to communicate the assessment ID to the CodeQL Action. */
-  RISK_ASSESSMENT_ID = "CODEQL_ACTION_RISK_ASSESSMENT_ID",
-}
-
-/**
- * Enumerates known GitHub Actions environment variables that we expect
- * to be set in a GitHub Actions environment.
- */
-export enum ActionsEnvVars {
-  GITHUB_ACTION_REPOSITORY = "GITHUB_ACTION_REPOSITORY",
-  GITHUB_API_URL = "GITHUB_API_URL",
-  GITHUB_EVENT_NAME = "GITHUB_EVENT_NAME",
-  GITHUB_EVENT_PATH = "GITHUB_EVENT_PATH",
-  GITHUB_JOB = "GITHUB_JOB",
-  GITHUB_REF = "GITHUB_REF",
-  GITHUB_REPOSITORY = "GITHUB_REPOSITORY",
-  GITHUB_RUN_ATTEMPT = "GITHUB_RUN_ATTEMPT",
-  GITHUB_RUN_ID = "GITHUB_RUN_ID",
-  GITHUB_SERVER_URL = "GITHUB_SERVER_URL",
-  GITHUB_SHA = "GITHUB_SHA",
-  GITHUB_WORKFLOW = "GITHUB_WORKFLOW",
-  GITHUB_WORKSPACE = "GITHUB_WORKSPACE",
-  RUNNER_ENVIRONMENT = "RUNNER_ENVIRONMENT",
-  RUNNER_NAME = "RUNNER_NAME",
-  RUNNER_OS = "RUNNER_OS",
-  RUNNER_TEMP = "RUNNER_TEMP",
-  RUNNER_TOOL_CACHE = "RUNNER_TOOL_CACHE",
-}
-
-/** A type representing all known environment variables. */
-export type KnownEnvVar = EnvVar | ActionsEnvVars | RegistryProxyVars;
-
-/**
- * Gets an environment variable, but throws an error if it is not set.
- */
-function getRequiredEnvVar(env: NodeJS.ProcessEnv, paramName: string): string {
-  const value = env[paramName];
-  if (value === undefined || value.length === 0) {
-    throw new Error(`${paramName} environment variable must be set`);
-  }
-  return value;
-}
-
-/**
- * Get an environment parameter, but throw an error if it is not set.
- *
- * @deprecated Use `getRequired` of a `ReadOnlyEnv` or `Env` instance instead.
- */
-export function getRequiredEnvParam(paramName: string): string {
-  return getRequiredEnvVar(process.env, paramName);
-}
-
-/**
- * Gets an environment variable, but returns `undefined` if it is not set or empty.
- */
-function getOptionalEnvVarFrom(
-  env: NodeJS.ProcessEnv,
-  paramName: string,
-): string | undefined {
-  const value = env[paramName];
-  if (value?.trim().length === 0) {
-    return undefined;
-  }
-  return value;
-}
-
-/**
- * Get an environment variable, but return `undefined` if it is not set or empty.
- *
- * @deprecated Use `getOptional` of a `ReadOnlyEnv` or `Env` instance instead.
- */
-export function getOptionalEnvVar(paramName: string): string | undefined {
-  return getOptionalEnvVarFrom(process.env, paramName);
-}
-
-/**
- * An abstraction around read-only environment variables, to allow abstracting away from `process.env`
- * in tests, while clearly signalling in regular code that the consumer of the `ReadOnlyEnv` instance
- * will only read from it.
- */
-export class ReadOnlyEnv {
-  constructor(protected readonly vars: Record) {}
-
-  /** Clones the object while detaching the underlying environment from the original. */
-  public clone(): this {
-    return Object.create(this, { vars: { value: { ...this.vars } } }) as this;
-  }
-
-  /** Gets a copy of the underlying environment. */
-  public get(): Record {
-    return { ...this.vars };
-  }
-
-  /** Tries to get the value for `name` and throws if there isn't one. */
-  public getRequired(name: string): string {
-    return getRequiredEnvVar(this.vars, name);
-  }
-
-  /** Gets the value for `name`, or `undefined` if it isn't set or empty. */
-  public getOptional(name: string): string | undefined {
-    return getOptionalEnvVarFrom(this.vars, name);
-  }
-
-  /** Gets the entries of the underlying `ProcessEnv`. */
-  public entries(): Array<[string, T]> {
-    return Object.entries(this.vars);
-  }
-}
-
-/**
- * A wrapper around an environment, to allow abstracting away from `process.env` in tests.
- * Use `ReadOnlyEnv` instead if you only plan to read from the environment.
- * This type allows writing to the environment.
- */
-export class Env<
-  T extends string | undefined = string | undefined,
-> extends ReadOnlyEnv {
-  private changed: boolean = false;
-
-  /** Sets an environment variable. */
-  public set(name: string, value: T): void {
-    this.vars[name] = value;
-    this.changed = true;
-  }
-
-  /** Gets a value indicating whether `set` was called at least once. */
-  public hasChanged(): boolean {
-    return this.changed;
-  }
-}
-
-/** Gets an `Env` instance for `env`, which is `process.env` by default. */
-export function getEnv(env: NodeJS.ProcessEnv = process.env): Env {
-  return new Env(env);
-}
diff --git a/src/error-messages.ts b/src/error-messages.ts
deleted file mode 100644
index bd32a6a04a..0000000000
--- a/src/error-messages.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-import { RepositoryPropertyName } from "./feature-flags/properties";
-
-const PACKS_PROPERTY = "packs";
-
-export function getConfigFileOutsideWorkspaceErrorMessage(
-  configFile: string,
-): string {
-  return `The configuration file "${configFile}" is outside of the workspace`;
-}
-
-export function getConfigFileDoesNotExistErrorMessage(
-  configFile: string,
-): string {
-  return `The configuration file "${configFile}" does not exist`;
-}
-
-export function getConfigFileParseErrorMessage(
-  configFile: string,
-  message: string,
-): string {
-  return `Cannot parse "${configFile}": ${message}`;
-}
-
-export function getInvalidConfigFileMessage(
-  configFile: string,
-  messages: string[],
-): string {
-  const andMore =
-    messages.length > 10 ? `, and ${messages.length - 10} more.` : ".";
-  return `The configuration file "${configFile}" is invalid: ${messages.slice(0, 10).join(", ")}${andMore}`;
-}
-
-export function getConfigFileRepoOldFormatInvalidMessage(
-  configFile: string,
-): string {
-  let error = `The configuration file "${configFile}" is not a supported remote file reference.`;
-  error += " Expected format //@";
-
-  return error;
-}
-
-export function getConfigFileRepoFormatInvalidMessage(
-  configFile: string,
-): string {
-  let error = `The configuration file "${configFile}" is not a supported remote file reference.`;
-  error += " Expected format [/][@][:]";
-
-  return error;
-}
-
-export function getConfigFileFormatInvalidMessage(configFile: string): string {
-  return `The configuration file "${configFile}" could not be read`;
-}
-
-export function getConfigFileDirectoryGivenMessage(configFile: string): string {
-  return `The configuration file "${configFile}" looks like a directory, not a file`;
-}
-
-export function getEmptyCombinesError(): string {
-  return `A '+' was used to specify that you want to add extra arguments to the configuration, but no extra arguments were specified. Please either remove the '+' or specify some extra arguments.`;
-}
-
-export function getConfigFilePropertyError(
-  configFile: string | undefined,
-  property: string,
-  error: string,
-): string {
-  if (configFile === undefined) {
-    return `The workflow property "${property}" is invalid: ${error}`;
-  } else {
-    return `The configuration file "${configFile}" is invalid: property "${property}" ${error}`;
-  }
-}
-
-export function getRepoPropertyError(
-  propertyName: RepositoryPropertyName,
-  error: string,
-): string {
-  return `The repository property "${propertyName}" is invalid: ${error}`;
-}
-
-export function getPacksStrInvalid(
-  packStr: string,
-  configFile?: string,
-): string {
-  return configFile
-    ? getConfigFilePropertyError(
-        configFile,
-        PACKS_PROPERTY,
-        `"${packStr}" is not a valid pack`,
-      )
-    : `"${packStr}" is not a valid pack`;
-}
-
-export function getNoLanguagesError(): string {
-  return (
-    "Did not detect any languages to analyze. " +
-    "Please update input in workflow or check that GitHub detects the correct languages in your repository."
-  );
-}
-
-export function getUnknownLanguagesError(languages: string[]): string {
-  return `Did not recognize the following languages: ${languages.join(", ")}`;
-}
diff --git a/src/feature-flags.test.ts b/src/feature-flags.test.ts
deleted file mode 100644
index d8b5eea04d..0000000000
--- a/src/feature-flags.test.ts
+++ /dev/null
@@ -1,614 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import test from "ava";
-
-import * as defaults from "./defaults.json";
-import {
-  Feature,
-  featureConfig,
-  FEATURE_FLAGS_FILE_NAME,
-  FeatureConfig,
-} from "./feature-flags";
-import {
-  setUpFeatureFlagTests,
-  getFeatureIncludingCodeQlIfRequired,
-  assertAllFeaturesUndefinedInApi,
-  assertAllFeaturesHaveDefaultValues,
-} from "./feature-flags/testing-util";
-import {
-  checkExpectedLogMessages,
-  getRecordingLogger,
-  initializeFeatures,
-  LoggedMessage,
-  mockCodeQLVersion,
-  mockFeatureFlagApiEndpoint,
-  setupTests,
-  stubFeatureFlagApiEndpoint,
-} from "./testing-utils";
-import { GitHubVariant, initializeEnvironment, withTmpDir } from "./util";
-
-setupTests(test);
-
-test.beforeEach(() => {
-  initializeEnvironment("1.2.3");
-});
-
-test.serial(
-  `All features use default values if running against GHES`,
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const loggedMessages = [];
-      const features = setUpFeatureFlagTests(
-        tmpDir,
-        getRecordingLogger(loggedMessages),
-        { type: GitHubVariant.GHES, version: "3.0.0" },
-      );
-
-      await assertAllFeaturesHaveDefaultValues(t, features);
-      checkExpectedLogMessages(t, loggedMessages, [
-        "Not running against github.com. Using default values for all features.",
-      ]);
-    });
-  },
-);
-
-test.serial(`Feature flags are requested in GHEC-DR`, async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const loggedMessages = [];
-    const features = setUpFeatureFlagTests(
-      tmpDir,
-      getRecordingLogger(loggedMessages),
-      { type: GitHubVariant.GHEC_DR },
-    );
-
-    mockFeatureFlagApiEndpoint(200, initializeFeatures(true));
-
-    for (const feature of Object.values(Feature)) {
-      // Ensure we have gotten a response value back from the Mock API
-      t.assert(await getFeatureIncludingCodeQlIfRequired(features, feature));
-    }
-
-    // And that we haven't bailed preemptively.
-    t.assert(
-      loggedMessages.find(
-        (v: LoggedMessage) =>
-          v.type === "debug" &&
-          v.message ===
-            "Not running against github.com. Disabling all toggleable features.",
-      ) === undefined,
-    );
-  });
-});
-
-test.serial(
-  "API response missing and features use default value",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const loggedMessages: LoggedMessage[] = [];
-      const features = setUpFeatureFlagTests(
-        tmpDir,
-        getRecordingLogger(loggedMessages),
-      );
-
-      mockFeatureFlagApiEndpoint(403, {});
-
-      for (const feature of Object.values(Feature)) {
-        t.assert(
-          (await getFeatureIncludingCodeQlIfRequired(features, feature)) ===
-            featureConfig[feature].defaultValue,
-        );
-      }
-      assertAllFeaturesUndefinedInApi(t, loggedMessages);
-    });
-  },
-);
-
-test.serial(
-  "Features use default value if they're not returned in API response",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const loggedMessages: LoggedMessage[] = [];
-      const features = setUpFeatureFlagTests(
-        tmpDir,
-        getRecordingLogger(loggedMessages),
-      );
-
-      mockFeatureFlagApiEndpoint(200, {});
-
-      for (const feature of Object.values(Feature)) {
-        t.assert(
-          (await getFeatureIncludingCodeQlIfRequired(features, feature)) ===
-            featureConfig[feature].defaultValue,
-        );
-      }
-
-      assertAllFeaturesUndefinedInApi(t, loggedMessages);
-    });
-  },
-);
-
-test.serial(
-  "Include no more than 25 features in each API request",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const features = setUpFeatureFlagTests(tmpDir);
-
-      stubFeatureFlagApiEndpoint((request) => {
-        const requestedFeatures = (request.features as string).split(",");
-        return {
-          status: requestedFeatures.length <= 25 ? 200 : 400,
-          messageIfError: "Can request a maximum of 25 features.",
-          data: {},
-        };
-      });
-
-      // We only need to call getValue once, and it does not matter which feature
-      // we ask for. Under the hood, the features library will request all features
-      // from the API.
-      const feature = Object.values(Feature)[0];
-      await t.notThrowsAsync(async () =>
-        getFeatureIncludingCodeQlIfRequired(features, feature),
-      );
-    });
-  },
-);
-
-test.serial(
-  "Feature flags exception is propagated if the API request errors",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const features = setUpFeatureFlagTests(tmpDir);
-
-      mockFeatureFlagApiEndpoint(500, {});
-
-      const someFeature = Object.values(Feature)[0];
-
-      await t.throwsAsync(
-        async () => getFeatureIncludingCodeQlIfRequired(features, someFeature),
-        {
-          message:
-            "Encountered an error while trying to determine feature enablement: Error: some error message",
-        },
-      );
-    });
-  },
-);
-
-for (const feature of Object.keys(featureConfig)) {
-  test.serial(
-    `Only feature '${feature}' is enabled if enabled in the API response. Other features disabled`,
-    async (t) => {
-      await withTmpDir(async (tmpDir) => {
-        const features = setUpFeatureFlagTests(tmpDir);
-
-        // set all features to false except the one we're testing
-        const expectedFeatureEnablement: { [feature: string]: boolean } = {};
-        for (const f of Object.keys(featureConfig)) {
-          expectedFeatureEnablement[f] = f === feature;
-        }
-        mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-        // retrieve the values of the actual features
-        const actualFeatureEnablement: { [feature: string]: boolean } = {};
-        for (const f of Object.keys(featureConfig)) {
-          actualFeatureEnablement[f] =
-            await getFeatureIncludingCodeQlIfRequired(features, f as Feature);
-        }
-
-        // All features should be false except the one we're testing
-        t.deepEqual(actualFeatureEnablement, expectedFeatureEnablement);
-      });
-    },
-  );
-
-  test.serial(
-    `Only feature '${feature}' is enabled if the associated environment variable is true. Others disabled.`,
-    async (t) => {
-      await withTmpDir(async (tmpDir) => {
-        const features = setUpFeatureFlagTests(tmpDir);
-
-        const expectedFeatureEnablement = initializeFeatures(false);
-        mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-        // feature should be disabled initially
-        t.assert(
-          !(await getFeatureIncludingCodeQlIfRequired(
-            features,
-            feature as Feature,
-          )),
-        );
-
-        // set env var to true and check that the feature is now enabled
-        process.env[featureConfig[feature].envVar] = "true";
-        t.assert(
-          await getFeatureIncludingCodeQlIfRequired(
-            features,
-            feature as Feature,
-          ),
-        );
-      });
-    },
-  );
-
-  test.serial(
-    `Feature '${feature}' is disabled if the associated environment variable is false, even if enabled in API`,
-    async (t) => {
-      await withTmpDir(async (tmpDir) => {
-        const features = setUpFeatureFlagTests(tmpDir);
-
-        const expectedFeatureEnablement = initializeFeatures(true);
-        mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-        // feature should be enabled initially
-        t.assert(
-          await getFeatureIncludingCodeQlIfRequired(
-            features,
-            feature as Feature,
-          ),
-        );
-
-        // set env var to false and check that the feature is now disabled
-        process.env[featureConfig[feature].envVar] = "false";
-        t.assert(
-          !(await getFeatureIncludingCodeQlIfRequired(
-            features,
-            feature as Feature,
-          )),
-        );
-      });
-    },
-  );
-
-  if (
-    featureConfig[feature].minimumVersion !== undefined ||
-    featureConfig[feature].toolsFeature !== undefined
-  ) {
-    test.serial(
-      `Getting feature '${feature} should throw if no codeql is provided`,
-      async (t) => {
-        await withTmpDir(async (tmpDir) => {
-          const features = setUpFeatureFlagTests(tmpDir);
-
-          const expectedFeatureEnablement = initializeFeatures(true);
-          mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-          // The type system should prevent this happening, but test that if we
-          // bypass it we get the expected error.
-          await t.throwsAsync(
-            // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-            async () => features.getValue(feature as any),
-            {
-              message: `Internal error: A ${
-                featureConfig[feature].minimumVersion !== undefined
-                  ? "minimum version"
-                  : "required tools feature"
-              } is specified for feature ${feature}, but no instance of CodeQL was provided.`,
-            },
-          );
-        });
-      },
-    );
-  }
-
-  if (featureConfig[feature].minimumVersion !== undefined) {
-    test.serial(
-      `Feature '${feature}' is disabled if the minimum CLI version is below ${featureConfig[feature].minimumVersion}`,
-      async (t) => {
-        await withTmpDir(async (tmpDir) => {
-          const features = setUpFeatureFlagTests(tmpDir);
-
-          const expectedFeatureEnablement = initializeFeatures(true);
-          mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-          // feature should be disabled when an old CLI version is set
-          let codeql = mockCodeQLVersion("2.0.0");
-          t.assert(!(await features.getValue(feature as Feature, codeql)));
-
-          // even setting the env var to true should not enable the feature if
-          // the minimum CLI version is not met
-          process.env[featureConfig[feature].envVar] = "true";
-          t.assert(!(await features.getValue(feature as Feature, codeql)));
-
-          // feature should be enabled when a new CLI version is set
-          // and env var is not set
-          process.env[featureConfig[feature].envVar] = "";
-          codeql = mockCodeQLVersion(
-            featureConfig[feature].minimumVersion as string,
-          );
-          t.assert(await features.getValue(feature as Feature, codeql));
-
-          // set env var to false and check that the feature is now disabled
-          process.env[featureConfig[feature].envVar] = "false";
-          t.assert(!(await features.getValue(feature as Feature, codeql)));
-        });
-      },
-    );
-  }
-
-  if (featureConfig[feature].toolsFeature !== undefined) {
-    test.serial(
-      `Feature '${feature}' is disabled if the required tools feature is not enabled`,
-      async (t) => {
-        await withTmpDir(async (tmpDir) => {
-          const features = setUpFeatureFlagTests(tmpDir);
-
-          const expectedFeatureEnablement = initializeFeatures(true);
-          mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-          // feature should be disabled when the required tools feature is not enabled
-          let codeql = mockCodeQLVersion("2.0.0");
-          t.assert(!(await features.getValue(feature as Feature, codeql)));
-
-          // even setting the env var to true should not enable the feature if
-          // the required tools feature is not enabled
-          process.env[featureConfig[feature].envVar] = "true";
-          t.assert(!(await features.getValue(feature as Feature, codeql)));
-
-          // feature should be enabled when the required tools feature is enabled
-          // and env var is not set
-          process.env[featureConfig[feature].envVar] = "";
-          codeql = mockCodeQLVersion("2.0.0", {
-            [featureConfig[feature].toolsFeature]: true,
-          });
-          t.assert(await features.getValue(feature as Feature, codeql));
-
-          // set env var to false and check that the feature is now disabled
-          process.env[featureConfig[feature].envVar] = "false";
-          t.assert(!(await features.getValue(feature as Feature, codeql)));
-        });
-      },
-    );
-  }
-}
-
-test.serial("Feature flags are saved to disk", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const features = setUpFeatureFlagTests(tmpDir);
-    const expectedFeatureEnablement = initializeFeatures(true);
-    mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-    const cachedFeatureFlags = path.join(tmpDir, FEATURE_FLAGS_FILE_NAME);
-
-    t.false(
-      fs.existsSync(cachedFeatureFlags),
-      "Feature flag cached file should not exist before getting feature flags",
-    );
-
-    t.true(
-      await getFeatureIncludingCodeQlIfRequired(
-        features,
-        Feature.QaTelemetryEnabled,
-      ),
-      "Feature flag should be enabled initially",
-    );
-
-    t.true(
-      fs.existsSync(cachedFeatureFlags),
-      "Feature flag cached file should exist after getting feature flags",
-    );
-
-    const actualFeatureEnablement = JSON.parse(
-      fs.readFileSync(cachedFeatureFlags, "utf8"),
-    );
-    t.deepEqual(actualFeatureEnablement, expectedFeatureEnablement);
-
-    // now test that we actually use the feature flag cache instead of the server
-    actualFeatureEnablement[Feature.QaTelemetryEnabled] = false;
-    fs.writeFileSync(
-      cachedFeatureFlags,
-      JSON.stringify(actualFeatureEnablement),
-    );
-
-    // delete the in memory cache so that we are forced to use the cached file
-    (features as any).gitHubFeatureFlags.cachedApiResponse = undefined;
-
-    t.false(
-      await getFeatureIncludingCodeQlIfRequired(
-        features,
-        Feature.QaTelemetryEnabled,
-      ),
-      "Feature flag should be enabled after reading from cached file",
-    );
-  });
-});
-
-test.serial(
-  "Environment variable can override feature flag cache",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const features = setUpFeatureFlagTests(tmpDir);
-      const expectedFeatureEnablement = initializeFeatures(true);
-      mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-      const cachedFeatureFlags = path.join(tmpDir, FEATURE_FLAGS_FILE_NAME);
-      t.true(
-        await getFeatureIncludingCodeQlIfRequired(
-          features,
-          Feature.QaTelemetryEnabled,
-        ),
-        "Feature flag should be enabled initially",
-      );
-
-      t.true(
-        fs.existsSync(cachedFeatureFlags),
-        "Feature flag cached file should exist after getting feature flags",
-      );
-      process.env.CODEQL_ACTION_QA_TELEMETRY = "false";
-
-      t.false(
-        await getFeatureIncludingCodeQlIfRequired(
-          features,
-          Feature.QaTelemetryEnabled,
-        ),
-        "Feature flag should be disabled after setting env var",
-      );
-    });
-  },
-);
-
-test.serial(`selects CLI from defaults.json on GHES`, async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const features = setUpFeatureFlagTests(tmpDir);
-
-    const defaultCliVersion = await features.getEnabledDefaultCliVersions(
-      GitHubVariant.GHES,
-    );
-    t.deepEqual(defaultCliVersion, {
-      enabledVersions: [
-        {
-          cliVersion: defaults.cliVersion,
-          tagName: defaults.bundleVersion,
-        },
-      ],
-    });
-  });
-});
-
-for (const variant of [GitHubVariant.DOTCOM, GitHubVariant.GHEC_DR]) {
-  test.serial(
-    `selects CLI v2.20.1 on ${variant} when feature flags enable v2.20.0 and v2.20.1`,
-    async (t) => {
-      await withTmpDir(async (tmpDir) => {
-        const features = setUpFeatureFlagTests(tmpDir);
-        const expectedFeatureEnablement = initializeFeatures(true);
-        expectedFeatureEnablement["default_codeql_version_2_20_0_enabled"] =
-          true;
-        expectedFeatureEnablement["default_codeql_version_2_20_1_enabled"] =
-          true;
-        expectedFeatureEnablement["default_codeql_version_2_20_2_enabled"] =
-          false;
-        expectedFeatureEnablement["default_codeql_version_2_20_3_enabled"] =
-          false;
-        expectedFeatureEnablement["default_codeql_version_2_20_4_enabled"] =
-          false;
-        expectedFeatureEnablement["default_codeql_version_2_20_5_enabled"] =
-          false;
-        mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-        const defaultCliVersion =
-          await features.getEnabledDefaultCliVersions(variant);
-        t.deepEqual(defaultCliVersion, {
-          enabledVersions: [
-            { cliVersion: "2.20.1", tagName: "codeql-bundle-v2.20.1" },
-            { cliVersion: "2.20.0", tagName: "codeql-bundle-v2.20.0" },
-          ],
-          toolsFeatureFlagsValid: true,
-        });
-      });
-    },
-  );
-
-  test.serial(
-    `selects CLI from defaults.json on ${variant} when no default version feature flags are enabled`,
-    async (t) => {
-      await withTmpDir(async (tmpDir) => {
-        const features = setUpFeatureFlagTests(tmpDir);
-        const expectedFeatureEnablement = initializeFeatures(true);
-        mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-        const defaultCliVersion =
-          await features.getEnabledDefaultCliVersions(variant);
-        t.deepEqual(defaultCliVersion, {
-          enabledVersions: [
-            {
-              cliVersion: defaults.cliVersion,
-              tagName: defaults.bundleVersion,
-            },
-          ],
-          toolsFeatureFlagsValid: false,
-        });
-      });
-    },
-  );
-
-  test.serial(
-    `ignores invalid version numbers in default version feature flags on ${variant}`,
-    async (t) => {
-      await withTmpDir(async (tmpDir) => {
-        const loggedMessages = [];
-        const features = setUpFeatureFlagTests(
-          tmpDir,
-          getRecordingLogger(loggedMessages),
-        );
-        const expectedFeatureEnablement = initializeFeatures(true);
-        expectedFeatureEnablement["default_codeql_version_2_20_0_enabled"] =
-          true;
-        expectedFeatureEnablement["default_codeql_version_2_20_1_enabled"] =
-          true;
-        expectedFeatureEnablement[
-          "default_codeql_version_2_20_invalid_enabled"
-        ] = true;
-        mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement);
-
-        const defaultCliVersion =
-          await features.getEnabledDefaultCliVersions(variant);
-        t.deepEqual(defaultCliVersion, {
-          enabledVersions: [
-            { cliVersion: "2.20.1", tagName: "codeql-bundle-v2.20.1" },
-            { cliVersion: "2.20.0", tagName: "codeql-bundle-v2.20.0" },
-          ],
-          toolsFeatureFlagsValid: true,
-        });
-
-        t.assert(
-          loggedMessages.find(
-            (v: LoggedMessage) =>
-              v.type === "warning" &&
-              v.message ===
-                "Ignoring feature flag default_codeql_version_2_20_invalid_enabled as it does not specify a valid CodeQL version.",
-          ) !== undefined,
-        );
-      });
-    },
-  );
-}
-
-test.serial("legacy feature flags should end with _enabled", async (t) => {
-  for (const [feature, config] of Object.entries(featureConfig)) {
-    if ((config satisfies FeatureConfig as FeatureConfig).legacyApi) {
-      t.assert(
-        feature.endsWith("_enabled"),
-        `legacy feature ${feature} should end with '_enabled'`,
-      );
-    }
-  }
-});
-
-test.serial(
-  "non-legacy feature flags should not end with _enabled",
-  async (t) => {
-    for (const [feature, config] of Object.entries(featureConfig)) {
-      if (!(config satisfies FeatureConfig as FeatureConfig).legacyApi) {
-        t.false(
-          feature.endsWith("_enabled"),
-          `non-legacy feature ${feature} should not end with '_enabled'`,
-        );
-      }
-    }
-  },
-);
-
-test.serial(
-  "non-legacy feature flags should not start with codeql_action_",
-  async (t) => {
-    for (const [feature, config] of Object.entries(featureConfig)) {
-      if (!(config satisfies FeatureConfig as FeatureConfig).legacyApi) {
-        t.false(
-          feature.startsWith("codeql_action_"),
-          `non-legacy feature ${feature} should not start with 'codeql_action_'`,
-        );
-      }
-    }
-  },
-);
-
-test.serial(
-  "initFeatures returns a `Features` instance by default",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const features = setUpFeatureFlagTests(tmpDir);
-      t.is("Features", features.constructor.name);
-    });
-  },
-);
diff --git a/src/feature-flags.ts b/src/feature-flags.ts
deleted file mode 100644
index fff7ef0440..0000000000
--- a/src/feature-flags.ts
+++ /dev/null
@@ -1,893 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as semver from "semver";
-
-import { getApiClient } from "./api-client";
-import type { CodeQL } from "./codeql";
-import * as defaults from "./defaults.json";
-import { Logger } from "./logging";
-import {
-  CODEQL_OVERLAY_MINIMUM_VERSION,
-  CODEQL_OVERLAY_MINIMUM_VERSION_CPP,
-  CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP,
-  CODEQL_OVERLAY_MINIMUM_VERSION_GO,
-  CODEQL_OVERLAY_MINIMUM_VERSION_JAVA,
-  CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT,
-  CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON,
-  CODEQL_OVERLAY_MINIMUM_VERSION_RUBY,
-} from "./overlay";
-import { RepositoryNwo } from "./repository";
-import { ToolsFeature } from "./tools-features";
-import * as util from "./util";
-
-const DEFAULT_VERSION_FEATURE_FLAG_PREFIX = "default_codeql_version_";
-const DEFAULT_VERSION_FEATURE_FLAG_SUFFIX = "_enabled";
-
-/**
- * The first version of the CodeQL Bundle that shipped with zstd-compressed bundles.
- *
- * This is now below the minimum version of CodeQL, but we keep this around because we currently set
- * up CodeQL before checking that the version is new enough.
- */
-export const CODEQL_VERSION_ZSTD_BUNDLE = "2.19.0";
-
-const LINKED_CODEQL_VERSION: CodeQLVersionInfo = {
-  cliVersion: defaults.cliVersion,
-  tagName: defaults.bundleVersion,
-};
-
-export interface CodeQLVersionInfo {
-  /** The version number of the CodeQL CLI, e.g. `2.19.0`. */
-  cliVersion: string;
-  /**
-   * The tag name of the CodeQL Bundle associated with this version, e.g. `codeql-bundle-v2.19.0`.
-   */
-  tagName: string;
-}
-
-export interface CodeQLDefaultVersionInfo {
-  /**
-   * CodeQL CLI versions that are enabled as defaults, sorted from highest to lowest.
-   *
-   * Guaranteed to be non-empty. When feature flags are unavailable, this falls back to a single
-   * entry containing the version pinned in `defaults.json`.
-   */
-  enabledVersions: CodeQLVersionInfo[];
-  /**
-   * If accessed, whether the tools feature flags are valid, i.e. contain at least one enabled
-   * version.
-   */
-  toolsFeatureFlagsValid?: boolean;
-}
-
-/**
- * Features as named by the GitHub API endpoint.
- *
- * Do not include the `codeql_action_` prefix as this is stripped by the API
- * endpoint.
- *
- * Legacy features should end with `_enabled`.
- */
-export enum Feature {
-  /** Allows supported properties of configuration files to be merged. */
-  AllowMergeConfigFiles = "allow_merge_config_files",
-  /** Controls whether we allow multiple values for the `analysis-kinds` input. */
-  AllowMultipleAnalysisKinds = "allow_multiple_analysis_kinds",
-  CleanupTrapCaches = "cleanup_trap_caches",
-  /** Whether to allow the `config-file` input to be specified via a repository property. */
-  ConfigFileRepositoryProperty = "config_file_repository_property",
-  CppDependencyInstallation = "cpp_dependency_installation_enabled",
-  CsharpCacheBuildModeNone = "csharp_cache_bmn",
-  CsharpNewCacheKey = "csharp_new_cache_key",
-  DiffInformedQueries = "diff_informed_queries",
-  DisableCsharpBuildless = "disable_csharp_buildless",
-  DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
-  DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
-  ExportDiagnosticsEnabled = "export_diagnostics_enabled",
-  /**
-   * Emergency override that forces the CodeQL CLI to use the JGit-based Git backend instead of its
-   * default backend selection.
-   */
-  ForceJGit = "force_jgit",
-  ForceNightly = "force_nightly",
-  IgnoreGeneratedFiles = "ignore_generated_files",
-  JavaNetworkDebugging = "java_network_debugging",
-  OverlayAnalysis = "overlay_analysis",
-  OverlayAnalysisCodeScanningCpp = "overlay_analysis_code_scanning_cpp",
-  OverlayAnalysisCodeScanningCsharp = "overlay_analysis_code_scanning_csharp",
-  OverlayAnalysisCodeScanningGo = "overlay_analysis_code_scanning_go",
-  OverlayAnalysisCodeScanningJava = "overlay_analysis_code_scanning_java",
-  OverlayAnalysisCodeScanningJavascript = "overlay_analysis_code_scanning_javascript",
-  OverlayAnalysisCodeScanningPython = "overlay_analysis_code_scanning_python",
-  OverlayAnalysisCodeScanningRuby = "overlay_analysis_code_scanning_ruby",
-  OverlayAnalysisCpp = "overlay_analysis_cpp",
-  OverlayAnalysisCsharp = "overlay_analysis_csharp",
-  /** Disable TRAP caching when overlay analysis is enabled. */
-  OverlayAnalysisDisableTrapCaching = "overlay_analysis_disable_trap_caching",
-  OverlayAnalysisGo = "overlay_analysis_go",
-  OverlayAnalysisJava = "overlay_analysis_java",
-  OverlayAnalysisJavascript = "overlay_analysis_javascript",
-  /**
-   * When set, chooses the default CodeQL CLI version as the highest version that is both enabled by
-   * feature flags and present as an overlay-base database in the Actions cache for the configured
-   * languages. Falls back to the highest feature flagged version if no intersecting overlay-base
-   * database exists in the cache.
-   */
-  OverlayAnalysisMatchCodeqlVersion = "overlay_analysis_match_codeql_version",
-  /**
-   * Like `OverlayAnalysisMatchCodeqlVersion`, but only logs a diagnostic with the version that
-   * would have been chosen instead of actually changing the default CodeQL CLI version.
-   * `OverlayAnalysisMatchCodeqlVersion` overrides this flag.
-   */
-  OverlayAnalysisMatchCodeqlVersionDryRun = "overlay_analysis_match_codeql_version_dry_run",
-  OverlayAnalysisPython = "overlay_analysis_python",
-  OverlayAnalysisRuby = "overlay_analysis_ruby",
-  /** Controls whether hardware checks are skipped for overlay analysis. */
-  OverlayAnalysisSkipResourceChecks = "overlay_analysis_skip_resource_checks",
-  /** Controls whether the Actions cache is checked for overlay build outcomes. */
-  OverlayAnalysisStatusCheck = "overlay_analysis_status_check",
-  /** Controls whether overlay build failures on the default branch are stored in the Actions cache. */
-  OverlayAnalysisStatusSave = "overlay_analysis_status_save",
-  QaTelemetryEnabled = "qa_telemetry_enabled",
-  /** Routes (some) API requests through the registry proxy. */
-  ProxyApiRequests = "proxy_api_requests",
-  /** Note that this currently only disables baseline file coverage information. */
-  SkipFileCoverageOnPrs = "skip_file_coverage_on_prs",
-  StartProxyUseFeaturesRelease = "start_proxy_use_features_release",
-  /** Whether to allow the `tools` input to be specified via a repository property. */
-  ToolsRepositoryProperty = "tools_repository_property",
-  UploadOverlayDbToApi = "upload_overlay_db_to_api",
-  ValidateDbConfig = "validate_db_config",
-}
-
-export type FeatureConfig = {
-  /**
-   * Default value in environments where the feature flags API is not available,
-   * such as GitHub Enterprise Server.
-   */
-  defaultValue: boolean;
-  /**
-   * Environment variable for explicitly enabling or disabling the feature.
-   *
-   * This overrides enablement status from the feature flags API.
-   */
-  envVar: string;
-  /**
-   * Whether the feature flag is part of the legacy feature flags API (defaults to false).
-   *
-   * These feature flags are included by default in the API response and do not need to be
-   * explicitly requested.
-   */
-  legacyApi?: boolean;
-  /**
-   * Minimum version of the CLI, if applicable.
-   *
-   * Prefer using `ToolsFeature`s for future flags.
-   */
-  minimumVersion: string | undefined;
-  /** Required tools feature, if applicable. */
-  toolsFeature?: ToolsFeature;
-};
-
-export const featureConfig = {
-  [Feature.AllowMergeConfigFiles]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_ALLOW_MERGE_CONFIG_FILES",
-    minimumVersion: undefined,
-  },
-  [Feature.AllowMultipleAnalysisKinds]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_ALLOW_MULTIPLE_ANALYSIS_KINDS",
-    minimumVersion: undefined,
-  },
-  [Feature.CleanupTrapCaches]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
-    minimumVersion: undefined,
-  },
-  [Feature.ConfigFileRepositoryProperty]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_CONFIG_FILE_REPOSITORY_PROPERTY",
-    minimumVersion: undefined,
-  },
-  [Feature.CppDependencyInstallation]: {
-    defaultValue: false,
-    envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
-    legacyApi: true,
-    minimumVersion: "2.15.0",
-  },
-  [Feature.CsharpCacheBuildModeNone]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_CSHARP_CACHE_BMN",
-    minimumVersion: undefined,
-  },
-  [Feature.CsharpNewCacheKey]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_CSHARP_NEW_CACHE_KEY",
-    minimumVersion: undefined,
-  },
-  [Feature.DiffInformedQueries]: {
-    defaultValue: true,
-    envVar: "CODEQL_ACTION_DIFF_INFORMED_QUERIES",
-    minimumVersion: "2.21.0",
-  },
-  [Feature.DisableCsharpBuildless]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_DISABLE_CSHARP_BUILDLESS",
-    minimumVersion: undefined,
-  },
-  [Feature.DisableJavaBuildlessEnabled]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_DISABLE_JAVA_BUILDLESS",
-    legacyApi: true,
-    minimumVersion: undefined,
-  },
-  [Feature.DisableKotlinAnalysisEnabled]: {
-    defaultValue: false,
-    envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS",
-    legacyApi: true,
-    minimumVersion: undefined,
-  },
-  [Feature.ExportDiagnosticsEnabled]: {
-    defaultValue: true,
-    envVar: "CODEQL_ACTION_EXPORT_DIAGNOSTICS",
-    legacyApi: true,
-    minimumVersion: undefined,
-  },
-  [Feature.ForceJGit]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_FORCE_JGIT",
-    minimumVersion: undefined,
-  },
-  [Feature.ForceNightly]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
-    minimumVersion: undefined,
-  },
-  [Feature.IgnoreGeneratedFiles]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
-    minimumVersion: undefined,
-  },
-  [Feature.JavaNetworkDebugging]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING",
-    minimumVersion: undefined,
-  },
-  [Feature.OverlayAnalysis]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION,
-  },
-  // Per-language overlay feature flags. Each has minimumVersion set to the
-  // minimum CLI version that supports overlay analysis for that language.
-  // Only languages that are GA or in staff-ship should have feature flags here.
-  [Feature.OverlayAnalysisCodeScanningCpp]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CPP,
-  },
-  [Feature.OverlayAnalysisCodeScanningCsharp]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP,
-  },
-  [Feature.OverlayAnalysisCodeScanningGo]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO,
-  },
-  [Feature.OverlayAnalysisCodeScanningJava]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA,
-  },
-  [Feature.OverlayAnalysisCodeScanningJavascript]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT,
-  },
-  [Feature.OverlayAnalysisCodeScanningPython]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON,
-  },
-  [Feature.OverlayAnalysisCodeScanningRuby]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY,
-  },
-  [Feature.OverlayAnalysisCpp]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CPP,
-  },
-  [Feature.OverlayAnalysisCsharp]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP,
-  },
-  [Feature.OverlayAnalysisGo]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO,
-  },
-  [Feature.OverlayAnalysisJava]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA,
-  },
-  [Feature.OverlayAnalysisJavascript]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT,
-  },
-  [Feature.OverlayAnalysisPython]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON,
-  },
-  [Feature.OverlayAnalysisRuby]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY",
-    minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY,
-  },
-  // Other overlay-related feature flags
-  [Feature.OverlayAnalysisDisableTrapCaching]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_DISABLE_TRAP_CACHING",
-    minimumVersion: undefined,
-  },
-  [Feature.OverlayAnalysisMatchCodeqlVersion]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MATCH_CODEQL_VERSION",
-    minimumVersion: undefined,
-  },
-  [Feature.OverlayAnalysisMatchCodeqlVersionDryRun]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MATCH_CODEQL_VERSION_DRY_RUN",
-    minimumVersion: undefined,
-  },
-  [Feature.OverlayAnalysisStatusCheck]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK",
-    minimumVersion: undefined,
-  },
-  [Feature.OverlayAnalysisStatusSave]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE",
-    minimumVersion: undefined,
-  },
-  [Feature.OverlayAnalysisSkipResourceChecks]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS",
-    minimumVersion: undefined,
-  },
-  [Feature.QaTelemetryEnabled]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_QA_TELEMETRY",
-    legacyApi: true,
-    minimumVersion: undefined,
-  },
-  [Feature.ProxyApiRequests]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_PROXY_API_REQUESTS",
-    minimumVersion: undefined,
-  },
-  [Feature.SkipFileCoverageOnPrs]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
-    minimumVersion: undefined,
-    toolsFeature: ToolsFeature.SuppressesMissingFileBaselineWarning,
-  },
-  [Feature.StartProxyUseFeaturesRelease]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE",
-    minimumVersion: undefined,
-  },
-  [Feature.ToolsRepositoryProperty]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_TOOLS_REPOSITORY_PROPERTY",
-    minimumVersion: undefined,
-  },
-  [Feature.UploadOverlayDbToApi]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
-    minimumVersion: undefined,
-    toolsFeature: ToolsFeature.BundleSupportsOverlay,
-  },
-  [Feature.ValidateDbConfig]: {
-    defaultValue: false,
-    envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG",
-    minimumVersion: undefined,
-  },
-} satisfies Record;
-
-/** A feature whose enablement does not depend on the version of the CodeQL CLI. */
-export type FeatureWithoutCLI = {
-  [K in Feature]: (typeof featureConfig)[K] extends
-    | {
-        minimumVersion: string;
-      }
-    | {
-        toolsFeature: ToolsFeature;
-      }
-    ? never
-    : K;
-}[keyof typeof featureConfig];
-
-export interface FeatureEnablement {
-  /**
-   * Returns the set of default CodeQL CLI versions to consider, sorted from
-   * highest to lowest. The first entry is the version that the CodeQL Action
-   * will use by default. The list is always non-empty.
-   */
-  getEnabledDefaultCliVersions(
-    variant: util.GitHubVariant,
-  ): Promise;
-  getValue(feature: FeatureWithoutCLI): Promise;
-  getValue(feature: Feature, codeql: CodeQL): Promise;
-}
-
-/**
- * A response from the GitHub API that contains feature flag enablement information for the CodeQL
- * Action.
- *
- * It maps feature flags to whether they are enabled or not.
- */
-type GitHubFeatureFlagsApiResponse = Partial>;
-
-export const FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json";
-
-/**
- * Determines the enablement status of a number of features locally without
- * consulting the GitHub API.
- */
-class OfflineFeatures implements FeatureEnablement {
-  constructor(protected readonly logger: Logger) {}
-
-  async getEnabledDefaultCliVersions(
-    _variant: util.GitHubVariant,
-  ): Promise {
-    return {
-      enabledVersions: [LINKED_CODEQL_VERSION],
-    };
-  }
-
-  /**
-   * Gets the `FeatureConfig` for `feature`.
-   */
-  getFeatureConfig(feature: Feature): FeatureConfig {
-    // Narrow the type to FeatureConfig to avoid type errors. To avoid unsafe use of `as`, we
-    // check that the required properties exist using `satisfies`.
-    return featureConfig[feature] satisfies FeatureConfig;
-  }
-
-  /**
-   * Determines whether `feature` is enabled without consulting the GitHub API.
-   *
-   * @param feature The feature to check.
-   * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the
-   *        feature, the version of the CodeQL CLI will be checked against the minimum version.
-   *        If the version is less than the minimum version, the feature will be considered
-   *        disabled. If not provided, and a `minimumVersion` is specified for the feature, then
-   *        this function will throw.
-   * @returns true if the feature is enabled, false otherwise.
-   *
-   * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided.
-   */
-  async getValue(feature: Feature, codeql?: CodeQL): Promise {
-    const offlineValue = await this.getOfflineValue(feature, codeql);
-    if (offlineValue !== undefined) {
-      return offlineValue;
-    }
-
-    return this.getDefaultValue(feature);
-  }
-
-  /**
-   * Determines whether `feature` is enabled using the CLI and environment variables.
-   */
-  protected async getOfflineValue(
-    feature: Feature,
-    codeql?: CodeQL,
-  ): Promise {
-    const config = this.getFeatureConfig(feature);
-
-    if (!codeql && config.minimumVersion) {
-      throw new Error(
-        `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.`,
-      );
-    }
-    if (!codeql && config.toolsFeature) {
-      throw new Error(
-        `Internal error: A required tools feature is specified for feature ${feature}, but no instance of CodeQL was provided.`,
-      );
-    }
-
-    const envVar = (process.env[config.envVar] || "").toLocaleLowerCase();
-
-    // Do not use this feature if user explicitly disables it via an environment variable.
-    if (envVar === "false") {
-      this.logger.debug(
-        `Feature ${feature} is disabled via the environment variable ${config.envVar}.`,
-      );
-      return false;
-    }
-
-    // Never use this feature if the CLI version explicitly can't support it.
-    const minimumVersion = config.minimumVersion;
-    if (codeql && minimumVersion) {
-      if (!(await util.codeQlVersionAtLeast(codeql, minimumVersion))) {
-        this.logger.debug(
-          `Feature ${feature} is disabled because the CodeQL CLI version is older than the minimum ` +
-            `version ${minimumVersion}.`,
-        );
-        return false;
-      } else {
-        this.logger.debug(
-          `CodeQL CLI version ${
-            (await codeql.getVersion()).version
-          } is newer than the minimum ` +
-            `version ${minimumVersion} for feature ${feature}.`,
-        );
-      }
-    }
-    const toolsFeature = config.toolsFeature;
-    if (codeql && toolsFeature) {
-      if (!(await codeql.supportsFeature(toolsFeature))) {
-        this.logger.debug(
-          `Feature ${feature} is disabled because the CodeQL CLI version does not support the ` +
-            `required tools feature ${toolsFeature}.`,
-        );
-        return false;
-      } else {
-        this.logger.debug(
-          `CodeQL CLI version ${
-            (await codeql.getVersion()).version
-          } supports the required tools feature ${toolsFeature} for feature ${feature}.`,
-        );
-      }
-    }
-
-    // Use this feature if user explicitly enables it via an environment variable.
-    if (envVar === "true") {
-      this.logger.debug(
-        `Feature ${feature} is enabled via the environment variable ${config.envVar}.`,
-      );
-      return true;
-    }
-
-    return undefined;
-  }
-
-  /** Gets the default value of `feature`. */
-  protected async getDefaultValue(feature: Feature): Promise {
-    const config = this.getFeatureConfig(feature);
-    const defaultValue = config.defaultValue;
-    this.logger.debug(
-      `Feature ${feature} is ${
-        defaultValue ? "enabled" : "disabled"
-      } due to its default value.`,
-    );
-    return defaultValue;
-  }
-}
-
-/**
- * Determines the enablement status of a number of features.
- * If feature enablement is not able to be determined locally, a request to the
- * GitHub API is made to determine the enablement status.
- */
-class Features extends OfflineFeatures {
-  private gitHubFeatureFlags: GitHubFeatureFlags;
-
-  constructor(repositoryNwo: RepositoryNwo, tempDir: string, logger: Logger) {
-    super(logger);
-
-    this.gitHubFeatureFlags = new GitHubFeatureFlags(
-      repositoryNwo,
-      path.join(tempDir, FEATURE_FLAGS_FILE_NAME),
-      logger,
-    );
-  }
-
-  async getEnabledDefaultCliVersions(
-    variant: util.GitHubVariant,
-  ): Promise {
-    if (supportsFeatureFlags(variant)) {
-      return await this.gitHubFeatureFlags.getEnabledDefaultCliVersionsFromFlags();
-    }
-    return super.getEnabledDefaultCliVersions(variant);
-  }
-
-  /**
-   *
-   * @param feature The feature to check.
-   * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the
-   *        feature, the version of the CodeQL CLI will be checked against the minimum version.
-   *        If the version is less than the minimum version, the feature will be considered
-   *        disabled. If not provided, and a `minimumVersion` is specified for the feature, then
-   *        this function will throw.
-   * @returns true if the feature is enabled, false otherwise.
-   *
-   * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided.
-   */
-  async getValue(feature: Feature, codeql?: CodeQL): Promise {
-    // Check whether the feature is enabled locally.
-    const offlineValue = await this.getOfflineValue(feature, codeql);
-    if (offlineValue !== undefined) {
-      return offlineValue;
-    }
-
-    // Ask the GitHub API if the feature is enabled.
-    const apiValue = await this.gitHubFeatureFlags.getValue(feature);
-    if (apiValue !== undefined) {
-      this.logger.debug(
-        `Feature ${feature} is ${
-          apiValue ? "enabled" : "disabled"
-        } via the GitHub API.`,
-      );
-      return apiValue;
-    }
-
-    // Return the default value.
-    return this.getDefaultValue(feature);
-  }
-}
-
-class GitHubFeatureFlags {
-  private cachedApiResponse: GitHubFeatureFlagsApiResponse | undefined;
-
-  // We cache whether the feature flags were accessed or not in order to accurately report whether flags were
-  // incorrectly configured vs. inaccessible in our telemetry.
-  private hasAccessedRemoteFeatureFlags: boolean;
-
-  constructor(
-    private readonly repositoryNwo: RepositoryNwo,
-    private readonly featureFlagsFile: string,
-    private readonly logger: Logger,
-  ) {
-    this.hasAccessedRemoteFeatureFlags = false; // Not accessed by default.
-  }
-
-  private getCliVersionFromFeatureFlag(f: string): string | undefined {
-    if (
-      !f.startsWith(DEFAULT_VERSION_FEATURE_FLAG_PREFIX) ||
-      !f.endsWith(DEFAULT_VERSION_FEATURE_FLAG_SUFFIX)
-    ) {
-      return undefined;
-    }
-    const version = f
-      .substring(
-        DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length,
-        f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length,
-      )
-      .replace(/_/g, ".");
-
-    if (!semver.valid(version)) {
-      this.logger.warning(
-        `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.`,
-      );
-      return undefined;
-    }
-    return version;
-  }
-
-  /**
-   * Returns CLI versions enabled by `default_codeql_version_*_enabled` feature
-   * flags, sorted from highest to lowest. Falls back to the version pinned in
-   * `defaults.json` if no such flags are enabled.
-   */
-  async getEnabledDefaultCliVersionsFromFlags(): Promise {
-    const response = await this.getAllFeatures();
-
-    const sortedCliVersions = Object.entries(response)
-      .map(([f, isEnabled]) =>
-        isEnabled ? this.getCliVersionFromFeatureFlag(f) : undefined,
-      )
-      .filter((f): f is string => f !== undefined)
-      .sort(semver.rcompare);
-
-    if (sortedCliVersions.length === 0) {
-      // We expect at least one default CLI version to be enabled on Dotcom at any time. However if
-      // the feature flags are misconfigured, rather than crashing, we fall back to the CLI version
-      // shipped with the Action in defaults.json. This has the effect of immediately rolling out
-      // new CLI versions to all users running the latest Action.
-      //
-      // A drawback of this approach relates to the small number of users that run old versions of
-      // the Action on Dotcom. As a result of this approach, if we misconfigure the feature flags
-      // then these users will experience some alert churn. This is because the CLI version in the
-      // defaults.json shipped with an old version of the Action is likely older than the CLI
-      // version that would have been specified by the feature flags before they were misconfigured.
-      this.logger.warning(
-        "Feature flags do not specify a default CLI version. Falling back to the CLI version " +
-          `shipped with the Action. This is ${defaults.cliVersion}.`,
-      );
-      const result: CodeQLDefaultVersionInfo = {
-        enabledVersions: [LINKED_CODEQL_VERSION],
-      };
-      if (this.hasAccessedRemoteFeatureFlags) {
-        result.toolsFeatureFlagsValid = false;
-      }
-      return result;
-    }
-
-    this.logger.debug(
-      `Derived default CLI version of ${sortedCliVersions[0]} from feature flags.`,
-    );
-    return {
-      enabledVersions: sortedCliVersions.map((cliVersion) => ({
-        cliVersion,
-        tagName: `codeql-bundle-v${cliVersion}`,
-      })),
-      toolsFeatureFlagsValid: true,
-    };
-  }
-
-  async getValue(feature: Feature): Promise {
-    const response = await this.getAllFeatures();
-    if (response === undefined) {
-      this.logger.debug(`No feature flags API response for ${feature}.`);
-      return undefined;
-    }
-    const features = response[feature];
-    if (features === undefined) {
-      this.logger.debug(`Feature '${feature}' undefined in API response.`);
-      return undefined;
-    }
-    return !!features;
-  }
-
-  private async getAllFeatures(): Promise {
-    // if we have an in memory cache, use that
-    if (this.cachedApiResponse !== undefined) {
-      return this.cachedApiResponse;
-    }
-
-    // if a previous step has written a feature flags file to disk, use that
-    const fileFlags = await this.readLocalFlags();
-    if (fileFlags !== undefined) {
-      this.cachedApiResponse = fileFlags;
-      return fileFlags;
-    }
-
-    // if not, request flags from the server
-    let remoteFlags = await this.loadApiResponse();
-    if (remoteFlags === undefined) {
-      remoteFlags = {};
-    }
-
-    // cache the response in memory
-    this.cachedApiResponse = remoteFlags;
-
-    // and cache them to disk so future workflow steps can use them
-    await this.writeLocalFlags(remoteFlags);
-
-    return remoteFlags;
-  }
-
-  private async readLocalFlags(): Promise<
-    GitHubFeatureFlagsApiResponse | undefined
-  > {
-    try {
-      if (fs.existsSync(this.featureFlagsFile)) {
-        this.logger.debug(
-          `Loading feature flags from ${this.featureFlagsFile}`,
-        );
-        return JSON.parse(
-          fs.readFileSync(this.featureFlagsFile, "utf8"),
-        ) as GitHubFeatureFlagsApiResponse;
-      }
-    } catch (e) {
-      this.logger.warning(
-        `Error reading cached feature flags file ${this.featureFlagsFile}: ${e}. Requesting from GitHub instead.`,
-      );
-    }
-    return undefined;
-  }
-
-  private async writeLocalFlags(
-    flags: GitHubFeatureFlagsApiResponse,
-  ): Promise {
-    try {
-      this.logger.debug(`Writing feature flags to ${this.featureFlagsFile}`);
-      fs.writeFileSync(this.featureFlagsFile, JSON.stringify(flags));
-    } catch (e) {
-      this.logger.warning(
-        `Error writing cached feature flags file ${this.featureFlagsFile}: ${e}.`,
-      );
-    }
-  }
-
-  private async loadApiResponse(): Promise {
-    try {
-      const featuresToRequest = Object.entries(featureConfig)
-        .filter(
-          ([, config]) =>
-            !(config satisfies FeatureConfig as FeatureConfig).legacyApi,
-        )
-        .map(([f]) => f);
-
-      const FEATURES_PER_REQUEST = 25;
-      const featureChunks: string[][] = [];
-      while (featuresToRequest.length > 0) {
-        featureChunks.push(featuresToRequest.splice(0, FEATURES_PER_REQUEST));
-      }
-
-      let remoteFlags: GitHubFeatureFlagsApiResponse = {};
-
-      for (const chunk of featureChunks) {
-        const response = await getApiClient().request(
-          "GET /repos/:owner/:repo/code-scanning/codeql-action/features",
-          {
-            owner: this.repositoryNwo.owner,
-            repo: this.repositoryNwo.repo,
-            features: chunk.join(","),
-          },
-        );
-        const chunkFlags = response.data as GitHubFeatureFlagsApiResponse;
-        remoteFlags = { ...remoteFlags, ...chunkFlags };
-      }
-
-      this.logger.debug(
-        "Loaded the following default values for the feature flags from the CodeQL Action API:",
-      );
-      for (const [feature, value] of Object.entries(remoteFlags).sort(
-        ([nameA], [nameB]) => nameA.localeCompare(nameB),
-      )) {
-        this.logger.debug(`  ${feature}: ${value}`);
-      }
-      this.hasAccessedRemoteFeatureFlags = true;
-      return remoteFlags;
-    } catch (e) {
-      const httpError = util.asHTTPError(e);
-      if (httpError?.status === 403) {
-        this.logger.warning(
-          "This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. " +
-            "As a result, it will not be opted into any experimental features. " +
-            "This could be because the Action is running on a pull request from a fork. If not, " +
-            `please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}`,
-        );
-        this.hasAccessedRemoteFeatureFlags = false;
-        return {};
-      } else {
-        // Some features, such as `ml_powered_queries_enabled` affect the produced alerts.
-        // Considering these features disabled in the event of a transient error could
-        // therefore lead to alert churn. As a result, we crash if we cannot determine the value of
-        // the feature.
-        throw new Error(
-          `Encountered an error while trying to determine feature enablement: ${e}`,
-        );
-      }
-    }
-  }
-}
-
-function supportsFeatureFlags(githubVariant: util.GitHubVariant): boolean {
-  return (
-    githubVariant === util.GitHubVariant.DOTCOM ||
-    githubVariant === util.GitHubVariant.GHEC_DR
-  );
-}
-
-/**
- * Initialises an instance of a `FeatureEnablement` implementation. The implementation used
- * is determined by the environment we are running in.
- */
-export function initFeatures(
-  gitHubVersion: util.GitHubVersion,
-  repositoryNwo: RepositoryNwo,
-  tempDir: string,
-  logger: Logger,
-): FeatureEnablement {
-  if (!supportsFeatureFlags(gitHubVersion.type)) {
-    logger.debug(
-      "Not running against github.com. Using default values for all features.",
-    );
-    return new OfflineFeatures(logger);
-  } else {
-    return new Features(repositoryNwo, tempDir, logger);
-  }
-}
diff --git a/src/feature-flags/offline-features.test.ts b/src/feature-flags/offline-features.test.ts
deleted file mode 100644
index 2870ef3b8a..0000000000
--- a/src/feature-flags/offline-features.test.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as apiClient from "../api-client";
-import {
-  checkExpectedLogMessages,
-  getRecordingLogger,
-  LoggedMessage,
-  setupTests,
-} from "../testing-utils";
-import { GitHubVariant, initializeEnvironment, withTmpDir } from "../util";
-
-import {
-  assertAllFeaturesHaveDefaultValues,
-  setUpFeatureFlagTests,
-} from "./testing-util";
-
-setupTests(test);
-
-test.beforeEach(() => {
-  initializeEnvironment("1.2.3");
-});
-
-test("OfflineFeatures makes no API requests", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const loggedMessages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(loggedMessages);
-    const features = setUpFeatureFlagTests(tmpDir, logger, {
-      type: GitHubVariant.GHES,
-      version: "3.0.0",
-    });
-    t.is("OfflineFeatures", features.constructor.name);
-
-    sinon
-      .stub(apiClient, "getApiClient")
-      .throws(new Error("Should not have called getApiClient"));
-
-    await assertAllFeaturesHaveDefaultValues(t, features);
-    checkExpectedLogMessages(t, loggedMessages, [
-      "Not running against github.com. Using default values for all features.",
-    ]);
-  });
-});
diff --git a/src/feature-flags/properties.test.ts b/src/feature-flags/properties.test.ts
deleted file mode 100644
index d3094a8d1c..0000000000
--- a/src/feature-flags/properties.test.ts
+++ /dev/null
@@ -1,244 +0,0 @@
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as api from "../api-client";
-import { getRunnerLogger } from "../logging";
-import { parseRepositoryNwo } from "../repository";
-import { RecordingLogger, setupTests } from "../testing-utils";
-
-import * as properties from "./properties";
-
-setupTests(test);
-
-test.serial(
-  "loadPropertiesFromApi throws if response data is not an array",
-  async (t) => {
-    sinon.stub(api, "getRepositoryProperties").resolves({
-      headers: {},
-      status: 200,
-      url: "",
-      data: {},
-    });
-    const logger = getRunnerLogger(true);
-    const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-    await t.throwsAsync(
-      properties.loadPropertiesFromApi(logger, mockRepositoryNwo),
-      {
-        message: /Expected repository properties API to return an array/,
-      },
-    );
-  },
-);
-
-test.serial(
-  "loadPropertiesFromApi throws if response data contains objects without `property_name`",
-  async (t) => {
-    sinon.stub(api, "getRepositoryProperties").resolves({
-      headers: {},
-      status: 200,
-      url: "",
-      data: [{}],
-    });
-    const logger = getRunnerLogger(true);
-    const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-    await t.throwsAsync(
-      properties.loadPropertiesFromApi(logger, mockRepositoryNwo),
-      {
-        message:
-          /Expected repository property object to have a 'property_name'/,
-      },
-    );
-  },
-);
-
-test.serial(
-  "loadPropertiesFromApi does not throw for unexpected value types of unknown properties",
-  async (t) => {
-    sinon.stub(api, "getRepositoryProperties").resolves({
-      headers: {},
-      status: 200,
-      url: "",
-      data: [
-        { property_name: "not-used-by-us", value: { foo: "bar" } },
-        { property_name: "also-not-used-by-us", value: ["A", "B", "C"] },
-      ],
-    });
-    const logger = getRunnerLogger(true);
-    const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-    await t.notThrowsAsync(
-      properties.loadPropertiesFromApi(logger, mockRepositoryNwo),
-    );
-  },
-);
-
-test.serial("loadPropertiesFromApi loads known properties", async (t) => {
-  const knownProperties = [
-    { property_name: "github-codeql-config-file", value: "owner/repo" },
-    { property_name: "github-codeql-extra-queries", value: "+queries" },
-    { property_name: "github-codeql-tools", value: "nightly" },
-  ];
-  sinon.stub(api, "getRepositoryProperties").resolves({
-    headers: {},
-    status: 200,
-    url: "",
-    data: [
-      ...knownProperties,
-      { property_name: "unknown-property", value: "something" },
-    ] satisfies properties.GitHubPropertiesResponse,
-  });
-  const logger = getRunnerLogger(true);
-  const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-  const response = await properties.loadPropertiesFromApi(
-    logger,
-    mockRepositoryNwo,
-  );
-  t.deepEqual(
-    response,
-    Object.fromEntries(
-      knownProperties.map((prop) => [prop.property_name, prop.value]),
-    ),
-  );
-});
-
-test.serial("loadPropertiesFromApi parses true boolean property", async (t) => {
-  sinon.stub(api, "getRepositoryProperties").resolves({
-    headers: {},
-    status: 200,
-    url: "",
-    data: [
-      {
-        property_name: "github-codeql-disable-overlay",
-        value: "true",
-      },
-      { property_name: "github-codeql-extra-queries", value: "+queries" },
-    ] satisfies properties.GitHubPropertiesResponse,
-  });
-  const logger = getRunnerLogger(true);
-  const warningSpy = sinon.spy(logger, "warning");
-  const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-  const response = await properties.loadPropertiesFromApi(
-    logger,
-    mockRepositoryNwo,
-  );
-  t.deepEqual(response, {
-    "github-codeql-disable-overlay": true,
-    "github-codeql-extra-queries": "+queries",
-  });
-  t.true(warningSpy.notCalled);
-});
-
-test.serial(
-  "loadPropertiesFromApi parses false boolean property",
-  async (t) => {
-    sinon.stub(api, "getRepositoryProperties").resolves({
-      headers: {},
-      status: 200,
-      url: "",
-      data: [
-        {
-          property_name: "github-codeql-disable-overlay",
-          value: "false",
-        },
-      ] satisfies properties.GitHubPropertiesResponse,
-    });
-    const logger = getRunnerLogger(true);
-    const warningSpy = sinon.spy(logger, "warning");
-    const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-    const response = await properties.loadPropertiesFromApi(
-      logger,
-      mockRepositoryNwo,
-    );
-    t.deepEqual(response, {
-      "github-codeql-disable-overlay": false,
-    });
-    t.true(warningSpy.notCalled);
-  },
-);
-
-test.serial(
-  "loadPropertiesFromApi throws if known property value is not a string",
-  async (t) => {
-    sinon.stub(api, "getRepositoryProperties").resolves({
-      headers: {},
-      status: 200,
-      url: "",
-      data: [{ property_name: "github-codeql-extra-queries", value: 123 }],
-    });
-    const logger = getRunnerLogger(true);
-    const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-    await t.throwsAsync(
-      properties.loadPropertiesFromApi(logger, mockRepositoryNwo),
-      {
-        message:
-          /Unexpected value for repository property 'github-codeql-extra-queries' \(number\), got: 123/,
-      },
-    );
-  },
-);
-
-test.serial(
-  "loadPropertiesFromApi warns if boolean property has unexpected value",
-  async (t) => {
-    sinon.stub(api, "getRepositoryProperties").resolves({
-      headers: {},
-      status: 200,
-      url: "",
-      data: [
-        {
-          property_name: "github-codeql-disable-overlay",
-          value: "yes",
-        },
-      ] satisfies properties.GitHubPropertiesResponse,
-    });
-    const logger = getRunnerLogger(true);
-    const warningSpy = sinon.spy(logger, "warning");
-    const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-    const response = await properties.loadPropertiesFromApi(
-      logger,
-      mockRepositoryNwo,
-    );
-    t.deepEqual(response, {
-      "github-codeql-disable-overlay": false,
-    });
-    t.true(warningSpy.calledOnce);
-    t.is(
-      warningSpy.firstCall.args[0],
-      "Repository property 'github-codeql-disable-overlay' has unexpected value 'yes'. Expected 'true' or 'false'. Defaulting to false.",
-    );
-  },
-);
-
-test.serial(
-  "loadPropertiesFromApi warns if a repository property name starts with the common prefix, but is not recognised by us",
-  async (t) => {
-    process.env["GITHUB_EVENT_NAME"] = "push";
-    const propertyName: string = `${properties.GITHUB_CODEQL_PROPERTY_PREFIX}unknown`;
-    sinon.stub(api, "getRepositoryProperties").resolves({
-      headers: {},
-      status: 200,
-      url: "",
-      data: [
-        {
-          property_name: propertyName,
-          value: "true",
-        },
-      ] satisfies properties.GitHubPropertiesResponse,
-    });
-    const logger = new RecordingLogger();
-    const warningSpy = sinon.spy(logger, "warning");
-    const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
-    const response = await properties.loadPropertiesFromApi(
-      logger,
-      mockRepositoryNwo,
-    );
-    t.deepEqual(response, {});
-    t.true(warningSpy.calledOnce);
-    t.assert(
-      warningSpy.firstCall.args[0]
-        .toString()
-        .startsWith(
-          `Found repository properties ('${propertyName}'), which look like CodeQL Action repository properties`,
-        ),
-    );
-  },
-);
diff --git a/src/feature-flags/properties.ts b/src/feature-flags/properties.ts
deleted file mode 100644
index 4c888bd5ec..0000000000
--- a/src/feature-flags/properties.ts
+++ /dev/null
@@ -1,271 +0,0 @@
-import * as github from "@actions/github";
-
-import { isDynamicWorkflow } from "../actions-util";
-import { getRepositoryProperties } from "../api-client";
-import { Logger } from "../logging";
-import { RepositoryNwo } from "../repository";
-import { Failure, getErrorMessage, Result, Success } from "../util";
-
-/** The common prefix that we expect all of our repository properties to have. */
-export const GITHUB_CODEQL_PROPERTY_PREFIX = "github-codeql-";
-
-/**
- * Enumerates repository property names that have some meaning to us.
- */
-export enum RepositoryPropertyName {
-  CONFIG_FILE = "github-codeql-config-file",
-  DISABLE_OVERLAY = "github-codeql-disable-overlay",
-  EXTRA_QUERIES = "github-codeql-extra-queries",
-  FILE_COVERAGE_ON_PRS = "github-codeql-file-coverage-on-prs",
-  TOOLS = "github-codeql-tools",
-}
-
-/** Parsed types of the known repository properties. */
-export type AllRepositoryProperties = {
-  [RepositoryPropertyName.CONFIG_FILE]: string;
-  [RepositoryPropertyName.DISABLE_OVERLAY]: boolean;
-  [RepositoryPropertyName.EXTRA_QUERIES]: string;
-  [RepositoryPropertyName.FILE_COVERAGE_ON_PRS]: boolean;
-  [RepositoryPropertyName.TOOLS]: string;
-};
-
-/** Parsed repository properties. */
-export type RepositoryProperties = Partial;
-
-/** Maps known repository properties to the type we expect to get from the API. */
-export type RepositoryPropertyApiType = {
-  [RepositoryPropertyName.CONFIG_FILE]: string;
-  [RepositoryPropertyName.DISABLE_OVERLAY]: string;
-  [RepositoryPropertyName.EXTRA_QUERIES]: string;
-  [RepositoryPropertyName.FILE_COVERAGE_ON_PRS]: string;
-  [RepositoryPropertyName.TOOLS]: string;
-};
-
-/** The type of functions which take the `value` from the API and try to convert it to the type we want. */
-export type PropertyParser = (
-  name: K,
-  value: RepositoryPropertyApiType[K],
-  logger: Logger,
-) => AllRepositoryProperties[K];
-
-/** Possible types of `value`s we get from the API. */
-export type RepositoryPropertyValue = string | string[];
-
-/** The type of repository property configurations. */
-export type PropertyInfo = {
-  /** A validator which checks that the value received from the API is what we expect. */
-  validate: (
-    value: RepositoryPropertyValue,
-  ) => value is RepositoryPropertyApiType[K];
-  /** A `PropertyParser` for the property. */
-  parse: PropertyParser;
-};
-
-/** Determines whether a value from the API is a string or not. */
-function isString(value: RepositoryPropertyValue): value is string {
-  return typeof value === "string";
-}
-
-/** A repository property that we expect to contain a string value. */
-const stringProperty = {
-  validate: isString,
-  parse: parseStringRepositoryProperty,
-};
-
-/** A repository property that we expect to contain a boolean value. */
-const booleanProperty = {
-  // The value from the API should come as a string, which we then parse into a boolean.
-  validate: isString,
-  parse: parseBooleanRepositoryProperty,
-};
-
-/** Parsers that transform repository properties from the API response into typed values. */
-const repositoryPropertyParsers: {
-  [K in RepositoryPropertyName]: PropertyInfo;
-} = {
-  [RepositoryPropertyName.CONFIG_FILE]: stringProperty,
-  [RepositoryPropertyName.DISABLE_OVERLAY]: booleanProperty,
-  [RepositoryPropertyName.EXTRA_QUERIES]: stringProperty,
-  [RepositoryPropertyName.FILE_COVERAGE_ON_PRS]: booleanProperty,
-  [RepositoryPropertyName.TOOLS]: stringProperty,
-};
-
-/**
- * A repository property has a name and a value.
- */
-export interface GitHubRepositoryProperty {
-  property_name: string;
-  value: RepositoryPropertyValue;
-}
-
-/**
- * The API returns a list of `GitHubRepositoryProperty` objects.
- */
-export type GitHubPropertiesResponse = GitHubRepositoryProperty[];
-
-/**
- * Retrieves all known repository properties from the API.
- *
- * @param logger The logger to use.
- * @param repositoryNwo Information about the repository for which to load properties.
- * @returns Returns a partial mapping from `RepositoryPropertyName` to values.
- */
-export async function loadPropertiesFromApi(
-  logger: Logger,
-  repositoryNwo: RepositoryNwo,
-): Promise {
-  try {
-    const response = await getRepositoryProperties(repositoryNwo);
-    const remoteProperties = response.data as GitHubPropertiesResponse;
-
-    if (!Array.isArray(remoteProperties)) {
-      throw new Error(
-        `Expected repository properties API to return an array, but got: ${JSON.stringify(response.data)}`,
-      );
-    }
-
-    logger.debug(
-      `Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}`,
-    );
-
-    const properties: RepositoryProperties = {};
-    const unrecognisedProperties: string[] = [];
-
-    for (const property of remoteProperties) {
-      if (property.property_name === undefined) {
-        throw new Error(
-          `Expected repository property object to have a 'property_name', but got: ${JSON.stringify(property)}`,
-        );
-      }
-
-      if (isKnownPropertyName(property.property_name)) {
-        setProperty(properties, property.property_name, property.value, logger);
-      } else if (
-        property.property_name.startsWith(GITHUB_CODEQL_PROPERTY_PREFIX) &&
-        !isDynamicWorkflow()
-      ) {
-        unrecognisedProperties.push(property.property_name);
-      }
-    }
-
-    if (Object.keys(properties).length === 0) {
-      logger.debug("No known repository properties were found.");
-    } else {
-      logger.debug(
-        "Loaded the following values for the repository properties:",
-      );
-      for (const [property, value] of Object.entries(properties).sort(
-        ([nameA], [nameB]) => nameA.localeCompare(nameB),
-      )) {
-        logger.debug(`  ${property}: ${value}`);
-      }
-    }
-
-    // Emit a warning if we encountered unrecognised properties that have our prefix.
-    if (unrecognisedProperties.length > 0) {
-      const unrecognisedPropertyList = unrecognisedProperties
-        .map((name) => `'${name}'`)
-        .join(", ");
-
-      logger.warning(
-        `Found repository properties (${unrecognisedPropertyList}), ` +
-          "which look like CodeQL Action repository properties, " +
-          "but which are not understood by this version of the CodeQL Action. " +
-          "Do you need to update to a newer version?",
-      );
-    }
-
-    return properties;
-  } catch (e) {
-    throw new Error(
-      `Encountered an error while trying to determine repository properties: ${e}`,
-    );
-  }
-}
-
-/**
- * Validate that `value` has the correct type for `K` and, if so, update the partial set of repository
- * properties with the parsed value of the specified property.
- */
-function setProperty(
-  properties: RepositoryProperties,
-  name: K,
-  value: RepositoryPropertyValue,
-  logger: Logger,
-): void {
-  const propertyOptions = repositoryPropertyParsers[name];
-
-  // We perform the validation here for two reasons:
-  // 1. This function is only called if `name` is a property we care about, to avoid throwing
-  //    on unrelated properties that may use representations we do not support.
-  // 2. The `propertyOptions.validate` function checks that the type of `value` we received from
-  //    the API is what expect and narrows the type accordingly, allowing us to call `parse`.
-  if (propertyOptions.validate(value)) {
-    properties[name] = propertyOptions.parse(name, value, logger);
-  } else {
-    throw new Error(
-      `Unexpected value for repository property '${name}' (${typeof value}), got: ${JSON.stringify(value)}`,
-    );
-  }
-}
-
-/** Parse a boolean repository property. */
-function parseBooleanRepositoryProperty(
-  name: string,
-  value: string,
-  logger: Logger,
-): boolean {
-  if (value !== "true" && value !== "false") {
-    logger.warning(
-      `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.`,
-    );
-  }
-  return value === "true";
-}
-
-/** Parse a string repository property. */
-function parseStringRepositoryProperty(_name: string, value: string): string {
-  return value;
-}
-
-/** Set of known repository property names, for fast lookups. */
-const KNOWN_REPOSITORY_PROPERTY_NAMES = new Set(
-  Object.values(RepositoryPropertyName),
-);
-
-/** Returns whether the given value is a known repository property name. */
-function isKnownPropertyName(name: string): name is RepositoryPropertyName {
-  return KNOWN_REPOSITORY_PROPERTY_NAMES.has(name);
-}
-
-/**
- * Loads [repository properties](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization) if applicable.
- */
-export async function loadRepositoryProperties(
-  repositoryNwo: RepositoryNwo,
-  logger: Logger,
-): Promise> {
-  // See if we can skip loading repository properties early. In particular,
-  // repositories owned by users cannot have repository properties, so we can
-  // skip the API call entirely in that case.
-  const repositoryOwnerType = github.context.payload.repository?.owner.type;
-  logger.debug(
-    `Repository owner type is '${repositoryOwnerType ?? "unknown"}'.`,
-  );
-  if (repositoryOwnerType === "User") {
-    logger.debug(
-      "Skipping loading repository properties because the repository is owned by a user and " +
-        "therefore cannot have repository properties.",
-    );
-    return new Success({});
-  }
-
-  try {
-    return new Success(await loadPropertiesFromApi(logger, repositoryNwo));
-  } catch (error) {
-    logger.warning(
-      `Failed to load repository properties: ${getErrorMessage(error)}`,
-    );
-    return new Failure(error);
-  }
-}
diff --git a/src/feature-flags/testing-util.ts b/src/feature-flags/testing-util.ts
deleted file mode 100644
index 202f2c97b1..0000000000
--- a/src/feature-flags/testing-util.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import { type ExecutionContext } from "ava";
-
-import {
-  Feature,
-  featureConfig,
-  FeatureConfig,
-  FeatureEnablement,
-  FeatureWithoutCLI,
-  initFeatures,
-} from "../feature-flags";
-import { getRunnerLogger } from "../logging";
-import { parseRepositoryNwo } from "../repository";
-import {
-  LoggedMessage,
-  mockCodeQLVersion,
-  setupActionsVars,
-} from "../testing-utils";
-import { ToolsFeature } from "../tools-features";
-import { GitHubVariant } from "../util";
-import * as util from "../util";
-
-const testRepositoryNwo = parseRepositoryNwo("github/example");
-
-export async function assertAllFeaturesHaveDefaultValues(
-  t: ExecutionContext,
-  features: FeatureEnablement,
-) {
-  for (const feature of Object.values(Feature)) {
-    t.deepEqual(
-      await getFeatureIncludingCodeQlIfRequired(features, feature),
-      featureConfig[feature].defaultValue,
-    );
-  }
-}
-
-export function assertAllFeaturesUndefinedInApi(
-  t: ExecutionContext,
-  loggedMessages: LoggedMessage[],
-) {
-  for (const feature of Object.keys(featureConfig)) {
-    t.assert(
-      loggedMessages.find(
-        (v) =>
-          v.type === "debug" &&
-          (v.message as string).includes(feature) &&
-          (v.message as string).includes("undefined in API response"),
-      ) !== undefined,
-    );
-  }
-}
-
-export function setUpFeatureFlagTests(
-  tmpDir: string,
-  logger = getRunnerLogger(true),
-  gitHubVersion = { type: GitHubVariant.DOTCOM } as util.GitHubVersion,
-): FeatureEnablement {
-  setupActionsVars(tmpDir, tmpDir);
-
-  return initFeatures(gitHubVersion, testRepositoryNwo, tmpDir, logger);
-}
-
-/**
- * Returns an argument to pass to `getValue` that if required includes a CodeQL object meeting the
- * minimum version or tool feature requirements specified by the feature.
- */
-export function getFeatureIncludingCodeQlIfRequired(
-  features: FeatureEnablement,
-  feature: Feature,
-) {
-  const config = featureConfig[
-    feature
-  ] satisfies FeatureConfig as FeatureConfig;
-  if (
-    config.minimumVersion === undefined &&
-    config.toolsFeature === undefined
-  ) {
-    return features.getValue(feature as FeatureWithoutCLI);
-  }
-
-  return features.getValue(
-    feature,
-    mockCodeQLVersion(
-      "9.9.9",
-      Object.fromEntries(Object.values(ToolsFeature).map((v) => [v, true])),
-    ),
-  );
-}
diff --git a/src/fingerprints.test.ts b/src/fingerprints.test.ts
deleted file mode 100644
index 6cb9b68617..0000000000
--- a/src/fingerprints.test.ts
+++ /dev/null
@@ -1,253 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as ava from "ava";
-import test from "ava";
-
-import * as fingerprints from "./fingerprints";
-import { getRunnerLogger } from "./logging";
-import * as sarif from "./sarif";
-import { setupTests } from "./testing-utils";
-import * as util from "./util";
-
-setupTests(test);
-
-async function testHash(
-  t: ava.Assertions,
-  input: string,
-  expectedHashes: string[],
-) {
-  await util.withTmpDir(async (tmpDir) => {
-    const tmpFile = path.resolve(tmpDir, "testfile");
-    fs.writeFileSync(tmpFile, input);
-    let index = 0;
-    const callback = function (lineNumber: number, hash: string) {
-      t.is(lineNumber, index + 1);
-      t.is(hash, expectedHashes[index]);
-      index++;
-    };
-    await fingerprints.hash(callback, tmpFile);
-    t.is(index, input.split(/\r\n|\r|\n/).length);
-  });
-}
-
-test("hash", async (t: ava.Assertions) => {
-  // Try empty file
-  await testHash(t, "", ["c129715d7a2bc9a3:1"]);
-
-  // Try various combinations of newline characters
-  await testHash(t, " a\nb\n  \t\tc\n d", [
-    "271789c17abda88f:1",
-    "54703d4cd895b18:1",
-    "180aee12dab6264:1",
-    "a23a3dc5e078b07b:1",
-  ]);
-  await testHash(t, " hello; \t\nworld!!!\n\n\n  \t\tGreetings\n End", [
-    "8b7cf3e952e7aeb2:1",
-    "b1ae1287ec4718d9:1",
-    "bff680108adb0fcc:1",
-    "c6805c5e1288b612:1",
-    "b86d3392aea1be30:1",
-    "e6ceba753e1a442:1",
-  ]);
-  await testHash(t, " hello; \t\nworld!!!\n\n\n  \t\tGreetings\n End\n", [
-    "e9496ae3ebfced30:1",
-    "fb7c023a8b9ccb3f:1",
-    "ce8ba1a563dcdaca:1",
-    "e20e36e16fcb0cc8:1",
-    "b3edc88f2938467e:1",
-    "c8e28b0b4002a3a0:1",
-    "c129715d7a2bc9a3:1",
-  ]);
-  await testHash(t, " hello; \t\nworld!!!\r\r\r  \t\tGreetings\r End\r", [
-    "e9496ae3ebfced30:1",
-    "fb7c023a8b9ccb3f:1",
-    "ce8ba1a563dcdaca:1",
-    "e20e36e16fcb0cc8:1",
-    "b3edc88f2938467e:1",
-    "c8e28b0b4002a3a0:1",
-    "c129715d7a2bc9a3:1",
-  ]);
-  await testHash(
-    t,
-    " hello; \t\r\nworld!!!\r\n\r\n\r\n  \t\tGreetings\r\n End\r\n",
-    [
-      "e9496ae3ebfced30:1",
-      "fb7c023a8b9ccb3f:1",
-      "ce8ba1a563dcdaca:1",
-      "e20e36e16fcb0cc8:1",
-      "b3edc88f2938467e:1",
-      "c8e28b0b4002a3a0:1",
-      "c129715d7a2bc9a3:1",
-    ],
-  );
-  await testHash(t, " hello; \t\nworld!!!\r\n\n\r  \t\tGreetings\r End\r\n", [
-    "e9496ae3ebfced30:1",
-    "fb7c023a8b9ccb3f:1",
-    "ce8ba1a563dcdaca:1",
-    "e20e36e16fcb0cc8:1",
-    "b3edc88f2938467e:1",
-    "c8e28b0b4002a3a0:1",
-    "c129715d7a2bc9a3:1",
-  ]);
-
-  // Try repeating line that will generate identical hashes
-  await testHash(t, "Lorem ipsum dolor sit amet.\n".repeat(10), [
-    "a7f2ff13bc495cf2:1",
-    "a7f2ff13bc495cf2:2",
-    "a7f2ff13bc495cf2:3",
-    "a7f2ff13bc495cf2:4",
-    "a7f2ff13bc495cf2:5",
-    "a7f2ff13bc495cf2:6",
-    "a7f2ff1481e87703:1",
-    "a9cf91f7bbf1862b:1",
-    "55ec222b86bcae53:1",
-    "cc97dc7b1d7d8f7b:1",
-    "c129715d7a2bc9a3:1",
-  ]);
-
-  await testHash(
-    t,
-    "x = 2\nx = 1\nprint(x)\nx = 3\nprint(x)\nx = 4\nprint(x)\n",
-    [
-      "e54938cc54b302f1:1",
-      "bb609acbe9138d60:1",
-      "1131fd5871777f34:1",
-      "5c482a0f8b35ea28:1",
-      "54517377da7028d2:1",
-      "2c644846cb18d53e:1",
-      "f1b89f20de0d133:1",
-      "c129715d7a2bc9a3:1",
-    ],
-  );
-});
-
-function testResolveUriToFile(uri: any, index: any, artifactsURIs: any[]) {
-  const location = { uri, index };
-  const artifacts = artifactsURIs.map((artifactURI) => ({
-    location: { uri: artifactURI },
-  }));
-  return fingerprints.resolveUriToFile(
-    location,
-    artifacts,
-    process.cwd(),
-    getRunnerLogger(true),
-  );
-}
-
-test("resolveUriToFile", (t) => {
-  // The resolveUriToFile method checks that the file exists and is in the right directory
-  // so we need to give it real files to look at. We will use this file as an example.
-  // For this to work we require the current working directory to be a parent, but this
-  // should generally always be the case so this is fine.
-  const filepath = __filename.split(path.sep).join("/");
-  const relativeFilepath = path
-    .relative(process.cwd(), __filename)
-    .split(path.sep)
-    .join("/");
-
-  // Absolute paths are unmodified
-  t.is(testResolveUriToFile(filepath, undefined, []), filepath);
-  t.is(testResolveUriToFile(`file://${filepath}`, undefined, []), filepath);
-
-  // Relative paths are made absolute
-  t.is(
-    testResolveUriToFile(relativeFilepath, undefined, [])
-      ?.split(path.sep)
-      .join("/"),
-    filepath,
-  );
-  t.is(
-    testResolveUriToFile(`file://${relativeFilepath}`, undefined, [])
-      ?.split(path.sep)
-      .join("/"),
-    filepath,
-  );
-
-  // Absolute paths outside the src root are discarded
-  t.is(testResolveUriToFile("/src/foo/bar.js", undefined, []), undefined);
-  t.is(
-    testResolveUriToFile("file:///src/foo/bar.js", undefined, []),
-    undefined,
-  );
-
-  // Other schemes are discarded
-  t.is(testResolveUriToFile(`https://${filepath}`, undefined, []), undefined);
-  t.is(testResolveUriToFile(`ftp://${filepath}`, undefined, []), undefined);
-
-  // Invalid URIs are discarded
-  t.is(testResolveUriToFile(1, undefined, []), undefined);
-  t.is(testResolveUriToFile(undefined, undefined, []), undefined);
-
-  // Non-existent files are discarded
-  t.is(testResolveUriToFile(`${filepath}2`, undefined, []), undefined);
-
-  // Index is resolved
-  t.is(testResolveUriToFile(undefined, 0, [filepath]), filepath);
-  t.is(testResolveUriToFile(undefined, 1, ["foo", filepath]), filepath);
-
-  // Invalid indexes are discarded
-  t.is(testResolveUriToFile(undefined, 1, [filepath]), undefined);
-  t.is(testResolveUriToFile(undefined, "0", [filepath]), undefined);
-
-  // Directories are discarded
-  const dirpath = __dirname;
-  t.is(testResolveUriToFile(dirpath, undefined, []), undefined);
-  t.is(testResolveUriToFile(`file://${dirpath}`, undefined, []), undefined);
-});
-
-test("addFingerprints", async (t) => {
-  // Run an end-to-end test on a test file
-  const input = JSON.parse(
-    fs
-      .readFileSync(`${__dirname}/../src/testdata/fingerprinting.input.sarif`)
-      .toString(),
-  ) as sarif.Log;
-  const expected = JSON.parse(
-    fs
-      .readFileSync(
-        `${__dirname}/../src/testdata/fingerprinting.expected.sarif`,
-      )
-      .toString(),
-  );
-
-  // The URIs in the SARIF files resolve to files in the testdata directory
-  const sourceRoot = path.normalize(`${__dirname}/../src/testdata`);
-
-  t.deepEqual(
-    await fingerprints.addFingerprints(
-      input,
-      sourceRoot,
-      getRunnerLogger(true),
-    ),
-    expected,
-  );
-});
-
-test("missingRegions", async (t) => {
-  // Run an end-to-end test on a test file
-  const input = JSON.parse(
-    fs
-      .readFileSync(`${__dirname}/../src/testdata/fingerprinting2.input.sarif`)
-      .toString(),
-  ) as sarif.Log;
-  const expected = JSON.parse(
-    fs
-      .readFileSync(
-        `${__dirname}/../src/testdata/fingerprinting2.expected.sarif`,
-      )
-      .toString(),
-  );
-
-  // The URIs in the SARIF files resolve to files in the testdata directory
-  const sourceRoot = path.normalize(`${__dirname}/../src/testdata`);
-
-  t.deepEqual(
-    await fingerprints.addFingerprints(
-      input,
-      sourceRoot,
-      getRunnerLogger(true),
-    ),
-    expected,
-  );
-});
diff --git a/src/fingerprints.ts b/src/fingerprints.ts
deleted file mode 100644
index 14cf30e63f..0000000000
--- a/src/fingerprints.ts
+++ /dev/null
@@ -1,321 +0,0 @@
-import * as fs from "fs";
-import path from "path";
-
-import Long from "long";
-
-import { DocUrl } from "./doc-url";
-import * as json from "./json";
-import { Logger } from "./logging";
-import type * as sarif from "./sarif";
-
-const tab = "\t".charCodeAt(0);
-const space = " ".charCodeAt(0);
-const lf = "\n".charCodeAt(0);
-const cr = "\r".charCodeAt(0);
-const EOF = 65535;
-const BLOCK_SIZE = 100;
-const MOD = Long.fromInt(37); // L
-
-// Compute the starting point for the hash mod
-function computeFirstMod(): Long {
-  let firstMod = Long.ONE; // L
-  for (let i = 0; i < BLOCK_SIZE; i++) {
-    firstMod = firstMod.multiply(MOD);
-  }
-  return firstMod;
-}
-
-// Type signature of callback passed to hash function.
-// Will be called with the line number (1-based) and hash for every line.
-type hashCallback = (lineNumber: number, hash: string) => void;
-
-/**
- * Hash the contents of a file
- *
- * The hash method computes a rolling hash for every line in the input. The hash is computed using the first
- * BLOCK_SIZE non-space/tab characters counted from the start of the line. For the computation of the hash all
- * line endings (i.e. \r, \n, and \r\n) are normalized to '\n'. A special value (-1) is added at the end of the
- * file followed by enough '\0' characters to ensure that there are BLOCK_SIZE characters available for computing
- * the hashes of the lines near the end of the file.
- *
- * @param callback function that is called with the line number (1-based) and hash for every line
- * @param filepath The path to the file to hash
- */
-export async function hash(callback: hashCallback, filepath: string) {
-  // A rolling view in to the input
-  const window: number[] = Array(BLOCK_SIZE).fill(0);
-
-  // If the character in the window is the start of a new line
-  // then records the line number, otherwise will be -1.
-  // Indexes match up with those from the window variable.
-  const lineNumbers: number[] = Array(BLOCK_SIZE).fill(-1);
-
-  // The current hash value, updated as we read each character
-  let hashRaw = Long.ZERO;
-  const firstMod = computeFirstMod();
-
-  // The current index in the window, will wrap around to zero when we reach BLOCK_SIZE
-  let index = 0;
-  // The line number of the character we are currently processing from the input
-  let lineNumber = 0;
-  // Is the next character to be read the start of a new line
-  let lineStart = true;
-  // Was the previous character a CR (carriage return)
-  let prevCR = false;
-  // A map of hashes we've seen before and how many times,
-  // so we can disambiguate identical hashes
-  const hashCounts: { [hashValue: string]: number } = {};
-
-  // Output the current hash and line number to the callback function
-  const outputHash = function () {
-    const hashValue = hashRaw.toUnsigned().toString(16);
-    if (!hashCounts[hashValue]) {
-      hashCounts[hashValue] = 0;
-    }
-    hashCounts[hashValue]++;
-    callback(lineNumbers[index], `${hashValue}:${hashCounts[hashValue]}`);
-    lineNumbers[index] = -1;
-  };
-
-  // Update the current hash value and increment the index in the window
-  const updateHash = function (current: number) {
-    const begin = window[index];
-    window[index] = current;
-    hashRaw = MOD.multiply(hashRaw)
-      .add(Long.fromInt(current))
-      .subtract(firstMod.multiply(Long.fromInt(begin)));
-
-    index = (index + 1) % BLOCK_SIZE;
-  };
-
-  // First process every character in the input, updating the hash and lineNumbers
-  // as we go. Once we reach a point in the window again then we've processed
-  // BLOCK_SIZE characters and if the last character at this point in the window
-  // was the start of a line then we should output the hash for that line.
-  const processCharacter = function (current: number) {
-    // skip tabs, spaces, and line feeds that come directly after a carriage return
-    if (current === space || current === tab || (prevCR && current === lf)) {
-      prevCR = false;
-      return;
-    }
-    // replace CR with LF
-    if (current === cr) {
-      current = lf;
-      prevCR = true;
-    } else {
-      prevCR = false;
-    }
-    if (lineNumbers[index] !== -1) {
-      outputHash();
-    }
-    if (lineStart) {
-      lineStart = false;
-      lineNumber++;
-      lineNumbers[index] = lineNumber;
-    }
-    if (current === lf) {
-      lineStart = true;
-    }
-    updateHash(current);
-  };
-
-  const readStream = fs.createReadStream(filepath, "utf8");
-  for await (const data of readStream) {
-    for (let i = 0; i < data.length; ++i) {
-      processCharacter((data as string).charCodeAt(i));
-    }
-  }
-  processCharacter(EOF);
-
-  // Flush the remaining lines
-  for (let i = 0; i < BLOCK_SIZE; i++) {
-    if (lineNumbers[index] !== -1) {
-      outputHash();
-    }
-    updateHash(0);
-  }
-}
-
-// Generate a hash callback function that updates the given result in-place
-// when it receives a hash for the correct line number. Ignores hashes for other lines.
-function locationUpdateCallback(
-  result: sarif.Result,
-  location: any,
-  logger: Logger,
-): hashCallback {
-  let locationStartLine = location.physicalLocation?.region?.startLine;
-  if (locationStartLine === undefined) {
-    // We expect the region section to be present, but it can be absent if the
-    // alert pertains to the entire file. In this case, we compute the fingerprint
-    // using the hash of the first line of the file.
-    locationStartLine = 1;
-  }
-  return function (lineNumber: number, hashValue: string) {
-    // Ignore hashes for lines that don't concern us
-    if (locationStartLine !== lineNumber) {
-      return;
-    }
-
-    if (!result.partialFingerprints) {
-      result.partialFingerprints = {};
-    }
-    const existingFingerprint =
-      result.partialFingerprints.primaryLocationLineHash;
-
-    // If the hash doesn't match the existing fingerprint then
-    // output a warning and don't overwrite it.
-    if (!existingFingerprint) {
-      result.partialFingerprints.primaryLocationLineHash = hashValue;
-    } else if (existingFingerprint !== hashValue) {
-      logger.warning(
-        `Calculated fingerprint of ${hashValue} for file ${location.physicalLocation.artifactLocation.uri} line ${lineNumber}, but found existing inconsistent fingerprint value ${existingFingerprint}`,
-      );
-    }
-  };
-}
-
-// Can we fingerprint the given location. This requires access to
-// the source file so we can hash it.
-// If possible returns a absolute file path for the source file,
-// or if not possible then returns undefined.
-export function resolveUriToFile(
-  location: any,
-  artifacts: any[],
-  sourceRoot: string,
-  logger: Logger,
-): string | undefined {
-  // This may be referencing an artifact
-  if (!location.uri && location.index !== undefined) {
-    if (
-      typeof location.index !== "number" ||
-      location.index < 0 ||
-      location.index >= artifacts.length ||
-      !json.isObject(artifacts[location.index].location)
-    ) {
-      logger.debug(`Ignoring location as index "${location.index}" is invalid`);
-      return undefined;
-    }
-    location = artifacts[location.index].location;
-  }
-
-  // Get the URI and decode
-  if (typeof location.uri !== "string") {
-    logger.debug(`Ignoring location as URI "${location.uri}" is invalid`);
-    return undefined;
-  }
-
-  let uri: string;
-  try {
-    uri = decodeURIComponent(location.uri as string);
-  } catch {
-    logger.debug(`Ignoring location as URI "${location.uri}" is invalid`);
-    return undefined;
-  }
-
-  // Remove a file scheme, and abort if the scheme is anything else
-  const fileUriPrefix = "file://";
-  if (uri.startsWith(fileUriPrefix)) {
-    uri = uri.substring(fileUriPrefix.length);
-  }
-  if (uri.indexOf("://") !== -1) {
-    logger.debug(
-      `Ignoring location URI "${uri}" as the scheme is not recognised`,
-    );
-    return undefined;
-  }
-
-  // Discard any absolute paths that aren't in the src root
-  const srcRootPrefix = `${sourceRoot}/`;
-  if (uri.startsWith("/") && !uri.startsWith(srcRootPrefix)) {
-    logger.debug(
-      `Ignoring location URI "${uri}" as it is outside of the src root`,
-    );
-    return undefined;
-  }
-
-  // Just assume a relative path is relative to the src root.
-  // This is not necessarily true but should be a good approximation
-  // and here we likely want to err on the side of handling more cases.
-  if (!path.isAbsolute(uri)) {
-    uri = srcRootPrefix + uri;
-  }
-
-  // Check the file exists
-  if (!fs.existsSync(uri)) {
-    logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`);
-    return undefined;
-  }
-
-  if (fs.statSync(uri).isDirectory()) {
-    logger.debug(`Unable to compute fingerprint for directory: ${uri}`);
-    return undefined;
-  }
-
-  return uri;
-}
-
-// Compute fingerprints for results in the given sarif file
-// and return an updated sarif file contents.
-export async function addFingerprints(
-  sarifLog: Partial,
-  sourceRoot: string,
-  logger: Logger,
-): Promise> {
-  logger.info(
-    `Adding fingerprints to SARIF file. See ${DocUrl.TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS} for more information.`,
-  );
-  // Gather together results for the same file and construct
-  // callbacks to accept hashes for that file and update the location
-  const callbacksByFile: { [filename: string]: hashCallback[] } = {};
-  for (const run of sarifLog.runs || []) {
-    // We may need the list of artifacts to resolve against
-    const artifacts = run.artifacts || [];
-
-    for (const result of run.results || []) {
-      // Check the primary location is defined correctly and is in the src root
-      const primaryLocation = (result.locations || [])[0];
-      if (!primaryLocation?.physicalLocation?.artifactLocation) {
-        logger.debug(
-          `Unable to compute fingerprint for invalid location: ${JSON.stringify(
-            primaryLocation,
-          )}`,
-        );
-        continue;
-      }
-
-      if (primaryLocation?.physicalLocation?.region?.startLine === undefined) {
-        // Locations without a line number are unlikely to be source files
-        continue;
-      }
-
-      const filepath = resolveUriToFile(
-        primaryLocation.physicalLocation.artifactLocation,
-        artifacts,
-        sourceRoot,
-        logger,
-      );
-      if (!filepath) {
-        continue;
-      }
-      if (!callbacksByFile[filepath]) {
-        callbacksByFile[filepath] = [];
-      }
-      callbacksByFile[filepath].push(
-        locationUpdateCallback(result, primaryLocation, logger),
-      );
-    }
-  }
-
-  // Now hash each file that was found
-  for (const [filepath, callbacks] of Object.entries(callbacksByFile)) {
-    // A callback that forwards the hash to all other callbacks for that file
-    const teeCallback = function (lineNumber: number, hashValue: string) {
-      for (const c of Object.values(callbacks)) {
-        c(lineNumber, hashValue);
-      }
-    };
-    await hash(teeCallback, filepath);
-  }
-
-  return sarifLog;
-}
diff --git a/src/git-utils.test.ts b/src/git-utils.test.ts
deleted file mode 100644
index b77d40a7ec..0000000000
--- a/src/git-utils.test.ts
+++ /dev/null
@@ -1,654 +0,0 @@
-import * as fs from "fs";
-import * as os from "os";
-import * as path from "path";
-
-import * as core from "@actions/core";
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import * as gitUtils from "./git-utils";
-import { setupActionsVars, setupTests } from "./testing-utils";
-import { withTmpDir } from "./util";
-
-setupTests(test);
-
-test.serial("getRef() throws on the empty string", async (t) => {
-  process.env["GITHUB_REF"] = "";
-  await t.throwsAsync(gitUtils.getRef);
-});
-
-test.serial(
-  "getRef() returns merge PR ref if GITHUB_SHA still checked out",
-  async (t) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const expectedRef = "refs/pull/1/merge";
-      const currentSha = "a".repeat(40);
-      process.env["GITHUB_REF"] = expectedRef;
-      process.env["GITHUB_SHA"] = currentSha;
-
-      const callback = sinon.stub(gitUtils, "getCommitOid");
-      callback.withArgs("HEAD").resolves(currentSha);
-
-      const actualRef = await gitUtils.getRef();
-      t.deepEqual(actualRef, expectedRef);
-    });
-  },
-);
-
-test.serial(
-  "getRef() returns merge PR ref if GITHUB_REF still checked out but sha has changed (actions checkout@v1)",
-  async (t) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const expectedRef = "refs/pull/1/merge";
-      process.env["GITHUB_REF"] = expectedRef;
-      process.env["GITHUB_SHA"] = "b".repeat(40);
-      const sha = "a".repeat(40);
-
-      const callback = sinon.stub(gitUtils, "getCommitOid");
-      callback.withArgs("refs/remotes/pull/1/merge").resolves(sha);
-      callback.withArgs("HEAD").resolves(sha);
-
-      const actualRef = await gitUtils.getRef();
-      t.deepEqual(actualRef, expectedRef);
-    });
-  },
-);
-
-test.serial(
-  "getRef() returns head PR ref if GITHUB_REF no longer checked out",
-  async (t) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupActionsVars(tmpDir, tmpDir);
-      process.env["GITHUB_REF"] = "refs/pull/1/merge";
-      process.env["GITHUB_SHA"] = "a".repeat(40);
-
-      const callback = sinon.stub(gitUtils, "getCommitOid");
-      callback.withArgs(tmpDir, "refs/pull/1/merge").resolves("a".repeat(40));
-      callback.withArgs(tmpDir, "HEAD").resolves("b".repeat(40));
-
-      const actualRef = await gitUtils.getRef();
-      t.deepEqual(actualRef, "refs/pull/1/head");
-    });
-  },
-);
-
-test.serial(
-  "getRef() returns ref provided as an input and ignores current HEAD",
-  async (t) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const getAdditionalInputStub = sinon.stub(
-        actionsUtil,
-        "getOptionalInput",
-      );
-      getAdditionalInputStub.withArgs("ref").resolves("refs/pull/2/merge");
-      getAdditionalInputStub.withArgs("sha").resolves("b".repeat(40));
-
-      // These values are be ignored
-      process.env["GITHUB_REF"] = "refs/pull/1/merge";
-      process.env["GITHUB_SHA"] = "a".repeat(40);
-
-      const callback = sinon.stub(gitUtils, "getCommitOid");
-      callback.withArgs("refs/pull/1/merge").resolves("b".repeat(40));
-      callback.withArgs("HEAD").resolves("b".repeat(40));
-
-      const actualRef = await gitUtils.getRef();
-      t.deepEqual(actualRef, "refs/pull/2/merge");
-    });
-  },
-);
-
-test.serial(
-  "getRef() returns CODE_SCANNING_REF as a fallback for GITHUB_REF",
-  async (t) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const expectedRef = "refs/pull/1/HEAD";
-      const currentSha = "a".repeat(40);
-      process.env["CODE_SCANNING_REF"] = expectedRef;
-      process.env["GITHUB_REF"] = "";
-      process.env["GITHUB_SHA"] = currentSha;
-
-      const actualRef = await gitUtils.getRef();
-      t.deepEqual(actualRef, expectedRef);
-    });
-  },
-);
-
-test.serial(
-  "getRef() returns GITHUB_REF over CODE_SCANNING_REF if both are provided",
-  async (t) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const expectedRef = "refs/pull/1/merge";
-      const currentSha = "a".repeat(40);
-      process.env["CODE_SCANNING_REF"] = "refs/pull/1/HEAD";
-      process.env["GITHUB_REF"] = expectedRef;
-      process.env["GITHUB_SHA"] = currentSha;
-
-      const actualRef = await gitUtils.getRef();
-      t.deepEqual(actualRef, expectedRef);
-    });
-  },
-);
-
-test.serial(
-  "getRef() throws an error if only `ref` is provided as an input",
-  async (t) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const getAdditionalInputStub = sinon.stub(
-        actionsUtil,
-        "getOptionalInput",
-      );
-      getAdditionalInputStub.withArgs("ref").resolves("refs/pull/1/merge");
-
-      await t.throwsAsync(
-        async () => {
-          await gitUtils.getRef();
-        },
-        {
-          instanceOf: Error,
-          message:
-            "Both 'ref' and 'sha' are required if one of them is provided.",
-        },
-      );
-    });
-  },
-);
-
-test.serial(
-  "getRef() throws an error if only `sha` is provided as an input",
-  async (t) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupActionsVars(tmpDir, tmpDir);
-      process.env["GITHUB_WORKSPACE"] = "/tmp";
-      const getAdditionalInputStub = sinon.stub(
-        actionsUtil,
-        "getOptionalInput",
-      );
-      getAdditionalInputStub.withArgs("sha").resolves("a".repeat(40));
-
-      await t.throwsAsync(
-        async () => {
-          await gitUtils.getRef();
-        },
-        {
-          instanceOf: Error,
-          message:
-            "Both 'ref' and 'sha' are required if one of them is provided.",
-        },
-      );
-    });
-  },
-);
-
-test.serial("isAnalyzingDefaultBranch()", async (t) => {
-  process.env["GITHUB_EVENT_NAME"] = "push";
-  process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "true";
-  t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), true);
-  process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "false";
-
-  await withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-    const envFile = path.join(tmpDir, "event.json");
-    fs.writeFileSync(
-      envFile,
-      JSON.stringify({
-        repository: {
-          default_branch: "main",
-        },
-      }),
-    );
-    process.env["GITHUB_EVENT_PATH"] = envFile;
-
-    process.env["GITHUB_REF"] = "main";
-    process.env["GITHUB_SHA"] = "1234";
-    t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), true);
-
-    process.env["GITHUB_REF"] = "refs/heads/main";
-    t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), true);
-
-    process.env["GITHUB_REF"] = "feature";
-    t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), false);
-
-    fs.writeFileSync(
-      envFile,
-      JSON.stringify({
-        schedule: "0 0 * * *",
-      }),
-    );
-    process.env["GITHUB_EVENT_NAME"] = "schedule";
-    process.env["GITHUB_REF"] = "refs/heads/main";
-    t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), true);
-
-    const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
-    getAdditionalInputStub
-      .withArgs("ref")
-      .resolves("refs/heads/something-else");
-    getAdditionalInputStub
-      .withArgs("sha")
-      .resolves("0000000000000000000000000000000000000000");
-    process.env["GITHUB_EVENT_NAME"] = "schedule";
-    process.env["GITHUB_REF"] = "refs/heads/main";
-    t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), false);
-  });
-});
-
-test.serial("determineBaseBranchHeadCommitOid non-pullrequest", async (t) => {
-  const infoStub = sinon.stub(core, "info");
-
-  process.env["GITHUB_EVENT_NAME"] = "hucairz";
-  process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
-  const result = await gitUtils.determineBaseBranchHeadCommitOid(__dirname);
-  t.deepEqual(result, undefined);
-  t.deepEqual(0, infoStub.callCount);
-});
-
-test.serial(
-  "determineBaseBranchHeadCommitOid not git repository",
-  async (t) => {
-    const infoStub = sinon.stub(core, "info");
-
-    process.env["GITHUB_EVENT_NAME"] = "pull_request";
-    process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
-
-    await withTmpDir(async (tmpDir) => {
-      await gitUtils.determineBaseBranchHeadCommitOid(tmpDir);
-    });
-
-    t.deepEqual(1, infoStub.callCount);
-    t.deepEqual(
-      infoStub.firstCall.args[0],
-      "git call failed. Will calculate the base branch SHA on the server. Error: " +
-        "The checkout path provided to the action does not appear to be a git repository.",
-    );
-  },
-);
-
-test.serial("determineBaseBranchHeadCommitOid other error", async (t) => {
-  const infoStub = sinon.stub(core, "info");
-
-  process.env["GITHUB_EVENT_NAME"] = "pull_request";
-  process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
-  const result = await gitUtils.determineBaseBranchHeadCommitOid(
-    path.join(__dirname, "../../i-dont-exist"),
-  );
-  t.deepEqual(result, undefined);
-  t.deepEqual(1, infoStub.callCount);
-  t.assert(
-    infoStub.firstCall.args[0].startsWith(
-      "git call failed. Will calculate the base branch SHA on the server. Error: ",
-    ),
-  );
-  t.assert(
-    !infoStub.firstCall.args[0].endsWith(
-      "The checkout path provided to the action does not appear to be a git repository.",
-    ),
-  );
-});
-
-test.serial(
-  "determineBaseBranchHeadCommitOid accepts SHA-256 OIDs",
-  async (t) => {
-    const mergeSha = "a".repeat(64);
-    const baseOid = "b".repeat(64);
-    const headOid = "c".repeat(64);
-
-    process.env["GITHUB_EVENT_NAME"] = "pull_request";
-    process.env["GITHUB_SHA"] = mergeSha;
-
-    sinon
-      .stub(gitUtils as any, "runGitCommand")
-      .resolves(`commit ${mergeSha}\nparent ${baseOid}\nparent ${headOid}\n`);
-
-    const result = await gitUtils.determineBaseBranchHeadCommitOid(__dirname);
-    t.deepEqual(result, baseOid);
-  },
-);
-
-test.serial("decodeGitFilePath unquoted strings", async (t) => {
-  t.deepEqual(gitUtils.decodeGitFilePath("foo"), "foo");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo bar"), "foo bar");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\\\bar"), "foo\\\\bar");
-  t.deepEqual(gitUtils.decodeGitFilePath('foo\\"bar'), 'foo\\"bar');
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\001bar"), "foo\\001bar");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\abar"), "foo\\abar");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\bbar"), "foo\\bbar");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\fbar"), "foo\\fbar");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\nbar"), "foo\\nbar");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\rbar"), "foo\\rbar");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\tbar"), "foo\\tbar");
-  t.deepEqual(gitUtils.decodeGitFilePath("foo\\vbar"), "foo\\vbar");
-  t.deepEqual(
-    gitUtils.decodeGitFilePath("\\a\\b\\f\\n\\r\\t\\v"),
-    "\\a\\b\\f\\n\\r\\t\\v",
-  );
-});
-
-test.serial("decodeGitFilePath quoted strings", async (t) => {
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo"'), "foo");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo bar"'), "foo bar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\\\bar"'), "foo\\bar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\"bar"'), 'foo"bar');
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\001bar"'), "foo\x01bar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\abar"'), "foo\x07bar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\bbar"'), "foo\bbar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\fbar"'), "foo\fbar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\nbar"'), "foo\nbar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\rbar"'), "foo\rbar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\tbar"'), "foo\tbar");
-  t.deepEqual(gitUtils.decodeGitFilePath('"foo\\vbar"'), "foo\vbar");
-  t.deepEqual(
-    gitUtils.decodeGitFilePath('"\\a\\b\\f\\n\\r\\t\\v"'),
-    "\x07\b\f\n\r\t\v",
-  );
-});
-
-test.serial(
-  "getFileOidsUnderPath uses --recurse-submodules when submodules exist",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      fs.writeFileSync(path.join(tmpDir, ".gitmodules"), "");
-      const runGitCommandStub = sinon
-        .stub(gitUtils as any, "runGitCommand")
-        .callsFake(async (_cwd: any, args: any) => {
-          if (args[0] === "rev-parse") {
-            return `${tmpDir}\n`;
-          }
-          return (
-            "100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/git-utils.js\n" +
-            "100644 d89514599a9a99f22b4085766d40af7b99974827 0\tlib/git-utils.js.map\n" +
-            "100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\tsrc/git-utils.ts"
-          );
-        });
-
-      const result = await gitUtils.getFileOidsUnderPath("/fake/path");
-
-      t.deepEqual(result, {
-        "lib/git-utils.js": "30d998ded095371488be3a729eb61d86ed721a18",
-        "lib/git-utils.js.map": "d89514599a9a99f22b4085766d40af7b99974827",
-        "src/git-utils.ts": "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96",
-      });
-
-      // Second call (after getGitRoot) should include --recurse-submodules
-      t.deepEqual(runGitCommandStub.secondCall.args[1], [
-        "ls-files",
-        "--recurse-submodules",
-        "--stage",
-      ]);
-    });
-  },
-);
-
-test.serial(
-  "getFileOidsUnderPath omits --recurse-submodules when no submodules exist",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const runGitCommandStub = sinon
-        .stub(gitUtils as any, "runGitCommand")
-        .callsFake(async (_cwd: any, args: any) => {
-          if (args[0] === "rev-parse") {
-            return `${tmpDir}\n`;
-          }
-          return (
-            "100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/git-utils.js\n" +
-            "100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\tsrc/git-utils.ts"
-          );
-        });
-
-      const result = await gitUtils.getFileOidsUnderPath("/fake/path");
-
-      t.deepEqual(result, {
-        "lib/git-utils.js": "30d998ded095371488be3a729eb61d86ed721a18",
-        "src/git-utils.ts": "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96",
-      });
-
-      // Second call (after getGitRoot) should NOT include --recurse-submodules
-      t.deepEqual(runGitCommandStub.secondCall.args[1], [
-        "ls-files",
-        "--stage",
-      ]);
-    });
-  },
-);
-
-test.serial("getFileOidsUnderPath handles quoted paths", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    sinon
-      .stub(gitUtils as any, "runGitCommand")
-      .callsFake(async (_cwd: any, args: any) => {
-        if (args[0] === "rev-parse") {
-          return `${tmpDir}\n`;
-        }
-        return (
-          "100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/normal-file.js\n" +
-          '100644 d89514599a9a99f22b4085766d40af7b99974827 0\t"lib/file with spaces.js"\n' +
-          '100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\t"lib/file\\twith\\ttabs.js"'
-        );
-      });
-
-    const result = await gitUtils.getFileOidsUnderPath("/fake/path");
-
-    t.deepEqual(result, {
-      "lib/normal-file.js": "30d998ded095371488be3a729eb61d86ed721a18",
-      "lib/file with spaces.js": "d89514599a9a99f22b4085766d40af7b99974827",
-      "lib/file\twith\ttabs.js": "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96",
-    });
-  });
-});
-
-test.serial("getFileOidsUnderPath handles SHA-256 OIDs", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const sha256OidA =
-      "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2c0d4b7e8f9a1234567890ab";
-    const sha256OidB =
-      "aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899";
-
-    sinon
-      .stub(gitUtils as any, "runGitCommand")
-      .callsFake(async (_cwd: any, args: any) => {
-        if (args[0] === "rev-parse") {
-          return `${tmpDir}\n`;
-        }
-        return (
-          `100644 ${sha256OidA} 0\tlib/sha256-file-a.js\n` +
-          `100644 ${sha256OidB} 0\tsrc/sha256-file-b.ts`
-        );
-      });
-
-    const result = await gitUtils.getFileOidsUnderPath("/fake/path");
-
-    t.deepEqual(result, {
-      "lib/sha256-file-a.js": sha256OidA,
-      "src/sha256-file-b.ts": sha256OidB,
-    });
-  });
-});
-
-test.serial(
-  "getFileOidsUnderPath rejects OIDs of unsupported length",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      // 50-char OID: not a valid SHA-1 (40) or SHA-256 (64) length. The regex
-      // must not accept this even though every character is a valid hex digit.
-      const invalidLine =
-        "100644 30d998ded095371488be3a729eb61d86ed721a1830d998ded0 0\tlib/bad.js";
-      sinon
-        .stub(gitUtils as any, "runGitCommand")
-        .callsFake(async (_cwd: any, args: any) => {
-          if (args[0] === "rev-parse") {
-            return `${tmpDir}\n`;
-          }
-          return invalidLine;
-        });
-
-      await t.throwsAsync(
-        async () => {
-          await gitUtils.getFileOidsUnderPath("/fake/path");
-        },
-        {
-          instanceOf: Error,
-          message: `Unexpected "git ls-files" output: ${invalidLine}`,
-        },
-      );
-    });
-  },
-);
-
-test.serial("getFileOidsUnderPath handles empty output", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    sinon
-      .stub(gitUtils as any, "runGitCommand")
-      .callsFake(async (_cwd: any, args: any) => {
-        if (args[0] === "rev-parse") {
-          return `${tmpDir}\n`;
-        }
-        return "";
-      });
-
-    const result = await gitUtils.getFileOidsUnderPath("/fake/path");
-    t.deepEqual(result, {});
-  });
-});
-
-test.serial(
-  "getFileOidsUnderPath throws on unexpected output format",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      sinon
-        .stub(gitUtils as any, "runGitCommand")
-        .callsFake(async (_cwd: any, args: any) => {
-          if (args[0] === "rev-parse") {
-            return `${tmpDir}\n`;
-          }
-          return (
-            "100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/git-utils.js\n" +
-            "invalid-line-format\n" +
-            "100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\tsrc/git-utils.ts"
-          );
-        });
-
-      await t.throwsAsync(
-        async () => {
-          await gitUtils.getFileOidsUnderPath("/fake/path");
-        },
-        {
-          instanceOf: Error,
-          message: 'Unexpected "git ls-files" output: invalid-line-format',
-        },
-      );
-    });
-  },
-);
-
-test.serial(
-  "getGitVersionOrThrow returns version for valid git output",
-  async (t) => {
-    sinon
-      .stub(gitUtils as any, "runGitCommand")
-      .resolves(`git version 2.40.0${os.EOL}`);
-
-    const version = await gitUtils.getGitVersionOrThrow();
-    t.is(version.truncatedVersion, "2.40.0");
-    t.is(version.fullVersion, "2.40.0");
-  },
-);
-
-test.serial("getGitVersionOrThrow throws for invalid git output", async (t) => {
-  sinon.stub(gitUtils as any, "runGitCommand").resolves("invalid output");
-
-  await t.throwsAsync(
-    async () => {
-      await gitUtils.getGitVersionOrThrow();
-    },
-    {
-      instanceOf: Error,
-      message: "Could not parse Git version from output: invalid output",
-    },
-  );
-});
-
-test.serial(
-  "getGitVersionOrThrow handles Windows-style git output",
-  async (t) => {
-    sinon
-      .stub(gitUtils as any, "runGitCommand")
-      .resolves("git version 2.40.0.windows.1");
-
-    const version = await gitUtils.getGitVersionOrThrow();
-    // The truncated version should contain just the major.minor.patch portion
-    t.is(version.truncatedVersion, "2.40.0");
-    t.is(version.fullVersion, "2.40.0.windows.1");
-  },
-);
-
-test.serial("getGitVersionOrThrow throws when git command fails", async (t) => {
-  sinon
-    .stub(gitUtils as any, "runGitCommand")
-    .rejects(new Error("git not found"));
-
-  await t.throwsAsync(
-    async () => {
-      await gitUtils.getGitVersionOrThrow();
-    },
-    {
-      instanceOf: Error,
-      message: "git not found",
-    },
-  );
-});
-
-test.serial(
-  "GitVersionInfo.isAtLeast correctly compares versions",
-  async (t) => {
-    const version = new gitUtils.GitVersionInfo("2.40.0", "2.40.0");
-
-    t.true(version.isAtLeast("2.38.0"));
-    t.true(version.isAtLeast("2.40.0"));
-    t.false(version.isAtLeast("2.41.0"));
-    t.false(version.isAtLeast("3.0.0"));
-  },
-);
-
-test.serial("listFiles returns array of file paths", async (t) => {
-  sinon
-    .stub(gitUtils, "runGitCommand")
-    .resolves(["dir/file.txt", "README.txt", ""].join(os.EOL));
-
-  await t.notThrowsAsync(async () => {
-    const result = await gitUtils.listFiles("/some/path");
-    t.is(result.length, 2);
-    t.is(result[0], "dir/file.txt");
-  });
-});
-
-test.serial("getGeneratedFiles returns generated files only", async (t) => {
-  const runGitCommandStub = sinon.stub(gitUtils, "runGitCommand");
-
-  runGitCommandStub
-    .onFirstCall()
-    .resolves(["dir/file.txt", "test.json", "README.txt", ""].join(os.EOL));
-  runGitCommandStub
-    .onSecondCall()
-    .resolves(
-      [
-        "dir/file.txt: linguist-generated: unspecified",
-        "test.json: linguist-generated: true",
-        "README.txt: linguist-generated: false",
-        "",
-      ].join(os.EOL),
-    );
-
-  await t.notThrowsAsync(async () => {
-    const result = await gitUtils.getGeneratedFiles("/some/path");
-
-    t.assert(runGitCommandStub.calledTwice);
-
-    t.is(result.length, 1);
-    t.is(result[0], "test.json");
-  });
-});
diff --git a/src/git-utils.ts b/src/git-utils.ts
deleted file mode 100644
index 0f5bf52a47..0000000000
--- a/src/git-utils.ts
+++ /dev/null
@@ -1,472 +0,0 @@
-import * as fs from "fs";
-import * as os from "os";
-import * as path from "path";
-
-import * as core from "@actions/core";
-import { ExecOptions } from "@actions/exec";
-import * as toolrunner from "@actions/exec/lib/toolrunner";
-import * as io from "@actions/io";
-import * as semver from "semver";
-
-import {
-  getOptionalInput,
-  getWorkflowEvent,
-  getWorkflowEventName,
-} from "./actions-util";
-import { ConfigurationError, getRequiredEnvParam } from "./util";
-
-/**
- * Minimum Git version required for overlay analysis in repositories that
- * contain submodules. Support for using the `git ls-files
- * --recurse-submodules` option with `--stage` was added in Git 2.36.0.
- */
-export const GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES = "2.36.0";
-
-/**
- * Git version information
- *
- * The full version string as reported by `git --version` may not be
- * semver-compatible (e.g., "2.40.0.windows.1"). This class captures both
- * the full version string and a truncated semver-compatible version string
- * (e.g., "2.40.0").
- */
-export class GitVersionInfo {
-  constructor(
-    /** Truncated semver-compatible version */
-    public truncatedVersion: string,
-    /** Full version string as reported by `git --version` */
-    public fullVersion: string,
-  ) {}
-
-  isAtLeast(minVersion: string): boolean {
-    return semver.gte(this.truncatedVersion, minVersion);
-  }
-}
-
-/**
- * Gets the version of Git installed on the system and throws an error if
- * the version cannot be determined.
- */
-export async function getGitVersionOrThrow(): Promise {
-  const stdout = await runGitCommand(
-    undefined,
-    ["--version"],
-    "Failed to get git version.",
-  );
-  // Git version output can vary: "git version 2.40.0" or "git version 2.40.0.windows.1"
-  // We capture just the major.minor.patch portion to ensure semver compatibility.
-  const match = stdout.trim().match(/^git version ((\d+\.\d+\.\d+).*)$/);
-  if (match?.[1] && match?.[2]) {
-    return new GitVersionInfo(match[2], match[1]);
-  }
-  throw new Error(`Could not parse Git version from output: ${stdout.trim()}`);
-}
-
-export const runGitCommand = async function (
-  workingDirectory: string | undefined,
-  args: string[],
-  customErrorMessage: string,
-  options?: ExecOptions,
-): Promise {
-  let stdout = "";
-  let stderr = "";
-  core.debug(`Running git command: git ${args.join(" ")}`);
-  try {
-    await new toolrunner.ToolRunner(await io.which("git", true), args, {
-      silent: true,
-      listeners: {
-        stdout: (data) => {
-          stdout += data.toString();
-        },
-        stderr: (data) => {
-          stderr += data.toString();
-        },
-      },
-      cwd: workingDirectory,
-      ...options,
-    }).exec();
-    return stdout;
-  } catch (error) {
-    let reason = stderr;
-    if (stderr.includes("not a git repository")) {
-      reason =
-        "The checkout path provided to the action does not appear to be a git repository.";
-    }
-    core.info(`git call failed. ${customErrorMessage} Error: ${reason}`);
-    throw error;
-  }
-};
-
-/**
- * Gets the SHA of the commit that is currently checked out.
- */
-export const getCommitOid = async function (
-  checkoutPath: string,
-  ref = "HEAD",
-): Promise {
-  // Try to use git to get the current commit SHA. If that fails then
-  // log but otherwise silently fall back to using the SHA from the environment.
-  // The only time these two values will differ is during analysis of a PR when
-  // the workflow has changed the current commit to the head commit instead of
-  // the merge commit, which must mean that git is available.
-  // Even if this does go wrong, it's not a huge problem for the alerts to
-  // reported on the merge commit.
-  try {
-    const stdout = await runGitCommand(
-      checkoutPath,
-      ["rev-parse", ref],
-      "Continuing with commit SHA from user input or environment.",
-    );
-    return stdout.trim();
-  } catch {
-    return getOptionalInput("sha") || getRequiredEnvParam("GITHUB_SHA");
-  }
-};
-
-/**
- * If the action was triggered by a pull request, determine the commit sha at
- * the head of the base branch, using the merge commit that this workflow analyzes.
- * Returns undefined if run by other triggers or the base branch commit cannot be
- * determined.
- */
-export const determineBaseBranchHeadCommitOid = async function (
-  checkoutPathOverride?: string,
-): Promise {
-  if (getWorkflowEventName() !== "pull_request") {
-    return undefined;
-  }
-
-  const mergeSha = getRequiredEnvParam("GITHUB_SHA");
-  const checkoutPath =
-    checkoutPathOverride ?? getOptionalInput("checkout_path");
-
-  try {
-    let commitOid = "";
-    let baseOid = "";
-    let headOid = "";
-
-    const stdout = await runGitCommand(
-      checkoutPath,
-      ["show", "-s", "--format=raw", mergeSha],
-      "Will calculate the base branch SHA on the server.",
-    );
-
-    for (const data of stdout.split("\n")) {
-      if (data.startsWith("commit ") && commitOid === "") {
-        commitOid = data.substring(7);
-      } else if (data.startsWith("parent ")) {
-        if (baseOid === "") {
-          baseOid = data.substring(7);
-        } else if (headOid === "") {
-          headOid = data.substring(7);
-        }
-      }
-    }
-
-    // Let's confirm our assumptions: We had a merge commit and the parsed parent
-    // data looks correct. OIDs are either 40 (SHA-1) or 64 (SHA-256) hex characters.
-    if (
-      commitOid === mergeSha &&
-      (headOid.length === 40 || headOid.length === 64) &&
-      (baseOid.length === 40 || baseOid.length === 64)
-    ) {
-      return baseOid;
-    }
-    return undefined;
-  } catch {
-    return undefined;
-  }
-};
-
-/**
- * Decode, if necessary, a file path produced by Git. See
- * https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath
- * for details on how Git encodes file paths with special characters.
- *
- * This function works only for Git output with `core.quotePath=false`.
- */
-export const decodeGitFilePath = function (filePath: string): string {
-  if (filePath.startsWith('"') && filePath.endsWith('"')) {
-    filePath = filePath.substring(1, filePath.length - 1);
-    return filePath.replace(
-      /\\([abfnrtv\\"]|[0-7]{1,3})/g,
-      (_match, seq: string) => {
-        switch (seq[0]) {
-          case "a":
-            return "\x07";
-          case "b":
-            return "\b";
-          case "f":
-            return "\f";
-          case "n":
-            return "\n";
-          case "r":
-            return "\r";
-          case "t":
-            return "\t";
-          case "v":
-            return "\v";
-          case "\\":
-            return "\\";
-          case '"':
-            return '"';
-          default:
-            // Both String.fromCharCode() and String.fromCodePoint() works only
-            // for constructing an entire character at once. If a Unicode
-            // character is encoded as a sequence of escaped bytes, calling these
-            // methods sequentially on the individual byte values would *not*
-            // produce the original multi-byte Unicode character. As a result,
-            // this implementation works only with the Git option core.quotePath
-            // set to false.
-            return String.fromCharCode(parseInt(seq, 8));
-        }
-      },
-    );
-  }
-  return filePath;
-};
-
-/**
- * Get the root of the Git repository.
- *
- * @param sourceRoot The source root of the code being analyzed.
- * @returns The root of the Git repository.
- */
-export const getGitRoot = async function (
-  sourceRoot: string,
-): Promise {
-  try {
-    const stdout = await runGitCommand(
-      sourceRoot,
-      ["rev-parse", "--show-toplevel"],
-      `Cannot find Git repository root from the source root ${sourceRoot}.`,
-    );
-    return stdout.trim();
-  } catch {
-    // Errors are already logged by runGitCommand()
-    return undefined;
-  }
-};
-
-/**
- * Returns true if the Git repository has submodules registered (i.e. a
- * `.gitmodules` file exists at the repository root).
- *
- * @param gitRoot The root of the Git repository.
- */
-export function hasSubmodules(gitRoot: string): boolean {
-  return fs.existsSync(path.join(gitRoot, ".gitmodules"));
-}
-
-/**
- * Returns the Git OIDs of all tracked files (in the index and in the working
- * tree) that are under the given base path, including files in active
- * submodules. Untracked files and files not under the given base path are
- * ignored.
- *
- * @param basePath A path into the Git repository.
- * @returns a map from file paths (relative to `basePath`) to Git OIDs.
- * @throws {Error} if "git ls-files" produces unexpected output.
- */
-export const getFileOidsUnderPath = async function (
-  basePath: string,
-): Promise<{ [key: string]: string }> {
-  // Without the --full-name flag, the path is relative to the current working
-  // directory of the git command, which is basePath.
-  //
-  // We use --stage rather than --format here because --format was only
-  // introduced in Git 2.38.0, which would limit overlay rollout.
-  //
-  // We only pass --recurse-submodules when the repository actually has
-  // submodules, because the combination of --recurse-submodules and --stage is
-  // only supported since Git 2.36.0.
-  const gitRoot = await getGitRoot(basePath);
-  const mayHaveSubmodules =
-    gitRoot === undefined ? true : hasSubmodules(gitRoot);
-  const args = mayHaveSubmodules
-    ? ["ls-files", "--recurse-submodules", "--stage"]
-    : ["ls-files", "--stage"];
-  const stdout = await runGitCommand(
-    basePath,
-    args,
-    "Cannot list Git OIDs of tracked files.",
-  );
-
-  const fileOidMap: { [key: string]: string } = {};
-  // With --stage, the output is a list of lines like:
-  // 100644 4c51bc1d9e86cd86e01b0f340cb8ce095c33b283 0\tsrc/git-utils.test.ts
-  // 100644 6b792ea543ce75d7a8a03df591e3c85311ecb64f 0\tsrc/git-utils.ts
-  // The fields are:   \t
-  // The OID is either 40 (SHA-1) or 64 (SHA-256) hex characters.
-  const regex = /^[0-9]+ ([0-9a-f]{40}|[0-9a-f]{64}) [0-9]+\t(.+)$/;
-  for (const line of stdout.split("\n")) {
-    if (line) {
-      const match = line.match(regex);
-      if (match) {
-        const oid = match[1];
-        const filePath = decodeGitFilePath(match[2]);
-        fileOidMap[filePath] = oid;
-      } else {
-        throw new Error(`Unexpected "git ls-files" output: ${line}`);
-      }
-    }
-  }
-  return fileOidMap;
-};
-
-function getRefFromEnv(): string {
-  // To workaround a limitation of Actions dynamic workflows not setting
-  // the GITHUB_REF in some cases, we accept also the ref within the
-  // CODE_SCANNING_REF variable. When possible, however, we prefer to use
-  // the GITHUB_REF as that is a protected variable and cannot be overwritten.
-  let refEnv: string;
-  try {
-    refEnv = getRequiredEnvParam("GITHUB_REF");
-  } catch (e) {
-    // If the GITHUB_REF is not set, we try to rescue by getting the
-    // CODE_SCANNING_REF.
-    const maybeRef = process.env["CODE_SCANNING_REF"];
-    if (maybeRef === undefined || maybeRef.length === 0) {
-      throw e;
-    }
-    refEnv = maybeRef;
-  }
-  return refEnv;
-}
-
-/**
- * Get the ref currently being analyzed.
- */
-export async function getRef(): Promise {
-  // Will be in the form "refs/heads/master" on a push event
-  // or in the form "refs/pull/N/merge" on a pull_request event
-  const refInput = getOptionalInput("ref");
-  const shaInput = getOptionalInput("sha");
-  const checkoutPath =
-    getOptionalInput("checkout_path") ||
-    getOptionalInput("source-root") ||
-    getRequiredEnvParam("GITHUB_WORKSPACE");
-
-  const hasRefInput = !!refInput;
-  const hasShaInput = !!shaInput;
-  // If one of 'ref' or 'sha' are provided, both are required
-  if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) {
-    throw new ConfigurationError(
-      "Both 'ref' and 'sha' are required if one of them is provided.",
-    );
-  }
-
-  const ref = refInput || getRefFromEnv();
-  const sha = shaInput || getRequiredEnvParam("GITHUB_SHA");
-
-  // If the ref is a user-provided input, we have to skip logic
-  // and assume that it is really where they want to upload the results.
-  if (refInput) {
-    return refInput;
-  }
-
-  // For pull request refs we want to detect whether the workflow
-  // has run `git checkout HEAD^2` to analyze the 'head' ref rather
-  // than the 'merge' ref. If so, we want to convert the ref that
-  // we report back.
-  const pull_ref_regex = /refs\/pull\/(\d+)\/merge/;
-  if (!pull_ref_regex.test(ref)) {
-    return ref;
-  }
-
-  const head = await getCommitOid(checkoutPath, "HEAD");
-
-  // in actions/checkout@v2+ we can check if git rev-parse HEAD == GITHUB_SHA
-  // in actions/checkout@v1 this may not be true as it checks out the repository
-  // using GITHUB_REF. There is a subtle race condition where
-  // git rev-parse GITHUB_REF != GITHUB_SHA, so we must check
-  // git rev-parse GITHUB_REF == git rev-parse HEAD instead.
-  const hasChangedRef =
-    sha !== head &&
-    (await getCommitOid(
-      checkoutPath,
-      ref.replace(/^refs\/pull\//, "refs/remotes/pull/"),
-    )) !== head;
-
-  if (hasChangedRef) {
-    const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head");
-    core.debug(
-      `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.`,
-    );
-    return newRef;
-  } else {
-    return ref;
-  }
-}
-
-function removeRefsHeadsPrefix(ref: string): string {
-  return ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref;
-}
-
-/**
- * Returns whether we are analyzing the default branch for the repository.
- *
- * This first checks the environment variable `CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH`. This
- * environment variable can be set in cases where repository information might not be available, for
- * example dynamic workflows.
- */
-export async function isAnalyzingDefaultBranch(): Promise {
-  if (process.env.CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH === "true") {
-    return true;
-  }
-
-  // Get the current ref and trim and refs/heads/ prefix
-  let currentRef = await getRef();
-  currentRef = removeRefsHeadsPrefix(currentRef);
-
-  const event = getWorkflowEvent();
-  let defaultBranch = event?.repository?.default_branch;
-
-  if (getWorkflowEventName() === "schedule") {
-    defaultBranch = removeRefsHeadsPrefix(getRefFromEnv());
-  }
-
-  return currentRef === defaultBranch;
-}
-
-/**
- * Gets a list of all tracked files in the repository.
- *
- * @param workingDirectory The working directory, which is part of a Git repository.
- */
-export async function listFiles(workingDirectory: string): Promise {
-  const stdout = await runGitCommand(
-    workingDirectory,
-    ["ls-files"],
-    "Unable to list tracked files.",
-  );
-  return stdout.split(os.EOL).filter((line) => line.trim().length > 0);
-}
-
-/**
- * Gets a list of files that have the `linguist-generated: true` attribute.
- *
- * @param workingDirectory The working directory, which is part of a Git repository.
- */
-export async function getGeneratedFiles(
-  workingDirectory: string,
-): Promise {
-  const files = await listFiles(workingDirectory);
-  const stdout = await runGitCommand(
-    workingDirectory,
-    ["check-attr", "linguist-generated", "--stdin"],
-    "Unable to check attributes of files.",
-    { input: Buffer.from(files.join(os.EOL)) },
-  );
-
-  const generatedFiles: string[] = [];
-  const regex = /^([^:]+): linguist-generated: true$/;
-  for (const result of stdout.split(os.EOL)) {
-    const match = result.match(regex);
-    if (match && match[1].trim().length > 0) {
-      generatedFiles.push(match[1].trim());
-    }
-  }
-
-  return generatedFiles;
-}
diff --git a/src/init-action-post-helper.test.ts b/src/init-action-post-helper.test.ts
deleted file mode 100644
index f24cc5e4e4..0000000000
--- a/src/init-action-post-helper.test.ts
+++ /dev/null
@@ -1,856 +0,0 @@
-import * as core from "@actions/core";
-import test, { ExecutionContext } from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import { AnalysisKind } from "./analyses";
-import * as apiClient from "./api-client";
-import * as codeql from "./codeql";
-import * as configUtils from "./config-utils";
-import * as debugArtifacts from "./debug-artifacts";
-import { EnvVar } from "./environment";
-import { Feature } from "./feature-flags";
-import * as initActionPostHelper from "./init-action-post-helper";
-import { getRunnerLogger } from "./logging";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import * as overlayStatus from "./overlay/status";
-import { parseRepositoryNwo } from "./repository";
-import {
-  createFeatures,
-  createTestConfig,
-  DEFAULT_ACTIONS_VARS,
-  makeMacro,
-  makeVersionInfo,
-  RecordingLogger,
-  setupActionsVars,
-  setupTests,
-} from "./testing-utils";
-import * as uploadLib from "./upload-lib";
-import * as util from "./util";
-import * as workflow from "./workflow";
-
-const NUM_BYTES_PER_GIB = 1024 * 1024 * 1024;
-
-setupTests(test);
-
-test.serial("init-post action with debug mode off", async (t) => {
-  return await util.withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-
-    const gitHubVersion: util.GitHubVersion = {
-      type: util.GitHubVariant.DOTCOM,
-    };
-    sinon.stub(configUtils, "getConfig").resolves(
-      createTestConfig({
-        debugMode: false,
-        gitHubVersion,
-        languages: [],
-      }),
-    );
-
-    const uploadAllAvailableDebugArtifactsSpy = sinon.spy();
-    const printDebugLogsSpy = sinon.spy();
-
-    await initActionPostHelper.uploadFailureInfo(
-      uploadAllAvailableDebugArtifactsSpy,
-      printDebugLogsSpy,
-      codeql.createStubCodeQL({}),
-      createTestConfig({ debugMode: false }),
-      parseRepositoryNwo("github/codeql-action"),
-      createFeatures([]),
-      getRunnerLogger(true),
-    );
-
-    t.assert(uploadAllAvailableDebugArtifactsSpy.notCalled);
-    t.assert(printDebugLogsSpy.notCalled);
-  });
-});
-
-test.serial("init-post action with debug mode on", async (t) => {
-  return await util.withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-
-    const uploadAllAvailableDebugArtifactsSpy = sinon.spy();
-    const printDebugLogsSpy = sinon.spy();
-
-    await initActionPostHelper.uploadFailureInfo(
-      uploadAllAvailableDebugArtifactsSpy,
-      printDebugLogsSpy,
-      codeql.createStubCodeQL({}),
-      createTestConfig({ debugMode: true }),
-      parseRepositoryNwo("github/codeql-action"),
-      createFeatures([]),
-      getRunnerLogger(true),
-    );
-
-    t.assert(uploadAllAvailableDebugArtifactsSpy.called);
-    t.assert(printDebugLogsSpy.called);
-  });
-});
-
-test.serial(
-  "uploads failed SARIF run with `diagnostics export` if feature flag is off",
-  async (t) => {
-    const actionsWorkflow = createTestWorkflow([
-      {
-        name: "Checkout repository",
-        uses: "actions/checkout@v5",
-      },
-      {
-        name: "Initialize CodeQL",
-        uses: "github/codeql-action/init@v4",
-        with: {
-          languages: "javascript",
-        },
-      },
-      {
-        name: "Perform CodeQL Analysis",
-        uses: "github/codeql-action/analyze@v4",
-        with: {
-          category: "my-category",
-        },
-      },
-    ]);
-    await testFailedSarifUpload(t, actionsWorkflow, {
-      category: "my-category",
-    });
-  },
-);
-
-test.serial(
-  "uploads failed SARIF run with `diagnostics export` if the database doesn't exist",
-  async (t) => {
-    const actionsWorkflow = createTestWorkflow([
-      {
-        name: "Checkout repository",
-        uses: "actions/checkout@v5",
-      },
-      {
-        name: "Initialize CodeQL",
-        uses: "github/codeql-action/init@v4",
-        with: {
-          languages: "javascript",
-        },
-      },
-      {
-        name: "Perform CodeQL Analysis",
-        uses: "github/codeql-action/analyze@v4",
-        with: {
-          category: "my-category",
-        },
-      },
-    ]);
-    await testFailedSarifUpload(t, actionsWorkflow, {
-      category: "my-category",
-      databaseExists: false,
-    });
-  },
-);
-
-test.serial(
-  "uploads failed SARIF run with database export-diagnostics if the database exists and feature flag is on",
-  async (t) => {
-    const actionsWorkflow = createTestWorkflow([
-      {
-        name: "Checkout repository",
-        uses: "actions/checkout@v5",
-      },
-      {
-        name: "Initialize CodeQL",
-        uses: "github/codeql-action/init@v4",
-        with: {
-          languages: "javascript",
-        },
-      },
-      {
-        name: "Perform CodeQL Analysis",
-        uses: "github/codeql-action/analyze@v4",
-        with: {
-          category: "my-category",
-        },
-      },
-    ]);
-    await testFailedSarifUpload(t, actionsWorkflow, {
-      category: "my-category",
-      exportDiagnosticsEnabled: true,
-    });
-  },
-);
-
-const UPLOAD_INPUT_TEST_CASES = [
-  {
-    uploadInput: "true",
-    shouldUpload: true,
-  },
-  {
-    uploadInput: "false",
-    shouldUpload: true,
-  },
-  {
-    uploadInput: "always",
-    shouldUpload: true,
-  },
-  {
-    uploadInput: "failure-only",
-    shouldUpload: true,
-  },
-  {
-    uploadInput: "never",
-    shouldUpload: false,
-  },
-  {
-    uploadInput: "unrecognized-value",
-    shouldUpload: true,
-  },
-];
-
-for (const { uploadInput, shouldUpload } of UPLOAD_INPUT_TEST_CASES) {
-  test.serial(
-    `does ${
-      shouldUpload ? "" : "not "
-    }upload failed SARIF run for workflow with upload: ${uploadInput}`,
-    async (t) => {
-      const actionsWorkflow = createTestWorkflow([
-        {
-          name: "Checkout repository",
-          uses: "actions/checkout@v5",
-        },
-        {
-          name: "Initialize CodeQL",
-          uses: "github/codeql-action/init@v4",
-          with: {
-            languages: "javascript",
-          },
-        },
-        {
-          name: "Perform CodeQL Analysis",
-          uses: "github/codeql-action/analyze@v4",
-          with: {
-            category: "my-category",
-            upload: uploadInput,
-          },
-        },
-      ]);
-      const result = await testFailedSarifUpload(t, actionsWorkflow, {
-        category: "my-category",
-        expectUpload: shouldUpload,
-      });
-      if (!shouldUpload) {
-        t.is(
-          result.upload_failed_run_skipped_because,
-          "SARIF upload is disabled",
-        );
-      }
-    },
-  );
-}
-
-test.serial(
-  "uploading failed SARIF run succeeds when workflow uses an input with a matrix var",
-  async (t) => {
-    const actionsWorkflow = createTestWorkflow([
-      {
-        name: "Checkout repository",
-        uses: "actions/checkout@v5",
-      },
-      {
-        name: "Initialize CodeQL",
-        uses: "github/codeql-action/init@v4",
-        with: {
-          languages: "javascript",
-        },
-      },
-      {
-        name: "Perform CodeQL Analysis",
-        uses: "github/codeql-action/analyze@v4",
-        with: {
-          category: "/language:${{ matrix.language }}",
-        },
-      },
-    ]);
-    await testFailedSarifUpload(t, actionsWorkflow, {
-      category: "/language:csharp",
-      matrix: { language: "csharp" },
-    });
-  },
-);
-
-test.serial(
-  "uploading failed SARIF run fails when workflow uses a complex upload input",
-  async (t) => {
-    const actionsWorkflow = createTestWorkflow([
-      {
-        name: "Checkout repository",
-        uses: "actions/checkout@v5",
-      },
-      {
-        name: "Initialize CodeQL",
-        uses: "github/codeql-action/init@v4",
-        with: {
-          languages: "javascript",
-        },
-      },
-      {
-        name: "Perform CodeQL Analysis",
-        uses: "github/codeql-action/analyze@v4",
-        with: {
-          upload: "${{ matrix.language != 'csharp' }}",
-        },
-      },
-    ]);
-    const result = await testFailedSarifUpload(t, actionsWorkflow, {
-      expectUpload: false,
-    });
-    t.is(
-      result.upload_failed_run_error,
-      "Could not get upload input to github/codeql-action/analyze since it contained an " +
-        "unrecognized dynamic value.",
-    );
-  },
-);
-
-test.serial(
-  "uploading failed SARIF run fails when workflow does not reference github/codeql-action",
-  async (t) => {
-    const actionsWorkflow = createTestWorkflow([
-      {
-        name: "Checkout repository",
-        uses: "actions/checkout@v5",
-      },
-    ]);
-    const result = await testFailedSarifUpload(t, actionsWorkflow, {
-      expectUpload: false,
-    });
-    t.is(
-      result.upload_failed_run_error,
-      "Could not get upload input to github/codeql-action/analyze since the analyze job does not " +
-        "call github/codeql-action/analyze.",
-    );
-    t.truthy(result.upload_failed_run_stack_trace);
-  },
-);
-
-test.serial(
-  "not uploading failed SARIF when `code-scanning` is not an enabled analysis kind",
-  async (t) => {
-    const result = await testFailedSarifUpload(t, createTestWorkflow([]), {
-      analysisKinds: [AnalysisKind.CodeQuality],
-      expectUpload: false,
-    });
-    t.is(
-      result.upload_failed_run_skipped_because,
-      "No analysis kind that supports failed SARIF uploads is enabled.",
-    );
-  },
-);
-
-test.serial(
-  "saves overlay status when overlay-base analysis did not complete successfully",
-  async (t) => {
-    return await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      // Ensure analyze did not complete successfully.
-      delete process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY];
-
-      const diskUsage: util.DiskUsage = {
-        numAvailableBytes: 100 * NUM_BYTES_PER_GIB,
-        numTotalBytes: 200 * NUM_BYTES_PER_GIB,
-      };
-      sinon.stub(util, "checkDiskUsage").resolves(diskUsage);
-
-      const saveOverlayStatusStub = sinon
-        .stub(overlayStatus, "saveOverlayStatus")
-        .resolves(true);
-
-      const stubCodeQL = codeql.createStubCodeQL({});
-
-      await initActionPostHelper.uploadFailureInfo(
-        sinon.spy(),
-        sinon.spy(),
-        stubCodeQL,
-        createTestConfig({
-          debugMode: false,
-          languages: ["javascript"],
-          overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-        }),
-        parseRepositoryNwo("github/codeql-action"),
-        createFeatures([Feature.OverlayAnalysisStatusSave]),
-        getRunnerLogger(true),
-      );
-
-      t.true(
-        saveOverlayStatusStub.calledOnce,
-        "saveOverlayStatus should be called exactly once",
-      );
-      t.deepEqual(
-        saveOverlayStatusStub.firstCall.args[0],
-        stubCodeQL,
-        "first arg should be the CodeQL instance",
-      );
-      t.deepEqual(
-        saveOverlayStatusStub.firstCall.args[1],
-        ["javascript"],
-        "second arg should be the languages",
-      );
-      t.deepEqual(
-        saveOverlayStatusStub.firstCall.args[2],
-        diskUsage,
-        "third arg should be the disk usage",
-      );
-      t.deepEqual(
-        saveOverlayStatusStub.firstCall.args[3],
-        {
-          attemptedToBuildOverlayBaseDatabase: true,
-          builtOverlayBaseDatabase: false,
-          job: {
-            checkRunId: undefined,
-            workflowRunId: Number(DEFAULT_ACTIONS_VARS.GITHUB_RUN_ID),
-            workflowRunAttempt: Number(DEFAULT_ACTIONS_VARS.GITHUB_RUN_ATTEMPT),
-            name: DEFAULT_ACTIONS_VARS.GITHUB_JOB,
-          },
-        },
-        "fourth arg should be the overlay status recording an unsuccessful build attempt with job details",
-      );
-    });
-  },
-);
-
-test.serial(
-  "does not save overlay status when OverlayAnalysisStatusSave feature flag is disabled",
-  async (t) => {
-    return await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      // Ensure analyze did not complete successfully.
-      delete process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY];
-
-      sinon.stub(util, "checkDiskUsage").resolves({
-        numAvailableBytes: 100 * NUM_BYTES_PER_GIB,
-        numTotalBytes: 200 * NUM_BYTES_PER_GIB,
-      });
-
-      const saveOverlayStatusStub = sinon
-        .stub(overlayStatus, "saveOverlayStatus")
-        .resolves(true);
-
-      await initActionPostHelper.uploadFailureInfo(
-        sinon.spy(),
-        sinon.spy(),
-        codeql.createStubCodeQL({}),
-        createTestConfig({
-          debugMode: false,
-          languages: ["javascript"],
-          overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-        }),
-        parseRepositoryNwo("github/codeql-action"),
-        createFeatures([]),
-        getRunnerLogger(true),
-      );
-
-      t.true(
-        saveOverlayStatusStub.notCalled,
-        "saveOverlayStatus should not be called when OverlayAnalysisStatusSave feature flag is disabled",
-      );
-    });
-  },
-);
-
-test.serial("does not save overlay status when build successful", async (t) => {
-  return await util.withTmpDir(async (tmpDir) => {
-    setupActionsVars(tmpDir, tmpDir);
-    // Mark analyze as having completed successfully.
-    process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] = "true";
-
-    sinon.stub(util, "checkDiskUsage").resolves({
-      numAvailableBytes: 100 * NUM_BYTES_PER_GIB,
-      numTotalBytes: 200 * NUM_BYTES_PER_GIB,
-    });
-
-    const saveOverlayStatusStub = sinon
-      .stub(overlayStatus, "saveOverlayStatus")
-      .resolves(true);
-
-    await initActionPostHelper.uploadFailureInfo(
-      sinon.spy(),
-      sinon.spy(),
-      codeql.createStubCodeQL({}),
-      createTestConfig({
-        debugMode: false,
-        languages: ["javascript"],
-        overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-      }),
-      parseRepositoryNwo("github/codeql-action"),
-      createFeatures([Feature.OverlayAnalysisStatusSave]),
-      getRunnerLogger(true),
-    );
-
-    t.true(
-      saveOverlayStatusStub.notCalled,
-      "saveOverlayStatus should not be called when build completed successfully",
-    );
-  });
-});
-
-test.serial(
-  "does not save overlay status when overlay not enabled",
-  async (t) => {
-    return await util.withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      delete process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY];
-
-      sinon.stub(util, "checkDiskUsage").resolves({
-        numAvailableBytes: 100 * NUM_BYTES_PER_GIB,
-        numTotalBytes: 200 * NUM_BYTES_PER_GIB,
-      });
-
-      const saveOverlayStatusStub = sinon
-        .stub(overlayStatus, "saveOverlayStatus")
-        .resolves(true);
-
-      await initActionPostHelper.uploadFailureInfo(
-        sinon.spy(),
-        sinon.spy(),
-        codeql.createStubCodeQL({}),
-        createTestConfig({
-          debugMode: false,
-          languages: ["javascript"],
-          overlayDatabaseMode: OverlayDatabaseMode.None,
-        }),
-        parseRepositoryNwo("github/codeql-action"),
-        createFeatures([]),
-        getRunnerLogger(true),
-      );
-
-      t.true(
-        saveOverlayStatusStub.notCalled,
-        "saveOverlayStatus should not be called when overlay is not enabled",
-      );
-    });
-  },
-);
-
-function createTestWorkflow(
-  steps: workflow.WorkflowJobStep[],
-): workflow.Workflow {
-  return {
-    name: "CodeQL",
-    on: {
-      push: {
-        branches: ["main"],
-      },
-      pull_request: {
-        branches: ["main"],
-      },
-    },
-    jobs: {
-      analyze: {
-        name: "CodeQL Analysis",
-        "runs-on": "ubuntu-latest",
-        steps,
-      },
-    },
-  };
-}
-
-async function testFailedSarifUpload(
-  t: ExecutionContext,
-  actionsWorkflow: workflow.Workflow,
-  {
-    category,
-    databaseExists = true,
-    expectUpload = true,
-    exportDiagnosticsEnabled = false,
-    matrix = {},
-    analysisKinds = [AnalysisKind.CodeScanning],
-  }: {
-    category?: string;
-    databaseExists?: boolean;
-    expectUpload?: boolean;
-    exportDiagnosticsEnabled?: boolean;
-    matrix?: { [key: string]: string };
-    analysisKinds?: AnalysisKind[];
-  } = {},
-): Promise {
-  const config = createTestConfig({
-    analysisKinds,
-    codeQLCmd: "codeql",
-    debugMode: true,
-    languages: [],
-  });
-  if (databaseExists) {
-    config.dbLocation = "path/to/database";
-  }
-  process.env["GITHUB_JOB"] = "analyze";
-  process.env["GITHUB_REPOSITORY"] = DEFAULT_ACTIONS_VARS.GITHUB_REPOSITORY;
-  process.env["GITHUB_WORKSPACE"] = "/tmp";
-  sinon
-    .stub(actionsUtil, "getRequiredInput")
-    .withArgs("matrix")
-    .returns(JSON.stringify(matrix));
-
-  const codeqlObject = await codeql.getCodeQLForTesting();
-  sinon.stub(codeql, "getCodeQL").resolves(codeqlObject);
-  sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.17.6"));
-  const databaseExportDiagnosticsStub = sinon.stub(
-    codeqlObject,
-    "databaseExportDiagnostics",
-  );
-  const diagnosticsExportStub = sinon.stub(codeqlObject, "diagnosticsExport");
-
-  sinon.stub(workflow, "getWorkflow").resolves(actionsWorkflow);
-
-  const uploadFiles = sinon.stub(uploadLib, "uploadFiles");
-  uploadFiles.resolves({
-    sarifID: "42",
-    statusReport: { raw_upload_size_bytes: 20, zipped_upload_size_bytes: 10 },
-  });
-  const waitForProcessing = sinon.stub(uploadLib, "waitForProcessing");
-
-  const features = [] as Feature[];
-  if (exportDiagnosticsEnabled) {
-    features.push(Feature.ExportDiagnosticsEnabled);
-  }
-
-  const result = await initActionPostHelper.tryUploadSarifIfRunFailed(
-    config,
-    parseRepositoryNwo("github/codeql-action"),
-    createFeatures(features),
-    getRunnerLogger(true),
-  );
-  if (expectUpload) {
-    t.deepEqual(result, {
-      sarifID: "42",
-      raw_upload_size_bytes: 20,
-      zipped_upload_size_bytes: 10,
-    });
-    if (databaseExists && exportDiagnosticsEnabled) {
-      t.true(
-        databaseExportDiagnosticsStub.calledOnceWith(
-          config.dbLocation,
-          sinon.match.string,
-          category,
-        ),
-        `Actual args were: ${JSON.stringify(databaseExportDiagnosticsStub.args)}`,
-      );
-    } else {
-      t.true(
-        diagnosticsExportStub.calledOnceWith(
-          sinon.match.string,
-          category,
-          config,
-        ),
-        `Actual args were: ${JSON.stringify(diagnosticsExportStub.args)}`,
-      );
-    }
-    t.true(
-      uploadFiles.calledOnceWith(
-        sinon.match.string,
-        sinon.match.string,
-        category,
-        sinon.match.any,
-        sinon.match.any,
-      ),
-      `Actual args were: ${JSON.stringify(uploadFiles.args)}`,
-    );
-    t.true(
-      waitForProcessing.calledOnceWith(sinon.match.any, "42", sinon.match.any, {
-        isUnsuccessfulExecution: true,
-      }),
-    );
-  } else {
-    t.true(diagnosticsExportStub.notCalled);
-    t.true(uploadFiles.notCalled);
-    t.true(waitForProcessing.notCalled);
-  }
-  return result;
-}
-
-const singleLanguageMatrix = JSON.stringify({
-  language: "javascript",
-  category: "/language:javascript",
-  "build-mode": "none",
-  runner: "ubuntu-latest",
-});
-
-async function mockRiskAssessmentEnv(matrix: string) {
-  process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] = "false";
-  process.env["GITHUB_JOB"] = "analyze";
-  process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
-  process.env["GITHUB_WORKSPACE"] =
-    "/home/runner/work/codeql-action-fake-repository/codeql-action-fake-repository";
-
-  sinon
-    .stub(apiClient, "getGitHubVersion")
-    .resolves({ type: util.GitHubVariant.GHES, version: "3.0.0" });
-
-  const codeqlObject = await codeql.getCodeQLForTesting();
-  const databaseExportDiagnostics = sinon
-    .stub(codeqlObject, "databaseExportDiagnostics")
-    .resolves();
-  const diagnosticsExport = sinon
-    .stub(codeqlObject, "diagnosticsExport")
-    .resolves();
-
-  sinon.stub(codeql, "getCodeQL").resolves(codeqlObject);
-
-  sinon.stub(core, "getInput").withArgs("matrix").returns(matrix);
-
-  const uploadArtifact = sinon.stub().resolves();
-  const artifactClient = { uploadArtifact };
-  sinon
-    .stub(debugArtifacts, "getArtifactUploaderClient")
-    .value(() => artifactClient);
-
-  return { uploadArtifact, databaseExportDiagnostics, diagnosticsExport };
-}
-
-test.serial(
-  "tryUploadSarifIfRunFailed - uploads as artifact for risk assessments (diagnosticsExport)",
-  async (t) => {
-    const logger = new RecordingLogger();
-    const { uploadArtifact, databaseExportDiagnostics, diagnosticsExport } =
-      await mockRiskAssessmentEnv(singleLanguageMatrix);
-
-    const config = createTestConfig({
-      analysisKinds: [AnalysisKind.RiskAssessment],
-      codeQLCmd: "codeql-for-testing",
-      languages: ["javascript"],
-    });
-    const features = createFeatures([]);
-
-    const result = await initActionPostHelper.tryUploadSarifIfRunFailed(
-      config,
-      parseRepositoryNwo("github/codeql-action-fake-repository"),
-      features,
-      logger,
-    );
-
-    const expectedName = debugArtifacts.sanitizeArtifactName(
-      `sarif-artifact-${debugArtifacts.getArtifactSuffix(singleLanguageMatrix)}`,
-    );
-    const expectedFilePattern = /codeql-failed-sarif-javascript\.csra\.sarif$/;
-    t.is(result.upload_failed_run_skipped_because, undefined);
-    t.is(result.upload_failed_run_error, undefined);
-    t.is(result.sarifID, expectedName);
-    t.assert(
-      uploadArtifact.calledOnceWith(
-        expectedName,
-        [sinon.match(expectedFilePattern)],
-        sinon.match.string,
-      ),
-    );
-    t.assert(databaseExportDiagnostics.notCalled);
-    t.assert(
-      diagnosticsExport.calledOnceWith(
-        sinon.match(expectedFilePattern),
-        "/language:javascript",
-        config,
-      ),
-    );
-  },
-);
-
-test.serial(
-  "tryUploadSarifIfRunFailed - uploads as artifact for risk assessments (databaseExportDiagnostics)",
-  async (t) => {
-    const logger = new RecordingLogger();
-    const { uploadArtifact, databaseExportDiagnostics, diagnosticsExport } =
-      await mockRiskAssessmentEnv(singleLanguageMatrix);
-
-    const dbLocation = "/some/path";
-    const config = createTestConfig({
-      analysisKinds: [AnalysisKind.RiskAssessment],
-      codeQLCmd: "codeql-for-testing",
-      languages: ["javascript"],
-      dbLocation: "/some/path",
-    });
-    const features = createFeatures([Feature.ExportDiagnosticsEnabled]);
-
-    const result = await initActionPostHelper.tryUploadSarifIfRunFailed(
-      config,
-      parseRepositoryNwo("github/codeql-action-fake-repository"),
-      features,
-      logger,
-    );
-
-    const expectedName = debugArtifacts.sanitizeArtifactName(
-      `sarif-artifact-${debugArtifacts.getArtifactSuffix(singleLanguageMatrix)}`,
-    );
-    const expectedFilePattern = /codeql-failed-sarif-javascript\.csra\.sarif$/;
-    t.is(result.upload_failed_run_skipped_because, undefined);
-    t.is(result.upload_failed_run_error, undefined);
-    t.is(result.sarifID, expectedName);
-    t.assert(
-      uploadArtifact.calledOnceWith(
-        expectedName,
-        [sinon.match(expectedFilePattern)],
-        sinon.match.string,
-      ),
-    );
-    t.assert(diagnosticsExport.notCalled);
-    t.assert(
-      databaseExportDiagnostics.calledOnceWith(
-        dbLocation,
-        sinon.match(expectedFilePattern),
-        "/language:javascript",
-      ),
-    );
-  },
-);
-
-const skippedUploadTest = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    config: Partial,
-    expectedSkippedReason: string,
-  ) => {
-    const logger = new RecordingLogger();
-    const { uploadArtifact, diagnosticsExport } =
-      await mockRiskAssessmentEnv(singleLanguageMatrix);
-    const features = createFeatures([]);
-
-    const result = await initActionPostHelper.tryUploadSarifIfRunFailed(
-      createTestConfig(config),
-      parseRepositoryNwo("github/codeql-action-fake-repository"),
-      features,
-      logger,
-    );
-
-    t.is(result.upload_failed_run_skipped_because, expectedSkippedReason);
-    t.assert(uploadArtifact.notCalled);
-    t.assert(diagnosticsExport.notCalled);
-  },
-
-  title: (providedTitle: string = "") =>
-    `tryUploadSarifIfRunFailed - skips upload ${providedTitle}`,
-});
-
-skippedUploadTest.serial(
-  "without CodeQL command",
-  // No codeQLCmd
-  {
-    analysisKinds: [AnalysisKind.RiskAssessment],
-    languages: ["javascript"],
-  } satisfies Partial,
-  "CodeQL command not found",
-);
-
-skippedUploadTest.serial(
-  "if no language is configured",
-  // No explicit language configuration
-  {
-    analysisKinds: [AnalysisKind.RiskAssessment],
-    codeQLCmd: "codeql-for-testing",
-  } satisfies Partial,
-  "Unexpectedly, the configuration is not for a single language.",
-);
-
-skippedUploadTest.serial(
-  "if multiple languages is configured",
-  // Multiple explicit languages configured
-  {
-    analysisKinds: [AnalysisKind.RiskAssessment],
-    codeQLCmd: "codeql-for-testing",
-    languages: ["javascript", "python"],
-  } satisfies Partial,
-  "Unexpectedly, the configuration is not for a single language.",
-);
diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts
deleted file mode 100644
index 7b7b056a1c..0000000000
--- a/src/init-action-post-helper.ts
+++ /dev/null
@@ -1,554 +0,0 @@
-import * as fs from "fs";
-import path from "path";
-
-import * as github from "@actions/github";
-
-import * as actionsUtil from "./actions-util";
-import { CodeScanning, RiskAssessment } from "./analyses";
-import { getApiClient, getGitHubVersion } from "./api-client";
-import { CodeQL, getCodeQL } from "./codeql";
-import {
-  Config,
-  isCodeScanningEnabled,
-  isRiskAssessmentEnabled,
-} from "./config-utils";
-import {
-  getArtifactSuffix,
-  getArtifactUploaderClient,
-  sanitizeArtifactName,
-} from "./debug-artifacts";
-import * as dependencyCaching from "./dependency-caching";
-import { EnvVar } from "./environment";
-import { Feature, FeatureEnablement } from "./feature-flags";
-import { Logger } from "./logging";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import {
-  createOverlayStatus,
-  OverlayStatus,
-  saveOverlayStatus,
-} from "./overlay/status";
-import { RepositoryNwo, getRepositoryNwo } from "./repository";
-import { JobStatus } from "./status-report";
-import * as uploadLib from "./upload-lib";
-import {
-  checkDiskUsage,
-  delay,
-  Failure,
-  getErrorMessage,
-  getRequiredEnvParam,
-  parseMatrixInput,
-  Result,
-  shouldSkipSarifUpload,
-  Success,
-  wrapError,
-} from "./util";
-import {
-  getCategoryInputOrThrow,
-  getCheckoutPathInputOrThrow,
-  getUploadInputOrThrow,
-  getWorkflow,
-} from "./workflow";
-
-export interface UploadFailedSarifResult extends uploadLib.UploadStatusReport {
-  /** If there was an error while uploading a failed run, this is its message. */
-  upload_failed_run_error?: string;
-  /** If there was an error while uploading a failed run, this is its stack trace. */
-  upload_failed_run_stack_trace?: string;
-  /** Reason why we did not upload a SARIF payload with `executionSuccessful: false`. */
-  upload_failed_run_skipped_because?: string;
-
-  /** The internal ID of SARIF analysis. */
-  sarifID?: string;
-}
-
-export interface JobStatusReport {
-  job_status: JobStatus;
-}
-
-export interface DependencyCachingUsageReport {
-  dependency_caching_usage?: dependencyCaching.DependencyCachingUsageReport;
-}
-
-function createFailedUploadFailedSarifResult(
-  error: unknown,
-): UploadFailedSarifResult {
-  const wrappedError = wrapError(error);
-  return {
-    upload_failed_run_error: wrappedError.message,
-    upload_failed_run_stack_trace: wrappedError.stack,
-  };
-}
-
-/** Records details about a SARIF file that contains information about a failed analysis. */
-interface FailedSarifInfo {
-  sarifFile: string;
-  category: string | undefined;
-  checkoutPath: string;
-}
-
-/**
- * Tries to prepare a SARIF file that contains information about a failed analysis.
- *
- * @returns Either information about the SARIF file that was produced, or a reason why it couldn't be produced.
- */
-async function prepareFailedSarif(
-  logger: Logger,
-  features: FeatureEnablement,
-  config: Config,
-): Promise> {
-  if (!config.codeQLCmd) {
-    return new Failure({
-      upload_failed_run_skipped_because: "CodeQL command not found",
-    });
-  }
-  const jobName = getRequiredEnvParam("GITHUB_JOB");
-  const matrix = parseMatrixInput(actionsUtil.getRequiredInput("matrix"));
-
-  if (shouldSkipSarifUpload()) {
-    return new Failure({
-      upload_failed_run_skipped_because: "SARIF upload is disabled",
-    });
-  }
-
-  if (isRiskAssessmentEnabled(config)) {
-    if (config.languages.length !== 1) {
-      return new Failure({
-        upload_failed_run_skipped_because:
-          "Unexpectedly, the configuration is not for a single language.",
-      });
-    }
-
-    // We can make these assumptions for risk assessments.
-    const language = config.languages[0];
-    const category = `/language:${language}`;
-    const checkoutPath = ".";
-    const result = await generateFailedSarif(
-      logger,
-      features,
-      config,
-      category,
-      checkoutPath,
-      `../codeql-failed-sarif-${language}${RiskAssessment.sarifExtension}`,
-    );
-    return new Success(result);
-  } else {
-    const workflow = await getWorkflow(logger);
-    const shouldUpload = getUploadInputOrThrow(workflow, jobName, matrix);
-    if (
-      !["always", "failure-only"].includes(
-        actionsUtil.getUploadValue(shouldUpload),
-      )
-    ) {
-      return new Failure({
-        upload_failed_run_skipped_because: "SARIF upload is disabled",
-      });
-    }
-    const category = getCategoryInputOrThrow(workflow, jobName, matrix);
-    const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix);
-
-    const result = await generateFailedSarif(
-      logger,
-      features,
-      config,
-      category,
-      checkoutPath,
-    );
-    return new Success(result);
-  }
-}
-
-async function generateFailedSarif(
-  logger: Logger,
-  features: FeatureEnablement,
-  config: Config,
-  category: string | undefined,
-  checkoutPath: string,
-  sarifFile?: string,
-) {
-  const databasePath = config.dbLocation;
-  const codeql = await getCodeQL(logger, config.codeQLCmd);
-
-  // Set the filename for the SARIF file if not already set.
-  if (sarifFile === undefined) {
-    sarifFile = "../codeql-failed-run.sarif";
-  }
-
-  // If there is no database or the feature flag is off, we run 'export diagnostics'
-  if (
-    databasePath === undefined ||
-    !(await features.getValue(Feature.ExportDiagnosticsEnabled, codeql))
-  ) {
-    await codeql.diagnosticsExport(sarifFile, category, config);
-  } else {
-    // We call 'database export-diagnostics' to find any per-database diagnostics.
-    await codeql.databaseExportDiagnostics(databasePath, sarifFile, category);
-  }
-
-  return { sarifFile, category, checkoutPath };
-}
-
-/**
- * Upload a failed SARIF file if we can verify that SARIF upload is enabled and determine the SARIF
- * category for the workflow.
- */
-async function maybeUploadFailedSarif(
-  config: Config,
-  repositoryNwo: RepositoryNwo,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  const failedSarifResult = await prepareFailedSarif(logger, features, config);
-
-  if (failedSarifResult.isFailure()) {
-    return failedSarifResult.value;
-  }
-
-  const failedSarif = failedSarifResult.value;
-
-  logger.info(`Uploading failed SARIF file ${failedSarif.sarifFile}`);
-  const uploadResult = await uploadLib.uploadFiles(
-    failedSarif.sarifFile,
-    failedSarif.checkoutPath,
-    failedSarif.category,
-    features,
-    logger,
-    CodeScanning,
-  );
-  await uploadLib.waitForProcessing(
-    repositoryNwo,
-    uploadResult.sarifID,
-    logger,
-    { isUnsuccessfulExecution: true },
-  );
-  return uploadResult
-    ? { ...uploadResult.statusReport, sarifID: uploadResult.sarifID }
-    : {};
-}
-
-/** Uploads a failed SARIF file as workflow artifact, if it can be generated. */
-async function maybeUploadFailedSarifArtifact(
-  config: Config,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  const failedSarifResult = await prepareFailedSarif(logger, features, config);
-
-  if (failedSarifResult.isFailure()) {
-    return failedSarifResult.value;
-  }
-
-  const failedSarif = failedSarifResult.value;
-
-  logger.info(
-    `Uploading failed SARIF file ${failedSarif.sarifFile} as artifact`,
-  );
-
-  const gitHubVersion = await getGitHubVersion();
-  const client = await getArtifactUploaderClient(logger, gitHubVersion.type);
-
-  const suffix = getArtifactSuffix(actionsUtil.getOptionalInput("matrix"));
-  const name = sanitizeArtifactName(`sarif-artifact-${suffix}`);
-  await client.uploadArtifact(
-    name,
-    [path.normalize(failedSarif.sarifFile)],
-    path.normalize(".."),
-  );
-
-  return { sarifID: name };
-}
-
-/**
- * Tries to upload a SARIF file with information about the run, if it failed.
- *
- * @param config The CodeQL Action configuration.
- * @param repositoryNwo The name and owner of the repository.
- * @param features Information about enabled features.
- * @param logger The logger to use.
- * @returns The results of uploading the SARIF file for the failure.
- */
-export async function tryUploadSarifIfRunFailed(
-  config: Config,
-  repositoryNwo: RepositoryNwo,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  // There's nothing to do here if the analysis succeeded.
-  if (process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] === "true") {
-    return {
-      upload_failed_run_skipped_because:
-        "Analyze Action completed successfully",
-    };
-  }
-
-  try {
-    // Only upload the failed SARIF to Code scanning if Code scanning is enabled.
-    if (isCodeScanningEnabled(config)) {
-      return await maybeUploadFailedSarif(
-        config,
-        repositoryNwo,
-        features,
-        logger,
-      );
-    } else if (isRiskAssessmentEnabled(config)) {
-      return await maybeUploadFailedSarifArtifact(config, features, logger);
-    } else {
-      return {
-        upload_failed_run_skipped_because:
-          "No analysis kind that supports failed SARIF uploads is enabled.",
-      };
-    }
-  } catch (e) {
-    logger.debug(
-      `Failed to upload a SARIF file for this failed CodeQL code scanning run. ${e}`,
-    );
-    return createFailedUploadFailedSarifResult(e);
-  }
-}
-
-/**
- * Handles the majority of the `post-init` step logic which, depending on the configuration,
- * mainly involves uploading a SARIF file with information about the failed run, debug
- * artifacts, and performing clean-up operations.
- *
- * @param uploadAllAvailableDebugArtifacts A function with which to upload debug artifacts.
- * @param printDebugLogs A function with which to print debug logs.
- * @param codeql The CodeQL CLI instance.
- * @param config The CodeQL Action configuration.
- * @param repositoryNwo The name and owner of the repository.
- * @param features Information about enabled features.
- * @param logger The logger to use.
- * @returns The results of uploading the SARIF file for the failure.
- */
-export async function uploadFailureInfo(
-  uploadAllAvailableDebugArtifacts: (
-    codeql: CodeQL,
-    config: Config,
-    logger: Logger,
-    codeQlVersion: string,
-  ) => Promise,
-  printDebugLogs: (config: Config) => Promise,
-  codeql: CodeQL,
-  config: Config,
-  repositoryNwo: RepositoryNwo,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  await recordOverlayStatus(codeql, config, features, logger);
-
-  const uploadFailedSarifResult = await tryUploadSarifIfRunFailed(
-    config,
-    repositoryNwo,
-    features,
-    logger,
-  );
-
-  if (uploadFailedSarifResult.upload_failed_run_skipped_because) {
-    logger.debug(
-      "Won't upload a failed SARIF file for this CodeQL analysis because: " +
-        `${uploadFailedSarifResult.upload_failed_run_skipped_because}.`,
-    );
-  }
-  // Throw an error if in integration tests, we expected to upload a SARIF file for a failed run
-  // but we didn't upload anything.
-  if (
-    process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" &&
-    !uploadFailedSarifResult.raw_upload_size_bytes
-  ) {
-    const error = JSON.stringify(uploadFailedSarifResult);
-    throw new Error(
-      "Expected to upload a failed SARIF file for this CodeQL code scanning run, " +
-        `but the result was instead ${error}.`,
-    );
-  }
-
-  if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
-    if (!github.context.payload.pull_request?.head.repo.fork) {
-      await removeUploadedSarif(uploadFailedSarifResult, logger);
-    } else {
-      logger.info(
-        "Skipping deletion of failed SARIF because the workflow was triggered from a fork of " +
-          "codeql-action and doesn't have the appropriate permissions for deletion.",
-      );
-    }
-  }
-
-  // Upload appropriate Actions artifacts for debugging
-  if (config.debugMode) {
-    logger.info(
-      "Debug mode is on. Uploading available database bundles and logs as Actions debugging artifacts...",
-    );
-    const version = await codeql.getVersion();
-    await uploadAllAvailableDebugArtifacts(
-      codeql,
-      config,
-      logger,
-      version.version,
-    );
-    await printDebugLogs(config);
-  }
-
-  if (actionsUtil.isSelfHostedRunner()) {
-    try {
-      fs.rmSync(config.dbLocation, {
-        recursive: true,
-        force: true,
-        maxRetries: 3,
-      });
-      logger.info(
-        `Cleaned up database cluster directory ${config.dbLocation}.`,
-      );
-    } catch (e) {
-      logger.warning(
-        `Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`,
-      );
-    }
-  } else {
-    logger.debug(
-      "Skipping cleanup of database cluster directory since we are running on a GitHub-hosted " +
-        "runner which will be automatically cleaned up.",
-    );
-  }
-
-  return uploadFailedSarifResult;
-}
-
-/**
- * If overlay base database creation was attempted but the analysis did not complete
- * successfully, save the failure status to the Actions cache so that subsequent runs
- * can skip overlay analysis until something changes (e.g. a new CodeQL version).
- */
-async function recordOverlayStatus(
-  codeql: CodeQL,
-  config: Config,
-  features: FeatureEnablement,
-  logger: Logger,
-) {
-  if (
-    config.overlayDatabaseMode !== OverlayDatabaseMode.OverlayBase ||
-    process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] === "true" ||
-    !(await features.getValue(Feature.OverlayAnalysisStatusSave))
-  ) {
-    return;
-  }
-
-  const checkRunIdInput = actionsUtil.getOptionalInput("check-run-id");
-  const checkRunId =
-    checkRunIdInput !== undefined ? parseInt(checkRunIdInput, 10) : undefined;
-
-  const overlayStatus: OverlayStatus = createOverlayStatus(
-    {
-      attemptedToBuildOverlayBaseDatabase: true,
-      builtOverlayBaseDatabase: false,
-    },
-    checkRunId !== undefined && checkRunId >= 0 ? checkRunId : undefined,
-  );
-
-  const diskUsage = await checkDiskUsage(logger);
-  if (diskUsage === undefined) {
-    logger.warning(
-      "Unable to save overlay status to the Actions cache because the available disk space could not be determined.",
-    );
-    return;
-  }
-
-  const saved = await saveOverlayStatus(
-    codeql,
-    config.languages,
-    diskUsage,
-    overlayStatus,
-    logger,
-  );
-
-  const blurb =
-    "This job attempted to run with improved incremental analysis but it did not complete successfully. " +
-    "One possible reason for this is disk space constraints, since improved incremental analysis can " +
-    "require a significant amount of disk space for some repositories.";
-
-  if (saved) {
-    logger.error(
-      `${blurb} ` +
-        "This failure has been recorded in the Actions cache, so the next CodeQL analysis will run " +
-        "without improved incremental analysis. If you want to enable improved incremental analysis, " +
-        "try increasing the disk space available to the runner. " +
-        "If that doesn't help, contact GitHub Support for further assistance.",
-    );
-  } else {
-    logger.error(
-      `${blurb} ` +
-        "The attempt to save this failure status to the Actions cache failed. The Action will attempt to " +
-        "run with improved incremental analysis again.",
-    );
-  }
-}
-
-async function removeUploadedSarif(
-  uploadFailedSarifResult: UploadFailedSarifResult,
-  logger: Logger,
-) {
-  const sarifID = uploadFailedSarifResult.sarifID;
-  if (sarifID) {
-    logger.startGroup("Deleting failed SARIF upload");
-    logger.info(
-      `In test mode, therefore deleting the failed analysis to avoid impacting tool status for the Action repository. SARIF ID to delete: ${sarifID}.`,
-    );
-    const client = getApiClient();
-
-    try {
-      const repositoryNwo = getRepositoryNwo();
-
-      // Wait to make sure the analysis is ready for download before requesting it.
-      await delay(5000);
-
-      // Get the analysis associated with the uploaded sarif
-      const analysisInfo = await client.request(
-        "GET /repos/:owner/:repo/code-scanning/analyses?sarif_id=:sarif_id",
-        {
-          owner: repositoryNwo.owner,
-          repo: repositoryNwo.repo,
-          sarif_id: sarifID,
-        },
-      );
-
-      // Delete the analysis.
-      if (analysisInfo.data.length === 1) {
-        const analysis = analysisInfo.data[0];
-        logger.info(`Analysis ID to delete: ${analysis.id}.`);
-        try {
-          await client.request(
-            "DELETE /repos/:owner/:repo/code-scanning/analyses/:analysis_id?confirm_delete",
-            {
-              owner: repositoryNwo.owner,
-              repo: repositoryNwo.repo,
-              analysis_id: analysis.id,
-            },
-          );
-          logger.info(`Analysis deleted.`);
-        } catch (e) {
-          const origMessage = getErrorMessage(e);
-          const newMessage = origMessage.includes(
-            "No analysis found for analysis ID",
-          )
-            ? `Analysis ${analysis.id} does not exist. It was likely already deleted.`
-            : origMessage;
-          throw new Error(newMessage);
-        }
-      } else {
-        throw new Error(
-          `Expected to find exactly one analysis with sarif_id ${sarifID}. Found ${analysisInfo.data.length}.`,
-        );
-      }
-    } catch (e) {
-      throw new Error(
-        `Failed to delete uploaded SARIF analysis. Reason: ${getErrorMessage(
-          e,
-        )}`,
-      );
-    } finally {
-      logger.endGroup();
-    }
-  } else {
-    logger.warning(
-      "Could not delete the uploaded SARIF analysis because a SARIF ID wasn't provided by the API when uploading the SARIF file.",
-    );
-  }
-}
diff --git a/src/init-action-post.ts b/src/init-action-post.ts
deleted file mode 100644
index 2261b56ea6..0000000000
--- a/src/init-action-post.ts
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * This file is the entry point for the `post:` hook of `init-action.yml`.
- * It will run after the all steps in this job, in reverse order in relation to
- * other `post:` hooks.
- */
-
-import * as core from "@actions/core";
-
-import {
-  restoreInputs,
-  getTemporaryDirectory,
-  printDebugLogs,
-} from "./actions-util";
-import { getGitHubVersion } from "./api-client";
-import { CachingKind } from "./caching-utils";
-import { getCodeQL } from "./codeql";
-import { type Config, getConfig } from "./config-utils";
-import * as debugArtifacts from "./debug-artifacts";
-import {
-  DependencyCachingUsageReport,
-  getDependencyCacheUsage,
-} from "./dependency-caching";
-import { EnvVar } from "./environment";
-import { initFeatures } from "./feature-flags";
-import * as gitUtils from "./git-utils";
-import * as initActionPostHelper from "./init-action-post-helper";
-import { getActionsLogger } from "./logging";
-import { getRepositoryNwo } from "./repository";
-import {
-  StatusReportBase,
-  sendStatusReport,
-  sendUnhandledErrorStatusReport,
-  createStatusReportBase,
-  getActionsStatus,
-  ActionName,
-  getJobStatusDisplayName,
-  JobStatus,
-} from "./status-report";
-import { checkDiskUsage, checkGitHubVersionInRange, wrapError } from "./util";
-
-interface InitPostStatusReport
-  extends StatusReportBase,
-    initActionPostHelper.UploadFailedSarifResult,
-    initActionPostHelper.JobStatusReport,
-    initActionPostHelper.DependencyCachingUsageReport {}
-
-async function run(startedAt: Date) {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-
-  const logger = getActionsLogger();
-  let config: Config | undefined;
-  let uploadFailedSarifResult:
-    | initActionPostHelper.UploadFailedSarifResult
-    | undefined;
-  let dependencyCachingUsage: DependencyCachingUsageReport | undefined;
-  try {
-    // Restore inputs from `init` Action.
-    restoreInputs();
-
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-
-    const repositoryNwo = getRepositoryNwo();
-    const features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger,
-    );
-
-    config = await getConfig(getTemporaryDirectory(), logger);
-    if (config === undefined) {
-      logger.warning(
-        "Debugging artifacts are unavailable since the 'init' Action failed before it could produce any.",
-      );
-    } else {
-      const codeql = await getCodeQL(logger, config.codeQLCmd);
-
-      uploadFailedSarifResult = await initActionPostHelper.uploadFailureInfo(
-        debugArtifacts.tryUploadAllAvailableDebugArtifacts,
-        printDebugLogs,
-        codeql,
-        config,
-        repositoryNwo,
-        features,
-        logger,
-      );
-
-      // If we are analyzing the default branch and some kind of caching is enabled,
-      // then try to determine our overall cache usage for dependency caches. We only
-      // do this under these circumstances to avoid slowing down analyses for PRs
-      // and where caching may not be enabled.
-      if (
-        (await gitUtils.isAnalyzingDefaultBranch()) &&
-        config.dependencyCachingEnabled !== CachingKind.None
-      ) {
-        dependencyCachingUsage = await getDependencyCacheUsage(logger);
-      }
-    }
-  } catch (unwrappedError) {
-    const error = wrapError(unwrappedError);
-    core.setFailed(error.message);
-
-    const statusReportBase = await createStatusReportBase(
-      ActionName.InitPost,
-      getActionsStatus(error),
-      startedAt,
-      config,
-      await checkDiskUsage(logger),
-      logger,
-      error.message,
-      error.stack,
-    );
-    if (statusReportBase !== undefined) {
-      await sendStatusReport(statusReportBase);
-    }
-    return;
-  }
-  const jobStatus = getFinalJobStatus(config);
-  logger.info(`CodeQL job status was ${getJobStatusDisplayName(jobStatus)}.`);
-
-  const statusReportBase = await createStatusReportBase(
-    ActionName.InitPost,
-    "success",
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger,
-  );
-  if (statusReportBase !== undefined) {
-    const statusReport: InitPostStatusReport = {
-      ...statusReportBase,
-      ...uploadFailedSarifResult,
-      job_status: jobStatus,
-      dependency_caching_usage: dependencyCachingUsage,
-    };
-    logger.info("Sending status report for init-post step.");
-    await sendStatusReport(statusReport);
-    logger.info("Status report sent for init-post step.");
-  }
-}
-
-/**
- * Determine the final job status to be reported in the status report.
- *
- * If the job status has already been set by another step, we use that.
- * Otherwise, we determine the job status based on whether the analyze step
- * completed successfully and whether we have a valid CodeQL config.
- */
-function getFinalJobStatus(config: Config | undefined): JobStatus {
-  const existingJobStatus = getJobStatusFromEnvironment();
-  if (existingJobStatus !== undefined) {
-    return existingJobStatus;
-  }
-
-  let jobStatus: JobStatus;
-
-  if (process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] === "true") {
-    core.exportVariable(EnvVar.JOB_STATUS, JobStatus.SuccessStatus);
-    jobStatus = JobStatus.SuccessStatus;
-  } else if (config !== undefined) {
-    // - We have computed a CodeQL config
-    // - Analyze didn't complete successfully
-    // - The job status hasn't already been set to Failure/ConfigurationError
-    //
-    // This means that something along the way failed in a step that is not
-    // owned by the Action, for example a manual build step. We consider this a
-    // configuration error.
-    jobStatus = JobStatus.ConfigErrorStatus;
-  } else {
-    // If we didn't manage to compute a CodeQL config, it is unclear at this
-    // point why the analyze Action didn't complete.
-    // - One possibility is that the workflow run was cancelled. We could
-    //   consider determining workflow cancellation using the GitHub API, but
-    //   for now we treat all these cases as unknown.
-    // - Another possibility is that we're running a workflow that only runs
-    //   `init`, for instance a workflow that was created before `setup-codeql`
-    //   was available and uses `init` just to set up the CodeQL tools.
-    jobStatus = JobStatus.UnknownStatus;
-  }
-
-  // This shouldn't be necessary, but in the odd case that we run more than one
-  // `init` post step, ensure the job status is consistent between them.
-  core.exportVariable(EnvVar.JOB_STATUS, jobStatus);
-  return jobStatus;
-}
-
-/**
- * Get the job status from the environment variable, if it has been set.
- *
- * If the job status is invalid, return `UnknownStatus`.
- */
-function getJobStatusFromEnvironment(): JobStatus | undefined {
-  const jobStatusFromEnvironment = process.env[EnvVar.JOB_STATUS];
-
-  if (jobStatusFromEnvironment !== undefined) {
-    // Validate the job status from the environment. If it is invalid, return unknown.
-    if (
-      Object.values(JobStatus).includes(jobStatusFromEnvironment as JobStatus)
-    ) {
-      return jobStatusFromEnvironment as JobStatus;
-    }
-    return JobStatus.UnknownStatus;
-  }
-
-  return undefined;
-}
-
-export async function runWrapper() {
-  const startedAt = new Date();
-  const logger = getActionsLogger();
-  try {
-    await run(startedAt);
-  } catch (error) {
-    core.setFailed(`init post action failed: ${wrapError(error).message}`);
-    await sendUnhandledErrorStatusReport(
-      ActionName.InitPost,
-      startedAt,
-      error,
-      logger,
-    );
-  }
-}
diff --git a/src/init-action.ts b/src/init-action.ts
deleted file mode 100644
index 6b5ed392ef..0000000000
--- a/src/init-action.ts
+++ /dev/null
@@ -1,800 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as core from "@actions/core";
-import * as io from "@actions/io";
-import * as semver from "semver";
-
-import { Action, ActionState, runInActions } from "./action-common";
-import {
-  FileCmdNotFoundError,
-  getActionVersion,
-  getFileType,
-  getOptionalInput,
-  getRequiredInput,
-  getTemporaryDirectory,
-  persistInputs,
-} from "./actions-util";
-import { AnalysisKind, getAnalysisKinds } from "./analyses";
-import { getGitHubVersion, GitHubApiCombinedDetails } from "./api-client";
-import {
-  getDependencyCachingEnabled,
-  getTotalCacheSize,
-  shouldRestoreCache,
-} from "./caching-utils";
-import { CodeQL } from "./codeql";
-import { getConfigFileInput } from "./config/file";
-import { ComputedInput, getToolsInput } from "./config/inputs";
-import * as configUtils from "./config-utils";
-import {
-  DependencyCacheRestoreStatusReport,
-  downloadDependencyCaches,
-} from "./dependency-caching";
-import {
-  addDiagnostic,
-  addNoLanguageDiagnostic,
-  flushDiagnostics,
-  logUnwrittenDiagnostics,
-  makeDiagnostic,
-  makeTelemetryDiagnostic,
-} from "./diagnostics";
-import { EnvVar } from "./environment";
-import { Feature, FeatureEnablement, initFeatures } from "./feature-flags";
-import { loadRepositoryProperties } from "./feature-flags/properties";
-import {
-  checkInstallPython311,
-  checkPacksForOverlayCompatibility,
-  cleanupDatabaseClusterDirectory,
-  getFileCoverageInformationEnabled,
-  logFileCoverageOnPrsDeprecationWarning,
-  initCodeQL,
-  initConfig,
-  runDatabaseInitCluster,
-} from "./init";
-import { JavaEnvVars, BuiltInLanguage } from "./languages";
-import { Logger, withGroupAsync } from "./logging";
-import {
-  downloadOverlayBaseDatabaseFromCache,
-  OverlayBaseDatabaseDownloadStats,
-} from "./overlay/caching";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import { getRepositoryNwo } from "./repository";
-import { ToolsSource } from "./setup-codeql";
-import {
-  ActionName,
-  InitStatusReport,
-  InitToolsDownloadFields,
-  InitWithConfigStatusReport,
-  createInitWithConfigStatusReport,
-  createStatusReportBase,
-  getActionsStatus,
-  sendStatusReport,
-} from "./status-report";
-import { ToolsDownloadStatusReport } from "./tools-download";
-import { ToolsFeature } from "./tools-features";
-import { getCombinedTracerConfig } from "./tracer-config";
-import {
-  checkDiskUsage,
-  checkForTimeout,
-  checkGitHubVersionInRange,
-  codeQlVersionAtLeast,
-  DEFAULT_DEBUG_ARTIFACT_NAME,
-  DEFAULT_DEBUG_DATABASE_NAME,
-  getCodeQLMemoryLimit,
-  getRequiredEnvParam,
-  getThreadsFlagValue,
-  initializeEnvironment,
-  ConfigurationError,
-  wrapError,
-  checkActionVersion,
-  getErrorMessage,
-  BuildMode,
-  getOptionalEnvVar,
-} from "./util";
-import { checkWorkflow } from "./workflow";
-
-/**
- * First version of CodeQL where the Java extractor safely supports the option to minimize
- * dependency jars. Note: some earlier versions of the extractor will respond to the corresponding
- * option, but may rewrite jars in ways that lead to extraction errors.
- */
-export const CODEQL_VERSION_JAR_MINIMIZATION = "2.23.0";
-
-/**
- * Sends a status report indicating that the `init` Action is starting.
- *
- * @param startedAt
- * @param config
- * @param logger
- */
-async function sendStartingStatusReport(
-  startedAt: Date,
-  config: Partial | undefined,
-  logger: Logger,
-) {
-  const statusReportBase = await createStatusReportBase(
-    ActionName.Init,
-    "starting",
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger,
-  );
-  if (statusReportBase !== undefined) {
-    await sendStatusReport(statusReportBase);
-  }
-}
-
-async function sendCompletedStatusReport(
-  startedAt: Date,
-  config: configUtils.Config | undefined,
-  configFile: string | undefined,
-  toolsInput: ComputedInput | undefined,
-  toolsDownloadStatusReport: ToolsDownloadStatusReport | undefined,
-  toolsFeatureFlagsValid: boolean | undefined,
-  toolsSource: ToolsSource,
-  toolsVersion: string,
-  overlayBaseDatabaseStats: OverlayBaseDatabaseDownloadStats | undefined,
-  dependencyCachingResults: DependencyCacheRestoreStatusReport | undefined,
-  logger: Logger,
-  error?: Error,
-) {
-  const statusReportBase = await createStatusReportBase(
-    ActionName.Init,
-    getActionsStatus(error),
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger,
-    error?.message,
-    error?.stack,
-  );
-
-  if (statusReportBase === undefined) {
-    return;
-  }
-
-  const workflowLanguages = getOptionalInput("languages");
-
-  const initStatusReport: InitStatusReport = {
-    ...statusReportBase,
-    tools_input: toolsInput?.value || "",
-    tools_resolved_version: toolsVersion,
-    tools_source: toolsSource || ToolsSource.Unknown,
-    workflow_languages: workflowLanguages || "",
-  };
-
-  if (toolsInput !== undefined) {
-    initStatusReport.computed_inputs.tools = toolsInput;
-  }
-
-  const initToolsDownloadFields: InitToolsDownloadFields = {};
-
-  if (toolsDownloadStatusReport?.downloadDurationMs !== undefined) {
-    initToolsDownloadFields.tools_download_duration_ms =
-      toolsDownloadStatusReport.downloadDurationMs;
-  }
-  if (toolsFeatureFlagsValid !== undefined) {
-    initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
-  }
-
-  if (config !== undefined) {
-    // Append fields that are dependent on `config`
-    const initWithConfigStatusReport: InitWithConfigStatusReport =
-      await createInitWithConfigStatusReport(
-        config,
-        initStatusReport,
-        configFile,
-        Math.round(
-          await getTotalCacheSize(Object.values(config.trapCaches), logger),
-        ),
-        overlayBaseDatabaseStats,
-        dependencyCachingResults,
-      );
-    await sendStatusReport({
-      ...initWithConfigStatusReport,
-      ...initToolsDownloadFields,
-    });
-  } else {
-    await sendStatusReport({ ...initStatusReport, ...initToolsDownloadFields });
-  }
-}
-
-async function run(
-  actionState: ActionState<["Base", "Logger", "Env", "Actions"]>,
-) {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-
-  const startedAt = actionState.startedAt;
-  const logger = actionState.logger;
-
-  let apiDetails: GitHubApiCombinedDetails;
-  let config: configUtils.Config | undefined;
-  let configFile: string | undefined;
-  let codeql: CodeQL;
-  let features: FeatureEnablement;
-  let sourceRoot: string;
-  let toolsInput: ComputedInput | undefined;
-  let toolsDownloadStatusReport: ToolsDownloadStatusReport | undefined;
-  let toolsFeatureFlagsValid: boolean | undefined;
-  let toolsSource: ToolsSource;
-  let toolsVersion: string;
-
-  try {
-    initializeEnvironment(getActionVersion());
-
-    // Make inputs accessible in the `post` step.
-    persistInputs();
-
-    apiDetails = {
-      auth: getRequiredInput("token"),
-      externalRepoAuth: getOptionalInput("external-repository-token"),
-      url: getRequiredEnvParam("GITHUB_SERVER_URL"),
-      apiURL: getRequiredEnvParam("GITHUB_API_URL"),
-    };
-
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    checkActionVersion(getActionVersion(), gitHubVersion);
-
-    const repositoryNwo = getRepositoryNwo();
-
-    features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger,
-    );
-
-    // Fetch the values of known repository properties that affect us.
-    const repositoryPropertiesResult = await loadRepositoryProperties(
-      repositoryNwo,
-      logger,
-    );
-    const repositoryProperties = repositoryPropertiesResult.orElse({});
-
-    core.exportVariable(EnvVar.INIT_ACTION_HAS_RUN, "true");
-
-    // path.resolve() respects the intended semantics of source-root. If
-    // source-root is relative, it is relative to the GITHUB_WORKSPACE. If
-    // source-root is absolute, it is used as given.
-    sourceRoot = path.resolve(
-      getRequiredEnvParam("GITHUB_WORKSPACE"),
-      getOptionalInput("source-root") || "",
-    );
-
-    // Parsing the `analysis-kinds` input may throw a `ConfigurationError`, which we don't want before
-    // we have called `sendStartingStatusReport` below. However, we want the analysis kinds for that status
-    // report. To work around this, we ignore exceptions that are thrown here and then call `getAnalysisKinds`
-    // a second time later. The second call will then throw the exception again. If `getAnalysisKinds` is
-    // successful, the results are cached so that we don't duplicate the work in normal runs.
-    let analysisKinds: AnalysisKind[] | undefined;
-    try {
-      analysisKinds = await getAnalysisKinds(logger, features);
-    } catch (err) {
-      logger.debug(
-        `Failed to parse analysis kinds for 'starting' status report: ${getErrorMessage(err)}`,
-      );
-    }
-
-    // Compute the value of the `config-file` input.
-    const actionStateWithFeatures = { ...actionState, features };
-    configFile = await getConfigFileInput(
-      actionStateWithFeatures,
-      repositoryProperties,
-      analysisKinds,
-    );
-
-    // Send a status report indicating that an analysis is starting.
-    await sendStartingStatusReport(startedAt, { analysisKinds }, logger);
-
-    // Throw a `ConfigurationError` if the `setup-codeql` action has been run.
-    if (process.env[EnvVar.SETUP_CODEQL_ACTION_HAS_RUN] === "true") {
-      throw new ConfigurationError(
-        `The 'init' action should not be run in the same workflow as 'setup-codeql'.`,
-      );
-    }
-
-    // Get the computed `tools` input.
-    toolsInput = await getToolsInput(
-      actionStateWithFeatures,
-      repositoryProperties,
-    );
-
-    const codeQLDefaultVersionInfo =
-      await features.getEnabledDefaultCliVersions(gitHubVersion.type);
-    toolsFeatureFlagsValid = codeQLDefaultVersionInfo.toolsFeatureFlagsValid;
-    const rawLanguages = configUtils.getRawLanguagesNoAutodetect(
-      getOptionalInput("languages"),
-    );
-    const useOverlayAwareDefaultCliVersion =
-      analysisKinds?.length === 1 &&
-      analysisKinds[0] === AnalysisKind.CodeScanning;
-    const initCodeQLResult = await initCodeQL(
-      toolsInput?.value,
-      apiDetails,
-      getTemporaryDirectory(),
-      gitHubVersion.type,
-      codeQLDefaultVersionInfo,
-      rawLanguages,
-      useOverlayAwareDefaultCliVersion,
-      features,
-      logger,
-    );
-    codeql = initCodeQLResult.codeql;
-    toolsDownloadStatusReport = initCodeQLResult.toolsDownloadStatusReport;
-    toolsVersion = initCodeQLResult.toolsVersion;
-    toolsSource = initCodeQLResult.toolsSource;
-
-    // Check the workflow for problems. If there are any problems, they are reported
-    // to the workflow log. No exceptions are thrown.
-    await checkWorkflow(logger, codeql);
-
-    // Set CODEQL_ENABLE_EXPERIMENTAL_FEATURES for Rust if between 2.19.3 (included) and 2.22.1 (excluded)
-    // We need to set this environment variable before initializing the config, otherwise Rust
-    // analysis will not be enabled (experimental language packs are only active with that environment
-    // variable set to `true`).
-    if (
-      // Only enable the experimental features env variable for Rust analysis if the user has explicitly
-      // requested rust - don't enable it via language autodetection.
-      configUtils
-        .getRawLanguagesNoAutodetect(getOptionalInput("languages"))
-        .includes(BuiltInLanguage.rust)
-    ) {
-      const experimental = "2.19.3";
-      const publicPreview = "2.22.1";
-      const actualVer = (await codeql.getVersion()).version;
-      if (semver.lt(actualVer, experimental)) {
-        throw new ConfigurationError(
-          `Rust analysis is supported by CodeQL CLI version ${experimental} or higher, but found version ${actualVer}`,
-        );
-      }
-      if (semver.lt(actualVer, publicPreview)) {
-        core.exportVariable(EnvVar.EXPERIMENTAL_FEATURES, "true");
-        logger.info("Experimental Rust analysis enabled");
-      }
-    }
-
-    analysisKinds = await getAnalysisKinds(logger, features);
-    const debugMode = getOptionalInput("debug") === "true" || core.isDebug();
-    const fileCoverageResult = await getFileCoverageInformationEnabled(
-      debugMode,
-      codeql,
-      features,
-      repositoryProperties,
-    );
-
-    config = await initConfig(actionStateWithFeatures, {
-      analysisKinds,
-      languagesInput: getOptionalInput("languages"),
-      queriesInput: getOptionalInput("queries"),
-      packsInput: getOptionalInput("packs"),
-      buildModeInput: getOptionalInput("build-mode"),
-      ramInput: getOptionalInput("ram"),
-      configFile,
-      dbLocation: getOptionalInput("db-location"),
-      configInput: getOptionalInput("config"),
-      dependencyCachingEnabled: getDependencyCachingEnabled(),
-      // Debug mode is enabled if:
-      // - The `init` Action is passed `debug: true`.
-      // - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
-      //   or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
-      debugMode,
-      debugArtifactName:
-        getOptionalInput("debug-artifact-name") || DEFAULT_DEBUG_ARTIFACT_NAME,
-      debugDatabaseName:
-        getOptionalInput("debug-database-name") || DEFAULT_DEBUG_DATABASE_NAME,
-      repository: repositoryNwo,
-      tempDir: getTemporaryDirectory(),
-      codeql,
-      workspacePath: getRequiredEnvParam("GITHUB_WORKSPACE"),
-      sourceRoot,
-      githubVersion: gitHubVersion,
-      apiDetails,
-      features,
-      repositoryProperties,
-      enableFileCoverageInformation: fileCoverageResult.enabled,
-      logger,
-    });
-
-    if (
-      config.languages.includes(BuiltInLanguage.swift) &&
-      process.platform !== "darwin"
-    ) {
-      throw new ConfigurationError(
-        `Swift analysis is only supported on macOS runner images. Please migrate to a macOS runner.`,
-      );
-    }
-
-    if (repositoryPropertiesResult.isFailure()) {
-      addNoLanguageDiagnostic(
-        config,
-        makeTelemetryDiagnostic(
-          "codeql-action/repository-properties-load-failure",
-          "Failed to load repository properties",
-          {
-            error: getErrorMessage(repositoryPropertiesResult.value),
-          },
-        ),
-      );
-    }
-
-    if (fileCoverageResult.enabledByRepositoryProperty) {
-      addNoLanguageDiagnostic(
-        config,
-        makeTelemetryDiagnostic(
-          "codeql-action/file-coverage-on-prs-enabled-by-repository-property",
-          "File coverage on PRs enabled by repository property",
-          {},
-        ),
-      );
-    }
-
-    if (fileCoverageResult.showDeprecationWarning) {
-      logFileCoverageOnPrsDeprecationWarning(logger);
-    }
-
-    await checkInstallPython311(config.languages, codeql);
-  } catch (unwrappedError) {
-    const error = wrapError(unwrappedError);
-    core.setFailed(error.message);
-    const statusReportBase = await createStatusReportBase(
-      ActionName.Init,
-      error instanceof ConfigurationError ? "user-error" : "aborted",
-      startedAt,
-      config,
-      await checkDiskUsage(logger),
-      logger,
-      error.message,
-      error.stack,
-    );
-    if (statusReportBase !== undefined) {
-      await sendStatusReport(statusReportBase);
-    }
-    return;
-  }
-
-  let overlayBaseDatabaseStats: OverlayBaseDatabaseDownloadStats | undefined;
-  let dependencyCachingStatus: DependencyCacheRestoreStatusReport | undefined;
-  try {
-    if (
-      config.overlayDatabaseMode === OverlayDatabaseMode.Overlay &&
-      config.useOverlayDatabaseCaching
-    ) {
-      // OverlayDatabaseMode.Overlay comes in two flavors: with database
-      // caching, or without. The flavor with database caching is intended to be
-      // an "automatic control" mode, which is supposed to be fail-safe. If we
-      // cannot download an overlay-base database, we revert to
-      // OverlayDatabaseMode.None so that the workflow can continue to run.
-      //
-      // The flavor without database caching is intended to be a "manual
-      // control" mode, where the workflow is supposed to make all the
-      // necessary preparations. So, in that mode, we would assume that
-      // everything is in order and let the analysis fail if that turns out not
-      // to be the case.
-      await withGroupAsync(
-        "Checking cache for overlay-base database",
-        async () => {
-          overlayBaseDatabaseStats = await downloadOverlayBaseDatabaseFromCache(
-            codeql,
-            config,
-            logger,
-          );
-          if (!overlayBaseDatabaseStats) {
-            config.overlayDatabaseMode = OverlayDatabaseMode.None;
-            logger.info(
-              "No overlay-base database found in cache, " +
-                `reverting overlay database mode to ${OverlayDatabaseMode.None}.`,
-            );
-          }
-        },
-      );
-    }
-
-    if (config.overlayDatabaseMode !== OverlayDatabaseMode.Overlay) {
-      cleanupDatabaseClusterDirectory(config, logger);
-    }
-
-    // Forward Go flags
-    const goFlags = process.env["GOFLAGS"];
-    if (goFlags) {
-      core.exportVariable("GOFLAGS", goFlags);
-      core.warning(
-        "Passing the GOFLAGS env parameter to the init action is deprecated. Please move this to the analyze action.",
-      );
-    }
-
-    if (
-      config.languages.includes(BuiltInLanguage.go) &&
-      process.platform === "linux"
-    ) {
-      try {
-        const goBinaryPath = await io.which("go", true);
-        const fileOutput = await getFileType(goBinaryPath);
-
-        // Go 1.21 and above ships with statically linked binaries on Linux. CodeQL cannot currently trace custom builds
-        // where the entry point is a statically linked binary. Until that is fixed, we work around the problem by
-        // replacing the `go` binary with a shell script that invokes the actual `go` binary. Since the shell is
-        // typically dynamically linked, this provides a suitable entry point for the CodeQL tracer.
-        if (
-          fileOutput.includes("statically linked") &&
-          !(await codeql.supportsFeature(
-            ToolsFeature.IndirectTracingSupportsStaticBinaries,
-          ))
-        ) {
-          try {
-            logger.debug(`Applying static binary workaround for Go`);
-
-            // Create a directory that we can add to the system PATH.
-            const tempBinPath = path.resolve(
-              getTemporaryDirectory(),
-              "codeql-action-go-tracing",
-              "bin",
-            );
-            fs.mkdirSync(tempBinPath, { recursive: true });
-            core.addPath(tempBinPath);
-
-            // Write the wrapper script to the directory we just added to the PATH.
-            const goWrapperPath = path.resolve(tempBinPath, "go");
-            fs.writeFileSync(
-              goWrapperPath,
-              `#!/bin/bash\n\nexec ${goBinaryPath} "$@"`,
-            );
-            fs.chmodSync(goWrapperPath, "755");
-
-            // Store the original location of our wrapper script somewhere where we can
-            // later retrieve it from and cross-check that it hasn't been changed.
-            core.exportVariable(EnvVar.GO_BINARY_LOCATION, goWrapperPath);
-          } catch (e) {
-            logger.warning(
-              `Analyzing Go on Linux, but failed to install wrapper script. Tracing custom builds may fail: ${e}`,
-            );
-          }
-        } else {
-          // Store the location of the original Go binary, so we can check that no setup tasks were performed after the
-          // `init` Action ran.
-          core.exportVariable(EnvVar.GO_BINARY_LOCATION, goBinaryPath);
-        }
-      } catch (e) {
-        logger.warning(
-          `Failed to determine the location of the Go binary: ${e}`,
-        );
-
-        if (e instanceof FileCmdNotFoundError) {
-          addDiagnostic(
-            config,
-            BuiltInLanguage.go,
-            makeDiagnostic(
-              "go/workflow/file-program-unavailable",
-              "The `file` program is required on Linux, but does not appear to be installed",
-              {
-                markdownMessage:
-                  "CodeQL was unable to find the `file` program on this system. Ensure that the `file` program is installed on Linux runners and accessible.",
-                visibility: {
-                  statusPage: true,
-                  telemetry: true,
-                  cliSummaryTable: true,
-                },
-                severity: "warning",
-              },
-            ),
-          );
-        }
-      }
-    }
-
-    // Limit RAM and threads for extractors. When running extractors, the CodeQL CLI obeys the
-    // CODEQL_RAM and CODEQL_THREADS environment variables to decide how much RAM and how many
-    // threads it would ask extractors to use. See help text for the "--ram" and "--threads"
-    // options at https://codeql.github.com/docs/codeql-cli/manual/database-trace-command/
-    // for details.
-    core.exportVariable(
-      "CODEQL_RAM",
-      process.env["CODEQL_RAM"] ||
-        getCodeQLMemoryLimit(getOptionalInput("ram"), logger).toString(),
-    );
-    core.exportVariable(
-      "CODEQL_THREADS",
-      process.env["CODEQL_THREADS"] ||
-        getThreadsFlagValue(getOptionalInput("threads"), logger).toString(),
-    );
-
-    // Disable Kotlin extractor if feature flag set
-    if (await features.getValue(Feature.DisableKotlinAnalysisEnabled)) {
-      core.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true");
-    }
-
-    // Emergency override to force the CodeQL CLI back to the JGit-based Git backend.
-    if (await features.getValue(Feature.ForceJGit)) {
-      core.exportVariable("CODEQL_GIT_BACKEND", "jgit");
-    }
-
-    const kotlinLimitVar =
-      "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT";
-    if (
-      (await codeQlVersionAtLeast(codeql, "2.20.3")) &&
-      !(await codeQlVersionAtLeast(codeql, "2.20.4"))
-    ) {
-      core.exportVariable(kotlinLimitVar, "2.1.20");
-    }
-
-    // Restore dependency cache(s), if they exist.
-    if (shouldRestoreCache(config.dependencyCachingEnabled)) {
-      const dependencyCachingResult = await downloadDependencyCaches(
-        codeql,
-        features,
-        config.languages,
-        logger,
-      );
-      dependencyCachingStatus = dependencyCachingResult.statusReport;
-      config.dependencyCachingRestoredKeys =
-        dependencyCachingResult.restoredKeys;
-    }
-
-    if (getOptionalInput("setup-python-dependencies") !== undefined) {
-      logger.warning(
-        "The setup-python-dependencies input is deprecated and no longer has any effect. We recommend removing any references from your workflows. See https://github.blog/changelog/2024-01-23-codeql-2-16-python-dependency-installation-disabled-new-queries-and-bug-fixes/ for more information.",
-      );
-    }
-
-    if (
-      process.env["CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION"] !==
-      undefined
-    ) {
-      logger.warning(
-        "The CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION environment variable is deprecated and no longer has any effect. We recommend removing any references from your workflows. See https://github.blog/changelog/2024-01-23-codeql-2-16-python-dependency-installation-disabled-new-queries-and-bug-fixes/ for more information.",
-      );
-    }
-
-    // If we are doing a Java `build-mode: none` analysis, then set the environment variable that
-    // enables the option in the Java extractor to minimize dependency jars. We also only do this if
-    // dependency caching is enabled, since the option is intended to reduce the size of dependency
-    // caches, but the jar-rewriting does have a performance cost that we'd like to avoid when
-    // caching is not being used.
-    // TODO: Remove this language-specific mechanism and replace it with a more general one that
-    // tells extractors when dependency caching is enabled, and then the Java extractor can make its
-    // own decision about whether to rewrite jars.
-    if (process.env[EnvVar.JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS]) {
-      logger.debug(
-        `${EnvVar.JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS} is already set to '${process.env[EnvVar.JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS]}', so the Action will not override it.`,
-      );
-    } else if (
-      (await codeQlVersionAtLeast(codeql, CODEQL_VERSION_JAR_MINIMIZATION)) &&
-      config.dependencyCachingEnabled &&
-      config.buildMode === BuildMode.None &&
-      config.languages.includes(BuiltInLanguage.java)
-    ) {
-      core.exportVariable(
-        EnvVar.JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS,
-        "true",
-      );
-    }
-
-    const { registriesAuthTokens, qlconfigFile } =
-      await configUtils.generateRegistries(
-        getOptionalInput("registries"),
-        config.tempDir,
-        logger,
-      );
-    const databaseInitEnvironment = {
-      GITHUB_TOKEN: apiDetails.auth,
-      CODEQL_REGISTRIES_AUTH: registriesAuthTokens,
-    };
-
-    await runDatabaseInitCluster(
-      databaseInitEnvironment,
-      codeql,
-      config,
-      sourceRoot,
-      "Runner.Worker.exe",
-      qlconfigFile,
-    );
-
-    // To check custom query packs for compatibility with overlay analysis, we
-    // need to first initialize the database cluster, which downloads the
-    // user-specified custom query packs. But we also want to check custom query
-    // pack compatibility first, because database cluster initialization depends
-    // on the overlay database mode. The solution is to initialize the database
-    // cluster first, check custom query pack compatibility, and if we need to
-    // revert to `OverlayDatabaseMode.None`, re-initialize the database cluster
-    // with the new overlay database mode.
-    if (
-      config.overlayDatabaseMode !== OverlayDatabaseMode.None &&
-      !(await checkPacksForOverlayCompatibility(codeql, config, logger))
-    ) {
-      logger.info(
-        "Reverting overlay database mode to None due to incompatible packs.",
-      );
-      config.overlayDatabaseMode = OverlayDatabaseMode.None;
-      cleanupDatabaseClusterDirectory(config, logger, {
-        disableExistingDirectoryWarning: true,
-      });
-      await runDatabaseInitCluster(
-        databaseInitEnvironment,
-        codeql,
-        config,
-        sourceRoot,
-        "Runner.Worker.exe",
-        qlconfigFile,
-      );
-    }
-
-    const tracerConfig = await getCombinedTracerConfig(codeql, config);
-    if (tracerConfig !== undefined) {
-      for (const [key, value] of Object.entries(tracerConfig.env)) {
-        core.exportVariable(key, value);
-      }
-    }
-
-    // Enable Java network debugging if the FF is enabled.
-    if (await features.getValue(Feature.JavaNetworkDebugging)) {
-      // Get the existing value of `JAVA_TOOL_OPTIONS`, if any.
-      const existingJavaToolOptions =
-        getOptionalEnvVar(JavaEnvVars.JAVA_TOOL_OPTIONS) || "";
-
-      // Add the network debugging options.
-      core.exportVariable(
-        JavaEnvVars.JAVA_TOOL_OPTIONS,
-        `${existingJavaToolOptions} -Djavax.net.debug=all`,
-      );
-    }
-
-    // Write diagnostics to the database that we previously stored in memory because the database
-    // did not exist until now.
-    flushDiagnostics(config);
-
-    // We save the config here instead of at the end of `initConfig` because we
-    // may have updated the config returned from `initConfig`, e.g. to revert to
-    // `OverlayDatabaseMode.None` if we failed to download an overlay-base
-    // database.
-    await configUtils.saveConfig(config, logger);
-
-    core.setOutput("codeql-path", config.codeQLCmd);
-    core.setOutput("codeql-version", (await codeql.getVersion()).version);
-  } catch (unwrappedError) {
-    const error = wrapError(unwrappedError);
-    core.setFailed(error.message);
-    await sendCompletedStatusReport(
-      startedAt,
-      config,
-      undefined, // We only report config info on success.
-      toolsInput,
-      toolsDownloadStatusReport,
-      toolsFeatureFlagsValid,
-      toolsSource,
-      toolsVersion,
-      overlayBaseDatabaseStats,
-      dependencyCachingStatus,
-      logger,
-      error,
-    );
-    return;
-  } finally {
-    logUnwrittenDiagnostics();
-  }
-  await sendCompletedStatusReport(
-    startedAt,
-    config,
-    configFile,
-    toolsInput,
-    toolsDownloadStatusReport,
-    toolsFeatureFlagsValid,
-    toolsSource,
-    toolsVersion,
-    overlayBaseDatabaseStats,
-    dependencyCachingStatus,
-    logger,
-  );
-}
-
-/** Defines the `init` Action. */
-const init: Action = {
-  name: ActionName.Init,
-  run,
-};
-
-export async function runWrapper() {
-  await runInActions(init);
-  await checkForTimeout();
-}
diff --git a/src/init.test.ts b/src/init.test.ts
deleted file mode 100644
index 1f0d2c701c..0000000000
--- a/src/init.test.ts
+++ /dev/null
@@ -1,704 +0,0 @@
-import * as fs from "fs";
-import path from "path";
-
-import * as core from "@actions/core";
-import * as github from "@actions/github";
-import test, { ExecutionContext } from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import { createStubCodeQL } from "./codeql";
-import { ActionsEnvVars } from "./environment";
-import { Feature } from "./feature-flags";
-import {
-  checkPacksForOverlayCompatibility,
-  cleanupDatabaseClusterDirectory,
-  getFileCoverageInformationEnabled,
-  logFileCoverageOnPrsDeprecationWarning,
-} from "./init";
-import { BuiltInLanguage } from "./languages";
-import {
-  createFeatures,
-  LoggedMessage,
-  createTestConfig,
-  getRecordingLogger,
-  setupTests,
-  makeMacro,
-} from "./testing-utils";
-import { ConfigurationError, withTmpDir } from "./util";
-
-setupTests(test);
-
-test("cleanupDatabaseClusterDirectory cleans up where possible", async (t) => {
-  await withTmpDir(async (tmpDir: string) => {
-    const dbLocation = path.resolve(tmpDir, "dbs");
-    fs.mkdirSync(dbLocation, { recursive: true });
-
-    const fileToCleanUp = path.resolve(dbLocation, "something-to-cleanup.txt");
-    fs.writeFileSync(fileToCleanUp, "");
-
-    const messages: LoggedMessage[] = [];
-    cleanupDatabaseClusterDirectory(
-      createTestConfig({ dbLocation }),
-      getRecordingLogger(messages),
-    );
-
-    t.is(messages.length, 2);
-    t.is(messages[0].type, "warning");
-    t.is(
-      messages[0].message,
-      `The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`,
-    );
-    t.is(messages[1].type, "info");
-    t.is(
-      messages[1].message,
-      `Cleaned up database cluster directory ${dbLocation}.`,
-    );
-
-    t.false(fs.existsSync(fileToCleanUp));
-  });
-});
-
-for (const { runnerEnv, ErrorConstructor, message } of [
-  {
-    runnerEnv: "self-hosted",
-    ErrorConstructor: ConfigurationError,
-    message: (dbLocation) =>
-      "The CodeQL Action requires an empty database cluster directory. By default, this is located " +
-      `at ${dbLocation}. You can customize it using the 'db-location' input to the init Action. An ` +
-      "attempt was made to clean up the directory, but this failed. This can happen if another " +
-      "process is using the directory or the directory is owned by a different user. Please clean " +
-      "up the directory manually and rerun the job.",
-  },
-  {
-    runnerEnv: "github-hosted",
-    ErrorConstructor: Error,
-    message: (dbLocation) =>
-      "The CodeQL Action requires an empty database cluster directory. By default, this is located " +
-      `at ${dbLocation}. You can customize it using the 'db-location' input to the init Action. An ` +
-      "attempt was made to clean up the directory, but this failed. This shouldn't typically " +
-      "happen on hosted runners. If you are using an advanced setup, please check your workflow, " +
-      "otherwise we recommend rerunning the job.",
-  },
-]) {
-  test.serial(
-    `cleanupDatabaseClusterDirectory throws a ${ErrorConstructor.name} when cleanup fails on ${runnerEnv} runner`,
-    async (t) => {
-      await withTmpDir(async (tmpDir: string) => {
-        process.env[ActionsEnvVars.RUNNER_ENVIRONMENT] = runnerEnv;
-
-        const dbLocation = path.resolve(tmpDir, "dbs");
-        fs.mkdirSync(dbLocation, { recursive: true });
-
-        const fileToCleanUp = path.resolve(
-          dbLocation,
-          "something-to-cleanup.txt",
-        );
-        fs.writeFileSync(fileToCleanUp, "");
-
-        const rmSyncError = `Failed to clean up file ${fileToCleanUp}`;
-
-        const messages: LoggedMessage[] = [];
-        t.throws(
-          () =>
-            cleanupDatabaseClusterDirectory(
-              createTestConfig({ dbLocation }),
-              getRecordingLogger(messages),
-              {},
-              () => {
-                throw new Error(rmSyncError);
-              },
-            ),
-          {
-            instanceOf: ErrorConstructor,
-            message: `${message(dbLocation)} Details: ${rmSyncError}`,
-          },
-        );
-
-        t.is(messages.length, 1);
-        t.is(messages[0].type, "warning");
-        t.is(
-          messages[0].message,
-          `The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`,
-        );
-      });
-    },
-  );
-}
-
-test("cleanupDatabaseClusterDirectory can disable warning with options", async (t) => {
-  await withTmpDir(async (tmpDir: string) => {
-    const dbLocation = path.resolve(tmpDir, "dbs");
-    fs.mkdirSync(dbLocation, { recursive: true });
-
-    const fileToCleanUp = path.resolve(dbLocation, "something-to-cleanup.txt");
-    fs.writeFileSync(fileToCleanUp, "");
-
-    const messages: LoggedMessage[] = [];
-    cleanupDatabaseClusterDirectory(
-      createTestConfig({ dbLocation }),
-      getRecordingLogger(messages),
-      { disableExistingDirectoryWarning: true },
-    );
-
-    // Should only have the info message, not the warning
-    t.is(messages.length, 1);
-    t.is(messages[0].type, "info");
-    t.is(
-      messages[0].message,
-      `Cleaned up database cluster directory ${dbLocation}.`,
-    );
-
-    t.false(fs.existsSync(fileToCleanUp));
-  });
-});
-
-type PackInfo = {
-  language: BuiltInLanguage;
-  packinfoContents: string | undefined;
-  sourceOnlyPack?: boolean;
-  qlpackFileName?: string;
-};
-
-const testCheckPacksForOverlayCompatibility = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    {
-      cliOverlayVersion,
-      languages,
-      packs,
-      expectedResult,
-    }: {
-      cliOverlayVersion: number | undefined;
-      languages: BuiltInLanguage[];
-      packs: Record;
-      expectedResult: boolean;
-    },
-  ) => {
-    await withTmpDir(async (tmpDir) => {
-      const packDirsByLanguage = new Map();
-
-      for (const [packName, packInfo] of Object.entries(packs)) {
-        const packPath = path.join(tmpDir, packName);
-        fs.mkdirSync(packPath, { recursive: true });
-        if (packInfo.packinfoContents) {
-          fs.writeFileSync(
-            path.join(packPath, ".packinfo"),
-            packInfo.packinfoContents,
-          );
-        }
-        const qlpackFileName = packInfo.qlpackFileName || "qlpack.yml";
-        fs.writeFileSync(
-          path.join(packPath, qlpackFileName),
-          packInfo.sourceOnlyPack
-            ? `name: ${packName}\nversion: 1.0.0\n`
-            : `name: ${packName}\nversion: 1.0.0\nbuildMetadata:\n sha: 123abc\n`,
-        );
-
-        if (!packDirsByLanguage.has(packInfo.language)) {
-          packDirsByLanguage.set(packInfo.language, []);
-        }
-        packDirsByLanguage.get(packInfo.language)!.push(packPath);
-      }
-
-      const codeql = createStubCodeQL({
-        getVersion: async () => ({
-          version: "2.22.2",
-          overlayVersion: cliOverlayVersion,
-        }),
-        resolveQueriesStartingPacks: async (suitePaths: string[]) => {
-          for (const language of packDirsByLanguage.keys()) {
-            const suiteForLanguage = path.join(
-              language,
-              "temp",
-              "config-queries.qls",
-            );
-            if (suitePaths[0].endsWith(suiteForLanguage)) {
-              return packDirsByLanguage.get(language) || [];
-            }
-          }
-          return [];
-        },
-      });
-
-      const messages: LoggedMessage[] = [];
-      const result = await checkPacksForOverlayCompatibility(
-        codeql,
-        createTestConfig({ dbLocation: tmpDir, languages }),
-        getRecordingLogger(messages),
-      );
-      t.is(result, expectedResult);
-      t.deepEqual(
-        messages.length,
-        expectedResult ? 0 : 1,
-        "Expected log messages",
-      );
-    });
-  },
-  title: (title) => `checkPacksForOverlayCompatibility: ${title}`,
-});
-
-testCheckPacksForOverlayCompatibility(
-  "returns false when CLI does not support overlay",
-  {
-    cliOverlayVersion: undefined,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-    },
-    expectedResult: false,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns true when there are no query packs",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {},
-    expectedResult: true,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns true when query pack has not been compiled",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: undefined,
-        sourceOnlyPack: true,
-      },
-    },
-    expectedResult: true,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns true when query pack has expected overlay version",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-    },
-    expectedResult: true,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns true when query packs for all languages to analyze are compatible",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.cpp, BuiltInLanguage.java],
-    packs: {
-      "codeql/cpp-queries": {
-        language: BuiltInLanguage.cpp,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-    },
-    expectedResult: true,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns true when query pack for a language not analyzed is incompatible",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/cpp-queries": {
-        language: BuiltInLanguage.cpp,
-        packinfoContents: undefined,
-      },
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-    },
-    expectedResult: true,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns false when query pack for a language to analyze is incompatible",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.cpp, BuiltInLanguage.java],
-    packs: {
-      "codeql/cpp-queries": {
-        language: BuiltInLanguage.cpp,
-        packinfoContents: '{"overlayVersion":1}',
-      },
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-    },
-    expectedResult: false,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns false when query pack is missing .packinfo",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-      "custom/queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: undefined,
-      },
-    },
-    expectedResult: false,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns false when query pack has different overlay version",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-      "custom/queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":1}',
-      },
-    },
-    expectedResult: false,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns false when query pack is missing overlayVersion in .packinfo",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-      "custom/queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: "{}",
-      },
-    },
-    expectedResult: false,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns false when .packinfo is not valid JSON",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-      },
-      "custom/queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: "this_is_not_valid_json",
-      },
-    },
-    expectedResult: false,
-  },
-);
-
-testCheckPacksForOverlayCompatibility(
-  "returns true when query pack uses codeql-pack.yml filename",
-  {
-    cliOverlayVersion: 2,
-    languages: [BuiltInLanguage.java],
-    packs: {
-      "codeql/java-queries": {
-        language: BuiltInLanguage.java,
-        packinfoContents: '{"overlayVersion":2}',
-        qlpackFileName: "codeql-pack.yml",
-      },
-    },
-    expectedResult: true,
-  },
-);
-
-test("file coverage information enabled when debugMode is true", async (t) => {
-  const result = await getFileCoverageInformationEnabled(
-    true, // debugMode
-    createStubCodeQL({}),
-    createFeatures([Feature.SkipFileCoverageOnPrs]),
-    {},
-  );
-  t.true(result.enabled);
-  t.false(result.enabledByRepositoryProperty);
-  t.false(result.showDeprecationWarning);
-});
-
-test.serial(
-  "file coverage information enabled when not analyzing a pull request",
-  async (t) => {
-    sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(false);
-
-    const result = await getFileCoverageInformationEnabled(
-      false, // debugMode
-      createStubCodeQL({}),
-      createFeatures([Feature.SkipFileCoverageOnPrs]),
-      {},
-    );
-    t.true(result.enabled);
-    t.false(result.enabledByRepositoryProperty);
-    t.false(result.showDeprecationWarning);
-  },
-);
-
-test.serial(
-  "file coverage information enabled when feature flag is not enabled, with deprecation warning",
-  async (t) => {
-    sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true);
-
-    const result = await getFileCoverageInformationEnabled(
-      false, // debugMode
-      createStubCodeQL({}),
-      createFeatures([]),
-      {},
-    );
-    t.true(result.enabled);
-    t.false(result.enabledByRepositoryProperty);
-    t.true(result.showDeprecationWarning);
-  },
-);
-
-test.serial(
-  "file coverage information enabled when repository property is set",
-  async (t) => {
-    sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true);
-
-    const result = await getFileCoverageInformationEnabled(
-      false, // debugMode
-      createStubCodeQL({}),
-      createFeatures([Feature.SkipFileCoverageOnPrs]),
-      {
-        "github-codeql-file-coverage-on-prs": true,
-      },
-    );
-    t.true(result.enabled);
-    t.true(result.enabledByRepositoryProperty);
-    t.false(result.showDeprecationWarning);
-  },
-);
-
-test.serial(
-  "file coverage information enabled when env var opt-out is set",
-  async (t) => {
-    sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true);
-    process.env["CODEQL_ACTION_FILE_COVERAGE_ON_PRS"] = "true";
-
-    const result = await getFileCoverageInformationEnabled(
-      false, // debugMode
-      createStubCodeQL({}),
-      createFeatures([Feature.SkipFileCoverageOnPrs]),
-      {},
-    );
-    t.true(result.enabled);
-    t.false(result.enabledByRepositoryProperty);
-    t.false(result.showDeprecationWarning);
-  },
-);
-
-test.serial(
-  "file coverage information disabled when all conditions for skipping are met",
-  async (t) => {
-    sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true);
-
-    const result = await getFileCoverageInformationEnabled(
-      false, // debugMode
-      createStubCodeQL({}),
-      createFeatures([Feature.SkipFileCoverageOnPrs]),
-      {},
-    );
-    t.false(result.enabled);
-    t.false(result.enabledByRepositoryProperty);
-    t.false(result.showDeprecationWarning);
-  },
-);
-
-test.serial(
-  "file coverage deprecation warning for org-owned repo with default setup recommends repo property",
-  (t) => {
-    const exportVariableStub = sinon.stub(core, "exportVariable");
-    sinon.stub(actionsUtil, "isDefaultSetup").returns(true);
-    github.context.payload = {
-      repository: {
-        name: "test-repo",
-        owner: { login: "test-org", type: "Organization" },
-      },
-    };
-    const messages: LoggedMessage[] = [];
-    logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages));
-    t.is(messages.length, 1);
-    t.is(messages[0].type, "warning");
-    t.is(
-      messages[0].message,
-      "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " +
-        "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" +
-        "To opt out of this change, create a custom repository property " +
-        'with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to ' +
-        "`true` in the repository's settings.",
-    );
-    t.true(exportVariableStub.calledOnce);
-  },
-);
-
-test.serial(
-  "file coverage deprecation warning for org-owned repo with advanced setup recommends env var and repo property",
-  (t) => {
-    const exportVariableStub = sinon.stub(core, "exportVariable");
-    sinon.stub(actionsUtil, "isDefaultSetup").returns(false);
-    github.context.payload = {
-      repository: {
-        name: "test-repo",
-        owner: { login: "test-org", type: "Organization" },
-      },
-    };
-    const messages: LoggedMessage[] = [];
-    logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages));
-    t.is(messages.length, 1);
-    t.is(messages[0].type, "warning");
-    t.is(
-      messages[0].message,
-      "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " +
-        "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" +
-        "To opt out of this change, set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`. " +
-        "Alternatively, create a custom repository property " +
-        'with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to ' +
-        "`true` in the repository's settings.",
-    );
-    t.true(exportVariableStub.calledOnce);
-  },
-);
-
-test.serial(
-  "file coverage deprecation warning for user-owned repo with default setup recommends advanced setup",
-  (t) => {
-    const exportVariableStub = sinon.stub(core, "exportVariable");
-    sinon.stub(actionsUtil, "isDefaultSetup").returns(true);
-    github.context.payload = {
-      repository: {
-        name: "test-repo",
-        owner: { login: "test-user", type: "User" },
-      },
-    };
-    const messages: LoggedMessage[] = [];
-    logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages));
-    t.is(messages.length, 1);
-    t.is(messages[0].type, "warning");
-    t.is(
-      messages[0].message,
-      "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " +
-        "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" +
-        "To opt out of this change, switch to an advanced setup workflow and " +
-        "set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.",
-    );
-    t.true(exportVariableStub.calledOnce);
-  },
-);
-
-test.serial(
-  "file coverage deprecation warning for user-owned repo with advanced setup recommends env var",
-  (t) => {
-    const exportVariableStub = sinon.stub(core, "exportVariable");
-    sinon.stub(actionsUtil, "isDefaultSetup").returns(false);
-    github.context.payload = {
-      repository: {
-        name: "test-repo",
-        owner: { login: "test-user", type: "User" },
-      },
-    };
-    const messages: LoggedMessage[] = [];
-    logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages));
-    t.is(messages.length, 1);
-    t.is(messages[0].type, "warning");
-    t.is(
-      messages[0].message,
-      "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " +
-        "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" +
-        "To opt out of this change, set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.",
-    );
-    t.true(exportVariableStub.calledOnce);
-  },
-);
-
-test.serial(
-  "file coverage deprecation warning for unknown owner type with default setup recommends advanced setup",
-  (t) => {
-    const exportVariableStub = sinon.stub(core, "exportVariable");
-    sinon.stub(actionsUtil, "isDefaultSetup").returns(true);
-    github.context.payload = { repository: undefined };
-    const messages: LoggedMessage[] = [];
-    logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages));
-    t.is(messages.length, 1);
-    t.is(messages[0].type, "warning");
-    t.is(
-      messages[0].message,
-      "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " +
-        "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" +
-        "To opt out of this change, switch to an advanced setup workflow and " +
-        "set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.",
-    );
-    t.true(exportVariableStub.calledOnce);
-  },
-);
-
-test.serial(
-  "file coverage deprecation warning for unknown owner type with advanced setup recommends env var",
-  (t) => {
-    const exportVariableStub = sinon.stub(core, "exportVariable");
-    sinon.stub(actionsUtil, "isDefaultSetup").returns(false);
-    github.context.payload = { repository: undefined };
-    const messages: LoggedMessage[] = [];
-    logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages));
-    t.is(messages.length, 1);
-    t.is(messages[0].type, "warning");
-    t.is(
-      messages[0].message,
-      "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " +
-        "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" +
-        "To opt out of this change, set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.",
-    );
-    t.true(exportVariableStub.calledOnce);
-  },
-);
-
-test.serial(
-  "logFileCoverageOnPrsDeprecationWarning does not log if already logged",
-  (t) => {
-    process.env["CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION"] =
-      "true";
-    const exportVariableStub = sinon.stub(core, "exportVariable");
-    const messages: LoggedMessage[] = [];
-    logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages));
-    t.is(messages.length, 0);
-    t.true(exportVariableStub.notCalled);
-  },
-);
diff --git a/src/init.ts b/src/init.ts
deleted file mode 100644
index c6a258e58c..0000000000
--- a/src/init.ts
+++ /dev/null
@@ -1,413 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as core from "@actions/core";
-import * as toolrunner from "@actions/exec/lib/toolrunner";
-import * as github from "@actions/github";
-import * as io from "@actions/io";
-import * as yaml from "js-yaml";
-
-import { ActionState } from "./action-common";
-import {
-  getOptionalInput,
-  isAnalyzingPullRequest,
-  isDefaultSetup,
-  isSelfHostedRunner,
-} from "./actions-util";
-import { GitHubApiDetails } from "./api-client";
-import { CodeQL, setupCodeQL } from "./codeql";
-import * as configUtils from "./config-utils";
-import { EnvVar } from "./environment";
-import {
-  CodeQLDefaultVersionInfo,
-  Feature,
-  FeatureEnablement,
-} from "./feature-flags";
-import {
-  RepositoryProperties,
-  RepositoryPropertyName,
-} from "./feature-flags/properties";
-import { BuiltInLanguage, Language } from "./languages";
-import { Logger, withGroupAsync } from "./logging";
-import { ToolsSource } from "./setup-codeql";
-import { ToolsDownloadStatusReport } from "./tools-download";
-import * as util from "./util";
-
-export async function initCodeQL(
-  toolsInput: string | undefined,
-  apiDetails: GitHubApiDetails,
-  tempDir: string,
-  variant: util.GitHubVariant,
-  defaultCliVersion: CodeQLDefaultVersionInfo,
-  rawLanguages: string[] | undefined,
-  useOverlayAwareDefaultCliVersion: boolean,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise<{
-  codeql: CodeQL;
-  toolsDownloadStatusReport?: ToolsDownloadStatusReport;
-  toolsSource: ToolsSource;
-  toolsVersion: string;
-}> {
-  logger.startGroup("Setup CodeQL tools");
-  const { codeql, toolsDownloadStatusReport, toolsSource, toolsVersion } =
-    await setupCodeQL(
-      toolsInput,
-      apiDetails,
-      tempDir,
-      variant,
-      defaultCliVersion,
-      rawLanguages,
-      useOverlayAwareDefaultCliVersion,
-      features,
-      logger,
-      true,
-    );
-  await codeql.printVersion();
-  logger.endGroup();
-  return {
-    codeql,
-    toolsDownloadStatusReport,
-    toolsSource,
-    toolsVersion,
-  };
-}
-
-export async function initConfig(
-  actionState: ActionState<["Logger", "Env", "FeatureFlags"]>,
-  inputs: configUtils.InitConfigInputs,
-): Promise {
-  return await withGroupAsync("Load language configuration", async () => {
-    return await configUtils.initConfig(actionState, inputs);
-  });
-}
-
-export async function runDatabaseInitCluster(
-  databaseInitEnvironment: Record,
-  codeql: CodeQL,
-  config: configUtils.Config,
-  sourceRoot: string,
-  processName: string | undefined,
-  qlconfigFile: string | undefined,
-): Promise {
-  fs.mkdirSync(config.dbLocation, { recursive: true });
-  await configUtils.wrapEnvironment(
-    databaseInitEnvironment,
-    async () =>
-      await codeql.databaseInitCluster(
-        config,
-        sourceRoot,
-        processName,
-        qlconfigFile,
-      ),
-  );
-}
-
-/**
- * Check whether all query packs are compatible with the overlay analysis
- * support in the CodeQL CLI. If the check fails, this function will log a
- * warning and returns false.
- *
- * @param codeql A CodeQL instance.
- * @param logger A logger.
- * @returns `true` if all query packs are compatible with overlay analysis,
- * `false` otherwise.
- */
-export async function checkPacksForOverlayCompatibility(
-  codeql: CodeQL,
-  config: configUtils.Config,
-  logger: Logger,
-): Promise {
-  const codeQlOverlayVersion = (await codeql.getVersion()).overlayVersion;
-  if (codeQlOverlayVersion === undefined) {
-    logger.warning("The CodeQL CLI does not support overlay analysis.");
-    return false;
-  }
-
-  for (const language of config.languages) {
-    const suitePath = util.getGeneratedSuitePath(config, language);
-    const packDirs = await codeql.resolveQueriesStartingPacks([suitePath]);
-    if (
-      packDirs.some(
-        (packDir) =>
-          !checkPackForOverlayCompatibility(
-            packDir,
-            codeQlOverlayVersion,
-            logger,
-          ),
-      )
-    ) {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-/** Interface for `qlpack.yml` file contents. */
-interface QlPack {
-  buildMetadata?: string;
-}
-
-/**
- * Check a single pack for its overlay compatibility. If the check fails, this
- * function will log a warning and returns false.
- *
- * @param packDir Path to the directory containing the pack.
- * @param codeQlOverlayVersion The overlay version of the CodeQL CLI.
- * @param logger A logger.
- * @returns `true` if the pack is compatible with overlay analysis, `false`
- * otherwise.
- */
-function checkPackForOverlayCompatibility(
-  packDir: string,
-  codeQlOverlayVersion: number,
-  logger: Logger,
-): boolean {
-  try {
-    let qlpackPath = path.join(packDir, "qlpack.yml");
-    if (!fs.existsSync(qlpackPath)) {
-      qlpackPath = path.join(packDir, "codeql-pack.yml");
-    }
-    const qlpackContents = yaml.load(
-      fs.readFileSync(qlpackPath, "utf8"),
-    ) as QlPack;
-    if (!qlpackContents.buildMetadata) {
-      // This is a source-only pack, and overlay compatibility checks apply only
-      // to precompiled packs.
-      return true;
-    }
-
-    const packInfoPath = path.join(packDir, ".packinfo");
-    if (!fs.existsSync(packInfoPath)) {
-      logger.warning(
-        `The query pack at ${packDir} does not have a .packinfo file, ` +
-          "so it cannot support overlay analysis. Recompiling the query pack " +
-          "with the latest CodeQL CLI should solve this problem.",
-      );
-      return false;
-    }
-
-    const packInfoFileContents = JSON.parse(
-      fs.readFileSync(packInfoPath, "utf8"),
-    );
-    const packOverlayVersion = packInfoFileContents.overlayVersion;
-    if (typeof packOverlayVersion !== "number") {
-      logger.warning(
-        `The .packinfo file for the query pack at ${packDir} ` +
-          "does not have the overlayVersion field, which indicates that " +
-          "the pack is not compatible with overlay analysis.",
-      );
-      return false;
-    }
-
-    if (packOverlayVersion !== codeQlOverlayVersion) {
-      logger.warning(
-        `The query pack at ${packDir} was compiled with ` +
-          `overlay version ${packOverlayVersion}, but the CodeQL CLI ` +
-          `supports overlay version ${codeQlOverlayVersion}. The ` +
-          "query pack needs to be recompiled to support overlay analysis.",
-      );
-      return false;
-    }
-  } catch (e) {
-    logger.warning(
-      `Error while checking pack at ${packDir} ` +
-        `for overlay compatibility: ${util.getErrorMessage(e)}`,
-    );
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * If we are running python 3.12+ on windows, we need to switch to python 3.11.
- * This check happens in a powershell script.
- */
-export async function checkInstallPython311(
-  languages: Language[],
-  codeql: CodeQL,
-) {
-  if (
-    languages.includes(BuiltInLanguage.python) &&
-    process.platform === "win32" &&
-    !(await codeql.getVersion()).features?.supportsPython312
-  ) {
-    const script = path.resolve(
-      __dirname,
-      "../python-setup",
-      "check_python12.ps1",
-    );
-    await new toolrunner.ToolRunner(await io.which("powershell", true), [
-      script,
-    ]).exec();
-  }
-}
-
-export function cleanupDatabaseClusterDirectory(
-  config: configUtils.Config,
-  logger: Logger,
-  options: { disableExistingDirectoryWarning?: boolean } = {},
-  // We can't stub the fs module in tests, so we allow the caller to override the rmSync function
-  // for testing.
-  rmSync = fs.rmSync,
-): void {
-  if (
-    fs.existsSync(config.dbLocation) &&
-    (fs.statSync(config.dbLocation).isFile() ||
-      fs.readdirSync(config.dbLocation).length > 0)
-  ) {
-    if (!options.disableExistingDirectoryWarning) {
-      logger.warning(
-        `The database cluster directory ${config.dbLocation} must be empty. Attempting to clean it up.`,
-      );
-    }
-    try {
-      rmSync(config.dbLocation, {
-        force: true,
-        maxRetries: 3,
-        recursive: true,
-      });
-
-      logger.info(
-        `Cleaned up database cluster directory ${config.dbLocation}.`,
-      );
-    } catch (e) {
-      const blurb = `The CodeQL Action requires an empty database cluster directory. ${
-        getOptionalInput("db-location")
-          ? `This is currently configured to be ${config.dbLocation}. `
-          : `By default, this is located at ${config.dbLocation}. ` +
-            "You can customize it using the 'db-location' input to the init Action. "
-      }An attempt was made to clean up the directory, but this failed.`;
-
-      // Hosted runners are automatically cleaned up, so this error should not occur for hosted runners.
-      if (isSelfHostedRunner()) {
-        throw new util.ConfigurationError(
-          `${blurb} This can happen if another process is using the directory or the directory is owned by a different user. ` +
-            `Please clean up the directory manually and rerun the job. Details: ${util.getErrorMessage(
-              e,
-            )}`,
-        );
-      } else {
-        throw new Error(
-          `${blurb} This shouldn't typically happen on hosted runners. ` +
-            "If you are using an advanced setup, please check your workflow, otherwise we " +
-            `recommend rerunning the job. Details: ${util.getErrorMessage(e)}`,
-        );
-      }
-    }
-  }
-}
-
-export async function getFileCoverageInformationEnabled(
-  debugMode: boolean,
-  codeql: CodeQL,
-  features: FeatureEnablement,
-  repositoryProperties: RepositoryProperties,
-): Promise<{
-  enabled: boolean;
-  enabledByRepositoryProperty: boolean;
-  showDeprecationWarning: boolean;
-}> {
-  // Always enable file coverage information in debug mode
-  if (debugMode) {
-    return {
-      enabled: true,
-      enabledByRepositoryProperty: false,
-      showDeprecationWarning: false,
-    };
-  }
-  // We're most interested in speeding up PRs, and we want to keep
-  // submitting file coverage information for the default branch since
-  // it is used to populate the status page.
-  if (!isAnalyzingPullRequest()) {
-    return {
-      enabled: true,
-      enabledByRepositoryProperty: false,
-      showDeprecationWarning: false,
-    };
-  }
-  // If the user has explicitly opted out via an environment variable, don't
-  // show the deprecation warning.
-  if (
-    (process.env[EnvVar.FILE_COVERAGE_ON_PRS] || "").toLocaleLowerCase() ===
-    "true"
-  ) {
-    return {
-      enabled: true,
-      enabledByRepositoryProperty: false,
-      showDeprecationWarning: false,
-    };
-  }
-  // Allow repositories to opt in to file coverage information on PRs
-  // using a repository property. In this case, don't show the deprecation
-  // warning since the repository has explicitly opted in.
-  if (
-    repositoryProperties[RepositoryPropertyName.FILE_COVERAGE_ON_PRS] === true
-  ) {
-    return {
-      enabled: true,
-      enabledByRepositoryProperty: true,
-      showDeprecationWarning: false,
-    };
-  }
-  // If the feature is disabled, then maintain the previous behavior of
-  // unconditionally computing file coverage information, but warn that
-  // file coverage on PRs will be disabled in a future release.
-  if (!(await features.getValue(Feature.SkipFileCoverageOnPrs, codeql))) {
-    return {
-      enabled: true,
-      enabledByRepositoryProperty: false,
-      showDeprecationWarning: true,
-    };
-  }
-  // Otherwise, disable file coverage information on PRs to speed up analysis.
-  return {
-    enabled: false,
-    enabledByRepositoryProperty: false,
-    showDeprecationWarning: false,
-  };
-}
-
-/**
- * Log a warning about the deprecation of file coverage information on PRs, including how to opt
- * back in via an environment variable or repository property.
- */
-export function logFileCoverageOnPrsDeprecationWarning(logger: Logger): void {
-  if (process.env[EnvVar.DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION]) {
-    return;
-  }
-
-  const repositoryOwnerType: string | undefined =
-    github.context.payload.repository?.owner.type;
-
-  let message =
-    "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " +
-    "to improve analysis performance. File coverage information will still be computed on non-PR analyses.";
-  const envVarOptOut =
-    "set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.";
-  const repoPropertyOptOut =
-    "create a custom repository property with the name " +
-    '`github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to ' +
-    "`true` in the repository's settings.";
-
-  if (repositoryOwnerType === "Organization") {
-    // Org-owned repo: can use the repository property
-    if (isDefaultSetup()) {
-      message += `\n\nTo opt out of this change, ${repoPropertyOptOut}`;
-    } else {
-      message += `\n\nTo opt out of this change, ${envVarOptOut} Alternatively, ${repoPropertyOptOut}`;
-    }
-  } else if (isDefaultSetup()) {
-    // User-owned repo on default setup: no repo property available and
-    // no way to set env vars, so need to switch to advanced setup.
-    message += `\n\nTo opt out of this change, switch to an advanced setup workflow and ${envVarOptOut}`;
-  } else {
-    // User-owned repo on advanced setup: can set the env var
-    message += `\n\nTo opt out of this change, ${envVarOptOut}`;
-  }
-
-  logger.warning(message);
-  core.exportVariable(EnvVar.DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION, "true");
-}
diff --git a/src/json/index.test.ts b/src/json/index.test.ts
deleted file mode 100644
index 80edbedece..0000000000
--- a/src/json/index.test.ts
+++ /dev/null
@@ -1,142 +0,0 @@
-import test from "ava";
-
-import { setupTests } from "../testing-utils";
-
-import * as json from ".";
-
-setupTests(test);
-
-const testSchema = {
-  requiredKey: json.string,
-};
-
-const optionalOrNullSchema = {
-  optionalKey: json.optionalOrNull(json.string),
-};
-
-test("validateSchema - required properties are required", async (t) => {
-  t.false(json.validateSchema(testSchema, {}));
-  t.false(json.validateSchema(testSchema, { requiredKey: undefined }));
-  t.false(json.validateSchema(testSchema, { requiredKey: null }));
-  t.false(json.validateSchema(testSchema, { requiredKey: 0 }));
-  t.false(json.validateSchema(testSchema, { requiredKey: 123 }));
-  t.false(json.validateSchema(testSchema, { requiredKey: false }));
-  t.false(json.validateSchema(testSchema, { requiredKey: true }));
-  t.false(json.validateSchema(testSchema, { requiredKey: [] }));
-  t.false(json.validateSchema(testSchema, { requiredKey: {} }));
-  t.true(json.validateSchema(testSchema, { requiredKey: "" }));
-  t.true(json.validateSchema(testSchema, { requiredKey: "foo" }));
-});
-
-test("validateSchema - optionalOrNullSchema properties are optional or null", async (t) => {
-  // Optional fields may be absent
-  t.true(json.validateSchema(optionalOrNullSchema, {}));
-  t.true(json.validateSchema(optionalOrNullSchema, { optionalKey: undefined }));
-  t.true(json.validateSchema(optionalOrNullSchema, { optionalKey: null }));
-
-  // But, if present, should have the expected type
-  t.false(json.validateSchema(optionalOrNullSchema, { optionalKey: 0 }));
-  t.false(json.validateSchema(optionalOrNullSchema, { optionalKey: 123 }));
-  t.false(json.validateSchema(optionalOrNullSchema, { optionalKey: false }));
-  t.false(json.validateSchema(optionalOrNullSchema, { optionalKey: true }));
-  t.false(json.validateSchema(optionalOrNullSchema, { optionalKey: [] }));
-  t.false(json.validateSchema(optionalOrNullSchema, { optionalKey: {} }));
-  t.true(json.validateSchema(optionalOrNullSchema, { optionalKey: "" }));
-  t.true(json.validateSchema(optionalOrNullSchema, { optionalKey: "foo" }));
-});
-
-const optionalSchema = {
-  optionalKey: json.optional(json.string),
-};
-
-test("validateSchema - optional properties are optional", async (t) => {
-  // Optional fields may be absent or explicitly undefined
-  t.true(json.validateSchema(optionalSchema, {}));
-  t.true(json.validateSchema(optionalSchema, { optionalKey: undefined }));
-
-  // But should reject null
-  t.false(json.validateSchema(optionalSchema, { optionalKey: null }));
-
-  // And, if present, should have the expected type
-  t.false(json.validateSchema(optionalSchema, { optionalKey: 0 }));
-  t.false(json.validateSchema(optionalSchema, { optionalKey: 123 }));
-  t.false(json.validateSchema(optionalSchema, { optionalKey: false }));
-  t.false(json.validateSchema(optionalSchema, { optionalKey: true }));
-  t.false(json.validateSchema(optionalSchema, { optionalKey: [] }));
-  t.false(json.validateSchema(optionalSchema, { optionalKey: {} }));
-  t.true(json.validateSchema(optionalSchema, { optionalKey: "" }));
-  t.true(json.validateSchema(optionalSchema, { optionalKey: "foo" }));
-});
-
-const arraySchema = {
-  arrayKey: json.array(json.number),
-};
-
-test("validateSchema - validates arrays", async (t) => {
-  // Arrays of numeric elements are accepted.
-  t.true(json.validateSchema(arraySchema, { arrayKey: [] }));
-  t.true(json.validateSchema(arraySchema, { arrayKey: [4] }));
-  t.true(json.validateSchema(arraySchema, { arrayKey: [4, 8] }));
-  t.true(json.validateSchema(arraySchema, { arrayKey: [4, 8, 15] }));
-
-  // Other array elements are not accepted.
-  t.false(json.validateSchema(arraySchema, { arrayKey: [4, 8, 15, "bar"] }));
-  t.false(json.validateSchema(arraySchema, { arrayKey: [4, 8, undefined] }));
-  t.false(json.validateSchema(arraySchema, { arrayKey: [4, 8, 15, null] }));
-});
-
-const objectSchema = {
-  objectKey: json.object(arraySchema),
-};
-
-test("validateSchema - validates objects", async (t) => {
-  // Objects of the given schema are accepted.
-  t.true(json.validateSchema(objectSchema, { objectKey: { arrayKey: [] } }));
-  t.true(json.validateSchema(objectSchema, { objectKey: { arrayKey: [4] } }));
-
-  // Other values are not accepted.
-  t.false(json.validateSchema(objectSchema, {}));
-  t.false(json.validateSchema(objectSchema, { objectKey: [] }));
-  t.false(json.validateSchema(objectSchema, { objectKey: undefined }));
-  t.false(json.validateSchema(objectSchema, { objectKey: null }));
-  t.false(json.validateSchema(objectSchema, { objectKey: "foo" }));
-  t.false(json.validateSchema(objectSchema, { objectKey: 123 }));
-});
-
-const checkSchemaTestSchema = {
-  rootKey: json.object(objectSchema),
-};
-
-test("checkSchema - reports unknown keys", async (t) => {
-  const result = json.checkSchema(checkSchemaTestSchema, {
-    rootKey: {
-      objectKey: {
-        arrayKey: [],
-      },
-      nestedExtraKey: "foo",
-    },
-    extraKey: "bar",
-  });
-
-  t.true(result.valid);
-  t.deepEqual(
-    result.unknownKeys.sort(),
-    [".extraKey", ".rootKey.nestedExtraKey"].sort(),
-  );
-});
-
-test("checkSchema - reports invalid keys", async (t) => {
-  const result = json.checkSchema(checkSchemaTestSchema, {
-    rootKey: {
-      objectKey: {
-        arrayKey: ["foo"],
-      },
-    },
-  });
-
-  t.false(result.valid);
-  t.deepEqual(
-    result.invalidKeys.sort(),
-    [".rootKey.objectKey.arrayKey[0]"].sort(),
-  );
-});
diff --git a/src/json/index.ts b/src/json/index.ts
deleted file mode 100644
index d8764ec478..0000000000
--- a/src/json/index.ts
+++ /dev/null
@@ -1,367 +0,0 @@
-/**
- * Represents a value we have obtained from parsing JSON which we know is an object,
- * and expect to be of some type `T` which has not yet been validated.
- */
-export type UnvalidatedObject = { [P in keyof T]?: unknown };
-
-/** Represents a value we have obtained from parsing JSON which we know is an array. */
-export type UnvalidatedArray = unknown[];
-
-/**
- * Attempts to parse `data` as JSON. This function does not perform any validation and will therefore
- * return a value of an `unknown` type if successful. Throws if `data` is not valid JSON.
- */
-export function parseString(data: string): unknown {
-  return JSON.parse(data) as unknown;
-}
-
-/** Asserts that `value` is an object, which is not yet validated, but expected to be of type `T`. */
-export function isObject(value: unknown): value is UnvalidatedObject {
-  return typeof value === "object" && value !== null && !Array.isArray(value);
-}
-
-/** Asserts that `value` is an array, which is not yet validated. */
-export function isArray(value: unknown): value is UnvalidatedArray {
-  return Array.isArray(value);
-}
-
-/** Asserts that `value` is a string. */
-export function isString(value: unknown): value is string {
-  return typeof value === "string";
-}
-
-/** Asserts that `value` is a number. */
-export function isNumber(value: unknown): value is number {
-  return typeof value === "number";
-}
-
-/** Asserts that `value` is a boolean. */
-export function isBoolean(value: unknown): value is boolean {
-  return typeof value === "boolean";
-}
-
-/** Asserts that `value` is either a string or undefined. */
-export function isStringOrUndefined(
-  value: unknown,
-): value is string | undefined {
-  return value === undefined || isString(value);
-}
-
-/**
- * Represents a field of type `T` in a schema.
- * Carries a validation function and flag indicating whether the field is required or not.
- */
-export type Validator = {
-  validate: (val: unknown) => val is T;
-  check: (
-    val: unknown,
-    opts: CheckSchemaOptions,
-    path: string,
-  ) => CheckSchemaResult;
-  required: boolean;
-};
-
-function defaultCheck(
-  validate: (val: unknown) => val is any,
-): (arg: unknown) => CheckSchemaResult {
-  return (arg) => ({ unknownKeys: [], invalidKeys: [], valid: validate(arg) });
-}
-
-function makeValidator(validate: (arg: unknown) => arg is T) {
-  return {
-    validate,
-    check: defaultCheck(validate),
-    required: true,
-  } as const satisfies Validator;
-}
-
-/** Extracts `T` from `Validator`. */
-export type UnwrapValidator = V extends Validator ? A : never;
-
-/** A validator for string fields in schemas. */
-export const string = makeValidator(isString);
-
-/** A validator for number fields in schemas. */
-export const number = makeValidator(isNumber);
-
-/** A validator for boolean fields in schemas. */
-export const boolean = makeValidator(isBoolean);
-
-/** A validator for arrays. */
-export function array(validator: Validator) {
-  const validate = (val: unknown) => {
-    return isArray(val) && val.every((e) => validator.validate(e));
-  };
-  return {
-    validate,
-    check: (val: unknown, opts: CheckSchemaOptions, path: string) => {
-      const result: CheckSchemaResult = successfulCheckSchema();
-
-      // The value must be an array.
-      if (!isArray(val)) {
-        result.valid = false;
-        return result;
-      }
-
-      // Validate all elements of the array.
-      let index = 0;
-      for (const e of val) {
-        const elementPath = `${path}[${index}]`;
-        const eResult = validator.check(e, opts, `${elementPath}`);
-
-        result.invalidKeys.push(...eResult.invalidKeys);
-        result.unknownKeys.push(...eResult.unknownKeys);
-        index++;
-
-        if (!eResult.valid) {
-          result.valid = false;
-
-          // Add the element path to `invalidKeys` if we didn't get
-          // any more specific ones from the element validator.
-          if (eResult.invalidKeys.length === 0) {
-            result.invalidKeys.push(elementPath);
-          }
-
-          if (opts.failFast) {
-            return result;
-          }
-
-          continue;
-        }
-      }
-
-      return result;
-    },
-    required: true,
-  } as const satisfies Validator;
-}
-
-/** A validator for objects. */
-export function object<
-  S extends Schema,
-  T extends UnvalidatedObject = FromSchema,
->(schema: S) {
-  return {
-    validate: (val: unknown) => {
-      return isObject(val) && validateSchema(schema, val);
-    },
-    check: (val, opts, path) => {
-      if (!isObject(val)) {
-        return invalidCheckSchema();
-      }
-      return checkSchema(schema, val, opts, path);
-    },
-    required: true,
-  } as const satisfies Validator;
-}
-
-/**
- * Transforms a validator to be optional, accepting `undefined` or `null` for an
- * absent value.
- */
-export function optionalOrNull(validator: Validator) {
-  return {
-    validate: (val: unknown) => {
-      return val === undefined || val === null || validator.validate(val);
-    },
-    check: (val, opts, path) => {
-      if (val === undefined || val === null) {
-        return successfulCheckSchema();
-      }
-      return validator.check(val, opts, path);
-    },
-    required: false,
-  } as const satisfies Validator;
-}
-
-/**
- * Transforms a validator to be optional, accepting `undefined` for an absent
- * value but, unlike `optionalOrNull`, rejecting `null`.
- */
-export function optional(validator: Validator) {
-  return {
-    validate: (val: unknown): val is T | undefined => {
-      return val === undefined || validator.validate(val);
-    },
-    check: (val, opts, path) => {
-      if (val === undefined) {
-        return successfulCheckSchema();
-      }
-      return validator.check(val, opts, path);
-    },
-    required: false,
-  } as const satisfies Validator;
-}
-
-/** Represents an arbitrary object schema. */
-export type Schema = Record>;
-
-/** Extracts the required keys from `S`. */
-export type RequiredKeys = {
-  [K in keyof S]: S[K]["required"] extends true ? K : never;
-}[keyof S];
-
-/** Extracts optional keys from `S`. */
-export type OptionalKeys = {
-  [K in keyof S]: S[K]["required"] extends true ? never : K;
-}[keyof S];
-
-/** Constructs an object type corresponding to a schema. */
-export type FromSchema = {
-  [K in RequiredKeys]: UnwrapValidator;
-} & { [K in OptionalKeys]?: UnwrapValidator };
-
-/**
- * Validates that `obj` satisfies at least `schema`. Additional keys are accepted.
- *
- * @param schema The schema to validate against.
- * @param obj The object to validate.
- * @returns Asserts that `obj` is of the `schema`'s type if validation is successful.
- */
-export function validateSchema<
-  S extends Schema,
-  T extends UnvalidatedObject = FromSchema,
->(schema: S, obj: UnvalidatedObject): obj is T {
-  const result = checkSchema(schema, obj, { failFast: true });
-  return result.valid;
-}
-
-/**
- * Validates that `arr` is an array whose elements satisfy at least `elementSchema`.
- * Additional keys are accepted in each element.
- *
- * @param elementSchema The schema to validate the elements against.
- * @param arr The array to validate.
- * @returns Asserts that `arr` has elements of `schema`'s type if validation is successful.
- */
-export function validateArray<
-  S extends Schema,
-  T extends UnvalidatedArray = Array>,
->(elementSchema: S, arr: UnvalidatedArray): arr is T {
-  const elementValidator = object(elementSchema);
-
-  return array(elementValidator).validate(arr);
-}
-
-export interface CheckSchemaOptions {
-  /** Whether to stop validation after the first error. */
-  failFast?: boolean;
-}
-
-export interface CheckSchemaResult {
-  /** Whether the `obj` satisfies the schema. */
-  valid: boolean;
-  /** Unknown keys that were found during validation. */
-  unknownKeys: string[];
-  /** Known keys that failed validation. */
-  invalidKeys: string[];
-}
-
-/**
- * Convenience function to produce a `CheckSchemaResult` where `valid: true`.
- */
-function successfulCheckSchema(): CheckSchemaResult {
-  return {
-    valid: true,
-    unknownKeys: [],
-    invalidKeys: [],
-  };
-}
-
-/**
- * Convenience function to produce a `CheckSchemaResult` where `valid: false`.
- */
-function invalidCheckSchema(): CheckSchemaResult {
-  return {
-    valid: false,
-    unknownKeys: [],
-    invalidKeys: [],
-  };
-}
-
-export function checkSchema(
-  schema: S,
-  obj: UnvalidatedObject,
-  options: CheckSchemaOptions = {},
-  path: string = "",
-): CheckSchemaResult {
-  const result: CheckSchemaResult = successfulCheckSchema();
-
-  // Track the set of input keys. We remove keys from this set as we recognise them
-  // during validation.
-  const inputKeys = new Set(Object.keys(obj));
-
-  // Track keys that have failed validation, starting with the empty set.
-  const invalidKeys = new Set();
-
-  // Loop through all keys in the object schema and validate that the given object
-  // satisfies the schema key.
-  for (const [key, validator] of Object.entries(schema)) {
-    const hasKey = key in obj;
-
-    // Remove key from set of unrecognised keys.
-    inputKeys.delete(key);
-
-    // Add the key to the set of invalid keys. We remove it later once
-    // it passes validation.
-    invalidKeys.add(key);
-
-    // If the property is required, but absent, fail.
-    if (validator.required && !hasKey) {
-      result.valid = false;
-
-      if (options.failFast) {
-        break;
-      }
-      continue;
-    }
-
-    // If the property is required, but undefined or null, fail.
-    if (validator.required && (obj[key] === undefined || obj[key] === null)) {
-      result.valid = false;
-
-      if (options.failFast) {
-        break;
-      }
-      continue;
-    }
-
-    // If the property is present, validate it.
-    if (hasKey) {
-      const checkResult = validator.check(obj[key], options, `${path}.${key}`);
-
-      result.unknownKeys.push(...checkResult.unknownKeys);
-      result.invalidKeys.push(...checkResult.invalidKeys);
-
-      // If we have invalid keys from the validator, then that means that
-      // we have a more specific key than `key`. Remove `key` from the results.
-      if (checkResult.invalidKeys.length > 0) {
-        invalidKeys.delete(key);
-      }
-
-      if (!checkResult.valid) {
-        result.valid = false;
-
-        if (options.failFast) {
-          break;
-        }
-        continue;
-      }
-    }
-
-    // If we reach this point, the key has been successfully validated.
-    invalidKeys.delete(key);
-  }
-
-  // If there are any remaining keys in `inputKeys`, add them to `unknownKeys`.
-  for (const remainingKey of inputKeys) {
-    result.unknownKeys.push(`${path}.${remainingKey}`);
-  }
-
-  // If there are any remaining keys in `invalidKeys`, add them to the result.
-  for (const invalidKey of invalidKeys) {
-    result.invalidKeys.push(`${path}.${invalidKey}`);
-  }
-
-  return result;
-}
diff --git a/src/json/testing-util.ts b/src/json/testing-util.ts
deleted file mode 100644
index 18c1bf06e5..0000000000
--- a/src/json/testing-util.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { ExecutionContext } from "ava";
-
-import * as json from ".";
-
-/**
- * Constructs an object based on `schema` for unit tests.
- * Assumes that all keys in `schema` have string values.
- *
- * @param includeOptional Whether to include optional properties.
- * @param schema The schema to base the object on.
- * @returns An object that satisfies `schema`.
- */
-export function makeFromSchema(
-  includeOptional: boolean,
-  schema: S,
-): json.FromSchema {
-  const result = {};
-  for (const [key, validator] of Object.entries(schema)) {
-    if (!validator.required && !includeOptional) {
-      continue;
-    }
-    result[key] = `value-for-${key}`;
-  }
-  return result as json.FromSchema;
-}
-
-/** Options for `withSchemaMatrix`. */
-export interface SchemaMatrixOptions {
-  /** Whether cases where the properties are entirely absent should be excluded. */
-  excludeAbsent?: boolean;
-}
-
-/**
- * Constructs a test matrix of possible objects for `schema`: all required properties
- * plus all permutations of possible states for the optional properties.
- *
- * @param schema The schema to construct a test matrix for.
- * @param body The test body to call with each value from the test matrix.
- */
-export function withSchemaMatrix(
-  t: ExecutionContext,
-  schema: S,
-  opts: SchemaMatrixOptions,
-  body: (value: json.FromSchema) => void,
-): void {
-  // Construct a base object that includes all required properties.
-  const required = makeFromSchema(false, schema);
-
-  // Identify optional properties.
-  const optionalKeys: Array = [];
-
-  for (const [key, validator] of Object.entries(schema)) {
-    if (!validator.required) {
-      optionalKeys.push(key);
-    }
-  }
-
-  const optionalValues = (key: keyof S) => [
-    null,
-    undefined,
-    `value-for-${String(key)}`,
-  ];
-
-  // Constructs an array of test objects, starting with `required` and combining it with all
-  // possible states of each optional property. For example, with default settings:
-  //
-  // For { requiredKey: string }, we get: `[{ requiredKey: "some-string-value" }]`
-  //
-  // For { requiredKey: string, optionalKey?: string }, we get:
-  // [ { requiredKey: "some-string-value" },
-  //   { requiredKey: "some-string-value", optionalKey: undefined },
-  //   { requiredKey: "some-string-value", optionalKey: null },
-  //   { requiredKey: "some-string-value", optionalKey: "some-value" },
-  // ]
-  const permutations = (keys: Array) => {
-    if (keys.length === 0) return [required];
-
-    const bases = permutations(keys.slice(1));
-    const result: Array> = [];
-
-    const optionalKey = keys[0];
-    for (const base of bases) {
-      if (!opts.excludeAbsent) {
-        // Optional keys can be absent entirely.
-        result.push(base);
-      }
-
-      // Or be present and have one of the `optionalValues`.
-      for (const optionalValue of optionalValues(optionalKey)) {
-        result.push({ ...base, [optionalKey]: optionalValue });
-      }
-    }
-    return result;
-  };
-
-  // Call `body` for all test cases.
-  const testCases = permutations(optionalKeys);
-  for (const testCase of testCases) {
-    try {
-      body(testCase);
-    } catch (err) {
-      t.log(testCase);
-      throw err;
-    }
-  }
-}
diff --git a/src/languages/builtin.json b/src/languages/builtin.json
deleted file mode 100644
index 2c3511816d..0000000000
--- a/src/languages/builtin.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-  "languages": [
-    "actions",
-    "cpp",
-    "csharp",
-    "go",
-    "java",
-    "javascript",
-    "python",
-    "ruby",
-    "rust",
-    "swift"
-  ],
-  "aliases": {
-    "c": "cpp",
-    "c-c++": "cpp",
-    "c-cpp": "cpp",
-    "c#": "csharp",
-    "c++": "cpp",
-    "java-kotlin": "java",
-    "javascript-typescript": "javascript",
-    "kotlin": "java",
-    "typescript": "javascript"
-  }
-}
diff --git a/src/languages/index.test.ts b/src/languages/index.test.ts
deleted file mode 100644
index 4fe1675af7..0000000000
--- a/src/languages/index.test.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import test from "ava";
-
-import { setupTests } from "../testing-utils";
-
-import knownLanguagesData from "./builtin.json";
-
-import { isBuiltInLanguage, BuiltInLanguage, parseBuiltInLanguage } from ".";
-
-setupTests(test);
-
-test("parseBuiltInLanguage", (t) => {
-  // Exact matches
-  t.is(parseBuiltInLanguage("csharp"), BuiltInLanguage.csharp);
-  t.is(parseBuiltInLanguage("cpp"), BuiltInLanguage.cpp);
-  t.is(parseBuiltInLanguage("go"), BuiltInLanguage.go);
-  t.is(parseBuiltInLanguage("java"), BuiltInLanguage.java);
-  t.is(parseBuiltInLanguage("javascript"), BuiltInLanguage.javascript);
-  t.is(parseBuiltInLanguage("python"), BuiltInLanguage.python);
-  t.is(parseBuiltInLanguage("rust"), BuiltInLanguage.rust);
-
-  // Aliases
-  t.is(parseBuiltInLanguage("  \t\nCsHaRp\t\t"), BuiltInLanguage.csharp);
-  t.is(parseBuiltInLanguage("c"), BuiltInLanguage.cpp);
-  t.is(parseBuiltInLanguage("c++"), BuiltInLanguage.cpp);
-  t.is(parseBuiltInLanguage("kotlin"), BuiltInLanguage.java);
-  t.is(parseBuiltInLanguage("typescript"), BuiltInLanguage.javascript);
-
-  // spaces and case-insensitivity
-  t.is(parseBuiltInLanguage("  \t\nkOtLin\t\t"), BuiltInLanguage.java);
-
-  // Not matches
-  t.is(parseBuiltInLanguage(BuiltInLanguage.python), BuiltInLanguage.python);
-  t.is(parseBuiltInLanguage("foo"), undefined);
-  t.is(parseBuiltInLanguage(" "), undefined);
-  t.is(parseBuiltInLanguage(""), undefined);
-});
-
-test("isBuiltInLanguage matches the curated built-in language set", (t) => {
-  t.true(isBuiltInLanguage(BuiltInLanguage.actions));
-  t.true(isBuiltInLanguage(BuiltInLanguage.swift));
-  t.false(isBuiltInLanguage("typescript"));
-});
-
-test("BuiltInLanguage enum matches builtin.json", (t) => {
-  t.deepEqual(Object.values(BuiltInLanguage), knownLanguagesData.languages);
-});
diff --git a/src/languages/index.ts b/src/languages/index.ts
deleted file mode 100644
index 7ecbd06fd5..0000000000
--- a/src/languages/index.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import knownLanguagesData from "./builtin.json";
-
-/** A language to analyze with CodeQL. */
-export type Language = string;
-
-/** A language built into the `defaults.json` CodeQL distribution. */
-export enum BuiltInLanguage {
-  actions = "actions",
-  cpp = "cpp",
-  csharp = "csharp",
-  go = "go",
-  java = "java",
-  javascript = "javascript",
-  python = "python",
-  ruby = "ruby",
-  rust = "rust",
-  swift = "swift",
-}
-
-/** Java-specific environment variable names that we may care about. */
-export enum JavaEnvVars {
-  JAVA_HOME = "JAVA_HOME",
-  JAVA_TOOL_OPTIONS = "JAVA_TOOL_OPTIONS",
-  JDK_JAVA_OPTIONS = "JDK_JAVA_OPTIONS",
-  _JAVA_OPTIONS = "_JAVA_OPTIONS",
-}
-
-const builtInLanguageSet = new Set(knownLanguagesData.languages);
-
-export function isBuiltInLanguage(
-  language: string,
-): language is BuiltInLanguage {
-  return builtInLanguageSet.has(language);
-}
-
-/**
- * Parse a language input corresponding to a built-in language into its canonical CodeQL language
- * name.
- *
- * This uses the language aliases shipped with the Action and will not be able to resolve aliases
- * added by third-party CodeQL language support or versions of the CodeQL CLI newer than the one
- * mentioned in `defaults.json`. Therefore, this function should only be used when the CodeQL CLI is
- * not available.
- */
-export function parseBuiltInLanguage(
-  language: string,
-): BuiltInLanguage | undefined {
-  language = language.trim().toLowerCase();
-  language =
-    knownLanguagesData.aliases[
-      language as keyof typeof knownLanguagesData.aliases
-    ] ?? language;
-  if (isBuiltInLanguage(language)) {
-    return language;
-  }
-  return undefined;
-}
diff --git a/src/logging.ts b/src/logging.ts
deleted file mode 100644
index 2c34cb54d4..0000000000
--- a/src/logging.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import * as core from "@actions/core";
-
-export interface Logger {
-  debug: (message: string) => void;
-  info: (message: string) => void;
-  warning: (message: string | Error) => void;
-  error: (message: string | Error) => void;
-
-  isDebug: () => boolean;
-
-  startGroup: (name: string) => void;
-  endGroup: () => void;
-}
-
-export function getActionsLogger(): Logger {
-  return {
-    debug: core.debug,
-    info: core.info,
-    warning: core.warning,
-    error: core.error,
-    isDebug: core.isDebug,
-    startGroup: core.startGroup,
-    endGroup: core.endGroup,
-  };
-}
-
-export function getRunnerLogger(debugMode: boolean): Logger {
-  return {
-    // eslint-disable-next-line no-console
-    debug: debugMode ? console.debug : () => undefined,
-    // eslint-disable-next-line no-console
-    info: console.info,
-    // eslint-disable-next-line no-console
-    warning: console.warn,
-    // eslint-disable-next-line no-console
-    error: console.error,
-    isDebug: () => debugMode,
-    startGroup: () => undefined,
-    endGroup: () => undefined,
-  };
-}
-
-export function withGroup(groupName: string, f: () => T): T {
-  core.startGroup(groupName);
-  try {
-    return f();
-  } finally {
-    core.endGroup();
-  }
-}
-
-export async function withGroupAsync(
-  groupName: string,
-  f: () => Promise,
-): Promise {
-  core.startGroup(groupName);
-  try {
-    return await f();
-  } finally {
-    core.endGroup();
-  }
-}
-
-/** Format a duration for use in logs. */
-export function formatDuration(durationMs: number) {
-  if (durationMs < 1000) {
-    return `${durationMs}ms`;
-  }
-
-  if (durationMs < 60 * 1000) {
-    return `${(durationMs / 1000).toFixed(1)}s`;
-  }
-  const minutes = Math.floor(durationMs / (60 * 1000));
-  const seconds = Math.floor((durationMs % (60 * 1000)) / 1000);
-  return `${minutes}m${seconds}s`;
-}
diff --git a/src/overlay/caching.test.ts b/src/overlay/caching.test.ts
deleted file mode 100644
index daf3483ed5..0000000000
--- a/src/overlay/caching.test.ts
+++ /dev/null
@@ -1,415 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as actionsCache from "@actions/cache";
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "../actions-util";
-import * as apiClient from "../api-client";
-import type { ResolveDatabaseOutput } from "../codeql";
-import * as gitUtils from "../git-utils";
-import { BuiltInLanguage } from "../languages";
-import { getRunnerLogger } from "../logging";
-import {
-  createTestConfig,
-  makeMacro,
-  mockCodeQLVersion,
-  setupTests,
-} from "../testing-utils";
-import * as utils from "../util";
-import { withTmpDir } from "../util";
-
-import {
-  downloadOverlayBaseDatabaseFromCache,
-  getCacheRestoreKeyPrefix,
-  getCacheSaveKey,
-  getCodeQlVersionsForOverlayBaseDatabases,
-} from "./caching";
-import { OverlayDatabaseMode } from "./overlay-database-mode";
-
-setupTests(test);
-
-interface DownloadOverlayBaseDatabaseTestCase {
-  overlayDatabaseMode: OverlayDatabaseMode;
-  useOverlayDatabaseCaching: boolean;
-  isInTestMode: boolean;
-  restoreCacheResult: string | undefined | Error;
-  hasBaseDatabaseOidsFile: boolean;
-  tryGetFolderBytesSucceeds: boolean;
-  codeQLVersion: string;
-  resolveDatabaseOutput: ResolveDatabaseOutput | Error;
-}
-
-const defaultDownloadTestCase: DownloadOverlayBaseDatabaseTestCase = {
-  overlayDatabaseMode: OverlayDatabaseMode.Overlay,
-  useOverlayDatabaseCaching: true,
-  isInTestMode: false,
-  restoreCacheResult: "cache-key",
-  hasBaseDatabaseOidsFile: true,
-  tryGetFolderBytesSucceeds: true,
-  codeQLVersion: "2.20.5",
-  resolveDatabaseOutput: { overlayBaseSpecifier: "20250626:XXX" },
-};
-
-const testDownloadOverlayBaseDatabaseFromCache = makeMacro({
-  exec: async (
-    t,
-    partialTestCase: Partial,
-    expectDownloadSuccess: boolean,
-  ) => {
-    await withTmpDir(async (tmpDir) => {
-      const dbLocation = path.join(tmpDir, "db");
-      await fs.promises.mkdir(dbLocation, { recursive: true });
-
-      const logger = getRunnerLogger(true);
-      const testCase = { ...defaultDownloadTestCase, ...partialTestCase };
-      const config = createTestConfig({
-        dbLocation,
-        languages: [BuiltInLanguage.java],
-      });
-
-      config.overlayDatabaseMode = testCase.overlayDatabaseMode;
-      config.useOverlayDatabaseCaching = testCase.useOverlayDatabaseCaching;
-
-      if (testCase.hasBaseDatabaseOidsFile) {
-        const baseDatabaseOidsFile = path.join(
-          dbLocation,
-          "base-database-oids.json",
-        );
-        await fs.promises.writeFile(baseDatabaseOidsFile, JSON.stringify({}));
-      }
-
-      sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-
-      sinon.stub(utils, "isInTestMode").returns(testCase.isInTestMode);
-
-      if (testCase.restoreCacheResult instanceof Error) {
-        sinon
-          .stub(actionsCache, "restoreCache")
-          .rejects(testCase.restoreCacheResult);
-      } else {
-        sinon
-          .stub(actionsCache, "restoreCache")
-          .resolves(testCase.restoreCacheResult);
-      }
-
-      sinon
-        .stub(utils, "tryGetFolderBytes")
-        .resolves(testCase.tryGetFolderBytesSucceeds ? 1024 * 1024 : undefined);
-
-      const codeql = mockCodeQLVersion(testCase.codeQLVersion);
-
-      if (testCase.resolveDatabaseOutput instanceof Error) {
-        sinon
-          .stub(codeql, "resolveDatabase")
-          .rejects(testCase.resolveDatabaseOutput);
-      } else {
-        sinon
-          .stub(codeql, "resolveDatabase")
-          .resolves(testCase.resolveDatabaseOutput);
-      }
-
-      const result = await downloadOverlayBaseDatabaseFromCache(
-        codeql,
-        config,
-        logger,
-      );
-
-      if (expectDownloadSuccess) {
-        t.truthy(result);
-      } else {
-        t.is(result, undefined);
-      }
-    });
-  },
-  title: (title) => `downloadOverlayBaseDatabaseFromCache: ${title}`,
-});
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns stats when successful",
-  {},
-  true,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when mode is OverlayDatabaseMode.OverlayBase",
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when mode is OverlayDatabaseMode.None",
-  {
-    overlayDatabaseMode: OverlayDatabaseMode.None,
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when caching is disabled",
-  {
-    useOverlayDatabaseCaching: false,
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined in test mode",
-  {
-    isInTestMode: true,
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when cache miss",
-  {
-    restoreCacheResult: undefined,
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when download fails",
-  {
-    restoreCacheResult: new Error("Download failed"),
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when downloaded database is invalid",
-  {
-    hasBaseDatabaseOidsFile: false,
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when downloaded database doesn't have an overlayBaseSpecifier",
-  {
-    resolveDatabaseOutput: {},
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when resolving database metadata fails",
-  {
-    resolveDatabaseOutput: new Error("Failed to resolve database metadata"),
-  },
-  false,
-);
-
-testDownloadOverlayBaseDatabaseFromCache.serial(
-  "returns undefined when filesystem error occurs",
-  {
-    tryGetFolderBytesSucceeds: false,
-  },
-  false,
-);
-
-test.serial("overlay-base database cache keys remain stable", async (t) => {
-  const logger = getRunnerLogger(true);
-  const config = createTestConfig({ languages: ["python", "javascript"] });
-  const codeQlVersion = "2.23.0";
-  const commitOid = "abc123def456";
-
-  sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-  sinon.stub(gitUtils, "getCommitOid").resolves(commitOid);
-  sinon.stub(actionsUtil, "getWorkflowRunID").returns(12345);
-  sinon.stub(actionsUtil, "getWorkflowRunAttempt").returns(1);
-
-  const saveKey = await getCacheSaveKey(
-    config,
-    codeQlVersion,
-    "checkout-path",
-    logger,
-  );
-  const expectedSaveKey =
-    "codeql-overlay-base-database-1-c5666c509a2d9895-javascript_python-2.23.0-abc123def456-12345-1";
-  t.is(
-    saveKey,
-    expectedSaveKey,
-    "Cache save key changed unexpectedly. " +
-      "This may indicate breaking changes in the cache key generation logic.",
-  );
-
-  const restoreKeyPrefix = await getCacheRestoreKeyPrefix(
-    config,
-    codeQlVersion,
-  );
-  const expectedRestoreKeyPrefix =
-    "codeql-overlay-base-database-1-c5666c509a2d9895-javascript_python-2.23.0-";
-  t.is(
-    restoreKeyPrefix,
-    expectedRestoreKeyPrefix,
-    "Cache restore key prefix changed unexpectedly. " +
-      "This may indicate breaking changes in the cache key generation logic.",
-  );
-
-  t.true(
-    saveKey.startsWith(restoreKeyPrefix),
-    `Expected save key "${saveKey}" to start with restore key prefix "${restoreKeyPrefix}"`,
-  );
-});
-
-test.serial(
-  "getCodeQlVersionsForOverlayBaseDatabases returns unique versions sorted latest first",
-  async (t) => {
-    const logger = getRunnerLogger(true);
-
-    sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-    sinon.stub(apiClient, "listActionsCaches").resolves([
-      {
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-javascript_python-2.23.0-abc123-1-1",
-      },
-      {
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-javascript_python-2.24.1-def456-2-1",
-      },
-      {
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-javascript_python-2.23.0-ghi789-3-1",
-      },
-    ]);
-
-    const result = await getCodeQlVersionsForOverlayBaseDatabases(
-      ["javascript", "python"],
-      logger,
-    );
-    t.deepEqual(result, ["2.24.1", "2.23.0"]);
-  },
-);
-
-test.serial(
-  "getCodeQlVersionsForOverlayBaseDatabases returns empty list when no caches exist",
-  async (t) => {
-    const logger = getRunnerLogger(true);
-
-    sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-    sinon.stub(apiClient, "listActionsCaches").resolves([]);
-
-    const result = await getCodeQlVersionsForOverlayBaseDatabases(
-      ["python"],
-      logger,
-    );
-    t.deepEqual(result, []);
-  },
-);
-
-test.serial(
-  "getCodeQlVersionsForOverlayBaseDatabases returns empty list when cache keys are unparseable",
-  async (t) => {
-    const logger = getRunnerLogger(true);
-
-    sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-    sinon.stub(apiClient, "listActionsCaches").resolves([
-      {
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-python-malformed",
-      },
-      { key: undefined },
-    ]);
-
-    const result = await getCodeQlVersionsForOverlayBaseDatabases(
-      ["python"],
-      logger,
-    );
-    t.deepEqual(result, []);
-  },
-);
-
-test.serial(
-  "getCodeQlVersionsForOverlayBaseDatabases returns the single version when only one cache exists",
-  async (t) => {
-    const logger = getRunnerLogger(true);
-
-    sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-    sinon.stub(apiClient, "listActionsCaches").resolves([
-      {
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-cpp-2.25.0-abc123-1-1",
-      },
-    ]);
-
-    const result = await getCodeQlVersionsForOverlayBaseDatabases(
-      ["cpp"],
-      logger,
-    );
-    t.deepEqual(result, ["2.25.0"]);
-  },
-);
-
-test.serial(
-  "getCodeQlVersionsForOverlayBaseDatabases resolves language aliases",
-  async (t) => {
-    const logger = getRunnerLogger(true);
-    // The alias `c++` should be resolved to "cpp" and match cache entries keyed with "cpp"
-
-    sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-    sinon.stub(apiClient, "listActionsCaches").resolves([
-      {
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-cpp-2.25.0-abc123-1-1",
-      },
-    ]);
-
-    const result = await getCodeQlVersionsForOverlayBaseDatabases(
-      ["c++"],
-      logger,
-    );
-    t.deepEqual(result, ["2.25.0"]);
-  },
-);
-
-test.serial(
-  "getCodeQlVersionsForOverlayBaseDatabases de-duplicates resolved language aliases",
-  async (t) => {
-    const logger = getRunnerLogger(true);
-
-    sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-    const listActionsCachesStub = sinon
-      .stub(apiClient, "listActionsCaches")
-      .resolves([
-        {
-          key: "codeql-overlay-base-database-1-c5666c509a2d9895-javascript_python-2.25.0-abc123-1-1",
-        },
-      ]);
-
-    const result = await getCodeQlVersionsForOverlayBaseDatabases(
-      ["javascript", "typescript", "Python", "python"],
-      logger,
-    );
-    t.deepEqual(result, ["2.25.0"]);
-    sinon.assert.calledOnceWithExactly(
-      listActionsCachesStub,
-      "codeql-overlay-base-database-1-c5666c509a2d9895-javascript_python-",
-    );
-  },
-);
-
-test.serial(
-  "getCodeQlVersionsForOverlayBaseDatabases ignores nightly versions with build metadata",
-  async (t) => {
-    const logger = getRunnerLogger(true);
-
-    sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/");
-    sinon.stub(apiClient, "listActionsCaches").resolves([
-      {
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-python-2.25.0-abc123-1-1",
-      },
-      {
-        // Nightly release with semver build metadata; should be ignored.
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-python-2.26.0+202604211234-def456-2-1",
-      },
-      {
-        key: "codeql-overlay-base-database-1-c5666c509a2d9895-python-2.24.0-ghi789-3-1",
-      },
-    ]);
-
-    const result = await getCodeQlVersionsForOverlayBaseDatabases(
-      ["python"],
-      logger,
-    );
-    t.deepEqual(result, ["2.25.0", "2.24.0"]);
-  },
-);
diff --git a/src/overlay/caching.ts b/src/overlay/caching.ts
deleted file mode 100644
index c4557cd4ef..0000000000
--- a/src/overlay/caching.ts
+++ /dev/null
@@ -1,521 +0,0 @@
-import * as fs from "fs";
-
-import * as actionsCache from "@actions/cache";
-import * as semver from "semver";
-
-import {
-  getRequiredInput,
-  getWorkflowRunAttempt,
-  getWorkflowRunID,
-} from "../actions-util";
-import { getAutomationID, listActionsCaches } from "../api-client";
-import { createCacheKeyHash } from "../caching-utils";
-import { type CodeQL } from "../codeql";
-import { type Config } from "../config-utils";
-import { getCommitOid } from "../git-utils";
-import { type Language, parseBuiltInLanguage } from "../languages";
-import { type Logger, withGroupAsync } from "../logging";
-import {
-  CleanupLevel,
-  getBaseDatabaseOidsFilePath,
-  getCodeQLDatabasePath,
-  getErrorMessage,
-  isInTestMode,
-  tryGetFolderBytes,
-  waitForResultWithTimeLimit,
-} from "../util";
-
-import { OverlayDatabaseMode } from "./overlay-database-mode";
-
-/**
- * The maximum (uncompressed) size of the overlay base database that we will
- * upload. By default, the Actions Cache has an overall capacity of 10 GB, and
- * the Actions Cache client library uses zstd compression.
- *
- * Ideally we would apply a size limit to the compressed overlay-base database,
- * but we cannot do so because compression is handled transparently by the
- * Actions Cache client library. Instead we place a limit on the uncompressed
- * size of the overlay-base database.
- *
- * Assuming 2.5:1 compression ratio, the 7.5 GB limit on uncompressed data would
- * translate to a limit of around 3 GB after compression.
- */
-const OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500;
-const OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES =
-  OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1_000_000;
-
-// Constants for database caching
-const CACHE_VERSION = 1;
-const CACHE_PREFIX = "codeql-overlay-base-database";
-
-// The purpose of this ten-minute limit is to guard against the possibility
-// that the cache service is unresponsive, which would otherwise cause the
-// entire action to hang.  Normally we expect cache operations to complete
-// within two minutes.
-const MAX_CACHE_OPERATION_MS = 600_000;
-
-/**
- * Checks that the overlay-base database is valid by checking for the
- * existence of the base database OIDs file.
- *
- * @param config The configuration object
- * @param logger The logger instance
- * @param warningPrefix Prefix for the check failure warning message
- * @returns True if the verification succeeded, false otherwise
- */
-async function checkOverlayBaseDatabase(
-  codeql: CodeQL,
-  config: Config,
-  logger: Logger,
-  warningPrefix: string,
-): Promise {
-  // An overlay-base database should contain the base database OIDs file.
-  const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config);
-  if (!fs.existsSync(baseDatabaseOidsFilePath)) {
-    logger.warning(
-      `${warningPrefix}: ${baseDatabaseOidsFilePath} does not exist`,
-    );
-    return false;
-  }
-
-  for (const language of config.languages) {
-    const dbPath = getCodeQLDatabasePath(config, language);
-    try {
-      const resolveDatabaseOutput = await codeql.resolveDatabase(dbPath);
-      if (
-        resolveDatabaseOutput === undefined ||
-        !("overlayBaseSpecifier" in resolveDatabaseOutput)
-      ) {
-        logger.info(`${warningPrefix}: no overlayBaseSpecifier defined`);
-        return false;
-      } else {
-        logger.debug(
-          `Overlay base specifier for ${language} overlay-base database found: ` +
-            `${resolveDatabaseOutput.overlayBaseSpecifier}`,
-        );
-      }
-    } catch (e) {
-      logger.warning(`${warningPrefix}: failed to resolve database: ${e}`);
-      return false;
-    }
-  }
-
-  return true;
-}
-
-/**
- * Uploads the overlay-base database to the GitHub Actions cache. If conditions
- * for uploading are not met, the function does nothing and returns false.
- *
- * This function uses the `checkout_path` input to determine the repository path
- * and works only when called from `analyze` or `upload-sarif`.
- *
- * @param codeql The CodeQL instance
- * @param config The configuration object
- * @param logger The logger instance
- * @returns A promise that resolves to true if the upload was performed and
- * successfully completed, or false otherwise
- */
-export async function cleanupAndUploadOverlayBaseDatabaseToCache(
-  codeql: CodeQL,
-  config: Config,
-  logger: Logger,
-): Promise {
-  const overlayDatabaseMode = config.overlayDatabaseMode;
-  if (overlayDatabaseMode !== OverlayDatabaseMode.OverlayBase) {
-    logger.debug(
-      `Overlay database mode is ${overlayDatabaseMode}. ` +
-        "Skip uploading overlay-base database to cache.",
-    );
-    return false;
-  }
-  if (!config.useOverlayDatabaseCaching) {
-    logger.debug(
-      "Overlay database caching is disabled. " +
-        "Skip uploading overlay-base database to cache.",
-    );
-    return false;
-  }
-  if (isInTestMode()) {
-    logger.debug(
-      "In test mode. Skip uploading overlay-base database to cache.",
-    );
-    return false;
-  }
-
-  const databaseIsValid = await checkOverlayBaseDatabase(
-    codeql,
-    config,
-    logger,
-    "Abort uploading overlay-base database to cache",
-  );
-  if (!databaseIsValid) {
-    return false;
-  }
-
-  // Clean up the database using the overlay cleanup level.
-  await withGroupAsync("Cleaning up databases", async () => {
-    await codeql.databaseCleanupCluster(config, CleanupLevel.Overlay);
-  });
-
-  const dbLocation = config.dbLocation;
-
-  const databaseSizeBytes = await tryGetFolderBytes(dbLocation, logger);
-  if (databaseSizeBytes === undefined) {
-    logger.warning(
-      "Failed to determine database size. " +
-        "Skip uploading overlay-base database to cache.",
-    );
-    return false;
-  }
-
-  if (databaseSizeBytes > OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES) {
-    const databaseSizeMB = Math.round(databaseSizeBytes / 1_000_000);
-    logger.warning(
-      `Database size (${databaseSizeMB} MB) ` +
-        `exceeds maximum upload size (${OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB} MB). ` +
-        "Skip uploading overlay-base database to cache.",
-    );
-    return false;
-  }
-
-  const codeQlVersion = (await codeql.getVersion()).version;
-  const checkoutPath = getRequiredInput("checkout_path");
-  const cacheSaveKey = await getCacheSaveKey(
-    config,
-    codeQlVersion,
-    checkoutPath,
-    logger,
-  );
-  logger.info(
-    `Uploading overlay-base database to Actions cache with key ${cacheSaveKey}`,
-  );
-
-  try {
-    const cacheId = await waitForResultWithTimeLimit(
-      MAX_CACHE_OPERATION_MS,
-      actionsCache.saveCache([dbLocation], cacheSaveKey),
-      () => {},
-    );
-    if (cacheId === undefined) {
-      logger.warning("Timed out while uploading overlay-base database");
-      return false;
-    }
-  } catch (error) {
-    logger.warning(
-      "Failed to upload overlay-base database to cache: " +
-        `${error instanceof Error ? error.message : String(error)}`,
-    );
-    return false;
-  }
-  logger.info(`Successfully uploaded overlay-base database from ${dbLocation}`);
-  return true;
-}
-
-export interface OverlayBaseDatabaseDownloadStats {
-  databaseSizeBytes: number;
-  databaseDownloadDurationMs: number;
-}
-
-/**
- * Downloads the overlay-base database from the GitHub Actions cache. If conditions
- * for downloading are not met, the function does nothing and returns false.
- *
- * @param codeql The CodeQL instance
- * @param config The configuration object
- * @param logger The logger instance
- * @returns A promise that resolves to download statistics if an overlay-base
- * database was successfully downloaded, or undefined if the download was
- * either not performed or failed.
- */
-export async function downloadOverlayBaseDatabaseFromCache(
-  codeql: CodeQL,
-  config: Config,
-  logger: Logger,
-): Promise {
-  const overlayDatabaseMode = config.overlayDatabaseMode;
-  if (overlayDatabaseMode !== OverlayDatabaseMode.Overlay) {
-    logger.debug(
-      `Overlay database mode is ${overlayDatabaseMode}. ` +
-        "Skip downloading overlay-base database from cache.",
-    );
-    return undefined;
-  }
-  if (!config.useOverlayDatabaseCaching) {
-    logger.debug(
-      "Overlay database caching is disabled. " +
-        "Skip downloading overlay-base database from cache.",
-    );
-    return undefined;
-  }
-  if (isInTestMode()) {
-    logger.debug(
-      "In test mode. Skip downloading overlay-base database from cache.",
-    );
-    return undefined;
-  }
-
-  const dbLocation = config.dbLocation;
-  const codeQlVersion = (await codeql.getVersion()).version;
-  const cacheRestoreKeyPrefix = await getCacheRestoreKeyPrefix(
-    config,
-    codeQlVersion,
-  );
-
-  logger.info(
-    "Looking in Actions cache for overlay-base database with " +
-      `restore key ${cacheRestoreKeyPrefix}`,
-  );
-
-  let databaseDownloadDurationMs = 0;
-  try {
-    const databaseDownloadStart = performance.now();
-    const foundKey = await waitForResultWithTimeLimit(
-      // This ten-minute limit for the cache restore operation is mainly to
-      // guard against the possibility that the cache service is unresponsive
-      // and hangs outside the data download.
-      //
-      // Data download (which is normally the most time-consuming part of the
-      // restore operation) should not run long enough to hit this limit. Even
-      // for an extremely large 10GB database, at a download speed of 40MB/s
-      // (see below), the download should complete within five minutes. If we
-      // do hit this limit, there are likely more serious problems other than
-      // mere slow download speed.
-      //
-      // This is important because we don't want any ongoing file operations
-      // on the database directory when we do hit this limit. Hitting this
-      // time limit takes us to a fallback path where we re-initialize the
-      // database from scratch at dbLocation, and having the cache restore
-      // operation continue to write into dbLocation in the background would
-      // really mess things up. We want to hit this limit only in the case
-      // of a hung cache service, not just slow download speed.
-      MAX_CACHE_OPERATION_MS,
-      actionsCache.restoreCache(
-        [dbLocation],
-        cacheRestoreKeyPrefix,
-        undefined,
-        {
-          // Azure SDK download (which is the default) uses 128MB segments; see
-          // https://github.com/actions/toolkit/blob/main/packages/cache/README.md.
-          // Setting segmentTimeoutInMs to 3000 translates to segment download
-          // speed of about 40 MB/s, which should be achievable unless the
-          // download is unreliable (in which case we do want to abort).
-          segmentTimeoutInMs: 3000,
-        },
-      ),
-      () => {
-        logger.info("Timed out downloading overlay-base database from cache");
-      },
-    );
-    databaseDownloadDurationMs = Math.round(
-      performance.now() - databaseDownloadStart,
-    );
-
-    if (foundKey === undefined) {
-      logger.info("No overlay-base database found in Actions cache");
-      return undefined;
-    }
-
-    logger.info(
-      `Downloaded overlay-base database in cache with key ${foundKey}`,
-    );
-  } catch (error) {
-    logger.warning(
-      "Failed to download overlay-base database from cache: " +
-        `${error instanceof Error ? error.message : String(error)}`,
-    );
-    return undefined;
-  }
-
-  const databaseIsValid = await checkOverlayBaseDatabase(
-    codeql,
-    config,
-    logger,
-    "Downloaded overlay-base database is invalid",
-  );
-  if (!databaseIsValid) {
-    logger.warning("Downloaded overlay-base database failed validation");
-    return undefined;
-  }
-
-  const databaseSizeBytes = await tryGetFolderBytes(dbLocation, logger);
-  if (databaseSizeBytes === undefined) {
-    logger.info(
-      "Filesystem error while accessing downloaded overlay-base database",
-    );
-    // The problem that warrants reporting download failure is not that we are
-    // unable to determine the size of the database. Rather, it is that we
-    // encountered a filesystem error while accessing the database, which
-    // indicates that an overlay analysis will likely fail.
-    return undefined;
-  }
-
-  logger.info(`Successfully downloaded overlay-base database to ${dbLocation}`);
-  return {
-    databaseSizeBytes: Math.round(databaseSizeBytes),
-    databaseDownloadDurationMs,
-  };
-}
-
-/**
- * Computes the cache key for saving the overlay-base database to the GitHub
- * Actions cache.
- *
- * The key consists of the restore key prefix (which does not include the
- * commit SHA) and the commit SHA of the current checkout.
- */
-export async function getCacheSaveKey(
-  config: Config,
-  codeQlVersion: string,
-  checkoutPath: string,
-  logger: Logger,
-): Promise {
-  let runId = 1;
-  let attemptId = 1;
-  try {
-    runId = getWorkflowRunID();
-    attemptId = getWorkflowRunAttempt();
-  } catch (e) {
-    logger.warning(
-      `Failed to get workflow run ID or attempt ID. Reason: ${getErrorMessage(e)}`,
-    );
-  }
-  const sha = await getCommitOid(checkoutPath);
-  const restoreKeyPrefix = await getCacheRestoreKeyPrefix(
-    config,
-    codeQlVersion,
-  );
-  return `${restoreKeyPrefix}${sha}-${runId}-${attemptId}`;
-}
-
-/**
- * Computes the cache key prefix for restoring the overlay-base database from
- * the GitHub Actions cache.
- *
- * Actions cache supports using multiple restore keys to indicate preference,
- * and this function could in principle take advantage of that feature by
- * returning a list of restore key prefixes. However, since overlay-base
- * databases are built from the default branch and used in PR analysis, it is
- * exceedingly unlikely that the commit SHA will ever be the same.
- *
- * Therefore, this function returns only a single restore key prefix, which does
- * not include the commit SHA. This allows us to restore the most recent
- * compatible overlay-base database.
- */
-export async function getCacheRestoreKeyPrefix(
-  config: Config,
-  codeQlVersion: string,
-): Promise {
-  return `${await getCacheKeyPrefixBase(config.languages)}${codeQlVersion}-`;
-}
-
-/**
- * Computes the cache key prefix for overlay-base databases, excluding the
- * CodeQL version.
- */
-async function getCacheKeyPrefixBase(
-  parsedLanguages: Language[],
-): Promise {
-  const languagesComponent = [...parsedLanguages].sort().join("_");
-
-  const cacheKeyComponents = {
-    automationID: await getAutomationID(),
-    // Add more components here as needed in the future
-  };
-  const componentsHash = createCacheKeyHash(cacheKeyComponents);
-
-  // CACHE_PREFIX: distinguishes overlay-base databases from other cache objects
-  // CACHE_VERSION: cache format version
-  // componentsHash: hash of additional components (see above for details)
-  // languagesComponent: the languages included in the overlay-base database
-  //
-  // Technically we can also include languages in the componentsHash, but
-  // including them explicitly in the cache key makes it easier to debug and
-  // understand the cache key structure.
-  return `${CACHE_PREFIX}-${CACHE_VERSION}-${componentsHash}-${languagesComponent}-`;
-}
-
-/**
- * Searches the GitHub Actions cache for overlay-base databases matching the given languages, and
- * returns all stable CodeQL versions found across matching cache entries.
- *
- * Note that we do not guarantee that the cache entry for these versions of CodeQL will still be
- * present by the time we attempt to restore the cache. We could achieve that with a download retry
- * loop, but we expect that if there is sufficient Actions cache contention that an overlay-base
- * cache entry for a particular CodeQL version is evicted before we can use it, then it is likely
- * that the same thing will happen to other overlay-base cache entries, and therefore we will not be
- * able to use overlay.
- *
- * @returns Unique stable CodeQL versions found in cached overlay-base databases, sorted from latest to
- * earliest, or undefined if one of the languages is not a built-in language.
- */
-export async function getCodeQlVersionsForOverlayBaseDatabases(
-  rawLanguages: string[],
-  logger: Logger,
-): Promise {
-  const languages = rawLanguages.map(parseBuiltInLanguage);
-  if (languages.includes(undefined)) {
-    logger.warning(
-      "One or more provided languages are not recognized as built-in languages. " +
-        "Skipping searching for overlay-base databases in cache.",
-    );
-    return undefined;
-  }
-  const dedupedLanguages = [
-    ...new Set(languages.filter((l) => l !== undefined)),
-  ];
-  const cacheKeyPrefix = await getCacheKeyPrefixBase(dedupedLanguages);
-
-  logger.debug(
-    `Searching for overlay-base databases in Actions cache with ` +
-      `prefix ${cacheKeyPrefix}`,
-  );
-
-  const caches = await listActionsCaches(cacheKeyPrefix);
-
-  if (caches.length === 0) {
-    logger.info("No overlay-base databases found in Actions cache.");
-    return [];
-  }
-
-  logger.info(
-    `Found ${caches.length} overlay-base ` +
-      `${caches.length === 1 ? "database" : "databases"} in the Actions cache.`,
-  );
-
-  // Parse CodeQL versions from cache keys, matching only stable releases.
-  //
-  // After the prefix, the remaining key format starts with `${codeQlVersion}-`. Nightlies will have
-  // a suffix like `+202604201548` that will break the match.
-  //
-  // Caveat: this relies on the fact that we haven't released any CodeQL bundles with the
-  // `x.y.z-` semver format which does not interact well with the current overlay base
-  // DB cache key format.
-  const versionRegex = /^([\d.]+)-/;
-  const versionSet = new Set();
-
-  for (const cache of caches) {
-    if (!cache.key) continue;
-    const suffix = cache.key.substring(cacheKeyPrefix.length);
-    const match = suffix.match(versionRegex);
-    if (match && semver.valid(match[1])) {
-      versionSet.add(match[1]);
-    }
-  }
-
-  if (versionSet.size === 0) {
-    logger.info(
-      "Could not parse any CodeQL versions from overlay-base database " +
-        "cache keys.",
-    );
-    return [];
-  }
-
-  const versions = [...versionSet].sort(semver.rcompare);
-
-  logger.info(
-    `Found overlay databases for the following CodeQL versions in the Actions cache: ${versions.join(", ")}`,
-  );
-
-  return versions;
-}
diff --git a/src/overlay/diagnostics.ts b/src/overlay/diagnostics.ts
deleted file mode 100644
index 4b716c3df8..0000000000
--- a/src/overlay/diagnostics.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import { type CodeQL } from "../codeql";
-import { type Config } from "../config-utils";
-import {
-  addNoLanguageDiagnostic,
-  makeDiagnostic,
-  makeTelemetryDiagnostic,
-} from "../diagnostics";
-import { DocUrl } from "../doc-url";
-import { RepositoryPropertyName } from "../feature-flags/properties";
-
-/** Reason why overlay analysis was disabled. */
-export enum OverlayDisabledReason {
-  /** Overlay analysis was disabled by the CODEQL_OVERLAY_DATABASE_MODE environment variable being set to "none". */
-  DisabledByEnvironmentVariable = "disabled-by-environment-variable",
-  /** Overlay analysis was disabled by a repository property. */
-  DisabledByRepositoryProperty = "disabled-by-repository-property",
-  /** The build mode is incompatible with overlay analysis. */
-  IncompatibleBuildMode = "incompatible-build-mode",
-  /** The CodeQL CLI version is too old to support overlay analysis. */
-  IncompatibleCodeQl = "incompatible-codeql",
-  /** The Git version could not be determined or is too old. */
-  IncompatibleGit = "incompatible-git",
-  /** The runner does not have enough disk space to perform overlay analysis. */
-  InsufficientDiskSpace = "insufficient-disk-space",
-  /** The runner does not have enough memory to perform overlay analysis. */
-  InsufficientMemory = "insufficient-memory",
-  /** Overlay analysis is not enabled for one or more of the configured languages. */
-  LanguageNotEnabled = "language-not-enabled",
-  /** The source root is not inside a git repository. */
-  NoGitRoot = "no-git-root",
-  /**
-   * For one or more of the configured languages, overlay analysis is only
-   * enabled when using the default query suite, but the config customises the
-   * queries by disabling default queries, specifying custom queries or packs,
-   * or adding query filters.
-   */
-  NonDefaultQueries = "non-default-queries",
-  /** We are not analyzing a pull request or the default branch. */
-  NotPullRequestOrDefaultBranch = "not-pull-request-or-default-branch",
-  /** The top-level overlay analysis feature flag is not enabled. */
-  OverallFeatureNotEnabled = "overall-feature-not-enabled",
-  /**
-   * Overlay analysis was selected for a pull request, but diff-informed
-   * analysis was not enabled for the run (for example, because the
-   * `DiffInformedQueries` feature flag is off, the GHES version is too old,
-   * or the PR diff ranges could not be computed). Overlay analysis has only
-   * been validated in combination with diff-informed analysis, so we fall
-   * back to a non-overlay analysis in this case.
-   */
-  DiffInformedAnalysisNotEnabled = "diff-informed-analysis-not-enabled",
-  /** Overlay analysis was skipped because it previously failed with similar hardware resources. */
-  SkippedDueToCachedStatus = "skipped-due-to-cached-status",
-  /** Disk usage could not be determined during the overlay status check. */
-  UnableToDetermineDiskUsage = "unable-to-determine-disk-usage",
-}
-
-/**
- * Add diagnostics related to why overlay was disabled. This includes:
- *
- * - A telemetry diagnostic that logs the disablement reason.
- * - User-facing diagnostics for specific disablement reasons that are
- *   actionable by the user.
- */
-export async function addOverlayDisablementDiagnostics(
-  config: Config,
-  codeql: CodeQL,
-  overlayDisabledReason: OverlayDisabledReason,
-): Promise {
-  addNoLanguageDiagnostic(
-    config,
-    makeTelemetryDiagnostic(
-      "codeql-action/overlay-disabled",
-      "Overlay analysis disabled",
-      {
-        reason: overlayDisabledReason,
-      },
-    ),
-  );
-
-  if (
-    overlayDisabledReason === OverlayDisabledReason.SkippedDueToCachedStatus
-  ) {
-    addNoLanguageDiagnostic(
-      config,
-      makeDiagnostic(
-        "codeql-action/overlay-disabled-due-to-cached-status",
-        "Skipped improved incremental analysis because it failed previously with similar hardware resources",
-        {
-          attributes: {
-            languages: config.languages,
-          },
-          markdownMessage:
-            `Improved incremental analysis was skipped because it previously failed for this repository ` +
-            `with CodeQL version ${(await codeql.getVersion()).version} on a runner with similar hardware resources. ` +
-            "One possible reason for this is that improved incremental analysis can require a significant amount of disk space for some repositories. " +
-            "If you want to try re-enabling improved incremental analysis, increase the disk space available " +
-            "to the runner. If that doesn't help, contact GitHub Support for further assistance.\n\n" +
-            "Improved incremental analysis will be automatically retried when the next version of CodeQL is released. " +
-            `You can also manually trigger a retry by [removing](${DocUrl.DELETE_ACTIONS_CACHE_ENTRIES}) \`codeql-overlay-status-*\` entries from the Actions cache.`,
-          severity: "note",
-          visibility: {
-            cliSummaryTable: true,
-            statusPage: true,
-            telemetry: false,
-          },
-        },
-      ),
-    );
-  }
-
-  if (
-    overlayDisabledReason === OverlayDisabledReason.DisabledByRepositoryProperty
-  ) {
-    addNoLanguageDiagnostic(
-      config,
-      makeDiagnostic(
-        "codeql-action/overlay-disabled-by-repository-property",
-        "Improved incremental analysis disabled by repository property",
-        {
-          attributes: {
-            languages: config.languages,
-          },
-          markdownMessage:
-            "Improved incremental analysis has been disabled because the " +
-            `\`${RepositoryPropertyName.DISABLE_OVERLAY}\` repository property is set to \`true\`. ` +
-            "To re-enable improved incremental analysis, set this property to `false` or remove it.",
-          severity: "note",
-          visibility: {
-            cliSummaryTable: true,
-            statusPage: true,
-            telemetry: false,
-          },
-        },
-      ),
-    );
-  }
-}
diff --git a/src/overlay/index.test.ts b/src/overlay/index.test.ts
deleted file mode 100644
index 967ccf3a7d..0000000000
--- a/src/overlay/index.test.ts
+++ /dev/null
@@ -1,290 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "../actions-util";
-import * as gitUtils from "../git-utils";
-import { getRunnerLogger } from "../logging";
-import { createTestConfig, setupTests } from "../testing-utils";
-import { withTmpDir } from "../util";
-
-import { writeBaseDatabaseOidsFile, writeOverlayChangesFile } from ".";
-
-setupTests(test);
-
-test.serial(
-  "writeOverlayChangesFile generates correct changes file",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const [dbLocation, sourceRoot, tempDir] = ["db", "src", "temp"].map((d) =>
-        path.join(tmpDir, d),
-      );
-      await Promise.all(
-        [dbLocation, sourceRoot, tempDir].map((d) =>
-          fs.promises.mkdir(d, { recursive: true }),
-        ),
-      );
-
-      const logger = getRunnerLogger(true);
-      const config = createTestConfig({ dbLocation });
-
-      // Mock the getFileOidsUnderPath function to return base OIDs
-      const baseOids = {
-        "unchanged.js": "aaa111",
-        "modified.js": "bbb222",
-        "deleted.js": "ccc333",
-      };
-      const getFileOidsStubForBase = sinon
-        .stub(gitUtils, "getFileOidsUnderPath")
-        .resolves(baseOids);
-
-      // Write the base database OIDs file
-      await writeBaseDatabaseOidsFile(config, sourceRoot);
-      getFileOidsStubForBase.restore();
-
-      // Mock the getFileOidsUnderPath function to return overlay OIDs
-      const currentOids = {
-        "unchanged.js": "aaa111",
-        "modified.js": "ddd444", // Changed OID
-        "added.js": "eee555", // New file
-      };
-      sinon.stub(gitUtils, "getFileOidsUnderPath").resolves(currentOids);
-
-      // Write the overlay changes file, which uses the mocked overlay OIDs
-      // and the base database OIDs file
-      const diffRangeFilePath = path.join(tempDir, "pr-diff-range.json");
-      sinon.stub(actionsUtil, "getTemporaryDirectory").returns(tempDir);
-      sinon
-        .stub(actionsUtil, "getDiffRangesJsonFilePath")
-        .returns(diffRangeFilePath);
-      sinon.stub(gitUtils, "getGitRoot").resolves(sourceRoot);
-      const changesFilePath = await writeOverlayChangesFile(
-        config,
-        sourceRoot,
-        logger,
-      );
-
-      const fileContent = await fs.promises.readFile(changesFilePath, "utf-8");
-      const parsedContent = JSON.parse(fileContent) as { changes: string[] };
-
-      t.deepEqual(
-        parsedContent.changes.sort(),
-        ["added.js", "deleted.js", "modified.js"],
-        "Should identify added, deleted, and modified files",
-      );
-    });
-  },
-);
-
-test.serial(
-  "writeOverlayChangesFile merges additional diff files into overlay changes",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const [dbLocation, sourceRoot, tempDir] = ["db", "src", "temp"].map((d) =>
-        path.join(tmpDir, d),
-      );
-      await Promise.all(
-        [dbLocation, sourceRoot, tempDir].map((d) =>
-          fs.promises.mkdir(d, { recursive: true }),
-        ),
-      );
-
-      const logger = getRunnerLogger(true);
-      const config = createTestConfig({ dbLocation });
-
-      // Mock the getFileOidsUnderPath function to return base OIDs
-      // "reverted.js" has the same OID in both base and current, simulating
-      // a revert PR where the file content matches the overlay-base
-      const baseOids = {
-        "unchanged.js": "aaa111",
-        "modified.js": "bbb222",
-        "reverted.js": "eee555",
-      };
-      const getFileOidsStubForBase = sinon
-        .stub(gitUtils, "getFileOidsUnderPath")
-        .resolves(baseOids);
-
-      // Write the base database OIDs file
-      await writeBaseDatabaseOidsFile(config, sourceRoot);
-      getFileOidsStubForBase.restore();
-
-      // Mock the getFileOidsUnderPath function to return overlay OIDs
-      // "reverted.js" has the same OID as the base -- OID comparison alone
-      // would NOT include it, only additionalChangedFiles causes it to appear
-      const currentOids = {
-        "unchanged.js": "aaa111",
-        "modified.js": "ddd444", // Changed OID
-        "reverted.js": "eee555", // Same OID as base -- not detected by OID comparison
-      };
-      sinon.stub(gitUtils, "getFileOidsUnderPath").resolves(currentOids);
-
-      const diffRangeFilePath = path.join(tempDir, "pr-diff-range.json");
-      sinon.stub(actionsUtil, "getTemporaryDirectory").returns(tempDir);
-      sinon
-        .stub(actionsUtil, "getDiffRangesJsonFilePath")
-        .returns(diffRangeFilePath);
-      sinon.stub(gitUtils, "getGitRoot").resolves(sourceRoot);
-
-      // Write a pr-diff-range.json file with diff ranges including
-      // "reverted.js" (unchanged OIDs) and "modified.js" (already in OID changes)
-      await fs.promises.writeFile(
-        diffRangeFilePath,
-        JSON.stringify([
-          { path: "reverted.js", startLine: 1, endLine: 10 },
-          { path: "modified.js", startLine: 1, endLine: 5 },
-          { path: "diff-only.js", startLine: 1, endLine: 3 },
-        ]),
-      );
-
-      const changesFilePath = await writeOverlayChangesFile(
-        config,
-        sourceRoot,
-        logger,
-      );
-
-      const fileContent = await fs.promises.readFile(changesFilePath, "utf-8");
-      const parsedContent = JSON.parse(fileContent) as { changes: string[] };
-
-      t.deepEqual(
-        parsedContent.changes.sort(),
-        ["diff-only.js", "modified.js", "reverted.js"],
-        "Should include OID-changed files, diff-only files, and deduplicate overlapping files",
-      );
-    });
-  },
-);
-
-test.serial(
-  "writeOverlayChangesFile works without additional diff files",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const [dbLocation, sourceRoot, tempDir] = ["db", "src", "temp"].map((d) =>
-        path.join(tmpDir, d),
-      );
-      await Promise.all(
-        [dbLocation, sourceRoot, tempDir].map((d) =>
-          fs.promises.mkdir(d, { recursive: true }),
-        ),
-      );
-
-      const logger = getRunnerLogger(true);
-      const config = createTestConfig({ dbLocation });
-
-      // Mock the getFileOidsUnderPath function to return base OIDs
-      const baseOids = {
-        "unchanged.js": "aaa111",
-        "modified.js": "bbb222",
-      };
-      const getFileOidsStubForBase = sinon
-        .stub(gitUtils, "getFileOidsUnderPath")
-        .resolves(baseOids);
-
-      await writeBaseDatabaseOidsFile(config, sourceRoot);
-      getFileOidsStubForBase.restore();
-
-      const currentOids = {
-        "unchanged.js": "aaa111",
-        "modified.js": "ddd444",
-      };
-      sinon.stub(gitUtils, "getFileOidsUnderPath").resolves(currentOids);
-
-      const diffRangeFilePath = path.join(tempDir, "pr-diff-range.json");
-      sinon.stub(actionsUtil, "getTemporaryDirectory").returns(tempDir);
-      sinon
-        .stub(actionsUtil, "getDiffRangesJsonFilePath")
-        .returns(diffRangeFilePath);
-      sinon.stub(gitUtils, "getGitRoot").resolves(sourceRoot);
-
-      // No pr-diff-range.json file exists - should work the same as before
-      const changesFilePath = await writeOverlayChangesFile(
-        config,
-        sourceRoot,
-        logger,
-      );
-
-      const fileContent = await fs.promises.readFile(changesFilePath, "utf-8");
-      const parsedContent = JSON.parse(fileContent) as { changes: string[] };
-
-      t.deepEqual(
-        parsedContent.changes.sort(),
-        ["modified.js"],
-        "Should only include OID-changed files when no additional files provided",
-      );
-    });
-  },
-);
-
-test.serial(
-  "writeOverlayChangesFile converts diff range paths to sourceRoot-relative when sourceRoot is a subdirectory",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      // Simulate: repo root = tmpDir, sourceRoot = tmpDir/src
-      const repoRoot = tmpDir;
-      const sourceRoot = path.join(tmpDir, "src");
-      const [dbLocation, tempDir] = ["db", "temp"].map((d) =>
-        path.join(tmpDir, d),
-      );
-      await Promise.all(
-        [dbLocation, sourceRoot, tempDir].map((d) =>
-          fs.promises.mkdir(d, { recursive: true }),
-        ),
-      );
-
-      const logger = getRunnerLogger(true);
-      const config = createTestConfig({ dbLocation });
-
-      // Base OIDs (sourceRoot-relative paths)
-      const baseOids = {
-        "app.js": "aaa111",
-        "lib/util.js": "bbb222",
-      };
-      const getFileOidsStubForBase = sinon
-        .stub(gitUtils, "getFileOidsUnderPath")
-        .resolves(baseOids);
-      await writeBaseDatabaseOidsFile(config, sourceRoot);
-      getFileOidsStubForBase.restore();
-
-      // Current OIDs — same as base (no OID changes)
-      const currentOids = {
-        "app.js": "aaa111",
-        "lib/util.js": "bbb222",
-      };
-      sinon.stub(gitUtils, "getFileOidsUnderPath").resolves(currentOids);
-
-      const diffRangeFilePath = path.join(tempDir, "pr-diff-range.json");
-      sinon.stub(actionsUtil, "getTemporaryDirectory").returns(tempDir);
-      sinon
-        .stub(actionsUtil, "getDiffRangesJsonFilePath")
-        .returns(diffRangeFilePath);
-      // getGitRoot returns the repo root (parent of sourceRoot)
-      sinon.stub(gitUtils, "getGitRoot").resolves(repoRoot);
-
-      // Diff ranges use repo-root-relative paths (as returned by the GitHub compare API)
-      await fs.promises.writeFile(
-        diffRangeFilePath,
-        JSON.stringify([
-          { path: "src/app.js", startLine: 1, endLine: 10 },
-          { path: "src/lib/util.js", startLine: 5, endLine: 8 },
-          { path: "other/outside.js", startLine: 1, endLine: 3 }, // not under sourceRoot
-        ]),
-      );
-
-      const changesFilePath = await writeOverlayChangesFile(
-        config,
-        sourceRoot,
-        logger,
-      );
-
-      const fileContent = await fs.promises.readFile(changesFilePath, "utf-8");
-      const parsedContent = JSON.parse(fileContent) as { changes: string[] };
-
-      t.deepEqual(
-        parsedContent.changes.sort(),
-        ["app.js", "lib/util.js"],
-        "Should convert repo-root-relative paths to sourceRoot-relative and filter out files outside sourceRoot",
-      );
-    });
-  },
-);
diff --git a/src/overlay/index.ts b/src/overlay/index.ts
deleted file mode 100644
index 16c4d80c1f..0000000000
--- a/src/overlay/index.ts
+++ /dev/null
@@ -1,195 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as actionsUtil from "../actions-util";
-import { getOptionalInput, getTemporaryDirectory } from "../actions-util";
-import { type Config } from "../config-utils";
-import { getFileOidsUnderPath, getGitRoot } from "../git-utils";
-import { Logger } from "../logging";
-import { getBaseDatabaseOidsFilePath } from "../util";
-
-export const CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8";
-
-// Per-language minimum CLI versions for overlay analysis, based on release
-// validation data.
-export const CODEQL_OVERLAY_MINIMUM_VERSION_CPP = "2.25.0";
-export const CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1";
-export const CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2";
-export const CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8";
-export const CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9";
-export const CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9";
-export const CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9";
-
-/**
- * Writes a JSON file containing Git OIDs for all tracked files (represented
- * by path relative to the source root) under the source root. The file is
- * written into the database location specified in the config.
- *
- * @param config The configuration object containing the database location
- * @param sourceRoot The root directory containing the source files to process
- * @throws {Error} If the Git repository root cannot be determined
- */
-export async function writeBaseDatabaseOidsFile(
-  config: Config,
-  sourceRoot: string,
-): Promise {
-  const gitFileOids = await getFileOidsUnderPath(sourceRoot);
-  const gitFileOidsJson = JSON.stringify(gitFileOids);
-  const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config);
-  await fs.promises.writeFile(baseDatabaseOidsFilePath, gitFileOidsJson);
-}
-
-/**
- * Reads and parses the JSON file containing the base database Git OIDs.
- * This file contains the mapping of file paths to their corresponding Git OIDs
- * that was previously written by writeBaseDatabaseOidsFile().
- *
- * @param config The configuration object containing the database location
- * @param logger The logger instance to use for error reporting
- * @returns An object mapping file paths (relative to source root) to their Git OIDs
- * @throws {Error} If the file cannot be read or parsed
- */
-async function readBaseDatabaseOidsFile(
-  config: Config,
-  logger: Logger,
-): Promise<{ [key: string]: string }> {
-  const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config);
-  try {
-    const contents = await fs.promises.readFile(
-      baseDatabaseOidsFilePath,
-      "utf-8",
-    );
-    return JSON.parse(contents) as { [key: string]: string };
-  } catch (e) {
-    logger.error(
-      "Failed to read overlay-base file OIDs from " +
-        `${baseDatabaseOidsFilePath}: ${(e as any).message || e}`,
-    );
-    throw e;
-  }
-}
-
-/**
- * Writes a JSON file containing the source-root-relative paths of files under
- * `sourceRoot` that have changed (added, removed, or modified) from the overlay
- * base database.
- *
- * This function uses the Git index to determine which files have changed, so it
- * requires the following preconditions, both when this function is called and
- * when the overlay-base database was initialized:
- *
- * - It requires that `sourceRoot` is inside a Git repository.
- * - It assumes that all changes in the working tree are staged in the index.
- * - It assumes that all files of interest are tracked by Git, e.g. not covered
- *   by `.gitignore`.
- */
-export async function writeOverlayChangesFile(
-  config: Config,
-  sourceRoot: string,
-  logger: Logger,
-): Promise {
-  const baseFileOids = await readBaseDatabaseOidsFile(config, logger);
-  const overlayFileOids = await getFileOidsUnderPath(sourceRoot);
-  const oidChangedFiles = computeChangedFiles(baseFileOids, overlayFileOids);
-  logger.info(
-    `Found ${oidChangedFiles.length} changed file(s) under ${sourceRoot} from OID comparison.`,
-  );
-
-  // Merge in any file paths from precomputed PR diff ranges to ensure the
-  // overlay always includes all files from the PR diff, even in edge cases
-  // like revert PRs where OID comparison shows no change.
-  const diffRangeFiles = await getDiffRangeFilePaths(sourceRoot, logger);
-  const changedFiles = [...new Set([...oidChangedFiles, ...diffRangeFiles])];
-
-  const changedFilesJson = JSON.stringify({ changes: changedFiles });
-  const overlayChangesFile = path.join(
-    getTemporaryDirectory(),
-    "overlay-changes.json",
-  );
-  logger.debug(
-    `Writing overlay changed files to ${overlayChangesFile}: ${changedFilesJson}`,
-  );
-  await fs.promises.writeFile(overlayChangesFile, changedFilesJson);
-  return overlayChangesFile;
-}
-
-function computeChangedFiles(
-  baseFileOids: { [key: string]: string },
-  overlayFileOids: { [key: string]: string },
-): string[] {
-  const changes: string[] = [];
-  for (const [file, oid] of Object.entries(overlayFileOids)) {
-    if (!(file in baseFileOids) || baseFileOids[file] !== oid) {
-      changes.push(file);
-    }
-  }
-  for (const file of Object.keys(baseFileOids)) {
-    if (!(file in overlayFileOids)) {
-      changes.push(file);
-    }
-  }
-  return changes;
-}
-
-async function getDiffRangeFilePaths(
-  sourceRoot: string,
-  logger: Logger,
-): Promise {
-  const jsonFilePath = actionsUtil.getDiffRangesJsonFilePath();
-
-  if (!fs.existsSync(jsonFilePath)) {
-    logger.debug(
-      `No diff ranges JSON file found at ${jsonFilePath}; skipping.`,
-    );
-    return [];
-  }
-
-  let contents: string;
-  try {
-    contents = await fs.promises.readFile(jsonFilePath, "utf8");
-  } catch (e) {
-    logger.warning(
-      `Failed to read diff ranges JSON file at ${jsonFilePath}: ${e}`,
-    );
-    return [];
-  }
-
-  let diffRanges: Array<{ path: string }>;
-  try {
-    diffRanges = JSON.parse(contents) as Array<{ path: string }>;
-  } catch (e) {
-    logger.warning(
-      `Failed to parse diff ranges JSON file at ${jsonFilePath}: ${e}`,
-    );
-    return [];
-  }
-  logger.debug(
-    `Read ${diffRanges.length} diff range(s) from ${jsonFilePath} for overlay changes.`,
-  );
-
-  // Diff-range paths are relative to the repo root (from the GitHub compare
-  // API), but overlay changed files must be relative to sourceRoot (to match
-  // getFileOidsUnderPath output). Convert and filter accordingly.
-  const repoRoot = await getGitRoot(sourceRoot);
-  if (repoRoot === undefined) {
-    if (getOptionalInput("source-root")) {
-      throw new Error(
-        "Cannot determine git root to convert diff range paths relative to source-root. " +
-          "Failing to avoid omitting files from the analysis.",
-      );
-    }
-    logger.warning(
-      "Cannot determine git root; returning diff range paths as-is.",
-    );
-    return [...new Set(diffRanges.map((r) => r.path))];
-  }
-
-  const relativePaths = diffRanges
-    .map((r) =>
-      path
-        .relative(sourceRoot, path.join(repoRoot, r.path))
-        .replaceAll(path.sep, "/"),
-    )
-    .filter((rel) => !rel.startsWith(".."));
-  return [...new Set(relativePaths)];
-}
diff --git a/src/overlay/overlay-database-mode.ts b/src/overlay/overlay-database-mode.ts
deleted file mode 100644
index f5fc6c761b..0000000000
--- a/src/overlay/overlay-database-mode.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export enum OverlayDatabaseMode {
-  Overlay = "overlay",
-  OverlayBase = "overlay-base",
-  None = "none",
-}
diff --git a/src/overlay/status.test.ts b/src/overlay/status.test.ts
deleted file mode 100644
index d9fa48d90b..0000000000
--- a/src/overlay/status.test.ts
+++ /dev/null
@@ -1,181 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as actionsCache from "@actions/cache";
-import test from "ava";
-import * as sinon from "sinon";
-
-import {
-  getRecordingLogger,
-  LoggedMessage,
-  mockCodeQLVersion,
-  setupTests,
-} from "../testing-utils";
-import { DiskUsage, withTmpDir } from "../util";
-
-import { getCacheKey, shouldSkipOverlayAnalysis } from "./status";
-
-setupTests(test);
-
-function makeDiskUsage(totalGiB: number): DiskUsage {
-  return {
-    numTotalBytes: totalGiB * 1024 * 1024 * 1024,
-    numAvailableBytes: 0,
-  };
-}
-
-test("getCacheKey incorporates language, CodeQL version, and disk space", async (t) => {
-  const codeql = mockCodeQLVersion("2.20.0");
-  t.is(
-    await getCacheKey(codeql, ["javascript"], makeDiskUsage(50)),
-    "codeql-overlay-status-javascript-2.20.0-runner-50GB",
-  );
-  t.is(
-    await getCacheKey(codeql, ["python"], makeDiskUsage(50)),
-    "codeql-overlay-status-python-2.20.0-runner-50GB",
-  );
-  t.is(
-    await getCacheKey(
-      mockCodeQLVersion("2.21.0"),
-      ["javascript"],
-      makeDiskUsage(50),
-    ),
-    "codeql-overlay-status-javascript-2.21.0-runner-50GB",
-  );
-  t.is(
-    await getCacheKey(codeql, ["javascript"], makeDiskUsage(100)),
-    "codeql-overlay-status-javascript-2.20.0-runner-100GB",
-  );
-});
-
-test("getCacheKey sorts and joins multiple languages", async (t) => {
-  const codeql = mockCodeQLVersion("2.20.0");
-  t.is(
-    await getCacheKey(codeql, ["python", "javascript"], makeDiskUsage(50)),
-    "codeql-overlay-status-javascript+python-2.20.0-runner-50GB",
-  );
-  t.is(
-    await getCacheKey(codeql, ["javascript", "python"], makeDiskUsage(50)),
-    "codeql-overlay-status-javascript+python-2.20.0-runner-50GB",
-  );
-});
-
-test("getCacheKey rounds disk space down to nearest 10 GiB", async (t) => {
-  const codeql = mockCodeQLVersion("2.20.0");
-  t.is(
-    await getCacheKey(codeql, ["javascript"], makeDiskUsage(14)),
-    "codeql-overlay-status-javascript-2.20.0-runner-10GB",
-  );
-  t.is(
-    await getCacheKey(codeql, ["javascript"], makeDiskUsage(19)),
-    "codeql-overlay-status-javascript-2.20.0-runner-10GB",
-  );
-});
-
-test.serial(
-  "shouldSkipOverlayAnalysis returns false when no cached status exists",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      process.env["RUNNER_TEMP"] = tmpDir;
-      const codeql = mockCodeQLVersion("2.20.0");
-      const messages: LoggedMessage[] = [];
-      const logger = getRecordingLogger(messages);
-
-      sinon.stub(actionsCache, "restoreCache").resolves(undefined);
-
-      const result = await shouldSkipOverlayAnalysis(
-        codeql,
-        ["javascript"],
-        makeDiskUsage(50),
-        logger,
-      );
-
-      t.false(result);
-      t.true(
-        messages.some(
-          (m) =>
-            m.type === "debug" &&
-            typeof m.message === "string" &&
-            m.message.includes("No overlay status found in Actions cache."),
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "shouldSkipOverlayAnalysis returns true when cached status indicates failed build",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      process.env["RUNNER_TEMP"] = tmpDir;
-      const codeql = mockCodeQLVersion("2.20.0");
-      const messages: LoggedMessage[] = [];
-      const logger = getRecordingLogger(messages);
-
-      const status = {
-        attemptedToBuildOverlayBaseDatabase: true,
-        builtOverlayBaseDatabase: false,
-      };
-
-      // Stub restoreCache to write the status file and return a key
-      sinon.stub(actionsCache, "restoreCache").callsFake(async (paths) => {
-        const statusFile = paths[0];
-        await fs.promises.mkdir(path.dirname(statusFile), { recursive: true });
-        await fs.promises.writeFile(statusFile, JSON.stringify(status));
-        return "found-key";
-      });
-
-      const result = await shouldSkipOverlayAnalysis(
-        codeql,
-        ["javascript"],
-        makeDiskUsage(50),
-        logger,
-      );
-
-      t.true(result);
-    });
-  },
-);
-
-test.serial(
-  "shouldSkipOverlayAnalysis returns false when cached status indicates successful build",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      process.env["RUNNER_TEMP"] = tmpDir;
-      const codeql = mockCodeQLVersion("2.20.0");
-      const messages: LoggedMessage[] = [];
-      const logger = getRecordingLogger(messages);
-
-      const status = {
-        attemptedToBuildOverlayBaseDatabase: true,
-        builtOverlayBaseDatabase: true,
-      };
-
-      sinon.stub(actionsCache, "restoreCache").callsFake(async (paths) => {
-        const statusFile = paths[0];
-        await fs.promises.mkdir(path.dirname(statusFile), { recursive: true });
-        await fs.promises.writeFile(statusFile, JSON.stringify(status));
-        return "found-key";
-      });
-
-      const result = await shouldSkipOverlayAnalysis(
-        codeql,
-        ["javascript"],
-        makeDiskUsage(50),
-        logger,
-      );
-
-      t.false(result);
-      t.true(
-        messages.some(
-          (m) =>
-            m.type === "debug" &&
-            typeof m.message === "string" &&
-            m.message.includes(
-              "Cached overlay status does not indicate a previous unsuccessful attempt",
-            ),
-        ),
-      );
-    });
-  },
-);
diff --git a/src/overlay/status.ts b/src/overlay/status.ts
deleted file mode 100644
index 3acf382965..0000000000
--- a/src/overlay/status.ts
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * We perform enablement checks for overlay analysis to avoid using it on runners that are too small
- * to support it. However these checks cannot avoid every potential issue without being overly
- * conservative. Therefore, if our enablement checks enable overlay analysis for a runner that is
- * too small, we want to remember that, so that we will not try to use overlay analysis until
- * something changes (e.g. a larger runner is provisioned, or a new CodeQL version is released).
- *
- * We use the Actions cache as a lightweight way of providing this functionality.
- */
-
-import * as fs from "fs";
-import * as path from "path";
-
-import * as actionsCache from "@actions/cache";
-
-import {
-  getTemporaryDirectory,
-  getWorkflowRunAttempt,
-  getWorkflowRunID,
-} from "../actions-util";
-import { type CodeQL } from "../codeql";
-import * as json from "../json";
-import { Logger } from "../logging";
-import {
-  DiskUsage,
-  getErrorMessage,
-  getRequiredEnvParam,
-  waitForResultWithTimeLimit,
-} from "../util";
-
-/** The maximum time to wait for a cache operation to complete. */
-const MAX_CACHE_OPERATION_MS = 30_000;
-
-/** File name for the serialized overlay status. */
-const STATUS_FILE_NAME = "overlay-status.json";
-
-/** Path to the local overlay status file. */
-function getStatusFilePath(languages: string[]): string {
-  return path.join(
-    getTemporaryDirectory(),
-    "overlay-status",
-    [...languages].sort().join("+"),
-    STATUS_FILE_NAME,
-  );
-}
-
-/** Details of the job that recorded an overlay status. */
-interface JobInfo {
-  /** The check run ID. This is optional since it is not always available. */
-  checkRunId?: number;
-  /** The workflow run ID. */
-  workflowRunId: number;
-  /** The workflow run attempt number. */
-  workflowRunAttempt: number;
-  /** The name of the job (from GITHUB_JOB). */
-  name: string;
-}
-
-/** Status of an overlay analysis for a group of languages. */
-export interface OverlayStatus {
-  /** Whether the job attempted to build an overlay base database. */
-  attemptedToBuildOverlayBaseDatabase: boolean;
-  /** Whether the job successfully built an overlay base database. */
-  builtOverlayBaseDatabase: boolean;
-  /** Details of the job that recorded this status. */
-  job?: JobInfo;
-}
-
-/** Creates an `OverlayStatus` populated with the details of the current job. */
-export function createOverlayStatus(
-  attributes: Omit,
-  checkRunId?: number,
-): OverlayStatus {
-  const job: JobInfo = {
-    workflowRunId: getWorkflowRunID(),
-    workflowRunAttempt: getWorkflowRunAttempt(),
-    name: getRequiredEnvParam("GITHUB_JOB"),
-    checkRunId,
-  };
-  return {
-    ...attributes,
-    job,
-  };
-}
-
-/**
- * Whether overlay analysis should be skipped, based on the cached status for the given languages and disk usage.
- */
-export async function shouldSkipOverlayAnalysis(
-  codeql: CodeQL,
-  languages: string[],
-  diskUsage: DiskUsage,
-  logger: Logger,
-): Promise {
-  const status = await getOverlayStatus(codeql, languages, diskUsage, logger);
-  if (status === undefined) {
-    return false;
-  }
-  if (
-    status.attemptedToBuildOverlayBaseDatabase &&
-    !status.builtOverlayBaseDatabase
-  ) {
-    logger.debug(
-      "Cached overlay status indicates that building an overlay base database was unsuccessful.",
-    );
-    return true;
-  }
-  logger.debug(
-    "Cached overlay status does not indicate a previous unsuccessful attempt to build an overlay base database.",
-  );
-  return false;
-}
-
-/**
- * Retrieve overlay status from the Actions cache, if available.
- *
- * @returns `undefined` if no status was found in the cache (e.g. first run with
- * this cache key) or if the cache operation fails.
- */
-export async function getOverlayStatus(
-  codeql: CodeQL,
-  languages: string[],
-  diskUsage: DiskUsage,
-  logger: Logger,
-): Promise {
-  const cacheKey = await getCacheKey(codeql, languages, diskUsage);
-  const statusFile = getStatusFilePath(languages);
-
-  try {
-    await fs.promises.mkdir(path.dirname(statusFile), { recursive: true });
-    const foundKey = await waitForResultWithTimeLimit(
-      MAX_CACHE_OPERATION_MS,
-      actionsCache.restoreCache([statusFile], cacheKey),
-      () => {
-        logger.warning("Timed out restoring overlay status from cache.");
-      },
-    );
-    if (foundKey === undefined) {
-      logger.debug("No overlay status found in Actions cache.");
-      return undefined;
-    }
-
-    if (!fs.existsSync(statusFile)) {
-      logger.debug(
-        "Overlay status cache entry found but status file is missing.",
-      );
-      return undefined;
-    }
-
-    const contents = await fs.promises.readFile(statusFile, "utf-8");
-    const parsed: unknown = JSON.parse(contents);
-    if (
-      !json.isObject(parsed) ||
-      typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" ||
-      typeof parsed["builtOverlayBaseDatabase"] !== "boolean"
-    ) {
-      logger.debug(
-        "Ignoring overlay status cache entry with unexpected format.",
-      );
-      return undefined;
-    }
-    return parsed as OverlayStatus;
-  } catch (error) {
-    logger.warning(
-      `Failed to restore overlay status from cache: ${getErrorMessage(error)}`,
-    );
-    return undefined;
-  }
-}
-
-/**
- * Save overlay status to the Actions cache.
- *
- * @returns `true` if the status was saved successfully, `false` otherwise.
- */
-export async function saveOverlayStatus(
-  codeql: CodeQL,
-  languages: string[],
-  diskUsage: DiskUsage,
-  status: OverlayStatus,
-  logger: Logger,
-): Promise {
-  const cacheKey = await getCacheKey(codeql, languages, diskUsage);
-  const statusFile = getStatusFilePath(languages);
-
-  try {
-    await fs.promises.mkdir(path.dirname(statusFile), { recursive: true });
-    await fs.promises.writeFile(statusFile, JSON.stringify(status));
-    const cacheId = await waitForResultWithTimeLimit(
-      MAX_CACHE_OPERATION_MS,
-      actionsCache.saveCache([statusFile], cacheKey),
-      () => {
-        logger.warning("Timed out saving overlay status to cache.");
-      },
-    );
-    if (cacheId === undefined) {
-      return false;
-    }
-    logger.debug(`Saved overlay status to Actions cache with key ${cacheKey}`);
-    return true;
-  } catch (error) {
-    logger.warning(
-      `Failed to save overlay status to cache: ${getErrorMessage(error)}`,
-    );
-    return false;
-  }
-}
-
-export async function getCacheKey(
-  codeql: CodeQL,
-  languages: string[],
-  diskUsage: DiskUsage,
-): Promise {
-  // Total disk space, rounded to the nearest 10 GB. This is included in the cache key so that if a
-  // customer upgrades their runner, we will try again to use overlay analysis, even if the CodeQL
-  // version has not changed. We round to the nearest 10 GB to work around small differences in disk
-  // space.
-  //
-  // Limitation: this can still flip from "too small" to "large enough" and back again if the disk
-  // space fluctuates above and below a multiple of 10 GB.
-  const diskSpaceToNearest10Gb = `${10 * Math.floor(diskUsage.numTotalBytes / (10 * 1024 * 1024 * 1024))}GB`;
-
-  // Include the CodeQL version in the cache key so we will try again to use overlay analysis when
-  // new queries and libraries that may be more efficient are released.
-  return `codeql-overlay-status-${[...languages].sort().join("+")}-${(await codeql.getVersion()).version}-runner-${diskSpaceToNearest10Gb}`;
-}
diff --git a/src/repository.ts b/src/repository.ts
deleted file mode 100644
index f1e7f369bc..0000000000
--- a/src/repository.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { ConfigurationError, getRequiredEnvParam } from "./util";
-
-// A repository name with owner, parsed into its two parts
-export interface RepositoryNwo {
-  owner: string;
-  repo: string;
-}
-
-/**
- * Get the repository name with owner from the environment variable
- * `GITHUB_REPOSITORY`.
- *
- * @returns The repository name with owner.
- */
-export function getRepositoryNwo(): RepositoryNwo {
-  return getRepositoryNwoFromEnv("GITHUB_REPOSITORY");
-}
-
-/**
- * Get the repository name with owner from the first environment variable that
- * is set and non-empty.
- *
- * @param envVarNames The names of the environment variables to check.
- * @returns The repository name with owner.
- * @throws ConfigurationError if none of the environment variables are set.
- */
-export function getRepositoryNwoFromEnv(
-  ...envVarNames: string[]
-): RepositoryNwo {
-  const envVarName = envVarNames.find((name) => process.env[name]);
-  if (!envVarName) {
-    throw new ConfigurationError(
-      `None of the env vars ${envVarNames.join(", ")} are set`,
-    );
-  }
-  return parseRepositoryNwo(getRequiredEnvParam(envVarName));
-}
-
-export function parseRepositoryNwo(input: string): RepositoryNwo {
-  const parts = input.split("/");
-  if (parts.length !== 2) {
-    throw new ConfigurationError(`"${input}" is not a valid repository name`);
-  }
-  return {
-    owner: parts[0],
-    repo: parts[1],
-  };
-}
diff --git a/src/resolve-environment-action.ts b/src/resolve-environment-action.ts
deleted file mode 100644
index 1f2c6f36b0..0000000000
--- a/src/resolve-environment-action.ts
+++ /dev/null
@@ -1,139 +0,0 @@
-import * as core from "@actions/core";
-
-import {
-  getActionVersion,
-  getOptionalInput,
-  getRequiredInput,
-  getTemporaryDirectory,
-} from "./actions-util";
-import { getGitHubVersion } from "./api-client";
-import { CliError } from "./cli-errors";
-import { Config, getConfig } from "./config-utils";
-import { getActionsLogger } from "./logging";
-import { runResolveBuildEnvironment } from "./resolve-environment";
-import {
-  sendStatusReport,
-  sendUnhandledErrorStatusReport,
-  createStatusReportBase,
-  getActionsStatus,
-  ActionName,
-} from "./status-report";
-import {
-  checkActionVersion,
-  checkDiskUsage,
-  checkForTimeout,
-  checkGitHubVersionInRange,
-  ConfigurationError,
-  getErrorMessage,
-  wrapError,
-} from "./util";
-
-const ENVIRONMENT_OUTPUT_NAME = "environment";
-
-async function run(startedAt: Date) {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-
-  const logger = getActionsLogger();
-
-  let config: Config | undefined;
-
-  try {
-    const statusReportBase = await createStatusReportBase(
-      ActionName.ResolveEnvironment,
-      "starting",
-      startedAt,
-      config,
-      await checkDiskUsage(logger),
-      logger,
-    );
-    if (statusReportBase !== undefined) {
-      await sendStatusReport(statusReportBase);
-    }
-
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    checkActionVersion(getActionVersion(), gitHubVersion);
-
-    config = await getConfig(getTemporaryDirectory(), logger);
-    if (config === undefined) {
-      throw new ConfigurationError(
-        "Config file could not be found at expected location. Has the 'init' action been called?",
-      );
-    }
-
-    const workingDirectory = getOptionalInput("working-directory");
-    const result = await runResolveBuildEnvironment(
-      config.codeQLCmd,
-      logger,
-      workingDirectory,
-      getRequiredInput("language"),
-    );
-    core.setOutput(ENVIRONMENT_OUTPUT_NAME, result);
-  } catch (unwrappedError) {
-    const error = wrapError(unwrappedError);
-
-    if (error instanceof CliError) {
-      // If the CLI failed to run successfully for whatever reason,
-      // we just return an empty JSON object and proceed with the workflow.
-      core.setOutput(ENVIRONMENT_OUTPUT_NAME, {});
-      logger.warning(
-        `Failed to resolve a build environment suitable for automatically building your code. ${error.message}`,
-      );
-    } else {
-      // For any other error types, something has more seriously gone wrong and we fail.
-      core.setFailed(
-        `Failed to resolve a build environment suitable for automatically building your code. ${error.message}`,
-      );
-
-      const statusReportBase = await createStatusReportBase(
-        ActionName.ResolveEnvironment,
-        getActionsStatus(error),
-        startedAt,
-        config,
-        await checkDiskUsage(logger),
-        logger,
-        error.message,
-        error.stack,
-      );
-      if (statusReportBase !== undefined) {
-        await sendStatusReport(statusReportBase);
-      }
-    }
-
-    return;
-  }
-
-  const statusReportBase = await createStatusReportBase(
-    ActionName.ResolveEnvironment,
-    "success",
-    startedAt,
-    config,
-    await checkDiskUsage(logger),
-    logger,
-  );
-  if (statusReportBase !== undefined) {
-    await sendStatusReport(statusReportBase);
-  }
-}
-
-export async function runWrapper() {
-  const startedAt = new Date();
-  const logger = getActionsLogger();
-  try {
-    await run(startedAt);
-  } catch (error) {
-    core.setFailed(
-      `${ActionName.ResolveEnvironment} action failed: ${getErrorMessage(
-        error,
-      )}`,
-    );
-    await sendUnhandledErrorStatusReport(
-      ActionName.ResolveEnvironment,
-      startedAt,
-      error,
-      logger,
-    );
-  }
-  await checkForTimeout();
-}
diff --git a/src/resolve-environment.ts b/src/resolve-environment.ts
deleted file mode 100644
index 3a1a6ca6bf..0000000000
--- a/src/resolve-environment.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getCodeQL } from "./codeql";
-import { Logger } from "./logging";
-
-export async function runResolveBuildEnvironment(
-  cmd: string,
-  logger: Logger,
-  workingDir: string | undefined,
-  language: string,
-) {
-  logger.startGroup(`Attempting to resolve build environment for ${language}`);
-
-  const codeql = await getCodeQL(logger, cmd);
-
-  if (workingDir !== undefined) {
-    logger.info(`Using ${workingDir} as the working directory.`);
-  }
-
-  const result = await codeql.resolveBuildEnvironment(workingDir, language);
-
-  logger.endGroup();
-  return result;
-}
diff --git a/src/sarif-schema-2.1.0.json b/src/sarif-schema-2.1.0.json
deleted file mode 100644
index 3af5db6432..0000000000
--- a/src/sarif-schema-2.1.0.json
+++ /dev/null
@@ -1,3389 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "title": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema",
-  "$id": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "description": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.",
-  "additionalProperties": false,
-  "type": "object",
-  "properties": {
-
-    "$schema": {
-      "description": "The URI of the JSON schema corresponding to the version.",
-      "type": "string",
-      "format": "uri"
-    },
-
-    "version": {
-      "description": "The SARIF format version of this log file.",
-      "enum": [ "2.1.0" ],
-      "type": "string"
-    },
-
-    "runs": {
-      "description": "The set of runs contained in this log file.",
-      "type": [ "array", "null" ],
-      "minItems": 0,
-      "uniqueItems": false,
-      "items": {
-        "$ref": "#/definitions/run"
-      }
-    },
-
-    "inlineExternalProperties": {
-      "description": "References to external property files that share data between runs.",
-      "type": "array",
-      "minItems": 0,
-      "uniqueItems": true,
-      "items": {
-        "$ref": "#/definitions/externalProperties"
-      }
-    },
-
-    "properties": {
-      "description": "Key/value pairs that provide additional information about the log file.",
-      "$ref": "#/definitions/propertyBag"
-    }
-  },
-
-  "required": [ "version", "runs" ],
-
-  "definitions": {
-
-    "address": {
-      "description": "A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "absoluteAddress": {
-          "description": "The address expressed as a byte offset from the start of the addressable region.",
-          "type": "integer",
-          "minimum": -1,
-          "default": -1
-
-        },
-
-        "relativeAddress": {
-          "description": "The address expressed as a byte offset from the absolute address of the top-most parent object.",
-          "type": "integer"
-
-        },
-
-        "length": {
-          "description": "The number of bytes in this range of addresses.",
-          "type": "integer"
-        },
-
-        "kind": {
-          "description": "An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values.",
-          "type": "string"
-        },
-
-        "name": {
-          "description": "A name that is associated with the address, e.g., '.text'.",
-          "type": "string"
-        },
-
-        "fullyQualifiedName": {
-          "description": "A human-readable fully qualified name that is associated with the address.",
-          "type": "string"
-        },
-
-        "offsetFromParent": {
-          "description": "The byte offset of this address from the absolute or relative address of the parent object.",
-          "type": "integer"
-        },
-
-        "index": {
-          "description": "The index within run.addresses of the cached object for this address.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "parentIndex": {
-          "description": "The index within run.addresses of the parent object.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the address.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "artifact": {
-      "description": "A single artifact. In some cases, this artifact might be nested within another artifact.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "description": {
-          "description": "A short description of the artifact.",
-          "$ref": "#/definitions/message"
-        },
-
-        "location": {
-          "description": "The location of the artifact.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "parentIndex": {
-          "description": "Identifies the index of the immediate parent of the artifact, if this artifact is nested.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "offset": {
-          "description": "The offset in bytes of the artifact within its containing artifact.",
-          "type": "integer",
-          "minimum": 0
-        },
-
-        "length": {
-          "description": "The length of the artifact in bytes.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "roles": {
-          "description": "The role or roles played by the artifact in the analysis.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "enum": [
-              "analysisTarget",
-              "attachment",
-              "responseFile",
-              "resultFile",
-              "standardStream",
-              "tracedFile",
-              "unmodified",
-              "modified",
-              "added",
-              "deleted",
-              "renamed",
-              "uncontrolled",
-              "driver",
-              "extension",
-              "translation",
-              "taxonomy",
-              "policy",
-              "referencedOnCommandLine",
-              "memoryContents",
-              "directory",
-              "userSpecifiedConfiguration",
-              "toolSpecifiedConfiguration",
-              "debugOutputFile"
-            ],
-            "type": "string"
-          }
-        },
-
-        "mimeType": {
-          "description": "The MIME type (RFC 2045) of the artifact.",
-          "type": "string",
-          "pattern": "[^/]+/.+"
-        },
-
-        "contents": {
-          "description": "The contents of the artifact.",
-          "$ref": "#/definitions/artifactContent"
-        },
-
-        "encoding": {
-          "description": "Specifies the encoding for an artifact object that refers to a text file.",
-          "type": "string"
-        },
-
-        "sourceLanguage": {
-          "description": "Specifies the source language for any artifact object that refers to a text file that contains source code.",
-          "type": "string"
-        },
-
-        "hashes": {
-          "description": "A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function.",
-          "type": "object",
-          "additionalProperties": {
-            "type": "string"
-          }
-        },
-
-        "lastModifiedTimeUtc": {
-          "description": "The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See \"Date/time properties\" in the SARIF spec for the required format.",
-          "type": "string",
-          "format": "date-time"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the artifact.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "artifactChange": {
-      "description": "A change to a single artifact.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "artifactLocation": {
-          "description": "The location of the artifact to change.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "replacements": {
-          "description": "An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.",
-          "type": "array",
-          "minItems": 1,
-          "uniqueItems": false,
-          "items": {
-            "$ref": "#/definitions/replacement"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the change.",
-          "$ref": "#/definitions/propertyBag"
-        }
-
-      },
-
-      "required": [ "artifactLocation", "replacements" ]
-    },
-
-    "artifactContent": {
-      "description": "Represents the contents of an artifact.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "text": {
-          "description": "UTF-8-encoded content from a text artifact.",
-          "type": "string"
-        },
-
-        "binary": {
-          "description": "MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.",
-          "type": "string"
-        },
-
-        "rendered": {
-          "description": "An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region).",
-          "$ref": "#/definitions/multiformatMessageString"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the artifact content.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "artifactLocation": {
-      "description": "Specifies the location of an artifact.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "uri": {
-          "description": "A string containing a valid relative or absolute URI.",
-          "type": "string",
-          "format": "uri-reference"
-        },
-
-        "uriBaseId": {
-          "description": "A string which indirectly specifies the absolute URI with respect to which a relative URI in the \"uri\" property is interpreted.",
-          "type": "string"
-        },
-
-        "index": {
-          "description": "The index within the run artifacts array of the artifact object associated with the artifact location.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "description": {
-          "description": "A short description of the artifact location.",
-          "$ref": "#/definitions/message"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the artifact location.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "attachment": {
-      "description": "An artifact relevant to a result.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "description": {
-          "description": "A message describing the role played by the attachment.",
-          "$ref": "#/definitions/message"
-        },
-
-        "artifactLocation": {
-          "description": "The location of the attachment.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "regions": {
-          "description": "An array of regions of interest within the attachment.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/region"
-          }
-        },
-
-        "rectangles": {
-          "description": "An array of rectangles specifying areas of interest within the image.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/rectangle"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the attachment.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "artifactLocation" ]
-    },
-
-    "codeFlow": {
-      "description": "A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "message": {
-          "description": "A message relevant to the code flow.",
-          "$ref": "#/definitions/message"
-        },
-
-        "threadFlows": {
-          "description": "An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.",
-          "type": "array",
-          "minItems": 1,
-          "uniqueItems": false,
-          "items": {
-            "$ref": "#/definitions/threadFlow"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the code flow.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "threadFlows" ]
-    },
-
-    "configurationOverride": {
-      "description": "Information about how a specific rule or notification was reconfigured at runtime.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "configuration": {
-          "description": "Specifies how the rule or notification was configured during the scan.",
-          "$ref": "#/definitions/reportingConfiguration"
-        },
-
-        "descriptor": {
-          "description": "A reference used to locate the descriptor whose configuration was overridden.",
-          "$ref": "#/definitions/reportingDescriptorReference"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the configuration override.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "configuration", "descriptor" ]
-    },
-
-    "conversion": {
-      "description": "Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "tool": {
-          "description": "A tool object that describes the converter.",
-          "$ref": "#/definitions/tool"
-        },
-
-        "invocation": {
-          "description": "An invocation object that describes the invocation of the converter.",
-          "$ref": "#/definitions/invocation"
-        },
-
-        "analysisToolLogFiles": {
-          "description": "The locations of the analysis tool's per-run log files.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/artifactLocation"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the conversion.",
-          "$ref": "#/definitions/propertyBag"
-        }
-
-      },
-
-      "required": [ "tool" ]
-    },
-
-    "edge": {
-      "description": "Represents a directed edge in a graph.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "id": {
-          "description": "A string that uniquely identifies the edge within its graph.",
-          "type": "string"
-        },
-
-        "label": {
-          "description": "A short description of the edge.",
-          "$ref": "#/definitions/message"
-        },
-
-        "sourceNodeId": {
-          "description": "Identifies the source node (the node at which the edge starts).",
-          "type": "string"
-        },
-
-        "targetNodeId": {
-          "description": "Identifies the target node (the node at which the edge ends).",
-          "type": "string"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the edge.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "id", "sourceNodeId", "targetNodeId" ]
-    },
-
-    "edgeTraversal": {
-      "description": "Represents the traversal of a single edge during a graph traversal.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "edgeId": {
-          "description": "Identifies the edge being traversed.",
-          "type": "string"
-        },
-
-        "message": {
-          "description": "A message to display to the user as the edge is traversed.",
-          "$ref": "#/definitions/message"
-        },
-
-        "finalState": {
-          "description": "The values of relevant expressions after the edge has been traversed.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/multiformatMessageString"
-          }
-        },
-
-        "stepOverEdgeCount": {
-          "description": "The number of edge traversals necessary to return from a nested graph.",
-          "type": "integer",
-          "minimum": 0
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the edge traversal.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "edgeId" ]
-    },
-
-    "exception": {
-      "description": "Describes a runtime exception encountered during the execution of an analysis tool.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "kind": {
-          "type": "string",
-          "description": "A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal."
-        },
-
-        "message": {
-          "description": "A message that describes the exception.",
-          "type": "string"
-        },
-
-        "stack": {
-          "description": "The sequence of function calls leading to the exception.",
-          "$ref": "#/definitions/stack"
-        },
-
-        "innerExceptions": {
-          "description": "An array of exception objects each of which is considered a cause of this exception.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/exception"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the exception.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "externalProperties": {
-      "description": "The top-level element of an external property file.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "schema": {
-          "description": "The URI of the JSON schema corresponding to the version of the external property file format.",
-          "type": "string",
-          "format": "uri"
-        },
-
-        "version": {
-          "description": "The SARIF format version of this external properties object.",
-          "enum": [ "2.1.0" ],
-          "type": "string"
-        },
-
-        "guid": {
-          "description": "A stable, unique identifier for this external properties object, in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "runGuid": {
-          "description": "A stable, unique identifier for the run associated with this external properties object, in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "conversion": {
-          "description": "A conversion object that will be merged with a separate run.",
-          "$ref": "#/definitions/conversion"
-        },
-
-        "graphs": {
-          "description": "An array of graph objects that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "default": [],
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/graph"
-          }
-        },
-
-        "externalizedProperties": {
-          "description": "Key/value pairs that provide additional information that will be merged with a separate run.",
-          "$ref": "#/definitions/propertyBag"
-        },
-
-        "artifacts": {
-          "description": "An array of artifact objects that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/artifact"
-          }
-        },
-
-        "invocations": {
-          "description": "Describes the invocation of the analysis tool that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/invocation"
-          }
-        },
-
-        "logicalLocations": {
-          "description": "An array of logical locations such as namespaces, types or functions that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/logicalLocation"
-          }
-        },
-
-        "threadFlowLocations": {
-          "description": "An array of threadFlowLocation objects that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/threadFlowLocation"
-          }
-        },
-
-        "results": {
-          "description": "An array of result objects that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/result"
-          }
-        },
-
-        "taxonomies": {
-          "description": "Tool taxonomies that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponent"
-          }
-        },
-
-        "driver": {
-          "description": "The analysis tool object that will be merged with a separate run.",
-          "$ref": "#/definitions/toolComponent"
-        },
-
-        "extensions": {
-          "description": "Tool extensions that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponent"
-          }
-        },
-
-        "policies": {
-          "description": "Tool policies that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponent"
-          }
-        },
-
-        "translations": {
-          "description": "Tool translations that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponent"
-          }
-        },
-
-        "addresses": {
-          "description": "Addresses that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/address"
-          }
-        },
-
-        "webRequests": {
-          "description": "Requests that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/webRequest"
-          }
-        },
-
-        "webResponses": {
-          "description": "Responses that will be merged with a separate run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/webResponse"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the external properties.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "externalPropertyFileReference": {
-      "description": "Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "location": {
-          "description": "The location of the external property file.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "guid": {
-          "description": "A stable, unique identifier for the external property file in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "itemCount": {
-          "description": "A non-negative integer specifying the number of items contained in the external property file.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the external property file.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "anyOf": [
-        { "required": [ "location" ] },
-        { "required": [ "guid" ] }
-      ]
-    },
-
-    "externalPropertyFileReferences": {
-      "description": "References to external property files that should be inlined with the content of a root log file.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "conversion": {
-          "description": "An external property file containing a run.conversion object to be merged with the root log file.",
-          "$ref": "#/definitions/externalPropertyFileReference"
-        },
-
-        "graphs": {
-          "description": "An array of external property files containing a run.graphs object to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "externalizedProperties": {
-          "description": "An external property file containing a run.properties object to be merged with the root log file.",
-          "$ref": "#/definitions/externalPropertyFileReference"
-        },
-
-        "artifacts": {
-          "description": "An array of external property files containing run.artifacts arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "invocations": {
-          "description": "An array of external property files containing run.invocations arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "logicalLocations": {
-          "description": "An array of external property files containing run.logicalLocations arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "threadFlowLocations": {
-          "description": "An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "results": {
-          "description": "An array of external property files containing run.results arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "taxonomies": {
-          "description": "An array of external property files containing run.taxonomies arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "addresses": {
-          "description": "An array of external property files containing run.addresses arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "driver": {
-          "description": "An external property file containing a run.driver object to be merged with the root log file.",
-          "$ref": "#/definitions/externalPropertyFileReference"
-        },
-
-        "extensions": {
-          "description": "An array of external property files containing run.extensions arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "policies": {
-          "description": "An array of external property files containing run.policies arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "translations": {
-          "description": "An array of external property files containing run.translations arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "webRequests": {
-          "description": "An array of external property files containing run.requests arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "webResponses": {
-          "description": "An array of external property files containing run.responses arrays to be merged with the root log file.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/externalPropertyFileReference"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the external property files.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "fix": {
-      "description": "A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "description": {
-          "description": "A message that describes the proposed fix, enabling viewers to present the proposed change to an end user.",
-          "$ref": "#/definitions/message"
-        },
-
-        "artifactChanges": {
-          "description": "One or more artifact changes that comprise a fix for a result.",
-          "type": "array",
-          "minItems": 1,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/artifactChange"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the fix.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "artifactChanges" ]
-    },
-
-    "graph": {
-      "description": "A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph).",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "description": {
-          "description": "A description of the graph.",
-          "$ref": "#/definitions/message"
-        },
-
-        "nodes": {
-          "description": "An array of node objects representing the nodes of the graph.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/node"
-          }
-        },
-
-        "edges": {
-          "description": "An array of edge objects representing the edges of the graph.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/edge"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the graph.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "graphTraversal": {
-      "description": "Represents a path through a graph.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "runGraphIndex": {
-          "description": "The index within the run.graphs to be associated with the result.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "resultGraphIndex": {
-          "description": "The index within the result.graphs to be associated with the result.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "description": {
-          "description": "A description of this graph traversal.",
-          "$ref": "#/definitions/message"
-        },
-
-        "initialState": {
-          "description": "Values of relevant expressions at the start of the graph traversal that may change during graph traversal.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/multiformatMessageString"
-          }
-        },
-
-        "immutableState": {
-          "description": "Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/multiformatMessageString"
-          }
-        },
-
-        "edgeTraversals": {
-          "description": "The sequences of edges traversed by this graph traversal.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/edgeTraversal"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the graph traversal.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "oneOf": [
-        { "required": [ "runGraphIndex" ] },
-        { "required": [ "resultGraphIndex" ] }
-      ]
-    },
-
-    "invocation": {
-      "description": "The runtime environment of the analysis tool run.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "commandLine": {
-          "description": "The command line used to invoke the tool.",
-          "type": "string"
-        },
-
-        "arguments": {
-          "description": "An array of strings, containing in order the command line arguments passed to the tool from the operating system.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "responseFiles": {
-          "description": "The locations of any response files specified on the tool's command line.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/artifactLocation"
-          }
-        },
-
-        "startTimeUtc": {
-          "description": "The Coordinated Universal Time (UTC) date and time at which the invocation started. See \"Date/time properties\" in the SARIF spec for the required format.",
-          "type": "string",
-          "format": "date-time"
-        },
-
-        "endTimeUtc": {
-          "description": "The Coordinated Universal Time (UTC) date and time at which the invocation ended. See \"Date/time properties\" in the SARIF spec for the required format.",
-          "type": "string",
-          "format": "date-time"
-        },
-
-        "exitCode": {
-          "description": "The process exit code.",
-          "type": "integer"
-        },
-
-        "ruleConfigurationOverrides": {
-          "description": "An array of configurationOverride objects that describe rules related runtime overrides.",
-          "type": "array",
-          "minItems": 0,
-          "default": [],
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/configurationOverride"
-          }
-        },
-
-        "notificationConfigurationOverrides": {
-          "description": "An array of configurationOverride objects that describe notifications related runtime overrides.",
-          "type": "array",
-          "minItems": 0,
-          "default": [],
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/configurationOverride"
-          }
-        },
-
-        "toolExecutionNotifications": {
-          "description": "A list of runtime conditions detected by the tool during the analysis.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/notification"
-          }
-        },
-
-        "toolConfigurationNotifications": {
-          "description": "A list of conditions detected by the tool that are relevant to the tool's configuration.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/notification"
-          }
-        },
-
-        "exitCodeDescription": {
-          "description": "The reason for the process exit.",
-          "type": "string"
-        },
-
-        "exitSignalName": {
-          "description": "The name of the signal that caused the process to exit.",
-          "type": "string"
-        },
-
-        "exitSignalNumber": {
-          "description": "The numeric value of the signal that caused the process to exit.",
-          "type": "integer"
-        },
-
-        "processStartFailureMessage": {
-          "description": "The reason given by the operating system that the process failed to start.",
-          "type": "string"
-        },
-
-        "executionSuccessful": {
-          "description": "Specifies whether the tool's execution completed successfully.",
-          "type": "boolean"
-        },
-
-        "machine": {
-          "description": "The machine on which the invocation occurred.",
-          "type": "string"
-        },
-
-        "account": {
-          "description": "The account under which the invocation occurred.",
-          "type": "string"
-        },
-
-        "processId": {
-          "description": "The id of the process in which the invocation occurred.",
-          "type": "integer"
-        },
-
-        "executableLocation": {
-          "description": "An absolute URI specifying the location of the executable that was invoked.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "workingDirectory": {
-          "description": "The working directory for the invocation.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "environmentVariables": {
-          "description": "The environment variables associated with the analysis tool process, expressed as key/value pairs.",
-          "type": "object",
-          "additionalProperties": {
-            "type": "string"
-          }
-        },
-
-        "stdin": {
-          "description": "A file containing the standard input stream to the process that was invoked.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "stdout": {
-          "description": "A file containing the standard output stream from the process that was invoked.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "stderr": {
-          "description": "A file containing the standard error stream from the process that was invoked.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "stdoutStderr": {
-          "description": "A file containing the interleaved standard output and standard error stream from the process that was invoked.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the invocation.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "executionSuccessful" ]
-    },
-
-    "location": {
-      "description": "A location within a programming artifact.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "id": {
-          "description": "Value that distinguishes this location from all other locations within a single result object.",
-          "type": "integer",
-          "minimum": -1,
-          "default": -1
-        },
-
-        "physicalLocation": {
-          "description": "Identifies the artifact and region.",
-          "$ref": "#/definitions/physicalLocation"
-        },
-
-        "logicalLocations": {
-          "description": "The logical locations associated with the result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/logicalLocation"
-          }
-        },
-
-        "message": {
-          "description": "A message relevant to the location.",
-          "$ref": "#/definitions/message"
-        },
-
-        "annotations": {
-          "description": "A set of regions relevant to the location.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/region"
-          }
-        },
-
-        "relationships": {
-          "description": "An array of objects that describe relationships between this location and others.",
-          "type": "array",
-          "default": [],
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/locationRelationship"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the location.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "locationRelationship": {
-      "description": "Information about the relation of one location to another.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "target": {
-          "description": "A reference to the related location.",
-          "type": "integer",
-          "minimum": 0
-        },
-
-        "kinds": {
-          "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.",
-          "type": "array",
-          "default": [ "relevant" ],
-          "uniqueItems": true,
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "description": {
-          "description": "A description of the location relationship.",
-          "$ref": "#/definitions/message"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the location relationship.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "target" ]
-    },
-
-    "logicalLocation": {
-      "description": "A logical location of a construct that produced a result.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "name": {
-          "description": "Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.",
-          "type": "string"
-        },
-
-        "index": {
-          "description": "The index within the logical locations array.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "fullyQualifiedName": {
-          "description": "The human-readable fully qualified name of the logical location.",
-          "type": "string"
-        },
-
-        "decoratedName": {
-          "description": "The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.",
-          "type": "string"
-        },
-
-        "parentIndex": {
-          "description": "Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "kind": {
-          "description": "The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.",
-          "type": "string"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the logical location.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "message": {
-      "description": "Encapsulates a message intended to be read by the end user.",
-      "type": "object",
-      "additionalProperties": false,
-
-      "properties": {
-
-        "text": {
-          "description": "A plain text message string.",
-          "type": "string"
-        },
-
-        "markdown": {
-          "description": "A Markdown message string.",
-          "type": "string"
-        },
-
-        "id": {
-          "description": "The identifier for this message.",
-          "type": "string"
-        },
-
-        "arguments": {
-          "description": "An array of strings to substitute into the message string.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the message.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "anyOf": [
-        { "required": [ "text" ] },
-        { "required": [ "id" ] }
-      ]
-    },
-
-    "multiformatMessageString": {
-      "description": "A message string or message format string rendered in multiple formats.",
-      "type": "object",
-      "additionalProperties": false,
-
-      "properties": {
-
-        "text": {
-          "description": "A plain text message string or format string.",
-          "type": "string"
-        },
-
-        "markdown": {
-          "description": "A Markdown message string or format string.",
-          "type": "string"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the message.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "text" ]
-    },
-
-    "node": {
-      "description": "Represents a node in a graph.",
-      "type": "object",
-      "additionalProperties": false,
-
-      "properties": {
-
-        "id": {
-          "description": "A string that uniquely identifies the node within its graph.",
-          "type": "string"
-        },
-
-        "label": {
-          "description": "A short description of the node.",
-          "$ref": "#/definitions/message"
-        },
-
-        "location": {
-          "description": "A code location associated with the node.",
-          "$ref": "#/definitions/location"
-        },
-
-        "children": {
-          "description": "Array of child nodes.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/node"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the node.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "id" ]
-    },
-
-    "notification": {
-      "description": "Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "locations": {
-          "description": "The locations relevant to this notification.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/location"
-          }
-        },
-
-        "message": {
-          "description": "A message that describes the condition that was encountered.",
-          "$ref": "#/definitions/message"
-        },
-
-        "level": {
-          "description": "A value specifying the severity level of the notification.",
-          "default": "warning",
-          "enum": [ "none", "note", "warning", "error" ],
-          "type": "string"
-        },
-
-        "threadId": {
-          "description": "The thread identifier of the code that generated the notification.",
-          "type": "integer"
-        },
-
-        "timeUtc": {
-          "description": "The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification.",
-          "type": "string",
-          "format": "date-time"
-        },
-
-        "exception": {
-          "description": "The runtime exception, if any, relevant to this notification.",
-          "$ref": "#/definitions/exception"
-        },
-
-        "descriptor": {
-          "description": "A reference used to locate the descriptor relevant to this notification.",
-          "$ref": "#/definitions/reportingDescriptorReference"
-        },
-
-        "associatedRule": {
-          "description": "A reference used to locate the rule descriptor associated with this notification.",
-          "$ref": "#/definitions/reportingDescriptorReference"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the notification.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "message" ]
-    },
-
-    "physicalLocation": {
-      "description": "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "address": {
-          "description": "The address of the location.",
-          "$ref": "#/definitions/address"
-        },
-
-        "artifactLocation": {
-          "description": "The location of the artifact.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "region": {
-          "description": "Specifies a portion of the artifact.",
-          "$ref": "#/definitions/region"
-        },
-
-        "contextRegion": {
-          "description": "Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.",
-          "$ref": "#/definitions/region"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the physical location.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "anyOf": [
-        {
-          "required": [ "address" ]
-        },
-        {
-          "required": [ "artifactLocation" ]
-        }
-      ]
-    },
-
-    "propertyBag": {
-      "description": "Key/value pairs that provide additional information about the object.",
-      "type": "object",
-      "additionalProperties": true,
-      "properties": {
-        "tags": {
-
-          "description": "A set of distinct strings that provide additional information.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "type": "string"
-          }
-        }
-      }
-    },
-
-    "rectangle": {
-      "description": "An area within an image.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "top": {
-          "description": "The Y coordinate of the top edge of the rectangle, measured in the image's natural units.",
-          "type": "number"
-        },
-
-        "left": {
-          "description": "The X coordinate of the left edge of the rectangle, measured in the image's natural units.",
-          "type": "number"
-        },
-
-        "bottom": {
-          "description": "The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units.",
-          "type": "number"
-        },
-
-        "right": {
-          "description": "The X coordinate of the right edge of the rectangle, measured in the image's natural units.",
-          "type": "number"
-        },
-
-        "message": {
-          "description": "A message relevant to the rectangle.",
-          "$ref": "#/definitions/message"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the rectangle.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "region": {
-      "description": "A region within an artifact where a result was detected.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "startLine": {
-          "description": "The line number of the first character in the region.",
-          "type": "integer",
-          "minimum": 1
-        },
-
-        "startColumn": {
-          "description": "The column number of the first character in the region.",
-          "type": "integer",
-          "minimum": 1
-        },
-
-        "endLine": {
-          "description": "The line number of the last character in the region.",
-          "type": "integer",
-          "minimum": 1
-        },
-
-        "endColumn": {
-          "description": "The column number of the character following the end of the region.",
-          "type": "integer",
-          "minimum": 1
-        },
-
-        "charOffset": {
-          "description": "The zero-based offset from the beginning of the artifact of the first character in the region.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "charLength": {
-          "description": "The length of the region in characters.",
-          "type": "integer",
-          "minimum": 0
-        },
-
-        "byteOffset": {
-          "description": "The zero-based offset from the beginning of the artifact of the first byte in the region.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "byteLength": {
-          "description": "The length of the region in bytes.",
-          "type": "integer",
-          "minimum": 0
-        },
-
-        "snippet": {
-          "description": "The portion of the artifact contents within the specified region.",
-          "$ref": "#/definitions/artifactContent"
-        },
-
-        "message": {
-          "description": "A message relevant to the region.",
-          "$ref": "#/definitions/message"
-        },
-
-        "sourceLanguage": {
-          "description": "Specifies the source language, if any, of the portion of the artifact specified by the region object.",
-          "type": "string"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the region.",
-          "$ref": "#/definitions/propertyBag"
-        },
-
-        "anyOf": [
-          { "required": [ "startLine" ] },
-          { "required": [ "charOffset" ] },
-          { "required": [ "byteOffset" ] }
-        ]
-      }
-    },
-
-    "replacement": {
-      "description": "The replacement of a single region of an artifact.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "deletedRegion": {
-          "description": "The region of the artifact to delete.",
-          "$ref": "#/definitions/region"
-        },
-
-        "insertedContent": {
-          "description": "The content to insert at the location specified by the 'deletedRegion' property.",
-          "$ref": "#/definitions/artifactContent"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the replacement.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "deletedRegion" ]
-    },
-
-    "reportingDescriptor": {
-      "description": "Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "id": {
-          "description": "A stable, opaque identifier for the report.",
-          "type": "string"
-        },
-
-        "deprecatedIds": {
-          "description": "An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "guid": {
-          "description": "A unique identifier for the reporting descriptor in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "deprecatedGuids": {
-          "description": "An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "type": "string",
-            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-          }
-        },
-
-        "name": {
-          "description": "A report identifier that is understandable to an end user.",
-          "type": "string"
-        },
-
-        "deprecatedNames": {
-          "description": "An array of readable identifiers by which this report was known in some previous version of the analysis tool.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "shortDescription": {
-          "description": "A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text.",
-          "$ref": "#/definitions/multiformatMessageString"
-        },
-
-        "fullDescription": {
-          "description": "A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.",
-          "$ref": "#/definitions/multiformatMessageString"
-        },
-
-        "messageStrings": {
-          "description": "A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/multiformatMessageString"
-          }
-        },
-
-        "defaultConfiguration": {
-          "description": "Default reporting configuration information.",
-          "$ref": "#/definitions/reportingConfiguration"
-        },
-
-        "helpUri": {
-          "description": "A URI where the primary documentation for the report can be found.",
-          "type": "string",
-          "format": "uri"
-        },
-
-        "help": {
-          "description": "Provides the primary documentation for the report, useful when there is no online documentation.",
-          "$ref": "#/definitions/multiformatMessageString"
-        },
-
-        "relationships": {
-          "description": "An array of objects that describe relationships between this reporting descriptor and others.",
-          "type": "array",
-          "default": [],
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/reportingDescriptorRelationship"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the report.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "id" ]
-    },
-
-    "reportingConfiguration": {
-      "description": "Information about a rule or notification that can be configured at runtime.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "enabled": {
-          "description": "Specifies whether the report may be produced during the scan.",
-          "type": "boolean",
-          "default": true
-        },
-
-        "level": {
-          "description": "Specifies the failure level for the report.",
-          "default": "warning",
-          "enum": [ "none", "note", "warning", "error" ],
-          "type": "string"
-        },
-
-        "rank": {
-          "description": "Specifies the relative priority of the report. Used for analysis output only.",
-          "type": "number",
-          "default": -1.0,
-          "minimum": -1.0,
-          "maximum": 100.0
-        },
-
-        "parameters": {
-          "description": "Contains configuration information specific to a report.",
-          "$ref": "#/definitions/propertyBag"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the reporting configuration.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "reportingDescriptorReference": {
-      "description": "Information about how to locate a relevant reporting descriptor.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "id": {
-          "description": "The id of the descriptor.",
-          "type": "string"
-        },
-
-        "index": {
-          "description": "The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "guid": {
-          "description": "A guid that uniquely identifies the descriptor.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "toolComponent": {
-          "description": "A reference used to locate the toolComponent associated with the descriptor.",
-          "$ref": "#/definitions/toolComponentReference"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the reporting descriptor reference.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "anyOf": [
-        { "required": [ "index" ] },
-        { "required": [ "guid" ] },
-        { "required": [ "id" ] }
-      ]
-    },
-
-    "reportingDescriptorRelationship": {
-      "description": "Information about the relation of one reporting descriptor to another.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "target": {
-          "description": "A reference to the related reporting descriptor.",
-          "$ref": "#/definitions/reportingDescriptorReference"
-        },
-
-        "kinds": {
-          "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.",
-          "type": "array",
-          "default": [ "relevant" ],
-          "uniqueItems": true,
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "description": {
-          "description": "A description of the reporting descriptor relationship.",
-          "$ref": "#/definitions/message"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the reporting descriptor reference.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "target" ]
-    },
-
-    "result": {
-      "description": "A result produced by an analysis tool.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "ruleId": {
-          "description": "The stable, unique identifier of the rule, if any, to which this result is relevant.",
-          "type": "string"
-        },
-
-        "ruleIndex": {
-          "description": "The index within the tool component rules array of the rule object associated with this result.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "rule": {
-          "description": "A reference used to locate the rule descriptor relevant to this result.",
-          "$ref": "#/definitions/reportingDescriptorReference"
-        },
-
-        "kind": {
-          "description": "A value that categorizes results by evaluation state.",
-          "default": "fail",
-          "enum": [ "notApplicable", "pass", "fail", "review", "open", "informational" ],
-          "type": "string"
-        },
-
-        "level": {
-          "description": "A value specifying the severity level of the result.",
-          "default": "warning",
-          "enum": [ "none", "note", "warning", "error" ],
-          "type": "string"
-        },
-
-        "message": {
-          "description": "A message that describes the result. The first sentence of the message only will be displayed when visible space is limited.",
-          "$ref": "#/definitions/message"
-        },
-
-        "analysisTarget": {
-          "description": "Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "locations": {
-          "description": "The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/location"
-          }
-        },
-
-        "guid": {
-          "description": "A stable, unique identifier for the result in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "correlationGuid": {
-          "description": "A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "occurrenceCount": {
-          "description": "A positive integer specifying the number of times this logically unique result was observed in this run.",
-          "type": "integer",
-          "minimum": 1
-        },
-
-        "partialFingerprints": {
-          "description": "A set of strings that contribute to the stable, unique identity of the result.",
-          "type": "object",
-          "additionalProperties": {
-            "type": "string"
-          }
-        },
-
-        "fingerprints": {
-          "description": "A set of strings each of which individually defines a stable, unique identity for the result.",
-          "type": "object",
-          "additionalProperties": {
-            "type": "string"
-          }
-        },
-
-        "stacks": {
-          "description": "An array of 'stack' objects relevant to the result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/stack"
-          }
-        },
-
-        "codeFlows": {
-          "description": "An array of 'codeFlow' objects relevant to the result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/codeFlow"
-          }
-        },
-
-        "graphs": {
-          "description": "An array of zero or more unique graph objects associated with the result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/graph"
-          }
-        },
-
-        "graphTraversals": {
-          "description": "An array of one or more unique 'graphTraversal' objects.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/graphTraversal"
-          }
-        },
-
-        "relatedLocations": {
-          "description": "A set of locations relevant to this result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/location"
-          }
-        },
-
-        "suppressions": {
-          "description": "A set of suppressions relevant to this result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/suppression"
-          }
-        },
-
-        "baselineState": {
-          "description": "The state of a result relative to a baseline of a previous run.",
-          "enum": [
-            "new",
-            "unchanged",
-            "updated",
-            "absent"
-          ],
-          "type": "string"
-        },
-
-        "rank": {
-          "description": "A number representing the priority or importance of the result.",
-          "type": "number",
-          "default": -1.0,
-          "minimum": -1.0,
-          "maximum": 100.0
-        },
-
-        "attachments": {
-          "description": "A set of artifacts relevant to the result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/attachment"
-          }
-        },
-
-        "hostedViewerUri": {
-          "description": "An absolute URI at which the result can be viewed.",
-          "type": "string",
-          "format": "uri"
-        },
-
-        "workItemUris": {
-          "description": "The URIs of the work items associated with this result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "type": "string",
-            "format": "uri"
-          }
-        },
-
-        "provenance": {
-          "description": "Information about how and when the result was detected.",
-          "$ref": "#/definitions/resultProvenance"
-        },
-
-        "fixes": {
-          "description": "An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/fix"
-          }
-        },
-
-        "taxa": {
-          "description": "An array of references to taxonomy reporting descriptors that are applicable to the result.",
-          "type": "array",
-          "default": [],
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/reportingDescriptorReference"
-          }
-        },
-
-        "webRequest": {
-          "description": "A web request associated with this result.",
-          "$ref": "#/definitions/webRequest"
-        },
-
-        "webResponse": {
-          "description": "A web response associated with this result.",
-          "$ref": "#/definitions/webResponse"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the result.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "message" ]
-    },
-
-    "resultProvenance": {
-      "description": "Contains information about how and when a result was detected.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "firstDetectionTimeUtc": {
-          "description": "The Coordinated Universal Time (UTC) date and time at which the result was first detected. See \"Date/time properties\" in the SARIF spec for the required format.",
-          "type": "string",
-          "format": "date-time"
-        },
-
-        "lastDetectionTimeUtc": {
-          "description": "The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See \"Date/time properties\" in the SARIF spec for the required format.",
-          "type": "string",
-          "format": "date-time"
-        },
-
-        "firstDetectionRunGuid": {
-          "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "lastDetectionRunGuid": {
-          "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "invocationIndex": {
-          "description": "The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "conversionSources": {
-          "description": "An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/physicalLocation"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the result.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "run": {
-      "description": "Describes a single run of an analysis tool, and contains the reported output of that run.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "tool": {
-          "description": "Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.",
-          "$ref": "#/definitions/tool"
-        },
-
-        "invocations": {
-          "description": "Describes the invocation of the analysis tool.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/invocation"
-          }
-        },
-
-        "conversion": {
-          "description": "A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format.",
-          "$ref": "#/definitions/conversion"
-        },
-
-        "language": {
-          "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).",
-          "type": "string",
-          "default": "en-US",
-          "pattern": "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$"
-        },
-
-        "versionControlProvenance": {
-          "description": "Specifies the revision in version control of the artifacts that were scanned.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/versionControlDetails"
-          }
-        },
-
-        "originalUriBaseIds": {
-          "description": "The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/artifactLocation"
-          }
-        },
-
-        "artifacts": {
-          "description": "An array of artifact objects relevant to the run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/artifact"
-          }
-        },
-
-        "logicalLocations": {
-          "description": "An array of logical locations such as namespaces, types or functions.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/logicalLocation"
-          }
-        },
-
-        "graphs": {
-          "description": "An array of zero or more unique graph objects associated with the run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/graph"
-          }
-        },
-
-        "results": {
-          "description": "The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "items": {
-            "$ref": "#/definitions/result"
-          }
-        },
-
-        "automationDetails": {
-          "description": "Automation details that describe this run.",
-          "$ref": "#/definitions/runAutomationDetails"
-        },
-
-        "runAggregates": {
-          "description": "Automation details that describe the aggregate of runs to which this run belongs.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/runAutomationDetails"
-          }
-        },
-
-        "baselineGuid": {
-          "description": "The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "redactionTokens": {
-          "description": "An array of strings used to replace sensitive information in a redaction-aware property.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "defaultEncoding": {
-          "description": "Specifies the default encoding for any artifact object that refers to a text file.",
-          "type": "string"
-        },
-
-        "defaultSourceLanguage": {
-          "description": "Specifies the default source language for any artifact object that refers to a text file that contains source code.",
-          "type": "string"
-        },
-
-        "newlineSequences": {
-          "description": "An ordered list of character sequences that were treated as line breaks when computing region information for the run.",
-          "type": "array",
-          "minItems": 1,
-          "uniqueItems": true,
-          "default": [ "\r\n", "\n" ],
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "columnKind": {
-          "description": "Specifies the unit in which the tool measures columns.",
-          "enum": [ "utf16CodeUnits", "unicodeCodePoints" ],
-          "type": "string"
-        },
-
-        "externalPropertyFileReferences": {
-          "description": "References to external property files that should be inlined with the content of a root log file.",
-          "$ref": "#/definitions/externalPropertyFileReferences"
-        },
-
-        "threadFlowLocations": {
-          "description": "An array of threadFlowLocation objects cached at run level.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/threadFlowLocation"
-          }
-        },
-
-        "taxonomies": {
-          "description": "An array of toolComponent objects relevant to a taxonomy in which results are categorized.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponent"
-          }
-        },
-
-        "addresses": {
-          "description": "Addresses associated with this run instance, if any.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/address"
-          }
-        },
-
-        "translations": {
-          "description": "The set of available translations of the localized data provided by the tool.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponent"
-          }
-        },
-
-        "policies": {
-          "description": "Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponent"
-          }
-        },
-
-        "webRequests": {
-          "description": "An array of request objects cached at run level.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/webRequest"
-          }
-        },
-
-        "webResponses": {
-          "description": "An array of response objects cached at run level.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/webResponse"
-          }
-        },
-
-        "specialLocations": {
-          "description": "A specialLocations object that defines locations of special significance to SARIF consumers.",
-          "$ref": "#/definitions/specialLocations"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the run.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "tool" ]
-    },
-
-    "runAutomationDetails": {
-      "description": "Information that describes a run's identity and role within an engineering system process.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "description": {
-          "description": "A description of the identity and role played within the engineering system by this object's containing run object.",
-          "$ref": "#/definitions/message"
-        },
-
-        "id": {
-          "description": "A hierarchical string that uniquely identifies this object's containing run object.",
-          "type": "string"
-        },
-
-        "guid": {
-          "description": "A stable, unique identifier for this object's containing run object in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "correlationGuid": {
-          "description": "A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the run automation details.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "specialLocations": {
-      "description": "Defines locations of special significance to SARIF consumers.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "displayBase": {
-          "description": "Provides a suggestion to SARIF consumers to display file paths relative to the specified location.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the special locations.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "stack": {
-      "description": "A call stack that is relevant to a result.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "message": {
-          "description": "A message relevant to this call stack.",
-          "$ref": "#/definitions/message"
-        },
-
-        "frames": {
-          "description": "An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "items": {
-            "$ref": "#/definitions/stackFrame"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the stack.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "frames" ]
-    },
-
-    "stackFrame": {
-      "description": "A function call within a stack trace.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "location": {
-          "description": "The location to which this stack frame refers.",
-          "$ref": "#/definitions/location"
-        },
-
-        "module": {
-          "description": "The name of the module that contains the code of this stack frame.",
-          "type": "string"
-        },
-
-        "threadId": {
-          "description": "The thread identifier of the stack frame.",
-          "type": "integer"
-        },
-
-        "parameters": {
-          "description": "The parameters of the call that is executing.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": false,
-          "default": [],
-          "items": {
-            "type": "string",
-            "default": []
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the stack frame.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "suppression": {
-      "description": "A suppression that is relevant to a result.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "guid": {
-          "description": "A stable, unique identifier for the suprression in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "kind": {
-          "description": "A string that indicates where the suppression is persisted.",
-          "enum": [
-            "inSource",
-            "external"
-          ],
-          "type": "string"
-        },
-
-        "status": {
-          "description": "A string that indicates the review status of the suppression.",
-          "enum": [
-            "accepted",
-            "underReview",
-            "rejected"
-          ],
-          "type": "string"
-        },
-
-        "justification": {
-          "description": "A string representing the justification for the suppression.",
-          "type": "string"
-        },
-
-        "location": {
-          "description": "Identifies the location associated with the suppression.",
-          "$ref": "#/definitions/location"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the suppression.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "kind" ]
-    },
-
-    "threadFlow": {
-      "description": "Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "id": {
-          "description": "An string that uniquely identifies the threadFlow within the codeFlow in which it occurs.",
-          "type": "string"
-        },
-
-        "message": {
-          "description": "A message relevant to the thread flow.",
-          "$ref": "#/definitions/message"
-        },
-
-
-        "initialState": {
-          "description": "Values of relevant expressions at the start of the thread flow that may change during thread flow execution.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/multiformatMessageString"
-          }
-        },
-
-        "immutableState": {
-          "description": "Values of relevant expressions at the start of the thread flow that remain constant.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/multiformatMessageString"
-          }
-        },
-
-        "locations": {
-          "description": "A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.",
-          "type": "array",
-          "minItems": 1,
-          "uniqueItems": false,
-          "items": {
-            "$ref": "#/definitions/threadFlowLocation"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the thread flow.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "locations" ]
-    },
-
-    "threadFlowLocation": {
-      "description": "A location visited by an analysis tool while simulating or monitoring the execution of a program.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "index": {
-          "description": "The index within the run threadFlowLocations array.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "location": {
-          "description": "The code location.",
-          "$ref": "#/definitions/location"
-        },
-
-        "stack": {
-          "description": "The call stack leading to this location.",
-          "$ref": "#/definitions/stack"
-        },
-
-        "kinds": {
-          "description": "A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "type": "string"
-          }
-        },
-
-        "taxa": {
-          "description": "An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location.",
-          "type": "array",
-          "default": [],
-          "minItems": 0,
-          "uniqueItems": true,
-          "items": {
-            "$ref": "#/definitions/reportingDescriptorReference"
-          }
-        },
-
-        "module": {
-          "description": "The name of the module that contains the code that is executing.",
-          "type": "string"
-        },
-
-        "state": {
-          "description": "A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/multiformatMessageString"
-          }
-        },
-
-        "nestingLevel": {
-          "description": "An integer representing a containment hierarchy within the thread flow.",
-          "type": "integer",
-          "minimum": 0
-        },
-
-        "executionOrder": {
-          "description": "An integer representing the temporal order in which execution reached this location.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "executionTimeUtc": {
-          "description": "The Coordinated Universal Time (UTC) date and time at which this location was executed.",
-          "type": "string",
-          "format": "date-time"
-        },
-
-        "importance": {
-          "description": "Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is \"essential\", \"important\", \"unimportant\". Default: \"important\".",
-          "enum": [ "important", "essential", "unimportant" ],
-          "default": "important",
-          "type": "string"
-        },
-
-        "webRequest": {
-          "description": "A web request associated with this thread flow location.",
-          "$ref": "#/definitions/webRequest"
-        },
-
-        "webResponse": {
-          "description": "A web response associated with this thread flow location.",
-          "$ref": "#/definitions/webResponse"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the threadflow location.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "tool": {
-      "description": "The analysis tool that was run.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "driver": {
-          "description": "The analysis tool that was run.",
-          "$ref": "#/definitions/toolComponent"
-        },
-
-        "extensions": {
-          "description": "Tool extensions that contributed to or reconfigured the analysis tool that was run.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponent"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the tool.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "driver" ]
-    },
-
-    "toolComponent": {
-      "description": "A component, such as a plug-in or the driver, of the analysis tool that was run.",
-      "additionalProperties": false,
-      "type": "object",
-      "properties": {
-
-        "guid": {
-          "description": "A unique identifier for the tool component in the form of a GUID.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "name": {
-          "description": "The name of the tool component.",
-          "type": "string"
-        },
-
-        "organization": {
-          "description": "The organization or company that produced the tool component.",
-          "type": "string"
-        },
-
-        "product": {
-          "description": "A product suite to which the tool component belongs.",
-          "type": "string"
-        },
-
-        "productSuite": {
-          "description": "A localizable string containing the name of the suite of products to which the tool component belongs.",
-          "type": "string"
-        },
-
-        "shortDescription": {
-          "description": "A brief description of the tool component.",
-          "$ref": "#/definitions/multiformatMessageString"
-        },
-
-        "fullDescription": {
-          "description": "A comprehensive description of the tool component.",
-          "$ref": "#/definitions/multiformatMessageString"
-        },
-
-        "fullName": {
-          "description": "The name of the tool component along with its version and any other useful identifying information, such as its locale.",
-          "type": "string"
-        },
-
-        "version": {
-          "description": "The tool component version, in whatever format the component natively provides.",
-          "type": "string"
-        },
-
-        "semanticVersion": {
-          "description": "The tool component version in the format specified by Semantic Versioning 2.0.",
-          "type": "string"
-        },
-
-        "dottedQuadFileVersion": {
-          "description": "The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).",
-          "type": "string",
-          "pattern": "[0-9]+(\\.[0-9]+){3}"
-        },
-
-        "releaseDateUtc": {
-          "description": "A string specifying the UTC date (and optionally, the time) of the component's release.",
-          "type": "string"
-        },
-
-        "downloadUri": {
-          "description": "The absolute URI from which the tool component can be downloaded.",
-          "type": "string",
-          "format": "uri"
-        },
-
-        "informationUri": {
-          "description": "The absolute URI at which information about this version of the tool component can be found.",
-          "type": "string",
-          "format": "uri"
-        },
-
-        "globalMessageStrings": {
-          "description": "A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.",
-          "type": "object",
-          "additionalProperties": {
-            "$ref": "#/definitions/multiformatMessageString"
-          }
-        },
-
-        "notifications": {
-          "description": "An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/reportingDescriptor"
-          }
-        },
-
-        "rules": {
-          "description": "An array of reportingDescriptor objects relevant to the analysis performed by the tool component.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/reportingDescriptor"
-          }
-        },
-
-        "taxa": {
-          "description": "An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/reportingDescriptor"
-          }
-        },
-
-        "locations": {
-          "description": "An array of the artifactLocation objects associated with the tool component.",
-          "type": "array",
-          "minItems": 0,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/artifactLocation"
-          }
-        },
-
-        "language": {
-          "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).",
-          "type": "string",
-          "default": "en-US",
-          "pattern": "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$"
-        },
-
-        "contents": {
-          "description": "The kinds of data contained in this object.",
-          "type": "array",
-          "uniqueItems": true,
-          "default": [ "localizedData", "nonLocalizedData" ],
-          "items": {
-            "enum": [
-              "localizedData",
-              "nonLocalizedData"
-            ],
-            "type": "string"
-          }
-        },
-
-        "isComprehensive": {
-          "description": "Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.",
-          "type": "boolean",
-          "default": false
-        },
-
-        "localizedDataSemanticVersion": {
-          "description": "The semantic version of the localized strings defined in this component; maintained by components that provide translations.",
-          "type": "string"
-        },
-
-        "minimumRequiredLocalizedDataSemanticVersion": {
-          "description": "The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.",
-          "type": "string"
-        },
-
-        "associatedComponent": {
-          "description": "The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model.",
-          "$ref": "#/definitions/toolComponentReference"
-        },
-
-        "translationMetadata": {
-          "description": "Translation metadata, required for a translation, not populated by other component types.",
-          "$ref": "#/definitions/translationMetadata"
-        },
-
-        "supportedTaxonomies": {
-          "description": "An array of toolComponentReference objects to declare the taxonomies supported by the tool component.",
-          "type": "array",
-          "minItems": 0,
-          "uniqueItems": true,
-          "default": [],
-          "items": {
-            "$ref": "#/definitions/toolComponentReference"
-          }
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the tool component.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "name" ]
-    },
-
-    "toolComponentReference": {
-      "description": "Identifies a particular toolComponent object, either the driver or an extension.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "name": {
-          "description": "The 'name' property of the referenced toolComponent.",
-          "type": "string"
-        },
-
-        "index": {
-          "description": "An index into the referenced toolComponent in tool.extensions.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "guid": {
-          "description": "The 'guid' property of the referenced toolComponent.",
-          "type": "string",
-          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the toolComponentReference.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "translationMetadata": {
-      "description": "Provides additional metadata related to translation.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "name": {
-          "description": "The name associated with the translation metadata.",
-          "type": "string"
-        },
-
-        "fullName": {
-          "description": "The full name associated with the translation metadata.",
-          "type": "string"
-        },
-
-        "shortDescription": {
-          "description": "A brief description of the translation metadata.",
-          "$ref": "#/definitions/multiformatMessageString"
-        },
-
-        "fullDescription": {
-          "description": "A comprehensive description of the translation metadata.",
-          "$ref": "#/definitions/multiformatMessageString"
-        },
-
-        "downloadUri": {
-          "description": "The absolute URI from which the translation metadata can be downloaded.",
-          "type": "string",
-          "format": "uri"
-        },
-
-        "informationUri": {
-          "description": "The absolute URI from which information related to the translation metadata can be downloaded.",
-          "type": "string",
-          "format": "uri"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the translation metadata.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-      "required": [ "name" ]
-    },
-
-    "versionControlDetails": {
-      "description": "Specifies the information necessary to retrieve a desired revision from a version control system.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "repositoryUri": {
-          "description": "The absolute URI of the repository.",
-          "type": "string",
-          "format": "uri"
-        },
-
-        "revisionId": {
-          "description": "A string that uniquely and permanently identifies the revision within the repository.",
-          "type": "string"
-        },
-
-        "branch": {
-          "description": "The name of a branch containing the revision.",
-          "type": "string"
-        },
-
-        "revisionTag": {
-          "description": "A tag that has been applied to the revision.",
-          "type": "string"
-        },
-
-        "asOfTimeUtc": {
-          "description": "A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.",
-          "type": "string",
-          "format": "date-time"
-        },
-
-        "mappedTo": {
-          "description": "The location in the local file system to which the root of the repository was mapped at the time of the analysis.",
-          "$ref": "#/definitions/artifactLocation"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the version control details.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      },
-
-      "required": [ "repositoryUri" ]
-    },
-
-    "webRequest": {
-      "description": "Describes an HTTP request.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "index": {
-          "description": "The index within the run.webRequests array of the request object associated with this result.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-
-        },
-
-        "protocol": {
-          "description": "The request protocol. Example: 'http'.",
-          "type": "string"
-        },
-
-        "version": {
-          "description": "The request version. Example: '1.1'.",
-          "type": "string"
-        },
-
-        "target": {
-          "description": "The target of the request.",
-          "type": "string"
-        },
-
-        "method": {
-          "description": "The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.",
-          "type": "string"
-        },
-
-        "headers": {
-          "description": "The request headers.",
-          "type": "object",
-          "additionalProperties": {
-            "type": "string"
-          }
-        },
-
-        "parameters": {
-          "description": "The request parameters.",
-          "type": "object",
-          "additionalProperties": {
-            "type": "string"
-          }
-        },
-
-        "body": {
-          "description": "The body of the request.",
-          "$ref": "#/definitions/artifactContent"
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the request.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    },
-
-    "webResponse": {
-      "description": "Describes the response to an HTTP request.",
-      "type": "object",
-      "additionalProperties": false,
-      "properties": {
-
-        "index": {
-          "description": "The index within the run.webResponses array of the response object associated with this result.",
-          "type": "integer",
-          "default": -1,
-          "minimum": -1
-        },
-
-        "protocol": {
-          "description": "The response protocol. Example: 'http'.",
-          "type": "string"
-        },
-
-        "version": {
-          "description": "The response version. Example: '1.1'.",
-          "type": "string"
-        },
-
-        "statusCode": {
-          "description": "The response status code. Example: 451.",
-          "type": "integer"
-        },
-
-        "reasonPhrase": {
-          "description": "The response reason. Example: 'Not found'.",
-          "type": "string"
-        },
-
-        "headers": {
-          "description": "The response headers.",
-          "type": "object",
-          "additionalProperties": {
-            "type": "string"
-          }
-        },
-
-        "body": {
-          "description": "The body of the response.",
-          "$ref": "#/definitions/artifactContent"
-        },
-
-        "noResponseReceived": {
-          "description": "Specifies whether a response was received from the server.",
-          "type": "boolean",
-          "default": false
-        },
-
-        "properties": {
-          "description": "Key/value pairs that provide additional information about the response.",
-          "$ref": "#/definitions/propertyBag"
-        }
-      }
-    }
-  }
-}
diff --git a/src/sarif/index.test.ts b/src/sarif/index.test.ts
deleted file mode 100644
index 115d350133..0000000000
--- a/src/sarif/index.test.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import * as fs from "fs";
-
-import test from "ava";
-
-import { setupTests } from "../testing-utils";
-
-import { getToolNames, type Log } from ".";
-
-setupTests(test);
-
-test("getToolNames", (t) => {
-  const input = fs.readFileSync(
-    `${__dirname}/../../src/testdata/tool-names.sarif`,
-    "utf8",
-  );
-  const toolNames = getToolNames(JSON.parse(input) as Log);
-  t.deepEqual(toolNames, ["CodeQL command-line toolchain", "ESLint"]);
-});
diff --git a/src/sarif/index.ts b/src/sarif/index.ts
deleted file mode 100644
index 3cd537dafb..0000000000
--- a/src/sarif/index.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-import * as fs from "fs";
-
-import { Logger } from "../logging";
-
-import * as sarif from "sarif";
-
-export type * from "sarif";
-
-// Extends `ToolComponent` with the non-standard `automationId` property we use.
-export type RunKey = sarif.ToolComponent & {
-  /**
-   * Describes a SARIF run (either uniquely or not uniquely) based on the criteria used by
-   * Code Scanning to determine analysis categories
-   */
-  automationId: string | undefined;
-};
-
-/**
- * An error that occurred due to an invalid SARIF upload request.
- */
-export class InvalidSarifUploadError extends Error {}
-
-/**
- * Get the array of all the tool names contained in the given sarif contents.
- *
- * Returns an array of unique string tool names.
- */
-export function getToolNames(sarifFile: Partial): string[] {
-  const toolNames = {};
-
-  for (const run of sarifFile.runs || []) {
-    const tool = run.tool || {};
-    const driver = tool.driver || {};
-    if (typeof driver.name === "string" && driver.name.length > 0) {
-      toolNames[driver.name] = true;
-    }
-  }
-
-  return Object.keys(toolNames);
-}
-
-/**
- * Reads the file pointed at by `sarifFilePath` and parses it as JSON. This function does
- * not validate that the JSON represents a valid SARIF file. I.e. this function will only
- * throw if the file cannot be read or does not contain valid JSON.
- *
- * @param sarifFilePath The file to read.
- * @returns The resulting JSON value, cast to a SARIF `Log`.
- */
-export function readSarifFile(sarifFilePath: string): Partial {
-  return JSON.parse(fs.readFileSync(sarifFilePath, "utf8")) as sarif.Log;
-}
-
-// Takes a list of paths to sarif files and combines them together,
-// returning the contents of the combined sarif file.
-export function combineSarifFiles(
-  sarifFiles: string[],
-  logger: Logger,
-): sarif.Log {
-  logger.info(`Loading SARIF file(s)`);
-  const runs: sarif.Run[] = [];
-  let version: sarif.Log.version | undefined = undefined;
-
-  for (const sarifFile of sarifFiles) {
-    logger.debug(`Loading SARIF file: ${sarifFile}`);
-    const sarifLog = readSarifFile(sarifFile);
-    // If this is the first SARIF file we are reading, store the version from it so that we
-    // can put it in the combined SARIF. If not, then check that the versions match and
-    // throw an exception if they do not.
-    if (version === undefined) {
-      version = sarifLog.version;
-    } else if (version !== sarifLog.version) {
-      throw new InvalidSarifUploadError(
-        `Different SARIF versions encountered: ${version} and ${sarifLog.version}`,
-      );
-    }
-
-    runs.push(...(sarifLog?.runs || []));
-  }
-
-  // We can't guarantee that the SARIF files we load will have version properties. As a fallback,
-  // we set it to the expected version if we didn't find any other.
-  if (version === undefined) {
-    version = "2.1.0";
-  }
-
-  return { version, runs };
-}
-
-/**
- * Checks whether all the runs in the given SARIF files were produced by CodeQL.
- * @param sarifLogs The list of SARIF objects to check.
- */
-export function areAllRunsProducedByCodeQL(
-  sarifLogs: Array>,
-): boolean {
-  return sarifLogs.every((sarifLog: Partial) => {
-    return sarifLog.runs?.every((run) => run.tool?.driver?.name === "CodeQL");
-  });
-}
-
-function createRunKey(run: sarif.Run): RunKey {
-  return {
-    name: run.tool?.driver?.name,
-    fullName: run.tool?.driver?.fullName,
-    version: run.tool?.driver?.version,
-    semanticVersion: run.tool?.driver?.semanticVersion,
-    guid: run.tool?.driver?.guid,
-    automationId: run.automationDetails?.id,
-  };
-}
-
-/**
- * Checks whether all runs in the given SARIF files are unique (based on the
- * criteria used by Code Scanning to determine analysis categories).
- * @param sarifLogs The list of SARIF objects to check.
- */
-export function areAllRunsUnique(
-  sarifLogs: Array>,
-): boolean {
-  const keys = new Set();
-
-  for (const sarifLog of sarifLogs) {
-    if (sarifLog.runs === undefined) {
-      continue;
-    }
-
-    for (const run of sarifLog.runs) {
-      const key = JSON.stringify(createRunKey(run));
-
-      // If the key already exists, the runs are not unique.
-      if (keys.has(key)) {
-        return false;
-      }
-
-      keys.add(key);
-    }
-  }
-
-  return true;
-}
diff --git a/src/setup-codeql-action.ts b/src/setup-codeql-action.ts
deleted file mode 100644
index 7873449f9c..0000000000
--- a/src/setup-codeql-action.ts
+++ /dev/null
@@ -1,228 +0,0 @@
-import * as core from "@actions/core";
-
-import { Action, ActionState, runInActions } from "./action-common";
-import {
-  getActionVersion,
-  getOptionalInput,
-  getRequiredInput,
-  getTemporaryDirectory,
-} from "./actions-util";
-import { AnalysisKind, getAnalysisKinds } from "./analyses";
-import { getGitHubVersion } from "./api-client";
-import { CodeQL } from "./codeql";
-import { ComputedInput, getToolsInput } from "./config/inputs";
-import { getRawLanguagesNoAutodetect } from "./config-utils";
-import { EnvVar } from "./environment";
-import { initFeatures } from "./feature-flags";
-import { loadRepositoryProperties } from "./feature-flags/properties";
-import { initCodeQL } from "./init";
-import { Logger } from "./logging";
-import { getRepositoryNwo } from "./repository";
-import { ToolsSource } from "./setup-codeql";
-import {
-  ActionName,
-  InitStatusReport,
-  InitToolsDownloadFields,
-  createStatusReportBase,
-  getActionsStatus,
-  sendStatusReport,
-} from "./status-report";
-import { ToolsDownloadStatusReport } from "./tools-download";
-import {
-  checkDiskUsage,
-  checkForTimeout,
-  checkGitHubVersionInRange,
-  getRequiredEnvParam,
-  initializeEnvironment,
-  ConfigurationError,
-  wrapError,
-  checkActionVersion,
-} from "./util";
-
-/**
- * Helper function to send a full status report for this action.
- */
-async function sendCompletedStatusReport(
-  startedAt: Date,
-  toolsInput: ComputedInput | undefined,
-  toolsDownloadStatusReport: ToolsDownloadStatusReport | undefined,
-  toolsFeatureFlagsValid: boolean | undefined,
-  toolsSource: ToolsSource,
-  toolsVersion: string,
-  logger: Logger,
-  error?: Error,
-): Promise {
-  const statusReportBase = await createStatusReportBase(
-    ActionName.SetupCodeQL,
-    getActionsStatus(error),
-    startedAt,
-    undefined,
-    await checkDiskUsage(logger),
-    logger,
-    error?.message,
-    error?.stack,
-  );
-
-  if (statusReportBase === undefined) {
-    return;
-  }
-
-  const initStatusReport: InitStatusReport = {
-    ...statusReportBase,
-    tools_input: toolsInput?.value || "",
-    tools_resolved_version: toolsVersion,
-    tools_source: toolsSource || ToolsSource.Unknown,
-    workflow_languages: "",
-  };
-
-  if (toolsInput !== undefined) {
-    initStatusReport.computed_inputs.tools = toolsInput;
-  }
-
-  const initToolsDownloadFields: InitToolsDownloadFields = {};
-
-  if (toolsDownloadStatusReport?.downloadDurationMs !== undefined) {
-    initToolsDownloadFields.tools_download_duration_ms =
-      toolsDownloadStatusReport.downloadDurationMs;
-  }
-  if (toolsFeatureFlagsValid !== undefined) {
-    initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
-  }
-
-  await sendStatusReport({ ...initStatusReport, ...initToolsDownloadFields });
-}
-
-/** The main behaviour of this action. */
-async function run(
-  actionState: ActionState<["Base", "Logger", "Env", "Actions"]>,
-): Promise {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-  const { logger, startedAt } = actionState;
-
-  let codeql: CodeQL;
-  let toolsInput: ComputedInput | undefined;
-  let toolsDownloadStatusReport: ToolsDownloadStatusReport | undefined;
-  let toolsFeatureFlagsValid: boolean | undefined;
-  let toolsSource: ToolsSource;
-  let toolsVersion: string;
-
-  try {
-    initializeEnvironment(getActionVersion());
-
-    const apiDetails = {
-      auth: getRequiredInput("token"),
-      externalRepoAuth: getOptionalInput("external-repository-token"),
-      url: getRequiredEnvParam("GITHUB_SERVER_URL"),
-      apiURL: getRequiredEnvParam("GITHUB_API_URL"),
-    };
-
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-    checkActionVersion(getActionVersion(), gitHubVersion);
-
-    const repositoryNwo = getRepositoryNwo();
-
-    const features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger,
-    );
-
-    // Fetch the values of known repository properties that affect us.
-    const repositoryPropertiesResult = await loadRepositoryProperties(
-      repositoryNwo,
-      logger,
-    );
-    const repositoryProperties = repositoryPropertiesResult.orElse({});
-
-    const actionStateWithFeatures = { ...actionState, features };
-
-    const statusReportBase = await createStatusReportBase(
-      ActionName.SetupCodeQL,
-      "starting",
-      startedAt,
-      undefined,
-      await checkDiskUsage(logger),
-      logger,
-    );
-    if (statusReportBase !== undefined) {
-      await sendStatusReport(statusReportBase);
-    }
-
-    // Get the computed `tools` input.
-    toolsInput = await getToolsInput(
-      actionStateWithFeatures,
-      repositoryProperties,
-    );
-
-    const codeQLDefaultVersionInfo =
-      await features.getEnabledDefaultCliVersions(gitHubVersion.type);
-    toolsFeatureFlagsValid = codeQLDefaultVersionInfo.toolsFeatureFlagsValid;
-    const rawLanguages = getRawLanguagesNoAutodetect(
-      getOptionalInput("languages"),
-    );
-    const analysisKinds = await getAnalysisKinds(logger, features);
-    const initCodeQLResult = await initCodeQL(
-      toolsInput?.value,
-      apiDetails,
-      getTemporaryDirectory(),
-      gitHubVersion.type,
-      codeQLDefaultVersionInfo,
-      rawLanguages,
-      analysisKinds.length === 1 &&
-        analysisKinds[0] === AnalysisKind.CodeScanning,
-      features,
-      logger,
-    );
-    codeql = initCodeQLResult.codeql;
-    toolsDownloadStatusReport = initCodeQLResult.toolsDownloadStatusReport;
-    toolsVersion = initCodeQLResult.toolsVersion;
-    toolsSource = initCodeQLResult.toolsSource;
-
-    core.setOutput("codeql-path", codeql.getPath());
-    core.setOutput("codeql-version", (await codeql.getVersion()).version);
-
-    core.exportVariable(EnvVar.SETUP_CODEQL_ACTION_HAS_RUN, "true");
-  } catch (unwrappedError) {
-    const error = wrapError(unwrappedError);
-    core.setFailed(error.message);
-    const statusReportBase = await createStatusReportBase(
-      ActionName.SetupCodeQL,
-      error instanceof ConfigurationError ? "user-error" : "failure",
-      startedAt,
-      undefined,
-      await checkDiskUsage(logger),
-      logger,
-      error.message,
-      error.stack,
-    );
-    if (statusReportBase !== undefined) {
-      await sendStatusReport(statusReportBase);
-    }
-    return;
-  }
-
-  await sendCompletedStatusReport(
-    startedAt,
-    toolsInput,
-    toolsDownloadStatusReport,
-    toolsFeatureFlagsValid,
-    toolsSource,
-    toolsVersion,
-    logger,
-  );
-}
-
-/** Defines the `setup-codeql` Action. */
-const setupCodeQL: Action = {
-  name: ActionName.SetupCodeQL,
-  run,
-};
-
-/** Run the action and catch any unhandled errors. */
-export async function runWrapper(): Promise {
-  await runInActions(setupCodeQL);
-  await checkForTimeout();
-}
diff --git a/src/setup-codeql.test.ts b/src/setup-codeql.test.ts
deleted file mode 100644
index 219e39984c..0000000000
--- a/src/setup-codeql.test.ts
+++ /dev/null
@@ -1,919 +0,0 @@
-import * as path from "path";
-
-import * as github from "@actions/github";
-import * as toolcache from "@actions/tool-cache";
-import test, { ExecutionContext } from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import * as api from "./api-client";
-import { EnvVar } from "./environment";
-import { Feature } from "./feature-flags";
-import { getRunnerLogger } from "./logging";
-import { getCacheRestoreKeyPrefix } from "./overlay/caching";
-import * as setupCodeql from "./setup-codeql";
-import * as tar from "./tar";
-import {
-  LINKED_CLI_VERSION,
-  LoggedMessage,
-  SAMPLE_DEFAULT_CLI_VERSION,
-  SAMPLE_DOTCOM_API_DETAILS,
-  checkExpectedLogMessages,
-  createFeatures,
-  createTestConfig,
-  getRecordingLogger,
-  makeMacro,
-  mockBundleDownloadApi,
-  setupActionsVars,
-  setupTests,
-} from "./testing-utils";
-import {
-  getErrorMessage,
-  GitHubVariant,
-  initializeEnvironment,
-  withTmpDir,
-} from "./util";
-
-setupTests(test);
-
-test.beforeEach(() => {
-  initializeEnvironment("1.2.3");
-});
-
-test.serial("parse codeql bundle url version", (t) => {
-  t.deepEqual(
-    setupCodeql.getCodeQLURLVersion(
-      "https://github.com/.../codeql-bundle-20200601/...",
-    ),
-    "20200601",
-  );
-});
-
-test.serial("convert to semver", (t) => {
-  const tests = {
-    "20200601": "0.0.0-20200601",
-    "20200601.0": "0.0.0-20200601.0",
-    "20200601.0.0": "20200601.0.0",
-    "1.2.3": "1.2.3",
-    "1.2.3-alpha": "1.2.3-alpha",
-    "1.2.3-beta.1": "1.2.3-beta.1",
-  };
-
-  for (const [version, expectedVersion] of Object.entries(tests)) {
-    try {
-      const parsedVersion = setupCodeql.convertToSemVer(
-        version,
-        getRunnerLogger(true),
-      );
-      t.deepEqual(parsedVersion, expectedVersion);
-    } catch (e) {
-      t.fail(getErrorMessage(e));
-    }
-  }
-});
-
-test.serial("getCodeQLActionRepository", (t) => {
-  const logger = getRunnerLogger(true);
-
-  initializeEnvironment("1.2.3");
-
-  // isRunningLocalAction() === true
-  delete process.env["GITHUB_ACTION_REPOSITORY"];
-  process.env["RUNNER_TEMP"] = path.dirname(__dirname);
-  const repoLocalRunner = setupCodeql.getCodeQLActionRepository(logger);
-  t.deepEqual(repoLocalRunner, "github/codeql-action");
-
-  // isRunningLocalAction() === false
-  sinon.stub(actionsUtil, "isRunningLocalAction").returns(false);
-  process.env["GITHUB_ACTION_REPOSITORY"] = "xxx/yyy";
-  const repoEnv = setupCodeql.getCodeQLActionRepository(logger);
-  t.deepEqual(repoEnv, "xxx/yyy");
-});
-
-test.serial(
-  "getCodeQLSource sets CLI version for a semver tagged bundle",
-  async (t) => {
-    const features = createFeatures([]);
-
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const tagName = "codeql-bundle-v1.2.3";
-      mockBundleDownloadApi({ tagName });
-      const source = await setupCodeql.getCodeQLSource(
-        `https://github.com/github/codeql-action/releases/download/${tagName}/codeql-bundle-linux64.tar.gz`,
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        SAMPLE_DOTCOM_API_DETAILS,
-        GitHubVariant.DOTCOM,
-        false,
-        features,
-        getRunnerLogger(true),
-      );
-
-      t.is(source.sourceType, "download");
-      t.is(source["cliVersion"], "1.2.3");
-    });
-  },
-);
-
-const LINKED_BUNDLE_TEST_CASES = [
-  {
-    platform: "linux",
-    tarSupportsZstd: true,
-    expectedBundleName: "codeql-bundle-linux64.tar.zst",
-    expectedCompressionMethod: "zstd",
-  },
-  {
-    platform: "darwin",
-    tarSupportsZstd: true,
-    expectedBundleName: "codeql-bundle-osx64.tar.zst",
-    expectedCompressionMethod: "zstd",
-  },
-  {
-    platform: "win32",
-    tarSupportsZstd: true,
-    expectedBundleName: "codeql-bundle-win64.tar.gz",
-    expectedCompressionMethod: "gzip",
-  },
-  {
-    platform: "linux",
-    tarSupportsZstd: false,
-    expectedBundleName: "codeql-bundle-linux64.tar.gz",
-    expectedCompressionMethod: "gzip",
-  },
-] as const;
-
-for (const {
-  platform,
-  tarSupportsZstd,
-  expectedBundleName,
-  expectedCompressionMethod,
-} of LINKED_BUNDLE_TEST_CASES) {
-  test.serial(
-    `getCodeQLSource selects ${expectedBundleName} for linked tools`,
-    async (t) => {
-      const features = createFeatures([]);
-      sinon.stub(process, "platform").value(platform);
-
-      await withTmpDir(async (tmpDir) => {
-        setupActionsVars(tmpDir, tmpDir);
-        const source = await setupCodeql.getCodeQLSource(
-          "linked",
-          SAMPLE_DEFAULT_CLI_VERSION,
-          undefined, // rawLanguages
-          false, // useOverlayAwareDefaultCliVersion
-          SAMPLE_DOTCOM_API_DETAILS,
-          GitHubVariant.DOTCOM,
-          tarSupportsZstd,
-          features,
-          getRunnerLogger(true),
-        );
-
-        t.is(source.toolsVersion, LINKED_CLI_VERSION.cliVersion);
-        t.is(source.sourceType, "download");
-        if (source.sourceType === "download") {
-          t.is(source.compressionMethod, expectedCompressionMethod);
-          t.true(source.codeqlURL.endsWith(`/${expectedBundleName}`));
-        }
-      });
-    },
-  );
-}
-
-test.serial(
-  "getCodeQLSource correctly returns bundled CLI version when tools == latest",
-  async (t) => {
-    const loggedMessages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(loggedMessages);
-    const features = createFeatures([]);
-
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const source = await setupCodeql.getCodeQLSource(
-        "latest",
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        SAMPLE_DOTCOM_API_DETAILS,
-        GitHubVariant.DOTCOM,
-        false,
-        features,
-        logger,
-      );
-
-      // First, ensure that the CLI version is the linked version, so that backwards
-      // compatibility is maintained.
-      t.is(source.toolsVersion, LINKED_CLI_VERSION.cliVersion);
-      t.is(source.sourceType, "download");
-
-      // Afterwards, ensure that we see the deprecation message in the log.
-      const expected_message: string =
-        "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.";
-      t.assert(
-        loggedMessages.some(
-          (msg) =>
-            typeof msg.message === "string" &&
-            msg.message.includes(expected_message),
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "setupCodeQLBundle logs the CodeQL CLI version being used when asked to use linked tools",
-  async (t) => {
-    const loggedMessages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(loggedMessages);
-    const features = createFeatures([]);
-
-    // Stub the downloadCodeQL function to prevent downloading artefacts
-    // during testing from being called.
-    sinon.stub(setupCodeql, "downloadCodeQL").resolves({
-      codeqlFolder: "codeql",
-      statusReport: {
-        downloadDurationMs: 200,
-      },
-      toolsVersion: LINKED_CLI_VERSION.cliVersion,
-    });
-
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const result = await setupCodeql.setupCodeQLBundle(
-        "linked",
-        SAMPLE_DOTCOM_API_DETAILS,
-        "tmp/codeql_action_test/",
-        GitHubVariant.DOTCOM,
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        features,
-        logger,
-      );
-
-      // Basic sanity check that the version we got back is indeed
-      // the linked (default) CLI version.
-      t.is(result.toolsVersion, LINKED_CLI_VERSION.cliVersion);
-
-      // Ensure message logging CodeQL CLI version was present in user logs.
-      const expected_message: string = `Using CodeQL CLI version ${LINKED_CLI_VERSION.cliVersion}`;
-      t.assert(
-        loggedMessages.some(
-          (msg) =>
-            typeof msg.message === "string" &&
-            msg.message.includes(expected_message),
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "setupCodeQLBundle logs the CodeQL CLI version being used when asked to download a non-default bundle",
-  async (t) => {
-    const loggedMessages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(loggedMessages);
-    const features = createFeatures([]);
-
-    const bundleUrl =
-      "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.16.0/codeql-bundle-linux64.tar.gz";
-    const expectedVersion = "2.16.0";
-
-    // Stub the downloadCodeQL function to prevent downloading artefacts
-    // during testing from being called.
-    sinon.stub(setupCodeql, "downloadCodeQL").resolves({
-      codeqlFolder: "codeql",
-      statusReport: {
-        downloadDurationMs: 200,
-      },
-      toolsVersion: expectedVersion,
-    });
-
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const result = await setupCodeql.setupCodeQLBundle(
-        bundleUrl,
-        SAMPLE_DOTCOM_API_DETAILS,
-        "tmp/codeql_action_test/",
-        GitHubVariant.DOTCOM,
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        features,
-        logger,
-      );
-
-      // Basic sanity check that the version we got back is indeed the version that the
-      // bundle contains..
-      t.is(result.toolsVersion, expectedVersion);
-
-      // Ensure message logging CodeQL CLI version was present in user logs.
-      const expected_message: string = `Using CodeQL CLI version 2.16.0 sourced from ${bundleUrl} .`;
-      t.assert(
-        loggedMessages.some(
-          (msg) =>
-            typeof msg.message === "string" &&
-            msg.message.includes(expected_message),
-        ),
-      );
-    });
-  },
-);
-
-test.serial(
-  "getCodeQLSource correctly returns nightly CLI version when tools == nightly",
-  async (t) => {
-    const loggedMessages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(loggedMessages);
-    const features = createFeatures([]);
-
-    const expectedDate = "30260213";
-    const expectedTag = `codeql-bundle-${expectedDate}`;
-
-    // Ensure that we consistently select "zstd" for the test.
-    sinon.stub(process, "platform").value("linux");
-    sinon.stub(tar, "isZstdAvailable").resolves({
-      available: true,
-      foundZstdBinary: true,
-    });
-
-    const client = github.getOctokit("123");
-    const listReleases = sinon.stub(client.rest.repos, "listReleases");
-    // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-    listReleases.resolves({
-      data: [{ tag_name: expectedTag }],
-    } as any);
-    sinon.stub(api, "getApiClient").value(() => client);
-
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      const source = await setupCodeql.getCodeQLSource(
-        "nightly",
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        SAMPLE_DOTCOM_API_DETAILS,
-        GitHubVariant.DOTCOM,
-        false,
-        features,
-        logger,
-      );
-
-      // Check that the `CodeQLToolsSource` object matches our expectations.
-      const expectedVersion = `0.0.0-${expectedDate}`;
-      const expectedURL = `https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/${expectedTag}/${setupCodeql.getCodeQLBundleName("zstd")}`;
-      t.deepEqual(source, {
-        bundleVersion: expectedDate,
-        cliVersion: undefined,
-        codeqlURL: expectedURL,
-        compressionMethod: "zstd",
-        sourceType: "download",
-        toolsVersion: expectedVersion,
-      } satisfies setupCodeql.CodeQLToolsSource);
-
-      // Afterwards, ensure that we see the expected messages in the log.
-      checkExpectedLogMessages(t, loggedMessages, [
-        "Using the latest CodeQL CLI nightly, as requested by 'tools: nightly'.",
-        `Bundle version ${expectedDate} is not in SemVer format. Will treat it as pre-release ${expectedVersion}.`,
-        `Attempting to obtain CodeQL tools. CLI version: unknown, bundle tag name: ${expectedTag}`,
-        `Using CodeQL CLI sourced from ${expectedURL}`,
-      ]);
-    });
-  },
-);
-
-test.serial(
-  "getCodeQLSource correctly returns nightly CLI version when forced by FF",
-  async (t) => {
-    const loggedMessages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(loggedMessages);
-    const features = createFeatures([Feature.ForceNightly]);
-
-    const expectedDate = "30260213";
-    const expectedTag = `codeql-bundle-${expectedDate}`;
-
-    // Ensure that we consistently select "zstd" for the test.
-    sinon.stub(process, "platform").value("linux");
-    sinon.stub(tar, "isZstdAvailable").resolves({
-      available: true,
-      foundZstdBinary: true,
-    });
-
-    const client = github.getOctokit("123");
-    const listReleases = sinon.stub(client.rest.repos, "listReleases");
-    // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-    listReleases.resolves({
-      data: [{ tag_name: expectedTag }],
-    } as any);
-    sinon.stub(api, "getApiClient").value(() => client);
-
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir, { GITHUB_EVENT_NAME: "dynamic" });
-
-      const source = await setupCodeql.getCodeQLSource(
-        undefined,
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        SAMPLE_DOTCOM_API_DETAILS,
-        GitHubVariant.DOTCOM,
-        false,
-        features,
-        logger,
-      );
-
-      // Check that the `CodeQLToolsSource` object matches our expectations.
-      const expectedVersion = `0.0.0-${expectedDate}`;
-      const expectedURL = `https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/${expectedTag}/${setupCodeql.getCodeQLBundleName("zstd")}`;
-      t.deepEqual(source, {
-        bundleVersion: expectedDate,
-        cliVersion: undefined,
-        codeqlURL: expectedURL,
-        compressionMethod: "zstd",
-        sourceType: "download",
-        toolsVersion: expectedVersion,
-      } satisfies setupCodeql.CodeQLToolsSource);
-
-      // Afterwards, ensure that we see the expected messages in the log.
-      checkExpectedLogMessages(t, loggedMessages, [
-        `Using the latest CodeQL CLI nightly, as forced by the ${Feature.ForceNightly} feature flag.`,
-        `Bundle version ${expectedDate} is not in SemVer format. Will treat it as pre-release ${expectedVersion}.`,
-        `Attempting to obtain CodeQL tools. CLI version: unknown, bundle tag name: ${expectedTag}`,
-        `Using CodeQL CLI sourced from ${expectedURL}`,
-      ]);
-    });
-  },
-);
-
-test.serial(
-  "getCodeQLSource correctly returns latest version from toolcache when tools == toolcache",
-  async (t) => {
-    const loggedMessages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(loggedMessages);
-    const features = createFeatures([]);
-
-    const latestToolcacheVersion = "3.2.1";
-    const latestVersionPath = "/path/to/latest";
-    const testVersions = ["2.3.1", latestToolcacheVersion, "1.2.3"];
-    const findAllVersionsStub = sinon
-      .stub(toolcache, "findAllVersions")
-      .returns(testVersions);
-    const findStub = sinon.stub(toolcache, "find");
-    findStub
-      .withArgs("CodeQL", latestToolcacheVersion)
-      .returns(latestVersionPath);
-
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir, { GITHUB_EVENT_NAME: "dynamic" });
-
-      const source = await setupCodeql.getCodeQLSource(
-        "toolcache",
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        SAMPLE_DOTCOM_API_DETAILS,
-        GitHubVariant.DOTCOM,
-        false,
-        features,
-        logger,
-      );
-
-      // Check that the toolcache functions were called with the expected arguments
-      t.assert(
-        findAllVersionsStub.calledOnceWith("CodeQL"),
-        `toolcache.findAllVersions("CodeQL") wasn't called`,
-      );
-      t.assert(
-        findStub.calledOnceWith("CodeQL", latestToolcacheVersion),
-        `toolcache.find("CodeQL", ${latestToolcacheVersion}) wasn't called`,
-      );
-
-      // Check that `sourceType` and `toolsVersion` match expectations.
-      t.is(source.sourceType, "toolcache");
-      t.is(source.toolsVersion, latestToolcacheVersion);
-
-      // Check that key messages we would expect to find in the log are present.
-      const expectedMessages: string[] = [
-        `Attempting to use the latest CodeQL CLI version in the toolcache, as requested by 'tools: toolcache'.`,
-        `CLI version ${latestToolcacheVersion} is the latest version in the toolcache.`,
-        `Using CodeQL CLI version ${latestToolcacheVersion} from toolcache at ${latestVersionPath}`,
-      ];
-      for (const expectedMessage of expectedMessages) {
-        t.assert(
-          loggedMessages.some(
-            (msg) =>
-              typeof msg.message === "string" &&
-              msg.message.includes(expectedMessage),
-          ),
-          `Expected '${expectedMessage}' in the logger output, but didn't find it in:\n ${loggedMessages.map((m) => ` - '${m.message}'`).join("\n")}`,
-        );
-      }
-    });
-  },
-);
-
-const toolcacheInputFallbackMacro = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    featureList: Feature[],
-    environment: Record,
-    testVersions: string[],
-    expectedMessages: string[],
-  ) => {
-    const loggedMessages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(loggedMessages);
-    const features = createFeatures(featureList);
-
-    const findAllVersionsStub = sinon
-      .stub(toolcache, "findAllVersions")
-      .returns(testVersions);
-
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-
-      for (const [k, v] of Object.entries(environment)) {
-        process.env[k] = v;
-      }
-
-      const source = await setupCodeql.getCodeQLSource(
-        "toolcache",
-        SAMPLE_DEFAULT_CLI_VERSION,
-        undefined, // rawLanguages
-        false, // useOverlayAwareDefaultCliVersion
-        SAMPLE_DOTCOM_API_DETAILS,
-        GitHubVariant.DOTCOM,
-        false,
-        features,
-        logger,
-      );
-
-      // Check that the toolcache functions were called with the expected arguments
-      t.assert(
-        findAllVersionsStub.calledWith("CodeQL"),
-        `toolcache.findAllVersions("CodeQL") wasn't called`,
-      );
-
-      // Check that `sourceType` and `toolsVersion` match expectations.
-      t.is(source.sourceType, "download");
-      t.is(
-        source.toolsVersion,
-        SAMPLE_DEFAULT_CLI_VERSION.enabledVersions[0].cliVersion,
-      );
-
-      // Check that key messages we would expect to find in the log are present.
-      for (const expectedMessage of expectedMessages) {
-        t.assert(
-          loggedMessages.some(
-            (msg) =>
-              typeof msg.message === "string" &&
-              msg.message.includes(expectedMessage),
-          ),
-          `Expected '${expectedMessage}' in the logger output, but didn't find it in:\n ${loggedMessages.map((m) => ` - '${m.message}'`).join("\n")}`,
-        );
-      }
-    });
-  },
-  title: (providedTitle = "") =>
-    `getCodeQLSource falls back to downloading the CLI if ${providedTitle}`,
-});
-
-toolcacheInputFallbackMacro.serial(
-  "the toolcache doesn't have a CodeQL CLI when tools == toolcache",
-  [],
-  { GITHUB_EVENT_NAME: "dynamic" },
-  [],
-  [
-    `Attempting to use the latest CodeQL CLI version in the toolcache, as requested by 'tools: toolcache'.`,
-    `Found no CodeQL CLI in the toolcache, ignoring 'tools: toolcache'...`,
-  ],
-);
-
-toolcacheInputFallbackMacro.serial(
-  "the workflow trigger is not `dynamic`",
-  [],
-  { GITHUB_EVENT_NAME: "pull_request" },
-  [],
-  [
-    `Ignoring 'tools: toolcache' because the workflow was not triggered dynamically.`,
-  ],
-);
-
-test.serial(
-  'tryGetTagNameFromUrl extracts the right tag name for a repo name containing "codeql-bundle"',
-  (t) => {
-    t.is(
-      setupCodeql.tryGetTagNameFromUrl(
-        "https://github.com/org/codeql-bundle-testing/releases/download/codeql-bundle-v2.19.0/codeql-bundle-linux64.tar.zst",
-        getRunnerLogger(true),
-      ),
-      "codeql-bundle-v2.19.0",
-    );
-  },
-);
-
-test.serial(
-  "getLatestToolcacheVersion returns undefined if there are no CodeQL CLIs in the toolcache",
-  (t) => {
-    sinon.stub(toolcache, "findAllVersions").returns([]);
-    t.is(
-      setupCodeql.getLatestToolcacheVersion(getRunnerLogger(true)),
-      undefined,
-    );
-  },
-);
-
-test.serial(
-  "getLatestToolcacheVersion returns latest version in the toolcache",
-  (t) => {
-    const testVersions = ["2.3.1", "3.2.1", "1.2.3"];
-    sinon.stub(toolcache, "findAllVersions").returns(testVersions);
-
-    t.is(setupCodeql.getLatestToolcacheVersion(getRunnerLogger(true)), "3.2.1");
-  },
-);
-
-const overlayMatchEnabledVersions = {
-  enabledVersions: [
-    { cliVersion: "2.20.2", tagName: "codeql-bundle-v2.20.2" },
-    { cliVersion: "2.20.1", tagName: "codeql-bundle-v2.20.1" },
-    { cliVersion: "2.20.0", tagName: "codeql-bundle-v2.20.0" },
-  ],
-  toolsFeatureFlagsValid: true,
-};
-
-async function fakeOverlayBaseCacheKey(
-  language: string,
-  cliVersion: string,
-  suffix: string,
-): Promise {
-  const prefix = await getCacheRestoreKeyPrefix(
-    createTestConfig({ languages: [language] }),
-    cliVersion,
-  );
-  return `${prefix}${suffix}`;
-}
-
-test.serial(
-  "getCodeQLSource uses overlay-aware default version when requested for a PR",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      process.env[EnvVar.CODE_SCANNING_REF] = "refs/heads/feature-branch";
-      process.env[EnvVar.CODE_SCANNING_BASE_BRANCH] = "main";
-
-      sinon.stub(api, "getAutomationID").resolves("test/");
-      const listStub = sinon.stub(api, "listActionsCaches").resolves([
-        {
-          key: await fakeOverlayBaseCacheKey("javascript", "2.20.1", "abc-1-1"),
-        },
-      ]);
-      sinon
-        .stub(toolcache, "find")
-        .withArgs("CodeQL", "2.20.1")
-        .returns("/path/to/codeql-2.20.1");
-
-      const source = await setupCodeql.getCodeQLSource(
-        undefined,
-        overlayMatchEnabledVersions,
-        ["javascript"],
-        true,
-        SAMPLE_DOTCOM_API_DETAILS,
-        GitHubVariant.DOTCOM,
-        false,
-        createFeatures([Feature.OverlayAnalysisMatchCodeqlVersion]),
-        getRunnerLogger(true),
-      );
-
-      t.assert(listStub.calledOnce);
-      t.is(source.sourceType, "toolcache");
-      t.is(source.toolsVersion, "2.20.1");
-    });
-  },
-);
-
-test.serial(
-  "getCodeQLSource skips overlay-aware default version when not requested",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      setupActionsVars(tmpDir, tmpDir);
-      process.env["CODE_SCANNING_REF"] = "refs/heads/feature-branch";
-      process.env["CODE_SCANNING_BASE_BRANCH"] = "main";
-
-      sinon.stub(api, "getAutomationID").resolves("test/");
-      const listStub = sinon.stub(api, "listActionsCaches").resolves([
-        {
-          key: await fakeOverlayBaseCacheKey("javascript", "2.20.1", "abc-1-1"),
-        },
-      ]);
-      sinon
-        .stub(toolcache, "find")
-        .withArgs("CodeQL", "2.20.2")
-        .returns("/path/to/codeql-2.20.2");
-
-      const source = await setupCodeql.getCodeQLSource(
-        undefined,
-        overlayMatchEnabledVersions,
-        ["javascript"],
-        false,
-        SAMPLE_DOTCOM_API_DETAILS,
-        GitHubVariant.DOTCOM,
-        false,
-        createFeatures([Feature.OverlayAnalysisMatchCodeqlVersion]),
-        getRunnerLogger(true),
-      );
-
-      t.assert(listStub.notCalled);
-      t.is(source.sourceType, "toolcache");
-      t.is(source.toolsVersion, "2.20.2");
-    });
-  },
-);
-
-test.serial(
-  "getEnabledVersionsWithOverlayBaseDatabases returns flag-enabled versions present in cache, sorted desc",
-  async (t) => {
-    sinon.stub(api, "getAutomationID").resolves("test/");
-    sinon.stub(api, "listActionsCaches").resolves([
-      // Flag-enabled versions present in the cache, listed in non-descending
-      // order so the test exercises the sort.
-      {
-        key: await fakeOverlayBaseCacheKey("javascript", "2.20.0", "ghi-3-1"),
-      },
-      {
-        key: await fakeOverlayBaseCacheKey("javascript", "2.20.1", "def-2-1"),
-      },
-      // Newer than any flag-enabled version: should be filtered out.
-      {
-        key: await fakeOverlayBaseCacheKey("javascript", "2.21.0", "abc-1-1"),
-      },
-    ]);
-
-    const result = await setupCodeql.getEnabledVersionsWithOverlayBaseDatabases(
-      overlayMatchEnabledVersions,
-      ["javascript"],
-      createFeatures([Feature.OverlayAnalysisMatchCodeqlVersion]),
-      getRunnerLogger(true),
-    );
-    t.deepEqual(result, [
-      { cliVersion: "2.20.1", tagName: "codeql-bundle-v2.20.1" },
-      { cliVersion: "2.20.0", tagName: "codeql-bundle-v2.20.0" },
-    ]);
-  },
-);
-
-test.serial(
-  "getEnabledVersionsWithOverlayBaseDatabases returns empty when no cached version is flag-enabled",
-  async (t) => {
-    sinon.stub(api, "getAutomationID").resolves("test/");
-    sinon.stub(api, "listActionsCaches").resolves([
-      {
-        key: await fakeOverlayBaseCacheKey("javascript", "2.19.0", "abc-1-1"),
-      },
-    ]);
-
-    const result = await setupCodeql.getEnabledVersionsWithOverlayBaseDatabases(
-      overlayMatchEnabledVersions,
-      ["javascript"],
-      createFeatures([Feature.OverlayAnalysisMatchCodeqlVersion]),
-      getRunnerLogger(true),
-    );
-    t.deepEqual(result, []);
-  },
-);
-
-const noLanguagesMacro = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    rawLanguages: string[] | undefined,
-  ) => {
-    const listStub = sinon.stub(api, "listActionsCaches").resolves([]);
-
-    const result = await setupCodeql.getEnabledVersionsWithOverlayBaseDatabases(
-      overlayMatchEnabledVersions,
-      rawLanguages,
-      createFeatures([Feature.OverlayAnalysisMatchCodeqlVersion]),
-      getRunnerLogger(true),
-    );
-    t.deepEqual(result, []);
-    t.assert(
-      listStub.notCalled,
-      "Should not list Actions caches without any rawLanguages.",
-    );
-  },
-  title: (providedTitle = "") =>
-    `getEnabledVersionsWithOverlayBaseDatabases does not list caches when rawLanguages is ${providedTitle}`,
-});
-
-noLanguagesMacro.serial("undefined", undefined);
-noLanguagesMacro.serial("an empty array", []);
-
-test.serial(
-  "getEnabledVersionsWithOverlayBaseDatabases returns empty when listing caches throws",
-  async (t) => {
-    sinon.stub(api, "getAutomationID").resolves("test/");
-    sinon.stub(api, "listActionsCaches").rejects(new Error("listing failed"));
-
-    const result = await setupCodeql.getEnabledVersionsWithOverlayBaseDatabases(
-      overlayMatchEnabledVersions,
-      ["javascript"],
-      createFeatures([Feature.OverlayAnalysisMatchCodeqlVersion]),
-      getRunnerLogger(true),
-    );
-    t.deepEqual(result, []);
-  },
-);
-
-test.serial(
-  "getEnabledVersionsWithOverlayBaseDatabases returns versions present in the cache",
-  async (t) => {
-    sinon.stub(api, "getAutomationID").resolves("test/");
-    sinon.stub(api, "listActionsCaches").resolves([
-      {
-        key: await fakeOverlayBaseCacheKey("javascript", "2.20.2", "abc-1-1"),
-      },
-    ]);
-
-    const result = await setupCodeql.getEnabledVersionsWithOverlayBaseDatabases(
-      overlayMatchEnabledVersions,
-      ["javascript"],
-      createFeatures([Feature.OverlayAnalysisMatchCodeqlVersion]),
-      getRunnerLogger(true),
-    );
-    t.deepEqual(result, [
-      { cliVersion: "2.20.2", tagName: "codeql-bundle-v2.20.2" },
-    ]);
-  },
-);
-
-test.serial(
-  "getEnabledVersionsWithOverlayBaseDatabases does not list caches when both gates are off",
-  async (t) => {
-    const listStub = sinon.stub(api, "listActionsCaches").resolves([]);
-
-    const result = await setupCodeql.getEnabledVersionsWithOverlayBaseDatabases(
-      overlayMatchEnabledVersions,
-      ["javascript"],
-      createFeatures([]),
-      getRunnerLogger(true),
-    );
-    t.deepEqual(result, []);
-    t.assert(
-      listStub.notCalled,
-      "Should not list Actions caches when both gating feature flags are off.",
-    );
-  },
-);
-
-test.serial(
-  "getEnabledVersionsWithOverlayBaseDatabases dry-run returns empty but lists caches",
-  async (t) => {
-    sinon.stub(api, "getAutomationID").resolves("test/");
-    const listStub = sinon.stub(api, "listActionsCaches").resolves([
-      {
-        key: await fakeOverlayBaseCacheKey("javascript", "2.20.1", "abc-1-1"),
-      },
-    ]);
-
-    const result = await setupCodeql.getEnabledVersionsWithOverlayBaseDatabases(
-      overlayMatchEnabledVersions,
-      ["javascript"],
-      createFeatures([Feature.OverlayAnalysisMatchCodeqlVersionDryRun]),
-      getRunnerLogger(true),
-    );
-    t.deepEqual(
-      result,
-      [],
-      "Dry-run should return an empty list so the caller falls back.",
-    );
-    t.assert(
-      listStub.calledOnce,
-      "Dry-run should still list Actions caches to populate the diagnostic.",
-    );
-  },
-);
-
-test.serial(
-  "getEnabledVersionsWithOverlayBaseDatabases match flag wins over dry-run",
-  async (t) => {
-    sinon.stub(api, "getAutomationID").resolves("test/");
-    sinon.stub(api, "listActionsCaches").resolves([
-      {
-        key: await fakeOverlayBaseCacheKey("javascript", "2.20.1", "abc-1-1"),
-      },
-    ]);
-
-    const result = await setupCodeql.getEnabledVersionsWithOverlayBaseDatabases(
-      overlayMatchEnabledVersions,
-      ["javascript"],
-      createFeatures([
-        Feature.OverlayAnalysisMatchCodeqlVersion,
-        Feature.OverlayAnalysisMatchCodeqlVersionDryRun,
-      ]),
-      getRunnerLogger(true),
-    );
-    t.deepEqual(result, [
-      { cliVersion: "2.20.1", tagName: "codeql-bundle-v2.20.1" },
-    ]);
-  },
-);
diff --git a/src/setup-codeql.ts b/src/setup-codeql.ts
deleted file mode 100644
index 8d374585aa..0000000000
--- a/src/setup-codeql.ts
+++ /dev/null
@@ -1,1086 +0,0 @@
-import * as fs from "fs";
-import { OutgoingHttpHeaders } from "http";
-import * as path from "path";
-
-import * as toolcache from "@actions/tool-cache";
-import { default as deepEqual } from "fast-deep-equal";
-import * as semver from "semver";
-import { v4 as uuidV4 } from "uuid";
-
-import {
-  isAnalyzingPullRequest,
-  isDynamicWorkflow,
-  isRunningLocalAction,
-} from "./actions-util";
-import * as api from "./api-client";
-import * as defaults from "./defaults.json";
-import {
-  addNoLanguageDiagnostic,
-  makeDiagnostic,
-  makeTelemetryDiagnostic,
-} from "./diagnostics";
-import {
-  CODEQL_VERSION_ZSTD_BUNDLE,
-  CodeQLDefaultVersionInfo,
-  CodeQLVersionInfo,
-  Feature,
-  FeatureEnablement,
-} from "./feature-flags";
-import { Logger } from "./logging";
-import { getCodeQlVersionsForOverlayBaseDatabases } from "./overlay/caching";
-import * as tar from "./tar";
-import {
-  downloadAndExtract,
-  getToolcacheDirectory,
-  ToolsDownloadStatusReport,
-  writeToolcacheMarkerFile,
-} from "./tools-download";
-import * as util from "./util";
-import { isGoodVersion } from "./util";
-
-export enum ToolsSource {
-  Unknown = "UNKNOWN",
-  Local = "LOCAL",
-  Toolcache = "TOOLCACHE",
-  Download = "DOWNLOAD",
-}
-
-const CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action";
-const CODEQL_NIGHTLIES_REPOSITORY_OWNER = "dsp-testing";
-const CODEQL_NIGHTLIES_REPOSITORY_NAME = "codeql-cli-nightlies";
-
-const CODEQL_BUNDLE_VERSION_ALIAS: string[] = ["linked", "latest"];
-const CODEQL_NIGHTLY_TOOLS_INPUTS = ["nightly", "nightly-latest"];
-const CODEQL_TOOLCACHE_INPUT = "toolcache";
-
-function getCodeQLBundleExtension(
-  compressionMethod: tar.CompressionMethod,
-): string {
-  switch (compressionMethod) {
-    case "gzip":
-      return ".tar.gz";
-    case "zstd":
-      return ".tar.zst";
-    default:
-      util.assertNever(compressionMethod);
-  }
-}
-
-export function getCodeQLBundleName(
-  compressionMethod: tar.CompressionMethod,
-): string {
-  const extension = getCodeQLBundleExtension(compressionMethod);
-
-  let platform: string;
-  if (process.platform === "win32") {
-    platform = "win64";
-  } else if (process.platform === "linux") {
-    platform = "linux64";
-  } else if (process.platform === "darwin") {
-    platform = "osx64";
-  } else {
-    return `codeql-bundle${extension}`;
-  }
-  return `codeql-bundle-${platform}${extension}`;
-}
-
-export function getCodeQLActionRepository(logger: Logger): string {
-  if (isRunningLocalAction()) {
-    // This handles the case where the Action does not come from an Action repository,
-    // e.g. our integration tests which use the Action code from the current checkout.
-    // In these cases, the GITHUB_ACTION_REPOSITORY environment variable is not set.
-    logger.info(
-      "The CodeQL Action is checked out locally. Using the default CodeQL Action repository.",
-    );
-    return CODEQL_DEFAULT_ACTION_REPOSITORY;
-  }
-
-  return util.getRequiredEnvParam("GITHUB_ACTION_REPOSITORY");
-}
-
-async function getCodeQLBundleDownloadURL(
-  tagName: string,
-  apiDetails: api.GitHubApiDetails,
-  compressionMethod: tar.CompressionMethod,
-  logger: Logger,
-): Promise {
-  const codeQLActionRepository = getCodeQLActionRepository(logger);
-  const potentialDownloadSources = [
-    // This GitHub instance, and this Action.
-    [apiDetails.url, codeQLActionRepository],
-    // This GitHub instance, and the canonical Action.
-    [apiDetails.url, CODEQL_DEFAULT_ACTION_REPOSITORY],
-    // GitHub.com, and the canonical Action.
-    [util.GITHUB_DOTCOM_URL, CODEQL_DEFAULT_ACTION_REPOSITORY],
-  ];
-  // We now filter out any duplicates.
-  // Duplicates will happen either because the GitHub instance is GitHub.com, or because the Action is not a fork.
-  const uniqueDownloadSources = potentialDownloadSources.filter(
-    (source, index, self) => {
-      return !self.slice(0, index).some((other) => deepEqual(source, other));
-    },
-  );
-  const codeQLBundleName = getCodeQLBundleName(compressionMethod);
-  for (const downloadSource of uniqueDownloadSources) {
-    const [apiURL, repository] = downloadSource;
-    // If we've reached the final case, short-circuit the API check since we know the bundle exists and is public.
-    if (
-      apiURL === util.GITHUB_DOTCOM_URL &&
-      repository === CODEQL_DEFAULT_ACTION_REPOSITORY
-    ) {
-      break;
-    }
-    const [repositoryOwner, repositoryName] = repository.split("/");
-    try {
-      const release = await api.getApiClient().rest.repos.getReleaseByTag({
-        owner: repositoryOwner,
-        repo: repositoryName,
-        tag: tagName,
-      });
-      for (const asset of release.data.assets) {
-        if (asset.name === codeQLBundleName) {
-          logger.info(
-            `Found CodeQL bundle ${codeQLBundleName} in ${repository} on ${apiURL} with URL ${asset.url}.`,
-          );
-          return asset.url;
-        }
-      }
-    } catch (e) {
-      logger.info(
-        `Looked for CodeQL bundle ${codeQLBundleName} in ${repository} on ${apiURL} but got error ${e}.`,
-      );
-    }
-  }
-  return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${tagName}/${codeQLBundleName}`;
-}
-
-function tryGetBundleVersionFromTagName(
-  tagName: string,
-  logger: Logger,
-): string | undefined {
-  const match = tagName.match(/^codeql-bundle-(.*)$/);
-  if (match === null || match.length < 2) {
-    logger.debug(`Could not determine bundle version from tag ${tagName}.`);
-    return undefined;
-  }
-  return match[1];
-}
-
-export function tryGetTagNameFromUrl(
-  url: string,
-  logger: Logger,
-): string | undefined {
-  const matches = [...url.matchAll(/\/(codeql-bundle-[^/]*)\//g)];
-  if (matches.length === 0) {
-    logger.debug(`Could not determine tag name for URL ${url}.`);
-    return undefined;
-  }
-  // Example: https://github.com/org/codeql-bundle-testing/releases/download/codeql-bundle-v2.19.0/codeql-bundle-linux64.tar.zst
-  // We require a trailing forward slash to be part of the match, so the last match gives us the tag
-  // name. An alternative approach would be to also match against `/releases/`, but this approach
-  // assumes less about the structure of the URL.
-  const match = matches[matches.length - 1];
-
-  if (match?.length !== 2) {
-    logger.debug(
-      `Could not determine tag name for URL ${url}. Matched ${JSON.stringify(
-        match,
-      )}.`,
-    );
-    return undefined;
-  }
-
-  return match[1];
-}
-
-export function convertToSemVer(version: string, logger: Logger): string {
-  if (!semver.valid(version)) {
-    logger.debug(
-      `Bundle version ${version} is not in SemVer format. Will treat it as pre-release 0.0.0-${version}.`,
-    );
-    version = `0.0.0-${version}`;
-  }
-
-  const s = semver.clean(version);
-  if (!s) {
-    throw new Error(`Bundle version ${version} is not in SemVer format.`);
-  }
-
-  return s;
-}
-
-export type CodeQLToolsSource =
-  | {
-      codeqlTarPath: string;
-      compressionMethod: tar.CompressionMethod;
-      sourceType: "local";
-      /** Human-readable description of the source of the tools for telemetry purposes. */
-      toolsVersion: "local";
-    }
-  | {
-      codeqlFolder: string;
-      sourceType: "toolcache";
-      /** Human-readable description of the source of the tools for telemetry purposes. */
-      toolsVersion: string;
-    }
-  | {
-      /** Bundle version of the tools, if known. */
-      bundleVersion?: string;
-      /** CLI version of the tools, if known. */
-      cliVersion?: string;
-      compressionMethod: tar.CompressionMethod;
-      codeqlURL: string;
-      sourceType: "download";
-      /** Human-readable description of the source of the tools for telemetry purposes. */
-      toolsVersion: string;
-    };
-
-/**
- * Look for a version of the CodeQL tools in the cache which could override the requested CLI version.
- */
-async function findOverridingToolsInCache(
-  humanReadableVersion: string,
-  logger: Logger,
-): Promise {
-  const candidates = toolcache
-    .findAllVersions("CodeQL")
-    .filter(isGoodVersion)
-    .map((version) => ({
-      folder: toolcache.find("CodeQL", version),
-      version,
-    }))
-    .filter(({ folder }) => fs.existsSync(path.join(folder, "pinned-version")));
-
-  if (candidates.length === 1) {
-    const candidate = candidates[0];
-    logger.debug(
-      `CodeQL tools version ${candidate.version} in toolcache overriding version ${humanReadableVersion}.`,
-    );
-    return {
-      codeqlFolder: candidate.folder,
-      sourceType: "toolcache",
-      toolsVersion: candidate.version,
-    };
-  } else if (candidates.length === 0) {
-    logger.debug(
-      "Did not find any candidate pinned versions of the CodeQL tools in the toolcache.",
-    );
-  } else {
-    logger.debug(
-      "Could not use CodeQL tools from the toolcache since more than one candidate pinned " +
-        "version was found in the toolcache.",
-    );
-  }
-  return undefined;
-}
-
-/**
- * Returns the sorted set of enabled versions that have cached overlay-base databases for the
- * given languages, or an empty list if neither the `OverlayAnalysisMatchCodeqlVersion` nor the
- * `OverlayAnalysisMatchCodeqlVersionDryRun` feature flag is enabled. When only the dry-run flag
- * is enabled, this performs the lookup and emits a telemetry diagnostic with the version that
- * would have been chosen, but still returns an empty list so the caller falls back.
- */
-export async function getEnabledVersionsWithOverlayBaseDatabases(
-  defaultCliVersion: CodeQLDefaultVersionInfo,
-  rawLanguages: string[] | undefined,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  if (rawLanguages === undefined || rawLanguages.length === 0) {
-    return [];
-  }
-  const isEnabled = await features.getValue(
-    Feature.OverlayAnalysisMatchCodeqlVersion,
-  );
-  const isDryRun =
-    !isEnabled &&
-    (await features.getValue(Feature.OverlayAnalysisMatchCodeqlVersionDryRun));
-  if (!isEnabled && !isDryRun) {
-    return [];
-  }
-
-  let cachedVersions: string[] | undefined;
-  try {
-    cachedVersions = await getCodeQlVersionsForOverlayBaseDatabases(
-      rawLanguages,
-      logger,
-    );
-  } catch (e) {
-    logger.warning(
-      "Could not list overlay-base databases in the Actions cache while choosing a default " +
-        `CodeQL CLI version, falling back to the highest enabled version. Details: ${util.getErrorMessage(e)}`,
-    );
-    return [];
-  }
-
-  if (cachedVersions === undefined || cachedVersions.length === 0) {
-    return [];
-  }
-
-  const cachedVersionsSet = new Set(cachedVersions);
-  const overlayVersions = defaultCliVersion.enabledVersions.filter((v) =>
-    cachedVersionsSet.has(v.cliVersion),
-  );
-
-  if (overlayVersions.length === 0) {
-    return [];
-  }
-
-  const isCachedVersionDifferent =
-    overlayVersions[0].cliVersion !==
-    defaultCliVersion.enabledVersions[0].cliVersion;
-
-  if (isCachedVersionDifferent) {
-    addNoLanguageDiagnostic(
-      undefined,
-      makeTelemetryDiagnostic(
-        "codeql-action/overlay-aware-default-codeql-version",
-        "Overlay-aware default CodeQL version selection",
-        {
-          cachedVersions,
-          enabledVersions: defaultCliVersion.enabledVersions.map(
-            (v) => v.cliVersion,
-          ),
-          isDryRun,
-          overlayAwareVersion: overlayVersions[0].cliVersion,
-        },
-      ),
-    );
-  }
-
-  if (isDryRun) {
-    logger.debug(
-      `Overlay-aware default CodeQL version selection is running in dry-run mode. Would have used version ${overlayVersions[0].cliVersion}.`,
-    );
-    return [];
-  }
-
-  return overlayVersions;
-}
-
-/**
- * Resolves the newest enabled default CLI version that has a cached overlay-base database for the
- * relevant languages, if running a Code Scanning analysis for a pull request and one exists.
- * Otherwise, falls back to the newest enabled default CLI version.
- */
-async function resolveDefaultCliVersion(
-  defaultCliVersion: CodeQLDefaultVersionInfo,
-  rawLanguages: string[] | undefined,
-  useOverlayAwareDefaultCliVersion: boolean,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  if (!useOverlayAwareDefaultCliVersion || !isAnalyzingPullRequest()) {
-    return defaultCliVersion.enabledVersions[0];
-  }
-
-  const overlayVersions = await getEnabledVersionsWithOverlayBaseDatabases(
-    defaultCliVersion,
-    rawLanguages,
-    features,
-    logger,
-  );
-  if (overlayVersions.length > 0) {
-    logger.info(
-      `Using CodeQL version ${overlayVersions[0].cliVersion} since this is the ` +
-        `highest enabled version that has a cached overlay-base database.`,
-    );
-    return overlayVersions[0];
-  }
-  return defaultCliVersion.enabledVersions[0];
-}
-
-/**
- * Determines where the CodeQL CLI we want to use comes from. This can be from a local file,
- * the Actions toolcache, or a download.
- *
- * @param toolsInput The argument provided for the `tools` input, if any.
- * @param defaultCliVersion The default CLI version that's linked to the CodeQL Action.
- * @param rawLanguages Raw set of languages.
- * @param useOverlayAwareDefaultCliVersion Whether to select an overlay-aware default CLI version.
- * @param apiDetails Information about the GitHub API.
- * @param variant The GitHub variant we are running on.
- * @param tarSupportsZstd Whether zstd is supported by `tar`.
- * @param features Information about enabled features.
- * @param logger The logger to use.
- *
- * @returns Information about where the CodeQL CLI we want to use comes from.
- */
-export async function getCodeQLSource(
-  toolsInput: string | undefined,
-  defaultCliVersion: CodeQLDefaultVersionInfo,
-  rawLanguages: string[] | undefined,
-  useOverlayAwareDefaultCliVersion: boolean,
-  apiDetails: api.GitHubApiDetails,
-  variant: util.GitHubVariant,
-  tarSupportsZstd: boolean,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  // If there is an explicit `tools` input, it's not one of the reserved values, and it doesn't appear
-  // to point to a URL, then we assume it is a local path and use the CLI from there.
-  // TODO: This appears to misclassify filenames that happen to start with `http` as URLs.
-  if (
-    toolsInput &&
-    !isReservedToolsValue(toolsInput) &&
-    !toolsInput.startsWith("http")
-  ) {
-    logger.info(`Using CodeQL CLI from local path ${toolsInput}`);
-    const compressionMethod = tar.inferCompressionMethod(toolsInput);
-    if (compressionMethod === undefined) {
-      throw new util.ConfigurationError(
-        `Could not infer compression method from path ${toolsInput}. Please specify a path ` +
-          "ending in '.tar.gz' or '.tar.zst'.",
-      );
-    }
-    return {
-      codeqlTarPath: toolsInput,
-      compressionMethod,
-      sourceType: "local",
-      toolsVersion: "local",
-    };
-  }
-
-  /** CLI version number, for example 2.12.6. */
-  let cliVersion: string | undefined;
-  /** Tag name of the CodeQL bundle, for example `codeql-bundle-20230120`. */
-  let tagName: string | undefined;
-  /**
-   * URL of the CodeQL bundle.
-   *
-   * This does not always include a tag name.
-   */
-  let url: string | undefined;
-
-  // We allow forcing the nightly CLI via the FF for `dynamic` events (or in test mode) where the
-  // `tools` input cannot be adjusted to explicitly request it.
-  const canForceNightlyWithFF = isDynamicWorkflow() || util.isInTestMode();
-  const forceNightlyValueFF = await features.getValue(Feature.ForceNightly);
-  const forceNightly = forceNightlyValueFF && canForceNightlyWithFF;
-
-  // For advanced workflows, a value from `CODEQL_NIGHTLY_TOOLS_INPUTS` can be specified explicitly
-  // for the `tools` input in the workflow file.
-  const nightlyRequestedByToolsInput =
-    toolsInput !== undefined &&
-    CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput);
-
-  if (forceNightly || nightlyRequestedByToolsInput) {
-    if (forceNightly) {
-      logger.info(
-        `Using the latest CodeQL CLI nightly, as forced by the ${Feature.ForceNightly} feature flag.`,
-      );
-      addNoLanguageDiagnostic(
-        undefined,
-        makeDiagnostic(
-          "codeql-action/forced-nightly-cli",
-          "A nightly release of CodeQL was used",
-          {
-            markdownMessage:
-              "GitHub configured this analysis to use a nightly release of CodeQL to allow you to preview changes from an upcoming release.\n\n" +
-              "Nightly releases do not undergo the same validation as regular releases and may lead to analysis instability.\n\n" +
-              "If use of a nightly CodeQL release for this analysis is unexpected, please contact GitHub support.",
-            visibility: {
-              cliSummaryTable: true,
-              statusPage: true,
-              telemetry: true,
-            },
-            severity: "note",
-          },
-        ),
-      );
-    } else {
-      logger.info(
-        `Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.`,
-      );
-    }
-    toolsInput = await getNightlyToolsUrl(logger);
-  }
-
-  /**
-   * Whether the tools shipped with the Action, i.e. those in `defaults.json`, have been forced.
-   *
-   * We use the special value of 'linked' to prioritize the version in `defaults.json` over the
-   * version specified by the feature flags on Dotcom and over any pinned cached version on
-   * Enterprise Server.
-   *
-   * Previously we have been using 'latest' to force the shipped tools, but this was not clear
-   * enough for the users, so it has been changed to `linked`. We're keeping around `latest` for
-   * backwards compatibility.
-   */
-  const forceShippedTools =
-    toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput);
-
-  if (forceShippedTools) {
-    cliVersion = defaults.cliVersion;
-    tagName = defaults.bundleVersion;
-
-    logger.info(
-      `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion}, the version shipped with the Action.`,
-    );
-
-    if (toolsInput === "latest") {
-      logger.warning(
-        "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.",
-      );
-    }
-  } else if (
-    toolsInput !== undefined &&
-    toolsInput === CODEQL_TOOLCACHE_INPUT
-  ) {
-    let latestToolcacheVersion: string | undefined;
-
-    // We only allow `toolsInput === "toolcache"` for `dynamic` events. In general, using `toolsInput === "toolcache"`
-    // can lead to alert wobble and so it shouldn't be used for an analysis where results are intended to be uploaded.
-    // We also allow this in test mode.
-    const allowToolcacheValue = isDynamicWorkflow() || util.isInTestMode();
-    if (allowToolcacheValue) {
-      // If `toolsInput === "toolcache"`, try to find the latest version of the CLI that's available in the toolcache
-      // and use that. We perform this check here since we can set `cliVersion` directly and don't want to default to
-      // the linked version.
-      logger.info(
-        `Attempting to use the latest CodeQL CLI version in the toolcache, as requested by 'tools: ${toolsInput}'.`,
-      );
-
-      latestToolcacheVersion = getLatestToolcacheVersion(logger);
-      if (latestToolcacheVersion) {
-        cliVersion = latestToolcacheVersion;
-      }
-    }
-
-    if (latestToolcacheVersion === undefined) {
-      if (allowToolcacheValue) {
-        logger.info(
-          `Found no CodeQL CLI in the toolcache, ignoring 'tools: ${toolsInput}'...`,
-        );
-      } else {
-        logger.warning(
-          `Ignoring 'tools: ${toolsInput}' because the workflow was not triggered dynamically.`,
-        );
-      }
-
-      const version = await resolveDefaultCliVersion(
-        defaultCliVersion,
-        rawLanguages,
-        useOverlayAwareDefaultCliVersion,
-        features,
-        logger,
-      );
-      cliVersion = version.cliVersion;
-      tagName = version.tagName;
-    }
-  } else if (toolsInput !== undefined) {
-    // If a tools URL was provided, then use that.
-    tagName = tryGetTagNameFromUrl(toolsInput, logger);
-    url = toolsInput;
-
-    if (tagName) {
-      const bundleVersion = tryGetBundleVersionFromTagName(tagName, logger);
-      // If the bundle version is a semantic version, it is a CLI version number.
-      if (bundleVersion && semver.valid(bundleVersion)) {
-        cliVersion = convertToSemVer(bundleVersion, logger);
-      }
-    }
-  } else {
-    const version = await resolveDefaultCliVersion(
-      defaultCliVersion,
-      rawLanguages,
-      useOverlayAwareDefaultCliVersion,
-      features,
-      logger,
-    );
-    cliVersion = version.cliVersion;
-    tagName = version.tagName;
-  }
-
-  const bundleVersion =
-    tagName && tryGetBundleVersionFromTagName(tagName, logger);
-  const humanReadableVersion =
-    cliVersion ??
-    (bundleVersion && convertToSemVer(bundleVersion, logger)) ??
-    tagName ??
-    url ??
-    "unknown";
-
-  logger.debug(
-    "Attempting to obtain CodeQL tools. " +
-      `CLI version: ${cliVersion ?? "unknown"}, ` +
-      `bundle tag name: ${tagName ?? "unknown"}, ` +
-      `URL: ${url ?? "unspecified"}.`,
-  );
-
-  let codeqlFolder: string | undefined;
-
-  if (cliVersion) {
-    // If we find the specified CLI version, we always use that.
-    codeqlFolder = toolcache.find("CodeQL", cliVersion);
-
-    // Fall back to matching `x.y.z-`.
-    if (!codeqlFolder) {
-      logger.debug(
-        "Didn't find a version of the CodeQL tools in the toolcache with a version number " +
-          `exactly matching ${cliVersion}.`,
-      );
-      const allVersions = toolcache.findAllVersions("CodeQL");
-      logger.debug(
-        `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify(
-          allVersions,
-        )}.`,
-      );
-      // If there is exactly one version of the CodeQL tools in the toolcache, and that version is
-      // the form `x.y.z-`, then use it.
-      const candidateVersions = allVersions.filter((version) =>
-        version.startsWith(`${cliVersion}-`),
-      );
-      if (candidateVersions.length === 1) {
-        logger.debug(
-          `Exactly one version of the CodeQL tools starting with ${cliVersion} found in the ` +
-            "toolcache, using that.",
-        );
-        codeqlFolder = toolcache.find("CodeQL", candidateVersions[0]);
-      } else if (candidateVersions.length === 0) {
-        logger.debug(
-          `Didn't find any versions of the CodeQL tools starting with ${cliVersion} ` +
-            `in the toolcache. Trying next fallback method.`,
-        );
-      } else {
-        logger.warning(
-          `Found ${candidateVersions.length} versions of the CodeQL tools starting with ` +
-            `${cliVersion} in the toolcache, but at most one was expected.`,
-        );
-        logger.debug("Trying next fallback method.");
-      }
-    }
-  }
-
-  // Fall back to matching `0.0.0-`.
-  if (!codeqlFolder && tagName) {
-    const fallbackVersion = await tryGetFallbackToolcacheVersion(
-      cliVersion,
-      tagName,
-      logger,
-    );
-    if (fallbackVersion) {
-      codeqlFolder = toolcache.find("CodeQL", fallbackVersion);
-    } else {
-      logger.debug(
-        "Could not determine a fallback toolcache version number for CodeQL tools version " +
-          `${humanReadableVersion}.`,
-      );
-    }
-  }
-
-  if (codeqlFolder) {
-    logger.info(
-      `Found CodeQL tools version ${humanReadableVersion} in the toolcache.`,
-    );
-  } else {
-    logger.info(
-      `Did not find CodeQL tools version ${humanReadableVersion} in the toolcache.`,
-    );
-  }
-
-  if (codeqlFolder) {
-    if (cliVersion) {
-      logger.info(
-        `Using CodeQL CLI version ${cliVersion} from toolcache at ${codeqlFolder}`,
-      );
-    } else {
-      logger.info(`Using CodeQL CLI from toolcache at ${codeqlFolder}`);
-    }
-    return {
-      codeqlFolder,
-      sourceType: "toolcache",
-      toolsVersion: cliVersion ?? humanReadableVersion,
-    };
-  }
-
-  // If we don't find the requested version on Enterprise, we may allow a
-  // different version to save download time if the version hasn't been
-  // specified explicitly (in which case we always honor it).
-  if (
-    variant === util.GitHubVariant.GHES &&
-    !forceShippedTools &&
-    !toolsInput
-  ) {
-    const result = await findOverridingToolsInCache(
-      humanReadableVersion,
-      logger,
-    );
-    if (result !== undefined) {
-      return result;
-    }
-  }
-
-  let compressionMethod: tar.CompressionMethod;
-
-  if (!url) {
-    compressionMethod =
-      cliVersion !== undefined &&
-      (await useZstdBundle(cliVersion, tarSupportsZstd))
-        ? "zstd"
-        : "gzip";
-
-    url = await getCodeQLBundleDownloadURL(
-      tagName!,
-      apiDetails,
-      compressionMethod,
-      logger,
-    );
-  } else {
-    const method = tar.inferCompressionMethod(url);
-    if (method === undefined) {
-      throw new util.ConfigurationError(
-        `Could not infer compression method from URL ${url}. Please specify a URL ` +
-          "ending in '.tar.gz' or '.tar.zst'.",
-      );
-    }
-    compressionMethod = method;
-  }
-
-  if (cliVersion) {
-    logger.info(`Using CodeQL CLI version ${cliVersion} sourced from ${url} .`);
-  } else {
-    logger.info(`Using CodeQL CLI sourced from ${url} .`);
-  }
-  return {
-    bundleVersion: tagName && tryGetBundleVersionFromTagName(tagName, logger),
-    cliVersion,
-    codeqlURL: url,
-    compressionMethod,
-    sourceType: "download",
-    toolsVersion: cliVersion ?? humanReadableVersion,
-  };
-}
-
-/**
- * Gets a fallback version number to use when looking for CodeQL in the toolcache if we didn't find
- * the `x.y.z` version. This is to support old versions of the toolcache.
- */
-async function tryGetFallbackToolcacheVersion(
-  cliVersion: string | undefined,
-  tagName: string,
-  logger: Logger,
-): Promise {
-  const bundleVersion = tryGetBundleVersionFromTagName(tagName, logger);
-  if (!bundleVersion) {
-    return undefined;
-  }
-  const fallbackVersion = convertToSemVer(bundleVersion, logger);
-  logger.debug(
-    `Computed a fallback toolcache version number of ${fallbackVersion} for CodeQL version ` +
-      `${cliVersion ?? tagName}.`,
-  );
-  return fallbackVersion;
-}
-
-// Exported using `export const` for testing purposes. Specifically, we want to
-// be able to stub this function and have other functions in this file use that stub.
-export const downloadCodeQL = async function (
-  codeqlURL: string,
-  compressionMethod: tar.CompressionMethod,
-  maybeBundleVersion: string | undefined,
-  maybeCliVersion: string | undefined,
-  apiDetails: api.GitHubApiDetails,
-  tarVersion: tar.TarVersion | undefined,
-  tempDir: string,
-  logger: Logger,
-): Promise<{
-  codeqlFolder: string;
-  statusReport: ToolsDownloadStatusReport;
-  toolsVersion: string;
-}> {
-  const parsedCodeQLURL = new URL(codeqlURL);
-  const searchParams = new URLSearchParams(parsedCodeQLURL.search);
-  const headers: OutgoingHttpHeaders = {
-    accept: "application/octet-stream",
-  };
-  let authorization: string | undefined = undefined;
-
-  // We don't want to send an authorization header if there's already a token provided in the URL.
-  if (searchParams.has("token")) {
-    logger.debug("CodeQL tools URL contains an authorization token.");
-  } else {
-    authorization = api.getAuthorizationHeaderFor(
-      logger,
-      apiDetails,
-      codeqlURL,
-    );
-  }
-
-  const toolcacheInfo = getToolcacheDestinationInfo(
-    maybeBundleVersion,
-    maybeCliVersion,
-    logger,
-  );
-
-  const extractedBundlePath =
-    toolcacheInfo?.path ?? getTempExtractionDir(tempDir);
-
-  const statusReport = await downloadAndExtract(
-    codeqlURL,
-    compressionMethod,
-    extractedBundlePath,
-    authorization,
-    { "User-Agent": "CodeQL Action", ...headers },
-    tarVersion,
-    logger,
-  );
-
-  if (!toolcacheInfo) {
-    logger.debug(
-      "Could not cache CodeQL tools because we could not determine the bundle version from the " +
-        `URL ${codeqlURL}.`,
-    );
-    return {
-      codeqlFolder: extractedBundlePath,
-      statusReport,
-      toolsVersion: maybeCliVersion ?? "unknown",
-    };
-  }
-
-  writeToolcacheMarkerFile(toolcacheInfo.path, logger);
-
-  return {
-    codeqlFolder: extractedBundlePath,
-    statusReport,
-    toolsVersion: maybeCliVersion ?? toolcacheInfo.version,
-  };
-};
-
-function getToolcacheDestinationInfo(
-  maybeBundleVersion: string | undefined,
-  maybeCliVersion: string | undefined,
-  logger: Logger,
-): { path: string; version: string } | undefined {
-  if (maybeBundleVersion) {
-    const version = getCanonicalToolcacheVersion(
-      maybeCliVersion,
-      maybeBundleVersion,
-      logger,
-    );
-
-    return {
-      path: getToolcacheDirectory(version),
-      version,
-    };
-  }
-
-  return undefined;
-}
-
-export function getCodeQLURLVersion(url: string): string {
-  const match = url.match(/\/codeql-bundle-(.*)\//);
-  if (match === null || match.length < 2) {
-    throw new util.ConfigurationError(
-      `Malformed tools url: ${url}. Version could not be inferred`,
-    );
-  }
-  return match[1];
-}
-
-/**
- * Returns the toolcache version number to use to store the bundle with the associated CLI version
- * and bundle version.
- *
- * This is the canonical version number, since toolcaches populated by different versions of the
- * CodeQL Action or different runner image creation scripts may store the bundle using a different
- * version number. Functions like `getCodeQLSource` that fetch the bundle from rather than save the
- * bundle to the toolcache should handle these different version numbers.
- */
-function getCanonicalToolcacheVersion(
-  cliVersion: string | undefined,
-  bundleVersion: string,
-  logger: Logger,
-): string {
-  // If the CLI version is a pre-release or contains build metadata, then cache the
-  // bundle as `0.0.0-` to avoid the bundle being interpreted as containing a stable
-  // CLI release. In principle, it should be enough to just check that the CLI version isn't a
-  // pre-release, but the version numbers of CodeQL nightlies have the format `x.y.z+`,
-  // and we don't want these nightlies to override stable CLI versions in the toolcache.
-  if (!cliVersion?.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
-    return convertToSemVer(bundleVersion, logger);
-  }
-  // Bundles are now semantically versioned and can be looked up based on just the CLI version
-  // number, so we can version them in the toolcache using just the CLI version number.
-  return cliVersion;
-}
-
-interface SetupCodeQLResult {
-  codeqlFolder: string;
-  toolsDownloadStatusReport?: ToolsDownloadStatusReport;
-  toolsSource: ToolsSource;
-  toolsVersion: string;
-}
-
-/**
- * Obtains the CodeQL bundle, installs it in the toolcache if appropriate, and extracts it.
- *
- * @returns the path to the extracted bundle, and the version of the tools
- */
-export async function setupCodeQLBundle(
-  toolsInput: string | undefined,
-  apiDetails: api.GitHubApiDetails,
-  tempDir: string,
-  variant: util.GitHubVariant,
-  defaultCliVersion: CodeQLDefaultVersionInfo,
-  rawLanguages: string[] | undefined,
-  useOverlayAwareDefaultCliVersion: boolean,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  if (!(await util.isBinaryAccessible("tar", logger))) {
-    throw new util.ConfigurationError(
-      "Could not find tar in PATH, so unable to extract CodeQL bundle.",
-    );
-  }
-  const zstdAvailability = await tar.isZstdAvailable(logger);
-
-  const source = await getCodeQLSource(
-    toolsInput,
-    defaultCliVersion,
-    rawLanguages,
-    useOverlayAwareDefaultCliVersion,
-    apiDetails,
-    variant,
-    zstdAvailability.available,
-    features,
-    logger,
-  );
-
-  let codeqlFolder: string;
-  let toolsVersion = source.toolsVersion;
-  let toolsDownloadStatusReport: ToolsDownloadStatusReport | undefined;
-  let toolsSource: ToolsSource;
-  switch (source.sourceType) {
-    case "local": {
-      codeqlFolder = await tar.extract(
-        source.codeqlTarPath,
-        getTempExtractionDir(tempDir),
-        source.compressionMethod,
-        zstdAvailability.version,
-        logger,
-      );
-      toolsSource = ToolsSource.Local;
-      break;
-    }
-    case "toolcache":
-      codeqlFolder = source.codeqlFolder;
-      logger.debug(`CodeQL found in cache ${codeqlFolder}`);
-      toolsSource = ToolsSource.Toolcache;
-      break;
-    case "download": {
-      const result = await downloadCodeQL(
-        source.codeqlURL,
-        source.compressionMethod,
-        source.bundleVersion,
-        source.cliVersion,
-        apiDetails,
-        zstdAvailability.version,
-        tempDir,
-        logger,
-      );
-      toolsVersion = result.toolsVersion;
-      codeqlFolder = result.codeqlFolder;
-      toolsDownloadStatusReport = result.statusReport;
-      toolsSource = ToolsSource.Download;
-      break;
-    }
-    default:
-      util.assertNever(source);
-  }
-  return {
-    codeqlFolder,
-    toolsDownloadStatusReport,
-    toolsSource,
-    toolsVersion,
-  };
-}
-
-async function useZstdBundle(
-  cliVersion: string,
-  tarSupportsZstd: boolean,
-): Promise {
-  return (
-    // In testing, gzip performs better than zstd on Windows.
-    process.platform !== "win32" &&
-    tarSupportsZstd &&
-    semver.gte(cliVersion, CODEQL_VERSION_ZSTD_BUNDLE)
-  );
-}
-
-function getTempExtractionDir(tempDir: string) {
-  return path.join(tempDir, uuidV4());
-}
-
-/**
- * Get the URL of the latest nightly CodeQL bundle.
- */
-async function getNightlyToolsUrl(logger: Logger) {
-  const zstdAvailability = await tar.isZstdAvailable(logger);
-  // The nightly is guaranteed to have a zstd bundle
-  const compressionMethod = (await useZstdBundle(
-    CODEQL_VERSION_ZSTD_BUNDLE,
-    zstdAvailability.available,
-  ))
-    ? "zstd"
-    : "gzip";
-
-  try {
-    // Since nightlies are prereleases, we can't just download the latest release
-    // on the repository. So instead we need to find the latest pre-release
-    // version and construct the download URL from that.
-    const release = await api.getApiClient().rest.repos.listReleases({
-      owner: CODEQL_NIGHTLIES_REPOSITORY_OWNER,
-      repo: CODEQL_NIGHTLIES_REPOSITORY_NAME,
-      per_page: 1,
-      page: 1,
-      prerelease: true,
-    });
-    const latestRelease = release.data[0];
-    if (!latestRelease) {
-      throw new Error("Could not find the latest nightly release.");
-    }
-    return `https://github.com/${CODEQL_NIGHTLIES_REPOSITORY_OWNER}/${CODEQL_NIGHTLIES_REPOSITORY_NAME}/releases/download/${latestRelease.tag_name}/${getCodeQLBundleName(compressionMethod)}`;
-  } catch (e) {
-    throw new Error(
-      `Failed to retrieve the latest nightly release: ${util.wrapError(e)}`,
-    );
-  }
-}
-
-/**
- * Gets the latest version of the CodeQL CLI that is available in the toolcache, or `undefined`
- * if no CodeQL CLI is available in the toolcache.
- *
- * @param logger The logger to use.
- * @returns The latest version of the CodeQL CLI that is available in the toolcache, or `undefined` if there is none.
- */
-export function getLatestToolcacheVersion(logger: Logger): string | undefined {
-  const allVersions = toolcache
-    .findAllVersions("CodeQL")
-    .sort((a, b) => semver.compare(b, a));
-  logger.debug(
-    `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify(
-      allVersions,
-    )}.`,
-  );
-
-  if (allVersions.length > 0) {
-    const latestToolcacheVersion = allVersions[0];
-    logger.info(
-      `CLI version ${latestToolcacheVersion} is the latest version in the toolcache.`,
-    );
-    return latestToolcacheVersion;
-  }
-
-  return undefined;
-}
-
-function isReservedToolsValue(tools: string): boolean {
-  return (
-    CODEQL_BUNDLE_VERSION_ALIAS.includes(tools) ||
-    CODEQL_NIGHTLY_TOOLS_INPUTS.includes(tools) ||
-    tools === CODEQL_TOOLCACHE_INPUT
-  );
-}
diff --git a/src/start-proxy-action-post.ts b/src/start-proxy-action-post.ts
deleted file mode 100644
index 6b59052c6e..0000000000
--- a/src/start-proxy-action-post.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * This file is the entry point for the `post:` hook of `start-proxy-action.yml`.
- * It will run after the all steps in this job, in reverse order in relation to
- * other `post:` hooks.
- */
-import * as core from "@actions/core";
-
-import * as actionsUtil from "./actions-util";
-import { getGitHubVersion } from "./api-client";
-import * as configUtils from "./config-utils";
-import { uploadArtifacts } from "./debug-artifacts";
-import { getActionsLogger } from "./logging";
-import { checkGitHubVersionInRange, getErrorMessage } from "./util";
-
-export async function runWrapper() {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-
-  const logger = getActionsLogger();
-
-  try {
-    // Restore inputs from `start-proxy` Action.
-    actionsUtil.restoreInputs();
-
-    // Kill the running proxy
-    const pid = core.getState("proxy-process-pid");
-    if (pid) {
-      process.kill(Number(pid));
-    }
-
-    const config = await configUtils.getConfig(
-      actionsUtil.getTemporaryDirectory(),
-      logger,
-    );
-
-    if (config?.debugMode || core.isDebug()) {
-      const logFilePath = core.getState("proxy-log-file");
-      logger.info(
-        "Debug mode is on. Uploading proxy log as Actions debugging artifact...",
-      );
-      if (config?.gitHubVersion.type === undefined) {
-        logger.warning(
-          `Did not upload debug artifacts because cannot determine the GitHub variant running.`,
-        );
-        return;
-      }
-      const gitHubVersion = await getGitHubVersion();
-      checkGitHubVersionInRange(gitHubVersion, logger);
-
-      await uploadArtifacts(
-        logger,
-        [logFilePath],
-        actionsUtil.getTemporaryDirectory(),
-        "proxy-log-file",
-        gitHubVersion.type,
-      );
-    }
-  } catch (error) {
-    // A failure in the post step should not fail the entire action.
-    logger.warning(
-      `start-proxy post-action step failed: ${getErrorMessage(error)}`,
-    );
-  }
-}
diff --git a/src/start-proxy-action.ts b/src/start-proxy-action.ts
deleted file mode 100644
index e8b89732f7..0000000000
--- a/src/start-proxy-action.ts
+++ /dev/null
@@ -1,195 +0,0 @@
-import { ChildProcess, spawn } from "child_process";
-import * as path from "path";
-
-import * as core from "@actions/core";
-
-import { Action, ActionState, runInActions } from "./action-common";
-import * as actionsUtil from "./actions-util";
-import { getGitHubVersion } from "./api-client";
-import { FeatureEnablement, initFeatures } from "./feature-flags";
-import { BuiltInLanguage, parseBuiltInLanguage } from "./languages";
-import { Logger } from "./logging";
-import { getRepositoryNwo } from "./repository";
-import {
-  credentialToStr,
-  getCredentials,
-  getProxyBinaryPath,
-  getSafeErrorMessage,
-  ProxyInfo,
-  sendFailedStatusReport,
-  sendSuccessStatusReport,
-  Registry,
-  ProxyConfig,
-} from "./start-proxy";
-import { generateCertificateAuthority } from "./start-proxy/ca";
-import { checkProxyEnvironment } from "./start-proxy/environment";
-import { checkConnections } from "./start-proxy/reachability";
-import { ActionName } from "./status-report";
-import * as util from "./util";
-
-async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-  const startedAt = action.startedAt;
-  const logger = action.logger;
-  let features: FeatureEnablement | undefined;
-  let language: BuiltInLanguage | undefined;
-
-  try {
-    // Make inputs accessible in the `post` step.
-    actionsUtil.persistInputs();
-
-    // Setup logging for the proxy
-    const tempDir = actionsUtil.getTemporaryDirectory();
-    const proxyLogFilePath = path.resolve(tempDir, "proxy.log");
-    core.saveState("proxy-log-file", proxyLogFilePath);
-
-    // Initialise FFs.
-    const repositoryNwo = getRepositoryNwo();
-    const gitHubVersion = await getGitHubVersion();
-    features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      actionsUtil.getTemporaryDirectory(),
-      logger,
-    );
-
-    // Get the language input.
-    const languageInput = actionsUtil.getOptionalInput("language");
-    language = languageInput ? parseBuiltInLanguage(languageInput) : undefined;
-
-    // Get the registry configurations from one of the inputs.
-    const credentials = getCredentials(
-      logger,
-      actionsUtil.getOptionalInput("registry_secrets"),
-      actionsUtil.getOptionalInput("registries_credentials"),
-      language,
-    );
-
-    if (credentials.length === 0) {
-      logger.info("No credentials found, skipping proxy setup.");
-      return;
-    }
-
-    logger.info(
-      `Credentials loaded for the following registries:\n ${credentials
-        .map((c) => credentialToStr(c))
-        .join("\n")}`,
-    );
-
-    // Check the environment for any configurations which may affect the proxy.
-    // This is a best effort process to give us insights into potential factors
-    // which may affect the operation of our proxy.
-    if (core.isDebug() || util.isInTestMode()) {
-      try {
-        await checkProxyEnvironment(logger, language);
-      } catch (err) {
-        logger.debug(
-          `Unable to inspect runner environment: ${util.getErrorMessage(err)}`,
-        );
-      }
-    }
-
-    const ca = generateCertificateAuthority();
-
-    const proxyConfig: ProxyConfig = {
-      all_credentials: credentials,
-      ca,
-    };
-
-    // Start the Proxy
-    const proxyBin = await getProxyBinaryPath(logger, features);
-    const proxyInfo = await startProxy(
-      proxyBin,
-      proxyConfig,
-      proxyLogFilePath,
-      logger,
-    );
-
-    // Perform best-effort checks that the private registries are reachable.
-    await checkConnections(logger, proxyInfo);
-
-    // Report success if we have reached this point.
-    await sendSuccessStatusReport(
-      startedAt,
-      {
-        languages: language === undefined ? undefined : [language],
-      },
-      proxyConfig.all_credentials.map((c) => c.type),
-      logger,
-    );
-  } catch (unwrappedError) {
-    await sendFailedStatusReport(logger, startedAt, language, unwrappedError);
-  }
-}
-
-/** Defines the `start-proxy` Action. */
-const startProxyAction: Action = {
-  name: ActionName.StartProxy,
-  run,
-  transformTelemetryError: getSafeErrorMessage,
-};
-
-export async function runWrapper() {
-  await runInActions(startProxyAction);
-}
-
-async function startProxy(
-  binPath: string,
-  config: ProxyConfig,
-  logFilePath: string,
-  logger: Logger,
-): Promise {
-  const host = "127.0.0.1";
-  let port = 49152;
-  let subprocess: ChildProcess | undefined = undefined;
-  let tries = 5;
-  let subprocessError: Error | undefined = undefined;
-  while (tries-- > 0 && !subprocess && !subprocessError) {
-    subprocess = spawn(
-      binPath,
-      ["-addr", `${host}:${port}`, "-config", "-", "-logfile", logFilePath],
-      {
-        detached: true,
-        stdio: ["pipe", "ignore", "ignore"],
-      },
-    );
-    subprocess.unref();
-    if (subprocess.pid) {
-      core.saveState("proxy-process-pid", `${subprocess.pid}`);
-    }
-    subprocess.on("error", (error) => {
-      subprocessError = error;
-    });
-    subprocess.on("exit", (code) => {
-      if (code !== 0) {
-        // If the proxy failed to start, try a different port from the ephemeral range [49152, 65535]
-        port = Math.floor(Math.random() * (65535 - 49152) + 49152);
-        subprocess = undefined;
-      }
-    });
-    subprocess.stdin?.write(JSON.stringify(config));
-    subprocess.stdin?.end();
-    // Wait a little to allow the proxy to start
-    await util.delay(1000);
-  }
-  if (subprocessError) {
-    // eslint-disable-next-line @typescript-eslint/only-throw-error
-    throw subprocessError;
-  }
-  logger.info(`Proxy started on ${host}:${port}`);
-  core.setOutput("proxy_host", host);
-  core.setOutput("proxy_port", port.toString());
-  core.setOutput("proxy_ca_certificate", config.ca.cert);
-
-  const registry_urls: Registry[] = config.all_credentials
-    .filter((credential) => credential.url !== undefined)
-    .map((credential) => ({
-      type: credential.type,
-      url: credential.url,
-      "replaces-base": credential["replaces-base"],
-    }));
-  core.setOutput("proxy_urls", JSON.stringify(registry_urls));
-
-  return { host, port, cert: config.ca.cert, registries: registry_urls };
-}
diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts
deleted file mode 100644
index ee953798b8..0000000000
--- a/src/start-proxy.test.ts
+++ /dev/null
@@ -1,1073 +0,0 @@
-import * as filepath from "path";
-
-import * as core from "@actions/core";
-import * as toolcache from "@actions/tool-cache";
-import test, { ExecutionContext } from "ava";
-import sinon from "sinon";
-
-import * as apiClient from "./api-client";
-import * as defaults from "./defaults.json";
-import { setUpFeatureFlagTests } from "./feature-flags/testing-util";
-import { UnvalidatedObject, validateSchema } from "./json";
-import { makeFromSchema } from "./json/testing-util";
-import { BuiltInLanguage } from "./languages";
-import { getRunnerLogger, Logger } from "./logging";
-import * as startProxyExports from "./start-proxy";
-import * as statusReport from "./status-report";
-import {
-  assertNotLogged,
-  checkExpectedLogMessages,
-  createFeatures,
-  makeMacro,
-  makeTestToken,
-  RecordingLogger,
-  setupTests,
-  withRecordingLoggerAsync,
-} from "./testing-utils";
-import {
-  ConfigurationError,
-  GitHubVariant,
-  GitHubVersion,
-  withTmpDir,
-} from "./util";
-
-setupTests(test);
-
-const sendFailedStatusReportTest = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    err: Error,
-    expectedMessage: string,
-    expectedStatus: statusReport.ActionStatus = "failure",
-  ) => {
-    const now = new Date();
-
-    // Override core.setFailed to avoid it setting the program's exit code
-    sinon.stub(core, "setFailed").returns();
-
-    const createStatusReportBase = sinon.stub(
-      statusReport,
-      "createStatusReportBase",
-    );
-    createStatusReportBase.resolves(undefined);
-
-    await withRecordingLoggerAsync(async (logger) => {
-      await startProxyExports.sendFailedStatusReport(
-        logger,
-        now,
-        undefined,
-        err,
-      );
-
-      // Check that the stub has been called exactly once, with the expected arguments,
-      // but not with the message from the error.
-      sinon.assert.calledOnceWithExactly(
-        createStatusReportBase,
-        statusReport.ActionName.StartProxy,
-        expectedStatus,
-        now,
-        sinon.match.any,
-        sinon.match.any,
-        sinon.match.any,
-        expectedMessage,
-      );
-      t.false(
-        createStatusReportBase.calledWith(
-          statusReport.ActionName.StartProxy,
-          expectedStatus,
-          now,
-          sinon.match.any,
-          sinon.match.any,
-          sinon.match.any,
-          sinon.match((msg: string) => msg.includes(err.message)),
-        ),
-        "createStatusReportBase was called with the error message",
-      );
-    });
-  },
-
-  title: (providedTitle = "") => `sendFailedStatusReport - ${providedTitle}`,
-});
-
-sendFailedStatusReportTest.serial(
-  "reports generic error message for non-StartProxyError error",
-  new Error("Something went wrong today"),
-  "Error from start-proxy Action omitted (Error).",
-);
-
-sendFailedStatusReportTest.serial(
-  "reports generic error message for non-StartProxyError error with safe error message",
-  new Error(
-    startProxyExports.getStartProxyErrorMessage(
-      startProxyExports.StartProxyErrorType.DownloadFailed,
-    ),
-  ),
-  "Error from start-proxy Action omitted (Error).",
-);
-
-sendFailedStatusReportTest.serial(
-  "reports generic error message for ConfigurationError error",
-  new ConfigurationError("Something went wrong today"),
-  "Error from start-proxy Action omitted (ConfigurationError).",
-  "user-error",
-);
-
-const toEncodedJSON = (data: any) =>
-  Buffer.from(JSON.stringify(data)).toString("base64");
-
-const mixedCredentials = [
-  { type: "npm_registry", host: "npm.pkg.github.com", token: "abc" },
-  { type: "maven_repository", host: "maven.pkg.github.com", token: "def" },
-  { type: "nuget_feed", host: "nuget.pkg.github.com", token: "ghi" },
-  { type: "goproxy_server", host: "goproxy.example.com", token: "jkl" },
-];
-
-const gitSourceCredential = {
-  type: "git_source",
-  host: "github.com/github",
-  token: "mno",
-};
-
-const dockerRegistryCredential = {
-  type: "docker_registry",
-  host: "https://registry.example.com",
-  token: "pqr",
-};
-
-test("getCredentials prefers registriesCredentials over registrySecrets", async (t) => {
-  const registryCredentials = Buffer.from(
-    JSON.stringify([
-      { type: "npm_registry", host: "npm.pkg.github.com", token: "abc" },
-    ]),
-  ).toString("base64");
-  const registrySecrets = JSON.stringify([
-    { type: "npm_registry", host: "registry.npmjs.org", token: "def" },
-  ]);
-
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    registrySecrets,
-    registryCredentials,
-    undefined,
-  );
-  t.is(credentials.length, 1);
-  t.is(credentials[0].host, "npm.pkg.github.com");
-});
-
-test("getCredentials throws an error when configurations are not an array", async (t) => {
-  const registryCredentials = Buffer.from(
-    JSON.stringify({ type: "npm_registry", token: "abc" }),
-  ).toString("base64");
-
-  t.throws(
-    () =>
-      startProxyExports.getCredentials(
-        getRunnerLogger(true),
-        undefined,
-        registryCredentials,
-        undefined,
-      ),
-    {
-      message:
-        "Expected credentials data to be an array of configurations, but it is not.",
-    },
-  );
-});
-
-test("getCredentials throws error when credential is not an object", async (t) => {
-  const testCredentials = [["foo"], [null]].map(toEncodedJSON);
-
-  for (const testCredential of testCredentials) {
-    t.throws(
-      () =>
-        startProxyExports.getCredentials(
-          getRunnerLogger(true),
-          undefined,
-          testCredential,
-          undefined,
-        ),
-      {
-        message: "Invalid credentials - must be an object",
-      },
-    );
-  }
-});
-
-test("getCredentials throws error when credential is missing type", async (t) => {
-  const testCredentials = [[{ token: "abc", url: "https://localhost" }]].map(
-    toEncodedJSON,
-  );
-
-  for (const testCredential of testCredentials) {
-    t.throws(
-      () =>
-        startProxyExports.getCredentials(
-          getRunnerLogger(true),
-          undefined,
-          testCredential,
-          undefined,
-        ),
-      {
-        message: "Invalid credentials - must have a type",
-      },
-    );
-  }
-});
-
-test("getCredentials throws error when credential missing host and url", async (t) => {
-  const testCredentials = [
-    [{ type: "npm_registry", token: "abc" }],
-    [{ type: "npm_registry", token: "abc", host: null }],
-    [{ type: "npm_registry", token: "abc", url: null }],
-  ].map(toEncodedJSON);
-
-  for (const testCredential of testCredentials) {
-    t.throws(
-      () =>
-        startProxyExports.getCredentials(
-          getRunnerLogger(true),
-          undefined,
-          testCredential,
-          undefined,
-        ),
-      {
-        message: "Invalid credentials - must specify host or url",
-      },
-    );
-  }
-});
-
-test("getCredentials filters by language when specified", async (t) => {
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    undefined,
-    toEncodedJSON(mixedCredentials),
-    BuiltInLanguage.java,
-  );
-  t.is(credentials.length, 1);
-  t.is(credentials[0].type, "maven_repository");
-});
-
-test("getCredentials returns all for a language when specified", async (t) => {
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    undefined,
-    toEncodedJSON([...mixedCredentials, gitSourceCredential]),
-    BuiltInLanguage.go,
-  );
-  t.is(credentials.length, 2);
-
-  const credentialsTypes = credentials.map((c) => c.type);
-  t.assert(credentialsTypes.includes("goproxy_server"));
-  t.assert(credentialsTypes.includes("git_source"));
-});
-
-test("getCredentials returns all goproxy_servers for Go when specified", async (t) => {
-  const multipleGoproxyServers = [
-    { type: "goproxy_server", host: "goproxy1.example.com", token: "token1" },
-    { type: "goproxy_server", host: "goproxy2.example.com", token: "token2" },
-    { type: "git_source", host: "github.com/github", token: "mno" },
-  ];
-
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    undefined,
-    toEncodedJSON(multipleGoproxyServers),
-    BuiltInLanguage.go,
-  );
-  t.is(credentials.length, 3);
-
-  const goproxyServers = credentials.filter((c) => c.type === "goproxy_server");
-  t.is(goproxyServers.length, 2);
-  t.assert(goproxyServers.some((c) => c.host === "goproxy1.example.com"));
-  t.assert(goproxyServers.some((c) => c.host === "goproxy2.example.com"));
-});
-
-test("getCredentials returns all maven_repositories for Java when specified", async (t) => {
-  const multipleMavenRepositories = [
-    {
-      type: "maven_repository",
-      host: "maven1.pkg.github.com",
-      token: "token1",
-    },
-    {
-      type: "maven_repository",
-      host: "maven2.pkg.github.com",
-      token: "token2",
-    },
-    { type: "goproxy_server", host: "github.com/github", token: "mno" },
-  ];
-
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    undefined,
-    toEncodedJSON(multipleMavenRepositories),
-    BuiltInLanguage.java,
-  );
-  t.is(credentials.length, 2);
-
-  const mavenRepositories = credentials.filter(
-    (c) => c.type === "maven_repository",
-  );
-  t.assert(mavenRepositories.some((c) => c.host === "maven1.pkg.github.com"));
-  t.assert(mavenRepositories.some((c) => c.host === "maven2.pkg.github.com"));
-});
-
-test("getCredentials returns all credentials when no language specified", async (t) => {
-  const credentialsInput = toEncodedJSON(mixedCredentials);
-
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    undefined,
-    credentialsInput,
-    undefined,
-  );
-  t.is(credentials.length, mixedCredentials.length);
-});
-
-test("getCredentials throws an error when non-printable characters are used", async (t) => {
-  const invalidCredentials: startProxyExports.RawCredential[] = [
-    { type: "nuget_feed", host: "1nuget.pkg.github.com", token: "abc\u0000" }, // Non-printable character in token
-    { type: "nuget_feed", host: "2nuget.pkg.github.com\u0001" }, // Non-printable character in host
-    {
-      type: "nuget_feed",
-      host: "3nuget.pkg.github.com",
-      password: "ghi\u0002",
-    }, // Non-printable character in password
-    {
-      type: "nuget_feed",
-      host: "4nuget.pkg.github.com",
-      token: "ghi\x00",
-    }, // Non-printable character in token
-  ];
-
-  for (const invalidCredential of invalidCredentials) {
-    const credentialsInput = toEncodedJSON([invalidCredential]);
-
-    t.throws(
-      () =>
-        startProxyExports.getCredentials(
-          getRunnerLogger(true),
-          undefined,
-          credentialsInput,
-          undefined,
-        ),
-      {
-        message:
-          "Invalid credentials - fields must contain only printable characters",
-      },
-    );
-  }
-});
-
-for (const oidcSchemaInfo of startProxyExports.oidcSchemas) {
-  test(`getCredentials throws when non-printable characters are used (${oidcSchemaInfo.name} OIDC)`, (t) => {
-    const validCredential = makeFromSchema(true, oidcSchemaInfo.schema);
-    for (const key of Object.keys(validCredential)) {
-      const invalidAuthConfig = {
-        ...validCredential,
-        [key]: "123\x00",
-      };
-      const invalidCredential: startProxyExports.RawCredential = {
-        type: "nuget_feed",
-        host: `${key}.nuget.pkg.github.com`,
-        ...invalidAuthConfig,
-      };
-      const credentialsInput = toEncodedJSON([invalidCredential]);
-
-      t.throws(
-        () =>
-          startProxyExports.getCredentials(
-            getRunnerLogger(true),
-            undefined,
-            credentialsInput,
-            undefined,
-          ),
-        {
-          message:
-            "Invalid credentials - fields must contain only printable characters",
-        },
-      );
-    }
-  });
-}
-
-test("getCredentials accepts OIDC configurations", (t) => {
-  const oidcConfigurations = startProxyExports.oidcSchemas.map(
-    (schemaInfo) => ({
-      type: "nuget_feed",
-      host: `${schemaInfo.name.toLowerCase()}.pkg.github.com`,
-      ...makeFromSchema(true, schemaInfo.schema),
-    }),
-  );
-
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    undefined,
-    toEncodedJSON(oidcConfigurations),
-    BuiltInLanguage.csharp,
-  );
-  t.is(credentials.length, startProxyExports.oidcSchemas.length);
-
-  t.assert(credentials.every((c) => c.type === "nuget_feed"));
-
-  for (const oidcSchemaInfo of startProxyExports.oidcSchemas) {
-    t.assert(
-      credentials.some((c) =>
-        validateSchema(
-          oidcSchemaInfo.schema,
-          c as unknown as UnvalidatedObject,
-        ),
-      ),
-    );
-  }
-});
-
-const getCredentialsMacro = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    credentials: startProxyExports.RawCredential[],
-    checkAccepted: (
-      t: ExecutionContext,
-      logger: RecordingLogger,
-      results: startProxyExports.Credential[],
-    ) => void,
-  ) => {
-    const logger = new RecordingLogger();
-    const credentialsString = toEncodedJSON(credentials);
-
-    const results = startProxyExports.getCredentials(
-      logger,
-      undefined,
-      credentialsString,
-      undefined,
-    );
-
-    checkAccepted(t, logger, results);
-  },
-
-  title: (providedTitle = "") => `getCredentials - ${providedTitle}`,
-});
-
-getCredentialsMacro(
-  "warns for PAT-like password without a username",
-  [
-    {
-      type: "git_server",
-      host: "https://github.com/",
-      password: `ghp_${makeTestToken()}`,
-    },
-  ],
-  (t, logger, results) => {
-    // The configurations should be accepted, despite the likely problem.
-    t.assert(results);
-    t.is(results.length, 1);
-    t.is(results[0].type, "git_server");
-    t.is(results[0].host, "https://github.com/");
-
-    if (startProxyExports.hasUsernameAndPassword(results[0])) {
-      t.assert(results[0].password?.startsWith("ghp_"));
-    } else {
-      t.fail("Expected a `UsernamePassword`-based credential.");
-    }
-
-    // A warning should have been logged.
-    checkExpectedLogMessages(t, logger.messages, [
-      "using a GitHub Personal Access Token (PAT), but no username was provided",
-    ]);
-  },
-);
-
-getCredentialsMacro(
-  "no warning for PAT-like password with a username",
-  [
-    {
-      type: "git_server",
-      host: "https://github.com/",
-      username: "someone",
-      password: `ghp_${makeTestToken()}`,
-    },
-  ],
-  (t, logger, results) => {
-    // The configurations should be accepted, despite the likely problem.
-    t.assert(results);
-    t.is(results.length, 1);
-    t.is(results[0].type, "git_server");
-    t.is(results[0].host, "https://github.com/");
-
-    if (startProxyExports.hasUsernameAndPassword(results[0])) {
-      t.assert(results[0].password?.startsWith("ghp_"));
-    } else {
-      t.fail("Expected a `UsernamePassword`-based credential.");
-    }
-
-    assertNotLogged(
-      t,
-      logger,
-      "using a GitHub Personal Access Token (PAT), but no username was provided",
-    );
-  },
-);
-
-getCredentialsMacro(
-  "warns for PAT-like token without a username",
-  [
-    {
-      type: "git_server",
-      host: "https://github.com/",
-      token: `ghp_${makeTestToken()}`,
-    },
-  ],
-  (t, logger, results) => {
-    // The configurations should be accepted, despite the likely problem.
-    t.assert(results);
-    t.is(results.length, 1);
-    t.is(results[0].type, "git_server");
-    t.is(results[0].host, "https://github.com/");
-
-    if (startProxyExports.isToken(results[0])) {
-      t.assert(results[0].token?.startsWith("ghp_"));
-    } else {
-      t.fail("Expected a `Token`-based credential.");
-    }
-
-    // A warning should have been logged.
-    checkExpectedLogMessages(t, logger.messages, [
-      "using a GitHub Personal Access Token (PAT), but no username was provided",
-    ]);
-  },
-);
-
-getCredentialsMacro(
-  "no warning for PAT-like token with a username",
-  [
-    {
-      type: "git_server",
-      host: "https://github.com/",
-      username: "someone",
-      token: `ghp_${makeTestToken()}`,
-    },
-  ],
-  (t, logger, results) => {
-    // The configurations should be accepted, despite the likely problem.
-    t.assert(results);
-    t.is(results.length, 1);
-    t.is(results[0].type, "git_server");
-    t.is(results[0].host, "https://github.com/");
-
-    if (startProxyExports.isToken(results[0])) {
-      t.assert(results[0].token?.startsWith("ghp_"));
-    } else {
-      t.fail("Expected a `Token`-based credential.");
-    }
-
-    assertNotLogged(
-      t,
-      logger,
-      "using a GitHub Personal Access Token (PAT), but no username was provided",
-    );
-  },
-);
-
-test("getCredentials validates 'replaces-base' correctly", async (t) => {
-  // Valid cases.
-  const credentialsInput = toEncodedJSON([
-    {
-      type: "maven_repository",
-      host: "maven1.pkg.github.com",
-      token: "abc",
-      "replaces-base": false,
-    },
-    {
-      type: "maven_repository",
-      host: "maven2.pkg.github.com",
-      token: "def",
-      "replaces-base": true,
-    },
-    {
-      type: "maven_repository",
-      host: "maven3.pkg.github.com",
-      token: "ghi",
-    },
-  ]);
-
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    undefined,
-    credentialsInput,
-    BuiltInLanguage.java,
-  );
-
-  t.is(credentials.length, 3);
-  t.true(credentials.some((c) => c["replaces-base"] === true));
-  t.true(credentials.some((c) => c["replaces-base"] === false));
-  t.true(credentials.some((c) => c["replaces-base"] === undefined));
-
-  // Invalid cases.
-  const baseInvalid = {
-    type: "maven_repository",
-    host: "maven4.pkg.github.com",
-    token: "jkl",
-  };
-  t.throws(() =>
-    startProxyExports.getCredentials(
-      getRunnerLogger(true),
-      undefined,
-      toEncodedJSON([{ ...baseInvalid, "replaces-base": null }]),
-      BuiltInLanguage.java,
-    ),
-  );
-  t.throws(() =>
-    startProxyExports.getCredentials(
-      getRunnerLogger(true),
-      undefined,
-      toEncodedJSON([{ ...baseInvalid, "replaces-base": 123 }]),
-      BuiltInLanguage.java,
-    ),
-  );
-  t.throws(() =>
-    startProxyExports.getCredentials(
-      getRunnerLogger(true),
-      undefined,
-      toEncodedJSON([{ ...baseInvalid, "replaces-base": "true" }]),
-      BuiltInLanguage.java,
-    ),
-  );
-});
-
-test("getCredentials returns only ALWAYS_ENABLED_REGISTRY_TYPE credentials for Actions", async (t) => {
-  const credentialsInput = toEncodedJSON([
-    ...mixedCredentials,
-    gitSourceCredential,
-    dockerRegistryCredential,
-  ]);
-
-  const credentials = startProxyExports.getCredentials(
-    getRunnerLogger(true),
-    undefined,
-    credentialsInput,
-    BuiltInLanguage.actions,
-  );
-
-  for (const credential of credentials) {
-    t.true(
-      startProxyExports.ALWAYS_ENABLED_REGISTRY_TYPE.some(
-        (ty) => ty === credential.type,
-      ),
-    );
-  }
-});
-
-test("getCredentials always returns ALWAYS_ENABLED_REGISTRY_TYPE credentials for all languages", async (t) => {
-  const alwaysEnabledCredentials: startProxyExports.Credential[] = [];
-
-  for (const alwaysEnabled of startProxyExports.ALWAYS_ENABLED_REGISTRY_TYPE) {
-    alwaysEnabledCredentials.push({
-      type: alwaysEnabled,
-      host: `host-${alwaysEnabled}`,
-      token: `bar-${alwaysEnabled}`,
-      url: `url-${alwaysEnabled}`,
-    });
-  }
-
-  const credentialsInput = toEncodedJSON(alwaysEnabledCredentials);
-
-  // Test all languages.
-  for (const language of Object.values(BuiltInLanguage)) {
-    const credentials = startProxyExports.getCredentials(
-      getRunnerLogger(true),
-      undefined,
-      credentialsInput,
-      language,
-    );
-
-    t.deepEqual(credentials, alwaysEnabledCredentials);
-  }
-});
-
-function mockGetApiClient(endpoints: any) {
-  return (
-    sinon
-      .stub(apiClient, "getApiClient")
-      // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-      .returns({ rest: endpoints } as any)
-  );
-}
-
-type ReleaseAssets = Array<{ name: string; url?: string }>;
-
-function mockGetReleaseByTag(assets?: ReleaseAssets) {
-  const getReleaseByTag =
-    assets === undefined
-      ? sinon.stub().rejects()
-      : sinon.stub().resolves({
-          status: 200,
-          data: { assets },
-          headers: {},
-          url: "GET /repos/:owner/:repo/releases/tags/:tag",
-        });
-
-  return mockGetApiClient({ repos: { getReleaseByTag } });
-}
-
-function mockOfflineFeatures(tempDir: string, logger: Logger) {
-  // Using GHES ensures that we are using `OfflineFeatures`.
-  const gitHubVersion = {
-    type: GitHubVariant.GHES,
-    version: "3.0.0",
-  };
-  sinon.stub(apiClient, "getGitHubVersion").resolves(gitHubVersion);
-
-  return setUpFeatureFlagTests(tempDir, logger, gitHubVersion);
-}
-
-test.serial(
-  "getDownloadUrl returns fallback when `getReleaseByVersion` rejects",
-  async (t) => {
-    const logger = new RecordingLogger();
-    mockGetReleaseByTag();
-
-    await withTmpDir(async (tempDir) => {
-      const features = mockOfflineFeatures(tempDir, logger);
-      const info = await startProxyExports.getDownloadUrl(
-        getRunnerLogger(true),
-        features,
-      );
-
-      t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION);
-      t.is(
-        info.url,
-        startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()),
-      );
-    });
-  },
-);
-
-test.serial(
-  "getDownloadUrl returns fallback when there's no matching release asset",
-  async (t) => {
-    const logger = new RecordingLogger();
-    const testAssets = [[], [{ name: "foo" }]];
-
-    await withTmpDir(async (tempDir) => {
-      const features = mockOfflineFeatures(tempDir, logger);
-
-      for (const assets of testAssets) {
-        const stub = mockGetReleaseByTag(assets);
-        const info = await startProxyExports.getDownloadUrl(
-          getRunnerLogger(true),
-          features,
-        );
-
-        t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION);
-        t.is(
-          info.url,
-          startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()),
-        );
-
-        stub.restore();
-      }
-    });
-  },
-);
-
-test.serial("getDownloadUrl returns matching release asset", async (t) => {
-  const logger = new RecordingLogger();
-  const assets = [
-    { name: "foo", url: "other-url" },
-    { name: startProxyExports.getProxyPackage(), url: "url-we-want" },
-  ];
-  mockGetReleaseByTag(assets);
-
-  await withTmpDir(async (tempDir) => {
-    const features = mockOfflineFeatures(tempDir, logger);
-    const info = await startProxyExports.getDownloadUrl(
-      getRunnerLogger(true),
-      features,
-    );
-
-    t.is(info.version, defaults.cliVersion);
-    t.is(info.url, "url-we-want");
-  });
-});
-
-test.serial(
-  "getSafeErrorMessage - returns actual message for `StartProxyError`",
-  (t) => {
-    const error = new startProxyExports.StartProxyError(
-      startProxyExports.StartProxyErrorType.DownloadFailed,
-    );
-    t.is(
-      startProxyExports.getSafeErrorMessage(error),
-      startProxyExports.getStartProxyErrorMessage(error.errorType),
-    );
-  },
-);
-
-test.serial(
-  "getSafeErrorMessage - does not return message for arbitrary errors",
-  (t) => {
-    const error = new Error(
-      startProxyExports.getStartProxyErrorMessage(
-        startProxyExports.StartProxyErrorType.DownloadFailed,
-      ),
-    );
-
-    const message = startProxyExports.getSafeErrorMessage(error);
-
-    t.not(message, error.message);
-    t.assert(message.startsWith("Error from start-proxy Action omitted"));
-    t.assert(message.includes(error.name));
-  },
-);
-
-const wrapFailureTest = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    setup: () => void,
-    fn: (logger: Logger) => Promise,
-  ) => {
-    await withRecordingLoggerAsync(async (logger) => {
-      setup();
-
-      await t.throwsAsync(fn(logger), {
-        instanceOf: startProxyExports.StartProxyError,
-      });
-    });
-  },
-  title: (providedTitle) => `${providedTitle} - wraps errors on failure`,
-});
-
-test.serial("downloadProxy - returns file path on success", async (t) => {
-  await withRecordingLoggerAsync(async (logger) => {
-    const testPath = "/some/path";
-    sinon.stub(toolcache, "downloadTool").resolves(testPath);
-
-    const result = await startProxyExports.downloadProxy(
-      logger,
-      "url",
-      undefined,
-    );
-    t.is(result, testPath);
-  });
-});
-
-wrapFailureTest.serial(
-  "downloadProxy",
-  () => {
-    sinon.stub(toolcache, "downloadTool").throws();
-  },
-  async (logger) => {
-    await startProxyExports.downloadProxy(logger, "url", undefined);
-  },
-);
-
-test.serial("extractProxy - returns file path on success", async (t) => {
-  await withRecordingLoggerAsync(async (logger) => {
-    const testPath = "/some/path";
-    sinon.stub(toolcache, "extractTar").resolves(testPath);
-
-    const result = await startProxyExports.extractProxy(logger, "/other/path");
-    t.is(result, testPath);
-  });
-});
-
-wrapFailureTest.serial(
-  "extractProxy",
-  () => {
-    sinon.stub(toolcache, "extractTar").throws();
-  },
-  async (logger) => {
-    await startProxyExports.extractProxy(logger, "path");
-  },
-);
-
-test.serial("cacheProxy - returns file path on success", async (t) => {
-  await withRecordingLoggerAsync(async (logger) => {
-    const testPath = "/some/path";
-    sinon.stub(toolcache, "cacheDir").resolves(testPath);
-
-    const result = await startProxyExports.cacheProxy(
-      logger,
-      "/other/path",
-      "proxy",
-      "1.0",
-    );
-    t.is(result, testPath);
-  });
-});
-
-wrapFailureTest.serial(
-  "cacheProxy",
-  () => {
-    sinon.stub(toolcache, "cacheDir").throws();
-  },
-  async (logger) => {
-    await startProxyExports.cacheProxy(logger, "/other/path", "proxy", "1.0");
-  },
-);
-
-test.serial(
-  "getProxyBinaryPath - returns path from tool cache if available",
-  async (t) => {
-    const logger = new RecordingLogger();
-    mockGetReleaseByTag();
-
-    await withTmpDir(async (tempDir) => {
-      const toolcachePath = "/path/to/proxy/dir";
-      sinon.stub(toolcache, "find").returns(toolcachePath);
-
-      const features = mockOfflineFeatures(tempDir, logger);
-      const path = await startProxyExports.getProxyBinaryPath(logger, features);
-
-      t.assert(path);
-      t.is(
-        path,
-        filepath.join(toolcachePath, startProxyExports.getProxyFilename()),
-      );
-    });
-  },
-);
-
-test.serial(
-  "getProxyBinaryPath - downloads proxy if not in cache",
-  async (t) => {
-    const logger = new RecordingLogger();
-    const downloadUrl = "url-we-want";
-    mockGetReleaseByTag([
-      { name: startProxyExports.getProxyPackage(), url: downloadUrl },
-    ]);
-
-    const toolcachePath = "/path/to/proxy/dir";
-    const find = sinon.stub(toolcache, "find").returns("");
-    const getApiDetails = sinon.stub(apiClient, "getApiDetails").returns({
-      auth: "",
-      url: "",
-      apiURL: "",
-    });
-    const getAuthorizationHeaderFor = sinon
-      .stub(apiClient, "getAuthorizationHeaderFor")
-      .returns(undefined);
-    const archivePath = "/path/to/archive";
-    const downloadTool = sinon
-      .stub(toolcache, "downloadTool")
-      .resolves(archivePath);
-    const extractedPath = "/path/to/extracted";
-    const extractTar = sinon
-      .stub(toolcache, "extractTar")
-      .resolves(extractedPath);
-    const cacheDir = sinon.stub(toolcache, "cacheDir").resolves(toolcachePath);
-
-    const path = await startProxyExports.getProxyBinaryPath(
-      logger,
-      createFeatures([]),
-    );
-
-    t.assert(find.calledOnce);
-    t.assert(getApiDetails.calledOnce);
-    t.assert(getAuthorizationHeaderFor.calledOnce);
-    t.assert(downloadTool.calledOnceWith(downloadUrl));
-    t.assert(extractTar.calledOnceWith(archivePath));
-    t.assert(cacheDir.calledOnceWith(extractedPath));
-    t.assert(path);
-    t.is(
-      path,
-      filepath.join(toolcachePath, startProxyExports.getProxyFilename()),
-    );
-
-    checkExpectedLogMessages(t, logger.messages, [
-      `Found '${startProxyExports.getProxyPackage()}' in release '${defaults.bundleVersion}' at '${downloadUrl}'`,
-    ]);
-  },
-);
-
-test.serial(
-  "getProxyBinaryPath - downloads proxy based on features if not in cache",
-  async (t) => {
-    const logger = new RecordingLogger();
-    const expectedTag = "codeql-bundle-v2.20.1";
-    const expectedParams = {
-      owner: "github",
-      repo: "codeql-action",
-      tag: expectedTag,
-    };
-    const downloadUrl = "url-we-want";
-    const assets = [
-      {
-        name: startProxyExports.getProxyPackage(),
-        url: downloadUrl,
-      },
-    ];
-
-    const getReleaseByTag = sinon.stub();
-    getReleaseByTag.withArgs(sinon.match(expectedParams)).resolves({
-      status: 200,
-      data: { assets },
-      headers: {},
-      url: "GET /repos/:owner/:repo/releases/tags/:tag",
-    });
-    mockGetApiClient({ repos: { getReleaseByTag } });
-
-    await withTmpDir(async (tempDir) => {
-      const toolcachePath = "/path/to/proxy/dir";
-      const find = sinon.stub(toolcache, "find").returns("");
-      const getApiDetails = sinon.stub(apiClient, "getApiDetails").returns({
-        auth: "",
-        url: "",
-        apiURL: "",
-      });
-      const getAuthorizationHeaderFor = sinon
-        .stub(apiClient, "getAuthorizationHeaderFor")
-        .returns(undefined);
-      const archivePath = "/path/to/archive";
-      const downloadTool = sinon
-        .stub(toolcache, "downloadTool")
-        .resolves(archivePath);
-      const extractedPath = "/path/to/extracted";
-      const extractTar = sinon
-        .stub(toolcache, "extractTar")
-        .resolves(extractedPath);
-      const cacheDir = sinon
-        .stub(toolcache, "cacheDir")
-        .resolves(toolcachePath);
-
-      const gitHubVersion: GitHubVersion = {
-        type: GitHubVariant.DOTCOM,
-      };
-      sinon.stub(apiClient, "getGitHubVersion").resolves(gitHubVersion);
-
-      const features = setUpFeatureFlagTests(tempDir, logger, gitHubVersion);
-      sinon.stub(features, "getValue").callsFake(async (_feature, _codeql) => {
-        return true;
-      });
-      const getDefaultCliVersion = sinon
-        .stub(features, "getEnabledDefaultCliVersions")
-        .resolves({
-          enabledVersions: [{ cliVersion: "2.20.1", tagName: expectedTag }],
-        });
-      const path = await startProxyExports.getProxyBinaryPath(logger, features);
-
-      t.assert(getDefaultCliVersion.calledOnce);
-      sinon.assert.calledOnceWithMatch(
-        getReleaseByTag,
-        sinon.match(expectedParams),
-      );
-      t.assert(find.calledOnce);
-      t.assert(getApiDetails.calledOnce);
-      t.assert(getAuthorizationHeaderFor.calledOnce);
-      t.assert(downloadTool.calledOnceWith(downloadUrl));
-      t.assert(extractTar.calledOnceWith(archivePath));
-      t.assert(cacheDir.calledOnceWith(extractedPath));
-
-      t.assert(path);
-      t.is(
-        path,
-        filepath.join(toolcachePath, startProxyExports.getProxyFilename()),
-      );
-    });
-
-    checkExpectedLogMessages(t, logger.messages, [
-      `Found '${startProxyExports.getProxyPackage()}' in release '${expectedTag}' at '${downloadUrl}'`,
-    ]);
-  },
-);
diff --git a/src/start-proxy.ts b/src/start-proxy.ts
deleted file mode 100644
index caa1b3054a..0000000000
--- a/src/start-proxy.ts
+++ /dev/null
@@ -1,590 +0,0 @@
-import * as path from "path";
-
-import * as core from "@actions/core";
-import * as toolcache from "@actions/tool-cache";
-
-import {
-  getApiClient,
-  getApiDetails,
-  getAuthorizationHeaderFor,
-  getGitHubVersion,
-} from "./api-client";
-import * as artifactScanner from "./artifact-scanner";
-import { Config } from "./config-utils";
-import * as defaults from "./defaults.json";
-import {
-  CodeQLDefaultVersionInfo,
-  Feature,
-  FeatureEnablement,
-} from "./feature-flags";
-import * as json from "./json";
-import { BuiltInLanguage } from "./languages";
-import { Logger } from "./logging";
-import {
-  Address,
-  Registry,
-  Credential,
-  hasToken,
-  hasUsernameAndPassword,
-  hasUsername,
-  RawCredential,
-} from "./start-proxy/types";
-import { getAuthConfig } from "./start-proxy/validation";
-import {
-  ActionName,
-  createStatusReportBase,
-  getActionsStatus,
-  sendStatusReport,
-  StatusReportBase,
-} from "./status-report";
-import * as util from "./util";
-import { ConfigurationError, getErrorMessage, isDefined } from "./util";
-
-export * from "./start-proxy/types";
-
-/**
- * Enumerates specific error types for which we have corresponding error messages that
- * are safe to include in status reports.
- */
-export enum StartProxyErrorType {
-  DownloadFailed,
-  ExtractionFailed,
-  CacheFailed,
-}
-
-/**
- * @returns The error message corresponding to the error type.
- */
-export function getStartProxyErrorMessage(
-  errorType: StartProxyErrorType,
-): string {
-  switch (errorType) {
-    case StartProxyErrorType.DownloadFailed:
-      return "Failed to download proxy archive.";
-    case StartProxyErrorType.ExtractionFailed:
-      return "Failed to extract proxy archive.";
-    case StartProxyErrorType.CacheFailed:
-      return "Failed to add proxy to toolcache";
-  }
-}
-
-/**
- * We want to avoid accidentally leaking secrets that may be contained in exception
- * messages in the `start-proxy` action. Consequently, we don't report the messages
- * of arbitrary exceptions. This type of error ensures that the message is one from
- * `StartProxyErrorType` and therefore safe to include in a status report.
- */
-export class StartProxyError extends Error {
-  public readonly errorType: StartProxyErrorType;
-
-  constructor(errorType: StartProxyErrorType) {
-    super();
-    this.errorType = errorType;
-  }
-}
-
-/**
- * Sends a status report for the `start-proxy` action indicating a successful outcome.
- *
- * @param startedAt When the action was started.
- * @param config The configuration used.
- * @param registry_types The types of registries that are configured.
- * @param logger The logger to use.
- */
-export async function sendSuccessStatusReport(
-  startedAt: Date,
-  config: Partial,
-  registry_types: string[],
-  logger: Logger,
-) {
-  const statusReportBase = await createStatusReportBase(
-    ActionName.StartProxy,
-    "success",
-    startedAt,
-    config,
-    await util.checkDiskUsage(logger),
-    logger,
-  );
-  if (statusReportBase !== undefined) {
-    const statusReport: StatusReportBase = {
-      ...statusReportBase,
-      registry_types: registry_types.join(","),
-    };
-    await sendStatusReport(statusReport);
-  }
-}
-
-/**
- * Returns an error message for `error` that can safely be reported in a status report,
- * i.e. that does not contain sensitive information.
- *
- * @param error The error for which to get an error message.
- */
-export function getSafeErrorMessage(error: Error): string {
-  // If the error is a `StartProxyError`, resolve the error type to the corresponding
-  // error message.
-  if (error instanceof StartProxyError) {
-    return getStartProxyErrorMessage(error.errorType);
-  }
-
-  // Otherwise, omit the actual error message.
-  return `Error from start-proxy Action omitted (${error.constructor.name}).`;
-}
-
-/**
- * Sends a status report for the `start-proxy` action indicating a failure.
- *
- * @param logger The logger to use.
- * @param startedAt When the action was started.
- * @param language The language provided as input, if any.
- * @param unwrappedError The exception that was thrown.
- */
-export async function sendFailedStatusReport(
-  logger: Logger,
-  startedAt: Date,
-  language: BuiltInLanguage | undefined,
-  unwrappedError: unknown,
-) {
-  const error = util.wrapError(unwrappedError);
-  core.setFailed(`start-proxy action failed: ${error.message}`);
-
-  // To avoid the possibility of leaking sensitive information into the telemetry,
-  // we don't include arbitrary error messages. Instead, `getSafeErrorMessage` will
-  // return a generic message that includes the type of the error, unless it can decide
-  // that the message is safe to include.
-  const statusReportMessage = getSafeErrorMessage(error);
-  const errorStatusReportBase = await createStatusReportBase(
-    ActionName.StartProxy,
-    getActionsStatus(error),
-    startedAt,
-    {
-      languages: language === undefined ? undefined : [language],
-    },
-    await util.checkDiskUsage(logger),
-    logger,
-    statusReportMessage,
-  );
-  if (errorStatusReportBase !== undefined) {
-    await sendStatusReport(errorStatusReportBase);
-  }
-}
-
-export const UPDATEJOB_PROXY = "update-job-proxy";
-export const UPDATEJOB_PROXY_VERSION = "v2.0.20250624110901";
-const UPDATEJOB_PROXY_URL_PREFIX =
-  "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.22.0/";
-
-function isPAT(value: string) {
-  return artifactScanner.isAuthToken(value, [
-    artifactScanner.GITHUB_PAT_CLASSIC_PATTERN,
-    artifactScanner.GITHUB_PAT_FINE_GRAINED_PATTERN,
-  ]);
-}
-
-/**
- * A list of always-enabled registry types. The registry types in this list are always
- * enabled, because generic CodeQL workflow components may use them rather than just
- * language-specific components.
- */
-export const ALWAYS_ENABLED_REGISTRY_TYPE = [
-  "git_source",
-  "docker_registry",
-] as const;
-
-type RegistryMapping = Partial>;
-
-export const LANGUAGE_TO_REGISTRY_TYPE: Required = {
-  actions: [],
-  cpp: [],
-  java: ["maven_repository"],
-  csharp: ["nuget_feed"],
-  javascript: [],
-  python: [],
-  ruby: [],
-  rust: [],
-  swift: [],
-  go: ["goproxy_server", "git_source"],
-} as const;
-
-/**
- * Extracts an `Address` value from the given `Registry` value by determining whether it has
- * a `url` value, or no `url` value but a `host` value.
- *
- * @throws A `ConfigurationError` if the `Registry` value contains neither a `url` or `host` field.
- */
-function getRegistryAddress(
-  registry: json.UnvalidatedObject,
-): Address {
-  if (
-    isDefined(registry.url) &&
-    json.isString(registry.url) &&
-    json.isStringOrUndefined(registry.host)
-  ) {
-    return {
-      url: registry.url,
-      host: registry.host,
-    };
-  } else if (isDefined(registry.host) && json.isString(registry.host)) {
-    return {
-      url: undefined,
-      host: registry.host,
-    };
-  } else {
-    // The proxy needs one of these to work. If both are defined, the url has the precedence.
-    throw new ConfigurationError(
-      "Invalid credentials - must specify host or url",
-    );
-  }
-}
-
-/**
- * Returns registry credentials from action inputs.
- * It prefers `registriesCredentials` over `registrySecrets`.
- * If neither is set, it returns an empty array.
- */
-export function getCredentials(
-  logger: Logger,
-  registrySecrets: string | undefined,
-  registriesCredentials: string | undefined,
-  language: BuiltInLanguage | undefined,
-): Credential[] {
-  const registryTypeForLanguage = language
-    ? LANGUAGE_TO_REGISTRY_TYPE[language]
-    : undefined;
-
-  let credentialsStr: string;
-  if (registriesCredentials !== undefined) {
-    logger.info(`Using registries_credentials input.`);
-    credentialsStr = Buffer.from(registriesCredentials, "base64").toString();
-  } else if (registrySecrets !== undefined) {
-    logger.info(`Using registry_secrets input.`);
-    credentialsStr = registrySecrets;
-  } else {
-    logger.info(`No credentials defined.`);
-    return [];
-  }
-
-  // Parse and validate the credentials
-  let parsed: unknown;
-  try {
-    parsed = json.parseString(credentialsStr);
-  } catch {
-    // Don't log the error since it might contain sensitive information.
-    logger.error("Failed to parse the credentials data.");
-    throw new ConfigurationError("Invalid credentials format.");
-  }
-
-  // Check that the parsed data is indeed an array.
-  if (!json.isArray(parsed)) {
-    throw new ConfigurationError(
-      "Expected credentials data to be an array of configurations, but it is not.",
-    );
-  }
-
-  const out: Credential[] = [];
-  for (const e of parsed) {
-    if (e === null || !json.isObject(e)) {
-      throw new ConfigurationError("Invalid credentials - must be an object");
-    }
-
-    // The configuration must have a type.
-    if (!isDefined(e.type) || !json.isString(e.type)) {
-      throw new ConfigurationError("Invalid credentials - must have a type");
-    }
-
-    // Mask credentials to reduce chance of accidental leakage in logs.
-    const authConfig = getAuthConfig(e);
-    const address = getRegistryAddress(e);
-
-    // Filter credentials based on language if specified. `type` is the registry type.
-    // E.g., "maven_repository" for Java/Kotlin, "nuget_feed" for C#.
-    // We always allow types in `ALWAYS_ENABLED_REGISTRY_TYPE` since they can be used by
-    // other parts of the workflow.
-    if (
-      !ALWAYS_ENABLED_REGISTRY_TYPE.some((t) => t === e.type) &&
-      registryTypeForLanguage &&
-      !registryTypeForLanguage.some((t) => t === e.type)
-    ) {
-      continue;
-    }
-
-    const isPrintable = (str: string | undefined): boolean => {
-      return str ? /^[\x20-\x7E]*$/.test(str) : true;
-    };
-
-    // Ensure that all string fields only contain printable characters.
-    for (const key of Object.keys(e)) {
-      const val = e[key];
-      if (typeof val === "string" && !isPrintable(val)) {
-        throw new ConfigurationError(
-          "Invalid credentials - fields must contain only printable characters",
-        );
-      }
-    }
-
-    // If the password or token looks like a GitHub PAT, warn if no username is configured.
-    const noUsername =
-      !hasUsername(authConfig) || !isDefined(authConfig.username);
-    const passwordIsPAT =
-      hasUsernameAndPassword(authConfig) &&
-      isDefined(authConfig.password) &&
-      isPAT(authConfig.password);
-    const tokenIsPAT =
-      hasToken(authConfig) &&
-      isDefined(authConfig.token) &&
-      isPAT(authConfig.token);
-
-    if (noUsername && (passwordIsPAT || tokenIsPAT)) {
-      logger.warning(
-        `A ${e.type} private registry is configured for ${e.host || e.url} using a GitHub Personal Access Token (PAT), but no username was provided. ` +
-          `This may not work correctly. When configuring a private registry using a PAT, select "Username and password" and enter the username of the user ` +
-          `who generated the PAT.`,
-      );
-    }
-
-    // Construct the base credential object.
-    const baseCredential: Omit = { type: e.type };
-
-    // If "replaces-base" is present, it must be a boolean.
-    if ("replaces-base" in e) {
-      if (
-        isDefined(e["replaces-base"]) &&
-        typeof e["replaces-base"] === "boolean"
-      ) {
-        baseCredential["replaces-base"] = e["replaces-base"];
-      } else {
-        throw new ConfigurationError(
-          "Invalid credentials - 'replaces-base' must be a boolean",
-        );
-      }
-    }
-
-    out.push({
-      ...baseCredential,
-      ...authConfig,
-      ...address,
-    });
-  }
-  return out;
-}
-
-/**
- * Gets the name of the proxy release asset for the current platform.
- */
-export function getProxyPackage(): string {
-  const platform =
-    process.platform === "win32"
-      ? "win64"
-      : process.platform === "darwin"
-        ? "osx64"
-        : "linux64";
-  return `${UPDATEJOB_PROXY}-${platform}.tar.gz`;
-}
-
-/**
- * Gets the fallback URL for downloading the proxy release asset.
- *
- * @param proxyPackage The asset name.
- * @returns The full URL to download the specified asset from the fallback release.
- */
-export function getFallbackUrl(proxyPackage: string): string {
-  return `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`;
-}
-
-/**
- * Uses the GitHub API to obtain information about the CodeQL CLI bundle release
- * that is tagged by `version`.
- *
- * @returns The response from the GitHub API.
- */
-async function getReleaseByVersion(version: string) {
-  return getApiClient().rest.repos.getReleaseByTag({
-    owner: "github",
-    repo: "codeql-action",
-    tag: version,
-  });
-}
-
-/** Uses `features` to determine the default CLI version. */
-async function getCliVersionFromFeatures(
-  features: FeatureEnablement,
-): Promise {
-  const gitHubVersion = await getGitHubVersion();
-  return await features.getEnabledDefaultCliVersions(gitHubVersion.type);
-}
-
-/**
- * Determines the URL of the proxy release asset that we should download if its not
- * already in the toolcache, and its version.
- *
- * @param logger The logger to use.
- * @param features Information about enabled features.
- * @returns Returns the download URL and version of the proxy package we plan to use.
- */
-export async function getDownloadUrl(
-  logger: Logger,
-  features: FeatureEnablement,
-): Promise<{ url: string; version: string }> {
-  const proxyPackage = getProxyPackage();
-
-  try {
-    const useFeaturesToDetermineCLI = await features.getValue(
-      Feature.StartProxyUseFeaturesRelease,
-    );
-
-    // Retrieve information about the CLI version we should use. This will be either the linked
-    // version, or the one enabled by FFs.
-    const versionInfo = useFeaturesToDetermineCLI
-      ? (await getCliVersionFromFeatures(features)).enabledVersions[0]
-      : {
-          cliVersion: defaults.cliVersion,
-          tagName: defaults.bundleVersion,
-        };
-
-    // Try to retrieve information about the CLI bundle release identified by `versionInfo`.
-    const cliRelease = await getReleaseByVersion(versionInfo.tagName);
-
-    // Search the release's assets to find the one we are looking for.
-    for (const asset of cliRelease.data.assets) {
-      if (asset.name === proxyPackage) {
-        logger.info(
-          `Found '${proxyPackage}' in release '${versionInfo.tagName}' at '${asset.url}'`,
-        );
-        return {
-          url: asset.url,
-          // The `update-job-proxy` doesn't have a version as such. Since we now bundle it
-          // with CodeQL CLI bundle releases, we use the corresponding CLI version to
-          // differentiate between (potentially) different versions of `update-job-proxy`.
-          version: versionInfo.cliVersion,
-        };
-      }
-    }
-  } catch (ex) {
-    logger.warning(
-      `Failed to retrieve information about the linked release: ${getErrorMessage(ex)}`,
-    );
-  }
-
-  // Fallback to the hard-coded URL.
-  logger.info(
-    `Did not find '${proxyPackage}' in the linked release, falling back to hard-coded version.`,
-  );
-  return {
-    url: getFallbackUrl(proxyPackage),
-    version: UPDATEJOB_PROXY_VERSION,
-  };
-}
-
-/**
- * Attempts to download a file from `url` into the toolcache.
- *
- * @param logger The logger to use.
- * @param url The URL to download the proxy binary from.
- * @param authorization The authorization information to use.
- * @returns If successful, the path to the downloaded file.
- */
-export async function downloadProxy(
-  logger: Logger,
-  url: string,
-  authorization: string | undefined,
-) {
-  try {
-    // Download the proxy archive from `url`. We let `downloadTool` choose where
-    // to store it. The path to the downloaded file will be returned if successful.
-    return toolcache.downloadTool(url, /* dest: */ undefined, authorization, {
-      accept: "application/octet-stream",
-    });
-  } catch (error) {
-    logger.error(
-      `Failed to download proxy archive from ${url}: ${getErrorMessage(error)}`,
-    );
-    throw new StartProxyError(StartProxyErrorType.DownloadFailed);
-  }
-}
-
-/**
- * Attempts to extract the proxy binary from the `archive`.
- *
- * @param logger The logger to use.
- * @param archive The archive to extract.
- * @returns The path to the extracted file(s).
- */
-export async function extractProxy(logger: Logger, archive: string) {
-  try {
-    return await toolcache.extractTar(archive);
-  } catch (error) {
-    logger.error(
-      `Failed to extract proxy archive from ${archive}: ${getErrorMessage(error)}`,
-    );
-    throw new StartProxyError(StartProxyErrorType.ExtractionFailed);
-  }
-}
-
-/**
- * Attempts to store the proxy in the toolcache.
- *
- * @param logger The logger to use.
- * @param source The source path to add to the toolcache.
- * @param filename The filename of the proxy binary.
- * @param version The version of the proxy.
- * @returns The path to the directory in the toolcache.
- */
-export async function cacheProxy(
-  logger: Logger,
-  source: string,
-  filename: string,
-  version: string,
-) {
-  try {
-    return await toolcache.cacheDir(source, filename, version);
-  } catch (error) {
-    logger.error(
-      `Failed to add proxy archive from ${source} to toolcache: ${getErrorMessage(error)}`,
-    );
-    throw new StartProxyError(StartProxyErrorType.CacheFailed);
-  }
-}
-
-/**
- * Returns the platform-specific filename of the proxy binary.
- */
-export function getProxyFilename() {
-  return process.platform === "win32"
-    ? `${UPDATEJOB_PROXY}.exe`
-    : UPDATEJOB_PROXY;
-}
-
-/**
- * Gets a path to the proxy binary. If possible, this function will find the proxy in the
- * runner's tool cache. Otherwise, it downloads and extracts the proxy binary,
- * and stores it in the tool cache.
- *
- * @param logger The logger to use.
- * @returns The path to the proxy binary.
- */
-export async function getProxyBinaryPath(
-  logger: Logger,
-  features: FeatureEnablement,
-): Promise {
-  const proxyFileName = getProxyFilename();
-  const proxyInfo = await getDownloadUrl(logger, features);
-
-  let proxyBin = toolcache.find(proxyFileName, proxyInfo.version);
-  if (!proxyBin) {
-    const apiDetails = getApiDetails();
-    const authorization = getAuthorizationHeaderFor(
-      logger,
-      apiDetails,
-      proxyInfo.url,
-    );
-    const temp = await downloadProxy(logger, proxyInfo.url, authorization);
-    const extracted = await extractProxy(logger, temp);
-    proxyBin = await cacheProxy(
-      logger,
-      extracted,
-      proxyFileName,
-      proxyInfo.version,
-    );
-  }
-  return path.join(proxyBin, proxyFileName);
-}
diff --git a/src/start-proxy/ca.test.ts b/src/start-proxy/ca.test.ts
deleted file mode 100644
index 7b88fc54ba..0000000000
--- a/src/start-proxy/ca.test.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import test, { ExecutionContext } from "ava";
-import { pki } from "node-forge";
-
-import { setupTests } from "../testing-utils";
-
-import * as ca from "./ca";
-
-setupTests(test);
-
-const toMap = (array: T[], func: (e: T) => string) =>
-  new Map(array.map((val) => [func(val), val]));
-
-function checkCertAttributes(
-  t: ExecutionContext,
-  cert: pki.Certificate,
-) {
-  const subjectMap = toMap(
-    cert.subject.attributes,
-    (attr) => attr.name as string,
-  );
-  const issuerMap = toMap(
-    cert.issuer.attributes,
-    (attr) => attr.name as string,
-  );
-
-  t.is(subjectMap.get("commonName")?.value, "Dependabot Internal CA");
-  t.is(issuerMap.get("commonName")?.value, "Dependabot Internal CA");
-
-  for (const attrName of subjectMap.keys()) {
-    t.deepEqual(subjectMap.get(attrName), issuerMap.get(attrName));
-  }
-}
-
-test("generateCertificateAuthority - generates certificates", (t) => {
-  const result = ca.generateCertificateAuthority();
-  const cert = pki.certificateFromPem(result.cert);
-  const key = pki.privateKeyFromPem(result.key);
-
-  t.truthy(cert);
-  t.truthy(key);
-
-  checkCertAttributes(t, cert);
-
-  // Check the validity.
-  t.true(
-    cert.validity.notBefore <= new Date(),
-    "notBefore date is in the future",
-  );
-  t.true(cert.validity.notAfter > new Date(), "notAfter date is in the past");
-
-  // Check that the extensions are set as we'd expect.
-  const exts = toMap(cert.extensions as ca.Extension[], (ext) => ext.name);
-  t.is(exts.size, 4);
-  t.true(exts.get("basicConstraints")?.cA);
-  t.truthy(exts.get("subjectKeyIdentifier"));
-  t.truthy(exts.get("authorityKeyIdentifier"));
-
-  const keyUsage = exts.get("keyUsage");
-  if (t.truthy(keyUsage)) {
-    t.true(keyUsage.critical);
-    t.true(keyUsage.keyCertSign);
-    t.true(keyUsage.cRLSign);
-    t.true(keyUsage.digitalSignature);
-  }
-
-  t.truthy(cert.siginfo);
-});
diff --git a/src/start-proxy/ca.ts b/src/start-proxy/ca.ts
deleted file mode 100644
index 8f9b8de138..0000000000
--- a/src/start-proxy/ca.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { md, pki } from "node-forge";
-
-import { CertificateAuthority } from "./types";
-
-const KEY_SIZE = 2048;
-const KEY_EXPIRY_YEARS = 2;
-
-const CERT_SUBJECT = [
-  {
-    name: "commonName",
-    value: "Dependabot Internal CA",
-  },
-  {
-    name: "organizationName",
-    value: "GitHub inc.",
-  },
-  {
-    shortName: "OU",
-    value: "Dependabot",
-  },
-  {
-    name: "countryName",
-    value: "US",
-  },
-  {
-    shortName: "ST",
-    value: "California",
-  },
-  {
-    name: "localityName",
-    value: "San Francisco",
-  },
-];
-
-export type Extension = {
-  name: string;
-  [key: string]: unknown;
-};
-
-const allExtensions: Extension[] = [
-  { name: "basicConstraints", cA: true },
-  {
-    name: "keyUsage",
-    critical: true,
-    keyCertSign: true,
-    cRLSign: true,
-    digitalSignature: true,
-  },
-  { name: "subjectKeyIdentifier" },
-  { name: "authorityKeyIdentifier", keyIdentifier: true },
-];
-
-/**
- * Generates a CA certificate for the proxy.
- *
- * @returns The private and public keys.
- */
-export function generateCertificateAuthority(): CertificateAuthority {
-  const keys = pki.rsa.generateKeyPair(KEY_SIZE);
-  const cert = pki.createCertificate();
-  cert.publicKey = keys.publicKey;
-  cert.serialNumber = "01";
-  cert.validity.notBefore = new Date();
-  cert.validity.notAfter = new Date();
-  cert.validity.notAfter.setFullYear(
-    cert.validity.notBefore.getFullYear() + KEY_EXPIRY_YEARS,
-  );
-
-  cert.setSubject(CERT_SUBJECT);
-  cert.setIssuer(CERT_SUBJECT);
-
-  // Set the CA extensions for the certificate.
-  cert.setExtensions(allExtensions);
-
-  // Specifically use SHA256 to ensure consistency and compatibility.
-  cert.sign(keys.privateKey, md.sha256.create());
-
-  const pem = pki.certificateToPem(cert);
-  const key = pki.privateKeyToPem(keys.privateKey);
-  return { cert: pem, key };
-}
diff --git a/src/start-proxy/environment.test.ts b/src/start-proxy/environment.test.ts
deleted file mode 100644
index decd2fa6b3..0000000000
--- a/src/start-proxy/environment.test.ts
+++ /dev/null
@@ -1,225 +0,0 @@
-import * as fs from "fs";
-import * as os from "os";
-import path from "path";
-
-import * as toolrunner from "@actions/exec/lib/toolrunner";
-import * as io from "@actions/io";
-import test, { ExecutionContext } from "ava";
-import sinon from "sinon";
-
-import { JavaEnvVars, BuiltInLanguage } from "../languages";
-import {
-  checkExpectedLogMessages,
-  getRecordingLogger,
-  LoggedMessage,
-  setupTests,
-} from "../testing-utils";
-import { withTmpDir } from "../util";
-
-import {
-  checkJavaEnvVars,
-  checkJdkSettings,
-  checkProxyEnvironment,
-  checkProxyEnvVars,
-  discoverActionsJdks,
-  JAVA_PROXY_ENV_VARS,
-  ProxyEnvVars,
-} from "./environment";
-
-setupTests(test);
-
-function stubToolrunner() {
-  sinon.stub(io, "which").throws(new Error("Java not installed"));
-  sinon.stub(toolrunner, "ToolRunner").returns({
-    exec: async () => {
-      return 0;
-    },
-  });
-}
-
-function assertEnvVarLogMessages(
-  t: ExecutionContext,
-  envVars: string[],
-  messages: LoggedMessage[],
-  expectSet: boolean | string,
-) {
-  const template = (envVar: string) => {
-    if (typeof expectSet === "string") {
-      return `Environment variable '${envVar}' is set to '${expectSet}'`;
-    }
-    return expectSet
-      ? `Environment variable '${envVar}' is set to '${envVar}'`
-      : `Environment variable '${envVar}' is not set`;
-  };
-
-  const expected: string[] = [];
-
-  for (const envVar of envVars) {
-    expected.push(template(envVar));
-  }
-
-  checkExpectedLogMessages(t, messages, expected);
-}
-
-test("checkJavaEnvironment - none set", (t) => {
-  const messages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(messages);
-
-  checkJavaEnvVars(logger);
-  assertEnvVarLogMessages(t, JAVA_PROXY_ENV_VARS, messages, false);
-});
-
-test.serial(
-  "checkJavaEnvironment - logs values when variables are set",
-  (t) => {
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-
-    for (const envVar of Object.values(JavaEnvVars)) {
-      process.env[envVar] = envVar;
-    }
-
-    checkJavaEnvVars(logger);
-    assertEnvVarLogMessages(t, JAVA_PROXY_ENV_VARS, messages, true);
-  },
-);
-
-test.serial("discoverActionsJdks - discovers JDK paths", (t) => {
-  // Clear GHA variables that may interfere with this test in CI.
-  for (const envVar of Object.keys(process.env)) {
-    if (envVar.startsWith("JAVA_HOME_")) {
-      delete process.env[envVar];
-    }
-  }
-
-  const jdk8 = "/usr/lib/jvm/temurin-8-jdk-amd64";
-  const jdk17 = "/usr/lib/jvm/temurin-17-jdk-amd64";
-  const jdk21 = "/usr/lib/jvm/temurin-21-jdk-amd64";
-
-  process.env[JavaEnvVars.JAVA_HOME] = jdk17;
-  process.env["JAVA_HOME_8_X64"] = jdk8;
-  process.env["JAVA_HOME_17_X64"] = jdk17;
-  process.env["JAVA_HOME_21_X64"] = jdk21;
-
-  const results = discoverActionsJdks();
-  t.is(results.size, 3);
-  t.true(results.has(jdk8));
-  t.true(results.has(jdk17));
-  t.true(results.has(jdk21));
-});
-
-test("checkJdkSettings - does not throw for an empty directory", async (t) => {
-  const messages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(messages);
-
-  await withTmpDir(async (tmpDir) => {
-    t.notThrows(() => checkJdkSettings(logger, tmpDir));
-  });
-});
-
-test("checkJdkSettings - finds files and logs relevant properties", async (t) => {
-  const messages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(messages);
-
-  await withTmpDir(async (tmpDir) => {
-    const dir = path.join(tmpDir, "conf");
-    fs.mkdirSync(dir);
-
-    const file = path.join(dir, "net.properties");
-    fs.writeFileSync(
-      file,
-      [
-        "irrelevant.property=foo",
-        "http.proxyHost=proxy.example.com",
-        "http.unrelated=bar",
-      ].join(os.EOL),
-      {},
-    );
-    checkJdkSettings(logger, tmpDir);
-
-    checkExpectedLogMessages(t, messages, [
-      `Found '${file}'.`,
-      `Found 'http.proxyHost=proxy.example.com' in '${file}'`,
-    ]);
-  });
-});
-
-test("checkProxyEnvVars - none set", (t) => {
-  const messages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(messages);
-
-  checkProxyEnvVars(logger);
-  assertEnvVarLogMessages(t, Object.values(ProxyEnvVars), messages, false);
-});
-
-test.serial("checkProxyEnvVars - logs values when variables are set", (t) => {
-  const messages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(messages);
-
-  for (const envVar of Object.values(ProxyEnvVars)) {
-    process.env[envVar] = envVar;
-  }
-
-  checkProxyEnvVars(logger);
-  assertEnvVarLogMessages(t, Object.values(ProxyEnvVars), messages, true);
-});
-
-test.serial("checkProxyEnvVars - credentials are removed from URLs", (t) => {
-  const messages: LoggedMessage[] = [];
-  const logger = getRecordingLogger(messages);
-
-  for (const envVar of Object.values(ProxyEnvVars)) {
-    process.env[envVar] = "https://secret:password@proxy.local";
-  }
-
-  checkProxyEnvVars(logger);
-  assertEnvVarLogMessages(
-    t,
-    Object.values(ProxyEnvVars),
-    messages,
-    "https://proxy.local/",
-  );
-});
-
-test.serial(
-  "checkProxyEnvironment - includes base checks for all built-in languages",
-  async (t) => {
-    stubToolrunner();
-
-    for (const language of Object.values(BuiltInLanguage)) {
-      const messages: LoggedMessage[] = [];
-      const logger = getRecordingLogger(messages);
-
-      await checkProxyEnvironment(logger, language);
-      assertEnvVarLogMessages(t, Object.keys(ProxyEnvVars), messages, false);
-    }
-  },
-);
-
-test.serial(
-  "checkProxyEnvironment - includes Java checks for Java",
-  async (t) => {
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-
-    stubToolrunner();
-
-    await checkProxyEnvironment(logger, BuiltInLanguage.java);
-    assertEnvVarLogMessages(t, Object.keys(ProxyEnvVars), messages, false);
-    assertEnvVarLogMessages(t, JAVA_PROXY_ENV_VARS, messages, false);
-  },
-);
-
-test.serial(
-  "checkProxyEnvironment - includes language-specific checks if the language is undefined",
-  async (t) => {
-    const messages: LoggedMessage[] = [];
-    const logger = getRecordingLogger(messages);
-
-    stubToolrunner();
-
-    await checkProxyEnvironment(logger, undefined);
-    assertEnvVarLogMessages(t, Object.keys(ProxyEnvVars), messages, false);
-    assertEnvVarLogMessages(t, JAVA_PROXY_ENV_VARS, messages, false);
-  },
-);
diff --git a/src/start-proxy/environment.ts b/src/start-proxy/environment.ts
deleted file mode 100644
index 0a683cc07e..0000000000
--- a/src/start-proxy/environment.ts
+++ /dev/null
@@ -1,209 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as toolrunner from "@actions/exec/lib/toolrunner";
-import * as io from "@actions/io";
-
-import { JavaEnvVars, BuiltInLanguage, Language } from "../languages";
-import { Logger } from "../logging";
-import { getErrorMessage, isDefined } from "../util";
-
-/**
- * Checks whether an environment variable named `name` is set and logs its value if set.
- *
- * @param logger The logger to use.
- * @param name The name of the environment variable.
- * @returns True if set or false otherwise.
- */
-function checkEnvVar(logger: Logger, name: string): boolean {
-  const value = process.env[name];
-  if (isDefined(value)) {
-    const url = URL.parse(value);
-    if (isDefined(url)) {
-      url.username = "";
-      url.password = "";
-      logger.info(`Environment variable '${name}' is set to '${url}'.`);
-    } else {
-      logger.info(`Environment variable '${name}' is set to '${value}'.`);
-    }
-    return true;
-  } else {
-    logger.debug(`Environment variable '${name}' is not set.`);
-    return false;
-  }
-}
-
-// The JRE properties that may affect the proxy.
-const javaProperties = [
-  "http.proxyHost",
-  "http.proxyPort",
-  "https.proxyHost",
-  "https.proxyPort",
-  "http.nonProxyHosts",
-  "java.net.useSystemProxies",
-  "javax.net.ssl.trustStore",
-  "javax.net.ssl.trustStoreType",
-  "javax.net.ssl.trustStoreProvider",
-  "jdk.tls.client.protocols",
-  "jdk.tls.disabledAlgorithms",
-  "jdk.security.allowNonCaAnchor",
-  "https.protocols",
-  "com.sun.net.ssl.enableAIAcaIssuers",
-  "com.sun.net.ssl.checkRevocation",
-  "com.sun.security.enableCRLDP",
-  "ocsp.enable",
-];
-
-/** Java-specific environment variables which may contain information about proxy settings. */
-export const JAVA_PROXY_ENV_VARS: JavaEnvVars[] = [
-  JavaEnvVars.JAVA_TOOL_OPTIONS,
-  JavaEnvVars.JDK_JAVA_OPTIONS,
-  JavaEnvVars._JAVA_OPTIONS,
-];
-
-/**
- * Checks whether any Java-specific environment variables which may contain proxy
- * configurations are set and logs their values if so.
- */
-export function checkJavaEnvVars(logger: Logger) {
-  for (const envVar of JAVA_PROXY_ENV_VARS) {
-    checkEnvVar(logger, envVar);
-  }
-}
-
-/**
- * Discovers paths to JDK directories based on JAVA_HOME and GHA-specific environment variables.
- * @returns A set of JDK paths.
- */
-export function discoverActionsJdks(): Set {
-  const paths: Set = new Set();
-
-  // Check whether JAVA_HOME is set.
-  const javaHome = process.env[JavaEnvVars.JAVA_HOME];
-  if (isDefined(javaHome)) {
-    paths.add(javaHome);
-  }
-
-  for (const [envVar, value] of Object.entries(process.env)) {
-    if (isDefined(value) && envVar.match(/^JAVA_HOME_\d+_/)) {
-      paths.add(value);
-    }
-  }
-
-  return paths;
-}
-
-/**
- * Tries to inspect JDK configuration files for the specified JDK path which may contain proxy settings.
- *
- * @param logger The logger to use.
- * @param jdkHome The JDK home directory.
- */
-export function checkJdkSettings(logger: Logger, jdkHome: string) {
-  const filesToCheck = [
-    // JDK 9+
-    path.join("conf", "net.properties"),
-    // JDK 8 and below
-    path.join("lib", "net.properties"),
-  ];
-
-  for (const fileToCheck of filesToCheck) {
-    const file = path.join(jdkHome, fileToCheck);
-
-    try {
-      if (fs.existsSync(file)) {
-        logger.debug(`Found '${file}'.`);
-
-        const lines = String(fs.readFileSync(file)).split("\n");
-        for (const line of lines) {
-          for (const property of javaProperties) {
-            if (line.startsWith(`${property}=`)) {
-              logger.info(`Found '${line.trimEnd()}' in '${file}'.`);
-            }
-          }
-        }
-      } else {
-        logger.debug(`'${file}' does not exist.`);
-      }
-    } catch (err) {
-      logger.debug(`Failed to read '${file}': ${getErrorMessage(err)}`);
-    }
-  }
-}
-
-/** Invokes `java` to get it to show us the active configuration. */
-async function showJavaSettings(logger: Logger): Promise {
-  try {
-    const java = await io.which("java", true);
-
-    let output = "";
-    await new toolrunner.ToolRunner(
-      java,
-      ["-XshowSettings:all", "-XshowSettings:security:all", "-version"],
-      {
-        silent: true,
-        listeners: {
-          stdout: (data) => {
-            output += String(data);
-          },
-          stderr: (data) => {
-            output += String(data);
-          },
-        },
-      },
-    ).exec();
-
-    logger.startGroup("Java settings");
-    logger.info(output);
-    logger.endGroup();
-  } catch (err) {
-    logger.debug(`Failed to query java settings: ${getErrorMessage(err)}`);
-  }
-}
-
-/** Enumerates environment variable names which may contain information about proxy settings. */
-export enum ProxyEnvVars {
-  HTTP_PROXY = "HTTP_PROXY",
-  HTTPS_PROXY = "HTTPS_PROXY",
-  ALL_PROXY = "ALL_PROXY",
-}
-
-/**
- * Checks whether any proxy-related environment variables are set and logs their values if so.
- */
-export function checkProxyEnvVars(logger: Logger) {
-  // Both upper-case and lower-case variants of these environment variables are used.
-  for (const envVar of Object.values(ProxyEnvVars)) {
-    checkEnvVar(logger, envVar);
-    checkEnvVar(logger, envVar.toLowerCase());
-  }
-}
-
-/**
- * Inspects environment variables and other configurations on the runner to determine whether
- * any settings that may affect the operation of the proxy are present. All relevant information
- * is written to the log.
- *
- * @param logger The logger to use.
- * @param language The enabled language, if known.
- */
-export async function checkProxyEnvironment(
-  logger: Logger,
-  language: Language | undefined,
-): Promise {
-  // Determine whether there is an existing proxy configured.
-  checkProxyEnvVars(logger);
-
-  // Check language-specific configurations. If we don't know the language,
-  // then we perform all checks.
-  if (language === undefined || language === BuiltInLanguage.java) {
-    checkJavaEnvVars(logger);
-
-    await showJavaSettings(logger);
-
-    const jdks = discoverActionsJdks();
-    for (const jdk of jdks) {
-      checkJdkSettings(logger, jdk);
-    }
-  }
-}
diff --git a/src/start-proxy/reachability.test.ts b/src/start-proxy/reachability.test.ts
deleted file mode 100644
index dc205d0b32..0000000000
--- a/src/start-proxy/reachability.test.ts
+++ /dev/null
@@ -1,152 +0,0 @@
-import test from "ava";
-import * as sinon from "sinon";
-
-import {
-  checkExpectedLogMessages,
-  setupTests,
-  withRecordingLoggerAsync,
-} from "./../testing-utils";
-import {
-  checkConnections,
-  connectionTestConfig,
-  ReachabilityBackend,
-  ReachabilityError,
-} from "./reachability";
-import { ProxyInfo, Registry } from "./types";
-
-setupTests(test);
-
-class MockReachabilityBackend implements ReachabilityBackend {
-  public async checkConnection(_url: URL): Promise {
-    return 200;
-  }
-}
-
-const mavenRegistry: Registry = {
-  type: "maven_registry",
-  url: "https://repo.maven.apache.org/maven2/",
-};
-
-const nugetFeed: Registry = {
-  type: "nuget_feed",
-  url: "https://api.nuget.org/v3/index.json",
-};
-
-const proxyInfo: ProxyInfo = {
-  host: "127.0.0.1",
-  port: 1080,
-  cert: "",
-  registries: [mavenRegistry, nugetFeed],
-};
-
-test("checkConnections - basic functionality", async (t) => {
-  const backend = new MockReachabilityBackend();
-  const messages = await withRecordingLoggerAsync(async (logger) => {
-    const reachable = await checkConnections(logger, proxyInfo, backend);
-    t.is(reachable.size, proxyInfo.registries.length);
-    t.true(reachable.has(mavenRegistry));
-    t.true(reachable.has(nugetFeed));
-  });
-  checkExpectedLogMessages(t, messages, [
-    `Testing connection to ${mavenRegistry.url}`,
-    `Successfully tested connection to ${mavenRegistry.url}`,
-    `Testing connection to ${nugetFeed.url}`,
-    `Successfully tested connection to ${nugetFeed.url}`,
-    `Finished testing connections`,
-  ]);
-});
-
-test("checkConnections - excludes failed status codes", async (t) => {
-  const backend = new MockReachabilityBackend();
-  sinon
-    .stub(backend, "checkConnection")
-    .onSecondCall()
-    .throws(new ReachabilityError(400));
-  const messages = await withRecordingLoggerAsync(async (logger) => {
-    const reachable = await checkConnections(logger, proxyInfo, backend);
-    t.is(reachable.size, 1);
-    t.true(reachable.has(mavenRegistry));
-  });
-  checkExpectedLogMessages(t, messages, [
-    `Testing connection to ${mavenRegistry.url}`,
-    `Successfully tested connection to ${mavenRegistry.url}`,
-    `Testing connection to ${nugetFeed.url}`,
-    `Connection test to ${nugetFeed.url} failed. (400)`,
-    `Finished testing connections`,
-  ]);
-});
-
-test("checkConnections - handles other exceptions", async (t) => {
-  const backend = new MockReachabilityBackend();
-  sinon
-    .stub(backend, "checkConnection")
-    .onSecondCall()
-    .throws(new Error("Some generic error"));
-  const messages = await withRecordingLoggerAsync(async (logger) => {
-    const reachable = await checkConnections(logger, proxyInfo, backend);
-    t.is(reachable.size, 1);
-    t.true(reachable.has(mavenRegistry));
-  });
-  checkExpectedLogMessages(t, messages, [
-    `Testing connection to ${mavenRegistry.url}`,
-    `Successfully tested connection to ${mavenRegistry.url}`,
-    `Testing connection to ${nugetFeed.url}`,
-    `Connection test to ${nugetFeed.url} failed: Some generic error`,
-    `Finished testing connections`,
-  ]);
-});
-
-test("checkConnections - handles invalid URLs", async (t) => {
-  const backend = new MockReachabilityBackend();
-  const messages = await withRecordingLoggerAsync(async (logger) => {
-    const reachable = await checkConnections(
-      logger,
-      {
-        ...proxyInfo,
-        registries: [
-          {
-            type: "nuget_feed",
-            url: "localhost",
-          },
-        ],
-      },
-      backend,
-    );
-    t.is(reachable.size, 0);
-  });
-  checkExpectedLogMessages(t, messages, [
-    `Skipping check for localhost since it is not a valid URL.`,
-    `Finished testing connections`,
-  ]);
-});
-
-test("checkConnections - appends extra paths", async (t) => {
-  const backend = new MockReachabilityBackend();
-  const checkConnection = sinon.stub(backend, "checkConnection").resolves(200);
-
-  const messages = await withRecordingLoggerAsync(async (logger) => {
-    await checkConnections(
-      logger,
-      {
-        ...proxyInfo,
-        registries: [{ ...nugetFeed, url: "https://api.nuget.org/" }],
-      },
-      backend,
-    );
-  });
-  checkExpectedLogMessages(t, messages, [
-    `Testing connection to https://api.nuget.org/`,
-    `Successfully tested connection to https://api.nuget.org/`,
-    `Finished testing connections`,
-  ]);
-
-  t.true(
-    checkConnection.calledWith(
-      sinon.match(
-        new URL(
-          `https://api.nuget.org/${connectionTestConfig["nuget_feed"]?.path}`,
-        ),
-      ),
-    ),
-  );
-});
diff --git a/src/start-proxy/reachability.ts b/src/start-proxy/reachability.ts
deleted file mode 100644
index c20ab41460..0000000000
--- a/src/start-proxy/reachability.ts
+++ /dev/null
@@ -1,171 +0,0 @@
-import * as https from "https";
-
-import { HttpsProxyAgent } from "https-proxy-agent";
-
-import { DocUrl } from "../doc-url";
-import { Logger } from "../logging";
-import { getErrorMessage } from "../util";
-
-import { getAddressString, ProxyInfo, Registry } from "./types";
-
-/** Represents registry-specific connection test configurations. */
-export interface ConnectionTestConfig {
-  /** An optional path to append to the end of the base url. */
-  path?: string;
-}
-
-/** A partial mapping of registry types to extra connection test configurations. */
-export const connectionTestConfig: Partial<
-  Record
-> = {
-  nuget_feed: { path: "v3/index.json" },
-};
-
-/**
- * Applies the registry-specific check configuration to the base URL, if any and applicable.
- */
-export function makeTestUrl(
-  config: ConnectionTestConfig | undefined,
-  base: URL,
-): URL {
-  if (config?.path === undefined) {
-    return base;
-  }
-  if (base.pathname.endsWith(config.path)) {
-    return base;
-  }
-  return new URL(config.path, base);
-}
-
-export class ReachabilityError extends Error {
-  constructor(public readonly statusCode?: number | undefined) {
-    super();
-  }
-}
-
-/**
- * Abstracts over the backend for the reachability checks,
- * to allow actual networking to be replaced with stubs.
- */
-export interface ReachabilityBackend {
-  /**
-   * Performs a test HTTP request to the specified `url`. Resolves to the status code,
-   * if a successful status code was obtained. Otherwise throws
-   *
-   * @param url The URL of the registry to try and reach.
-   * @returns The successful status code (in the `<400` range).
-   */
-  checkConnection: (url: URL) => Promise;
-}
-
-class NetworkReachabilityBackend implements ReachabilityBackend {
-  private agent: https.Agent;
-
-  constructor(private readonly proxy: ProxyInfo) {
-    this.agent = new HttpsProxyAgent(`http://${proxy.host}:${proxy.port}`);
-  }
-
-  public async checkConnection(url: URL): Promise {
-    return new Promise((resolve, reject) => {
-      const req = https.request(
-        url,
-        {
-          agent: this.agent,
-          method: "GET",
-          ca: this.proxy.cert,
-          timeout: 5 * 1000, // 5 seconds
-        },
-        (res) => {
-          res.destroy();
-
-          if (res.statusCode !== undefined && res.statusCode < 400) {
-            resolve(res.statusCode);
-          } else {
-            reject(new ReachabilityError(res.statusCode));
-          }
-        },
-      );
-      req.on("error", (e) => {
-        reject(e);
-      });
-      req.on("timeout", () => {
-        req.destroy();
-        reject(new Error("Connection timeout."));
-      });
-      req.end();
-    });
-  }
-}
-
-/**
- * Determines which configured registries can be reached by performing test requests to them.
- *
- * @param logger The logger to use.
- * @param proxy Information about the proxy, including the configured registries.
- * @param backend Optionally for testing, a `ReachabilityBackend` to use.
- * @returns The set of registries which passed the checks.
- */
-export async function checkConnections(
-  logger: Logger,
-  proxy: ProxyInfo,
-  backend?: ReachabilityBackend,
-): Promise> {
-  const result: Set = new Set();
-
-  // Don't do anything if there are no registries.
-  if (proxy.registries.length === 0) return result;
-
-  // Start a log group and print a message with a disclaimer with a link to the
-  // relevant documentation that these checks are a best-effort process.
-  logger.startGroup("Testing connections via the proxy");
-  logger.info(
-    `The connection tests performed here are best-effort only and failures here may not affect the subsequent analysis. See ${DocUrl.PRIVATE_REGISTRY_LOGS} for more information.`,
-  );
-
-  try {
-    // Initialise a networking backend if no backend was provided.
-    if (backend === undefined) {
-      backend = new NetworkReachabilityBackend(proxy);
-    }
-
-    for (const registry of proxy.registries) {
-      const config = connectionTestConfig[registry.type];
-      const address = getAddressString(registry);
-      const url = URL.parse(address);
-
-      if (url === null) {
-        logger.info(
-          `Skipping check for ${address} since it is not a valid URL.`,
-        );
-        continue;
-      }
-
-      const testUrl = makeTestUrl(config, url);
-
-      try {
-        logger.debug(`Testing connection to ${url}...`);
-        const statusCode = await backend.checkConnection(testUrl);
-
-        logger.info(`Successfully tested connection to ${url} (${statusCode})`);
-        result.add(registry);
-      } catch (e) {
-        if (e instanceof ReachabilityError && e.statusCode !== undefined) {
-          logger.info(`Connection test to ${url} failed. (${e.statusCode})`);
-        } else {
-          logger.warning(
-            `Connection test to ${url} failed: ${getErrorMessage(e)}`,
-          );
-        }
-      }
-    }
-
-    logger.debug(`Finished testing connections to private registries.`);
-  } catch (e) {
-    logger.warning(
-      `Failed to test connections to private registries: ${getErrorMessage(e)}`,
-    );
-  }
-
-  logger.endGroup();
-  return result;
-}
diff --git a/src/start-proxy/types.test.ts b/src/start-proxy/types.test.ts
deleted file mode 100644
index 1b72ee8a72..0000000000
--- a/src/start-proxy/types.test.ts
+++ /dev/null
@@ -1,202 +0,0 @@
-import test from "ava";
-
-import { makeFromSchema, withSchemaMatrix } from "../json/testing-util";
-import { setupTests } from "../testing-utils";
-
-import * as types from "./types";
-
-setupTests(test);
-
-const validAzureCredential: types.AzureConfig = {
-  "tenant-id": "12345678-1234-1234-1234-123456789012",
-  "client-id": "abcdef01-2345-6789-abcd-ef0123456789",
-};
-
-const validAwsCredential: types.AWSConfig = {
-  "aws-region": "us-east-1",
-  "account-id": "123456789012",
-  "role-name": "MY_ROLE",
-  domain: "MY_DOMAIN",
-  "domain-owner": "987654321098",
-  audience: "custom-audience",
-};
-
-const validJFrogCredential: types.JFrogConfig = {
-  "jfrog-oidc-provider-name": "MY_PROVIDER",
-  audience: "jfrog-audience",
-  "identity-mapping-name": "my-mapping",
-};
-
-test("hasUsername", (t) => {
-  // Reject the case where `username` is missing.
-  t.false(types.hasUsername({}));
-
-  // Test all cases where `username` is present.
-  withSchemaMatrix(
-    t,
-    types.usernameSchema,
-    { excludeAbsent: true },
-    (value) => {
-      t.true(types.hasUsername(value));
-    },
-  );
-});
-
-test("hasUsernameAndPassword", (t) => {
-  // Reject cases where `username` or `password` are missing.
-  t.false(types.hasUsernameAndPassword({}));
-  t.false(types.hasUsernameAndPassword({ username: "foo" }));
-  t.false(types.hasUsernameAndPassword({ password: "foo" }));
-
-  // Test all cases where both `username` and `password` are present.
-  withSchemaMatrix(
-    t,
-    types.usernamePasswordSchema,
-    { excludeAbsent: true },
-    (value) => {
-      t.true(types.hasUsernameAndPassword(value));
-    },
-  );
-});
-
-test("credentialToStr - pretty-prints valid username+password configurations", (t) => {
-  const secret = "password123";
-  const credential: types.Credential = {
-    type: "maven_credential",
-    username: "user",
-    password: secret,
-    url: "https://localhost",
-  };
-
-  const str = types.credentialToStr(credential);
-
-  t.false(str.includes(secret));
-  t.is(
-    "Type: maven_credential; Url: https://localhost; Username: user; Password: ***;",
-    str,
-  );
-});
-
-test("credentialToStr - pretty-prints valid username+token configurations", (t) => {
-  const secret = "password123";
-  const credential: types.Credential = {
-    type: "maven_credential",
-    username: "user",
-    token: secret,
-    url: "https://localhost",
-  };
-
-  const str = types.credentialToStr(credential);
-
-  t.false(str.includes(secret));
-  t.is(
-    "Type: maven_credential; Url: https://localhost; Username: user; Token: ***;",
-    str,
-  );
-});
-
-test("credentialToStr - pretty-prints valid Azure OIDC configurations", (t) => {
-  const credential: types.Credential = {
-    type: "maven_credential",
-    url: "https://localhost",
-    ...validAzureCredential,
-  };
-
-  const str = types.credentialToStr(credential);
-
-  t.is(
-    "Type: maven_credential; Url: https://localhost; Tenant: 12345678-1234-1234-1234-123456789012; Client: abcdef01-2345-6789-abcd-ef0123456789;",
-    str,
-  );
-});
-
-test("credentialToStr - pretty-prints valid AWS OIDC configurations", (t) => {
-  const credential: types.Credential = {
-    type: "maven_credential",
-    url: "https://localhost",
-    ...validAwsCredential,
-  };
-
-  const str = types.credentialToStr(credential);
-
-  t.is(
-    "Type: maven_credential; Url: https://localhost; AWS Region: us-east-1; AWS Account: 123456789012; AWS Role: MY_ROLE; AWS Domain: MY_DOMAIN; AWS Domain Owner: 987654321098; AWS Audience: custom-audience;",
-    str,
-  );
-});
-
-test("credentialToStr - pretty-prints valid JFrog OIDC configurations", (t) => {
-  const credential: types.Credential = {
-    type: "maven_credential",
-    url: "https://localhost",
-    ...validJFrogCredential,
-  };
-
-  const str = types.credentialToStr(credential);
-
-  t.is(
-    "Type: maven_credential; Url: https://localhost; JFrog Provider: MY_PROVIDER; JFrog Identity Mapping: my-mapping; JFrog Audience: jfrog-audience;",
-    str,
-  );
-});
-
-test("credentialToStr - pretty-prints valid Cloudsmith OIDC configurations", (t) => {
-  const credential: types.Credential = {
-    type: "maven_credential",
-    url: "https://localhost",
-    ...(makeFromSchema(
-      true,
-      types.cloudsmithConfigSchema,
-    ) as types.CloudsmithConfig),
-  };
-
-  const str = types.credentialToStr(credential);
-
-  t.is(
-    "Type: maven_credential; Url: https://localhost; Cloudsmith Namespace: value-for-namespace; Cloudsmith Service Slug: value-for-service-slug; Cloudsmith API Host: value-for-api-host;",
-    str,
-  );
-});
-
-test("credentialToStr - pretty-prints valid GCP OIDC configurations", (t) => {
-  const credential: types.Credential = {
-    type: "maven_credential",
-    url: "https://localhost",
-    ...(makeFromSchema(true, types.gcpConfigSchema) as types.GCPConfig),
-  };
-
-  const str = types.credentialToStr(credential);
-
-  t.is(
-    "Type: maven_credential; Url: https://localhost; GCP Workload Identity Provider: value-for-workload-identity-provider; GCP Service Account: value-for-service-account; GCP Audience: value-for-audience;",
-    str,
-  );
-});
-
-test("credentialToStr - hides passwords", (t) => {
-  const secret = "password123";
-  const credential = {
-    type: "maven_credential",
-    password: secret,
-    url: "https://localhost",
-  } satisfies types.Credential;
-
-  const str = types.credentialToStr(credential);
-
-  t.false(str.includes(secret));
-  t.is("Type: maven_credential; Url: https://localhost; Password: ***;", str);
-});
-
-test("credentialToStr - hides tokens", (t) => {
-  const secret = "password123";
-  const credential = {
-    type: "maven_credential",
-    token: secret,
-    url: "https://localhost",
-  } satisfies types.Credential;
-
-  const str = types.credentialToStr(credential);
-
-  t.false(str.includes(secret));
-  t.is("Type: maven_credential; Url: https://localhost; Token: ***;", str);
-});
diff --git a/src/start-proxy/types.ts b/src/start-proxy/types.ts
deleted file mode 100644
index 17803e9126..0000000000
--- a/src/start-proxy/types.ts
+++ /dev/null
@@ -1,325 +0,0 @@
-import type { UnvalidatedObject } from "../json";
-import * as json from "../json";
-import { isDefined } from "../util";
-
-/**
- * After parsing configurations from JSON, we don't know whether all the keys we expect are
- * present or not. This type is used to represent such values, which we expect to be
- * `Credential` values, but haven't validated yet.
- */
-export type RawCredential = UnvalidatedObject;
-
-/** A schema for credential objects with a username. */
-export const usernameSchema = {
-  /** The username needed to authenticate to the package registry, if any. */
-  username: json.optionalOrNull(json.string),
-} as const satisfies json.Schema;
-
-/** Usernames may be present for both authentication with tokens or passwords. */
-export type Username = json.FromSchema;
-
-/**
- * Narrows `config` to `Username` if `config` has a `username` property.
- * Not used for validation. Assumes that `config` is already a validated `AuthConfig`.
- */
-export function hasUsername(config: AuthConfig): config is Username {
-  return "username" in config;
-}
-
-/** A schema for credential objects with a username and password. */
-export const usernamePasswordSchema = {
-  /** The password needed to authenticate to the package registry, if any. */
-  password: json.optionalOrNull(json.string),
-  ...usernameSchema,
-} as const satisfies json.Schema;
-
-/**
- * Fields expected for authentication based on a username and password.
- * Both username and password are optional.
- */
-export type UsernamePassword = json.FromSchema;
-
-/**
- * Narrows `config` to `UsernamePassword` if it has a `username` and `password` property.
- * Not used for validation. Assumes that `config` is already a validated `AuthConfig`.
- */
-export function hasUsernameAndPassword(
-  config: AuthConfig,
-): config is UsernamePassword {
-  return hasUsername(config) && "password" in config;
-}
-
-/** A schema for credential objects for token-based authentication. */
-export const tokenSchema = {
-  /** The token needed to authenticate to the package registry, if any. */
-  token: json.optionalOrNull(json.string),
-  ...usernameSchema,
-} as const satisfies json.Schema;
-
-/**
- * Fields expected for token-based authentication.
- * Both username and token are optional.
- */
-export type Token = json.FromSchema;
-
-/**
- * Narrows `config` to `Token` if it has a `token` property.
- * Not used for validation. Assumes that `config` is already a validated `AuthConfig`.
- */
-export function hasToken(config: AuthConfig): config is Token {
-  return "token" in config;
-}
-
-/** Decides whether `config` is token-based. */
-export function isToken(
-  config: UnvalidatedObject,
-): config is Token {
-  return "token" in config && json.validateSchema(tokenSchema, config);
-}
-
-/** A schema for Azure OIDC configurations. */
-export const azureConfigSchema = {
-  "tenant-id": json.string,
-  "client-id": json.string,
-} as const satisfies json.Schema;
-
-/** Configuration for Azure OIDC. */
-export type AzureConfig = json.FromSchema;
-
-/** Decides whether `config` is an Azure OIDC configuration. */
-export function isAzureConfig(
-  config: UnvalidatedObject,
-): config is AzureConfig {
-  return json.validateSchema(azureConfigSchema, config);
-}
-
-/** A schema for AWS OIDC configurations. */
-export const awsConfigSchema = {
-  "aws-region": json.string,
-  "account-id": json.string,
-  "role-name": json.string,
-  domain: json.string,
-  "domain-owner": json.string,
-  audience: json.optionalOrNull(json.string),
-} as const satisfies json.Schema;
-
-/** Configuration for AWS OIDC. */
-export type AWSConfig = json.FromSchema;
-
-/** Decides whether `config` is an AWS OIDC configuration. */
-export function isAWSConfig(
-  config: UnvalidatedObject,
-): config is AWSConfig {
-  return json.validateSchema(awsConfigSchema, config);
-}
-
-/** A schema for JFrog OIDC configurations. */
-export const jfrogConfigSchema = {
-  "jfrog-oidc-provider-name": json.string,
-  audience: json.optionalOrNull(json.string),
-  "identity-mapping-name": json.optionalOrNull(json.string),
-} as const satisfies json.Schema;
-
-/** Configuration for JFrog OIDC. */
-export type JFrogConfig = json.FromSchema;
-
-/** Decides whether `config` is a JFrog OIDC configuration. */
-export function isJFrogConfig(
-  config: UnvalidatedObject,
-): config is JFrogConfig {
-  return json.validateSchema(jfrogConfigSchema, config);
-}
-
-/** A schema for Cloudsmith OIDC configurations. */
-export const cloudsmithConfigSchema = {
-  namespace: json.string,
-  "service-slug": json.string,
-  "api-host": json.string,
-} as const satisfies json.Schema;
-
-/** Configuration for Cloudsmith OIDC. */
-export type CloudsmithConfig = json.FromSchema;
-
-/** Decides whether `config` is a Cloudsmith OIDC configuration. */
-export function isCloudsmithConfig(
-  config: UnvalidatedObject,
-): config is CloudsmithConfig {
-  return json.validateSchema(cloudsmithConfigSchema, config);
-}
-
-/** A schema for GCP OIDC configurations. */
-export const gcpConfigSchema = {
-  "workload-identity-provider": json.string,
-  "service-account": json.optionalOrNull(json.string),
-  audience: json.optionalOrNull(json.string),
-} as const satisfies json.Schema;
-
-/** Configuration for GCP OIDC. */
-export type GCPConfig = json.FromSchema;
-
-/** Decides whether `config` is a GCP OIDC configuration. */
-export function isGCPConfig(
-  config: UnvalidatedObject,
-): config is GCPConfig {
-  return json.validateSchema(gcpConfigSchema, config);
-}
-
-/** An array of all OIDC configuration schemas along with output-friendly names. */
-export const oidcSchemas = [
-  { schema: azureConfigSchema, name: "Azure" },
-  { schema: awsConfigSchema, name: "AWS" },
-  { schema: jfrogConfigSchema, name: "JFrog" },
-  { schema: cloudsmithConfigSchema, name: "Cloudsmith" },
-  { schema: gcpConfigSchema, name: "GCP" },
-];
-
-/** Represents all supported OIDC configurations. */
-export type OIDC =
-  | AzureConfig
-  | AWSConfig
-  | JFrogConfig
-  | CloudsmithConfig
-  | GCPConfig;
-
-/** All authentication-related fields. */
-export type AuthConfig = UsernamePassword | Token | OIDC;
-
-/**
- * A package registry configuration includes identifying information as well as
- * authentication credentials.
- */
-export type Credential = AuthConfig & Registry;
-
-/**
- * Pretty-prints a `Credential` value to a string, but hides the actual password or token values.
- *
- * @param credential The credential to convert to a string.
- */
-export function credentialToStr(credential: Credential): string {
-  let result: string = `Type: ${credential.type};`;
-
-  const appendIfDefined = (name: string, val: string | undefined | null) => {
-    if (isDefined(val)) {
-      result += ` ${name}: ${val};`;
-    }
-  };
-
-  appendIfDefined("Url", credential.url);
-  appendIfDefined("Host", credential.host);
-
-  if (hasUsername(credential)) {
-    appendIfDefined("Username", credential.username);
-  }
-
-  if ("password" in credential) {
-    appendIfDefined(
-      "Password",
-      isDefined(credential.password) ? "***" : undefined,
-    );
-  }
-  if (hasToken(credential)) {
-    appendIfDefined("Token", isDefined(credential.token) ? "***" : undefined);
-  }
-
-  if (isAzureConfig(credential)) {
-    appendIfDefined("Tenant", credential["tenant-id"]);
-    appendIfDefined("Client", credential["client-id"]);
-  } else if (isAWSConfig(credential)) {
-    appendIfDefined("AWS Region", credential["aws-region"]);
-    appendIfDefined("AWS Account", credential["account-id"]);
-    appendIfDefined("AWS Role", credential["role-name"]);
-    appendIfDefined("AWS Domain", credential.domain);
-    appendIfDefined("AWS Domain Owner", credential["domain-owner"]);
-    appendIfDefined("AWS Audience", credential.audience);
-  } else if (isJFrogConfig(credential)) {
-    appendIfDefined("JFrog Provider", credential["jfrog-oidc-provider-name"]);
-    appendIfDefined(
-      "JFrog Identity Mapping",
-      credential["identity-mapping-name"],
-    );
-    appendIfDefined("JFrog Audience", credential.audience);
-  } else if (isCloudsmithConfig(credential)) {
-    appendIfDefined("Cloudsmith Namespace", credential.namespace);
-    appendIfDefined("Cloudsmith Service Slug", credential["service-slug"]);
-    appendIfDefined("Cloudsmith API Host", credential["api-host"]);
-  } else if (isGCPConfig(credential)) {
-    appendIfDefined(
-      "GCP Workload Identity Provider",
-      credential["workload-identity-provider"],
-    );
-    appendIfDefined("GCP Service Account", credential["service-account"]);
-    appendIfDefined("GCP Audience", credential.audience);
-  }
-
-  return result;
-}
-
-/** The schema for `RegistryBase` objects. */
-export const registryBaseSchema = {
-  /** The type of the package registry. */
-  type: json.string,
-  /** Whether the registry replaces the base registry for the ecosystem. */
-  "replaces-base": json.optional(json.boolean),
-} as const satisfies json.Schema;
-
-/** Information about a registry, other than its address. */
-export type RegistryBase = json.FromSchema;
-
-/** A package registry is identified by its type and address. */
-export type Registry = RegistryBase & Address;
-
-// If a registry has an `url`, then that takes precedence over the `host` which may or may
-// not be defined.
-interface HasUrl {
-  url: string;
-  host?: string;
-}
-
-// If a registry does not have an `url`, then it must have a `host`.
-interface WithoutUrl {
-  url: undefined;
-  host: string;
-}
-
-/**
- * A valid `Registry` value must either have a `url` or a `host` value. If it has a `url` value,
- * then that takes precedence over the `host` value. If there is no `url` value, then it must
- * have a `host` value.
- */
-export type Address = HasUrl | WithoutUrl;
-
-/** Gets the address as a string. This will either be the `url` if present, or the `host` if not. */
-export function getAddressString(address: Address): string {
-  if (address.url === undefined) {
-    return address.host;
-  } else {
-    return address.url;
-  }
-}
-
-export interface ProxyInfo {
-  host: string;
-  port: number;
-  cert: string;
-  registries: Registry[];
-}
-
-export type CertificateAuthority = {
-  cert: string;
-  key: string;
-};
-
-export type BasicAuthCredentials = {
-  username: string;
-  password: string;
-};
-
-/**
- * Represents configurations for the authentication proxy.
- */
-export type ProxyConfig = {
-  /** The validated configurations for the proxy. */
-  all_credentials: Credential[];
-  ca: CertificateAuthority;
-  proxy_auth?: BasicAuthCredentials;
-};
diff --git a/src/start-proxy/validation.test.ts b/src/start-proxy/validation.test.ts
deleted file mode 100644
index 7c0cc1652d..0000000000
--- a/src/start-proxy/validation.test.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import test from "ava";
-
-import * as json from "../json";
-import { makeFromSchema } from "../json/testing-util";
-import { setupTests } from "../testing-utils";
-
-import * as types from "./types";
-import { getAuthConfig } from "./validation";
-
-setupTests(test);
-
-for (const schemaTest of types.oidcSchemas) {
-  for (const includeOptional of [true, false]) {
-    const minimalName = includeOptional ? "full" : "minimal";
-
-    test(`getAuthConfig - ${schemaTest.name} - ${minimalName}`, async (t) => {
-      const config = makeFromSchema(includeOptional, schemaTest.schema);
-
-      t.deepEqual(
-        getAuthConfig({
-          ...config,
-          unexpected: "unexpected-value",
-        } as unknown as json.UnvalidatedObject),
-        config,
-      );
-    });
-  }
-}
-
-test("getAuthConfig - token", async (t) => {
-  const config = makeFromSchema(true, types.tokenSchema);
-
-  t.deepEqual(
-    getAuthConfig({
-      ...config,
-      unexpected: "unexpected-value",
-    } as json.UnvalidatedObject),
-    config,
-  );
-});
-
-test("getAuthConfig - username and password", async (t) => {
-  const config = makeFromSchema(true, types.usernamePasswordSchema);
-
-  t.deepEqual(
-    getAuthConfig({
-      ...config,
-      unexpected: "unexpected-value",
-    } as json.UnvalidatedObject),
-    config,
-  );
-});
-
-test("getAuthConfig - empty", async (t) => {
-  const config = makeFromSchema(false, types.usernamePasswordSchema);
-
-  // Since the purpose of constructing the `AuthConfig` values is for
-  // serialisation to JSON so that they can be passed to the proxy as configuration,
-  // we only care that the stringified JSON representations are the same.
-  t.deepEqual(
-    JSON.stringify(
-      getAuthConfig({
-        ...config,
-        unexpected: "unexpected-value",
-      } as json.UnvalidatedObject),
-    ),
-    JSON.stringify({}),
-  );
-});
diff --git a/src/start-proxy/validation.ts b/src/start-proxy/validation.ts
deleted file mode 100644
index 6603a4776a..0000000000
--- a/src/start-proxy/validation.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import * as core from "@actions/core";
-
-import * as json from "../json";
-import { isDefined } from "../util";
-
-import type { AuthConfig, UsernamePassword } from "./types";
-import * as types from "./types";
-
-/** Constructs a new object from `obj` with only keys that exist in `schema`. */
-export function cloneCredential(
-  schema: S,
-  obj: json.FromSchema,
-): json.FromSchema {
-  const result = {};
-
-  for (const key of Object.keys(schema)) {
-    // Skip keys that don't exist or don't have a value.
-    if (!isDefined(obj[key])) {
-      continue;
-    }
-    result[key] = obj[key];
-  }
-
-  return result as json.FromSchema;
-}
-
-/** Extracts an `AuthConfig` value from `config`. */
-export function getAuthConfig(
-  config: json.UnvalidatedObject,
-): AuthConfig {
-  // Start by checking for the OIDC configurations, since they have required properties
-  // which we can use to identify them.
-  for (const oidcSchema of types.oidcSchemas) {
-    if (json.validateSchema(oidcSchema.schema, config)) {
-      return cloneCredential(oidcSchema.schema, config);
-    }
-  }
-
-  // Otherwise, try the basic configuration types.
-  if (types.isToken(config)) {
-    // There are three scenarios for non-OIDC authentication based on the registry type:
-    //
-    // 1. `username`+`token`
-    // 2. A `token` that combines the username and actual token, separated by ':'.
-    // 3. `username`+`password`
-    //
-    // In all three cases, all fields are optional. If the `token` field is present,
-    // we accept the configuration as a `Token` typed configuration, with the `token`
-    // value and an optional `username`. Otherwise, we accept the configuration
-    // typed as `UsernamePassword` (in the `else` clause below) with optional
-    // username and password. I.e. a private registry type that uses 1. or 2.,
-    // but has no `token` configured, will get accepted as `UsernamePassword` here.
-
-    if (isDefined(config.token)) {
-      // Mask token to reduce chance of accidental leakage in logs, if we have one.
-      core.setSecret(config.token);
-    }
-
-    return cloneCredential(types.tokenSchema, config);
-  } else {
-    let username: string | undefined = undefined;
-    let password: string | undefined = undefined;
-
-    // Both "username" and "password" are optional. If we have reached this point, we need
-    // to validate which of them are present and that they have the correct type if so.
-    if ("password" in config && json.isString(config.password)) {
-      // Mask password to reduce chance of accidental leakage in logs, if we have one.
-      core.setSecret(config.password);
-      password = config.password;
-    }
-    if ("username" in config && json.isString(config.username)) {
-      username = config.username;
-    }
-
-    // Return the `UsernamePassword` object. Both username and password may be undefined.
-    return {
-      username,
-      password,
-    } satisfies UsernamePassword;
-  }
-}
diff --git a/src/status-report.test.ts b/src/status-report.test.ts
deleted file mode 100644
index 2b763da700..0000000000
--- a/src/status-report.test.ts
+++ /dev/null
@@ -1,494 +0,0 @@
-import test from "ava";
-import * as sinon from "sinon";
-import * as uuid from "uuid";
-
-import * as actionsUtil from "./actions-util";
-import { Config } from "./config-utils";
-import { EnvVar, RegistryProxyVars } from "./environment";
-import { BuiltInLanguage } from "./languages";
-import { getRunnerLogger } from "./logging";
-import { ToolsSource } from "./setup-codeql";
-import type { Registry } from "./start-proxy";
-import {
-  ActionName,
-  createInitWithConfigStatusReport,
-  createStatusReportBase,
-  getActionsStatus,
-  getRegistryTypesFromEnv,
-  getJobUUID,
-  InitStatusReport,
-  InitWithConfigStatusReport,
-} from "./status-report";
-import {
-  setupTests,
-  setupActionsVars,
-  createTestConfig,
-  makeMacro,
-  getTestEnv,
-  RecordingLogger,
-  callee,
-} from "./testing-utils";
-import { BuildMode, ConfigurationError, withTmpDir, wrapError } from "./util";
-
-setupTests(test);
-
-test("getRegistryTypesFromEnv - gets unique registry types from environment", async (t) => {
-  const logger = new RecordingLogger(true);
-  const env = getTestEnv({
-    [RegistryProxyVars.PROXY_URLS]: JSON.stringify([
-      { type: "git_source", url: "https://example.com" },
-      { type: "git_source", url: "https://github.com" },
-      { type: "docker_registry", url: "https://registry.example.com" },
-    ] satisfies Array>),
-  });
-
-  const result = getRegistryTypesFromEnv(logger, env);
-  t.deepEqual(result, ["git_source", "docker_registry"].sort().join(","));
-});
-
-test("getRegistryTypesFromEnv - returns undefined if the env var is not set", async (t) => {
-  const logger = new RecordingLogger(true);
-  const env = getTestEnv({});
-
-  const result = getRegistryTypesFromEnv(logger, env);
-  t.is(result, undefined);
-});
-
-test("getRegistryTypesFromEnv - returns undefined if the env var is not valid JSON", async (t) => {
-  const logger = new RecordingLogger(true);
-  const env = getTestEnv({ [RegistryProxyVars.PROXY_URLS]: "[" });
-
-  const result = getRegistryTypesFromEnv(logger, env);
-  t.is(result, undefined);
-});
-
-test("getRegistryTypesFromEnv - returns undefined if the env var is unexpected JSON", async (t) => {
-  const logger = new RecordingLogger(true);
-
-  t.is(
-    getRegistryTypesFromEnv(
-      logger,
-      getTestEnv({
-        // Top-level object rather than an array of objects.
-        [RegistryProxyVars.PROXY_URLS]: JSON.stringify({ type: "git_source" }),
-      }),
-    ),
-    undefined,
-  );
-  t.is(
-    getRegistryTypesFromEnv(
-      logger,
-      getTestEnv({
-        // Object has no "type" key.
-        [RegistryProxyVars.PROXY_URLS]: JSON.stringify([{}]),
-      }),
-    ),
-    undefined,
-  );
-});
-
-test("getJobUUID - generates valid UUIDs", async (t) => {
-  await callee(getJobUUID)
-    .withArgs()
-    .logs(t, "Job run UUID is ")
-    .hasEnv(t, (val) => {
-      return {
-        [EnvVar.JOB_RUN_UUID]: val,
-      };
-    })
-    .passes((val) => {
-      t.true(uuid.validate(val));
-    });
-});
-
-test("getJobUUID - retrieves existing job UUIDs", async (t) => {
-  const existingJobUuid = uuid.v4();
-  await callee(getJobUUID)
-    .withArgs()
-    .withEnv((env) => {
-      env.set(EnvVar.JOB_RUN_UUID, existingJobUuid);
-    })
-    .logs(t, `Existing job run UUID is ${existingJobUuid}.`)
-    .passes(t.deepEqual, existingJobUuid);
-});
-
-test("getJobUUID - doesn't retrieve invalid UUIDs", async (t) => {
-  const existingJobUuid = "not-a-uuid";
-  await callee(getJobUUID)
-    .withArgs()
-    .withEnv((env) => {
-      env.set(EnvVar.JOB_RUN_UUID, existingJobUuid);
-    })
-    .logs(t, `Job run UUID is `)
-    .notLogs(t, `Existing job run UUID is ${existingJobUuid}.`)
-    .passes(t.notDeepEqual, existingJobUuid);
-});
-
-function setupEnvironmentAndStub(tmpDir: string) {
-  setupActionsVars(tmpDir, tmpDir, {
-    GITHUB_EVENT_NAME: "dynamic",
-    GITHUB_RUN_ATTEMPT: "2",
-    GITHUB_RUN_ID: "100",
-  });
-
-  process.env[EnvVar.ANALYSIS_KEY] = "analysis-key";
-  process.env["ImageVersion"] = "2023.05.19.1";
-  process.env[RegistryProxyVars.PROXY_URLS] = JSON.stringify([
-    { type: "maven_repository" },
-  ] satisfies Array>);
-
-  const getRequiredInput = sinon.stub(actionsUtil, "getRequiredInput");
-  getRequiredInput.withArgs("matrix").resolves("input/matrix");
-}
-
-test.serial("createStatusReportBase", async (t) => {
-  await withTmpDir(async (tmpDir: string) => {
-    setupEnvironmentAndStub(tmpDir);
-
-    const statusReport = await createStatusReportBase(
-      ActionName.Init,
-      "failure",
-      new Date("May 19, 2023 05:19:00"),
-      createTestConfig({
-        buildMode: BuildMode.None,
-        languages: [BuiltInLanguage.java, BuiltInLanguage.swift],
-      }),
-      { numAvailableBytes: 100, numTotalBytes: 500 },
-      getRunnerLogger(false),
-      "failure cause",
-      "exception stack trace",
-    );
-    t.truthy(statusReport);
-
-    if (statusReport !== undefined) {
-      t.is(statusReport.action_name, ActionName.Init);
-      t.is(statusReport.action_oid, "unknown");
-      t.is(typeof statusReport.action_version, "string");
-      t.is(
-        statusReport.action_started_at,
-        new Date("May 19, 2023 05:19:00").toISOString(),
-      );
-      t.is(statusReport.actions_event_name, "dynamic");
-      t.is(statusReport.analysis_key, "analysis-key");
-      t.is(statusReport.build_mode, BuildMode.None);
-      t.is(statusReport.cause, "failure cause");
-      t.is(statusReport.commit_oid, process.env["GITHUB_SHA"]!);
-      t.deepEqual(statusReport.computed_inputs, {});
-      t.is(statusReport.exception, "exception stack trace");
-      t.is(statusReport.job_name, process.env["GITHUB_JOB"] || "");
-      t.is(typeof statusReport.job_run_uuid, "string");
-      t.is(statusReport.languages, "java,swift");
-      t.is(statusReport.ref, process.env["GITHUB_REF"]!);
-      t.is(statusReport.registry_types, "maven_repository");
-      t.is(statusReport.runner_available_disk_space_bytes, 100);
-      t.is(statusReport.runner_image_version, process.env["ImageVersion"]);
-      t.is(statusReport.runner_os, process.env["RUNNER_OS"]!);
-      t.is(statusReport.started_at, process.env[EnvVar.WORKFLOW_STARTED_AT]!);
-      t.is(statusReport.status, "failure");
-      t.is(statusReport.steady_state_default_setup, false);
-      t.is(statusReport.workflow_name, process.env["GITHUB_WORKFLOW"] || "");
-      t.is(statusReport.workflow_run_attempt, 2);
-      t.is(statusReport.workflow_run_id, 100);
-    }
-  });
-});
-
-test.serial("createStatusReportBase - empty configuration", async (t) => {
-  await withTmpDir(async (tmpDir: string) => {
-    setupEnvironmentAndStub(tmpDir);
-
-    const statusReport = await createStatusReportBase(
-      ActionName.StartProxy,
-      "success",
-      new Date("May 19, 2023 05:19:00"),
-      {},
-      { numAvailableBytes: 100, numTotalBytes: 500 },
-      getRunnerLogger(false),
-    );
-
-    if (t.truthy(statusReport)) {
-      t.is(statusReport.action_name, ActionName.StartProxy);
-      t.is(statusReport.status, "success");
-    }
-  });
-});
-
-test.serial("createStatusReportBase - partial configuration", async (t) => {
-  await withTmpDir(async (tmpDir: string) => {
-    setupEnvironmentAndStub(tmpDir);
-
-    const statusReport = await createStatusReportBase(
-      ActionName.StartProxy,
-      "success",
-      new Date("May 19, 2023 05:19:00"),
-      {
-        languages: ["go"],
-      },
-      { numAvailableBytes: 100, numTotalBytes: 500 },
-      getRunnerLogger(false),
-    );
-
-    if (t.truthy(statusReport)) {
-      t.is(statusReport.action_name, ActionName.StartProxy);
-      t.is(statusReport.status, "success");
-      t.is(statusReport.languages, "go");
-    }
-  });
-});
-
-test.serial("createStatusReportBase_firstParty", async (t) => {
-  await withTmpDir(async (tmpDir: string) => {
-    setupEnvironmentAndStub(tmpDir);
-
-    t.is(
-      (
-        await createStatusReportBase(
-          ActionName.UploadSarif,
-          "failure",
-          new Date("May 19, 2023 05:19:00"),
-          createTestConfig({}),
-          { numAvailableBytes: 100, numTotalBytes: 500 },
-          getRunnerLogger(false),
-          "failure cause",
-          "exception stack trace",
-        )
-      )?.first_party_analysis,
-      false,
-    );
-
-    t.is(
-      (
-        await createStatusReportBase(
-          ActionName.Autobuild,
-          "failure",
-          new Date("May 19, 2023 05:19:00"),
-          createTestConfig({}),
-          { numAvailableBytes: 100, numTotalBytes: 500 },
-          getRunnerLogger(false),
-          "failure cause",
-          "exception stack trace",
-        )
-      )?.first_party_analysis,
-      true,
-    );
-
-    process.env["CODEQL_ACTION_INIT_HAS_RUN"] = "foobar";
-    t.is(
-      (
-        await createStatusReportBase(
-          ActionName.UploadSarif,
-          "failure",
-          new Date("May 19, 2023 05:19:00"),
-          createTestConfig({}),
-          { numAvailableBytes: 100, numTotalBytes: 500 },
-          getRunnerLogger(false),
-          "failure cause",
-          "exception stack trace",
-        )
-      )?.first_party_analysis,
-      false,
-    );
-
-    t.is(
-      (
-        await createStatusReportBase(
-          ActionName.Init,
-          "failure",
-          new Date("May 19, 2023 05:19:00"),
-          createTestConfig({}),
-          { numAvailableBytes: 100, numTotalBytes: 500 },
-          getRunnerLogger(false),
-          "failure cause",
-          "exception stack trace",
-        )
-      )?.first_party_analysis,
-      true,
-    );
-
-    process.env["CODEQL_ACTION_INIT_HAS_RUN"] = "true";
-    t.is(
-      (
-        await createStatusReportBase(
-          ActionName.UploadSarif,
-          "failure",
-          new Date("May 19, 2023 05:19:00"),
-          createTestConfig({}),
-          { numAvailableBytes: 100, numTotalBytes: 500 },
-          getRunnerLogger(false),
-          "failure cause",
-          "exception stack trace",
-        )
-      )?.first_party_analysis,
-      true,
-    );
-
-    t.is(
-      (
-        await createStatusReportBase(
-          ActionName.Analyze,
-          "failure",
-          new Date("May 19, 2023 05:19:00"),
-          createTestConfig({}),
-          { numAvailableBytes: 100, numTotalBytes: 500 },
-          getRunnerLogger(false),
-          "failure cause",
-          "exception stack trace",
-        )
-      )?.first_party_analysis,
-      true,
-    );
-  });
-});
-
-test.serial(
-  "getActionStatus handling correctly various types of errors",
-  (t) => {
-    t.is(
-      getActionsStatus(new Error("arbitrary error")),
-      "failure",
-      "We categorise an arbitrary error as a failure",
-    );
-
-    t.is(
-      getActionsStatus(new ConfigurationError("arbitrary error")),
-      "user-error",
-      "We categorise a ConfigurationError as a user error",
-    );
-
-    t.is(
-      getActionsStatus(new Error("exit code 1"), "multiple things went wrong"),
-      "failure",
-      "getActionsStatus should return failure if passed an arbitrary error and an additional failure cause",
-    );
-
-    t.is(
-      getActionsStatus(
-        new ConfigurationError("exit code 1"),
-        "multiple things went wrong",
-      ),
-      "user-error",
-      "getActionsStatus should return user-error if passed a configuration error and an additional failure cause",
-    );
-
-    t.is(
-      getActionsStatus(),
-      "success",
-      "getActionsStatus should return success if no error is passed",
-    );
-
-    t.is(
-      getActionsStatus(new Object()),
-      "failure",
-      "getActionsStatus should return failure if passed an arbitrary object",
-    );
-
-    t.is(
-      getActionsStatus(null, "an error occurred"),
-      "failure",
-      "getActionsStatus should return failure if passed null and an additional failure cause",
-    );
-
-    t.is(
-      getActionsStatus(wrapError(new ConfigurationError("arbitrary error"))),
-      "user-error",
-      "We still recognise a wrapped ConfigurationError as a user error",
-    );
-  },
-);
-
-const testCreateInitWithConfigStatusReport = makeMacro({
-  exec: async (
-    t,
-    config: Config,
-    expectedReportProperties: Partial,
-  ) => {
-    await withTmpDir(async (tmpDir: string) => {
-      setupEnvironmentAndStub(tmpDir);
-
-      const statusReportBase = await createStatusReportBase(
-        ActionName.Init,
-        "failure",
-        new Date("May 19, 2023 05:19:00"),
-        config,
-        { numAvailableBytes: 100, numTotalBytes: 500 },
-        getRunnerLogger(false),
-        "failure cause",
-        "exception stack trace",
-      );
-
-      if (t.truthy(statusReportBase)) {
-        const initStatusReport: InitStatusReport = {
-          ...statusReportBase,
-          tools_input: "",
-          tools_resolved_version: "foo",
-          tools_source: ToolsSource.Unknown,
-          workflow_languages: "actions",
-        };
-
-        const initWithConfigStatusReport =
-          await createInitWithConfigStatusReport(
-            config,
-            initStatusReport,
-            undefined,
-            1024,
-            undefined,
-            undefined,
-          );
-
-        if (t.truthy(initWithConfigStatusReport)) {
-          t.like(initWithConfigStatusReport, expectedReportProperties);
-        }
-      }
-    });
-  },
-  title: (title) => `createInitWithConfigStatusReport: ${title}`,
-});
-
-testCreateInitWithConfigStatusReport.serial(
-  "returns a value",
-  createTestConfig({
-    buildMode: BuildMode.None,
-    languages: [BuiltInLanguage.java, BuiltInLanguage.swift],
-  }),
-  {
-    trap_cache_download_size_bytes: 1024,
-    registries: "[]",
-    query_filters: "[]",
-    packs: "{}",
-  },
-);
-
-testCreateInitWithConfigStatusReport.serial(
-  "includes packs for a single language",
-  createTestConfig({
-    buildMode: BuildMode.None,
-    languages: [BuiltInLanguage.java],
-    computedConfig: {
-      packs: ["foo", "bar"],
-    },
-  }),
-  {
-    registries: "[]",
-    query_filters: "[]",
-    packs: JSON.stringify({ java: ["foo", "bar"] }),
-  },
-);
-
-testCreateInitWithConfigStatusReport.serial(
-  "includes packs for multiple languages",
-  createTestConfig({
-    buildMode: BuildMode.None,
-    languages: [BuiltInLanguage.java, BuiltInLanguage.swift],
-    computedConfig: {
-      packs: { java: ["java-foo", "java-bar"], swift: ["swift-bar"] },
-    },
-  }),
-  {
-    registries: "[]",
-    query_filters: "[]",
-    packs: JSON.stringify({
-      java: ["java-foo", "java-bar"],
-      swift: ["swift-bar"],
-    }),
-  },
-);
diff --git a/src/status-report.ts b/src/status-report.ts
deleted file mode 100644
index e61b04f9dd..0000000000
--- a/src/status-report.ts
+++ /dev/null
@@ -1,736 +0,0 @@
-import * as os from "os";
-
-import * as core from "@actions/core";
-import * as uuid from "uuid";
-
-import type { ActionState } from "./action-common";
-import {
-  getWorkflowEventName,
-  getOptionalInput,
-  getWorkflowRunID,
-  getWorkflowRunAttempt,
-  getActionVersion,
-  getRequiredInput,
-  isSelfHostedRunner,
-} from "./actions-util";
-import { getAnalysisKey, getApiClient } from "./api-client";
-import { getCachedCodeQlVersion } from "./cli/output-cache";
-import type { Config } from "./config/action-config";
-import type { ComputedInput, InputName } from "./config/inputs";
-import { parseRegistriesWithoutCredentials } from "./config/pack-registries";
-import type { DependencyCacheRestoreStatusReport } from "./dependency-caching";
-import { DocUrl } from "./doc-url";
-import { EnvVar, getEnv, ReadOnlyEnv, RegistryProxyVars } from "./environment";
-import { getRef } from "./git-utils";
-import * as json from "./json";
-import type { Logger } from "./logging";
-import type { OverlayBaseDatabaseDownloadStats } from "./overlay/caching";
-import { getRepositoryNwo } from "./repository";
-import type { ToolsSource } from "./setup-codeql";
-import { registryBaseSchema } from "./start-proxy/types";
-import {
-  ConfigurationError,
-  getRequiredEnvParam,
-  isInTestMode,
-  GITHUB_DOTCOM_URL,
-  DiskUsage,
-  assertNever,
-  BuildMode,
-  getErrorMessage,
-  getTestingEnvironment,
-  asHTTPError,
-} from "./util";
-
-export enum ActionName {
-  Analyze = "finish",
-  Autobuild = "autobuild",
-  Init = "init",
-  InitPost = "init-post",
-  ResolveEnvironment = "resolve-environment",
-  SetupCodeQL = "setup-codeql",
-  StartProxy = "start-proxy",
-  UploadSarif = "upload-sarif",
-}
-
-/**
- * Maps an `ActionName` to its display name. Usually that is the same, except
- * for `ActionName.Analyze` where it is `"analyze"` instead of `"finish"`.
- */
-export function getDisplayActionName(actionName: ActionName): string {
-  if (actionName === ActionName.Analyze) {
-    return "analyze";
-  }
-  return actionName;
-}
-
-/**
- * Either creates a UUIDv4 for the analysis or retrieves an existing one from the
- * environment and returns it.
- * If a new UUID is generated, it is also exported as an environment variable.
- */
-export function getJobUUID(
-  action: ActionState<["Logger", "ReadOnlyEnv", "Actions"]>,
-) {
-  // Check if we already have a UUID for the analysis and return it if so.
-  const existingJobRunUuid = action.env.getOptional(EnvVar.JOB_RUN_UUID);
-
-  if (existingJobRunUuid !== undefined && uuid.validate(existingJobRunUuid)) {
-    action.logger.info(`Existing job run UUID is ${existingJobRunUuid}.`);
-    return existingJobRunUuid;
-  }
-
-  // Otherwise generate a new UUID.
-  const jobRunUuid = uuid.v4();
-  action.logger.info(`Job run UUID is ${jobRunUuid}.`);
-
-  action.actions.exportVariable(EnvVar.JOB_RUN_UUID, jobRunUuid);
-  return jobRunUuid;
-}
-
-/**
- * @returns a boolean indicating whether the analysis is considered to be first party.
- *
- * This is based on whether the init action has been used, which is only used for first party analysis.
- * When a SARIF file has been generated by other means and submitted using the upload action, this is
- * considered to be a third party analysis and is treated differently when calculating SLOs. To ensure
- * misconfigured workflows are not treated as third party, only the upload-sarif action can return false.
- */
-function isFirstPartyAnalysis(actionName: ActionName): boolean {
-  if (actionName !== ActionName.UploadSarif) {
-    return true;
-  }
-  return process.env[EnvVar.INIT_ACTION_HAS_RUN] === "true";
-}
-
-/**
- * @returns true if the analysis is considered to be third party.
- */
-export function isThirdPartyAnalysis(actionName: ActionName): boolean {
-  return !isFirstPartyAnalysis(actionName);
-}
-
-export type ActionStatus =
-  | "aborted" // Only used in the init Action, if init failed before initializing the tracer due to something other than a configuration error.
-  | "failure"
-  | "starting"
-  | "success"
-  | "user-error";
-
-/** Overall status of the entire job. String values match the Hydro schema. */
-export enum JobStatus {
-  UnknownStatus = "JOB_STATUS_UNKNOWN",
-  SuccessStatus = "JOB_STATUS_SUCCESS",
-  FailureStatus = "JOB_STATUS_FAILURE",
-  ConfigErrorStatus = "JOB_STATUS_CONFIGURATION_ERROR",
-}
-
-export interface StatusReportBase {
-  /** Name of the action being executed. */
-  action_name: ActionName;
-  /** Version of the action being executed, as a commit oid. */
-  action_oid: string;
-  /** Version of the action being executed, as a ref. */
-  action_ref?: string;
-  /** Time this action started. */
-  action_started_at: string;
-  /** Action version (x.y.z from package.json). */
-  action_version: string;
-  /** The name of the Actions event that triggered the workflow. */
-  actions_event_name?: string;
-  /** Comma-separated list of the kinds of analyses we are performing. */
-  analysis_kinds?: string;
-  /** Analysis key, normally composed from the workflow path and job name. */
-  analysis_key: string;
-  /** Build mode, if specified. */
-  build_mode?: BuildMode;
-  /** Cause of the failure (or undefined if status is not failure). */
-  cause?: string;
-  /** CodeQL CLI version (x.y.z from the CLI). */
-  codeql_version?: string;
-  /** Commit oid that the workflow was triggered on. */
-  commit_oid: string;
-  /** Time this action completed, or undefined if not yet completed. */
-  completed_at?: string;
-  /** A mapping of input names to their computed values. */
-  computed_inputs: Partial>;
-  /** Stack trace of the failure (or undefined if status is not failure). */
-  exception?: string;
-  /** Whether this is a first-party (CodeQL) run of the action. */
-  first_party_analysis: boolean;
-  /** Job name from the workflow. */
-  job_name: string;
-  /**
-   * UUID representing the job run that this status report belongs to. We
-   * generate our own UUID here because Actions currently does not expose a
-   * unique job run identifier. This UUID will allow us to more easily match
-   * reports from different steps in the same workflow job.
-   *
-   * If and when Actions does expose a unique job ID, we plan to populate a
-   * separate int field, `job_run_id`, with the Actions-generated identifier,
-   * as it will allow us to more easily join our telemetry data with Actions
-   * telemetry tables.
-   */
-  job_run_uuid: string;
-  /**
-   * Comma-separated list of languages that analysis was run for.
-   *
-   * This may be from the workflow file or may be calculated from the contents of the repository.
-   */
-  languages?: string;
-  /** Value of the matrix for this instantiation of the job. */
-  matrix_vars?: string;
-  /**
-   * Information about the enablement of the ML-powered JS query pack.
-   *
-   * @see {@link util.getMlPoweredJsQueriesStatus}
-   */
-  ml_powered_javascript_queries?: string;
-  /** Ref that the workflow was triggered on. */
-  ref: string;
-  /**
-   * A comma-separated list of private registry types which are configured for CodeQL.
-   * This only includes registry types we support (as determined by the `start-proxy` action),
-   * not all that are configured.
-   */
-  registry_types?: string;
-  /** Action runner hardware architecture (context runner.arch). */
-  runner_arch?: string;
-  /** Available disk space on the runner, in bytes. */
-  runner_available_disk_space_bytes?: number;
-  /**
-   * Version of the runner image, for workflows running on GitHub-hosted runners. Absent otherwise.
-   */
-  runner_image_version?: string;
-  /** Action runner operating system (context runner.os). */
-  runner_os: string;
-  /** Action runner operating system release (x.y.z from os.release()). */
-  runner_os_release?: string;
-  /** Total disk space on the runner, in bytes. */
-  runner_total_disk_space_bytes?: number;
-  /** Time the first action started. Normally the init action. */
-  started_at: string;
-  /** State this action is currently in. */
-  status: ActionStatus;
-  /** Whether this run is part of a steady-state, and not new, default setup run. */
-  steady_state_default_setup: boolean;
-  /**
-   * Testing environment: Set if non-production environment.
-   * The server accepts one of the following values:
-   *  `["", "qa-rc", "qa-rc-1", "qa-rc-2", "qa-experiment-1", "qa-experiment-2", "qa-experiment-3"]`.
-   */
-  testing_environment: string;
-  /** Workflow name. Converted to analysis_name further down the pipeline.. */
-  workflow_name: string;
-  /** Attempt number of the run containing the action run. */
-  workflow_run_attempt: number;
-  /** ID of the workflow run containing the action run. */
-  workflow_run_id: number;
-}
-
-export interface DatabaseCreationTimings {
-  scanned_language_extraction_duration_ms?: number;
-  trap_import_duration_ms?: number;
-}
-
-export function getActionsStatus(
-  error?: unknown,
-  otherFailureCause?: string,
-): ActionStatus {
-  if (error || otherFailureCause) {
-    return error instanceof ConfigurationError ? "user-error" : "failure";
-  } else {
-    return "success";
-  }
-}
-
-export function getJobStatusDisplayName(status: JobStatus): string {
-  switch (status) {
-    case JobStatus.SuccessStatus:
-      return "success";
-    case JobStatus.FailureStatus:
-      return "failure";
-    case JobStatus.ConfigErrorStatus:
-      return "configuration error";
-    case JobStatus.UnknownStatus:
-      return "unknown";
-    default:
-      assertNever(status);
-  }
-}
-
-/**
- * Sets the overall job status environment variable to configuration error
- * or failure, unless it's already been set to one of these values in a
- * previous step.
- */
-function setJobStatusIfUnsuccessful(actionStatus: ActionStatus) {
-  if (actionStatus === "user-error") {
-    core.exportVariable(
-      EnvVar.JOB_STATUS,
-      process.env[EnvVar.JOB_STATUS] ?? JobStatus.ConfigErrorStatus,
-    );
-  } else if (actionStatus === "failure" || actionStatus === "aborted") {
-    core.exportVariable(
-      EnvVar.JOB_STATUS,
-      process.env[EnvVar.JOB_STATUS] ?? JobStatus.FailureStatus,
-    );
-  }
-}
-
-// Any status report may include an array of EventReports associated with it.
-export interface EventReport {
-  /** Time this event ended. */
-  completed_at: string;
-  /** An enumerable description of the event. */
-  event: string;
-  /** eg: `success`, `failure`, `timeout`, etc. */
-  exit_status?: string;
-  /** If the event is language-specific. */
-  language?: string;
-  /**
-   * A generic JSON blob of data related to this event.
-   * Use Object.assign() to append additional fields to the object.
-   */
-  properties?: object;
-  /** Time this event started. */
-  started_at: string;
-}
-
-/**
- * Attempts to retrieve a list of private registry types from the `CODEQL_PROXY_URLS` environment
- * variable and returns it as a comma-separated string if successful. Returns `undefined` otherwise.
- */
-export function getRegistryTypesFromEnv(
-  logger: Logger,
-  env: ReadOnlyEnv = getEnv(),
-): string | undefined {
-  // Try to get the value of the environment variable.
-  const value = env.getOptional(RegistryProxyVars.PROXY_URLS);
-
-  if (value === undefined) {
-    return undefined;
-  }
-
-  // Try to parse the JSON we expect to find in it and return the comma-separated list of
-  // (unique) registry types.
-  try {
-    const data = JSON.parse(value) as unknown;
-
-    // Check that the parsed JSON meets our expectations.
-    if (!json.isArray(data)) {
-      logger.debug(
-        `Expected '${RegistryProxyVars.PROXY_URLS}' to contain a JSON array, but got '${typeof data}'.`,
-      );
-      return undefined;
-    }
-    if (!json.validateArray(registryBaseSchema, data)) {
-      logger.debug(
-        `Expected '${RegistryProxyVars.PROXY_URLS}' to contain a JSON array of registry objects, but got something else.`,
-      );
-      return undefined;
-    }
-
-    const types = new Set(data.map((r) => r.type));
-    return Array.from(types).sort().join(",");
-  } catch (err) {
-    logger.debug(
-      `Failed to parse '${RegistryProxyVars.PROXY_URLS}': ${getErrorMessage(err)}.`,
-    );
-    return undefined;
-  }
-}
-
-/**
- * Compose a StatusReport.
- *
- * @param actionName The name of the action, e.g. 'init', 'finish', 'upload-sarif'
- * @param status The status. Must be 'success', 'failure', or 'starting'
- * @param actionStartedAt The time this action started executing.
- * @param cause  Cause of failure (only supply if status is 'failure')
- * @param exception Exception (only supply if status is 'failure')
- * @returns undefined if an exception was thrown.
- */
-export async function createStatusReportBase(
-  actionName: ActionName,
-  status: ActionStatus,
-  actionStartedAt: Date,
-  config: Partial | undefined,
-  diskInfo: DiskUsage | undefined,
-  logger: Logger,
-  cause?: string,
-  exception?: string,
-): Promise {
-  try {
-    const commitOid =
-      getOptionalInput("sha") || process.env["GITHUB_SHA"] || "";
-    const ref = await getRef();
-    const jobRunUUID = process.env[EnvVar.JOB_RUN_UUID] || "";
-    const workflowRunID = getWorkflowRunID();
-    const workflowRunAttempt = getWorkflowRunAttempt();
-    const workflowName = process.env["GITHUB_WORKFLOW"] || "";
-    const jobName = process.env["GITHUB_JOB"] || "";
-    const analysis_key = await getAnalysisKey();
-    let workflowStartedAt = process.env[EnvVar.WORKFLOW_STARTED_AT];
-    if (workflowStartedAt === undefined) {
-      workflowStartedAt = actionStartedAt.toISOString();
-      core.exportVariable(EnvVar.WORKFLOW_STARTED_AT, workflowStartedAt);
-    }
-    const runnerOs = getRequiredEnvParam("RUNNER_OS");
-    const codeQlCliVersion = getCachedCodeQlVersion(logger, getEnv());
-    const actionRef = process.env["GITHUB_ACTION_REF"] || "";
-    const testingEnvironment = getTestingEnvironment();
-    // re-export the testing environment variable so that it is available to subsequent steps,
-    // even if it was only set for this step
-    if (testingEnvironment) {
-      core.exportVariable(EnvVar.TESTING_ENVIRONMENT, testingEnvironment);
-    }
-    const isSteadyStateDefaultSetupRun =
-      process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true";
-
-    const statusReport: StatusReportBase = {
-      action_name: actionName,
-      action_oid: "unknown", // TODO decide if it's possible to fill this in
-      action_ref: actionRef,
-      action_started_at: actionStartedAt.toISOString(),
-      action_version: getActionVersion(),
-      analysis_kinds: config?.analysisKinds?.join(","),
-      analysis_key,
-      build_mode: config?.buildMode,
-      commit_oid: commitOid,
-      computed_inputs: {},
-      first_party_analysis: isFirstPartyAnalysis(actionName),
-      job_name: jobName,
-      job_run_uuid: jobRunUUID,
-      ref,
-      registry_types: getRegistryTypesFromEnv(logger),
-      runner_os: runnerOs,
-      started_at: workflowStartedAt,
-      status,
-      steady_state_default_setup: isSteadyStateDefaultSetupRun,
-      testing_environment: testingEnvironment || "",
-      workflow_name: workflowName,
-      workflow_run_attempt: workflowRunAttempt,
-      workflow_run_id: workflowRunID,
-    };
-
-    try {
-      statusReport.actions_event_name = getWorkflowEventName();
-    } catch (e) {
-      logger.warning(
-        `Could not determine the workflow event name: ${getErrorMessage(e)}.`,
-      );
-    }
-
-    if (config) {
-      statusReport.languages = config.languages?.join(",");
-    }
-
-    if (diskInfo) {
-      statusReport.runner_available_disk_space_bytes =
-        diskInfo.numAvailableBytes;
-      statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes;
-    }
-
-    // Add optional parameters
-    if (cause) {
-      statusReport.cause = cause;
-    }
-    if (exception) {
-      statusReport.exception = exception;
-    }
-    if (
-      status === "success" ||
-      status === "failure" ||
-      status === "aborted" ||
-      status === "user-error"
-    ) {
-      statusReport.completed_at = new Date().toISOString();
-    }
-    const matrix = getRequiredInput("matrix");
-    if (matrix) {
-      statusReport.matrix_vars = matrix;
-    }
-    if ("RUNNER_ARCH" in process.env) {
-      // Values other than X86, X64, ARM, or ARM64 are discarded server side
-      statusReport.runner_arch = process.env["RUNNER_ARCH"];
-    }
-    if (!(runnerOs === "Linux" && isSelfHostedRunner())) {
-      // We do not report the release number for Linux self-hosted runners
-      // because the custom build suffix may be private customer information.
-      statusReport.runner_os_release = os.release();
-    }
-    if (codeQlCliVersion !== undefined) {
-      statusReport.codeql_version = codeQlCliVersion.version;
-    }
-    const imageVersion = process.env["ImageVersion"];
-    if (imageVersion) {
-      statusReport.runner_image_version = imageVersion;
-    }
-
-    return statusReport;
-  } catch (e) {
-    logger.warning(
-      `Failed to gather information for telemetry: ${getErrorMessage(e)}. Will skip sending status report.`,
-    );
-
-    // Re-throw the exception in test mode. While testing, we want to know if something goes wrong here.
-    if (isInTestMode()) {
-      throw e;
-    }
-
-    return undefined;
-  }
-}
-
-const OUT_OF_DATE_MSG =
-  "CodeQL Action is out-of-date. Please upgrade to the latest version of `codeql-action`.";
-const INCOMPATIBLE_MSG =
-  "CodeQL Action version is incompatible with the API endpoint. Please update to a compatible version of `codeql-action`.";
-
-/**
- * Send a status report to the code_scanning/analysis/status endpoint.
- *
- * Optionally checks the response from the API endpoint and sets the action
- * as failed if the status report failed. This is only expected to be used
- * when sending a 'starting' report.
- *
- * The `/code-scanning/analysis/status` endpoint is internal and it is not critical that it succeeds:
- * https://github.com/github/codeql/issues/15462#issuecomment-1919186317
- *
- * Failures while calling this endpoint are logged as warings.
- */
-export async function sendStatusReport(
-  statusReport: S,
-): Promise {
-  setJobStatusIfUnsuccessful(statusReport.status);
-
-  const statusReportJSON = JSON.stringify(statusReport);
-  core.debug(`Sending status report: ${statusReportJSON}`);
-  // If in test mode we don't want to upload the results
-  if (isInTestMode()) {
-    core.debug("In test mode. Status reports are not uploaded.");
-    return;
-  }
-
-  const nwo = getRepositoryNwo();
-  const client = getApiClient();
-
-  try {
-    await client.request(
-      "PUT /repos/:owner/:repo/code-scanning/analysis/status",
-      {
-        owner: nwo.owner,
-        repo: nwo.repo,
-        data: statusReportJSON,
-      },
-    );
-  } catch (e) {
-    const httpError = asHTTPError(e);
-    if (httpError !== undefined) {
-      switch (httpError.status) {
-        case 403:
-          if (
-            getWorkflowEventName() === "push" &&
-            process.env["GITHUB_ACTOR"] === "dependabot[bot]"
-          ) {
-            core.warning(
-              'Workflows triggered by Dependabot on the "push" event run with read-only access. ' +
-                "Uploading CodeQL results requires write access. " +
-                'To use CodeQL with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. ' +
-                `See ${DocUrl.SCANNING_ON_PUSH} for more information on how to configure these events.`,
-            );
-          } else {
-            core.warning(
-              "This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. " +
-                "This could be because the Action is running on a pull request from a fork. If not, " +
-                `please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}`,
-            );
-          }
-          return;
-        case 404:
-          core.warning(httpError.message);
-          return;
-        case 422:
-          // schema incompatibility when reporting status
-          // this means that this action version is no longer compatible with the API
-          // we still want to continue as it is likely the analysis endpoint will work
-          if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) {
-            core.debug(INCOMPATIBLE_MSG);
-          } else {
-            core.debug(OUT_OF_DATE_MSG);
-          }
-          return;
-      }
-    }
-
-    // something else has gone wrong and the request/response will be logged by octokit
-    // it's possible this is a transient error and we should continue scanning
-    core.warning(
-      `An unexpected error occurred when sending a status report: ${getErrorMessage(
-        e,
-      )}`,
-    );
-  }
-}
-
-/** Fields of the init status report that can be sent before `config` is populated. */
-export interface InitStatusReport extends StatusReportBase {
-  /** Value given by the user as the "tools" input. */
-  tools_input: string;
-  /** Version of the bundle used. */
-  tools_resolved_version: string;
-  /** Where the bundle originated from. */
-  tools_source: ToolsSource;
-  /** Comma-separated list of languages specified explicitly in the workflow file. */
-  workflow_languages: string;
-}
-
-/** Fields of the init status report that are populated using values from `config`. */
-export interface InitWithConfigStatusReport extends InitStatusReport {
-  /** Comma-separated list of languages where the default queries are disabled. */
-  disable_default_queries: string;
-  /** Comma-separated list of paths, from the 'paths' config field. */
-  paths: string;
-  /** Comma-separated list of paths, from the 'paths-ignore' config field. */
-  paths_ignore: string;
-  /** Comma-separated list of queries sources, from the 'queries' config field or workflow input. */
-  queries: string;
-  /** Stringified JSON object of packs, from the 'packs' config field or workflow input. */
-  packs: string;
-  /** Comma-separated list of languages for which we are using TRAP caching. */
-  trap_cache_languages: string;
-  /** Size of TRAP caches that we downloaded, in bytes. */
-  trap_cache_download_size_bytes: number;
-  /** Time taken to download TRAP caches, in milliseconds. */
-  trap_cache_download_duration_ms: number;
-  /** Size of the overlay-base database that we downloaded, in bytes. */
-  overlay_base_database_download_size_bytes?: number;
-  /** Time taken to download the overlay-base database, in milliseconds. */
-  overlay_base_database_download_duration_ms?: number;
-  /** Stringified JSON object representing information about the results of restoring dependency caches. */
-  dependency_caching_restore_results?: DependencyCacheRestoreStatusReport;
-  /** Stringified JSON array of registry configuration objects, from the 'registries' config field
-  or workflow input. **/
-  registries: string;
-  /** Stringified JSON object representing a query-filters, from the 'query-filters' config field. **/
-  query_filters: string;
-  /** Path to the specified code scanning config file, from the 'config-file' config field. */
-  config_file: string;
-}
-
-/** Fields of the init status report populated when the tools source is `download`. */
-export interface InitToolsDownloadFields {
-  /** Time taken to download the bundle, in milliseconds. */
-  tools_download_duration_ms?: number;
-  /**
-   * Whether the relevant tools dotcom feature flags have been misconfigured.
-   * Only populated if we attempt to determine the default version based on the dotcom feature flags. */
-  tools_feature_flags_valid?: boolean;
-}
-
-/**
- * Composes a `InitWithConfigStatusReport` from the given values.
- *
- * @param config The CodeQL Action configuration whose values should be added to the base status report.
- * @param initStatusReport The base status report.
- * @param configFile Optionally, the filename of the configuration file that was read.
- * @param totalCacheSize The computed total TRAP cache size.
- * @param overlayBaseDatabaseStats Statistics about the overlay database, if any.
- * @returns
- */
-export async function createInitWithConfigStatusReport(
-  config: Config,
-  initStatusReport: InitStatusReport,
-  configFile: string | undefined,
-  totalCacheSize: number,
-  overlayBaseDatabaseStats: OverlayBaseDatabaseDownloadStats | undefined,
-  dependencyCachingResults: DependencyCacheRestoreStatusReport | undefined,
-): Promise {
-  const languages = config.languages.join(",");
-  const paths = (config.originalUserInput.paths || []).join(",");
-  const pathsIgnore = (config.originalUserInput["paths-ignore"] || []).join(
-    ",",
-  );
-  const disableDefaultQueries = config.originalUserInput[
-    "disable-default-queries"
-  ]
-    ? languages
-    : "";
-
-  const queries: string[] = [];
-  let queriesInput = getOptionalInput("queries")?.trim();
-  if (queriesInput === undefined || queriesInput.startsWith("+")) {
-    queries.push(
-      ...(config.originalUserInput.queries || []).map((q) => q.uses),
-    );
-  }
-  if (queriesInput !== undefined) {
-    queriesInput = queriesInput.startsWith("+")
-      ? queriesInput.slice(1)
-      : queriesInput;
-    queries.push(...queriesInput.split(","));
-  }
-
-  let packs: Record = {};
-  if (Array.isArray(config.computedConfig.packs)) {
-    packs[config.languages[0]] = config.computedConfig.packs;
-  } else if (config.computedConfig.packs !== undefined) {
-    packs = config.computedConfig.packs;
-  }
-
-  return {
-    ...initStatusReport,
-    config_file: configFile ?? "",
-    disable_default_queries: disableDefaultQueries,
-    paths,
-    paths_ignore: pathsIgnore,
-    queries: queries.join(","),
-    packs: JSON.stringify(packs),
-    trap_cache_languages: Object.keys(config.trapCaches).join(","),
-    trap_cache_download_size_bytes: totalCacheSize,
-    trap_cache_download_duration_ms: Math.round(config.trapCacheDownloadTime),
-    overlay_base_database_download_size_bytes:
-      overlayBaseDatabaseStats?.databaseSizeBytes,
-    overlay_base_database_download_duration_ms:
-      overlayBaseDatabaseStats?.databaseDownloadDurationMs,
-    dependency_caching_restore_results: dependencyCachingResults,
-    query_filters: JSON.stringify(
-      config.originalUserInput["query-filters"] ?? [],
-    ),
-    registries: JSON.stringify(
-      parseRegistriesWithoutCredentials(getOptionalInput("registries")) ?? [],
-    ),
-  };
-}
-
-export async function sendUnhandledErrorStatusReport(
-  actionName: ActionName,
-  actionStartedAt: Date,
-  error: unknown,
-  logger: Logger,
-): Promise {
-  try {
-    // In the future, we may want to add a specific field for unhandled errors so we can
-    // create a dedicated monitor for them.
-    const statusReport = await createStatusReportBase(
-      actionName,
-      "failure",
-      actionStartedAt,
-      undefined,
-      undefined,
-      logger,
-      `Unhandled CodeQL Action error: ${getErrorMessage(error)}`,
-      error instanceof Error ? error.stack : undefined,
-    );
-    if (statusReport !== undefined) {
-      await sendStatusReport(statusReport);
-    }
-  } catch (e) {
-    logger.warning(
-      `Failed to send the unhandled error status report: ${getErrorMessage(e)}.`,
-    );
-    if (isInTestMode()) {
-      throw e;
-    }
-  }
-}
diff --git a/src/tar.test.ts b/src/tar.test.ts
deleted file mode 100644
index 48f4e866d3..0000000000
--- a/src/tar.test.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import * as path from "path";
-import * as stream from "stream";
-
-import test from "ava";
-
-import { getRunnerLogger } from "./logging";
-import { extractTarZst } from "./tar";
-import { setupTests } from "./testing-utils";
-import { withTmpDir } from "./util";
-
-setupTests(test);
-
-test("extractTarZst rejects if the input stream errors", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const archive = new stream.PassThrough();
-    const promise = extractTarZst(
-      archive,
-      path.join(tmpDir, "dest"),
-      { type: "gnu", version: "1.34" },
-      getRunnerLogger(true),
-    );
-
-    archive.destroy(
-      Object.assign(new Error("socket hang up"), {
-        code: "ECONNRESET",
-      }),
-    );
-
-    await t.throwsAsync(promise, {
-      message: /Error while downloading and extracting tar/,
-    });
-  });
-});
diff --git a/src/tar.ts b/src/tar.ts
deleted file mode 100644
index 3a0d79cc64..0000000000
--- a/src/tar.ts
+++ /dev/null
@@ -1,244 +0,0 @@
-import { spawn } from "child_process";
-import * as fs from "fs";
-import * as stream from "stream";
-
-import { ToolRunner } from "@actions/exec/lib/toolrunner";
-import * as io from "@actions/io";
-import * as toolcache from "@actions/tool-cache";
-import * as semver from "semver";
-
-import { CommandInvocationError } from "./actions-util";
-import { Logger } from "./logging";
-import { assertNever, cleanUpPath, isBinaryAccessible } from "./util";
-
-const MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3";
-const MIN_REQUIRED_GNU_TAR_VERSION = "1.31";
-
-export type TarVersion = {
-  type: "gnu" | "bsd";
-  version: string;
-};
-
-async function getTarVersion(): Promise {
-  const tar = await io.which("tar", true);
-  let stdout = "";
-  const exitCode = await new ToolRunner(tar, ["--version"], {
-    listeners: {
-      stdout: (data: Buffer) => {
-        stdout += data.toString();
-      },
-    },
-  }).exec();
-  if (exitCode !== 0) {
-    throw new Error("Failed to call tar --version");
-  }
-  // Return whether this is GNU tar or BSD tar, and the version number
-  if (stdout.includes("GNU tar")) {
-    const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/);
-    if (!match?.[1]) {
-      throw new Error("Failed to parse output of tar --version.");
-    }
-
-    return { type: "gnu", version: match[1] };
-  } else if (stdout.includes("bsdtar")) {
-    const match = stdout.match(/bsdtar ([0-9.]+)/);
-    if (!match?.[1]) {
-      throw new Error("Failed to parse output of tar --version.");
-    }
-
-    return { type: "bsd", version: match[1] };
-  } else {
-    throw new Error("Unknown tar version");
-  }
-}
-
-export interface ZstdAvailability {
-  available: boolean;
-  foundZstdBinary: boolean;
-  version?: TarVersion;
-}
-
-export async function isZstdAvailable(
-  logger: Logger,
-): Promise {
-  const foundZstdBinary = await isBinaryAccessible("zstd", logger);
-  try {
-    const tarVersion = await getTarVersion();
-    const { type, version } = tarVersion;
-    logger.info(`Found ${type} tar version ${version}.`);
-    switch (type) {
-      case "gnu":
-        return {
-          available:
-            foundZstdBinary &&
-            // GNU tar only uses major and minor version numbers
-            semver.gte(
-              semver.coerce(version)!,
-              semver.coerce(MIN_REQUIRED_GNU_TAR_VERSION)!,
-            ),
-          foundZstdBinary,
-          version: tarVersion,
-        };
-      case "bsd":
-        return {
-          available:
-            foundZstdBinary &&
-            // Do a loose comparison since these version numbers don't contain
-            // a patch version number.
-            semver.gte(version, MIN_REQUIRED_BSD_TAR_VERSION),
-          foundZstdBinary,
-          version: tarVersion,
-        };
-      default:
-        assertNever(type);
-    }
-  } catch (e) {
-    logger.warning(
-      "Failed to determine tar version, therefore will assume zstd is not available. " +
-        `The underlying error was: ${e}`,
-    );
-    return { available: false, foundZstdBinary };
-  }
-}
-
-export type CompressionMethod = "gzip" | "zstd";
-
-export async function extract(
-  tarPath: string,
-  dest: string,
-  compressionMethod: CompressionMethod,
-  tarVersion: TarVersion | undefined,
-  logger: Logger,
-): Promise {
-  // Ensure destination exists
-  fs.mkdirSync(dest, { recursive: true });
-
-  switch (compressionMethod) {
-    case "gzip":
-      // Defensively continue to call the toolcache API as requesting a gzipped
-      // bundle may be a fallback option.
-      return await toolcache.extractTar(tarPath, dest);
-    case "zstd": {
-      if (!tarVersion) {
-        throw new Error(
-          "Could not determine tar version, which is required to extract a Zstandard archive.",
-        );
-      }
-      await extractTarZst(tarPath, dest, tarVersion, logger);
-      return dest;
-    }
-  }
-}
-
-/**
- * Extract a compressed tar archive
- *
- * @param tar   tar stream, or path to the tar
- * @param dest     destination directory
- */
-export async function extractTarZst(
-  tar: stream.Readable | string,
-  dest: string,
-  tarVersion: TarVersion,
-  logger: Logger,
-): Promise {
-  logger.debug(
-    `Extracting to ${dest}.${
-      tar instanceof stream.Readable
-        ? ` Input stream has high water mark ${tar.readableHighWaterMark}.`
-        : ""
-    }`,
-  );
-
-  try {
-    // Initialize args
-    //
-    // `--ignore-zeros` means that trailing zero bytes at the end of an archive will be read
-    // by `tar` in case a further concatenated archive follows. Otherwise when a tarball built
-    // by GNU tar, which writes many trailing zeroes, is read by BSD tar, which expects less, then
-    // BSD tar can hang up the pipe to its filter program early, and if that program is `zstd`
-    // then it will try to write the remaining zeroes, get an EPIPE error because `tar` has closed
-    // its end of the pipe, return 1, and `tar` will pass the error along.
-    //
-    // See also https://github.com/facebook/zstd/issues/4294
-    const args = ["-x", "--zstd", "--ignore-zeros"];
-
-    if (tarVersion.type === "gnu") {
-      // Suppress warnings when using GNU tar to extract archives created by BSD tar
-      args.push("--warning=no-unknown-keyword");
-      args.push("--overwrite");
-    }
-
-    args.push("-f", tar instanceof stream.Readable ? "-" : tar, "-C", dest);
-
-    process.stdout.write(`[command]tar ${args.join(" ")}\n`);
-
-    await new Promise((resolve, reject) => {
-      const tarProcess = spawn("tar", args, { stdio: "pipe" });
-
-      let stdout = "";
-      tarProcess.stdout?.on("data", (data: Buffer) => {
-        stdout += data.toString();
-        process.stdout.write(data);
-      });
-
-      let stderr = "";
-      tarProcess.stderr?.on("data", (data: Buffer) => {
-        stderr += data.toString();
-        // Mimic the standard behavior of the toolrunner by writing stderr to stdout
-        process.stdout.write(data);
-      });
-
-      tarProcess.on("error", (err) => {
-        reject(new Error(`Error while extracting tar: ${err}`));
-      });
-
-      if (tar instanceof stream.Readable) {
-        // Use `pipeline` rather than `pipe` so that an error on either stream is reported here
-        // rather than being emitted as an unhandled `error` event, and so that `tar`'s standard
-        // input is closed if the download fails partway through.
-        stream.pipeline(tar, tarProcess.stdin, (err) => {
-          if (err) {
-            reject(
-              new Error(`Error while downloading and extracting tar: ${err}`),
-            );
-          }
-        });
-      }
-
-      tarProcess.on("exit", (code) => {
-        if (code !== 0) {
-          reject(
-            new CommandInvocationError(
-              "tar",
-              args,
-              code ?? undefined,
-              stdout,
-              stderr,
-            ),
-          );
-        }
-        resolve();
-      });
-    });
-  } catch (e) {
-    await cleanUpPath(dest, "extraction destination directory", logger);
-    throw e;
-  }
-}
-
-const KNOWN_EXTENSIONS: Record = {
-  "tar.gz": "gzip",
-  "tar.zst": "zstd",
-};
-
-export function inferCompressionMethod(
-  tarPath: string,
-): CompressionMethod | undefined {
-  for (const [ext, method] of Object.entries(KNOWN_EXTENSIONS)) {
-    if (tarPath.endsWith(`.${ext}`)) {
-      return method;
-    }
-  }
-  return undefined;
-}
diff --git a/src/testdata/codeql-bundle-pinned.tar.gz b/src/testdata/codeql-bundle-pinned.tar.gz
deleted file mode 100644
index 80745d53bd..0000000000
Binary files a/src/testdata/codeql-bundle-pinned.tar.gz and /dev/null differ
diff --git a/src/testdata/codeql-bundle-pinned.tar.zst b/src/testdata/codeql-bundle-pinned.tar.zst
deleted file mode 100644
index 38a07421cf..0000000000
Binary files a/src/testdata/codeql-bundle-pinned.tar.zst and /dev/null differ
diff --git a/src/testdata/codeql-bundle.tar.gz b/src/testdata/codeql-bundle.tar.gz
deleted file mode 100644
index 311ee5faee..0000000000
Binary files a/src/testdata/codeql-bundle.tar.gz and /dev/null differ
diff --git a/src/testdata/codeql-bundle.tar.zst b/src/testdata/codeql-bundle.tar.zst
deleted file mode 100644
index b2a65c7314..0000000000
Binary files a/src/testdata/codeql-bundle.tar.zst and /dev/null differ
diff --git a/src/testdata/debug-artifacts-with-fake-token.zip b/src/testdata/debug-artifacts-with-fake-token.zip
deleted file mode 100644
index 5a121691af..0000000000
Binary files a/src/testdata/debug-artifacts-with-fake-token.zip and /dev/null differ
diff --git a/src/testdata/empty-sarif.sarif b/src/testdata/empty-sarif.sarif
deleted file mode 100644
index 0a7961f16f..0000000000
--- a/src/testdata/empty-sarif.sarif
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "version": "2.1.0",
-  "runs": [
-    {
-      "tool": {
-        "driver": {
-          "name": "LGTM.com",
-          "organization": "Semmle",
-          "version": "1.24.0-SNAPSHOT",
-          "rules": []
-        }
-      },
-      "results": [],
-      "columnKind": "utf16CodeUnits",
-      "properties": {
-        "semmle.formatSpecifier": "2.1.0",
-        "semmle.sourceLanguage": "java"
-      }
-    }
-  ]
-}
diff --git a/src/testdata/fingerprinting.expected.sarif b/src/testdata/fingerprinting.expected.sarif
deleted file mode 100644
index b4858d9ae5..0000000000
--- a/src/testdata/fingerprinting.expected.sarif
+++ /dev/null
@@ -1,92 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "version": "2.1.0",
-  "runs": [
-    {
-      "tool": {
-        "driver": {
-          "name": "CodeQL command-line toolchain",
-          "organization": "GitHub",
-          "semanticVersion": "2.0.0",
-          "rules": []
-        }
-      },
-      "artifacts": [
-        {
-          "location": {
-            "uri": "testFile1.js",
-            "uriBaseId": "%SRCROOT%",
-            "index": 0
-          }
-        },
-        {
-          "location": {
-            "uri": "testFile2.js",
-            "uriBaseId": "%SRCROOT%",
-            "index": 1
-          }
-        }
-      ],
-      "results": [
-        {
-          "ruleId": "js/unused-local-variable",
-          "ruleIndex": 0,
-          "message": {
-            "text": "Unused variable a."
-          },
-          "locations": [
-            {
-              "physicalLocation": {
-                "artifactLocation": {
-                  "uri": "testFile1.js",
-                  "uriBaseId": "%SRCROOT%",
-                  "index": 0
-                },
-                "region": {
-                  "startLine": 1,
-                  "startColumn": 1,
-                  "endColumn": 10
-                }
-              }
-            }
-          ],
-          "partialFingerprints": {
-            "primaryLocationLineHash": "5e4d5a9cf1294ad9:1"
-          }
-        },
-        {
-          "ruleId": "js/unused-local-variable",
-          "ruleIndex": 0,
-          "message": {
-            "text": "Unused variable bar."
-          },
-          "locations": [
-            {
-              "physicalLocation": {
-                "artifactLocation": {
-                  "index": 1
-                },
-                "region": {
-                  "startLine": 2
-                }
-              }
-            }
-          ],
-          "partialFingerprints": {
-            "primaryLocationLineHash": "f7592a95a9381ac0:1"
-          }
-        }
-      ],
-      "newlineSequences": [
-        "\r\n",
-        "\n",
-        "
",
-        "
"
-      ],
-      "columnKind": "utf16CodeUnits",
-      "properties": {
-        "semmle.formatSpecifier": "sarif-latest"
-      }
-    }
-  ]
-}
\ No newline at end of file
diff --git a/src/testdata/fingerprinting.input.sarif b/src/testdata/fingerprinting.input.sarif
deleted file mode 100644
index c9d5de32f8..0000000000
--- a/src/testdata/fingerprinting.input.sarif
+++ /dev/null
@@ -1,86 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "version": "2.1.0",
-  "runs": [
-    {
-      "tool": {
-        "driver": {
-          "name": "CodeQL command-line toolchain",
-          "organization": "GitHub",
-          "semanticVersion": "2.0.0",
-          "rules": []
-        }
-      },
-      "artifacts": [
-        {
-          "location": {
-            "uri": "testFile1.js",
-            "uriBaseId": "%SRCROOT%",
-            "index": 0
-          }
-        },
-        {
-          "location": {
-            "uri": "testFile2.js",
-            "uriBaseId": "%SRCROOT%",
-            "index": 1
-          }
-        }
-      ],
-      "results": [
-        {
-          "ruleId": "js/unused-local-variable",
-          "ruleIndex": 0,
-          "message": {
-            "text": "Unused variable a."
-          },
-          "locations": [
-            {
-              "physicalLocation": {
-                "artifactLocation": {
-                  "uri": "testFile1.js",
-                  "uriBaseId": "%SRCROOT%",
-                  "index": 0
-                },
-                "region": {
-                  "startLine": 1,
-                  "startColumn": 1,
-                  "endColumn": 10
-                }
-              }
-            }
-          ]
-        },
-        {
-          "ruleId": "js/unused-local-variable",
-          "ruleIndex": 0,
-          "message": {
-            "text": "Unused variable bar."
-          },
-          "locations": [
-            {
-              "physicalLocation": {
-                "artifactLocation": {
-                  "index": 1
-                },
-                "region": {
-                  "startLine": 2
-                }
-              }
-            }
-          ]
-        }
-      ],
-      "newlineSequences": [
-        "\r\n",
-        "\n",
-        "
",
-        "
"
-      ],
-      "columnKind": "utf16CodeUnits",
-      "properties": {
-        "semmle.formatSpecifier": "sarif-latest"
-      }
-    }
-  ]
-}
\ No newline at end of file
diff --git a/src/testdata/fingerprinting2.expected.sarif b/src/testdata/fingerprinting2.expected.sarif
deleted file mode 100644
index 731fec1469..0000000000
--- a/src/testdata/fingerprinting2.expected.sarif
+++ /dev/null
@@ -1,75 +0,0 @@
-{
-    "runs": [
-        {
-            "artifacts": [
-                {
-                    "location": {
-                        "index": 0,
-                        "uri": "src/ex_cmds.h",
-                        "uriBaseId": "%SRCROOT%"
-                    }
-                }
-            ],
-            "columnKind": "utf16CodeUnits",
-            "properties": {
-                "semmle.formatSpecifier": "sarif-latest"
-            },
-            "results": [
-                {
-                    "locations": [
-                        {
-                            "physicalLocation": {
-                                "artifactLocation": {
-                                    "index": 0,
-                                    "uri": "no_header_guard.h",
-                                    "uriBaseId": "%SRCROOT%"
-                                }
-                            }
-                        }
-                    ],
-                    "message": {
-                        "text": "This header file should contain a header guard to prevent multiple inclusion."
-                    },
-                    "partialFingerprints": {},
-                    "ruleId": "cpp/missing-header-guard",
-                    "ruleIndex": 0
-                }
-            ],
-            "tool": {
-                "driver": {
-                    "name": "CodeQL command-line toolchain",
-                    "organization": "GitHub",
-                    "rules": [
-                        {
-                            "defaultConfiguration": {},
-                            "fullDescription": {
-                                "text": "Header files should contain header guards (#defines to prevent the file from being included twice). This prevents errors and inefficiencies caused by repeated inclusion."
-                            },
-                            "id": "cpp/missing-header-guard",
-                            "name": "cpp/missing-header-guard",
-                            "properties": {
-                                "description": "Header files should contain header guards (#defines to prevent\n              the file from being included twice). This prevents errors and\n              inefficiencies caused by repeated inclusion.",
-                                "id": "cpp/missing-header-guard",
-                                "kind": "problem",
-                                "name": "Missing header guard",
-                                "precision": "high",
-                                "problem.severity": "warning",
-                                "tags": [
-                                    "efficiency",
-                                    "maintainability",
-                                    "modularity",
-                                    "external/jsf"
-                                ]
-                            },
-                            "shortDescription": {
-                                "text": "Missing header guard"
-                            }
-                        }
-                    ],
-                    "semanticVersion": "2.0.0+202002031536"
-                }
-            }
-        }
-    ],
-    "version": "2.1.0"
-}
diff --git a/src/testdata/fingerprinting2.input.sarif b/src/testdata/fingerprinting2.input.sarif
deleted file mode 100644
index d2bd614951..0000000000
--- a/src/testdata/fingerprinting2.input.sarif
+++ /dev/null
@@ -1,76 +0,0 @@
-{
-    "runs": [
-        {
-            "artifacts": [
-                {
-                    "location": {
-                        "index": 0,
-                        "uri": "src/ex_cmds.h",
-                        "uriBaseId": "%SRCROOT%"
-                    }
-                }
-            ],
-            "columnKind": "utf16CodeUnits",
-            "properties": {
-                "semmle.formatSpecifier": "sarif-latest"
-            },
-            "results": [
-                {
-                    "locations": [
-                        {
-                            "physicalLocation": {
-                                "artifactLocation": {
-                                    "index": 0,
-                                    "uri": "no_header_guard.h",
-                                    "uriBaseId": "%SRCROOT%"
-                                }
-                            }
-                        }
-                    ],
-                    "message": {
-                        "text": "This header file should contain a header guard to prevent multiple inclusion."
-                    },
-                    "partialFingerprints": {
-                    },
-                    "ruleId": "cpp/missing-header-guard",
-                    "ruleIndex": 0
-                }
-            ],
-            "tool": {
-                "driver": {
-                    "name": "CodeQL command-line toolchain",
-                    "organization": "GitHub",
-                    "rules": [
-                        {
-                            "defaultConfiguration": {},
-                            "fullDescription": {
-                                "text": "Header files should contain header guards (#defines to prevent the file from being included twice). This prevents errors and inefficiencies caused by repeated inclusion."
-                            },
-                            "id": "cpp/missing-header-guard",
-                            "name": "cpp/missing-header-guard",
-                            "properties": {
-                                "description": "Header files should contain header guards (#defines to prevent\n              the file from being included twice). This prevents errors and\n              inefficiencies caused by repeated inclusion.",
-                                "id": "cpp/missing-header-guard",
-                                "kind": "problem",
-                                "name": "Missing header guard",
-                                "precision": "high",
-                                "problem.severity": "warning",
-                                "tags": [
-                                    "efficiency",
-                                    "maintainability",
-                                    "modularity",
-                                    "external/jsf"
-                                ]
-                            },
-                            "shortDescription": {
-                                "text": "Missing header guard"
-                            }
-                        }
-                    ],
-                    "semanticVersion": "2.0.0+202002031536"
-                }
-            }
-        }
-    ],
-    "version": "2.1.0"
-}
diff --git a/src/testdata/invalid-sarif.sarif b/src/testdata/invalid-sarif.sarif
deleted file mode 100644
index 310c9d2e64..0000000000
--- a/src/testdata/invalid-sarif.sarif
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "version": "2.1.0",
-  "runs": [
-    {
-      "tool": {
-        "driver": {
-          "name": "LGTM.com",
-          "organization": "Semmle",
-          "version": "1.24.0-SNAPSHOT",
-          "rules": []
-        }
-      },
-      "results": 42
-    }
-  ]
-}
diff --git a/src/testdata/no_header_guard.h b/src/testdata/no_header_guard.h
deleted file mode 100644
index e7a644fbec..0000000000
--- a/src/testdata/no_header_guard.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * Blah blah
- */
-
-#define BLAH 1234
diff --git a/src/testdata/pr-diff-range.yml b/src/testdata/pr-diff-range.yml
deleted file mode 100644
index 073b83198a..0000000000
--- a/src/testdata/pr-diff-range.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-extensions:
-  - addsTo:
-      pack: codeql/util
-      extensible: restrictAlertsTo
-      checkPresence: false
-    data:
-      - ['/checkout/path/main.js', 10, 20]
diff --git a/src/testdata/pull_request.json b/src/testdata/pull_request.json
deleted file mode 100644
index 46aca2a7a7..0000000000
--- a/src/testdata/pull_request.json
+++ /dev/null
@@ -1,446 +0,0 @@
-{
-    "action": "opened",
-    "number": 2,
-    "pull_request": {
-        "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2",
-        "id": 279147437,
-        "node_id": "MDExOlB1bGxSZXF1ZXN0Mjc5MTQ3NDM3",
-        "html_url": "https://github.com/Codertocat/Hello-World/pull/2",
-        "diff_url": "https://github.com/Codertocat/Hello-World/pull/2.diff",
-        "patch_url": "https://github.com/Codertocat/Hello-World/pull/2.patch",
-        "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2",
-        "number": 2,
-        "state": "open",
-        "locked": false,
-        "title": "Update the README with new information.",
-        "user": {
-            "login": "Codertocat",
-            "id": 21031067,
-            "node_id": "MDQ6VXNlcjIxMDMxMDY3",
-            "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
-            "gravatar_id": "",
-            "url": "https://api.github.com/users/Codertocat",
-            "html_url": "https://github.com/Codertocat",
-            "followers_url": "https://api.github.com/users/Codertocat/followers",
-            "following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
-            "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
-            "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
-            "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
-            "organizations_url": "https://api.github.com/users/Codertocat/orgs",
-            "repos_url": "https://api.github.com/users/Codertocat/repos",
-            "events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
-            "received_events_url": "https://api.github.com/users/Codertocat/received_events",
-            "type": "User",
-            "site_admin": false
-        },
-        "body": "This is a pretty simple change that we need to pull into master.",
-        "created_at": "2019-05-15T15:20:33Z",
-        "updated_at": "2019-05-15T15:20:33Z",
-        "closed_at": null,
-        "merged_at": null,
-        "merge_commit_sha": null,
-        "assignee": null,
-        "assignees": [],
-        "requested_reviewers": [],
-        "requested_teams": [],
-        "labels": [],
-        "milestone": null,
-        "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits",
-        "review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments",
-        "review_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}",
-        "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments",
-        "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821",
-        "head": {
-            "label": "Codertocat:changes",
-            "ref": "changes",
-            "sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821",
-            "user": {
-                "login": "Codertocat",
-                "id": 21031067,
-                "node_id": "MDQ6VXNlcjIxMDMxMDY3",
-                "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
-                "gravatar_id": "",
-                "url": "https://api.github.com/users/Codertocat",
-                "html_url": "https://github.com/Codertocat",
-                "followers_url": "https://api.github.com/users/Codertocat/followers",
-                "following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
-                "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
-                "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
-                "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
-                "organizations_url": "https://api.github.com/users/Codertocat/orgs",
-                "repos_url": "https://api.github.com/users/Codertocat/repos",
-                "events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
-                "received_events_url": "https://api.github.com/users/Codertocat/received_events",
-                "type": "User",
-                "site_admin": false
-            },
-            "repo": {
-                "id": 186853002,
-                "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=",
-                "name": "Hello-World",
-                "full_name": "Codertocat/Hello-World",
-                "private": false,
-                "owner": {
-                    "login": "Codertocat",
-                    "id": 21031067,
-                    "node_id": "MDQ6VXNlcjIxMDMxMDY3",
-                    "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
-                    "gravatar_id": "",
-                    "url": "https://api.github.com/users/Codertocat",
-                    "html_url": "https://github.com/Codertocat",
-                    "followers_url": "https://api.github.com/users/Codertocat/followers",
-                    "following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
-                    "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
-                    "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
-                    "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
-                    "organizations_url": "https://api.github.com/users/Codertocat/orgs",
-                    "repos_url": "https://api.github.com/users/Codertocat/repos",
-                    "events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
-                    "received_events_url": "https://api.github.com/users/Codertocat/received_events",
-                    "type": "User",
-                    "site_admin": false
-                },
-                "html_url": "https://github.com/Codertocat/Hello-World",
-                "description": null,
-                "fork": false,
-                "url": "https://api.github.com/repos/Codertocat/Hello-World",
-                "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks",
-                "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}",
-                "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}",
-                "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams",
-                "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks",
-                "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}",
-                "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events",
-                "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}",
-                "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}",
-                "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags",
-                "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}",
-                "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}",
-                "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}",
-                "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}",
-                "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}",
-                "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages",
-                "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers",
-                "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors",
-                "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers",
-                "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription",
-                "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}",
-                "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}",
-                "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}",
-                "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}",
-                "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}",
-                "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}",
-                "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges",
-                "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}",
-                "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads",
-                "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}",
-                "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}",
-                "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}",
-                "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}",
-                "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}",
-                "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}",
-                "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments",
-                "created_at": "2019-05-15T15:19:25Z",
-                "updated_at": "2019-05-15T15:19:27Z",
-                "pushed_at": "2019-05-15T15:20:32Z",
-                "git_url": "git://github.com/Codertocat/Hello-World.git",
-                "ssh_url": "git@github.com:Codertocat/Hello-World.git",
-                "clone_url": "https://github.com/Codertocat/Hello-World.git",
-                "svn_url": "https://github.com/Codertocat/Hello-World",
-                "homepage": null,
-                "size": 0,
-                "stargazers_count": 0,
-                "watchers_count": 0,
-                "language": null,
-                "has_issues": true,
-                "has_projects": true,
-                "has_downloads": true,
-                "has_wiki": true,
-                "has_pages": true,
-                "forks_count": 0,
-                "mirror_url": null,
-                "archived": false,
-                "disabled": false,
-                "open_issues_count": 2,
-                "license": null,
-                "forks": 0,
-                "open_issues": 2,
-                "watchers": 0,
-                "default_branch": "master"
-            }
-        },
-        "base": {
-            "label": "Codertocat:master",
-            "ref": "master",
-            "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e",
-            "user": {
-                "login": "Codertocat",
-                "id": 21031067,
-                "node_id": "MDQ6VXNlcjIxMDMxMDY3",
-                "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
-                "gravatar_id": "",
-                "url": "https://api.github.com/users/Codertocat",
-                "html_url": "https://github.com/Codertocat",
-                "followers_url": "https://api.github.com/users/Codertocat/followers",
-                "following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
-                "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
-                "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
-                "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
-                "organizations_url": "https://api.github.com/users/Codertocat/orgs",
-                "repos_url": "https://api.github.com/users/Codertocat/repos",
-                "events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
-                "received_events_url": "https://api.github.com/users/Codertocat/received_events",
-                "type": "User",
-                "site_admin": false
-            },
-            "repo": {
-                "id": 186853002,
-                "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=",
-                "name": "Hello-World",
-                "full_name": "Codertocat/Hello-World",
-                "private": false,
-                "owner": {
-                    "login": "Codertocat",
-                    "id": 21031067,
-                    "node_id": "MDQ6VXNlcjIxMDMxMDY3",
-                    "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
-                    "gravatar_id": "",
-                    "url": "https://api.github.com/users/Codertocat",
-                    "html_url": "https://github.com/Codertocat",
-                    "followers_url": "https://api.github.com/users/Codertocat/followers",
-                    "following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
-                    "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
-                    "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
-                    "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
-                    "organizations_url": "https://api.github.com/users/Codertocat/orgs",
-                    "repos_url": "https://api.github.com/users/Codertocat/repos",
-                    "events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
-                    "received_events_url": "https://api.github.com/users/Codertocat/received_events",
-                    "type": "User",
-                    "site_admin": false
-                },
-                "html_url": "https://github.com/Codertocat/Hello-World",
-                "description": null,
-                "fork": false,
-                "url": "https://api.github.com/repos/Codertocat/Hello-World",
-                "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks",
-                "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}",
-                "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}",
-                "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams",
-                "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks",
-                "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}",
-                "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events",
-                "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}",
-                "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}",
-                "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags",
-                "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}",
-                "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}",
-                "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}",
-                "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}",
-                "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}",
-                "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages",
-                "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers",
-                "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors",
-                "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers",
-                "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription",
-                "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}",
-                "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}",
-                "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}",
-                "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}",
-                "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}",
-                "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}",
-                "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges",
-                "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}",
-                "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads",
-                "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}",
-                "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}",
-                "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}",
-                "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}",
-                "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}",
-                "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}",
-                "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments",
-                "created_at": "2019-05-15T15:19:25Z",
-                "updated_at": "2019-05-15T15:19:27Z",
-                "pushed_at": "2019-05-15T15:20:32Z",
-                "git_url": "git://github.com/Codertocat/Hello-World.git",
-                "ssh_url": "git@github.com:Codertocat/Hello-World.git",
-                "clone_url": "https://github.com/Codertocat/Hello-World.git",
-                "svn_url": "https://github.com/Codertocat/Hello-World",
-                "homepage": null,
-                "size": 0,
-                "stargazers_count": 0,
-                "watchers_count": 0,
-                "language": null,
-                "has_issues": true,
-                "has_projects": true,
-                "has_downloads": true,
-                "has_wiki": true,
-                "has_pages": true,
-                "forks_count": 0,
-                "mirror_url": null,
-                "archived": false,
-                "disabled": false,
-                "open_issues_count": 2,
-                "license": null,
-                "forks": 0,
-                "open_issues": 2,
-                "watchers": 0,
-                "default_branch": "master"
-            }
-        },
-        "_links": {
-            "self": {
-                "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2"
-            },
-            "html": {
-                "href": "https://github.com/Codertocat/Hello-World/pull/2"
-            },
-            "issue": {
-                "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2"
-            },
-            "comments": {
-                "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments"
-            },
-            "review_comments": {
-                "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments"
-            },
-            "review_comment": {
-                "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}"
-            },
-            "commits": {
-                "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits"
-            },
-            "statuses": {
-                "href": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821"
-            }
-        },
-        "author_association": "OWNER",
-        "draft": false,
-        "merged": false,
-        "mergeable": null,
-        "rebaseable": null,
-        "mergeable_state": "unknown",
-        "merged_by": null,
-        "comments": 0,
-        "review_comments": 0,
-        "maintainer_can_modify": false,
-        "commits": 1,
-        "additions": 1,
-        "deletions": 1,
-        "changed_files": 1
-    },
-    "repository": {
-        "id": 186853002,
-        "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=",
-        "name": "Hello-World",
-        "full_name": "Codertocat/Hello-World",
-        "private": false,
-        "owner": {
-            "login": "Codertocat",
-            "id": 21031067,
-            "node_id": "MDQ6VXNlcjIxMDMxMDY3",
-            "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
-            "gravatar_id": "",
-            "url": "https://api.github.com/users/Codertocat",
-            "html_url": "https://github.com/Codertocat",
-            "followers_url": "https://api.github.com/users/Codertocat/followers",
-            "following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
-            "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
-            "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
-            "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
-            "organizations_url": "https://api.github.com/users/Codertocat/orgs",
-            "repos_url": "https://api.github.com/users/Codertocat/repos",
-            "events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
-            "received_events_url": "https://api.github.com/users/Codertocat/received_events",
-            "type": "User",
-            "site_admin": false
-        },
-        "html_url": "https://github.com/Codertocat/Hello-World",
-        "description": null,
-        "fork": false,
-        "url": "https://api.github.com/repos/Codertocat/Hello-World",
-        "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks",
-        "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}",
-        "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}",
-        "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams",
-        "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks",
-        "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}",
-        "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events",
-        "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}",
-        "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}",
-        "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags",
-        "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}",
-        "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}",
-        "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}",
-        "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}",
-        "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}",
-        "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages",
-        "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers",
-        "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors",
-        "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers",
-        "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription",
-        "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}",
-        "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}",
-        "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}",
-        "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}",
-        "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}",
-        "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}",
-        "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges",
-        "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}",
-        "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads",
-        "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}",
-        "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}",
-        "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}",
-        "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}",
-        "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}",
-        "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}",
-        "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments",
-        "created_at": "2019-05-15T15:19:25Z",
-        "updated_at": "2019-05-15T15:19:27Z",
-        "pushed_at": "2019-05-15T15:20:32Z",
-        "git_url": "git://github.com/Codertocat/Hello-World.git",
-        "ssh_url": "git@github.com:Codertocat/Hello-World.git",
-        "clone_url": "https://github.com/Codertocat/Hello-World.git",
-        "svn_url": "https://github.com/Codertocat/Hello-World",
-        "homepage": null,
-        "size": 0,
-        "stargazers_count": 0,
-        "watchers_count": 0,
-        "language": null,
-        "has_issues": true,
-        "has_projects": true,
-        "has_downloads": true,
-        "has_wiki": true,
-        "has_pages": true,
-        "forks_count": 0,
-        "mirror_url": null,
-        "archived": false,
-        "disabled": false,
-        "open_issues_count": 2,
-        "license": null,
-        "forks": 0,
-        "open_issues": 2,
-        "watchers": 0,
-        "default_branch": "master"
-    },
-    "sender": {
-        "login": "Codertocat",
-        "id": 21031067,
-        "node_id": "MDQ6VXNlcjIxMDMxMDY3",
-        "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
-        "gravatar_id": "",
-        "url": "https://api.github.com/users/Codertocat",
-        "html_url": "https://github.com/Codertocat",
-        "followers_url": "https://api.github.com/users/Codertocat/followers",
-        "following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
-        "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
-        "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
-        "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
-        "organizations_url": "https://api.github.com/users/Codertocat/orgs",
-        "repos_url": "https://api.github.com/users/Codertocat/repos",
-        "events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
-        "received_events_url": "https://api.github.com/users/Codertocat/received_events",
-        "type": "User",
-        "site_admin": false
-    }
-}
\ No newline at end of file
diff --git a/src/testdata/testFile1.js b/src/testdata/testFile1.js
deleted file mode 100644
index ece41bd494..0000000000
--- a/src/testdata/testFile1.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var a = 0;
-var b = 0;
-var c = 0;
-var d = 0;
diff --git a/src/testdata/testFile2.js b/src/testdata/testFile2.js
deleted file mode 100644
index 32ccac1eb1..0000000000
--- a/src/testdata/testFile2.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var foo = 0;
-var bar = 0;
-var baz = 0;
-var qux = 0;
diff --git a/src/testdata/testFile3.ts b/src/testdata/testFile3.ts
deleted file mode 100644
index 190783c56f..0000000000
--- a/src/testdata/testFile3.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-var a;
-var b;
-var c;
-var d;
diff --git a/src/testdata/tool-names.sarif b/src/testdata/tool-names.sarif
deleted file mode 100644
index ee6cd8cd73..0000000000
--- a/src/testdata/tool-names.sarif
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "version": "2.1.0",
-  "runs": [
-    {
-      "tool": {
-        "driver": {
-          "name": "CodeQL command-line toolchain"
-        }
-      }
-    },
-    {
-      "tool": {
-        "driver": {
-          "name": "CodeQL command-line toolchain"
-        }
-      }
-    },
-    {
-      "tool": {
-        "driver": {
-          "name": "ESLint"
-        }
-      }
-    },
-    {
-      "tool": {
-        "driver": {
-          "name": ""
-        }
-      }
-    },
-    {
-      "tool": {
-        "driver": {
-          "name": null
-        }
-      }
-    }
-  ]
-}
diff --git a/src/testdata/valid-sarif-diff-filtered.sarif b/src/testdata/valid-sarif-diff-filtered.sarif
deleted file mode 100644
index 4c92c147e2..0000000000
--- a/src/testdata/valid-sarif-diff-filtered.sarif
+++ /dev/null
@@ -1,178 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "version": "2.1.0",
-  "runs": [{
-      "tool": {
-        "driver": {
-          "name": "LGTM.com",
-          "organization": "Semmle",
-          "version": "1.24.0-SNAPSHOT",
-          "rules": [{
-            "id": "js/unused-local-variable",
-            "name": "js/unused-local-variable",
-            "shortDescription": {
-              "text": "Unused variable, import, function or class"
-            },
-            "fullDescription": {
-              "text": "Unused variables, imports, functions or classes may be a symptom of a bug and should be examined carefully."
-            },
-            "defaultConfiguration": {
-              "level": "note"
-            },
-            "properties": {
-              "tags": ["maintainability"],
-              "kind": "problem",
-              "precision": "very-high",
-              "name": "Unused variable, import, function or class",
-              "description": "Unused variables, imports, functions or classes may be a symptom of a bug\n              and should be examined carefully.",
-              "id": "js/unused-local-variable",
-              "problem.severity": "recommendation"
-            }
-          }]
-        }
-      },
-      "results": [{
-        "ruleId": "js/unused-local-variable",
-        "ruleIndex": 0,
-        "message": {
-          "text": "Unused variable foo."
-        },
-        "locations": [{
-          "physicalLocation": {
-            "artifactLocation": {
-              "uri": "main.js",
-              "uriBaseId": "%SRCROOT%",
-              "index": 0
-            },
-            "region": {
-              "startLine": 2,
-              "startColumn": 7,
-              "endColumn": 10
-            }
-          }
-        }],
-        "partialFingerprints": {
-          "primaryLocationLineHash": "39fa2ee980eb94b0:1",
-          "primaryLocationStartColumnFingerprint": "4"
-        }
-      }],
-      "columnKind": "utf16CodeUnits",
-      "properties": {
-        "semmle.formatSpecifier": "2.1.0",
-        "semmle.sourceLanguage": "java"
-      }
-    },
-    {
-      "tool" : {
-        "driver" : {
-          "name" : "CodeQL command-line toolchain",
-          "organization" : "GitHub",
-          "semanticVersion" : "2.0.0",
-          "rules" : [ {
-            "id" : "js/unused-local-variable",
-            "name" : "js/unused-local-variable",
-            "shortDescription" : {
-              "text" : "Unused variable, import, function or class"
-            },
-            "fullDescription" : {
-              "text" : "Unused variables, imports, functions or classes may be a symptom of a bug and should be examined carefully."
-            },
-            "defaultConfiguration" : {
-              "level": "note"
-            },
-            "properties" : {
-              "tags" : [ "maintainability" ],
-              "kind" : "problem",
-              "precision" : "very-high",
-              "name" : "Unused variable, import, function or class",
-              "description" : "Unused variables, imports, functions or classes may be a symptom of a bug\n              and should be examined carefully.",
-              "id" : "js/unused-local-variable",
-              "problem.severity" : "recommendation"
-            }
-          },
-          {
-            "id": "js/inconsistent-use-of-new",
-            "name": "js/inconsistent-use-of-new",
-            "shortDescription": {
-              "text": "Inconsistent use of 'new'"
-            },
-            "fullDescription": {
-              "text": "If a function is intended to be a constructor, it should always be invoked with 'new'. Otherwise, it should always be invoked as a normal function, that is, without 'new'."
-            },
-            "defaultConfiguration": {
-              "level": "note"
-            },
-            "properties": {
-              "tags": [
-                "reliability",
-                "correctness",
-                "language-features"
-              ],
-              "kind": "problem",
-              "precision": "very-high",
-              "problem.severity": "warning"
-            }
-          } ]
-        }
-      },
-      "artifacts" : [ {
-        "location" : {
-          "uri" : "main.js",
-          "uriBaseId" : "%SRCROOT%",
-          "index" : 0
-        }
-      },
-      {
-        "location": {
-          "uri": "src/promiseUtils.js",
-          "uriBaseId": "%SRCROOT%",
-          "index": 1
-        }
-      },
-      {
-        "location": {
-          "uri": "src/LiveQueryClient.js",
-          "uriBaseId": "%SRCROOT%",
-          "index": 2
-        }
-      },
-      {
-        "location": {
-          "uri": "src/ParseObject.js",
-          "uriBaseId": "%SRCROOT%",
-          "index": 3
-        }
-      } ],
-      "results" : [ {
-        "ruleId" : "js/unused-local-variable",
-        "ruleIndex" : 0,
-        "message" : {
-          "text" : "Unused variable foo."
-        },
-        "locations" : [ {
-          "physicalLocation" : {
-            "artifactLocation" : {
-              "uri" : "main.js",
-              "uriBaseId" : "%SRCROOT%",
-              "index" : 0
-            },
-            "region" : {
-              "startLine" : 2,
-              "startColumn" : 7,
-              "endColumn" : 10
-            }
-          }
-        } ],
-        "partialFingerprints" : {
-          "primaryLocationLineHash" : "39fa2ee980eb94b0:1",
-          "primaryLocationStartColumnFingerprint" : "4"
-        }
-      }],
-      "newlineSequences" : [ "\r\n", "\n", "
", "
" ],
-      "columnKind" : "utf16CodeUnits",
-      "properties" : {
-        "semmle.formatSpecifier" : "sarif-latest"
-      }
-    }
-  ]
-}
\ No newline at end of file
diff --git a/src/testdata/valid-sarif.sarif b/src/testdata/valid-sarif.sarif
deleted file mode 100644
index 5ea179e0e8..0000000000
--- a/src/testdata/valid-sarif.sarif
+++ /dev/null
@@ -1,239 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "version": "2.1.0",
-  "runs": [{
-      "tool": {
-        "driver": {
-          "name": "LGTM.com",
-          "organization": "Semmle",
-          "version": "1.24.0-SNAPSHOT",
-          "rules": [{
-            "id": "js/unused-local-variable",
-            "name": "js/unused-local-variable",
-            "shortDescription": {
-              "text": "Unused variable, import, function or class"
-            },
-            "fullDescription": {
-              "text": "Unused variables, imports, functions or classes may be a symptom of a bug and should be examined carefully."
-            },
-            "defaultConfiguration": {
-              "level": "note"
-            },
-            "properties": {
-              "tags": ["maintainability"],
-              "kind": "problem",
-              "precision": "very-high",
-              "name": "Unused variable, import, function or class",
-              "description": "Unused variables, imports, functions or classes may be a symptom of a bug\n              and should be examined carefully.",
-              "id": "js/unused-local-variable",
-              "problem.severity": "recommendation"
-            }
-          }]
-        }
-      },
-      "results": [{
-        "ruleId": "js/unused-local-variable",
-        "ruleIndex": 0,
-        "message": {
-          "text": "Unused variable foo."
-        },
-        "locations": [{
-          "physicalLocation": {
-            "artifactLocation": {
-              "uri": "main.js",
-              "uriBaseId": "%SRCROOT%",
-              "index": 0
-            },
-            "region": {
-              "startLine": 2,
-              "startColumn": 7,
-              "endColumn": 10
-            }
-          }
-        }],
-        "partialFingerprints": {
-          "primaryLocationLineHash": "39fa2ee980eb94b0:1",
-          "primaryLocationStartColumnFingerprint": "4"
-        }
-      }],
-      "columnKind": "utf16CodeUnits",
-      "properties": {
-        "semmle.formatSpecifier": "2.1.0",
-        "semmle.sourceLanguage": "java"
-      }
-    },
-    {
-      "tool" : {
-        "driver" : {
-          "name" : "CodeQL command-line toolchain",
-          "organization" : "GitHub",
-          "semanticVersion" : "2.0.0",
-          "rules" : [ {
-            "id" : "js/unused-local-variable",
-            "name" : "js/unused-local-variable",
-            "shortDescription" : {
-              "text" : "Unused variable, import, function or class"
-            },
-            "fullDescription" : {
-              "text" : "Unused variables, imports, functions or classes may be a symptom of a bug and should be examined carefully."
-            },
-            "defaultConfiguration" : {
-              "level": "note"
-            },
-            "properties" : {
-              "tags" : [ "maintainability" ],
-              "kind" : "problem",
-              "precision" : "very-high",
-              "name" : "Unused variable, import, function or class",
-              "description" : "Unused variables, imports, functions or classes may be a symptom of a bug\n              and should be examined carefully.",
-              "id" : "js/unused-local-variable",
-              "problem.severity" : "recommendation"
-            }
-          },
-          {
-            "id": "js/inconsistent-use-of-new",
-            "name": "js/inconsistent-use-of-new",
-            "shortDescription": {
-              "text": "Inconsistent use of 'new'"
-            },
-            "fullDescription": {
-              "text": "If a function is intended to be a constructor, it should always be invoked with 'new'. Otherwise, it should always be invoked as a normal function, that is, without 'new'."
-            },
-            "defaultConfiguration": {
-              "level": "note"
-            },
-            "properties": {
-              "tags": [
-                "reliability",
-                "correctness",
-                "language-features"
-              ],
-              "kind": "problem",
-              "precision": "very-high",
-              "problem.severity": "warning"
-            }
-          } ]
-        }
-      },
-      "artifacts" : [ {
-        "location" : {
-          "uri" : "main.js",
-          "uriBaseId" : "%SRCROOT%",
-          "index" : 0
-        }
-      },
-      {
-        "location": {
-          "uri": "src/promiseUtils.js",
-          "uriBaseId": "%SRCROOT%",
-          "index": 1
-        }
-      },
-      {
-        "location": {
-          "uri": "src/LiveQueryClient.js",
-          "uriBaseId": "%SRCROOT%",
-          "index": 2
-        }
-      },
-      {
-        "location": {
-          "uri": "src/ParseObject.js",
-          "uriBaseId": "%SRCROOT%",
-          "index": 3
-        }
-      } ],
-      "results" : [ {
-        "ruleId" : "js/unused-local-variable",
-        "ruleIndex" : 0,
-        "message" : {
-          "text" : "Unused variable foo."
-        },
-        "locations" : [ {
-          "physicalLocation" : {
-            "artifactLocation" : {
-              "uri" : "main.js",
-              "uriBaseId" : "%SRCROOT%",
-              "index" : 0
-            },
-            "region" : {
-              "startLine" : 2,
-              "startColumn" : 7,
-              "endColumn" : 10
-            }
-          }
-        } ],
-        "partialFingerprints" : {
-          "primaryLocationLineHash" : "39fa2ee980eb94b0:1",
-          "primaryLocationStartColumnFingerprint" : "4"
-        }
-      },
-      {
-        "ruleId": "js/inconsistent-use-of-new",
-        "ruleIndex": 1,
-        "message": {
-          "text": "Function resolvingPromise is sometimes invoked as a constructor (for example [here](1)), and sometimes as a normal function (for example [here](2))."
-        },
-        "locations": [
-          {
-            "physicalLocation": {
-              "artifactLocation": {
-                "uri": "src/promiseUtils.js",
-                "uriBaseId": "%SRCROOT%",
-                "index": 1
-              },
-              "region": {
-                "startLine": 2
-              }
-            }
-          }
-        ],
-        "partialFingerprints": {
-          "primaryLocationLineHash": "5061c3315a741b7d:1",
-          "primaryLocationStartColumnFingerprint": "7"
-        },
-        "relatedLocations": [
-          {
-            "id": 1,
-            "physicalLocation": {
-              "artifactLocation": {
-                "uri": "src/ParseObject.js",
-                "uriBaseId": "%SRCROOT%",
-                "index": 3
-              },
-              "region": {
-                "startLine": 2281,
-                "startColumn": 33,
-                "endColumn": 55
-              }
-            },
-            "message": {
-              "text": "here"
-            }
-          },
-          {
-            "id": 2,
-            "physicalLocation": {
-              "artifactLocation": {
-                "uri": "src/LiveQueryClient.js",
-                "uriBaseId": "%SRCROOT%",
-                "index": 2
-              },
-              "region": {
-                "startLine": 166
-              }
-            },
-            "message": {
-              "text": "here"
-            }
-          }
-        ]
-      } ],
-      "newlineSequences" : [ "\r\n", "\n", "
", "
" ],
-      "columnKind" : "utf16CodeUnits",
-      "properties" : {
-        "semmle.formatSpecifier" : "sarif-latest"
-      }
-    }
-  ]
-}
\ No newline at end of file
diff --git a/src/testdata/with-invalid-uri.sarif b/src/testdata/with-invalid-uri.sarif
deleted file mode 100644
index 75cebe7278..0000000000
--- a/src/testdata/with-invalid-uri.sarif
+++ /dev/null
@@ -1,54 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
-  "version": "2.1.0",
-  "runs": [
-    {
-      "tool": {
-        "driver": {
-          "name": "LGTM.com",
-          "organization": "Semmle",
-          "version": "1.24.0-SNAPSHOT",
-          "rules": [
-            {
-              "id": "js/unused-local-variable",
-              "shortDescription": {
-                "text": "Unused local variable"
-              },
-              "helpUri": "not a valid URI"
-            }
-          ]
-        }
-      },
-      "results": [
-        {
-          "ruleId": "js/unused-local-variable",
-          "ruleIndex": 0,
-          "message": {
-            "text": "Unused variable foo."
-          },
-          "locations": [
-            {
-              "physicalLocation": {
-                "artifactLocation": {
-                  "uri": "not a valid URI",
-                  "uriBaseId": "%SRCROOT%",
-                  "index": 0
-                },
-                "region": {
-                  "startLine": 2,
-                  "startColumn": 7,
-                  "endColumn": 10
-                }
-              }
-            }
-          ]
-        }
-      ],
-      "columnKind": "utf16CodeUnits",
-      "properties": {
-        "semmle.formatSpecifier": "2.1.0",
-        "semmle.sourceLanguage": "java"
-      }
-    }
-  ]
-}
diff --git a/src/testing-utils.ts b/src/testing-utils.ts
deleted file mode 100644
index e4f26daa0f..0000000000
--- a/src/testing-utils.ts
+++ /dev/null
@@ -1,1008 +0,0 @@
-import { TextDecoder } from "node:util";
-import path from "path";
-
-import * as github from "@actions/github";
-import test, {
-  type ThrownError,
-  type ThrowsExpectation,
-  type ExecutionContext,
-  type MacroDeclarationOptions,
-  type TestFn,
-} from "ava";
-import nock from "nock";
-import * as sinon from "sinon";
-
-import { ActionState, StateFeature } from "./action-common";
-import { ActionsEnv, getActionVersion } from "./actions-util";
-import { AnalysisKind } from "./analyses";
-import * as apiClient from "./api-client";
-import { GitHubApiDetails } from "./api-client";
-import { CachingKind } from "./caching-utils";
-import { resetCachedCodeQlVersion } from "./cli/output-cache";
-import type { VersionInfo } from "./cli/types";
-import * as codeql from "./codeql";
-import { Config } from "./config-utils";
-import * as defaults from "./defaults.json";
-import { Env, ActionsEnvVars } from "./environment";
-import {
-  CodeQLDefaultVersionInfo,
-  Feature,
-  featureConfig,
-  FeatureEnablement,
-} from "./feature-flags";
-import { Logger } from "./logging";
-import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
-import { ActionName } from "./status-report";
-import {
-  DEFAULT_DEBUG_ARTIFACT_NAME,
-  DEFAULT_DEBUG_DATABASE_NAME,
-  Failure,
-  getEnv,
-  GitHubVariant,
-  GitHubVersion,
-  HTTPError,
-  Result,
-  Success,
-} from "./util";
-
-export const SAMPLE_DOTCOM_API_DETAILS = {
-  auth: "token",
-  url: "https://github.com",
-  apiURL: "https://api.github.com",
-};
-
-export const LINKED_CLI_VERSION = {
-  cliVersion: defaults.cliVersion,
-  tagName: defaults.bundleVersion,
-};
-
-export const SAMPLE_DEFAULT_CLI_VERSION: CodeQLDefaultVersionInfo = {
-  enabledVersions: [
-    {
-      cliVersion: "2.20.0",
-      tagName: "codeql-bundle-v2.20.0",
-    },
-  ],
-};
-
-type TestContext = {
-  stdoutWrite: any;
-  stderrWrite: any;
-  testOutput: string;
-  env: NodeJS.ProcessEnv;
-};
-
-function wrapOutput(context: TestContext) {
-  // Function signature taken from Socket.write.
-  // Note there are two overloads:
-  // write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
-  // write(str: Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean;
-  return (
-    chunk: Uint8Array | string,
-    encoding?: string,
-    cb?: (err?: Error) => void,
-  ): boolean => {
-    // Work out which method overload we are in
-    if (cb === undefined && typeof encoding === "function") {
-      cb = encoding;
-      encoding = undefined;
-    }
-
-    // Record the output
-    if (typeof chunk === "string") {
-      context.testOutput += chunk;
-    } else {
-      context.testOutput += new TextDecoder(encoding || "utf-8").decode(chunk);
-    }
-
-    // Satisfy contract by calling callback when done
-    if (cb !== undefined && typeof cb === "function") {
-      cb();
-    }
-
-    return true;
-  };
-}
-
-export function setupTests(testFn: TestFn) {
-  const typedTest = testFn as TestFn;
-
-  typedTest.beforeEach((t) => {
-    // Set an empty CodeQL object so that all method calls will fail
-    // unless the test explicitly sets one up.
-    codeql.setCodeQL({});
-
-    // Reset the in-process CodeQL version cache so that it doesn't leak between
-    // tests, which each represent a separate Actions step in production.
-    resetCachedCodeQlVersion();
-
-    // Replace stdout and stderr so we can record output during tests
-    t.context.testOutput = "";
-    const processStdoutWrite = process.stdout.write.bind(process.stdout);
-    t.context.stdoutWrite = processStdoutWrite;
-    process.stdout.write = wrapOutput(t.context) as any;
-    const processStderrWrite = process.stderr.write.bind(process.stderr);
-    t.context.stderrWrite = processStderrWrite;
-    process.stderr.write = wrapOutput(t.context) as any;
-
-    // Workaround an issue in tests where the case insensitivity of the `$PATH`
-    // environment variable on Windows isn't preserved, i.e. `process.env.PATH`
-    // is not the same as `process.env.Path`.
-    const pathKeys = Object.keys(process.env).filter(
-      (k) => k.toLowerCase() === "path",
-    );
-    if (pathKeys.length > 0) {
-      process.env.PATH = process.env[pathKeys[0]];
-    }
-
-    // Many tests modify environment variables. Take a copy now so that
-    // we reset them after the test to keep tests independent of each other.
-    // process.env only has strings fields, so a shallow copy is fine.
-    t.context.env = {};
-    Object.assign(t.context.env, process.env);
-  });
-
-  typedTest.afterEach.always((t) => {
-    // Restore stdout and stderr
-    // The captured output is only replayed if the test failed
-    process.stdout.write = t.context.stdoutWrite;
-    process.stderr.write = t.context.stderrWrite;
-    if (!t.passed) {
-      process.stdout.write(t.context.testOutput);
-    }
-
-    // Undo any modifications made by nock
-    nock.cleanAll();
-
-    // Undo any modifications made by sinon
-    sinon.restore();
-
-    // Undo any modifications to the env
-    process.env = t.context.env;
-  });
-}
-
-/**
- * Declare a reusable test implementation, with better type safety than `test.macro`.
- */
-export function makeMacro(
-  decl: MacroDeclarationOptions,
-) {
-  const m = test.macro(decl);
-
-  const wrapper = (name: string, ...args: Args) => test(name, m, ...args);
-  wrapper.test = (...args: Args) => test(m, ...args);
-  wrapper.serial = (name: string, ...args: Args) =>
-    test.serial(name, m, ...args);
-  // Make the implementation available as `fn`. We don't call it `exec` so
-  // that results from this function are not valid arguments to `test`
-  // or `test.serial`.
-  wrapper.fn = decl.exec;
-
-  return wrapper;
-}
-
-export function getTestEnv(testEnv: NodeJS.ProcessEnv = {}): Env {
-  return getEnv(testEnv);
-}
-
-/** An implementation of `ActionsEnv` for use in tests. */
-class TestActionsEnv implements ActionsEnv {
-  constructor(private readonly env: Env) {}
-
-  public clone(env: Env): this {
-    return Object.create(this, { env: { value: env } }) as this;
-  }
-
-  public getRequiredInput(name: string): string {
-    throw new Error(`Input required and not supplied: ${name}`);
-  }
-
-  public getOptionalInput(_name: string): string | undefined {
-    return undefined;
-  }
-
-  public exportVariable(name: string, value: string): void {
-    this.env.set(name, value);
-  }
-}
-
-/**
- * Gets an `ActionsEnv` instance for use in tests.
- */
-export function getTestActionsEnv(env: Env): TestActionsEnv {
-  return new TestActionsEnv(env);
-}
-
-/** For testing purposes, we make all available state features accessible in `TestEnv`. */
-type AllState = [
-  "Base",
-  "Logger",
-  "Env",
-  "ReadOnlyEnv",
-  "Actions",
-  "Api",
-  "FeatureFlags",
-];
-
-/** Initialise a fresh `ActionState` value. */
-export function initAllState(
-  overrides?: Partial>,
-): ActionState {
-  const env = getTestEnv();
-  return {
-    name: ActionName.Init,
-    startedAt: new Date(),
-    logger: new RecordingLogger(),
-    env,
-    actions: getTestActionsEnv(env),
-    apiClient: github.getOctokit("123"),
-    features: createFeatures([]),
-    ...overrides,
-  };
-}
-
-type DelayedCheck<
-  Args extends readonly any[],
-  R,
-  Fs extends ReadonlyArray,
-> = (
-  env: Readonly>,
-  result: Result, ThrownError>,
-) => Promise;
-
-export type Mutation = (val: T) => void;
-export type ValueOrMutation = T | Mutation;
-
-/**
- * Wraps a function that accepts an `ActionState` for testing in different environments.
- */
-abstract class BaseEnvBuilder<
-  Args extends readonly any[],
-  R,
-  Fs extends ReadonlyArray,
-> {
-  protected readonly fn: (state: ActionState, ...args: Args) => R;
-  private logger: RecordingLogger;
-  private actions: TestActionsEnv;
-  protected state: ActionState;
-  protected checks: Array>;
-
-  constructor(
-    fn: (state: ActionState, ...args: Args) => R,
-    cloneFrom?: BaseEnvBuilder,
-  ) {
-    this.fn = fn;
-    this.logger = new RecordingLogger();
-
-    if (cloneFrom !== undefined) {
-      const env = cloneFrom.state.env.clone();
-      this.actions = cloneFrom.actions.clone(env);
-      this.state = {
-        ...cloneFrom.state,
-        env,
-        actions: this.actions,
-        logger: this.logger,
-      } satisfies ActionState;
-    } else {
-      const env = getTestEnv();
-      this.actions = getTestActionsEnv(env);
-      this.state = initAllState({
-        logger: this.logger,
-        env,
-        actions: this.actions,
-      });
-    }
-
-    this.checks = [...(cloneFrom?.checks ?? [])];
-  }
-
-  /**
-   * Creates a clone of this object. Used internally.
-   * Must be overridden by subclasses.
-   */
-  protected abstract clone(): this;
-
-  public getLogger(): RecordingLogger {
-    return this.logger;
-  }
-
-  public getState(): ActionState {
-    return this.state;
-  }
-
-  public withArgs(...args: Args): CallableEnvBuilder {
-    const result = new CallableEnvBuilder(this.fn, args, this.clone());
-    return result;
-  }
-
-  public withFeatures(enabled: Feature[]): this {
-    const result = this.clone();
-    result.state.features = createFeatures(enabled);
-    return result;
-  }
-
-  /**
-   * Sets environment variables that are always available to GitHub Actions,
-   * excluding some that are expected to be set to paths.
-   *
-   * @param overrides Overrides for the defaults.
-   */
-  public withDefaultActionsEnv(overrides?: ActionVarOverrides): this {
-    const result = this.clone();
-    setupBaseActionsVars(overrides, result.state.env);
-    return result;
-  }
-
-  /**
-   * Sets environment variables that are always available to GitHub Actions.
-   * @param tempDir A value for `RUNNER_TEMP` and `GITHUB_WORKSPACE`.
-   * @param toolsDir A value for `RUNNER_TOOL_CACHE`.
-   * @param overrides Overrides for the defaults.
-   */
-  public withActionsEnv(
-    tempDir: string,
-    toolsDir: string,
-    overrides?: ActionVarOverrides,
-  ): this {
-    const result = this.clone();
-    setupActionsVars(tempDir, toolsDir, overrides, result.state.env);
-    return result;
-  }
-
-  public withEnv(arg: ValueOrMutation): this {
-    const result = this.clone();
-    if (typeof arg === "function") {
-      arg(result.state.env);
-    } else {
-      result.state.env = arg;
-    }
-    return result;
-  }
-
-  /** Applies `fn` to the `ActionsEnv`. */
-  public withActions(fn: Mutation): this {
-    const result = this.clone();
-    fn(result.state.actions);
-    return result;
-  }
-
-  /**
-   * Adds a delayed check that `messages` are logged. The check will be
-   * performed after the main assertion passes.
-   */
-  public logs(t: ExecutionContext, ...messages: string[]): this {
-    const result = this.clone();
-    result.checks.push(async (env) => {
-      checkExpectedLogMessages(t, env.getLogger().messages, messages);
-    });
-    return result;
-  }
-
-  /**
-   * Adds a delayed check that the environment variables returned by `fn`
-   * are present in the environment after the main assertion passes.
-   */
-  public hasEnv(
-    t: ExecutionContext,
-    fn: (
-      value: Awaited | undefined,
-      error: ThrownError | undefined,
-    ) => Record,
-  ): this {
-    const result = this.clone();
-    result.checks.push(async (env, r) => {
-      const value = r.orElse(undefined);
-      const error = r.isFailure() ? r.value : undefined;
-      const expected = fn(value, error);
-
-      t.like(env.getState().env.get(), expected);
-    });
-    return result;
-  }
-
-  /**
-   * Adds a delayed check that `messages` are not logged. The check will be
-   * performed after the main assertion passes.
-   */
-  public notLogs(t: ExecutionContext, ...messages: string[]): this {
-    const result = this.clone();
-    result.checks.push(async (env) => {
-      checkUnexpectedLogMessages(t, env.getLogger().messages, messages);
-    });
-    return result;
-  }
-}
-
-class EnvBuilder<
-  Args extends readonly any[],
-  R,
-  Fs extends ReadonlyArray,
-> extends BaseEnvBuilder {
-  protected clone(): this {
-    return new EnvBuilder(this.fn, this) as this;
-  }
-}
-
-export interface PassedAssertion {
-  result: Awaited;
-  assertionResult: T;
-}
-
-/**
- * A more minimal, exported interface for `CallableEnvBuilder`. This makes it easier to
- * define helper functions in tests which expect a value of a compatible type.
- */
-export interface AssertableTarget {
-  passes(
-    assertion: (val: Awaited, ...assertionArgs: AArgs) => AResult,
-    ...assertionArgs: AArgs
-  ): Promise>;
-
-  throws(
-    t: ExecutionContext,
-    expectations?: ThrowsExpectation,
-  ): Promise>;
-}
-
-class CallableEnvBuilder<
-    Args extends readonly any[],
-    R,
-    Fs extends ReadonlyArray,
-  >
-  extends BaseEnvBuilder
-  implements AssertableTarget
-{
-  private args: Args;
-
-  constructor(
-    fn: (state: ActionState, ...args: Args) => R,
-    args: Args,
-    cloneFrom?: BaseEnvBuilder,
-  ) {
-    super(fn, cloneFrom);
-    this.args = args;
-  }
-
-  protected clone(): this {
-    return new CallableEnvBuilder(this.fn, this.args, this) as this;
-  }
-
-  public getArgs(): Args {
-    return this.args;
-  }
-
-  call(): R {
-    return this.fn(this.state as unknown as ActionState, ...this.args);
-  }
-
-  /**
-   * Calls the underlying function in the configured environment and passes
-   * the result to `assertion` along with extra `assertionArgs`.
-   *
-   * @param assertion The assertion to apply to the result.
-   * @param assertionArgs Extra arguments for the assertion.
-   * @returns The result of the assertion.
-   */
-  public async passes(
-    assertion: (val: Awaited, ...assertionArgs: AArgs) => AResult,
-    ...assertionArgs: AArgs
-  ): Promise> {
-    // this.call() may or may not return a promise,
-    // `Promise.resolve` turns the result into one if it isn't already,
-    // and we then await it. That ensures that `result` is an `Awaited`.
-    const result = await Promise.resolve(this.call());
-
-    // Run the main assertion on the `result`.
-    const assertionResult = await assertion(result, ...assertionArgs);
-
-    // Run other delayed checks.
-    for (const delayedCheck of this.checks) {
-      await delayedCheck(this, new Success(result));
-    }
-
-    // Return the results of the function call and the main assertion.
-    return { result, assertionResult };
-  }
-
-  /**
-   * Asserts that calling the underlying function should throw an exception.
-   *
-   * @param t The execution context for the assertion.
-   * @param expectations Expectations for the error.
-   * @returns The error that was thrown.
-   */
-  public async throws(
-    t: ExecutionContext,
-    expectations?: ThrowsExpectation,
-  ): Promise> {
-    // Run the main assertion.
-    const error = await t.throwsAsync(
-      async () => Promise.resolve(this.call()),
-      expectations,
-    );
-
-    // Run other delayed checks.
-    for (const delayedCheck of this.checks) {
-      await delayedCheck(this, new Failure(error));
-    }
-
-    // Return the error.
-    return error;
-  }
-}
-
-/** Utility function to construct a `TestEnv`. */
-export function callee<
-  Args extends readonly any[],
-  R,
-  Fs extends readonly StateFeature[],
->(fn: (state: ActionState, ...args: Args) => R): EnvBuilder {
-  return new EnvBuilder(fn);
-}
-
-/**
- * Default values for environment variables typically set in an Actions
- * environment. Tests can override individual variables by passing them in the
- * `overrides` parameter.
- */
-export const DEFAULT_ACTIONS_VARS = {
-  GITHUB_ACTION_REPOSITORY: "github/codeql-action",
-  GITHUB_API_URL: "https://api.github.com",
-  GITHUB_EVENT_NAME: "push",
-  GITHUB_JOB: "test-job",
-  GITHUB_REF: "refs/heads/main",
-  GITHUB_REPOSITORY: "github/codeql-action-testing",
-  GITHUB_RUN_ATTEMPT: "1",
-  GITHUB_RUN_ID: "1",
-  GITHUB_SERVER_URL: "https://github.com",
-  GITHUB_SHA: "0".repeat(40),
-  GITHUB_WORKFLOW: "test-workflow",
-  RUNNER_NAME: "my-runner",
-  RUNNER_OS: "Linux",
-} as const satisfies Partial>;
-
-/** Partial mappings from GitHub Actions environment variables to values. */
-export type ActionVarOverrides = Partial<
-  Record
->;
-
-/**
- * Sets environment variables that are always available on GitHub Actions,
- * excluding some that are expected to be set to paths. See `setupActionsVars`.
- *
- * @param overrides Overrides for the defaults.
- * @param env The environment to set the variables for.
- */
-export function setupBaseActionsVars(
-  overrides?: ActionVarOverrides,
-  env: Env = getEnv(),
-) {
-  const vars = { ...DEFAULT_ACTIONS_VARS, ...overrides };
-  for (const [key, value] of Object.entries(vars)) {
-    env.set(key, value);
-  }
-}
-
-/**
- * Sets environment variables that are always available on GitHub Actions.
- *
- * @param tempDir A value for `RUNNER_TEMP` and `GITHUB_WORKSPACE`.
- * @param toolsDir A value for `RUNNER_TOOL_CACHE`.
- * @param overrides Overrides for the defaults.
- * @param env The environment to set the variables for.
- */
-export function setupActionsVars(
-  tempDir: string,
-  toolsDir: string,
-  overrides?: ActionVarOverrides,
-  env: Env = getEnv(),
-) {
-  setupBaseActionsVars(overrides, env);
-  env.set(ActionsEnvVars.RUNNER_TEMP, tempDir);
-  env.set(ActionsEnvVars.RUNNER_TOOL_CACHE, toolsDir);
-  env.set(ActionsEnvVars.GITHUB_WORKSPACE, tempDir);
-}
-
-type LogLevel = "debug" | "info" | "warning" | "error";
-
-export interface LoggedMessage {
-  type: LogLevel;
-  message: string | Error;
-}
-
-export class RecordingLogger implements Logger {
-  messages: LoggedMessage[] = [];
-  readonly groups: string[] = [];
-  readonly unfinishedGroups: Set = new Set();
-  private currentGroup: string | undefined = undefined;
-
-  constructor(private readonly logToConsole: boolean = true) {}
-
-  private addMessage(level: LogLevel, message: string | Error): void {
-    this.messages.push({ type: level, message });
-
-    if (this.logToConsole) {
-      // eslint-disable-next-line no-console
-      console.debug(message);
-    }
-  }
-
-  /**
-   * Checks whether the logged messages contain `messageOrRegExp`.
-   *
-   * If `messageOrRegExp` is a string, this function returns true as long as
-   * `messageOrRegExp` appears as part of one of the `messages`.
-   *
-   * If `messageOrRegExp` is a regular expression, this function returns true as long as
-   * one of the `messages` matches `messageOrRegExp`.
-   */
-  hasMessage(messageOrRegExp: string | RegExp): boolean {
-    return hasLoggedMessage(this.messages, messageOrRegExp);
-  }
-
-  isDebug() {
-    return true;
-  }
-
-  debug(message: string) {
-    this.addMessage("debug", message);
-  }
-
-  info(message: string) {
-    this.addMessage("info", message);
-  }
-
-  warning(message: string | Error) {
-    this.addMessage("warning", message);
-  }
-
-  error(message: string | Error) {
-    this.addMessage("error", message);
-  }
-
-  startGroup(name: string) {
-    this.groups.push(name);
-    this.currentGroup = name;
-    this.unfinishedGroups.add(name);
-  }
-
-  endGroup() {
-    if (this.currentGroup !== undefined) {
-      this.unfinishedGroups.delete(this.currentGroup);
-    }
-    this.currentGroup = undefined;
-  }
-}
-
-export function getRecordingLogger(
-  messages: LoggedMessage[],
-  { logToConsole }: { logToConsole?: boolean } = { logToConsole: true },
-): Logger {
-  const logger = new RecordingLogger(logToConsole);
-  logger.messages = messages;
-  return logger;
-}
-
-/**
- * Checks whether `messages` contains `messageOrRegExp`.
- *
- * If `messageOrRegExp` is a string, this function returns true as long as
- * `messageOrRegExp` appears as part of one of the `messages`.
- *
- * If `messageOrRegExp` is a regular expression, this function returns true as long as
- * one of the `messages` matches `messageOrRegExp`.
- */
-function hasLoggedMessage(
-  messages: LoggedMessage[],
-  messageOrRegExp: string | RegExp,
-): boolean {
-  const check = (val: string) =>
-    typeof messageOrRegExp === "string"
-      ? val.includes(messageOrRegExp)
-      : messageOrRegExp.test(val);
-
-  return messages.some(
-    (msg) => typeof msg.message === "string" && check(msg.message),
-  );
-}
-
-/**
- * Checks that `messages` contains all of `expectedMessages`.
- */
-export function checkExpectedLogMessages(
-  t: ExecutionContext,
-  messages: LoggedMessage[],
-  expectedMessages: string[],
-) {
-  const missingMessages: string[] = [];
-
-  for (const expectedMessage of expectedMessages) {
-    if (!hasLoggedMessage(messages, expectedMessage)) {
-      missingMessages.push(expectedMessage);
-    }
-  }
-
-  if (missingMessages.length > 0) {
-    const listify = (lines: string[]) =>
-      lines.map((m) => ` - '${m}'`).join("\n");
-
-    t.fail(
-      `Expected\n\n${listify(missingMessages)}\n\nin the logger output, but didn't find it in:\n\n${messages.map((m) => ` - '${m.message}'`).join("\n")}`,
-    );
-  } else {
-    t.pass();
-  }
-}
-
-/**
- * Checks that `messages` contains none of `unexpectedMessages`.
- */
-export function checkUnexpectedLogMessages(
-  t: ExecutionContext,
-  messages: LoggedMessage[],
-  unexpectedMessages: string[],
-) {
-  const presentMessages: string[] = [];
-
-  for (const unexpectedMessage of unexpectedMessages) {
-    if (hasLoggedMessage(messages, unexpectedMessage)) {
-      presentMessages.push(unexpectedMessage);
-    }
-  }
-
-  if (presentMessages.length > 0) {
-    const listify = (lines: string[]) =>
-      lines.map((m) => ` - '${m}'`).join("\n");
-
-    t.fail(
-      `Did not expect\n\n${listify(presentMessages)}\n\nin the logger output, but found them in:\n\n${messages.map((m) => ` - '${m.message}'`).join("\n")}`,
-    );
-  } else {
-    t.pass();
-  }
-}
-
-/**
- * Asserts that `message` should not have been logged to `logger`.
- */
-export function assertNotLogged(
-  t: ExecutionContext,
-  logger: RecordingLogger,
-  message: string | RegExp,
-) {
-  t.false(
-    logger.hasMessage(message),
-    `'${message}' should not have been logged, but was.`,
-  );
-}
-
-/**
- * Initialises a recording logger and calls `body` with it.
- *
- * @param body The test that requires a recording logger.
- * @returns The logged messages.
- */
-export async function withRecordingLoggerAsync(
-  body: (logger: Logger) => Promise,
-): Promise {
-  const messages = [];
-  const logger = getRecordingLogger(messages);
-
-  await body(logger);
-
-  return messages;
-}
-
-/** Mock the HTTP request to the feature flags enablement API endpoint. */
-export function mockFeatureFlagApiEndpoint(
-  responseStatusCode: number,
-  response: { [flagName: string]: boolean },
-) {
-  stubFeatureFlagApiEndpoint(() => ({
-    status: responseStatusCode,
-    messageIfError: "some error message",
-    data: response,
-  }));
-}
-
-/** Stub the HTTP request to the feature flags enablement API endpoint. */
-export function stubFeatureFlagApiEndpoint(
-  responseFunction: (params: any) => {
-    status: number;
-    messageIfError?: string;
-    data: { [flagName: string]: boolean };
-  },
-) {
-  // Passing an auth token is required, so we just use a dummy value
-  const client = github.getOctokit("123");
-
-  const requestSpy = sinon.stub(client, "request");
-
-  const optInSpy = requestSpy.withArgs(
-    "GET /repos/:owner/:repo/code-scanning/codeql-action/features",
-  );
-
-  optInSpy.callsFake((_route, params) => {
-    const response = responseFunction(params);
-    if (response.status < 300) {
-      return Promise.resolve({
-        status: response.status,
-        data: response.data,
-        headers: {},
-        url: "GET /repos/:owner/:repo/code-scanning/codeql-action/features",
-      });
-    } else {
-      throw new HTTPError(
-        response.messageIfError || "default stub error message",
-        response.status,
-      );
-    }
-  });
-
-  sinon.stub(apiClient, "getApiClient").value(() => client);
-}
-
-export function mockLanguagesInRepo(languages: string[]) {
-  const mockClient = sinon.stub(apiClient, "getApiClient");
-  const listLanguages = sinon.stub().resolves({
-    status: 200,
-    data: languages.reduce((acc, lang) => {
-      acc[lang] = 1;
-      return acc;
-    }, {}),
-    headers: {},
-    url: "GET /repos/:owner/:repo/languages",
-  });
-
-  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-  mockClient.returns({
-    rest: {
-      repos: {
-        listLanguages,
-      },
-    },
-  } as any);
-  return listLanguages;
-}
-
-/**
- * Constructs a `VersionInfo` object for testing purposes only.
- */
-export const makeVersionInfo = (
-  version: string,
-  features?: { [name: string]: boolean },
-  overlayVersion?: number,
-): VersionInfo => ({
-  version,
-  features,
-  overlayVersion,
-});
-
-export function mockCodeQLVersion(
-  version: string,
-  features?: { [name: string]: boolean },
-  overlayVersion?: number,
-) {
-  return codeql.createStubCodeQL({
-    async getVersion() {
-      return makeVersionInfo(version, features, overlayVersion);
-    },
-  });
-}
-
-/**
- * Create a feature enablement instance with the specified set of enabled features.
- *
- * This should be only used within tests.
- */
-export function createFeatures(enabledFeatures: Feature[]): FeatureEnablement {
-  return {
-    getEnabledDefaultCliVersions: async () => {
-      throw new Error("not implemented");
-    },
-    getValue: async (feature) => {
-      return enabledFeatures.includes(feature as Feature);
-    },
-  };
-}
-
-export function initializeFeatures(initialValue: boolean) {
-  return Object.keys(featureConfig).reduce((features, key) => {
-    features[key] = initialValue;
-    return features;
-  }, {});
-}
-
-/**
- * Mocks the API for downloading the bundle tagged `tagName`.
- *
- * @returns the download URL for the bundle. This can be passed to the tools parameter of
- * `codeql.setupCodeQL`.
- */
-export function mockBundleDownloadApi({
-  apiDetails = SAMPLE_DOTCOM_API_DETAILS,
-  isPinned,
-  repo = "github/codeql-action",
-  platformSpecific = true,
-  tagName,
-}: {
-  apiDetails?: GitHubApiDetails;
-  isPinned?: boolean;
-  repo?: string;
-  platformSpecific?: boolean;
-  tagName: string;
-}): string {
-  const platform =
-    process.platform === "win32"
-      ? "win64"
-      : process.platform === "linux"
-        ? "linux64"
-        : "osx64";
-
-  const baseUrl = apiDetails?.url ?? "https://example.com";
-
-  const bundleUrls = ["tar.gz", "tar.zst"].map((extension) => {
-    const relativeUrl = apiDetails
-      ? `/${repo}/releases/download/${tagName}/codeql-bundle${
-          platformSpecific ? `-${platform}` : ""
-        }.${extension}`
-      : `/download/${tagName}/codeql-bundle.${extension}`;
-
-    nock(baseUrl)
-      .get(relativeUrl)
-      .replyWithFile(
-        200,
-        path.join(
-          __dirname,
-          `/../src/testdata/codeql-bundle${
-            isPinned ? "-pinned" : ""
-          }.${extension}`,
-        ),
-      );
-    return `${baseUrl}${relativeUrl}`;
-  });
-
-  // Choose an arbitrary URL to return
-  return bundleUrls[0];
-}
-
-export function createTestConfig(overrides: Partial): Config {
-  return Object.assign(
-    {},
-    {
-      version: getActionVersion(),
-      analysisKinds: [AnalysisKind.CodeScanning],
-      languages: [],
-      buildMode: undefined,
-      originalUserInput: {},
-      computedConfig: {},
-      tempDir: "",
-      codeQLCmd: "",
-      gitHubVersion: {
-        type: GitHubVariant.DOTCOM,
-      } as GitHubVersion,
-      dbLocation: "",
-      debugMode: false,
-      debugArtifactName: DEFAULT_DEBUG_ARTIFACT_NAME,
-      debugDatabaseName: DEFAULT_DEBUG_DATABASE_NAME,
-      trapCaches: {},
-      trapCacheDownloadTime: 0,
-      dependencyCachingEnabled: CachingKind.None,
-      dependencyCachingRestoredKeys: [],
-      extraQueryExclusions: [],
-      overlayDatabaseMode: OverlayDatabaseMode.None,
-      useOverlayDatabaseCaching: false,
-      overlayModeSetExplicitly: false,
-      repositoryProperties: {},
-      enableFileCoverageInformation: true,
-    } satisfies Config,
-    overrides,
-  );
-}
-
-export function makeTestToken(length: number = 36) {
-  const chars =
-    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
-  return chars.repeat(Math.ceil(length / chars.length)).slice(0, length);
-}
diff --git a/src/tools-download.test.ts b/src/tools-download.test.ts
deleted file mode 100644
index 66fe0e72e4..0000000000
--- a/src/tools-download.test.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import { once } from "events";
-import * as path from "path";
-
-import * as toolcache from "@actions/tool-cache";
-import test from "ava";
-import nock from "nock";
-import * as sinon from "sinon";
-
-import { getRunnerLogger } from "./logging";
-import * as tar from "./tar";
-import { setupTests } from "./testing-utils";
-import { downloadAndExtract } from "./tools-download";
-import { withTmpDir } from "./util";
-
-setupTests(test);
-
-test.serial(
-  "downloadAndExtract reports the duration when downloading before extracting",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      const archivePath = path.join(tmpDir, "codeql-bundle.tar.gz");
-      const destination = path.join(tmpDir, "codeql");
-      sinon.stub(toolcache, "downloadTool").resolves(archivePath);
-      sinon.stub(tar, "extract").resolves(destination);
-
-      const statusReport = await downloadAndExtract(
-        "https://example.com/codeql-bundle.tar.gz",
-        "gzip",
-        destination,
-        undefined,
-        {},
-        undefined,
-        getRunnerLogger(true),
-      );
-
-      t.assert(Number.isInteger(statusReport.downloadDurationMs));
-    });
-  },
-);
-
-test.serial(
-  "downloadAndExtract falls back to downloading before extracting if streaming fails",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      sinon.stub(process, "platform").value("linux");
-      const archivePath = path.join(tmpDir, "codeql-bundle.tar.zst");
-      const destination = path.join(tmpDir, "codeql");
-      const downloadTool = sinon
-        .stub(toolcache, "downloadTool")
-        .resolves(archivePath);
-      const extract = sinon.stub(tar, "extract").resolves(destination);
-      const extractTarZst = sinon.stub(tar, "extractTarZst").resolves();
-      const request = nock("https://example.com")
-        .get("/codeql-bundle.tar.zst")
-        .replyWithError(
-          Object.assign(new Error("socket hang up"), { code: "ECONNRESET" }),
-        );
-
-      const statusReport = await downloadAndExtract(
-        "https://example.com/codeql-bundle.tar.zst",
-        "zstd",
-        destination,
-        undefined,
-        {},
-        { type: "gnu", version: "1.34" },
-        getRunnerLogger(true),
-      );
-
-      t.assert(Number.isInteger(statusReport.downloadDurationMs));
-      t.true(request.isDone());
-      t.false(extractTarZst.called);
-      t.true(downloadTool.calledOnce);
-      t.true(extract.calledOnce);
-    });
-  },
-);
-
-test.serial(
-  "downloadAndExtract omits the download duration when streaming extraction",
-  async (t) => {
-    await withTmpDir(async (tmpDir) => {
-      sinon.stub(process, "platform").value("linux");
-      const downloadTool = sinon.stub(toolcache, "downloadTool");
-      const extractTarZst = sinon
-        .stub(tar, "extractTarZst")
-        .callsFake(async (archive) => {
-          if (typeof archive === "string") {
-            t.fail("Expected the Zstandard archive to be streamed.");
-            return;
-          }
-          const end = once(archive, "end");
-          archive.resume();
-          await end;
-        });
-      const request = nock("https://example.com")
-        .get("/codeql-bundle.tar.zst")
-        .reply(200, "archive");
-
-      const statusReport = await downloadAndExtract(
-        "https://example.com/codeql-bundle.tar.zst",
-        "zstd",
-        path.join(tmpDir, "codeql"),
-        undefined,
-        {},
-        { type: "gnu", version: "1.34" },
-        getRunnerLogger(true),
-      );
-
-      t.deepEqual(statusReport, {});
-      t.false(downloadTool.called);
-      t.true(extractTarZst.calledOnce);
-      t.true(request.isDone());
-    });
-  },
-);
diff --git a/src/tools-download.ts b/src/tools-download.ts
deleted file mode 100644
index 9b2fa8723a..0000000000
--- a/src/tools-download.ts
+++ /dev/null
@@ -1,200 +0,0 @@
-import * as fs from "fs";
-import { IncomingMessage, OutgoingHttpHeaders, RequestOptions } from "http";
-import * as os from "os";
-import * as path from "path";
-import { performance } from "perf_hooks";
-
-import * as core from "@actions/core";
-import { HttpClient } from "@actions/http-client";
-import * as toolcache from "@actions/tool-cache";
-import { https } from "follow-redirects";
-import * as semver from "semver";
-
-import { formatDuration, Logger } from "./logging";
-import * as tar from "./tar";
-import { cleanUpPath, getErrorMessage, getRequiredEnvParam } from "./util";
-
-/**
- * High watermark to use when streaming the download and extraction of the CodeQL tools.
- */
-const STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // 4 MiB
-
-/**
- * How long the streaming download of the CodeQL tools may stall for before we abort it. This
- * applies both to establishing the connection and to gaps between chunks of the response body.
- */
-const STREAMING_STALL_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
-
-/**
- * The name of the tool cache directory for the CodeQL tools.
- */
-const TOOLCACHE_TOOL_NAME = "CodeQL";
-
-export type ToolsDownloadStatusReport = {
-  downloadDurationMs?: number;
-};
-
-export async function downloadAndExtract(
-  codeqlURL: string,
-  compressionMethod: tar.CompressionMethod,
-  dest: string,
-  authorization: string | undefined,
-  headers: OutgoingHttpHeaders,
-  tarVersion: tar.TarVersion | undefined,
-  logger: Logger,
-): Promise {
-  logger.info(
-    `Downloading CodeQL tools from ${codeqlURL} . This may take a while.`,
-  );
-
-  try {
-    if (compressionMethod === "zstd" && process.platform === "linux") {
-      logger.info(`Streaming the extraction of the CodeQL bundle.`);
-
-      const toolsInstallStart = performance.now();
-      await downloadAndExtractZstdWithStreaming(
-        codeqlURL,
-        dest,
-        authorization,
-        headers,
-        tarVersion!,
-        logger,
-      );
-
-      const combinedDurationMs = Math.round(
-        performance.now() - toolsInstallStart,
-      );
-      logger.info(
-        `Finished downloading and extracting CodeQL bundle to ${dest} (${formatDuration(
-          combinedDurationMs,
-        )}).`,
-      );
-
-      return {};
-    }
-  } catch (e) {
-    core.warning(
-      `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}`,
-    );
-    core.warning(`Falling back to downloading the bundle before extracting.`);
-
-    // If we failed during processing, we want to clean up the destination directory
-    // before we try again.
-    await cleanUpPath(dest, "CodeQL bundle", logger);
-  }
-
-  const toolsDownloadStart = performance.now();
-  const archivedBundlePath = await toolcache.downloadTool(
-    codeqlURL,
-    undefined,
-    authorization,
-    headers,
-  );
-  const downloadDurationMs = Math.round(performance.now() - toolsDownloadStart);
-
-  logger.info(
-    `Finished downloading CodeQL bundle to ${archivedBundlePath} (${formatDuration(
-      downloadDurationMs,
-    )}).`,
-  );
-
-  let extractionDurationMs: number;
-
-  try {
-    logger.info("Extracting CodeQL bundle.");
-    const extractionStart = performance.now();
-    await tar.extract(
-      archivedBundlePath,
-      dest,
-      compressionMethod,
-      tarVersion,
-      logger,
-    );
-    extractionDurationMs = Math.round(performance.now() - extractionStart);
-    logger.info(
-      `Finished extracting CodeQL bundle to ${dest} (${formatDuration(
-        extractionDurationMs,
-      )}).`,
-    );
-  } finally {
-    await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger);
-  }
-
-  return { downloadDurationMs };
-}
-
-async function downloadAndExtractZstdWithStreaming(
-  codeqlURL: string,
-  dest: string,
-  authorization: string | undefined,
-  headers: OutgoingHttpHeaders,
-  tarVersion: tar.TarVersion,
-  logger: Logger,
-): Promise {
-  // Ensure destination exists
-  fs.mkdirSync(dest, { recursive: true });
-
-  // Get HTTP Agent to use (respects proxy settings).
-  const agent = new HttpClient().getAgent(codeqlURL);
-
-  // Add User-Agent header and Authorization header if provided.
-  headers = Object.assign(
-    { "User-Agent": "CodeQL Action" },
-    authorization ? { authorization } : {},
-    headers,
-  );
-  const response = await new Promise((resolve, reject) => {
-    const request = https.get(
-      codeqlURL,
-      {
-        headers,
-        // Increase the high water mark to improve performance.
-        highWaterMark: STREAMING_HIGH_WATERMARK_BYTES,
-        // Use the agent to respect proxy settings.
-        agent,
-      } as unknown as RequestOptions,
-      (r) => resolve(r),
-    );
-    // Without this listener, connection failures such as `ECONNRESET` are emitted as unhandled
-    // `error` events, which terminate the process instead of letting us fall back to downloading
-    // the bundle before extracting it. This listener stays attached after the response arrives, so
-    // it also handles errors that occur while the response is being streamed.
-    request.on("error", reject);
-    request.setTimeout(STREAMING_STALL_TIMEOUT_MS, () => {
-      request.destroy(
-        new Error(
-          `No data received for ${formatDuration(STREAMING_STALL_TIMEOUT_MS)}.`,
-        ),
-      );
-    });
-  });
-
-  if (response.statusCode !== 200) {
-    // Discard the response body so that the connection can be released.
-    response.resume();
-    throw new Error(
-      `Failed to download CodeQL bundle from ${codeqlURL}. HTTP status code: ${response.statusCode}.`,
-    );
-  }
-
-  await tar.extractTarZst(response, dest, tarVersion, logger);
-}
-
-/** Gets the path to the toolcache directory for the specified version of the CodeQL tools. */
-export function getToolcacheDirectory(version: string): string {
-  return path.join(
-    getRequiredEnvParam("RUNNER_TOOL_CACHE"),
-    TOOLCACHE_TOOL_NAME,
-    semver.clean(version) || version,
-    os.arch() || "",
-  );
-}
-
-export function writeToolcacheMarkerFile(
-  extractedPath: string,
-  logger: Logger,
-): void {
-  const markerFilePath = `${extractedPath}.complete`;
-  fs.writeFileSync(markerFilePath, "");
-  logger.info(`Created toolcache marker file ${markerFilePath}`);
-}
diff --git a/src/tools-features.test.ts b/src/tools-features.test.ts
deleted file mode 100644
index 825b9c1eb3..0000000000
--- a/src/tools-features.test.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import test from "ava";
-
-import { makeVersionInfo } from "./testing-utils";
-import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
-
-test("isSupportedToolsFeature", async (t) => {
-  const versionInfo = makeVersionInfo("1.0.0");
-
-  t.false(
-    isSupportedToolsFeature(versionInfo, ToolsFeature.BundleSupportsOverlay),
-  );
-
-  versionInfo.features = { bundleSupportsOverlay: true };
-
-  t.true(
-    isSupportedToolsFeature(versionInfo, ToolsFeature.BundleSupportsOverlay),
-  );
-});
diff --git a/src/tools-features.ts b/src/tools-features.ts
deleted file mode 100644
index 4931be65ba..0000000000
--- a/src/tools-features.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import * as semver from "semver";
-
-import type { VersionInfo } from "./cli/types";
-
-export enum ToolsFeature {
-  BuiltinExtractorsSpecifyDefaultQueries = "builtinExtractorsSpecifyDefaultQueries",
-  BundleSupportsIncludeOption = "bundleSupportsIncludeOption",
-  BundleSupportsOverlay = "bundleSupportsOverlay",
-  IndirectTracingSupportsStaticBinaries = "indirectTracingSupportsStaticBinaries",
-  SuppressesMissingFileBaselineWarning = "suppressesMissingFileBaselineWarning",
-}
-
-/**
- * Determines if the given feature is supported by the CLI.
- *
- * @param versionInfo Version information, including features, returned by the CLI.
- * @param feature The feature to check for.
- * @returns True if the feature is supported or false otherwise.
- */
-export function isSupportedToolsFeature(
-  versionInfo: VersionInfo,
-  feature: ToolsFeature,
-): boolean {
-  return !!versionInfo.features && versionInfo.features[feature];
-}
-
-export const SafeArtifactUploadVersion = "2.20.3";
-
-/**
- * The first version of the CodeQL CLI where artifact upload is safe to use
- * for failed runs. This is not really a feature flag, but it is easiest to
- * model the behavior as a feature flag.
- *
- * This was not captured in a tools feature, so we need to use semver.
- *
- * @param codeQlVersion The version of the CodeQL CLI to check. If not provided, it is assumed to be safe.
- * @returns True if artifact upload is safe to use for failed runs or false otherwise.
- */
-export function isSafeArtifactUpload(codeQlVersion?: string): boolean {
-  return !codeQlVersion
-    ? true
-    : semver.gte(codeQlVersion, SafeArtifactUploadVersion);
-}
diff --git a/src/tracer-config.test.ts b/src/tracer-config.test.ts
deleted file mode 100644
index 58f844b8e7..0000000000
--- a/src/tracer-config.test.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import test from "ava";
-import * as sinon from "sinon";
-
-import { CodeQL, getCodeQLForTesting } from "./codeql";
-import * as configUtils from "./config-utils";
-import { BuiltInLanguage } from "./languages";
-import { createTestConfig, makeVersionInfo, setupTests } from "./testing-utils";
-import { ToolsFeature } from "./tools-features";
-import { getCombinedTracerConfig } from "./tracer-config";
-import * as util from "./util";
-
-setupTests(test);
-
-function getTestConfig(tempDir: string): configUtils.Config {
-  return createTestConfig({
-    languages: [BuiltInLanguage.java],
-    tempDir,
-    dbLocation: path.resolve(tempDir, "codeql_databases"),
-  });
-}
-
-async function stubCodeql(
-  enabledFeatures: ToolsFeature[] = [],
-): Promise {
-  const codeqlObject = await getCodeQLForTesting();
-  sinon
-    .stub(codeqlObject, "getVersion")
-    .resolves(
-      makeVersionInfo(
-        "1.0.0",
-        Object.fromEntries(enabledFeatures.map((f) => [f, true])),
-      ),
-    );
-  sinon
-    .stub(codeqlObject, "isTracedLanguage")
-    .withArgs(BuiltInLanguage.java)
-    .resolves(true);
-  return codeqlObject;
-}
-
-test("getCombinedTracerConfig - return undefined when no languages are traced languages", async (t) => {
-  await util.withTmpDir(async (tmpDir) => {
-    const config = getTestConfig(tmpDir);
-    // No traced languages
-    config.languages = [BuiltInLanguage.javascript, BuiltInLanguage.python];
-    t.deepEqual(
-      await getCombinedTracerConfig(await stubCodeql(), config),
-      undefined,
-    );
-  });
-});
-
-test("getCombinedTracerConfig", async (t) => {
-  await util.withTmpDir(async (tmpDir) => {
-    const config = getTestConfig(tmpDir);
-
-    const bundlePath = path.join(tmpDir, "bundle");
-    const codeqlPlatform =
-      process.platform === "win32"
-        ? "win64"
-        : process.platform === "darwin"
-          ? "osx64"
-          : "linux64";
-    const startTracingEnv = {
-      foo: "bar",
-      CODEQL_DIST: bundlePath,
-      CODEQL_PLATFORM: codeqlPlatform,
-    };
-
-    const tracingEnvironmentDir = path.join(
-      config.dbLocation,
-      "temp",
-      "tracingEnvironment",
-    );
-    fs.mkdirSync(tracingEnvironmentDir, { recursive: true });
-    const startTracingJson = path.join(
-      tracingEnvironmentDir,
-      "start-tracing.json",
-    );
-    fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
-
-    const result = await getCombinedTracerConfig(await stubCodeql(), config);
-    t.notDeepEqual(result, undefined);
-
-    t.false(Object.prototype.hasOwnProperty.call(result?.env, "CODEQL_RUNNER"));
-  });
-});
diff --git a/src/tracer-config.ts b/src/tracer-config.ts
deleted file mode 100644
index d786d46515..0000000000
--- a/src/tracer-config.ts
+++ /dev/null
@@ -1,105 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import { type CodeQL } from "./codeql";
-import { type Config } from "./config-utils";
-import { Logger } from "./logging";
-import { asyncSome, BuildMode } from "./util";
-
-export type TracerConfig = {
-  env: { [key: string]: string };
-};
-
-export async function shouldEnableIndirectTracing(
-  codeql: CodeQL,
-  config: Config,
-): Promise {
-  // We don't need to trace build mode none, or languages which unconditionally don't need tracing.
-  if (config.buildMode === BuildMode.None) {
-    return false;
-  }
-
-  // If the CLI supports `trace-command` with a `--build-mode`, we'll use direct tracing instead of
-  // indirect tracing.
-  if (config.buildMode === BuildMode.Autobuild) {
-    return false;
-  }
-
-  // Otherwise, use direct tracing if any of the languages need to be traced.
-  return asyncSome(config.languages, (l) => codeql.isTracedLanguage(l));
-}
-
-/**
- * Delete variables as specified by the end-tracing script
- *
- * WARNING: This does not _really_ end tracing, as the tracer will restore its
- * critical environment variables and it'll still be active for all processes
- * launched from this build step.
- *
- * However, it will stop tracing for all steps past the current build step.
- */
-export async function endTracingForCluster(
-  codeql: CodeQL,
-  config: Config,
-  logger: Logger,
-): Promise {
-  if (!(await shouldEnableIndirectTracing(codeql, config))) return;
-
-  logger.info(
-    "Unsetting build tracing environment variables. Subsequent steps of this job will not be traced.",
-  );
-
-  const envVariablesFile = path.resolve(
-    config.dbLocation,
-    "temp/tracingEnvironment/end-tracing.json",
-  );
-  if (!fs.existsSync(envVariablesFile)) {
-    throw new Error(
-      `Environment file for ending tracing not found: ${envVariablesFile}`,
-    );
-  }
-  try {
-    const endTracingEnvVariables: Map = JSON.parse(
-      fs.readFileSync(envVariablesFile, "utf8"),
-    );
-    for (const [key, value] of Object.entries(endTracingEnvVariables)) {
-      if (value !== null) {
-        process.env[key] = value;
-      } else {
-        delete process.env[key];
-      }
-    }
-  } catch (e) {
-    throw new Error(
-      `Failed to parse file containing end tracing environment variables: ${e}`,
-    );
-  }
-}
-
-async function getTracerConfigForCluster(
-  config: Config,
-): Promise {
-  const tracingEnvVariables = JSON.parse(
-    fs.readFileSync(
-      path.resolve(
-        config.dbLocation,
-        "temp/tracingEnvironment/start-tracing.json",
-      ),
-      "utf8",
-    ),
-  );
-  return {
-    env: tracingEnvVariables,
-  };
-}
-
-export async function getCombinedTracerConfig(
-  codeql: CodeQL,
-  config: Config,
-): Promise {
-  if (!(await shouldEnableIndirectTracing(codeql, config))) {
-    return undefined;
-  }
-
-  return await getTracerConfigForCluster(config);
-}
diff --git a/src/trap-caching.test.ts b/src/trap-caching.test.ts
deleted file mode 100644
index 478305e577..0000000000
--- a/src/trap-caching.test.ts
+++ /dev/null
@@ -1,281 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as cache from "@actions/cache";
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import * as apiClient from "./api-client";
-import {
-  getTrapCachingExtractorConfigArgs,
-  getTrapCachingExtractorConfigArgsForLang,
-  createStubCodeQL,
-} from "./codeql";
-import * as configUtils from "./config-utils";
-import { Feature } from "./feature-flags";
-import * as gitUtils from "./git-utils";
-import { BuiltInLanguage } from "./languages";
-import { getRunnerLogger } from "./logging";
-import {
-  createFeatures,
-  createTestConfig,
-  getRecordingLogger,
-  makeVersionInfo,
-  setupTests,
-} from "./testing-utils";
-import {
-  cleanupTrapCaches,
-  downloadTrapCaches,
-  getLanguagesSupportingCaching,
-  uploadTrapCaches,
-} from "./trap-caching";
-import * as util from "./util";
-
-setupTests(test);
-
-const stubCodeql = createStubCodeQL({
-  async getVersion() {
-    return makeVersionInfo("2.10.3");
-  },
-  async resolveLanguages() {
-    return {
-      extractors: {
-        [BuiltInLanguage.javascript]: [
-          {
-            extractor_root: "some_root",
-            extractor_options: {
-              trap: {
-                properties: {
-                  cache: {
-                    properties: {
-                      dir: {
-                        title: "Cache directory",
-                      },
-                      bound: {
-                        title: "Cache bound",
-                      },
-                      write: {
-                        title: "Cache write",
-                      },
-                    },
-                  },
-                },
-              },
-            },
-          },
-        ],
-        [BuiltInLanguage.cpp]: [
-          {
-            extractor_root: "other_root",
-          },
-        ],
-      },
-    };
-  },
-});
-
-const testConfigWithoutTmpDir = createTestConfig({
-  languages: [BuiltInLanguage.javascript, BuiltInLanguage.cpp],
-  trapCaches: {
-    javascript: "/some/cache/dir",
-  },
-});
-
-function getTestConfigWithTempDir(tempDir: string): configUtils.Config {
-  return createTestConfig({
-    languages: [BuiltInLanguage.javascript, BuiltInLanguage.ruby],
-    tempDir,
-    dbLocation: path.resolve(tempDir, "codeql_databases"),
-    trapCaches: {
-      javascript: path.resolve(tempDir, "jsCache"),
-      ruby: path.resolve(tempDir, "rubyCache"),
-    },
-  });
-}
-
-test.serial("check flags for JS, analyzing default branch", async (t) => {
-  await util.withTmpDir(async (tmpDir) => {
-    const config = getTestConfigWithTempDir(tmpDir);
-    sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-    const result = await getTrapCachingExtractorConfigArgsForLang(
-      config,
-      BuiltInLanguage.javascript,
-    );
-    t.deepEqual(result, [
-      `-O=javascript.trap.cache.dir=${path.resolve(tmpDir, "jsCache")}`,
-      "-O=javascript.trap.cache.bound=1024",
-      "-O=javascript.trap.cache.write=true",
-    ]);
-  });
-});
-
-test.serial("check flags for all, not analyzing default branch", async (t) => {
-  await util.withTmpDir(async (tmpDir) => {
-    const config = getTestConfigWithTempDir(tmpDir);
-    sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(false);
-    const result = await getTrapCachingExtractorConfigArgs(config);
-    t.deepEqual(result, [
-      `-O=javascript.trap.cache.dir=${path.resolve(tmpDir, "jsCache")}`,
-      "-O=javascript.trap.cache.bound=1024",
-      "-O=javascript.trap.cache.write=false",
-      `-O=ruby.trap.cache.dir=${path.resolve(tmpDir, "rubyCache")}`,
-      "-O=ruby.trap.cache.bound=1024",
-      "-O=ruby.trap.cache.write=false",
-    ]);
-  });
-});
-
-test("get languages that support TRAP caching", async (t) => {
-  const loggedMessages = [];
-  const logger = getRecordingLogger(loggedMessages);
-  const languagesSupportingCaching = await getLanguagesSupportingCaching(
-    stubCodeql,
-    [BuiltInLanguage.javascript, BuiltInLanguage.cpp],
-    logger,
-  );
-  t.deepEqual(languagesSupportingCaching, [BuiltInLanguage.javascript]);
-});
-
-test.serial("upload cache key contains right fields", async (t) => {
-  const loggedMessages = [];
-  const logger = getRecordingLogger(loggedMessages);
-  sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-  sinon.stub(util, "tryGetFolderBytes").resolves(999_999_999);
-  const stubSave = sinon.stub(cache, "saveCache");
-  process.env.GITHUB_SHA = "somesha";
-  await uploadTrapCaches(stubCodeql, testConfigWithoutTmpDir, logger);
-  t.assert(
-    stubSave.calledOnceWith(
-      sinon.match.array.contains(["/some/cache/dir"]),
-      sinon
-        .match("somesha")
-        .and(sinon.match("2.10.3"))
-        .and(sinon.match("javascript")),
-    ),
-  );
-});
-
-test.serial(
-  "download cache looks for the right key and creates dir",
-  async (t) => {
-    await util.withTmpDir(async (tmpDir) => {
-      const loggedMessages = [];
-      const logger = getRecordingLogger(loggedMessages);
-      sinon.stub(actionsUtil, "getTemporaryDirectory").returns(tmpDir);
-      sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(false);
-      const stubRestore = sinon.stub(cache, "restoreCache").resolves("found");
-      const eventFile = path.resolve(tmpDir, "event.json");
-      process.env.GITHUB_EVENT_NAME = "pull_request";
-      process.env.GITHUB_EVENT_PATH = eventFile;
-      fs.writeFileSync(
-        eventFile,
-        JSON.stringify({
-          pull_request: {
-            base: {
-              sha: "somesha",
-            },
-          },
-        }),
-      );
-      await downloadTrapCaches(
-        stubCodeql,
-        [BuiltInLanguage.javascript, BuiltInLanguage.cpp],
-        logger,
-      );
-      t.assert(
-        stubRestore.calledOnceWith(
-          sinon.match.array.contains([
-            path.resolve(tmpDir, "trapCaches", "javascript"),
-          ]),
-          sinon
-            .match("somesha")
-            .and(sinon.match("2.10.3"))
-            .and(sinon.match("javascript")),
-        ),
-      );
-      t.assert(fs.existsSync(path.resolve(tmpDir, "trapCaches", "javascript")));
-    });
-  },
-);
-
-test.serial("cleanup removes only old CodeQL TRAP caches", async (t) => {
-  await util.withTmpDir(async (tmpDir) => {
-    // This config specifies that we are analyzing JavaScript and Ruby, but not Swift.
-    const config = getTestConfigWithTempDir(tmpDir);
-
-    sinon.stub(gitUtils, "getRef").resolves("refs/heads/main");
-    sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
-    const listStub = sinon.stub(apiClient, "listActionsCaches").resolves([
-      // Should be kept, since it's not relevant to CodeQL. In reality, the API shouldn't return
-      // this in the first place, but this is a defensive check.
-      {
-        id: 1,
-        key: "some-other-key",
-        created_at: "2024-05-23T14:25:00Z",
-        size_in_bytes: 100 * 1024 * 1024,
-      },
-      // Should be kept, since it's the newest TRAP cache for JavaScript
-      {
-        id: 2,
-        key: "codeql-trap-1-2.0.0-javascript-newest",
-        created_at: "2024-04-23T14:25:00Z",
-        size_in_bytes: 50 * 1024 * 1024,
-      },
-      // Should be cleaned up
-      {
-        id: 3,
-        key: "codeql-trap-1-2.0.0-javascript-older",
-        created_at: "2024-03-22T14:25:00Z",
-        size_in_bytes: 200 * 1024 * 1024,
-      },
-      // Should be cleaned up
-      {
-        id: 4,
-        key: "codeql-trap-1-2.0.0-javascript-oldest",
-        created_at: "2024-02-21T14:25:00Z",
-        size_in_bytes: 300 * 1024 * 1024,
-      },
-      // Should be kept, since it's the newest TRAP cache for Ruby
-      {
-        id: 5,
-        key: "codeql-trap-1-2.0.0-ruby-newest",
-        created_at: "2024-02-20T14:25:00Z",
-        size_in_bytes: 300 * 1024 * 1024,
-      },
-      // Should be kept, since we aren't analyzing Swift
-      {
-        id: 6,
-        key: "codeql-trap-1-2.0.0-swift-newest",
-        created_at: "2024-02-22T14:25:00Z",
-        size_in_bytes: 300 * 1024 * 1024,
-      },
-      // Should be kept, since we aren't analyzing Swift
-      {
-        id: 7,
-        key: "codeql-trap-1-2.0.0-swift-older",
-        created_at: "2024-02-21T14:25:00Z",
-        size_in_bytes: 300 * 1024 * 1024,
-      },
-    ]);
-
-    const deleteStub = sinon.stub(apiClient, "deleteActionsCache").resolves();
-
-    const statusReport = await cleanupTrapCaches(
-      config,
-      createFeatures([Feature.CleanupTrapCaches]),
-      getRunnerLogger(true),
-    );
-
-    t.is(listStub.callCount, 1);
-    t.assert(listStub.calledWithExactly("codeql-trap", "refs/heads/main"));
-
-    t.deepEqual(statusReport, {
-      trap_cache_cleanup_size_bytes: 500 * 1024 * 1024,
-    });
-
-    t.is(deleteStub.callCount, 2);
-    t.assert(deleteStub.calledWithExactly(3));
-    t.assert(deleteStub.calledWithExactly(4));
-  });
-});
diff --git a/src/trap-caching.ts b/src/trap-caching.ts
deleted file mode 100644
index a802aac892..0000000000
--- a/src/trap-caching.ts
+++ /dev/null
@@ -1,335 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as actionsCache from "@actions/cache";
-
-import * as actionsUtil from "./actions-util";
-import * as apiClient from "./api-client";
-import { type CodeQL } from "./codeql";
-import { type Config } from "./config-utils";
-import { DocUrl } from "./doc-url";
-import { Feature, FeatureEnablement } from "./feature-flags";
-import * as gitUtils from "./git-utils";
-import { Language } from "./languages";
-import { Logger } from "./logging";
-import {
-  asHTTPError,
-  getErrorMessage,
-  tryGetFolderBytes,
-  waitForResultWithTimeLimit,
-} from "./util";
-
-// This constant should be bumped if we make a breaking change
-// to how the CodeQL Action stores or retrieves the TRAP cache,
-// and will invalidate previous caches. We don't need to bump
-// this for CLI/extractor changes, since the CLI version also
-// goes into the cache key.
-const CACHE_VERSION = 1;
-
-const CODEQL_TRAP_CACHE_PREFIX = "codeql-trap";
-
-// This constant sets the minimum size in megabytes of a TRAP
-// cache for us to consider it worth uploading.
-const MINIMUM_CACHE_MB_TO_UPLOAD = 10;
-
-// The maximum number of milliseconds to wait for TRAP cache
-// uploads or downloads to complete before continuing. Note
-// this timeout is per operation, so will be run as many
-// times as there are languages with TRAP caching enabled.
-const MAX_CACHE_OPERATION_MS = 120_000; // Two minutes
-
-/**
- * Download TRAP caches from the Actions cache.
- * @param codeql The CodeQL instance to use.
- * @param languages The languages being analyzed.
- * @param logger A logger to record some informational messages to.
- * @returns A partial map from languages to TRAP cache paths on disk, with
- * languages for which we shouldn't use TRAP caching omitted.
- */
-export async function downloadTrapCaches(
-  codeql: CodeQL,
-  languages: Language[],
-  logger: Logger,
-): Promise<{ [language: string]: string }> {
-  const result: { [language: string]: string } = {};
-  const languagesSupportingCaching = await getLanguagesSupportingCaching(
-    codeql,
-    languages,
-    logger,
-  );
-  logger.info(
-    `Found ${languagesSupportingCaching.length} languages that support TRAP caching`,
-  );
-  if (languagesSupportingCaching.length === 0) return result;
-
-  const cachesDir = path.join(
-    actionsUtil.getTemporaryDirectory(),
-    "trapCaches",
-  );
-  for (const language of languagesSupportingCaching) {
-    const cacheDir = path.join(cachesDir, language);
-    fs.mkdirSync(cacheDir, { recursive: true });
-    result[language] = cacheDir;
-  }
-
-  if (await gitUtils.isAnalyzingDefaultBranch()) {
-    logger.info(
-      "Analyzing default branch. Skipping downloading of TRAP caches.",
-    );
-    return result;
-  }
-
-  let baseSha = "unknown";
-  const eventPath = process.env.GITHUB_EVENT_PATH;
-  if (
-    actionsUtil.getWorkflowEventName() === "pull_request" &&
-    eventPath !== undefined
-  ) {
-    const event = JSON.parse(fs.readFileSync(path.resolve(eventPath), "utf-8"));
-    baseSha = event.pull_request?.base?.sha || baseSha;
-  }
-  for (const language of languages) {
-    const cacheDir = result[language];
-    if (cacheDir === undefined) continue;
-    // The SHA from the base of the PR is the most similar commit we might have a cache for
-    const preferredKey = await cacheKey(codeql, language, baseSha);
-    logger.info(
-      `Looking in Actions cache for TRAP cache with key ${preferredKey}`,
-    );
-    const found = await waitForResultWithTimeLimit(
-      MAX_CACHE_OPERATION_MS,
-      actionsCache.restoreCache([cacheDir], preferredKey, [
-        // Fall back to any cache with the right key prefix
-        await cachePrefix(codeql, language),
-      ]),
-      () => {
-        logger.info(
-          `Timed out downloading cache for ${language}, will continue without it`,
-        );
-      },
-    );
-    if (found === undefined) {
-      // We didn't find a TRAP cache in the Actions cache, so the directory on disk is
-      // still just an empty directory. There's no reason to tell the extractor to use it,
-      // so let's unset the entry in the map so we don't set any extractor options.
-      logger.info(`No TRAP cache found in Actions cache for ${language}`);
-      delete result[language];
-    }
-  }
-
-  return result;
-}
-
-/**
- * Possibly upload TRAP caches to the Actions cache.
- * @param codeql The CodeQL instance to use.
- * @param config The configuration for this workflow.
- * @param logger A logger to record some informational messages to.
- * @returns Whether the TRAP caches were uploaded.
- */
-export async function uploadTrapCaches(
-  codeql: CodeQL,
-  config: Config,
-  logger: Logger,
-): Promise {
-  if (!(await gitUtils.isAnalyzingDefaultBranch())) return false; // Only upload caches from the default branch
-
-  for (const language of config.languages) {
-    const cacheDir = config.trapCaches[language];
-    if (cacheDir === undefined) continue;
-    const trapFolderSize = await tryGetFolderBytes(cacheDir, logger);
-    if (trapFolderSize === undefined) {
-      logger.info(
-        `Skipping upload of TRAP cache for ${language} as we couldn't determine its size`,
-      );
-      continue;
-    }
-    if (trapFolderSize < MINIMUM_CACHE_MB_TO_UPLOAD * 1_048_576) {
-      logger.info(
-        `Skipping upload of TRAP cache for ${language} as it is too small`,
-      );
-      continue;
-    }
-    const key = await cacheKey(
-      codeql,
-      language,
-      process.env.GITHUB_SHA || "unknown",
-    );
-    logger.info(`Uploading TRAP cache to Actions cache with key ${key}`);
-    await waitForResultWithTimeLimit(
-      MAX_CACHE_OPERATION_MS,
-      actionsCache.saveCache([cacheDir], key),
-      () => {
-        logger.info(
-          `Timed out waiting for TRAP cache for ${language} to upload, will continue without uploading`,
-        );
-      },
-    );
-  }
-  return true;
-}
-
-export interface TrapCacheCleanupStatusReport {
-  trap_cache_cleanup_error?: string;
-  trap_cache_cleanup_size_bytes?: number;
-  trap_cache_cleanup_skipped_because?: string;
-}
-
-export async function cleanupTrapCaches(
-  config: Config,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise {
-  if (!(await features.getValue(Feature.CleanupTrapCaches))) {
-    return {
-      trap_cache_cleanup_skipped_because: "feature disabled",
-    };
-  }
-  logger.warning(
-    "TRAP cache cleanup is deprecated and will be removed in May 2026. " +
-      "We recommend instead disabling TRAP caching by passing the `trap-caching: false` input to the `init` Action.",
-  );
-  if (!(await gitUtils.isAnalyzingDefaultBranch())) {
-    return {
-      trap_cache_cleanup_skipped_because: "not analyzing default branch",
-    };
-  }
-
-  try {
-    let totalBytesCleanedUp = 0;
-
-    const allCaches = await apiClient.listActionsCaches(
-      CODEQL_TRAP_CACHE_PREFIX,
-      await gitUtils.getRef(),
-    );
-
-    for (const language of config.languages) {
-      if (config.trapCaches[language]) {
-        const cachesToRemove = await getTrapCachesForLanguage(
-          allCaches,
-          language,
-          logger,
-        );
-        // Dates returned by the API are in ISO 8601 format, so we can sort them lexicographically
-        cachesToRemove.sort((a, b) => a.created_at.localeCompare(b.created_at));
-        // Keep the most recent cache
-        const mostRecentCache = cachesToRemove.pop();
-        logger.debug(
-          `Keeping most recent TRAP cache (${JSON.stringify(mostRecentCache)})`,
-        );
-
-        if (cachesToRemove.length === 0) {
-          logger.info(`No TRAP caches to clean up for ${language}.`);
-          continue;
-        }
-
-        for (const cache of cachesToRemove) {
-          logger.debug(`Cleaning up TRAP cache (${JSON.stringify(cache)})`);
-          await apiClient.deleteActionsCache(cache.id);
-        }
-        const bytesCleanedUp = cachesToRemove.reduce(
-          (acc, item) => acc + item.size_in_bytes,
-          0,
-        );
-        totalBytesCleanedUp += bytesCleanedUp;
-        const megabytesCleanedUp = (bytesCleanedUp / (1024 * 1024)).toFixed(2);
-        logger.info(
-          `Cleaned up ${megabytesCleanedUp} MiB of old TRAP caches for ${language}.`,
-        );
-      }
-    }
-    return { trap_cache_cleanup_size_bytes: totalBytesCleanedUp };
-  } catch (e) {
-    if (asHTTPError(e)?.status === 403) {
-      logger.warning(
-        "Could not cleanup TRAP caches as the token did not have the required permissions. " +
-          'To clean up TRAP caches, ensure the token has the "actions:write" permission. ' +
-          `See ${DocUrl.ASSIGNING_PERMISSIONS_TO_JOBS} for more information.`,
-      );
-    } else {
-      logger.info(`Failed to cleanup TRAP caches, continuing. Details: ${e}`);
-    }
-    return { trap_cache_cleanup_error: getErrorMessage(e) };
-  }
-}
-
-async function getTrapCachesForLanguage(
-  allCaches: apiClient.ActionsCacheItem[],
-  language: Language,
-  logger: Logger,
-): Promise>> {
-  logger.debug(`Listing TRAP caches for ${language}`);
-
-  for (const cache of allCaches) {
-    if (!cache.created_at || !cache.id || !cache.key || !cache.size_in_bytes) {
-      throw new Error(
-        "An unexpected cache item was returned from the API that was missing one or " +
-          `more required fields: ${JSON.stringify(cache)}`,
-      );
-    }
-  }
-
-  return allCaches.filter((cache) => {
-    return cache.key?.includes(`-${language}-`);
-  }) as Array>;
-}
-
-export async function getLanguagesSupportingCaching(
-  codeql: CodeQL,
-  languages: Language[],
-  logger: Logger,
-): Promise {
-  const result: Language[] = [];
-  const resolveResult = await codeql.resolveLanguages();
-  outer: for (const lang of languages) {
-    const extractorsForLanguage = resolveResult.extractors[lang];
-    if (extractorsForLanguage === undefined) {
-      logger.info(
-        `${lang} does not support TRAP caching (couldn't find an extractor)`,
-      );
-      continue;
-    }
-    if (extractorsForLanguage.length !== 1) {
-      logger.info(
-        `${lang} does not support TRAP caching (found multiple extractors)`,
-      );
-      continue;
-    }
-    const extractor = extractorsForLanguage[0];
-    const trapCacheOptions =
-      extractor.extractor_options?.trap?.properties?.cache?.properties;
-    if (trapCacheOptions === undefined) {
-      logger.info(
-        `${lang} does not support TRAP caching (missing option group)`,
-      );
-      continue;
-    }
-    for (const requiredOpt of ["dir", "bound", "write"]) {
-      if (!(requiredOpt in trapCacheOptions)) {
-        logger.info(
-          `${lang} does not support TRAP caching (missing ${requiredOpt} option)`,
-        );
-        continue outer;
-      }
-    }
-    result.push(lang);
-  }
-  return result;
-}
-
-async function cacheKey(
-  codeql: CodeQL,
-  language: Language,
-  baseSha: string,
-): Promise {
-  return `${await cachePrefix(codeql, language)}${baseSha}`;
-}
-
-async function cachePrefix(
-  codeql: CodeQL,
-  language: Language,
-): Promise {
-  return `${CODEQL_TRAP_CACHE_PREFIX}-${CACHE_VERSION}-${
-    (await codeql.getVersion()).version
-  }-${language}-`;
-}
diff --git a/src/upload-lib-stub.js.tpl b/src/upload-lib-stub.js.tpl
deleted file mode 100644
index 0f4b0808ba..0000000000
--- a/src/upload-lib-stub.js.tpl
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-module.exports = require("./entry-points").__UPLOAD_LIB_EXPORT__;
diff --git a/src/upload-lib.test.ts b/src/upload-lib.test.ts
deleted file mode 100644
index 2c27d56c1c..0000000000
--- a/src/upload-lib.test.ts
+++ /dev/null
@@ -1,1045 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import * as github from "@actions/github";
-import { HTTPError } from "@actions/tool-cache";
-import test from "ava";
-import * as sinon from "sinon";
-
-import * as analyses from "./analyses";
-import { AnalysisKind, CodeQuality, CodeScanning } from "./analyses";
-import * as api from "./api-client";
-import * as diffUtils from "./diff-informed-analysis-utils";
-import { getRunnerLogger, Logger } from "./logging";
-import * as sarif from "./sarif";
-import { setupTests } from "./testing-utils";
-import * as uploadLib from "./upload-lib";
-import { UploadPayload } from "./upload-lib/types";
-import { GitHubVariant, initializeEnvironment, withTmpDir } from "./util";
-
-setupTests(test);
-
-test.beforeEach(() => {
-  initializeEnvironment("1.2.3");
-});
-
-test.serial("validateSarifFileSchema - valid", (t) => {
-  const inputFile = `${__dirname}/../src/testdata/valid-sarif.sarif`;
-  t.notThrows(() =>
-    uploadLib.validateSarifFileSchema(
-      uploadLib.readSarifFileOrThrow(inputFile),
-      inputFile,
-      getRunnerLogger(true),
-    ),
-  );
-});
-
-test.serial("validateSarifFileSchema - invalid", (t) => {
-  const inputFile = `${__dirname}/../src/testdata/invalid-sarif.sarif`;
-  t.throws(() =>
-    uploadLib.validateSarifFileSchema(
-      uploadLib.readSarifFileOrThrow(inputFile),
-      inputFile,
-      getRunnerLogger(true),
-    ),
-  );
-});
-
-test.serial(
-  "validate correct payload used for push, PR merge commit, and PR head",
-  async (t) => {
-    process.env["GITHUB_EVENT_NAME"] = "push";
-    const pushPayload: any = uploadLib.buildPayload(
-      "commit",
-      "refs/heads/master",
-      "key",
-      undefined,
-      "",
-      1234,
-      1,
-      "/opt/src",
-      undefined,
-      ["CodeQL", "eslint"],
-      "mergeBaseCommit",
-    );
-    // Not triggered by a pull request
-    t.falsy(pushPayload.base_ref);
-    t.falsy(pushPayload.base_sha);
-
-    process.env["GITHUB_EVENT_NAME"] = "pull_request";
-    process.env["GITHUB_SHA"] = "commit";
-    process.env["GITHUB_BASE_REF"] = "master";
-    process.env["GITHUB_EVENT_PATH"] =
-      `${__dirname}/../src/testdata/pull_request.json`;
-    const prMergePayload: any = uploadLib.buildPayload(
-      "commit",
-      "refs/pull/123/merge",
-      "key",
-      undefined,
-      "",
-      1234,
-      1,
-      "/opt/src",
-      undefined,
-      ["CodeQL", "eslint"],
-      "mergeBaseCommit",
-    );
-    // Uploads for a merge commit use the merge base
-    t.deepEqual(prMergePayload.base_ref, "refs/heads/master");
-    t.deepEqual(prMergePayload.base_sha, "mergeBaseCommit");
-
-    const prHeadPayload: any = uploadLib.buildPayload(
-      "headCommit",
-      "refs/pull/123/head",
-      "key",
-      undefined,
-      "",
-      1234,
-      1,
-      "/opt/src",
-      undefined,
-      ["CodeQL", "eslint"],
-      "mergeBaseCommit",
-    );
-    // Uploads for the head use the PR base
-    t.deepEqual(prHeadPayload.base_ref, "refs/heads/master");
-    t.deepEqual(
-      prHeadPayload.base_sha,
-      "f95f852bd8fca8fcc58a9a2d6c842781e32a215e",
-    );
-  },
-);
-
-test.serial("finding SARIF files", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    // include a couple of sarif files
-    fs.writeFileSync(path.join(tmpDir, "a.sarif"), "");
-    fs.writeFileSync(path.join(tmpDir, "b.sarif"), "");
-
-    // other random files shouldn't be returned
-    fs.writeFileSync(path.join(tmpDir, "c.foo"), "");
-
-    // we should recursively look in subdirectories
-    fs.mkdirSync(path.join(tmpDir, "dir1"));
-    fs.writeFileSync(path.join(tmpDir, "dir1", "d.sarif"), "");
-    fs.mkdirSync(path.join(tmpDir, "dir1", "dir2"));
-    fs.writeFileSync(path.join(tmpDir, "dir1", "dir2", "e.sarif"), "");
-
-    // we should ignore symlinks
-    fs.mkdirSync(path.join(tmpDir, "dir3"));
-    fs.symlinkSync(tmpDir, path.join(tmpDir, "dir3", "symlink1"), "dir");
-    fs.symlinkSync(
-      path.join(tmpDir, "a.sarif"),
-      path.join(tmpDir, "dir3", "symlink2.sarif"),
-      "file",
-    );
-
-    // add some non-Code Scanning files that should be ignored, unless we look for them specifically
-    for (const analysisKind of analyses.supportedAnalysisKinds) {
-      if (analysisKind === AnalysisKind.CodeScanning) continue;
-
-      const analysis = analyses.getAnalysisConfig(analysisKind);
-
-      fs.writeFileSync(path.join(tmpDir, `a${analysis.sarifExtension}`), "");
-      fs.writeFileSync(
-        path.join(tmpDir, "dir1", `b${analysis.sarifExtension}`),
-        "",
-      );
-    }
-
-    const expectedSarifFiles: Partial> = {};
-    expectedSarifFiles[AnalysisKind.CodeScanning] = [
-      path.join(tmpDir, "a.sarif"),
-      path.join(tmpDir, "b.sarif"),
-      path.join(tmpDir, "dir1", "d.sarif"),
-      path.join(tmpDir, "dir1", "dir2", "e.sarif"),
-    ];
-    const sarifFiles = uploadLib.findSarifFilesInDir(
-      tmpDir,
-      CodeScanning.sarifPredicate,
-    );
-
-    t.deepEqual(sarifFiles, expectedSarifFiles[AnalysisKind.CodeScanning]);
-
-    for (const analysisKind of analyses.supportedAnalysisKinds) {
-      if (analysisKind === AnalysisKind.CodeScanning) continue;
-
-      const analysis = analyses.getAnalysisConfig(analysisKind);
-
-      expectedSarifFiles[analysisKind] = [
-        path.join(tmpDir, `a${analysis.sarifExtension}`),
-        path.join(tmpDir, "dir1", `b${analysis.sarifExtension}`),
-      ];
-      const foundSarifFiles = uploadLib.findSarifFilesInDir(
-        tmpDir,
-        analysis.sarifPredicate,
-      );
-
-      t.deepEqual(foundSarifFiles, expectedSarifFiles[analysisKind]);
-    }
-
-    const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
-      getRunnerLogger(true),
-      tmpDir,
-    );
-
-    t.not(groupedSarifFiles, undefined);
-    for (const analysisKind of analyses.supportedAnalysisKinds) {
-      t.not(groupedSarifFiles[analysisKind], undefined);
-      t.deepEqual(
-        groupedSarifFiles[analysisKind],
-        expectedSarifFiles[analysisKind],
-      );
-    }
-  });
-});
-
-test.serial("getGroupedSarifFilePaths - Risk Assessment files", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const sarifPath = path.join(tmpDir, "a.csra.sarif");
-    fs.writeFileSync(sarifPath, "");
-
-    const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
-      getRunnerLogger(true),
-      sarifPath,
-    );
-
-    t.not(groupedSarifFiles, undefined);
-    t.is(groupedSarifFiles[AnalysisKind.CodeScanning], undefined);
-    t.is(groupedSarifFiles[AnalysisKind.CodeQuality], undefined);
-    t.not(groupedSarifFiles[AnalysisKind.RiskAssessment], undefined);
-    t.deepEqual(groupedSarifFiles[AnalysisKind.RiskAssessment], [sarifPath]);
-  });
-});
-
-test.serial("getGroupedSarifFilePaths - Code Quality file", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const sarifPath = path.join(tmpDir, "a.quality.sarif");
-    fs.writeFileSync(sarifPath, "");
-
-    const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
-      getRunnerLogger(true),
-      sarifPath,
-    );
-
-    t.not(groupedSarifFiles, undefined);
-    t.is(groupedSarifFiles[AnalysisKind.CodeScanning], undefined);
-    t.not(groupedSarifFiles[AnalysisKind.CodeQuality], undefined);
-    t.is(groupedSarifFiles[AnalysisKind.RiskAssessment], undefined);
-    t.deepEqual(groupedSarifFiles[AnalysisKind.CodeQuality], [sarifPath]);
-  });
-});
-
-test.serial("getGroupedSarifFilePaths - Code Scanning file", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const sarifPath = path.join(tmpDir, "a.sarif");
-    fs.writeFileSync(sarifPath, "");
-
-    const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
-      getRunnerLogger(true),
-      sarifPath,
-    );
-
-    t.not(groupedSarifFiles, undefined);
-    t.not(groupedSarifFiles[AnalysisKind.CodeScanning], undefined);
-    t.is(groupedSarifFiles[AnalysisKind.CodeQuality], undefined);
-    t.is(groupedSarifFiles[AnalysisKind.RiskAssessment], undefined);
-    t.deepEqual(groupedSarifFiles[AnalysisKind.CodeScanning], [sarifPath]);
-  });
-});
-
-test.serial("getGroupedSarifFilePaths - Other file", async (t) => {
-  await withTmpDir(async (tmpDir) => {
-    const sarifPath = path.join(tmpDir, "a.json");
-    fs.writeFileSync(sarifPath, "");
-
-    const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
-      getRunnerLogger(true),
-      sarifPath,
-    );
-
-    t.not(groupedSarifFiles, undefined);
-    t.not(groupedSarifFiles[AnalysisKind.CodeScanning], undefined);
-    t.is(groupedSarifFiles[AnalysisKind.CodeQuality], undefined);
-    t.is(groupedSarifFiles[AnalysisKind.RiskAssessment], undefined);
-    t.deepEqual(groupedSarifFiles[AnalysisKind.CodeScanning], [sarifPath]);
-  });
-});
-
-test.serial("populateRunAutomationDetails", (t) => {
-  const tool = { driver: { name: "test tool" } };
-  let sarifLog: sarif.Log = {
-    version: "2.1.0",
-    runs: [{ tool }],
-  };
-  const analysisKey = ".github/workflows/codeql-analysis.yml:analyze";
-
-  let expectedSarif: sarif.Log = {
-    version: "2.1.0",
-    runs: [
-      { tool, automationDetails: { id: "language:javascript/os:linux/" } },
-    ],
-  };
-
-  // Category has priority over analysis_key/environment
-  let modifiedSarif = uploadLib.populateRunAutomationDetails(
-    sarifLog,
-    "language:javascript/os:linux",
-    analysisKey,
-    '{"language": "other", "os": "other"}',
-  );
-  t.deepEqual(modifiedSarif, expectedSarif);
-
-  // It doesn't matter if the category has a slash at the end or not
-  modifiedSarif = uploadLib.populateRunAutomationDetails(
-    sarifLog,
-    "language:javascript/os:linux/",
-    analysisKey,
-    "",
-  );
-  t.deepEqual(modifiedSarif, expectedSarif);
-
-  // check that the automation details doesn't get overwritten
-  sarifLog = {
-    version: "2.1.0",
-    runs: [{ tool, automationDetails: { id: "my_id" } }],
-  };
-  expectedSarif = {
-    version: "2.1.0",
-    runs: [{ tool, automationDetails: { id: "my_id" } }],
-  };
-  modifiedSarif = uploadLib.populateRunAutomationDetails(
-    sarifLog,
-    undefined,
-    analysisKey,
-    '{"os": "linux", "language": "javascript"}',
-  );
-  t.deepEqual(modifiedSarif, expectedSarif);
-
-  // check multiple runs
-  sarifLog = {
-    version: "2.1.0",
-    runs: [{ tool, automationDetails: { id: "my_id" } }, { tool }],
-  };
-  expectedSarif = {
-    version: "2.1.0",
-    runs: [
-      { tool, automationDetails: { id: "my_id" } },
-      {
-        tool,
-        automationDetails: {
-          id: ".github/workflows/codeql-analysis.yml:analyze/language:javascript/os:linux/",
-        },
-      },
-    ],
-  };
-  modifiedSarif = uploadLib.populateRunAutomationDetails(
-    sarifLog,
-    undefined,
-    analysisKey,
-    '{"os": "linux", "language": "javascript"}',
-  );
-  t.deepEqual(modifiedSarif, expectedSarif);
-});
-
-test.serial("validateUniqueCategory when empty", (t) => {
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-});
-
-test.serial("validateUniqueCategory for automation details id", (t) => {
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("abc"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("abc"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("AbC"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-
-  // Our category sanitization is not perfect. Here are some examples
-  // of where we see false clashes
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("abc/def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("abc@def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("abc_def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("abc def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-
-  // this one is fine
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("abc_ def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-});
-
-test.serial("validateUniqueCategory for tool name", (t) => {
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "abc"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "abc"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "AbC"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-
-  // Our category sanitization is not perfect. Here are some examples
-  // of where we see false clashes
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "abc/def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "abc@def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "abc_def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(undefined, "abc def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-
-  // this one is fine
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif("abc_ def"),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-});
-
-test.serial(
-  "validateUniqueCategory for automation details id and tool name",
-  (t) => {
-    t.notThrows(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("abc", "abc"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-    t.throws(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("abc", "abc"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-
-    t.notThrows(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("abc_", "def"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-    t.throws(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("abc_", "def"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-
-    t.notThrows(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("ghi", "_jkl"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-    t.throws(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("ghi", "_jkl"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-
-    // Our category sanitization is not perfect. Here are some examples
-    // of where we see false clashes because we replace some characters
-    // with `_` in `sanitize`.
-    t.notThrows(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("abc", "def__"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-    t.throws(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("abc_def", "_"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-
-    t.notThrows(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("mno_", "pqr"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-    t.throws(() =>
-      uploadLib.validateUniqueCategory(
-        createMockSarif("mno", "_pqr"),
-        CodeScanning.sentinelPrefix,
-      ),
-    );
-  },
-);
-
-test.serial("validateUniqueCategory for multiple runs", (t) => {
-  const sarif1 = createMockSarif("abc", "def");
-  const sarif2 = createMockSarif("ghi", "jkl");
-
-  // duplicate categories are allowed within the same sarif file
-  const multiSarif: sarif.Log = {
-    version: "2.1.0",
-    runs: [sarif1.runs[0], sarif1.runs[0], sarif2.runs[0]],
-  };
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(multiSarif, CodeScanning.sentinelPrefix),
-  );
-
-  // should throw if there are duplicate categories in separate validations
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(sarif1, CodeScanning.sentinelPrefix),
-  );
-  t.throws(() =>
-    uploadLib.validateUniqueCategory(sarif2, CodeScanning.sentinelPrefix),
-  );
-});
-
-test.serial("validateUniqueCategory with different prefixes", (t) => {
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(),
-      CodeScanning.sentinelPrefix,
-    ),
-  );
-  t.notThrows(() =>
-    uploadLib.validateUniqueCategory(
-      createMockSarif(),
-      CodeQuality.sentinelPrefix,
-    ),
-  );
-});
-
-test.serial("accept results with invalid artifactLocation.uri value", (t) => {
-  const loggedMessages: string[] = [];
-  const mockLogger = {
-    info: (message: string) => {
-      loggedMessages.push(message);
-    },
-  } as Logger;
-
-  const sarifFile = `${__dirname}/../src/testdata/with-invalid-uri.sarif`;
-  uploadLib.validateSarifFileSchema(
-    uploadLib.readSarifFileOrThrow(sarifFile),
-    sarifFile,
-    mockLogger,
-  );
-
-  t.deepEqual(loggedMessages.length, 3);
-  t.deepEqual(
-    loggedMessages[1],
-    "Warning: 'not a valid URI' is not a valid URI in 'instance.runs[0].tool.driver.rules[0].helpUri'.",
-    "Warning: 'not a valid URI' is not a valid URI in 'instance.runs[0].results[0].locations[0].physicalLocation.artifactLocation.uri'.",
-  );
-});
-
-test.serial(
-  "shouldShowCombineSarifFilesDeprecationWarning when on dotcom",
-  async (t) => {
-    t.true(
-      await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([
-        createMockSarif("abc", "def"),
-        createMockSarif("abc", "def"),
-      ]),
-    );
-  },
-);
-
-test.serial(
-  "shouldShowCombineSarifFilesDeprecationWarning with only 1 run",
-  async (t) => {
-    t.false(
-      await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([
-        createMockSarif("abc", "def"),
-      ]),
-    );
-  },
-);
-
-test.serial(
-  "shouldShowCombineSarifFilesDeprecationWarning with distinct categories",
-  async (t) => {
-    t.false(
-      await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([
-        createMockSarif("abc", "def"),
-        createMockSarif("def", "def"),
-      ]),
-    );
-  },
-);
-
-test.serial(
-  "shouldShowCombineSarifFilesDeprecationWarning with distinct tools",
-  async (t) => {
-    t.false(
-      await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([
-        createMockSarif("abc", "abc"),
-        createMockSarif("abc", "def"),
-      ]),
-    );
-  },
-);
-
-test.serial(
-  "shouldShowCombineSarifFilesDeprecationWarning when environment variable is already set",
-  async (t) => {
-    process.env["CODEQL_MERGE_SARIF_DEPRECATION_WARNING"] = "true";
-
-    t.false(
-      await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([
-        createMockSarif("abc", "def"),
-        createMockSarif("abc", "def"),
-      ]),
-    );
-  },
-);
-
-test.serial("throwIfCombineSarifFilesDisabled when on dotcom", async (t) => {
-  await t.throwsAsync(
-    uploadLib.throwIfCombineSarifFilesDisabled(
-      [createMockSarif("abc", "def"), createMockSarif("abc", "def")],
-      {
-        type: GitHubVariant.DOTCOM,
-      },
-    ),
-    {
-      message:
-        /The CodeQL Action does not support uploading multiple SARIF runs with the same category/,
-    },
-  );
-});
-
-test.serial("throwIfCombineSarifFilesDisabled when on GHES 3.14", async (t) => {
-  await t.notThrowsAsync(
-    uploadLib.throwIfCombineSarifFilesDisabled(
-      [createMockSarif("abc", "def"), createMockSarif("abc", "def")],
-      {
-        type: GitHubVariant.GHES,
-        version: "3.14.0",
-      },
-    ),
-  );
-});
-
-test.serial("throwIfCombineSarifFilesDisabled when on GHES 3.17", async (t) => {
-  await t.notThrowsAsync(
-    uploadLib.throwIfCombineSarifFilesDisabled(
-      [createMockSarif("abc", "def"), createMockSarif("abc", "def")],
-      {
-        type: GitHubVariant.GHES,
-        version: "3.17.0",
-      },
-    ),
-  );
-});
-
-test.serial(
-  "throwIfCombineSarifFilesDisabled when on GHES 3.18 pre",
-  async (t) => {
-    await t.throwsAsync(
-      uploadLib.throwIfCombineSarifFilesDisabled(
-        [createMockSarif("abc", "def"), createMockSarif("abc", "def")],
-        {
-          type: GitHubVariant.GHES,
-          version: "3.18.0.pre1",
-        },
-      ),
-      {
-        message:
-          /The CodeQL Action does not support uploading multiple SARIF runs with the same category/,
-      },
-    );
-  },
-);
-
-test.serial(
-  "throwIfCombineSarifFilesDisabled when on GHES 3.18 alpha",
-  async (t) => {
-    await t.throwsAsync(
-      uploadLib.throwIfCombineSarifFilesDisabled(
-        [createMockSarif("abc", "def"), createMockSarif("abc", "def")],
-        {
-          type: GitHubVariant.GHES,
-          version: "3.18.0-alpha.1",
-        },
-      ),
-      {
-        message:
-          /The CodeQL Action does not support uploading multiple SARIF runs with the same category/,
-      },
-    );
-  },
-);
-
-test.serial("throwIfCombineSarifFilesDisabled when on GHES 3.18", async (t) => {
-  await t.throwsAsync(
-    uploadLib.throwIfCombineSarifFilesDisabled(
-      [createMockSarif("abc", "def"), createMockSarif("abc", "def")],
-      {
-        type: GitHubVariant.GHES,
-        version: "3.18.0",
-      },
-    ),
-    {
-      message:
-        /The CodeQL Action does not support uploading multiple SARIF runs with the same category/,
-    },
-  );
-});
-
-test.serial(
-  "throwIfCombineSarifFilesDisabled with an invalid GHES version",
-  async (t) => {
-    await t.notThrowsAsync(
-      uploadLib.throwIfCombineSarifFilesDisabled(
-        [createMockSarif("abc", "def"), createMockSarif("abc", "def")],
-        {
-          type: GitHubVariant.GHES,
-          version: "foobar",
-        },
-      ),
-    );
-  },
-);
-
-test.serial("throwIfCombineSarifFilesDisabled with only 1 run", async (t) => {
-  await t.notThrowsAsync(
-    uploadLib.throwIfCombineSarifFilesDisabled(
-      [createMockSarif("abc", "def")],
-      {
-        type: GitHubVariant.DOTCOM,
-      },
-    ),
-  );
-});
-
-test.serial(
-  "throwIfCombineSarifFilesDisabled with distinct categories",
-  async (t) => {
-    await t.notThrowsAsync(
-      uploadLib.throwIfCombineSarifFilesDisabled(
-        [createMockSarif("abc", "def"), createMockSarif("def", "def")],
-        {
-          type: GitHubVariant.DOTCOM,
-        },
-      ),
-    );
-  },
-);
-
-test.serial(
-  "throwIfCombineSarifFilesDisabled with distinct tools",
-  async (t) => {
-    await t.notThrowsAsync(
-      uploadLib.throwIfCombineSarifFilesDisabled(
-        [createMockSarif("abc", "abc"), createMockSarif("abc", "def")],
-        {
-          type: GitHubVariant.DOTCOM,
-        },
-      ),
-    );
-  },
-);
-
-test.serial(
-  "shouldConsiderConfigurationError correctly detects configuration errors",
-  (t) => {
-    const error1 = [
-      "CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled",
-    ];
-    t.true(uploadLib.shouldConsiderConfigurationError(error1));
-
-    const error2 = [
-      "rejecting delivery as the repository has too many logical alerts",
-    ];
-    t.true(uploadLib.shouldConsiderConfigurationError(error2));
-
-    // We fail cases where we get > 1 error messages back
-    const error3 = [
-      "rejecting delivery as the repository has too many alerts",
-      "extra error message",
-    ];
-    t.false(uploadLib.shouldConsiderConfigurationError(error3));
-  },
-);
-
-test.serial(
-  "shouldConsiderInvalidRequest returns correct recognises processing errors",
-  (t) => {
-    const error1 = [
-      "rejecting SARIF",
-      "an invalid URI was provided as a SARIF location",
-    ];
-    t.true(uploadLib.shouldConsiderInvalidRequest(error1));
-
-    const error2 = [
-      "locationFromSarifResult: expected artifact location",
-      "an invalid URI was provided as a SARIF location",
-    ];
-    t.true(uploadLib.shouldConsiderInvalidRequest(error2));
-
-    // We expect ALL errors to be of processing errors, for the outcome to be classified as
-    // an invalid SARIF upload error.
-    const error3 = [
-      "could not convert rules: invalid security severity value, is not a number",
-      "an unknown error occurred",
-    ];
-    t.false(uploadLib.shouldConsiderInvalidRequest(error3));
-  },
-);
-
-function createMockSarif(id?: string, tool?: string): sarif.Log {
-  return {
-    version: "2.1.0",
-    runs: [
-      {
-        automationDetails: {
-          id,
-        },
-        tool: {
-          driver: {
-            name: tool || "test tool",
-          },
-        },
-      },
-    ],
-  };
-}
-
-function uploadPayloadFixtures(analysis: analyses.AnalysisConfig) {
-  const mockData = {
-    payload: {
-      commit_oid: "abc123",
-      ref: "ref",
-      sarif: "base64data",
-      workflow_run_id: 1,
-      workflow_run_attempt: 1,
-      checkout_uri: "uri",
-      tool_names: ["codeql"],
-    } satisfies UploadPayload,
-    owner: "test-owner",
-    repo: "test-repo",
-    response: {
-      status: 200,
-      data: { id: "uploaded-sarif-id" },
-      headers: {},
-      url: analysis.target,
-    },
-  };
-  const client = github.getOctokit("123");
-  sinon.stub(api, "getApiClient").value(() => client);
-  const requestStub = sinon.stub(client, "request");
-
-  const upload = async () =>
-    uploadLib.uploadPayload(
-      mockData.payload,
-      {
-        owner: mockData.owner,
-        repo: mockData.repo,
-      },
-      getRunnerLogger(true),
-      analysis,
-    );
-
-  return {
-    upload,
-    requestStub,
-    mockData,
-  };
-}
-
-for (const analysisKind of analyses.supportedAnalysisKinds) {
-  const analysis = analyses.getAnalysisConfig(analysisKind);
-
-  test.serial(
-    `uploadPayload on ${analysis.name} uploads successfully`,
-    async (t) => {
-      const { upload, requestStub, mockData } = uploadPayloadFixtures(analysis);
-      requestStub
-        .withArgs(analysis.target, {
-          owner: mockData.owner,
-          repo: mockData.repo,
-          data: mockData.payload,
-        })
-        .onFirstCall()
-        .returns(Promise.resolve(mockData.response));
-      const result = await upload();
-      t.is(result, mockData.response.data.id);
-      t.true(requestStub.calledOnce);
-    },
-  );
-
-  for (const envVar of [
-    "CODEQL_ACTION_SKIP_SARIF_UPLOAD",
-    "CODEQL_ACTION_TEST_MODE",
-  ]) {
-    test.serial(
-      `uploadPayload on ${analysis.name} skips upload when ${envVar} is set`,
-      async (t) => {
-        const { upload, requestStub, mockData } =
-          uploadPayloadFixtures(analysis);
-        await withTmpDir(async (tmpDir) => {
-          process.env.RUNNER_TEMP = tmpDir;
-          process.env[envVar] = "true";
-          const result = await upload();
-          t.is(result, "dummy-sarif-id");
-          t.false(requestStub.called);
-
-          const payloadFile = path.join(
-            tmpDir,
-            `payload-${analysis.kind}.json`,
-          );
-          t.true(fs.existsSync(payloadFile));
-
-          const savedPayload = JSON.parse(fs.readFileSync(payloadFile, "utf8"));
-          t.deepEqual(savedPayload, mockData.payload);
-        });
-      },
-    );
-  }
-
-  test.serial(
-    `uploadPayload on ${analysis.name} wraps request errors using wrapApiConfigurationError`,
-    async (t) => {
-      const { upload, requestStub } = uploadPayloadFixtures(analysis);
-      const wrapApiConfigurationErrorStub = sinon.stub(
-        api,
-        "wrapApiConfigurationError",
-      );
-      const originalError = new HTTPError(404);
-      const wrappedError = new Error("Wrapped error message");
-      requestStub.rejects(originalError);
-      wrapApiConfigurationErrorStub
-        .withArgs(originalError)
-        .returns(wrappedError);
-      await t.throwsAsync(upload, {
-        is: wrappedError,
-      });
-    },
-  );
-}
-
-function runFilterAlertsByDiffRange(
-  input: Partial,
-  diffRanges: diffUtils.DiffThunkRange[],
-): Partial {
-  sinon.stub(diffUtils, "readDiffRangesJsonFile").returns(diffRanges);
-  return uploadLib.filterAlertsByDiffRange(getRunnerLogger(true), input);
-}
-
-test.serial(
-  "filterAlertsByDiffRange filters out alerts outside diff-range",
-  (t) => {
-    const input = sarif.readSarifFile(
-      `${__dirname}/../src/testdata/valid-sarif.sarif`,
-    );
-    const actualOutput = runFilterAlertsByDiffRange(input, [
-      {
-        path: "main.js",
-        startLine: 1,
-        endLine: 3,
-      },
-    ]);
-
-    const expectedOutput = sarif.readSarifFile(
-      `${__dirname}/../src/testdata/valid-sarif-diff-filtered.sarif`,
-    );
-
-    t.deepEqual(actualOutput, expectedOutput);
-  },
-);
diff --git a/src/upload-lib.ts b/src/upload-lib.ts
deleted file mode 100644
index da5552cf24..0000000000
--- a/src/upload-lib.ts
+++ /dev/null
@@ -1,1096 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-import * as url from "url";
-import zlib from "zlib";
-
-import * as core from "@actions/core";
-import { OctokitResponse } from "@octokit/types";
-import * as jsonschema from "jsonschema";
-
-import * as actionsUtil from "./actions-util";
-import * as analyses from "./analyses";
-import * as api from "./api-client";
-import { getGitHubVersion, wrapApiConfigurationError } from "./api-client";
-import { CodeQL, getCodeQL } from "./codeql";
-import { getConfig } from "./config-utils";
-import { readDiffRangesJsonFile } from "./diff-informed-analysis-utils";
-import { EnvVar } from "./environment";
-import { FeatureEnablement } from "./feature-flags";
-import * as fingerprints from "./fingerprints";
-import * as gitUtils from "./git-utils";
-import { initCodeQL } from "./init";
-import { Logger } from "./logging";
-import { getRepositoryNwo, RepositoryNwo } from "./repository";
-import * as sarif from "./sarif";
-import {
-  areAllRunsProducedByCodeQL,
-  areAllRunsUnique,
-  combineSarifFiles,
-  InvalidSarifUploadError,
-} from "./sarif";
-import { BasePayload, UploadPayload } from "./upload-lib/types";
-import * as util from "./util";
-import {
-  ConfigurationError,
-  getErrorMessage,
-  getRequiredEnvParam,
-  GitHubVariant,
-  GitHubVersion,
-  satisfiesGHESVersion,
-} from "./util";
-
-const GENERIC_403_MSG =
-  "The repo on which this action is running has not opted-in to CodeQL code scanning.";
-const GENERIC_404_MSG =
-  "The CodeQL code scanning feature is forbidden on this repository.";
-
-// Checks whether the deprecation warning for combining SARIF files should be shown.
-export async function shouldShowCombineSarifFilesDeprecationWarning(
-  sarifObjects: Array>,
-) {
-  // Only give a deprecation warning when not all runs are unique and
-  // we haven't already shown the warning.
-  return (
-    !areAllRunsUnique(sarifObjects) &&
-    !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING
-  );
-}
-
-export async function throwIfCombineSarifFilesDisabled(
-  sarifObjects: Array>,
-  githubVersion: GitHubVersion,
-) {
-  if (!(await shouldDisableCombineSarifFiles(sarifObjects, githubVersion))) {
-    return;
-  }
-
-  const deprecationMoreInformationMessage =
-    "For more information, see https://github.blog/changelog/2025-07-21-code-scanning-will-stop-combining-multiple-sarif-runs-uploaded-in-the-same-sarif-file/";
-
-  throw new ConfigurationError(
-    `The CodeQL Action does not support uploading multiple SARIF runs with the same category. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}`,
-  );
-}
-
-// Checks whether combining SARIF files should be disabled.
-async function shouldDisableCombineSarifFiles(
-  sarifObjects: Array>,
-  githubVersion: GitHubVersion,
-) {
-  if (githubVersion.type === GitHubVariant.GHES) {
-    // Never block on GHES versions before 3.18.
-    if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) {
-      return false;
-    }
-  }
-
-  if (areAllRunsUnique(sarifObjects)) {
-    // If all runs are unique, we can safely combine them.
-    return false;
-  }
-
-  // Combining SARIF files is not supported and Code Scanning will return an
-  // error if multiple runs with the same category are uploaded.
-  return true;
-}
-
-// Takes a list of paths to sarif files and combines them together using the
-// CLI `github merge-results` command when all SARIF files are produced by
-// CodeQL. Otherwise, it will fall back to combining the files in the action.
-// Returns the contents of the combined sarif file.
-async function combineSarifFilesUsingCLI(
-  sarifFiles: string[],
-  gitHubVersion: GitHubVersion,
-  features: FeatureEnablement,
-  logger: Logger,
-): Promise> {
-  logger.info("Combining SARIF files using the CodeQL CLI");
-
-  const sarifObjects = sarifFiles.map(sarif.readSarifFile);
-
-  const deprecationWarningMessage =
-    gitHubVersion.type === GitHubVariant.GHES
-      ? "and will be removed in GitHub Enterprise Server 3.18"
-      : "and will be removed in July 2025";
-  const deprecationMoreInformationMessage =
-    "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload";
-
-  if (!areAllRunsProducedByCodeQL(sarifObjects)) {
-    await throwIfCombineSarifFilesDisabled(sarifObjects, gitHubVersion);
-
-    logger.debug(
-      "Not all SARIF files were produced by CodeQL. Merging files in the action.",
-    );
-
-    if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects)) {
-      logger.warning(
-        `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}`,
-      );
-      core.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true");
-    }
-
-    // If not, use the naive method of combining the files.
-    return combineSarifFiles(sarifFiles, logger);
-  }
-
-  // Initialize CodeQL, either by using the config file from the 'init' step,
-  // or by initializing it here.
-  let codeQL: CodeQL;
-  let tempDir: string = actionsUtil.getTemporaryDirectory();
-
-  const config = await getConfig(tempDir, logger);
-  if (config !== undefined) {
-    codeQL = await getCodeQL(logger, config.codeQLCmd);
-    tempDir = config.tempDir;
-  } else {
-    logger.info(
-      "Initializing CodeQL since the 'init' Action was not called before this step.",
-    );
-
-    const apiDetails = {
-      auth: actionsUtil.getRequiredInput("token"),
-      externalRepoAuth: actionsUtil.getOptionalInput(
-        "external-repository-token",
-      ),
-      url: getRequiredEnvParam("GITHUB_SERVER_URL"),
-      apiURL: getRequiredEnvParam("GITHUB_API_URL"),
-    };
-
-    const codeQLDefaultVersionInfo =
-      await features.getEnabledDefaultCliVersions(gitHubVersion.type);
-
-    const initCodeQLResult = await initCodeQL(
-      undefined, // There is no tools input on the upload action
-      apiDetails,
-      tempDir,
-      gitHubVersion.type,
-      codeQLDefaultVersionInfo,
-      undefined, // rawLanguages: upload-lib does not run analysis
-      false, // useOverlayAwareDefaultCliVersion: upload-lib does not run analysis
-      features,
-      logger,
-    );
-
-    codeQL = initCodeQLResult.codeql;
-  }
-
-  const baseTempDir = path.resolve(tempDir, "combined-sarif");
-  fs.mkdirSync(baseTempDir, { recursive: true });
-  const outputDirectory = fs.mkdtempSync(path.resolve(baseTempDir, "output-"));
-
-  const outputFile = path.resolve(outputDirectory, "combined-sarif.sarif");
-
-  await codeQL.mergeResults(sarifFiles, outputFile, {
-    mergeRunsFromEqualCategory: true,
-  });
-
-  return sarif.readSarifFile(outputFile);
-}
-
-// Populates the run.automationDetails.id field using the analysis_key and environment
-// and return an updated sarif file contents.
-export function populateRunAutomationDetails(
-  sarifFile: Partial,
-  category: string | undefined,
-  analysis_key: string,
-  environment: string | undefined,
-): Partial {
-  const automationID = getAutomationID(category, analysis_key, environment);
-
-  if (automationID !== undefined) {
-    for (const run of sarifFile.runs || []) {
-      if (run.automationDetails === undefined) {
-        run.automationDetails = {
-          id: automationID,
-        };
-      }
-    }
-    return sarifFile;
-  }
-  return sarifFile;
-}
-
-function getAutomationID(
-  category: string | undefined,
-  analysis_key: string,
-  environment: string | undefined,
-): string | undefined {
-  if (category !== undefined) {
-    let automationID = category;
-    if (!automationID.endsWith("/")) {
-      automationID += "/";
-    }
-    return automationID;
-  }
-
-  return api.computeAutomationID(analysis_key, environment);
-}
-
-/**
- * Upload the given payload.
- * If the request fails then this will retry a small number of times.
- * This is exported for testing purposes only.
- */
-export async function uploadPayload(
-  payload: BasePayload,
-  repositoryNwo: RepositoryNwo,
-  logger: Logger,
-  analysis: analyses.AnalysisConfig,
-): Promise {
-  logger.info("Uploading results");
-
-  if (util.shouldSkipSarifUpload()) {
-    const payloadSaveFile = path.join(
-      actionsUtil.getTemporaryDirectory(),
-      `payload-${analysis.kind}.json`,
-    );
-    logger.info(
-      `SARIF upload disabled by an environment variable. Saving to ${payloadSaveFile}`,
-    );
-    logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`);
-    fs.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2));
-    return "dummy-sarif-id";
-  }
-
-  const client = api.getApiClient();
-
-  try {
-    const response = await client.request(analysis.target, {
-      owner: repositoryNwo.owner,
-      repo: repositoryNwo.repo,
-      data: payload,
-    });
-
-    logger.debug(`response status: ${response.status}`);
-    logger.info("Successfully uploaded results");
-    return response.data.id as string;
-  } catch (e) {
-    const httpError = util.asHTTPError(e);
-    if (httpError !== undefined) {
-      switch (httpError.status) {
-        case 403:
-          core.warning(httpError.message || GENERIC_403_MSG);
-          break;
-        case 404:
-          core.warning(httpError.message || GENERIC_404_MSG);
-          break;
-        default:
-          core.warning(httpError.message);
-          break;
-      }
-    }
-    throw wrapApiConfigurationError(e);
-  }
-}
-
-export interface UploadStatusReport {
-  /** Size in bytes of unzipped SARIF upload. */
-  raw_upload_size_bytes?: number;
-  /** Size in bytes of actual SARIF upload. */
-  zipped_upload_size_bytes?: number;
-  /** Number of results in the SARIF upload. */
-  num_results_in_sarif?: number;
-}
-
-export interface UploadResult {
-  statusReport: UploadStatusReport;
-  sarifID: string;
-}
-
-// Recursively walks a directory and returns all SARIF files it finds.
-// Does not follow symlinks.
-export function findSarifFilesInDir(
-  sarifPath: string,
-  isSarif: (name: string) => boolean,
-): string[] {
-  const sarifFiles: string[] = [];
-  const walkSarifFiles = (dir: string) => {
-    const entries = fs.readdirSync(dir, { withFileTypes: true });
-    for (const entry of entries) {
-      if (entry.isFile() && isSarif(entry.name)) {
-        sarifFiles.push(path.resolve(dir, entry.name));
-      } else if (entry.isDirectory()) {
-        walkSarifFiles(path.resolve(dir, entry.name));
-      }
-    }
-  };
-  walkSarifFiles(sarifPath);
-  return sarifFiles;
-}
-
-function getSarifFilePaths(
-  sarifPath: string,
-  isSarif: (name: string) => boolean,
-) {
-  if (!fs.existsSync(sarifPath)) {
-    // This is always a configuration error, even for first-party runs.
-    throw new ConfigurationError(`Path does not exist: ${sarifPath}`);
-  }
-
-  let sarifFiles: string[];
-  if (fs.lstatSync(sarifPath).isDirectory()) {
-    sarifFiles = findSarifFilesInDir(sarifPath, isSarif);
-    if (sarifFiles.length === 0) {
-      // This is always a configuration error, even for first-party runs.
-      throw new ConfigurationError(
-        `No SARIF files found to upload in "${sarifPath}".`,
-      );
-    }
-  } else {
-    sarifFiles = [sarifPath];
-  }
-  return sarifFiles;
-}
-
-type GroupedSarifFiles = Partial>;
-
-/**
- * Finds SARIF files in `sarifPath`, and groups them by analysis kind, following `SarifScanOrder`.
- *
- * @param logger The logger to use.
- * @param sarifPath The path of a file or directory to recursively scan for SARIF files.
- * @returns The `.sarif` files found in `sarifPath`, grouped by analysis kind.
- */
-export async function getGroupedSarifFilePaths(
-  logger: Logger,
-  sarifPath: string,
-): Promise {
-  const stats = fs.statSync(sarifPath, { throwIfNoEntry: false });
-
-  if (stats === undefined) {
-    // This is always a configuration error, even for first-party runs.
-    throw new ConfigurationError(`Path does not exist: ${sarifPath}`);
-  }
-
-  const results: GroupedSarifFiles = {};
-
-  if (stats.isDirectory()) {
-    let unassignedSarifFiles = findSarifFilesInDir(
-      sarifPath,
-      (name) => path.extname(name) === ".sarif",
-    );
-    logger.debug(
-      `Found the following .sarif files in ${sarifPath}: ${unassignedSarifFiles.join(", ")}`,
-    );
-
-    for (const analysisConfig of analyses.SarifScanOrder) {
-      const filesForCurrentAnalysis = unassignedSarifFiles.filter(
-        analysisConfig.sarifPredicate,
-      );
-      if (filesForCurrentAnalysis.length > 0) {
-        logger.debug(
-          `The following SARIF files are for ${analysisConfig.name}: ${filesForCurrentAnalysis.join(", ")}`,
-        );
-        // Looping through the array a second time is not efficient, but more readable.
-        // Change this to one loop for both calls to `filter` if this becomes a bottleneck.
-        unassignedSarifFiles = unassignedSarifFiles.filter(
-          (name) => !analysisConfig.sarifPredicate(name),
-        );
-        results[analysisConfig.kind] = filesForCurrentAnalysis;
-      } else {
-        logger.debug(`Found no SARIF files for ${analysisConfig.name}`);
-      }
-    }
-
-    if (unassignedSarifFiles.length !== 0) {
-      logger.warning(
-        `Found files in ${sarifPath} which do not belong to any analysis: ${unassignedSarifFiles.join(", ")}`,
-      );
-    }
-  } else {
-    for (const analysisConfig of analyses.SarifScanOrder) {
-      if (
-        analysisConfig.kind === analyses.AnalysisKind.CodeScanning ||
-        analysisConfig.sarifPredicate(sarifPath)
-      ) {
-        logger.debug(
-          `Using '${sarifPath}' as a SARIF file for ${analysisConfig.name}.`,
-        );
-        results[analysisConfig.kind] = [sarifPath];
-        break;
-      }
-    }
-  }
-
-  return results;
-}
-
-// Counts the number of results in the given SARIF file
-function countResultsInSarif(sarifLog: string): number {
-  let numResults = 0;
-  const parsedSarif = JSON.parse(sarifLog);
-  if (!Array.isArray(parsedSarif.runs)) {
-    throw new InvalidSarifUploadError("Invalid SARIF. Missing 'runs' array.");
-  }
-
-  for (const run of parsedSarif.runs) {
-    if (!Array.isArray(run.results)) {
-      throw new InvalidSarifUploadError(
-        "Invalid SARIF. Missing 'results' array in run.",
-      );
-    }
-    numResults += run.results.length;
-  }
-  return numResults;
-}
-
-/** A thin wrapper around `readSarifFile` which wraps exceptions in `InvalidSarifUploadError`.
- *
- * @throws InvalidSarifUploadError If parsing the SARIF file as JSON failed.
- */
-export function readSarifFileOrThrow(
-  sarifFilePath: string,
-): Partial {
-  try {
-    return sarif.readSarifFile(sarifFilePath);
-  } catch (e) {
-    throw new InvalidSarifUploadError(
-      `Invalid SARIF. JSON syntax error: ${getErrorMessage(e)}`,
-    );
-  }
-}
-
-// Validates the given SARIF object and throws an error if the SARIF object is invalid.
-// The file path is only used in error messages to improve clarity.
-export function validateSarifFileSchema(
-  sarifLog: Partial,
-  sarifFilePath: string,
-  logger: Logger,
-): sarifLog is sarif.Log {
-  if (
-    areAllRunsProducedByCodeQL([sarifLog]) &&
-    // We want to validate CodeQL SARIF in testing environments.
-    !util.getTestingEnvironment()
-  ) {
-    logger.debug(
-      `Skipping SARIF schema validation for ${sarifFilePath} as all runs are produced by CodeQL.`,
-    );
-    return true;
-  }
-
-  logger.info(`Validating ${sarifFilePath}`);
-  // eslint-disable-next-line @typescript-eslint/no-require-imports
-  const schema = require("../src/sarif-schema-2.1.0.json") as jsonschema.Schema;
-
-  const result = new jsonschema.Validator().validate(sarifLog, schema);
-  // Filter errors related to invalid URIs in the artifactLocation field as this
-  // is a breaking change. See https://github.com/github/codeql-action/issues/1703
-  const warningAttributes = ["uri-reference", "uri"];
-  const errors = (result.errors ?? []).filter(
-    (err) =>
-      !(
-        err.name === "format" &&
-        typeof err.argument === "string" &&
-        warningAttributes.includes(err.argument)
-      ),
-  );
-  const warnings = (result.errors ?? []).filter(
-    (err) =>
-      err.name === "format" &&
-      typeof err.argument === "string" &&
-      warningAttributes.includes(err.argument),
-  );
-
-  for (const warning of warnings) {
-    logger.info(
-      `Warning: '${warning.instance}' is not a valid URI in '${warning.property}'.`,
-    );
-  }
-
-  if (errors.length > 0) {
-    // Output the more verbose error messages in groups as these may be very large.
-    for (const error of errors) {
-      logger.startGroup(`Error details: ${error.stack}`);
-      logger.info(JSON.stringify(error, null, 2));
-      logger.endGroup();
-    }
-
-    // Set the main error message to the stacks of all the errors.
-    // This should be of a manageable size and may even give enough to fix the error.
-    const sarifErrors = errors.map((e) => `- ${e.stack}`);
-    throw new InvalidSarifUploadError(
-      `Unable to upload "${sarifFilePath}" as it is not valid SARIF:\n${sarifErrors.join(
-        "\n",
-      )}`,
-    );
-  }
-
-  return true;
-}
-
-// buildPayload constructs a map ready to be uploaded to the API from the given
-// parameters, respecting the current mode and target GitHub instance version.
-export function buildPayload(
-  commitOid: string,
-  ref: string,
-  analysisKey: string | undefined,
-  analysisName: string | undefined,
-  zippedSarif: string,
-  workflowRunID: number,
-  workflowRunAttempt: number,
-  checkoutURI: string,
-  environment: string | undefined,
-  toolNames: string[],
-  mergeBaseCommitOid: string | undefined,
-): UploadPayload {
-  const payloadObj: UploadPayload = {
-    commit_oid: commitOid,
-    ref,
-    analysis_key: analysisKey,
-    analysis_name: analysisName,
-    sarif: zippedSarif,
-    workflow_run_id: workflowRunID,
-    workflow_run_attempt: workflowRunAttempt,
-    checkout_uri: checkoutURI,
-    environment,
-    started_at: process.env[EnvVar.WORKFLOW_STARTED_AT],
-    tool_names: toolNames,
-    base_ref: undefined as undefined | string,
-    base_sha: undefined as undefined | string,
-  };
-
-  if (actionsUtil.getWorkflowEventName() === "pull_request") {
-    if (
-      commitOid === util.getRequiredEnvParam("GITHUB_SHA") &&
-      mergeBaseCommitOid
-    ) {
-      // We're uploading results for the merge commit
-      // and were able to determine the merge base.
-      // So we use that as the most accurate base.
-      payloadObj.base_ref = `refs/heads/${util.getRequiredEnvParam(
-        "GITHUB_BASE_REF",
-      )}`;
-      payloadObj.base_sha = mergeBaseCommitOid;
-    } else if (process.env.GITHUB_EVENT_PATH) {
-      // Either we're not uploading results for the merge commit
-      // or we could not determine the merge base.
-      // Using the PR base is the only option here
-      const githubEvent = JSON.parse(
-        fs.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"),
-      );
-      payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`;
-      payloadObj.base_sha = githubEvent.pull_request.base.sha;
-    }
-  }
-  return payloadObj;
-}
-
-export interface PostProcessingResults {
-  sarif: Partial;
-  analysisKey: string;
-  environment: string;
-}
-
-/**
- * Performs post-processing of the SARIF files given by `sarifPaths`.
- *
- * @param logger The logger to use.
- * @param features Information about enabled features.
- * @param checkoutPath The path where the repo was checked out at.
- * @param sarifPaths The paths of the SARIF files to post-process.
- * @param category The analysis category.
- * @param analysis The analysis configuration.
- *
- * @returns Returns the results of post-processing the SARIF files,
- *          including the resulting SARIF file.
- */
-export async function postProcessSarifFiles(
-  logger: Logger,
-  features: FeatureEnablement,
-  checkoutPath: string,
-  sarifPaths: string[],
-  category: string | undefined,
-  analysis: analyses.AnalysisConfig,
-): Promise {
-  logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`);
-
-  const gitHubVersion = await getGitHubVersion();
-
-  let sarifLog: Partial;
-  category = analysis.fixCategory(logger, category);
-
-  if (sarifPaths.length > 1) {
-    // Validate that the files we were asked to upload are all valid SARIF files
-    for (const sarifPath of sarifPaths) {
-      const parsedSarif = readSarifFileOrThrow(sarifPath);
-      validateSarifFileSchema(parsedSarif, sarifPath, logger);
-    }
-
-    sarifLog = await combineSarifFilesUsingCLI(
-      sarifPaths,
-      gitHubVersion,
-      features,
-      logger,
-    );
-  } else {
-    const sarifPath = sarifPaths[0];
-    sarifLog = readSarifFileOrThrow(sarifPath);
-    validateSarifFileSchema(sarifLog, sarifPath, logger);
-
-    // Validate that there are no runs for the same category
-    await throwIfCombineSarifFilesDisabled([sarifLog], gitHubVersion);
-  }
-
-  sarifLog = filterAlertsByDiffRange(logger, sarifLog);
-  sarifLog = await fingerprints.addFingerprints(sarifLog, checkoutPath, logger);
-
-  const analysisKey = await api.getAnalysisKey();
-  const environment = actionsUtil.getRequiredInput("matrix");
-  sarifLog = populateRunAutomationDetails(
-    sarifLog,
-    category,
-    analysisKey,
-    environment,
-  );
-
-  return { sarif: sarifLog, analysisKey, environment };
-}
-
-/**
- * Writes the post-processed SARIF file to disk, if needed based on `pathInput` or the `SARIF_DUMP_DIR`.
- *
- * @param logger The logger to use.
- * @param pathInput The input provided for `post-processed-sarif-path`.
- * @param uploadTarget The upload target.
- * @param postProcessingResults The results of post-processing SARIF files.
- */
-export async function writePostProcessedFiles(
-  logger: Logger,
-  pathInput: string | undefined,
-  uploadTarget: analyses.AnalysisConfig,
-  postProcessingResults: PostProcessingResults,
-) {
-  // If there's an explicit input, use that. Otherwise, use the value from the environment variable.
-  const outputPath = pathInput || util.getOptionalEnvVar(EnvVar.SARIF_DUMP_DIR);
-
-  // If we have a non-empty output path, write the SARIF file to it.
-  if (outputPath !== undefined) {
-    dumpSarifFile(
-      JSON.stringify(postProcessingResults.sarif),
-      outputPath,
-      logger,
-      uploadTarget,
-    );
-  } else {
-    logger.debug(`Not writing post-processed SARIF files.`);
-  }
-}
-
-/**
- * Uploads a single SARIF file or a directory of SARIF files depending on what `inputSarifPath` refers
- * to.
- */
-export async function uploadFiles(
-  inputSarifPath: string,
-  checkoutPath: string,
-  category: string | undefined,
-  features: FeatureEnablement,
-  logger: Logger,
-  uploadTarget: analyses.AnalysisConfig,
-): Promise {
-  const sarifPaths = getSarifFilePaths(
-    inputSarifPath,
-    uploadTarget.sarifPredicate,
-  );
-
-  return uploadSpecifiedFiles(
-    sarifPaths,
-    checkoutPath,
-    category,
-    features,
-    logger,
-    uploadTarget,
-  );
-}
-
-/**
- * Uploads the given array of SARIF files.
- */
-async function uploadSpecifiedFiles(
-  sarifPaths: string[],
-  checkoutPath: string,
-  category: string | undefined,
-  features: FeatureEnablement,
-  logger: Logger,
-  uploadTarget: analyses.AnalysisConfig,
-): Promise {
-  const processingResults: PostProcessingResults = await postProcessSarifFiles(
-    logger,
-    features,
-    checkoutPath,
-    sarifPaths,
-    category,
-    uploadTarget,
-  );
-
-  return uploadPostProcessedFiles(
-    logger,
-    checkoutPath,
-    uploadTarget,
-    processingResults,
-  );
-}
-
-/**
- * Uploads the results of post-processing SARIF files to the specified upload target.
- *
- * @param logger The logger to use.
- * @param checkoutPath The path at which the repository was checked out.
- * @param uploadTarget The analysis configuration.
- * @param postProcessingResults The results of post-processing SARIF files.
- *
- * @returns The results of uploading the `postProcessingResults` to `uploadTarget`.
- */
-export async function uploadPostProcessedFiles(
-  logger: Logger,
-  checkoutPath: string,
-  uploadTarget: analyses.AnalysisConfig,
-  postProcessingResults: PostProcessingResults,
-): Promise {
-  logger.startGroup(`Uploading ${uploadTarget.name} results`);
-
-  const sarifLog = postProcessingResults.sarif;
-  const toolNames = sarif.getToolNames(sarifLog);
-
-  logger.debug(`Validating that each SARIF run has a unique category`);
-  validateUniqueCategory(sarifLog, uploadTarget.sentinelPrefix);
-  logger.debug(`Serializing SARIF for upload`);
-  const sarifPayload = JSON.stringify(sarifLog);
-
-  logger.debug(`Compressing serialized SARIF`);
-  const zippedSarif = zlib.gzipSync(sarifPayload).toString("base64");
-  const checkoutURI = url.pathToFileURL(checkoutPath).href;
-
-  const payload = uploadTarget.transformPayload(
-    buildPayload(
-      await gitUtils.getCommitOid(checkoutPath),
-      await gitUtils.getRef(),
-      postProcessingResults.analysisKey,
-      util.getRequiredEnvParam("GITHUB_WORKFLOW"),
-      zippedSarif,
-      actionsUtil.getWorkflowRunID(),
-      actionsUtil.getWorkflowRunAttempt(),
-      checkoutURI,
-      postProcessingResults.environment,
-      toolNames,
-      await gitUtils.determineBaseBranchHeadCommitOid(),
-    ),
-  );
-
-  // Log some useful debug info about the info
-  const rawUploadSizeBytes = sarifPayload.length;
-  logger.debug(`Raw upload size: ${rawUploadSizeBytes} bytes`);
-  const zippedUploadSizeBytes = zippedSarif.length;
-  logger.debug(`Base64 zipped upload size: ${zippedUploadSizeBytes} bytes`);
-  const numResultInSarif = countResultsInSarif(sarifPayload);
-  logger.debug(`Number of results in upload: ${numResultInSarif}`);
-
-  // Make the upload
-  const sarifID = await uploadPayload(
-    payload,
-    getRepositoryNwo(),
-    logger,
-    uploadTarget,
-  );
-
-  logger.endGroup();
-
-  return {
-    statusReport: {
-      raw_upload_size_bytes: rawUploadSizeBytes,
-      zipped_upload_size_bytes: zippedUploadSizeBytes,
-      num_results_in_sarif: numResultInSarif,
-    },
-    sarifID,
-  };
-}
-
-/**
- * Dumps the given processed SARIF file contents to `outputDir`.
- */
-function dumpSarifFile(
-  sarifPayload: string,
-  outputDir: string,
-  logger: Logger,
-  uploadTarget: analyses.AnalysisConfig,
-) {
-  if (!fs.existsSync(outputDir)) {
-    fs.mkdirSync(outputDir, { recursive: true });
-  } else if (!fs.lstatSync(outputDir).isDirectory()) {
-    throw new ConfigurationError(
-      `The path that processed SARIF files should be written to exists, but is not a directory: ${outputDir}`,
-    );
-  }
-  const outputFile = path.resolve(
-    outputDir,
-    `upload${uploadTarget.sarifExtension}`,
-  );
-  logger.info(`Writing processed SARIF file to ${outputFile}`);
-  fs.writeFileSync(outputFile, sarifPayload);
-}
-
-// Should lead to status checks after 5s, 15s, 35s, 75s, and 155s.
-const STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS = 5 * 1000;
-const STATUS_CHECK_BACKOFF_MULTIPLIER = 2;
-const STATUS_CHECK_MAX_TRIES = 5;
-
-type ProcessingStatus = "pending" | "complete" | "failed";
-
-/**
- * Waits until either the analysis is successfully processed, a processing error
- * is reported, or `STATUS_CHECK_TIMEOUT_MILLISECONDS` elapses.
- *
- * If `isUnsuccessfulExecution` is passed, will throw an error if the analysis
- * processing does not produce a single error mentioning the unsuccessful
- * execution.
- */
-export async function waitForProcessing(
-  repositoryNwo: RepositoryNwo,
-  sarifID: string,
-  logger: Logger,
-  options: { isUnsuccessfulExecution: boolean } = {
-    isUnsuccessfulExecution: false,
-  },
-): Promise {
-  logger.startGroup("Waiting for processing to finish");
-  try {
-    const client = api.getApiClient();
-
-    // Do an initial wait because processing will always take a minimum of 2-3 seconds
-    let statusCheckBackoff = STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS;
-    if (process.env["NODE_ENV"] !== "test") {
-      await util.delay(statusCheckBackoff, { allowProcessExit: false });
-    }
-
-    for (
-      let statusCheckCount = 1;
-      statusCheckCount <= STATUS_CHECK_MAX_TRIES;
-      statusCheckCount++
-    ) {
-      let response: OctokitResponse | undefined = undefined;
-      try {
-        response = await client.request(
-          "GET /repos/:owner/:repo/code-scanning/sarifs/:sarif_id",
-          {
-            owner: repositoryNwo.owner,
-            repo: repositoryNwo.repo,
-            sarif_id: sarifID,
-          },
-        );
-      } catch (e) {
-        logger.warning(
-          `An error occurred checking the status of the delivery. ${e} It should still be processed in the background, but errors that occur during processing may not be reported.`,
-        );
-        break;
-      }
-      const status = response.data.processing_status as ProcessingStatus;
-      logger.info(`Analysis upload status is ${status}.`);
-
-      if (status === "pending") {
-        logger.debug("Analysis processing is still pending...");
-      } else if (options.isUnsuccessfulExecution) {
-        // We expect a specific processing error for unsuccessful executions, so
-        // handle these separately.
-        handleProcessingResultForUnsuccessfulExecution(
-          response,
-          status,
-          logger,
-        );
-        break;
-      } else if (status === "complete") {
-        break;
-      } else if (status === "failed") {
-        const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`;
-        const processingErrors = response.data.errors as string[];
-        throw shouldConsiderConfigurationError(processingErrors)
-          ? new ConfigurationError(message)
-          : shouldConsiderInvalidRequest(processingErrors)
-            ? new InvalidSarifUploadError(message)
-            : new Error(message);
-      } else {
-        util.assertNever(status);
-      }
-
-      if (statusCheckCount === STATUS_CHECK_MAX_TRIES) {
-        // If the analysis hasn't finished processing in the allotted time, we continue anyway rather than failing.
-        // It's possible the analysis will eventually finish processing, but it's not worth spending more
-        // Actions time waiting.
-        logger.warning(
-          "Timed out waiting for analysis to finish processing. Continuing.",
-        );
-        break;
-      } else {
-        statusCheckBackoff *= STATUS_CHECK_BACKOFF_MULTIPLIER;
-        await util.delay(statusCheckBackoff, { allowProcessExit: false });
-      }
-    }
-  } finally {
-    logger.endGroup();
-  }
-}
-
-/**
- * Returns whether the provided processing errors are a configuration error.
- */
-export function shouldConsiderConfigurationError(
-  processingErrors: string[],
-): boolean {
-  const expectedConfigErrors = [
-    "CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled",
-    "rejecting delivery as the repository has too many logical alerts",
-    "A delivery cannot contain multiple runs with the same category",
-  ];
-
-  return (
-    processingErrors.length === 1 &&
-    expectedConfigErrors.some((msg) => processingErrors[0].includes(msg))
-  );
-}
-
-/**
- * Returns whether the provided processing errors are the result of an invalid SARIF upload request.
- */
-export function shouldConsiderInvalidRequest(
-  processingErrors: string[],
-): boolean {
-  return processingErrors.every(
-    (error) =>
-      error.startsWith("rejecting SARIF") ||
-      error.startsWith("an invalid URI was provided as a SARIF location") ||
-      error.startsWith("locationFromSarifResult: expected artifact location") ||
-      error.startsWith(
-        "could not convert rules: invalid security severity value, is not a number",
-      ) ||
-      /^SARIF URI scheme [^\s]* did not match the checkout URI scheme [^\s]*/.test(
-        error,
-      ),
-  );
-}
-
-/**
- * Checks the processing result for an unsuccessful execution. Throws if the
- * result is not a failure with a single "unsuccessful execution" error.
- */
-function handleProcessingResultForUnsuccessfulExecution(
-  response: OctokitResponse,
-  status: Exclude,
-  logger: Logger,
-): void {
-  if (
-    status === "failed" &&
-    Array.isArray(response.data.errors) &&
-    response.data.errors.length === 1 &&
-    // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-    response.data.errors[0].toString().startsWith("unsuccessful execution")
-  ) {
-    logger.info(
-      "Successfully uploaded a SARIF file for the unsuccessful execution. Received expected " +
-        '"unsuccessful execution" processing error, and no other errors.',
-    );
-  } else if (status === "failed") {
-    logger.warning(
-      `Failed to upload a SARIF file for the unsuccessful execution. Code scanning status ` +
-        `information for the repository may be out of date as a result. Processing errors: ${response.data.errors}`,
-    );
-  } else if (status === "complete") {
-    // There is a known transient issue with the code scanning API where it sometimes reports
-    // `complete` for an unsuccessful execution submission.
-    logger.debug(
-      "Uploaded a SARIF file for the unsuccessful execution, but did not receive the expected " +
-        '"unsuccessful execution" processing error. This is a known transient issue with the ' +
-        "code scanning API, and does not cause out of date code scanning status information.",
-    );
-  } else {
-    util.assertNever(status);
-  }
-}
-
-export function validateUniqueCategory(
-  sarifLog: Partial,
-  sentinelPrefix: string,
-): void {
-  // duplicate categories are allowed in the same sarif file
-  // but not across multiple sarif files
-  const categories = {} as Record;
-
-  for (const run of sarifLog.runs || []) {
-    const id = run?.automationDetails?.id;
-    const tool = run.tool?.driver?.name;
-    const category = `${sanitize(id)}_${sanitize(tool)}`;
-    categories[category] = { id, tool };
-  }
-
-  for (const [category, { id, tool }] of Object.entries(categories)) {
-    const sentinelEnvVar = `${sentinelPrefix}${category}`;
-    if (process.env[sentinelEnvVar]) {
-      // This is always a configuration error, even for first-party runs.
-      throw new ConfigurationError(
-        "Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. " +
-          "The easiest fix is to specify a unique value for the `category` input. If .runs[].automationDetails.id is specified " +
-          "in the sarif file, that will take precedence over your configured `category`. " +
-          `Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})`,
-      );
-    }
-    core.exportVariable(sentinelEnvVar, sentinelEnvVar);
-  }
-}
-
-/**
- * Sanitizes a string to be used as an environment variable name.
- * This will replace all non-alphanumeric characters with underscores.
- * There could still be some false category clashes if two uploads
- * occur that differ only in their non-alphanumeric characters. This is
- * unlikely.
- *
- * @param str the initial value to sanitize
- */
-function sanitize(str?: string) {
-  return (str ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
-}
-
-export function filterAlertsByDiffRange(
-  logger: Logger,
-  sarifLog: Partial,
-): Partial {
-  const diffRanges = readDiffRangesJsonFile(logger);
-  if (!diffRanges?.length) {
-    return sarifLog;
-  }
-
-  if (sarifLog.runs === undefined) {
-    return sarifLog;
-  }
-
-  for (const run of sarifLog.runs) {
-    if (run.results) {
-      run.results = run.results.filter((result) => {
-        const locations = [
-          ...(result.locations || []).map((loc) => loc.physicalLocation),
-          ...(result.relatedLocations || []).map((loc) => loc.physicalLocation),
-        ];
-
-        return locations.some((physicalLocation) => {
-          const locationUri = physicalLocation?.artifactLocation?.uri;
-          const locationStartLine = physicalLocation?.region?.startLine;
-          if (!locationUri || locationStartLine === undefined) {
-            return false;
-          }
-          // Alert filtering here replicates the same behavior as the restrictAlertsTo
-          // extensible predicate in CodeQL. See the restrictAlertsTo documentation
-          // https://codeql.github.com/codeql-standard-libraries/csharp/codeql/util/AlertFiltering.qll/predicate.AlertFiltering$restrictAlertsTo.3.html
-          // for more details, such as why the filtering applies only to the first line
-          // of an alert location.
-          return diffRanges.some(
-            (range) =>
-              range.path === locationUri &&
-              ((range.startLine <= locationStartLine &&
-                range.endLine >= locationStartLine) ||
-                (range.startLine === 0 && range.endLine === 0)),
-          );
-        });
-      });
-    }
-  }
-
-  return sarifLog;
-}
diff --git a/src/upload-lib/types.ts b/src/upload-lib/types.ts
deleted file mode 100644
index 7282271f69..0000000000
--- a/src/upload-lib/types.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Represents the minimum, common payload for SARIF upload endpoints that we support.
- */
-export interface BasePayload {
-  /** The gzipped contents of a SARIF file. */
-  sarif: string;
-}
-
-/**
- * Represents the payload expected for Code Scanning and Code Quality SARIF uploads.
- */
-export interface UploadPayload extends BasePayload {
-  /** The SHA of the commit that was analysed. */
-  commit_oid: string;
-  /** The ref that was analysed. */
-  ref: string;
-  /** The analysis key that identifies the analysis. */
-  analysis_key?: string;
-  /** The name of the analysis. */
-  analysis_name?: string;
-  /** The ID of the workflow run that performed the analysis. */
-  workflow_run_id: number;
-  /** The attempt number. */
-  workflow_run_attempt: number;
-  /** The URI where the repository was checked out. */
-  checkout_uri: string;
-  /** The matrix value. */
-  environment?: string;
-  /** A string representation of when the analysis was started. */
-  started_at?: string;
-  /** The names of the tools that performed the analysis. */
-  tool_names: string[];
-  /** For a pull request, the ref of the base the PR is targeting. */
-  base_ref?: string;
-  /** For a pull request, the commit SHA of the merge base. */
-  base_sha?: string;
-}
-
-/**
- * Represents the payload expected for Code Scanning Risk Assessment SARIF uploads.
- */
-export interface AssessmentPayload extends BasePayload {
-  /** The ID of the assessment for which the SARIF is for. */
-  assessment_id: number;
-}
diff --git a/src/upload-sarif-action-post.ts b/src/upload-sarif-action-post.ts
deleted file mode 100644
index a27fe1667d..0000000000
--- a/src/upload-sarif-action-post.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * This file is the entry point for the `post:` hook of `upload-sarif-action.yml`.
- * It will run after the all steps in this job, in reverse order in relation to
- * other `post:` hooks.
- */
-import * as core from "@actions/core";
-
-import * as actionsUtil from "./actions-util";
-import { getGitHubVersion } from "./api-client";
-import * as debugArtifacts from "./debug-artifacts";
-import { EnvVar } from "./environment";
-import { getActionsLogger, withGroup } from "./logging";
-import { checkGitHubVersionInRange, getErrorMessage } from "./util";
-
-export async function runWrapper() {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-
-  try {
-    // Restore inputs from `upload-sarif` Action.
-    actionsUtil.restoreInputs();
-    const logger = getActionsLogger();
-    const gitHubVersion = await getGitHubVersion();
-    checkGitHubVersionInRange(gitHubVersion, logger);
-
-    // Upload SARIF artifacts if we determine that this is a third-party analysis run.
-    // For first-party runs, this artifact will be uploaded in the `analyze-post` step.
-    if (process.env[EnvVar.INIT_ACTION_HAS_RUN] !== "true") {
-      if (gitHubVersion.type === undefined) {
-        core.warning(
-          `Did not upload debug artifacts because cannot determine the GitHub variant running.`,
-        );
-        return;
-      }
-      await withGroup("Uploading combined SARIF debug artifact", () =>
-        debugArtifacts.uploadCombinedSarifArtifacts(
-          logger,
-          gitHubVersion.type,
-          // The codeqlVersion is not applicable for uploading non-codeql sarif.
-          // We can assume all versions are safe to upload.
-          undefined,
-        ),
-      );
-    }
-  } catch (error) {
-    core.setFailed(
-      `upload-sarif post-action step failed: ${getErrorMessage(error)}`,
-    );
-  }
-}
diff --git a/src/upload-sarif-action.ts b/src/upload-sarif-action.ts
deleted file mode 100644
index d3437510ce..0000000000
--- a/src/upload-sarif-action.ts
+++ /dev/null
@@ -1,172 +0,0 @@
-import * as core from "@actions/core";
-
-import { Action, ActionState, runInActions } from "./action-common";
-import * as actionsUtil from "./actions-util";
-import { getActionVersion, getTemporaryDirectory } from "./actions-util";
-import * as analyses from "./analyses";
-import { getGitHubVersion } from "./api-client";
-import { initFeatures } from "./feature-flags";
-import { Logger } from "./logging";
-import { getRepositoryNwo } from "./repository";
-import { InvalidSarifUploadError } from "./sarif";
-import {
-  createStatusReportBase,
-  sendStatusReport,
-  StatusReportBase,
-  getActionsStatus,
-  ActionName,
-  isThirdPartyAnalysis,
-} from "./status-report";
-import * as upload_lib from "./upload-lib";
-import { postProcessAndUploadSarif } from "./upload-sarif";
-import {
-  ConfigurationError,
-  checkActionVersion,
-  checkDiskUsage,
-  initializeEnvironment,
-  shouldSkipSarifUpload,
-  wrapError,
-} from "./util";
-
-interface UploadSarifStatusReport
-  extends StatusReportBase,
-    upload_lib.UploadStatusReport {}
-
-async function sendSuccessStatusReport(
-  startedAt: Date,
-  uploadStats: upload_lib.UploadStatusReport,
-  logger: Logger,
-) {
-  const statusReportBase = await createStatusReportBase(
-    ActionName.UploadSarif,
-    "success",
-    startedAt,
-    undefined,
-    await checkDiskUsage(logger),
-    logger,
-  );
-  if (statusReportBase !== undefined) {
-    const statusReport: UploadSarifStatusReport = {
-      ...statusReportBase,
-      ...uploadStats,
-    };
-    await sendStatusReport(statusReport);
-  }
-}
-
-async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) {
-  // To capture errors appropriately, keep as much code within the try-catch as
-  // possible, and only use safe functions outside.
-  try {
-    initializeEnvironment(getActionVersion());
-
-    const gitHubVersion = await getGitHubVersion();
-    checkActionVersion(getActionVersion(), gitHubVersion);
-
-    // Make inputs accessible in the `post` step.
-    actionsUtil.persistInputs();
-
-    const repositoryNwo = getRepositoryNwo();
-    const features = initFeatures(
-      gitHubVersion,
-      repositoryNwo,
-      getTemporaryDirectory(),
-      logger,
-    );
-
-    const startingStatusReportBase = await createStatusReportBase(
-      ActionName.UploadSarif,
-      "starting",
-      startedAt,
-      undefined,
-      await checkDiskUsage(logger),
-      logger,
-    );
-    if (startingStatusReportBase !== undefined) {
-      await sendStatusReport(startingStatusReportBase);
-    }
-
-    // `sarifPath` can either be a path to a single file, or a path to a directory.
-    const sarifPath = actionsUtil.getRequiredInput("sarif_file");
-    const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
-    const category = actionsUtil.getOptionalInput("category");
-
-    const uploadResults = await postProcessAndUploadSarif(
-      logger,
-      features,
-      "always",
-      checkoutPath,
-      sarifPath,
-      category,
-    );
-
-    // Fail if we didn't upload anything.
-    if (Object.keys(uploadResults).length === 0) {
-      throw new ConfigurationError(
-        `No SARIF files found to upload in "${sarifPath}".`,
-      );
-    }
-
-    const codeScanningResult =
-      uploadResults[analyses.AnalysisKind.CodeScanning];
-    if (codeScanningResult !== undefined) {
-      core.setOutput("sarif-id", codeScanningResult.sarifID);
-    }
-    core.setOutput("sarif-ids", JSON.stringify(uploadResults));
-
-    // We don't upload results in test mode, so don't wait for processing
-    if (shouldSkipSarifUpload()) {
-      core.debug(
-        "SARIF upload disabled by an environment variable. Waiting for processing is disabled.",
-      );
-    } else if (actionsUtil.getRequiredInput("wait-for-processing") === "true") {
-      if (codeScanningResult !== undefined) {
-        await upload_lib.waitForProcessing(
-          getRepositoryNwo(),
-          codeScanningResult.sarifID,
-          logger,
-        );
-      }
-      // The code quality service does not currently have an endpoint to wait for SARIF processing,
-      // so we can't wait for that here.
-    }
-    await sendSuccessStatusReport(
-      startedAt,
-      codeScanningResult?.statusReport || {},
-      logger,
-    );
-  } catch (unwrappedError) {
-    const error =
-      isThirdPartyAnalysis(ActionName.UploadSarif) &&
-      unwrappedError instanceof InvalidSarifUploadError
-        ? new ConfigurationError(unwrappedError.message)
-        : wrapError(unwrappedError);
-    const message = error.message;
-    core.setFailed(message);
-
-    const errorStatusReportBase = await createStatusReportBase(
-      ActionName.UploadSarif,
-      getActionsStatus(error),
-      startedAt,
-      undefined,
-      await checkDiskUsage(logger),
-      logger,
-      message,
-      error.stack,
-    );
-    if (errorStatusReportBase !== undefined) {
-      await sendStatusReport(errorStatusReportBase);
-    }
-    return;
-  }
-}
-
-/** Defines the `upload-sarif` Action. */
-const uploadSarif: Action = {
-  name: ActionName.UploadSarif,
-  run,
-};
-
-export async function runWrapper() {
-  await runInActions(uploadSarif);
-}
diff --git a/src/upload-sarif.test.ts b/src/upload-sarif.test.ts
deleted file mode 100644
index d310bce92a..0000000000
--- a/src/upload-sarif.test.ts
+++ /dev/null
@@ -1,271 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-
-import test, { ExecutionContext } from "ava";
-import * as sinon from "sinon";
-
-import { AnalysisKind, getAnalysisConfig } from "./analyses";
-import { getRunnerLogger } from "./logging";
-import { createFeatures, makeMacro, setupTests } from "./testing-utils";
-import { UploadResult } from "./upload-lib";
-import * as uploadLib from "./upload-lib";
-import { postProcessAndUploadSarif } from "./upload-sarif";
-import * as util from "./util";
-
-setupTests(test);
-
-interface UploadSarifExpectedResult {
-  uploadResult?: UploadResult;
-  expectedFiles?: string[];
-}
-
-function mockPostProcessSarifFiles() {
-  const postProcessSarifFiles = sinon.stub(uploadLib, "postProcessSarifFiles");
-
-  for (const analysisKind of Object.values(AnalysisKind)) {
-    const analysisConfig = getAnalysisConfig(analysisKind);
-    postProcessSarifFiles
-      .withArgs(
-        sinon.match.any,
-        sinon.match.any,
-        sinon.match.any,
-        sinon.match.any,
-        sinon.match.any,
-        analysisConfig,
-      )
-      .resolves({
-        sarif: { version: "2.1.0", runs: [] },
-        analysisKey: "",
-        environment: "",
-      });
-  }
-
-  return postProcessSarifFiles;
-}
-
-const postProcessAndUploadSarifMacro = makeMacro({
-  exec: async (
-    t: ExecutionContext,
-    sarifFiles: string[],
-    sarifPath: (tempDir: string) => string = (tempDir) => tempDir,
-    expectedResult: Partial>,
-  ) => {
-    await util.withTmpDir(async (tempDir) => {
-      const logger = getRunnerLogger(true);
-      const testPath = sarifPath(tempDir);
-      const features = createFeatures([]);
-
-      const toFullPath = (filename: string) => path.join(tempDir, filename);
-
-      const postProcessSarifFiles = mockPostProcessSarifFiles();
-      const uploadPostProcessedFiles = sinon.stub(
-        uploadLib,
-        "uploadPostProcessedFiles",
-      );
-
-      for (const analysisKind of Object.values(AnalysisKind)) {
-        const analysisConfig = getAnalysisConfig(analysisKind);
-        uploadPostProcessedFiles
-          .withArgs(logger, sinon.match.any, analysisConfig, sinon.match.any)
-          .resolves(expectedResult[analysisKind]?.uploadResult);
-      }
-
-      const fullSarifPaths = sarifFiles.map(toFullPath);
-      for (const sarifFile of fullSarifPaths) {
-        fs.writeFileSync(sarifFile, "");
-      }
-
-      const actual = await postProcessAndUploadSarif(
-        logger,
-        features,
-        "always",
-        "",
-        testPath,
-      );
-
-      for (const analysisKind of Object.values(AnalysisKind)) {
-        const analysisKindResult = expectedResult[analysisKind];
-        if (analysisKindResult) {
-          // We are expecting a result for this analysis kind, check that we have it.
-          t.deepEqual(actual[analysisKind], analysisKindResult.uploadResult);
-          // Additionally, check that the mocked `postProcessSarifFiles` was called with only the file paths
-          // that we expected it to be called with.
-          t.assert(
-            postProcessSarifFiles.calledWith(
-              logger,
-              features,
-              sinon.match.any,
-              analysisKindResult.expectedFiles?.map(toFullPath) ??
-                fullSarifPaths,
-              sinon.match.any,
-              getAnalysisConfig(analysisKind),
-            ),
-          );
-        } else {
-          // Otherwise, we are not expecting a result for this analysis kind. However, note that `undefined`
-          // is also returned by our mocked `uploadProcessedFiles` when there is no expected result for this
-          // analysis kind.
-          t.is(actual[analysisKind], undefined);
-          // Therefore, we also check that the mocked `uploadProcessedFiles` was not called for this analysis kind.
-          t.assert(
-            !uploadPostProcessedFiles.calledWith(
-              logger,
-              sinon.match.any,
-              getAnalysisConfig(analysisKind),
-              sinon.match.any,
-            ),
-            `uploadProcessedFiles was called for ${analysisKind}, but should not have been.`,
-          );
-        }
-      }
-    });
-  },
-  title: (providedTitle = "") => `processAndUploadSarif - ${providedTitle}`,
-});
-
-postProcessAndUploadSarifMacro.serial(
-  "SARIF file",
-  ["test.sarif"],
-  (tempDir) => path.join(tempDir, "test.sarif"),
-  {
-    "code-scanning": {
-      uploadResult: {
-        statusReport: {},
-        sarifID: "code-scanning-sarif",
-      },
-    },
-  },
-);
-
-postProcessAndUploadSarifMacro.serial(
-  "JSON file",
-  ["test.json"],
-  (tempDir) => path.join(tempDir, "test.json"),
-  {
-    "code-scanning": {
-      uploadResult: {
-        statusReport: {},
-        sarifID: "code-scanning-sarif",
-      },
-    },
-  },
-);
-
-postProcessAndUploadSarifMacro.serial(
-  "Code Scanning files",
-  ["test.json", "test.sarif"],
-  undefined,
-  {
-    "code-scanning": {
-      uploadResult: {
-        statusReport: {},
-        sarifID: "code-scanning-sarif",
-      },
-      expectedFiles: ["test.sarif"],
-    },
-  },
-);
-
-postProcessAndUploadSarifMacro.serial(
-  "Code Quality file",
-  ["test.quality.sarif"],
-  (tempDir) => path.join(tempDir, "test.quality.sarif"),
-  {
-    "code-quality": {
-      uploadResult: {
-        statusReport: {},
-        sarifID: "code-quality-sarif",
-      },
-    },
-  },
-);
-
-postProcessAndUploadSarifMacro.serial(
-  "Mixed files",
-  ["test.sarif", "test.quality.sarif"],
-  undefined,
-  {
-    "code-scanning": {
-      uploadResult: {
-        statusReport: {},
-        sarifID: "code-scanning-sarif",
-      },
-      expectedFiles: ["test.sarif"],
-    },
-    "code-quality": {
-      uploadResult: {
-        statusReport: {},
-        sarifID: "code-quality-sarif",
-      },
-      expectedFiles: ["test.quality.sarif"],
-    },
-  },
-);
-
-test.serial(
-  "postProcessAndUploadSarif doesn't upload if upload is disabled",
-  async (t) => {
-    await util.withTmpDir(async (tempDir) => {
-      const logger = getRunnerLogger(true);
-      const features = createFeatures([]);
-
-      const toFullPath = (filename: string) => path.join(tempDir, filename);
-
-      const postProcessSarifFiles = mockPostProcessSarifFiles();
-      const uploadPostProcessedFiles = sinon.stub(
-        uploadLib,
-        "uploadPostProcessedFiles",
-      );
-
-      fs.writeFileSync(toFullPath("test.sarif"), "");
-      fs.writeFileSync(toFullPath("test.quality.sarif"), "");
-
-      const actual = await postProcessAndUploadSarif(
-        logger,
-        features,
-        "never",
-        "",
-        tempDir,
-      );
-
-      t.truthy(actual);
-      t.assert(postProcessSarifFiles.calledTwice);
-      t.assert(uploadPostProcessedFiles.notCalled);
-    });
-  },
-);
-
-test.serial(
-  "postProcessAndUploadSarif writes post-processed SARIF files if output directory is provided",
-  async (t) => {
-    await util.withTmpDir(async (tempDir) => {
-      const logger = getRunnerLogger(true);
-      const features = createFeatures([]);
-
-      const toFullPath = (filename: string) => path.join(tempDir, filename);
-
-      const postProcessSarifFiles = mockPostProcessSarifFiles();
-
-      fs.writeFileSync(toFullPath("test.sarif"), "");
-      fs.writeFileSync(toFullPath("test.quality.sarif"), "");
-
-      const postProcessedOutPath = path.join(tempDir, "post-processed");
-      const actual = await postProcessAndUploadSarif(
-        logger,
-        features,
-        "never",
-        "",
-        tempDir,
-        "",
-        postProcessedOutPath,
-      );
-
-      t.truthy(actual);
-      t.assert(postProcessSarifFiles.calledTwice);
-      t.assert(fs.existsSync(path.join(postProcessedOutPath, "upload.sarif")));
-      t.assert(
-        fs.existsSync(path.join(postProcessedOutPath, "upload.quality.sarif")),
-      );
-    });
-  },
-);
diff --git a/src/upload-sarif.ts b/src/upload-sarif.ts
deleted file mode 100644
index bc2c886982..0000000000
--- a/src/upload-sarif.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import { UploadKind } from "./actions-util";
-import * as analyses from "./analyses";
-import { FeatureEnablement } from "./feature-flags";
-import { Logger } from "./logging";
-import * as upload_lib from "./upload-lib";
-import { unsafeEntriesInvariant } from "./util";
-
-// Maps analysis kinds to SARIF IDs.
-export type UploadSarifResults = Partial<
-  Record
->;
-
-/**
- * Finds SARIF files in `sarifPath`, post-processes them, and uploads them to the appropriate services.
- *
- * @param logger The logger to use.
- * @param features Information about enabled features.
- * @param uploadKind The kind of upload that is requested.
- * @param checkoutPath The path where the repository was checked out at.
- * @param sarifPath The path to the file or directory to upload.
- * @param category The analysis category.
- * @param postProcessedOutputPath The path to a directory to which the post-processed SARIF files should be written to.
- *
- * @returns A partial mapping from analysis kinds to the upload results.
- */
-export async function postProcessAndUploadSarif(
-  logger: Logger,
-  features: FeatureEnablement,
-  uploadKind: UploadKind,
-  checkoutPath: string,
-  sarifPath: string,
-  category?: string,
-  postProcessedOutputPath?: string,
-): Promise {
-  const sarifGroups = await upload_lib.getGroupedSarifFilePaths(
-    logger,
-    sarifPath,
-  );
-
-  const uploadResults: UploadSarifResults = {};
-  for (const [analysisKind, sarifFiles] of unsafeEntriesInvariant(
-    sarifGroups,
-  )) {
-    const analysisConfig = analyses.getAnalysisConfig(analysisKind);
-    const postProcessingResults = await upload_lib.postProcessSarifFiles(
-      logger,
-      features,
-      checkoutPath,
-      sarifFiles,
-      category,
-      analysisConfig,
-    );
-
-    // Write the post-processed SARIF files to disk. This will only write them if needed based on user inputs
-    // or environment variables.
-    await upload_lib.writePostProcessedFiles(
-      logger,
-      postProcessedOutputPath,
-      analysisConfig,
-      postProcessingResults,
-    );
-
-    // Only perform the actual upload of the post-processed files if `uploadKind` is `always`.
-    if (uploadKind === "always") {
-      uploadResults[analysisKind] = await upload_lib.uploadPostProcessedFiles(
-        logger,
-        checkoutPath,
-        analysisConfig,
-        postProcessingResults,
-      );
-    }
-  }
-
-  return uploadResults;
-}
diff --git a/src/util.test.ts b/src/util.test.ts
deleted file mode 100644
index cca457cbe6..0000000000
--- a/src/util.test.ts
+++ /dev/null
@@ -1,534 +0,0 @@
-import * as fs from "fs";
-import * as os from "os";
-import path from "path";
-
-import * as core from "@actions/core";
-import test from "ava";
-import * as yaml from "js-yaml";
-import * as sinon from "sinon";
-
-import * as api from "./api-client";
-import { EnvVar } from "./environment";
-import { getRunnerLogger } from "./logging";
-import { setupTests } from "./testing-utils";
-import * as util from "./util";
-
-setupTests(test);
-
-const GET_MEMORY_FLAG_TESTS = [
-  {
-    input: undefined,
-    totalMemoryMb: 8 * 1024,
-    platform: "linux",
-    expectedMemoryValue: 7 * 1024,
-  },
-  {
-    input: undefined,
-    totalMemoryMb: 8 * 1024,
-    platform: "win32",
-    expectedMemoryValue: 6.5 * 1024,
-  },
-  {
-    input: "",
-    totalMemoryMb: 8 * 1024,
-    platform: "linux",
-    expectedMemoryValue: 7 * 1024,
-  },
-  {
-    input: "512",
-    totalMemoryMb: 8 * 1024,
-    platform: "linux",
-    expectedMemoryValue: 512,
-  },
-  {
-    input: undefined,
-    totalMemoryMb: 64 * 1024,
-    platform: "linux",
-    expectedMemoryValue: 61644, // Math.floor(1024 * (64 - 1 - 0.05 * (64 - 8)))
-  },
-  {
-    input: undefined,
-    totalMemoryMb: 64 * 1024,
-    platform: "win32",
-    expectedMemoryValue: 61132, // Math.floor(1024 * (64 - 1.5 - 0.05 * (64 - 8)))
-  },
-  {
-    input: undefined,
-    totalMemoryMb: 64 * 1024,
-    platform: "linux",
-    expectedMemoryValue: 58777, // Math.floor(1024 * (64 - 1 - 0.1 * (64 - 8)))
-    reservedPercentageValue: "10",
-  },
-];
-
-for (const {
-  input,
-  totalMemoryMb,
-  platform,
-  expectedMemoryValue,
-  reservedPercentageValue,
-} of GET_MEMORY_FLAG_TESTS) {
-  test.serial(
-    `Memory flag value is ${expectedMemoryValue} for ${
-      input ?? "no user input"
-    } on ${platform} with ${totalMemoryMb} MB total system RAM${
-      reservedPercentageValue
-        ? ` and reserved percentage env var set to ${reservedPercentageValue}`
-        : ""
-    }`,
-    async (t) => {
-      process.env[EnvVar.SCALING_RESERVED_RAM_PERCENTAGE] =
-        reservedPercentageValue || undefined;
-      const flag = util.getMemoryFlagValueForPlatform(
-        input,
-        totalMemoryMb * 1024 * 1024,
-        platform,
-      );
-      t.deepEqual(flag, expectedMemoryValue);
-    },
-  );
-}
-
-test("getMemoryFlag() throws if the ram input is < 0 or NaN", async (t) => {
-  for (const input of ["-1", "hello!"]) {
-    t.throws(() => util.getMemoryFlag(input, getRunnerLogger(true)));
-  }
-});
-
-test("getThreadsFlag() should return the correct --threads flag", (t) => {
-  const numCpus = os.cpus().length;
-
-  const tests: Array<[string | undefined, string]> = [
-    ["0", "--threads=0"],
-    ["1", "--threads=1"],
-    [undefined, `--threads=${numCpus}`],
-    ["", `--threads=${numCpus}`],
-    [`${numCpus + 1}`, `--threads=${numCpus}`],
-    [`${-numCpus - 1}`, `--threads=${-numCpus}`],
-  ];
-
-  for (const [input, expectedFlag] of tests) {
-    const flag = util.getThreadsFlag(input, getRunnerLogger(true));
-    t.deepEqual(flag, expectedFlag);
-  }
-});
-
-test("getThreadsFlag() throws if the threads input is not an integer", (t) => {
-  t.throws(() => util.getThreadsFlag("hello!", getRunnerLogger(true)));
-});
-
-test.serial(
-  "getExtraOptionsEnvParam() succeeds on valid JSON with invalid options (for now)",
-  (t) => {
-    const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS;
-
-    const options = { foo: 42 };
-
-    process.env.CODEQL_ACTION_EXTRA_OPTIONS = JSON.stringify(options);
-
-    t.deepEqual(util.getExtraOptionsEnvParam(), options);
-
-    process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions;
-  },
-);
-
-test.serial("getExtraOptionsEnvParam() succeeds on valid JSON options", (t) => {
-  const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS;
-
-  const options = { database: { init: ["--debug"] } };
-  process.env.CODEQL_ACTION_EXTRA_OPTIONS = JSON.stringify(options);
-
-  t.deepEqual(util.getExtraOptionsEnvParam(), options);
-
-  process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions;
-});
-
-test.serial("getExtraOptionsEnvParam() succeeds on valid YAML options", (t) => {
-  const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS;
-
-  const options = { database: { init: ["--debug"] } };
-  process.env.CODEQL_ACTION_EXTRA_OPTIONS = yaml.dump(options);
-
-  t.deepEqual(util.getExtraOptionsEnvParam(), { ...options });
-
-  process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions;
-});
-
-test.serial("getExtraOptionsEnvParam() fails on invalid JSON", (t) => {
-  const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS;
-
-  process.env.CODEQL_ACTION_EXTRA_OPTIONS = "{{invalid-json}";
-  t.throws(util.getExtraOptionsEnvParam);
-
-  process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions;
-});
-
-test("parseGitHubUrl", (t) => {
-  t.deepEqual(util.parseGitHubUrl("github.com"), "https://github.com");
-  t.deepEqual(util.parseGitHubUrl("https://github.com"), "https://github.com");
-  t.deepEqual(
-    util.parseGitHubUrl("https://api.github.com"),
-    "https://github.com",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://github.com/foo/bar"),
-    "https://github.com",
-  );
-
-  t.deepEqual(
-    util.parseGitHubUrl("github.example.com"),
-    "https://github.example.com/",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://github.example.com"),
-    "https://github.example.com/",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://api.github.example.com"),
-    "https://github.example.com/",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://github.example.com/api/v3"),
-    "https://github.example.com/",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://github.example.com:1234"),
-    "https://github.example.com:1234/",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://api.github.example.com:1234"),
-    "https://github.example.com:1234/",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://github.example.com:1234/api/v3"),
-    "https://github.example.com:1234/",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://github.example.com/base/path"),
-    "https://github.example.com/base/path/",
-  );
-  t.deepEqual(
-    util.parseGitHubUrl("https://github.example.com/base/path/api/v3"),
-    "https://github.example.com/base/path/",
-  );
-
-  t.throws(() => util.parseGitHubUrl(""), {
-    message: '"" is not a valid URL',
-  });
-  t.throws(() => util.parseGitHubUrl("ssh://github.com"), {
-    message: '"ssh://github.com" is not a http or https URL',
-  });
-  t.throws(() => util.parseGitHubUrl("http:///::::433"), {
-    message: '"http:///::::433" is not a valid URL',
-  });
-});
-
-test("allowed API versions", async (t) => {
-  t.is(util.apiVersionInRange("1.33.0", "1.33", "2.0"), undefined);
-  t.is(util.apiVersionInRange("1.33.1", "1.33", "2.0"), undefined);
-  t.is(util.apiVersionInRange("1.34.0", "1.33", "2.0"), undefined);
-  t.is(util.apiVersionInRange("2.0.0", "1.33", "2.0"), undefined);
-  t.is(util.apiVersionInRange("2.0.1", "1.33", "2.0"), undefined);
-  t.is(
-    util.apiVersionInRange("1.32.0", "1.33", "2.0"),
-    util.DisallowedAPIVersionReason.ACTION_TOO_NEW,
-  );
-  t.is(
-    util.apiVersionInRange("2.1.0", "1.33", "2.0"),
-    util.DisallowedAPIVersionReason.ACTION_TOO_OLD,
-  );
-});
-
-test.serial("getRequiredEnvParam - gets environment variables", (t) => {
-  process.env.SOME_UNIT_TEST_VAR = "foo";
-  const result = util.getRequiredEnvParam("SOME_UNIT_TEST_VAR");
-  t.is(result, "foo");
-});
-
-test("getRequiredEnvParam - throws if an environment variable isn't set", (t) => {
-  t.throws(() => util.getRequiredEnvParam("SOME_UNIT_TEST_VAR"));
-});
-
-test.serial("getOptionalEnvVar - gets environment variables", (t) => {
-  process.env.SOME_UNIT_TEST_VAR = "foo";
-  const result = util.getOptionalEnvVar("SOME_UNIT_TEST_VAR");
-  t.is(result, "foo");
-});
-
-test.serial(
-  "getOptionalEnvVar - gets undefined for empty environment variables",
-  (t) => {
-    process.env.SOME_UNIT_TEST_VAR = "";
-    const result = util.getOptionalEnvVar("SOME_UNIT_TEST_VAR");
-    t.is(result, undefined);
-  },
-);
-
-test("getOptionalEnvVar - doesn't throw for undefined environment variables", (t) => {
-  t.notThrows(() => {
-    const result = util.getOptionalEnvVar("SOME_UNIT_TEST_VAR");
-    t.is(result, undefined);
-  });
-});
-
-test("doesDirectoryExist", async (t) => {
-  // Returns false if no file/dir of this name exists
-  t.false(util.doesDirectoryExist("non-existent-file.txt"));
-
-  await util.withTmpDir(async (tmpDir: string) => {
-    // Returns false if file
-    const testFile = `${tmpDir}/test-file.txt`;
-    fs.writeFileSync(testFile, "");
-    t.false(util.doesDirectoryExist(testFile));
-
-    // Returns true if directory
-    fs.writeFileSync(`${tmpDir}/nested-test-file.txt`, "");
-    t.true(util.doesDirectoryExist(tmpDir));
-  });
-});
-
-test("listFolder", async (t) => {
-  // Returns empty if not a directory
-  t.deepEqual(util.listFolder("not-a-directory"), []);
-
-  // Returns empty if directory is empty
-  await util.withTmpDir(async (emptyTmpDir: string) => {
-    t.deepEqual(util.listFolder(emptyTmpDir), []);
-  });
-
-  // Returns all file names in directory
-  await util.withTmpDir(async (tmpDir: string) => {
-    const nestedDir = fs.mkdtempSync(path.join(tmpDir, "nested-"));
-    fs.writeFileSync(path.resolve(nestedDir, "nested-test-file.txt"), "");
-    fs.writeFileSync(path.resolve(tmpDir, "test-file-1.txt"), "");
-    fs.writeFileSync(path.resolve(tmpDir, "test-file-2.txt"), "");
-    fs.writeFileSync(path.resolve(tmpDir, "test-file-3.txt"), "");
-
-    t.deepEqual(util.listFolder(tmpDir), [
-      path.resolve(nestedDir, "nested-test-file.txt"),
-      path.resolve(tmpDir, "test-file-1.txt"),
-      path.resolve(tmpDir, "test-file-2.txt"),
-      path.resolve(tmpDir, "test-file-3.txt"),
-    ]);
-  });
-});
-
-const longTime = 999_999;
-const shortTime = 10;
-
-test("waitForResultWithTimeLimit on long task", async (t) => {
-  let longTaskTimedOut = false;
-  const longTask = new Promise((resolve) => {
-    const timer = setTimeout(() => {
-      resolve(42);
-    }, longTime);
-    t.teardown(() => clearTimeout(timer));
-  });
-  const result = await util.waitForResultWithTimeLimit(
-    shortTime,
-    longTask,
-    () => {
-      longTaskTimedOut = true;
-    },
-  );
-  t.deepEqual(longTaskTimedOut, true);
-  t.deepEqual(result, undefined);
-});
-
-test("waitForResultWithTimeLimit on short task", async (t) => {
-  let shortTaskTimedOut = false;
-  const shortTask = new Promise((resolve) => {
-    setTimeout(() => {
-      resolve(99);
-    }, shortTime);
-  });
-  const result = await util.waitForResultWithTimeLimit(
-    longTime,
-    shortTask,
-    () => {
-      shortTaskTimedOut = true;
-    },
-  );
-  t.deepEqual(shortTaskTimedOut, false);
-  t.deepEqual(result, 99);
-});
-
-test("waitForResultWithTimeLimit doesn't call callback if promise resolves", async (t) => {
-  let shortTaskTimedOut = false;
-  const shortTask = new Promise((resolve) => {
-    setTimeout(() => {
-      resolve(99);
-    }, shortTime);
-  });
-  const result = await util.waitForResultWithTimeLimit(100, shortTask, () => {
-    shortTaskTimedOut = true;
-  });
-  await new Promise((r) => setTimeout(r, 200));
-  t.deepEqual(shortTaskTimedOut, false);
-  t.deepEqual(result, 99);
-});
-
-function formatGitHubVersion(version: util.GitHubVersion): string {
-  switch (version.type) {
-    case util.GitHubVariant.DOTCOM:
-      return "dotcom";
-    case util.GitHubVariant.GHEC_DR:
-      return "GHEC-DR";
-    case util.GitHubVariant.GHES:
-      return `GHES ${version.version}`;
-    default:
-      util.assertNever(version);
-  }
-}
-
-const CHECK_ACTION_VERSION_TESTS: Array<[string, util.GitHubVersion, boolean]> =
-  [
-    ["2.2.1", { type: util.GitHubVariant.DOTCOM }, true],
-    ["2.2.1", { type: util.GitHubVariant.GHEC_DR }, true],
-    ["2.2.1", { type: util.GitHubVariant.GHES, version: "3.10" }, false],
-    ["2.2.1", { type: util.GitHubVariant.GHES, version: "3.11" }, false],
-    ["2.2.1", { type: util.GitHubVariant.GHES, version: "3.12" }, false],
-    ["3.2.1", { type: util.GitHubVariant.DOTCOM }, true],
-    ["3.2.1", { type: util.GitHubVariant.GHEC_DR }, true],
-    ["3.2.1", { type: util.GitHubVariant.GHES, version: "3.10" }, false],
-    ["3.2.1", { type: util.GitHubVariant.GHES, version: "3.11" }, false],
-    ["3.2.1", { type: util.GitHubVariant.GHES, version: "3.12" }, false],
-    ["3.2.1", { type: util.GitHubVariant.GHES, version: "3.19" }, false],
-    ["3.2.1", { type: util.GitHubVariant.GHES, version: "3.20" }, true],
-    ["3.2.1", { type: util.GitHubVariant.GHES, version: "3.21" }, true],
-    ["4.2.1", { type: util.GitHubVariant.DOTCOM }, false],
-    ["4.2.1", { type: util.GitHubVariant.GHEC_DR }, false],
-    ["4.2.1", { type: util.GitHubVariant.GHES, version: "3.19" }, false],
-    ["4.2.1", { type: util.GitHubVariant.GHES, version: "3.20" }, false],
-    ["4.2.1", { type: util.GitHubVariant.GHES, version: "3.21" }, false],
-  ];
-
-for (const [
-  version,
-  githubVersion,
-  shouldReportError,
-] of CHECK_ACTION_VERSION_TESTS) {
-  const reportErrorDescription = shouldReportError
-    ? "reports error"
-    : "doesn't report error";
-  const versionsDescription = `CodeQL Action version ${version} and GitHub version ${formatGitHubVersion(
-    githubVersion,
-  )}`;
-  test.serial(
-    `checkActionVersion ${reportErrorDescription} for ${versionsDescription}`,
-    async (t) => {
-      const warningSpy = sinon.spy(core, "warning");
-      sinon.stub(api, "getGitHubVersion").resolves(githubVersion);
-
-      // call checkActionVersion twice and assert below that warning is reported only once
-      util.checkActionVersion(version, await api.getGitHubVersion());
-      util.checkActionVersion(version, await api.getGitHubVersion());
-
-      if (shouldReportError) {
-        t.true(
-          warningSpy.calledOnceWithExactly(
-            sinon.match(
-              "CodeQL Action v3 will be deprecated in December 2026.",
-            ),
-          ),
-        );
-      } else {
-        t.false(warningSpy.called);
-      }
-    },
-  );
-}
-
-test("getCgroupCpuCountFromCpus calculates the number of CPUs correctly", async (t) => {
-  await util.withTmpDir(async (tmpDir: string) => {
-    const testCpuFile = `${tmpDir}/cpus-file`;
-    fs.writeFileSync(testCpuFile, "1, 9-10\n", "utf-8");
-    t.deepEqual(
-      util.getCgroupCpuCountFromCpus(testCpuFile, getRunnerLogger(true)),
-      3,
-    );
-  });
-});
-
-test("getCgroupCpuCountFromCpus returns undefined if the CPU file doesn't exist", async (t) => {
-  await util.withTmpDir(async (tmpDir: string) => {
-    const testCpuFile = `${tmpDir}/cpus-file`;
-    t.false(fs.existsSync(testCpuFile));
-    t.deepEqual(
-      util.getCgroupCpuCountFromCpus(testCpuFile, getRunnerLogger(true)),
-      undefined,
-    );
-  });
-});
-
-test("getCgroupCpuCountFromCpus returns undefined if the CPU file exists but is empty", async (t) => {
-  await util.withTmpDir(async (tmpDir: string) => {
-    const testCpuFile = `${tmpDir}/cpus-file`;
-    fs.writeFileSync(testCpuFile, "\n", "utf-8");
-    t.deepEqual(
-      util.getCgroupCpuCountFromCpus(testCpuFile, getRunnerLogger(true)),
-      undefined,
-    );
-  });
-});
-
-test.serial(
-  "checkDiskUsage succeeds and produces positive numbers",
-  async (t) => {
-    process.env["GITHUB_WORKSPACE"] = os.tmpdir();
-    const diskUsage = await util.checkDiskUsage(getRunnerLogger(true));
-    if (t.truthy(diskUsage)) {
-      t.true(diskUsage.numAvailableBytes > 0);
-      t.true(diskUsage.numTotalBytes > 0);
-    }
-  },
-);
-
-test("joinAtMost - behaves like join if limit is <= 0", (t) => {
-  const sep = ", ";
-  const array: string[] = new Array(10).fill("test");
-  t.is(util.joinAtMost(array, sep, 0), array.join(sep));
-  t.is(util.joinAtMost(array, sep, -1), array.join(sep));
-});
-
-test("joinAtMost - behaves like join if limit is >= the size of the array", (t) => {
-  const sep = ", ";
-  const array: string[] = new Array(10).fill("test");
-  t.is(util.joinAtMost(array, sep, 10), array.join(sep));
-  t.is(util.joinAtMost(array, sep, 11), array.join(sep));
-});
-
-test("joinAtMost - truncates list if array is > than limit", (t) => {
-  const sep = ", ";
-  const array: string[] = Array.from(new Array(10), (_, i) => `test${i + 1}`);
-  const result = util.joinAtMost(array, sep, 5);
-  t.not(result, array.join(sep));
-  t.assert(result.endsWith(", ..."));
-  t.assert(result.includes("test5"));
-  t.false(result.includes("test6"));
-});
-
-test("Success creates a success result", (t) => {
-  const result = new util.Success("test value");
-  t.true(result.isSuccess());
-  t.false(result.isFailure());
-  t.is(result.value, "test value");
-});
-
-test("Failure creates a failure result", (t) => {
-  const error = new Error("test error");
-  const result = new util.Failure(error);
-  t.false(result.isSuccess());
-  t.true(result.isFailure());
-  t.is(result.value, error);
-});
-
-test("Success.orElse returns the value for a success result", (t) => {
-  const result = new util.Success("success value");
-  t.is(result.orElse("default value"), "success value");
-});
-
-test("Failure.orElse returns the default value for a failure result", (t) => {
-  const result = new util.Failure(new Error("test error"));
-  t.is(result.orElse("default value"), "default value");
-});
diff --git a/src/util.ts b/src/util.ts
deleted file mode 100644
index 2d910dec3b..0000000000
--- a/src/util.ts
+++ /dev/null
@@ -1,1148 +0,0 @@
-import * as fs from "fs";
-import * as fsPromises from "fs/promises";
-import * as os from "os";
-import * as path from "path";
-
-import * as core from "@actions/core";
-import * as io from "@actions/io";
-import getFolderSize from "get-folder-size";
-import * as yaml from "js-yaml";
-import * as semver from "semver";
-
-import * as apiCompatibility from "./api-compatibility.json";
-import type { CodeQL } from "./codeql";
-import type { Pack } from "./config/db-config";
-import type { Config } from "./config-utils";
-import { EnvVar, getRequiredEnvParam } from "./environment";
-import * as json from "./json";
-import { Language } from "./languages";
-import { Logger } from "./logging";
-
-// Re-export for backwards compatibility to avoid updating a lot of imports elsewhere.
-export { getRequiredEnvParam, getOptionalEnvVar, getEnv } from "./environment";
-
-/**
- * The name of the file containing the base database OIDs, as stored in the
- * root of the database location.
- */
-const BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
-
-/**
- * Specifies bundle versions that are known to be broken
- * and will not be used if found in the toolcache.
- */
-const BROKEN_VERSIONS = ["0.0.0-20211207"];
-
-/**
- * The URL for github.com.
- */
-export const GITHUB_DOTCOM_URL = "https://github.com";
-
-/**
- * Default name of the debugging artifact.
- */
-export const DEFAULT_DEBUG_ARTIFACT_NAME = "debug-artifacts";
-
-/**
- * Default name of the database in the debugging artifact.
- */
-export const DEFAULT_DEBUG_DATABASE_NAME = "db";
-
-/**
- * The default fraction of the total RAM above 8 GB that should be reserved for the system.
- */
-const DEFAULT_RESERVED_RAM_SCALING_FACTOR = 0.05;
-
-/**
- * The minimum amount of memory imposed by a cgroup limit that we will consider. Memory limits below
- * this amount are ignored.
- */
-const MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024;
-
-/**
- * Get the extra options for the codeql commands.
- */
-export function getExtraOptionsEnvParam(): object {
-  const varName = "CODEQL_ACTION_EXTRA_OPTIONS";
-  const raw = process.env[varName];
-  if (raw === undefined || raw.length === 0) {
-    return {};
-  }
-  try {
-    return yaml.load(raw) as object;
-  } catch (unwrappedError) {
-    const error = wrapError(unwrappedError);
-    throw new ConfigurationError(
-      `${varName} environment variable is set, but does not contain valid JSON: ${error.message}`,
-    );
-  }
-}
-
-// Creates a random temporary directory, runs the given body, and then deletes the directory.
-// Mostly intended for use within tests.
-export async function withTmpDir(
-  body: (tmpDir: string) => Promise,
-): Promise {
-  const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "codeql-action-"));
-  const result = await body(tmpDir);
-  await fs.promises.rm(tmpDir, { force: true, recursive: true });
-  return result;
-}
-
-/**
- * Gets an OS-specific amount of memory (in MB) to reserve for OS processes
- * when the user doesn't explicitly specify a memory setting.
- * This is a heuristic to avoid OOM errors (exit code 137 / SIGKILL)
- * from committing too much of the available memory to CodeQL.
- * @returns number
- */
-function getSystemReservedMemoryMegaBytes(
-  totalMemoryMegaBytes: number,
-  platform: string,
-): number {
-  // Windows needs more memory for OS processes.
-  const fixedAmount = 1024 * (platform === "win32" ? 1.5 : 1);
-
-  // Reserve an additional percentage of the amount of memory above 8 GB, since the amount used by
-  // the kernel for page tables scales with the size of physical memory.
-  const scaledAmount =
-    getReservedRamScaleFactor() * Math.max(totalMemoryMegaBytes - 8 * 1024, 0);
-  return fixedAmount + scaledAmount;
-}
-
-function getReservedRamScaleFactor(): number {
-  const envVar = Number.parseInt(
-    process.env[EnvVar.SCALING_RESERVED_RAM_PERCENTAGE] || "",
-    10,
-  );
-  if (envVar < 0 || envVar > 100 || Number.isNaN(envVar)) {
-    return DEFAULT_RESERVED_RAM_SCALING_FACTOR;
-  }
-  return envVar / 100;
-}
-
-/**
- * Get the value of the codeql `--ram` flag as configured by the `ram` input.
- * If no value was specified, the total available memory will be used minus a
- * threshold reserved for the OS.
- *
- * @returns {number} the amount of RAM to use, in megabytes
- */
-export function getMemoryFlagValueForPlatform(
-  userInput: string | undefined,
-  totalMemoryBytes: number,
-  platform: string,
-): number {
-  let memoryToUseMegaBytes: number;
-  if (userInput) {
-    memoryToUseMegaBytes = Number(userInput);
-    if (Number.isNaN(memoryToUseMegaBytes) || memoryToUseMegaBytes <= 0) {
-      throw new ConfigurationError(
-        `Invalid RAM setting "${userInput}", specified.`,
-      );
-    }
-  } else {
-    const totalMemoryMegaBytes = totalMemoryBytes / (1024 * 1024);
-    const reservedMemoryMegaBytes = getSystemReservedMemoryMegaBytes(
-      totalMemoryMegaBytes,
-      platform,
-    );
-    memoryToUseMegaBytes = totalMemoryMegaBytes - reservedMemoryMegaBytes;
-  }
-  return Math.floor(memoryToUseMegaBytes);
-}
-
-/**
- * Get the total amount of memory available to the Action, taking into account constraints imposed
- * by cgroups on Linux.
- */
-function getTotalMemoryBytes(logger: Logger): number {
-  const limits = [os.totalmem()];
-  if (os.platform() === "linux") {
-    limits.push(
-      ...[
-        "/sys/fs/cgroup/memory/memory.limit_in_bytes",
-        "/sys/fs/cgroup/memory.max",
-      ]
-        .map((file) => getCgroupMemoryLimitBytes(file, logger))
-        .filter((limit) => limit !== undefined)
-        .map((limit) => limit),
-    );
-  }
-  const limit = Math.min(...limits);
-  logger.debug(
-    `While resolving RAM, determined that the total memory available to the Action is ${
-      limit / (1024 * 1024)
-    } MiB.`,
-  );
-  return limit;
-}
-
-/**
- * Gets the number of bytes of available memory specified by the cgroup limit file at the given path.
- *
- * May be greater than the total memory reported by the operating system if there is no cgroup limit.
- */
-function getCgroupMemoryLimitBytes(
-  limitFile: string,
-  logger: Logger,
-): number | undefined {
-  if (!fs.existsSync(limitFile)) {
-    logger.debug(
-      `While resolving RAM, did not find a cgroup memory limit at ${limitFile}.`,
-    );
-    return undefined;
-  }
-
-  const limit = Number(fs.readFileSync(limitFile, "utf8"));
-
-  if (!Number.isInteger(limit)) {
-    logger.debug(
-      `While resolving RAM, ignored the file ${limitFile} that may contain a cgroup memory limit ` +
-        "as this file did not contain an integer.",
-    );
-    return undefined;
-  }
-
-  const displayLimit = `${Math.floor(limit / (1024 * 1024))} MiB`;
-  if (limit > os.totalmem()) {
-    logger.debug(
-      `While resolving RAM, ignored the file ${limitFile} that may contain a cgroup memory limit as ` +
-        `its contents ${displayLimit} were greater than the total amount of system memory.`,
-    );
-    return undefined;
-  }
-
-  if (limit < MINIMUM_CGROUP_MEMORY_LIMIT_BYTES) {
-    logger.info(
-      `While resolving RAM, ignored a cgroup limit of ${displayLimit} in ${limitFile} as it was below ${
-        MINIMUM_CGROUP_MEMORY_LIMIT_BYTES / (1024 * 1024)
-      } MiB.`,
-    );
-    return undefined;
-  }
-
-  logger.info(
-    `While resolving RAM, found a cgroup limit of ${displayLimit} in ${limitFile}.`,
-  );
-  return limit;
-}
-
-/**
- * Get the maximum amount of memory CodeQL is allowed to use. If no limit has been
- * configured by the user, then the total available memory will be used minus a
- * threshold reserved for the OS.
- *
- * @returns {number} the amount of RAM CodeQL is allowed to use, in megabytes
- */
-export function getCodeQLMemoryLimit(
-  userInput: string | undefined,
-  logger: Logger,
-): number {
-  return getMemoryFlagValueForPlatform(
-    userInput,
-    getTotalMemoryBytes(logger),
-    process.platform,
-  );
-}
-
-/**
- * Get the codeql `--ram` flag as configured by the `ram` input. If no value was
- * specified, the total available memory will be used minus a threshold
- * reserved for the OS.
- *
- * @returns string
- */
-export function getMemoryFlag(
-  userInput: string | undefined,
-  logger: Logger,
-): string {
-  const megabytes = getCodeQLMemoryLimit(userInput, logger);
-  return `--ram=${megabytes}`;
-}
-
-/**
- * Get the value of the codeql `--threads` flag specified for the `threads`
- * input. If no value was specified, all available threads will be used.
- *
- * The value will be capped to the number of available CPUs.
- *
- * @returns {number}
- */
-export function getThreadsFlagValue(
-  userInput: string | undefined,
-  logger: Logger,
-): number {
-  let numThreads: number;
-  const maxThreadsCandidates = [os.cpus().length];
-  if (os.platform() === "linux") {
-    maxThreadsCandidates.push(
-      ...["/sys/fs/cgroup/cpuset.cpus.effective", "/sys/fs/cgroup/cpuset.cpus"]
-        .map((file) => getCgroupCpuCountFromCpus(file, logger))
-        .filter((count) => count !== undefined && count > 0)
-        .map((count) => count as number),
-    );
-    maxThreadsCandidates.push(
-      ...["/sys/fs/cgroup/cpu.max"]
-        .map((file) => getCgroupCpuCountFromCpuMax(file, logger))
-        .filter((count) => count !== undefined && count > 0)
-        .map((count) => count as number),
-    );
-  }
-  const maxThreads = Math.min(...maxThreadsCandidates);
-  if (userInput) {
-    numThreads = Number(userInput);
-    if (Number.isNaN(numThreads)) {
-      throw new ConfigurationError(
-        `Invalid threads setting "${userInput}", specified.`,
-      );
-    }
-    if (numThreads > maxThreads) {
-      logger.info(
-        `Clamping desired number of threads (${numThreads}) to max available (${maxThreads}).`,
-      );
-      numThreads = maxThreads;
-    }
-    const minThreads = -maxThreads;
-    if (numThreads < minThreads) {
-      logger.info(
-        `Clamping desired number of free threads (${numThreads}) to max available (${minThreads}).`,
-      );
-      numThreads = minThreads;
-    }
-  } else {
-    // Default to using all threads
-    numThreads = maxThreads;
-  }
-  return numThreads;
-}
-
-/**
- * Gets the number of available cores specified by the cgroup cpu.max file at the given path.
- * Format of file: two values, the limit and the duration (period). If the limit is "max" then
- * we return undefined and do not use this file to determine CPU limits.
- */
-function getCgroupCpuCountFromCpuMax(
-  cpuMaxFile: string,
-  logger: Logger,
-): number | undefined {
-  if (!fs.existsSync(cpuMaxFile)) {
-    logger.debug(
-      `While resolving threads, did not find a cgroup CPU file at ${cpuMaxFile}.`,
-    );
-    return undefined;
-  }
-
-  const cpuMaxString = fs.readFileSync(cpuMaxFile, "utf-8");
-  const cpuMaxStringSplit = cpuMaxString.split(" ");
-  if (cpuMaxStringSplit.length !== 2) {
-    logger.debug(
-      `While resolving threads, did not use cgroup CPU file at ${cpuMaxFile} because it contained ${cpuMaxStringSplit.length} value(s) rather than the two expected.`,
-    );
-    return undefined;
-  }
-  const cpuLimit = cpuMaxStringSplit[0];
-  if (cpuLimit === "max") {
-    return undefined;
-  }
-  const duration = cpuMaxStringSplit[1];
-  const cpuCount = Math.floor(parseInt(cpuLimit) / parseInt(duration));
-
-  logger.info(
-    `While resolving threads, found a cgroup CPU file with ${cpuCount} CPUs in ${cpuMaxFile}.`,
-  );
-
-  return cpuCount;
-}
-
-/**
- * Gets the number of available cores listed in the cgroup cpuset.cpus file at the given path.
- */
-export function getCgroupCpuCountFromCpus(
-  cpusFile: string,
-  logger: Logger,
-): number | undefined {
-  if (!fs.existsSync(cpusFile)) {
-    logger.debug(
-      `While resolving threads, did not find a cgroup CPUs file at ${cpusFile}.`,
-    );
-    return undefined;
-  }
-
-  let cpuCount = 0;
-  // Comma-separated numbers and ranges, for eg. 0-1,3
-  const cpusString = fs.readFileSync(cpusFile, "utf-8").trim();
-  if (cpusString.length === 0) {
-    return undefined;
-  }
-  for (const token of cpusString.split(",")) {
-    if (!token.includes("-")) {
-      // Not a range
-      ++cpuCount;
-    } else {
-      const cpuStartIndex = parseInt(token.split("-")[0]);
-      const cpuEndIndex = parseInt(token.split("-")[1]);
-      cpuCount += cpuEndIndex - cpuStartIndex + 1;
-    }
-  }
-
-  logger.info(
-    `While resolving threads, found a cgroup CPUs file with ${cpuCount} CPUs in ${cpusFile}.`,
-  );
-
-  return cpuCount;
-}
-
-/**
- * Get the codeql `--threads` flag specified for the `threads` input.
- * If no value was specified, all available threads will be used.
- *
- * The value will be capped to the number of available CPUs.
- *
- * @returns string
- */
-export function getThreadsFlag(
-  userInput: string | undefined,
-  logger: Logger,
-): string {
-  return `--threads=${getThreadsFlagValue(userInput, logger)}`;
-}
-
-/**
- * Get the path where the CodeQL database for the given language lives.
- */
-export function getCodeQLDatabasePath(config: Config, language: Language) {
-  return path.resolve(config.dbLocation, language);
-}
-
-/**
- * Get the path where the generated query suite for the given language lives.
- */
-export function getGeneratedSuitePath(config: Config, language: Language) {
-  return path.resolve(
-    config.dbLocation,
-    language,
-    "temp",
-    "config-queries.qls",
-  );
-}
-
-/**
- * Parses user input of a github.com or GHES URL to a canonical form.
- * Removes any API prefix or suffix if one is present.
- */
-export function parseGitHubUrl(inputUrl: string): string {
-  const originalUrl = inputUrl;
-  if (inputUrl.indexOf("://") === -1) {
-    inputUrl = `https://${inputUrl}`;
-  }
-  if (!inputUrl.startsWith("http://") && !inputUrl.startsWith("https://")) {
-    throw new ConfigurationError(`"${originalUrl}" is not a http or https URL`);
-  }
-
-  let url: URL;
-  try {
-    url = new URL(inputUrl);
-  } catch {
-    throw new ConfigurationError(`"${originalUrl}" is not a valid URL`);
-  }
-
-  // If we detect this is trying to be to github.com
-  // then return with a fixed canonical URL.
-  if (url.hostname === "github.com" || url.hostname === "api.github.com") {
-    return GITHUB_DOTCOM_URL;
-  }
-
-  // Remove the API prefix if it's present
-  if (url.pathname.indexOf("/api/v3") !== -1) {
-    url.pathname = url.pathname.substring(0, url.pathname.indexOf("/api/v3"));
-  }
-  // Also consider subdomain isolation on GHES
-  if (url.hostname.startsWith("api.")) {
-    url.hostname = url.hostname.substring(4);
-  }
-
-  // Normalise path to having a trailing slash for consistency
-  if (!url.pathname.endsWith("/")) {
-    url.pathname = `${url.pathname}/`;
-  }
-
-  return url.toString();
-}
-
-const CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR =
-  "CODEQL_ACTION_WARNED_ABOUT_VERSION";
-
-let hasBeenWarnedAboutVersion = false;
-
-export enum GitHubVariant {
-  /** [GitHub.com](https://github.com) */
-  DOTCOM = "GitHub.com",
-  /** [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@latest/admin/overview/about-github-enterprise-server) */
-  GHES = "GitHub Enterprise Server",
-  /** [GitHub Enterprise Cloud with data residency](https://docs.github.com/en/enterprise-cloud@latest/admin/data-residency/about-github-enterprise-cloud-with-data-residency) */
-  GHEC_DR = "GitHub Enterprise Cloud with data residency",
-}
-
-export type GitHubVersion =
-  | { type: GitHubVariant.DOTCOM }
-  | { type: GitHubVariant.GHEC_DR }
-  | { type: GitHubVariant.GHES; version: string };
-
-export function checkGitHubVersionInRange(
-  version: GitHubVersion,
-  logger: Logger,
-) {
-  if (hasBeenWarnedAboutVersion || version.type !== GitHubVariant.GHES) {
-    return;
-  }
-
-  const disallowedAPIVersionReason = apiVersionInRange(
-    version.version,
-    apiCompatibility.minimumVersion,
-    apiCompatibility.maximumVersion,
-  );
-
-  if (
-    disallowedAPIVersionReason === DisallowedAPIVersionReason.ACTION_TOO_OLD
-  ) {
-    logger.warning(
-      `The CodeQL Action version you are using is too old to be compatible with GitHub Enterprise ${version.version}. If you experience issues, please upgrade to a more recent version of the CodeQL Action.`,
-    );
-  }
-  if (
-    disallowedAPIVersionReason === DisallowedAPIVersionReason.ACTION_TOO_NEW
-  ) {
-    logger.warning(
-      `GitHub Enterprise ${version.version} is too old to be compatible with this version of the CodeQL Action. If you experience issues, please upgrade to a more recent version of GitHub Enterprise or use an older version of the CodeQL Action.`,
-    );
-  }
-  hasBeenWarnedAboutVersion = true;
-  core.exportVariable(CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR, true);
-}
-
-export enum DisallowedAPIVersionReason {
-  ACTION_TOO_OLD,
-  ACTION_TOO_NEW,
-}
-
-export function apiVersionInRange(
-  version: string,
-  minimumVersion: string,
-  maximumVersion: string,
-): DisallowedAPIVersionReason | undefined {
-  if (!semver.satisfies(version, `>=${minimumVersion}`)) {
-    return DisallowedAPIVersionReason.ACTION_TOO_NEW;
-  }
-  if (!semver.satisfies(version, `<=${maximumVersion}`)) {
-    return DisallowedAPIVersionReason.ACTION_TOO_OLD;
-  }
-  return undefined;
-}
-
-/**
- * This error is used to indicate a runtime failure of an exhaustivity check enforced at compile time.
- */
-class ExhaustivityCheckingError extends Error {
-  constructor(public expectedExhaustiveValue: never) {
-    super("Internal error: exhaustivity checking failure");
-  }
-}
-
-/**
- * Used to perform compile-time exhaustivity checking on a value.  This function will not be executed at runtime unless
- * the type system has been subverted.
- */
-export function assertNever(value: never): never {
-  throw new ExhaustivityCheckingError(value);
-}
-
-/**
- * Set some initial environment variables that we can set even without
- * knowing what version of CodeQL we're running.
- */
-export function initializeEnvironment(version: string) {
-  core.exportVariable(EnvVar.FEATURE_MULTI_LANGUAGE, "false");
-  core.exportVariable(EnvVar.FEATURE_SANDWICH, "false");
-  core.exportVariable(EnvVar.FEATURE_SARIF_COMBINE, "true");
-  core.exportVariable(EnvVar.FEATURE_WILL_UPLOAD, "true");
-  core.exportVariable(EnvVar.VERSION, version);
-}
-
-export class HTTPError extends Error {
-  public status: number;
-
-  constructor(message: string, status: number) {
-    super(message);
-    this.status = status;
-  }
-}
-
-/**
- * An Error class that indicates an error that occurred due to
- * a misconfiguration of the action or the CodeQL CLI.
- */
-export class ConfigurationError extends Error {}
-
-export function asHTTPError(arg: any): HTTPError | undefined {
-  if (!json.isObject(arg) || !json.isString(arg.message)) {
-    return undefined;
-  }
-  if (Number.isInteger(arg.status)) {
-    return new HTTPError(arg.message, arg.status as number);
-  }
-  // See https://github.com/actions/toolkit/blob/acb230b99a46ed33a3f04a758cd68b47b9a82908/packages/tool-cache/src/tool-cache.ts#L19
-  if (Number.isInteger(arg.httpStatusCode)) {
-    return new HTTPError(arg.message, arg.httpStatusCode as number);
-  }
-  return undefined;
-}
-
-export async function codeQlVersionAtLeast(
-  codeql: CodeQL,
-  requiredVersion: string,
-): Promise {
-  return semver.gte((await codeql.getVersion()).version, requiredVersion);
-}
-
-export function getBaseDatabaseOidsFilePath(config: Config): string {
-  return path.join(config.dbLocation, BASE_DATABASE_OIDS_FILE_NAME);
-}
-
-/**
- * Bundles the database for the given language into a `.zip` file, returning the path to it.
- *
- * If a bundle for `dbName` already exists (e.g. from an earlier call), it is deleted and
- * re-created, so each call produces a fresh bundle reflecting the current database contents and the
- * given `includeDiagnostics` value.
- */
-export async function bundleDb(
-  config: Config,
-  language: Language,
-  codeql: CodeQL,
-  dbName: string,
-  { includeDiagnostics }: { includeDiagnostics: boolean },
-) {
-  const databasePath = getCodeQLDatabasePath(config, language);
-  const databaseBundlePath = path.resolve(config.dbLocation, `${dbName}.zip`);
-  // For a tiny bit of added safety, delete the file if it exists.
-  // The file is probably from an earlier call to this function, either
-  // as part of this action step or a previous one, but it could also be
-  // from somewhere else or someone trying to make the action upload a
-  // non-database file.
-  if (fs.existsSync(databaseBundlePath)) {
-    await fs.promises.rm(databaseBundlePath, { force: true });
-  }
-  // When overlay is enabled, the base database OIDs file is included at the
-  // root of the database cluster. However when we bundle a database, we only
-  // include the per-language database. So, to ensure the base database OIDs
-  // file is included in the database bundle, we copy it from the cluster into
-  // the individual database location before bundling.
-  const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config);
-  const additionalFiles: string[] = [];
-  if (fs.existsSync(baseDatabaseOidsFilePath)) {
-    await fsPromises.copyFile(
-      baseDatabaseOidsFilePath,
-      path.join(databasePath, BASE_DATABASE_OIDS_FILE_NAME),
-    );
-    additionalFiles.push(BASE_DATABASE_OIDS_FILE_NAME);
-  }
-  // Create the bundle, including the base database OIDs file if it exists
-  await codeql.databaseBundle(
-    databasePath,
-    databaseBundlePath,
-    dbName,
-    includeDiagnostics,
-    additionalFiles,
-  );
-  return databaseBundlePath;
-}
-
-/**
- * @param milliseconds time to delay
- * @param opts options
- * @param opts.allowProcessExit if true, the timer will not prevent the process from exiting
- */
-export async function delay(
-  milliseconds: number,
-  opts?: { allowProcessExit: boolean },
-) {
-  const { allowProcessExit } = opts || {};
-  return new Promise((resolve) => {
-    const timer = setTimeout(resolve, milliseconds);
-    if (allowProcessExit) {
-      // Immediately `unref` the timer such that it only prevents the process from exiting if the
-      // surrounding promise is being awaited.
-      timer.unref();
-    }
-  });
-}
-
-export function isGoodVersion(versionSpec: string) {
-  return !BROKEN_VERSIONS.includes(versionSpec);
-}
-
-/**
- * Returns whether we are in test mode. This is used by CodeQL Action PR checks.
- *
- * In test mode, we skip several uploads (SARIF results, status reports, DBs, ...).
- */
-export function isInTestMode(): boolean {
-  return process.env[EnvVar.TEST_MODE] === "true";
-}
-
-/**
- * Returns whether we specifically want to skip uploading SARIF files.
- */
-export function shouldSkipSarifUpload(): boolean {
-  return isInTestMode() || process.env[EnvVar.SKIP_SARIF_UPLOAD] === "true";
-}
-
-/**
- * Get the testing environment.
- *
- * This is set if the CodeQL Action is running in a non-production environment.
- */
-export function getTestingEnvironment(): string | undefined {
-  const testingEnvironment = process.env[EnvVar.TESTING_ENVIRONMENT] || "";
-  if (testingEnvironment === "") {
-    return undefined;
-  }
-  return testingEnvironment;
-}
-
-/**
- * Returns whether the path in the argument represents an existing directory.
- */
-export function doesDirectoryExist(dirPath: string): boolean {
-  try {
-    const stats = fs.lstatSync(dirPath);
-    return stats.isDirectory();
-  } catch {
-    return false;
-  }
-}
-
-/**
- * Returns a recursive list of files in a given directory.
- */
-export function listFolder(dir: string): string[] {
-  if (!doesDirectoryExist(dir)) {
-    return [];
-  }
-  const entries = fs.readdirSync(dir, { withFileTypes: true });
-  let files: string[] = [];
-  for (const entry of entries) {
-    if (entry.isFile()) {
-      files.push(path.resolve(dir, entry.name));
-    } else if (entry.isDirectory()) {
-      files = files.concat(listFolder(path.resolve(dir, entry.name)));
-    }
-  }
-  return files;
-}
-
-/**
- * Get the size a folder in bytes. This will log any filesystem errors
- * as a warning and then return undefined.
- *
- * @param cacheDir A directory to get the size of.
- * @param logger A logger to log any errors to.
- * @param quiet A value indicating whether to suppress warnings for errors (default: false).
- *              Ignored if the log level is `debug`.
- * @returns The size in bytes of the folder, or undefined if errors occurred.
- */
-export async function tryGetFolderBytes(
-  cacheDir: string,
-  logger: Logger,
-  quiet: boolean = false,
-): Promise {
-  try {
-    // tolerate some errors since we're only estimating the size
-    return await getFolderSize.loose(cacheDir);
-  } catch (e) {
-    if (!quiet || logger.isDebug()) {
-      logger.warning(
-        `Encountered an error while getting size of '${cacheDir}': ${e}`,
-      );
-    }
-    return undefined;
-  }
-}
-
-let hadTimeout = false;
-
-/**
- * Run a promise for a given amount of time, and if it doesn't resolve within
- * that time, call the provided callback and then return undefined. Due to the
- * limitation outlined below, using this helper function is not recommended
- * unless there is no other option for adding a timeout (e.g. the code that
- * would need the timeout added is an external library).
- *
- * Important: This does NOT cancel the original promise, so that promise will
- * continue in the background even after the timeout has expired. If the
- * original promise hangs, then this will prevent the process terminating.
- * If a timeout has occurred then the global hadTimeout variable will get set
- * to true, and the caller is responsible for forcing the process to exit
- * if this is the case by calling the `checkForTimeout` function at the end
- * of execution.
- *
- * @param timeoutMs The timeout in milliseconds.
- * @param promise The promise to run.
- * @param onTimeout A callback to call if the promise times out.
- * @returns The result of the promise, or undefined if the promise times out.
- */
-export async function waitForResultWithTimeLimit(
-  timeoutMs: number,
-  promise: Promise,
-  onTimeout: () => void,
-): Promise {
-  let finished = false;
-  const mainTask = async () => {
-    const result = await promise;
-    finished = true;
-    return result;
-  };
-  const timeoutTask = async () => {
-    await delay(timeoutMs, { allowProcessExit: true });
-    if (!finished) {
-      // Workaround: While the promise racing below will allow the main code
-      // to continue, the process won't normally exit until the asynchronous
-      // task in the background has finished. We set this variable to force
-      // an exit at the end of our code when `checkForTimeout` is called.
-      hadTimeout = true;
-      onTimeout();
-    }
-    return undefined;
-  };
-  return await Promise.race([mainTask(), timeoutTask()]);
-}
-
-/**
- * Check if the global hadTimeout variable has been set, and if so then
- * exit the process to ensure any background tasks that are still running
- * are killed. This should be called at the end of execution if the
- * `waitForResultWithTimeLimit` function has been used.
- */
-export async function checkForTimeout() {
-  if (hadTimeout === true) {
-    core.info(
-      "A timeout occurred, force exiting the process after 30 seconds to prevent hanging.",
-    );
-    await delay(30_000, { allowProcessExit: true });
-    process.exit();
-  }
-}
-
-/**
- * This function implements a heuristic to determine whether the
- * runner we are on is hosted by GitHub. It does this by checking
- * the name of the runner against the list of known GitHub-hosted
- * runner names. It also checks for the presence of a toolcache
- * directory with the name hostedtoolcache which is present on
- * GitHub-hosted runners.
- *
- * @returns true iff the runner is hosted by GitHub
- */
-export function isHostedRunner() {
-  return (
-    // Name of the runner on hosted Windows runners
-    process.env["RUNNER_NAME"]?.includes("Hosted Agent") ||
-    // Name of the runner on hosted POSIX runners
-    process.env["RUNNER_NAME"]?.includes("GitHub Actions") ||
-    // Segment of the path to the tool cache on all hosted runners
-    process.env["RUNNER_TOOL_CACHE"]?.includes("hostedtoolcache")
-  );
-}
-
-export function parseMatrixInput(
-  matrixInput: string | undefined,
-): { [key: string]: string } | undefined {
-  if (matrixInput === undefined || matrixInput === "null") {
-    return undefined;
-  }
-  return JSON.parse(matrixInput) as { [key: string]: string };
-}
-
-export function wrapError(error: unknown): Error {
-  return error instanceof Error ? error : new Error(String(error));
-}
-
-/**
- * Returns an appropriate message for the error.
- *
- * If the error is an `Error` instance, this returns the error message without
- * an `Error: ` prefix.
- */
-export function getErrorMessage(error: unknown): string {
-  return error instanceof Error ? error.message : String(error);
-}
-
-export function prettyPrintPack(pack: Pack) {
-  return `${pack.name}${pack.version ? `@${pack.version}` : ""}${
-    pack.path ? `:${pack.path}` : ""
-  }`;
-}
-
-export interface DiskUsage {
-  numAvailableBytes: number;
-  numTotalBytes: number;
-}
-
-export async function checkDiskUsage(
-  logger: Logger,
-): Promise {
-  try {
-    const diskUsage = await fsPromises.statfs(
-      getRequiredEnvParam("GITHUB_WORKSPACE"),
-    );
-
-    const blockSizeInBytes = diskUsage.bsize;
-    const numBlocksPerMb = (1024 * 1024) / blockSizeInBytes;
-    const numBlocksPerGb = (1024 * 1024 * 1024) / blockSizeInBytes;
-    if (diskUsage.bavail < 2 * numBlocksPerGb) {
-      const message =
-        "The Actions runner is running low on disk space " +
-        `(${(diskUsage.bavail / numBlocksPerMb).toPrecision(4)} MB available).`;
-      if (process.env[EnvVar.HAS_WARNED_ABOUT_DISK_SPACE] !== "true") {
-        logger.warning(message);
-      } else {
-        logger.debug(message);
-      }
-      core.exportVariable(EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true");
-    }
-    return {
-      numAvailableBytes: diskUsage.bavail * blockSizeInBytes,
-      numTotalBytes: diskUsage.blocks * blockSizeInBytes,
-    };
-  } catch (error) {
-    logger.warning(
-      `Failed to check available disk space: ${getErrorMessage(error)}`,
-    );
-    return undefined;
-  }
-}
-
-/**
- * Prompt the customer to upgrade to CodeQL Action v4, if appropriate.
- *
- * Check whether a customer is running v3. If they are, and we can determine that the GitHub
- * instance supports v4, then log an error prompting the customer to upgrade to v4.
- */
-export function checkActionVersion(
-  version: string,
-  githubVersion: GitHubVersion,
-) {
-  if (
-    !semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4
-    !process.env[EnvVar.LOG_VERSION_DEPRECATION] // do not log error if we have already
-  ) {
-    // Only error for versions of GHES that are compatible with CodeQL Action version 4.
-    //
-    // GHES 3.20 is the first version to ship with the v4 tag and this warning message code.
-    // Therefore, users who are seeing this warning message code are running on GHES 3.20 or newer,
-    // and should update to CodeQL Action v4.
-    if (
-      githubVersion.type === GitHubVariant.DOTCOM ||
-      githubVersion.type === GitHubVariant.GHEC_DR ||
-      (githubVersion.type === GitHubVariant.GHES &&
-        semver.satisfies(
-          semver.coerce(githubVersion.version) ?? "0.0.0",
-          ">=3.20",
-        ))
-    ) {
-      core.warning(
-        "CodeQL Action v3 will be deprecated in December 2026. " +
-          "Please update all occurrences of the CodeQL Action in your workflow files to v4. " +
-          "For more information, see " +
-          "https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/",
-      );
-      // set LOG_VERSION_DEPRECATION env var to prevent the warning from being logged multiple times
-      core.exportVariable(EnvVar.LOG_VERSION_DEPRECATION, "true");
-    }
-  }
-}
-
-/**
- * This will check whether the given GitHub version satisfies the given range,
- * taking into account that a range like >=3.18 will also match the GHES 3.18
- * pre-release/RC versions.
- *
- * When the given `githubVersion` is not a GHES version, or if the version
- * is invalid, this will return `defaultIfInvalid`.
- */
-export function satisfiesGHESVersion(
-  ghesVersion: string,
-  range: string,
-  defaultIfInvalid: boolean,
-): boolean {
-  const semverVersion = semver.coerce(ghesVersion);
-  if (semverVersion === null) {
-    return defaultIfInvalid;
-  }
-
-  // We always drop the pre-release part of the version, since anything that
-  // applies to GHES 3.18.0 should also apply to GHES 3.18.0.pre1.
-  semverVersion.prerelease = [];
-
-  return semver.satisfies(semverVersion, range);
-}
-
-/**
- * Supported build modes.
- *
- * These specify whether the CodeQL database should be created by tracing a build, and if so, how
- * this build will be invoked.
- */
-export enum BuildMode {
-  /** The database will be created without building the source root. */
-  None = "none",
-  /** The database will be created by attempting to automatically build the source root. */
-  Autobuild = "autobuild",
-  /** The database will be created by building the source root using manually specified build steps. */
-  Manual = "manual",
-}
-
-export function cloneObject(obj: T): T {
-  return JSON.parse(JSON.stringify(obj)) as T;
-}
-
-export async function cleanUpPath(file: string, name: string, logger: Logger) {
-  logger.debug(`Cleaning up ${name}.`);
-  try {
-    await fs.promises.rm(file, {
-      force: true,
-      recursive: true,
-    });
-  } catch (e) {
-    logger.warning(`Failed to clean up ${name}: ${e}.`);
-  }
-}
-
-export async function isBinaryAccessible(
-  binary: string,
-  logger: Logger,
-): Promise {
-  try {
-    await io.which(binary, true);
-    logger.debug(`Found ${binary}.`);
-    return true;
-  } catch (e) {
-    logger.debug(`Could not find ${binary}: ${e}`);
-    return false;
-  }
-}
-
-export async function asyncFilter(
-  array: T[],
-  predicate: (value: T) => Promise,
-): Promise {
-  const results = await Promise.all(array.map(predicate));
-  return array.filter((_, index) => results[index]);
-}
-
-export async function asyncSome(
-  array: T[],
-  predicate: (value: T) => Promise,
-): Promise {
-  const results = await Promise.all(array.map(predicate));
-  return results.some((result) => result);
-}
-
-/**
- * Checks that `value` is neither `undefined` nor `null`.
- * @param value The value to test.
- * @returns Narrows the type of `value` to exclude `undefined` and `null`.
- */
-export function isDefined(value: T | null | undefined): value is T {
-  return value !== undefined && value !== null;
-}
-
-/** Like `Object.entries`, but typed so that the key elements of the result have the
- * same type as the keys of the input object. Note that this may not be sound if the input
- * object has been cast to `T` from a subtype of `T` and contains additional keys that
- * are not represented by `keyof T`.
- */
-export function unsafeEntriesInvariant>(
-  object: T,
-): Array<[keyof T, Exclude]> {
-  return Object.entries(object).filter(
-    ([_, val]) => val !== undefined,
-  ) as Array<[keyof T, Exclude]>;
-}
-
-export enum CleanupLevel {
-  Clear = "clear",
-  Overlay = "overlay",
-}
-
-/**
- * Like `join`, but limits the number of elements that are joined together to `limit`
- * and appends `...` if the limit is exceeded.
- *
- * @param array The array to join.
- * @param separator The separator to join the array with.
- * @param limit The maximum number of elements from `array` to join.
- * @returns The result of joining at most `limit`-many elements from `array`.
- */
-export function joinAtMost(
-  array: string[],
-  separator: string,
-  limit: number,
-): string {
-  if (limit > 0 && array.length > limit) {
-    array = array.slice(0, limit);
-    array.push("...");
-  }
-
-  return array.join(separator);
-}
-
-/** An interface representing something that is either a success or a failure. */
-interface ResultLike {
-  /** The value of the result, which can be either a success value or a failure value. */
-  value: T | E;
-  /** Whether this result represents a success. */
-  isSuccess(): this is Success;
-  /** Whether this result represents a failure. */
-  isFailure(): this is Failure;
-  /** Get the value if this is a success, or return the default value if this is a failure. */
-  orElse(defaultValue: U): T | U;
-}
-
-/** A simple result type representing either a success or a failure. */
-export type Result = Success | Failure;
-
-/** A result representing a success. */
-export class Success implements ResultLike {
-  constructor(public readonly value: T) {}
-
-  isSuccess(): this is Success {
-    return true;
-  }
-
-  isFailure(): this is Failure {
-    return false;
-  }
-
-  orElse(_defaultValue: U): T {
-    return this.value;
-  }
-}
-
-/** A result representing a failure. */
-export class Failure implements ResultLike {
-  constructor(public readonly value: E) {}
-
-  isSuccess(): this is Success {
-    return false;
-  }
-
-  isFailure(): this is Failure {
-    return true;
-  }
-
-  orElse(defaultValue: U): U {
-    return defaultValue;
-  }
-}
diff --git a/src/workflow.test.ts b/src/workflow.test.ts
deleted file mode 100644
index c7f168a9dc..0000000000
--- a/src/workflow.test.ts
+++ /dev/null
@@ -1,1004 +0,0 @@
-import test, { ExecutionContext } from "ava";
-import * as yaml from "js-yaml";
-import * as sinon from "sinon";
-
-import * as actionsUtil from "./actions-util";
-import { createStubCodeQL, getCodeQLForTesting } from "./codeql";
-import { EnvVar } from "./environment";
-import {
-  checkExpectedLogMessages,
-  getRecordingLogger,
-  LoggedMessage,
-  setupTests,
-} from "./testing-utils";
-import {
-  checkWorkflow,
-  CodedError,
-  formatWorkflowCause,
-  formatWorkflowErrors,
-  getCategoryInputOrThrow,
-  getWorkflowErrors,
-  Workflow,
-  WorkflowErrors,
-} from "./workflow";
-import * as workflow from "./workflow";
-
-function errorCodes(
-  actual: CodedError[],
-  expected: CodedError[],
-): [string[], string[]] {
-  return [actual.map(({ code }) => code), expected.map(({ code }) => code)];
-}
-
-setupTests(test);
-
-test("getWorkflowErrors() when on is empty", async (t) => {
-  const errors = await getWorkflowErrors(
-    { on: {} },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() when on.push is an array missing pull_request", async (t) => {
-  const errors = await getWorkflowErrors(
-    { on: ["push"] },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() when on.push is an array missing push", async (t) => {
-  const errors = await getWorkflowErrors(
-    { on: ["pull_request"] },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, [WorkflowErrors.MissingPushHook]));
-});
-
-test("getWorkflowErrors() when on.push is valid", async (t) => {
-  const errors = await getWorkflowErrors(
-    {
-      on: ["push", "pull_request"],
-    },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() when on.push is a valid superset", async (t) => {
-  const errors = await getWorkflowErrors(
-    {
-      on: ["push", "pull_request", "schedule"],
-    },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() when on.push is a correct object", async (t) => {
-  const errors = await getWorkflowErrors(
-    {
-      on: {
-        push: { branches: ["main"] },
-        pull_request: { branches: ["main"] },
-      },
-    },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() when on.pull_requests is a string and correct", async (t) => {
-  const errors = await getWorkflowErrors(
-    {
-      on: { push: { branches: "*" }, pull_request: { branches: "*" } },
-    },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() when on.push is correct with empty objects", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-  on:
-    push:
-    pull_request:
-  `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() when on.push is not mismatched", async (t) => {
-  const errors = await getWorkflowErrors(
-    {
-      on: {
-        push: { branches: ["main", "feature"] },
-        pull_request: { branches: ["main"] },
-      },
-    },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() for a range of malformed workflows", async (t) => {
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: {
-            push: 1,
-            pull_request: 1,
-          },
-        } as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-        } as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-          jobs: 1,
-        } as unknown as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-          jobs: [1],
-        } as unknown as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-          jobs: { 1: 1 },
-        } as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-          jobs: { test: 1 },
-        } as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-          jobs: { test: [1] },
-        } as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-          jobs: { test: { steps: 1 } },
-        } as unknown as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-          jobs: { test: { steps: [{ notrun: "git checkout HEAD^2" }] } },
-        } as unknown as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: 1,
-          jobs: { test: [undefined] },
-        } as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(1 as Workflow, await getCodeQLForTesting()),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        {
-          on: {
-            push: {
-              branches: 1,
-            },
-            pull_request: {
-              branches: 1,
-            },
-          },
-        } as unknown as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-});
-
-test("getWorkflowErrors() when on.pull_request for wildcard branches", async (t) => {
-  const errors = await getWorkflowErrors(
-    {
-      on: {
-        push: { branches: ["feature/*"] },
-        pull_request: { branches: "feature/moose" },
-      },
-    },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test.serial("getWorkflowErrors() when HEAD^2 is checked out", async (t) => {
-  process.env.GITHUB_JOB = "test";
-
-  const errors = await getWorkflowErrors(
-    {
-      on: ["push", "pull_request"],
-      jobs: { test: { steps: [{ run: "git checkout HEAD^2" }] } },
-    },
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, [WorkflowErrors.CheckoutWrongHead]));
-});
-
-test.serial(
-  "getWorkflowErrors() produces an error for workflow with language name and its alias",
-  async (t) => {
-    await testLanguageAliases(
-      t,
-      ["java", "kotlin"],
-      { java: ["java-kotlin", "kotlin"] },
-      [
-        "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " +
-          "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " +
-          "matrix parameter to keep only one of the following: 'java', 'kotlin'.",
-      ],
-    );
-  },
-);
-
-test.serial(
-  "getWorkflowErrors() produces an error for workflow with two aliases same language",
-  async (t) => {
-    await testLanguageAliases(
-      t,
-      ["java-kotlin", "kotlin"],
-      { java: ["java-kotlin", "kotlin"] },
-      [
-        "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " +
-          "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " +
-          "matrix parameter to keep only one of the following: 'java-kotlin', 'kotlin'.",
-      ],
-    );
-  },
-);
-
-test.serial(
-  "getWorkflowErrors() does not produce an error for workflow with two distinct languages",
-  async (t) => {
-    await testLanguageAliases(
-      t,
-      ["java", "typescript"],
-      {
-        java: ["java-kotlin", "kotlin"],
-        javascript: ["javascript-typescript", "typescript"],
-      },
-      [],
-    );
-  },
-);
-
-test.serial(
-  "getWorkflowErrors() does not produce an error if codeql doesn't support language aliases",
-  async (t) => {
-    await testLanguageAliases(t, ["java-kotlin", "kotlin"], undefined, []);
-  },
-);
-
-async function testLanguageAliases(
-  t: ExecutionContext,
-  matrixLanguages: string[],
-  aliases: { [languageName: string]: string[] } | undefined,
-  expectedErrorMessages: string[],
-) {
-  process.env.GITHUB_JOB = "test";
-
-  const codeql = await getCodeQLForTesting();
-  sinon.stub(codeql, "resolveLanguages").resolves({
-    aliases:
-      aliases !== undefined
-        ? // Remap from languageName -> aliases to alias -> languageName
-          Object.assign(
-            {},
-            ...Object.entries(aliases).flatMap(([language, languageAliases]) =>
-              languageAliases.map((alias) => ({
-                [alias]: language,
-              })),
-            ),
-          )
-        : undefined,
-    extractors: {
-      java: [
-        {
-          extractor_root: "",
-        },
-      ],
-    },
-  });
-
-  const errors = await getWorkflowErrors(
-    {
-      on: ["push", "pull_request"],
-      jobs: {
-        test: {
-          strategy: {
-            matrix: {
-              language: matrixLanguages,
-            },
-          },
-          steps: [
-            { uses: "actions/checkout@v4" },
-            { uses: "github/codeql-action/init@v4" },
-            { uses: "github/codeql-action/analyze@v4" },
-          ],
-        },
-      },
-    },
-    codeql,
-  );
-
-  t.is(errors.length, expectedErrorMessages.length);
-  t.deepEqual(
-    errors.map((e) => e.message),
-    expectedErrorMessages,
-  );
-}
-
-test("formatWorkflowErrors() when there is one error", (t) => {
-  const message = formatWorkflowErrors([WorkflowErrors.CheckoutWrongHead]);
-  t.true(message.startsWith("1 issue was detected with this workflow:"));
-});
-
-test("formatWorkflowErrors() when there are multiple errors", (t) => {
-  const message = formatWorkflowErrors([
-    WorkflowErrors.CheckoutWrongHead,
-    WorkflowErrors.MissingPushHook,
-  ]);
-  t.true(message.startsWith("2 issues were detected with this workflow:"));
-});
-
-test("formatWorkflowCause() with no errors", (t) => {
-  const message = formatWorkflowCause([]);
-
-  t.deepEqual(message, undefined);
-});
-
-test("formatWorkflowCause()", (t) => {
-  const message = formatWorkflowCause([
-    WorkflowErrors.CheckoutWrongHead,
-    WorkflowErrors.MissingPushHook,
-  ]);
-
-  t.deepEqual(message, "CheckoutWrongHead,MissingPushHook");
-  t.deepEqual(formatWorkflowCause([]), undefined);
-});
-
-test("getWorkflowErrors() when branches contain dots", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-    on:
-      push:
-        branches: [4.1, master]
-      pull_request:
-        # The branches below must be a subset of the branches above
-        branches: [4.1, master]
-  `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() when on.push has a trailing comma", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-  name: "CodeQL"
-  on:
-    push:
-      branches: [master, ]
-    pull_request:
-      # The branches below must be a subset of the branches above
-      branches: [master]
-  `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test.serial(
-  "getWorkflowErrors() should only report the current job's CheckoutWrongHead",
-  async (t) => {
-    process.env.GITHUB_JOB = "test";
-
-    const errors = await getWorkflowErrors(
-      yaml.load(`
-  name: "CodeQL"
-  on:
-    push:
-      branches: [master]
-    pull_request:
-      # The branches below must be a subset of the branches above
-      branches: [master]
-  jobs:
-    test:
-      steps:
-        - run: "git checkout HEAD^2"
-
-    test2:
-      steps:
-        - run: "git checkout HEAD^2"
-
-    test3:
-      steps: []
-  `) as Workflow,
-      await getCodeQLForTesting(),
-    );
-
-    t.deepEqual(...errorCodes(errors, [WorkflowErrors.CheckoutWrongHead]));
-  },
-);
-
-test.serial(
-  "getWorkflowErrors() should not report a different job's CheckoutWrongHead",
-  async (t) => {
-    process.env.GITHUB_JOB = "test3";
-
-    const errors = await getWorkflowErrors(
-      yaml.load(`
-  name: "CodeQL"
-  on:
-    push:
-      branches: [master]
-    pull_request:
-      # The branches below must be a subset of the branches above
-      branches: [master]
-  jobs:
-    test:
-      steps:
-        - run: "git checkout HEAD^2"
-
-    test2:
-      steps:
-        - run: "git checkout HEAD^2"
-
-    test3:
-      steps: []
-  `) as Workflow,
-      await getCodeQLForTesting(),
-    );
-
-    t.deepEqual(...errorCodes(errors, []));
-  },
-);
-
-test("getWorkflowErrors() when on is missing", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-  name: "CodeQL"
-  `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() with a different on setup", async (t) => {
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        yaml.load(`
-  name: "CodeQL"
-  on: "workflow_dispatch"
-  `) as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        yaml.load(`
-  name: "CodeQL"
-  on: [workflow_dispatch]
-  `) as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        yaml.load(`
-  name: "CodeQL"
-  on:
-    workflow_dispatch: {}
-  `) as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-});
-
-test("getWorkflowErrors() should not report an error if PRs are totally unconfigured", async (t) => {
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        yaml.load(`
-  name: "CodeQL"
-  on:
-    push:
-      branches: [master]
-  `) as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-
-  t.deepEqual(
-    ...errorCodes(
-      await getWorkflowErrors(
-        yaml.load(`
-  name: "CodeQL"
-  on: ["push"]
-  `) as Workflow,
-        await getCodeQLForTesting(),
-      ),
-      [],
-    ),
-  );
-});
-
-test("getWorkflowErrors() should not report a warning if there is a workflow_call trigger", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-    name: "CodeQL"
-    on:
-      workflow_call:
-    `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() should not report a warning if there is a workflow_call trigger as a string", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-    name: "CodeQL"
-    on: workflow_call
-    `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() should not report a warning if there is a workflow_call trigger as an array", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-    name: "CodeQL"
-    on:
-      - workflow_call
-    `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() should report a warning if different versions of the CodeQL Action are used", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-      name: "CodeQL"
-      on:
-        push:
-          branches: [main]
-      jobs:
-        analyze:
-          steps:
-            - uses: github/codeql-action/init@v2
-            - uses: github/codeql-action/analyze@v4
-    `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(
-    ...errorCodes(errors, [WorkflowErrors.InconsistentActionVersion]),
-  );
-});
-
-test("getWorkflowErrors() should not report a warning if the same versions of the CodeQL Action are used", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-      name: "CodeQL"
-      on:
-        push:
-          branches: [main]
-      jobs:
-        analyze:
-          steps:
-            - uses: github/codeql-action/init@v4
-            - uses: github/codeql-action/analyze@v4
-    `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test("getWorkflowErrors() should not report a warning involving versions of other actions", async (t) => {
-  const errors = await getWorkflowErrors(
-    yaml.load(`
-      name: "CodeQL"
-      on:
-        push:
-          branches: [main]
-      jobs:
-        analyze:
-          steps:
-            - uses: actions/checkout@v5
-            - uses: github/codeql-action/init@v4
-    `) as Workflow,
-    await getCodeQLForTesting(),
-  );
-
-  t.deepEqual(...errorCodes(errors, []));
-});
-
-test.serial(
-  "getCategoryInputOrThrow returns category for simple workflow with category",
-  (t) => {
-    process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
-    t.is(
-      getCategoryInputOrThrow(
-        yaml.load(`
-        jobs:
-          analysis:
-            runs-on: ubuntu-latest
-            steps:
-              - uses: actions/checkout@v4
-              - uses: github/codeql-action/init@v4
-              - uses: github/codeql-action/analyze@v4
-                with:
-                  category: some-category
-      `) as Workflow,
-        "analysis",
-        {},
-      ),
-      "some-category",
-    );
-  },
-);
-
-test.serial(
-  "getCategoryInputOrThrow returns undefined for simple workflow without category",
-  (t) => {
-    process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
-    t.is(
-      getCategoryInputOrThrow(
-        yaml.load(`
-        jobs:
-          analysis:
-            runs-on: ubuntu-latest
-            steps:
-              - uses: actions/checkout@v4
-              - uses: github/codeql-action/init@v4
-              - uses: github/codeql-action/analyze@v4
-      `) as Workflow,
-        "analysis",
-        {},
-      ),
-      undefined,
-    );
-  },
-);
-
-test.serial(
-  "getCategoryInputOrThrow returns category for workflow with multiple jobs",
-  (t) => {
-    process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
-    t.is(
-      getCategoryInputOrThrow(
-        yaml.load(`
-        jobs:
-          foo:
-            runs-on: ubuntu-latest
-            steps:
-              - uses: actions/checkout@v4
-              - uses: github/codeql-action/init@v4
-              - runs: ./build foo
-              - uses: github/codeql-action/analyze@v4
-                with:
-                  category: foo-category
-          bar:
-            runs-on: ubuntu-latest
-            steps:
-              - uses: actions/checkout@v4
-              - uses: github/codeql-action/init@v4
-              - runs: ./build bar
-              - uses: github/codeql-action/analyze@v4
-                with:
-                  category: bar-category
-      `) as Workflow,
-        "bar",
-        {},
-      ),
-      "bar-category",
-    );
-  },
-);
-
-test.serial(
-  "getCategoryInputOrThrow finds category for workflow with language matrix",
-  (t) => {
-    process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
-    t.is(
-      getCategoryInputOrThrow(
-        yaml.load(`
-        jobs:
-          analysis:
-            runs-on: ubuntu-latest
-            strategy:
-              matrix:
-                language: [javascript, python]
-            steps:
-              - uses: actions/checkout@v4
-              - uses: github/codeql-action/init@v4
-                with:
-                  language: \${{ matrix.language }}
-              - uses: github/codeql-action/analyze@v4
-                with:
-                  category: "/language:\${{ matrix.language }}"
-      `) as Workflow,
-        "analysis",
-        { language: "javascript" },
-      ),
-      "/language:javascript",
-    );
-  },
-);
-
-test.serial(
-  "getCategoryInputOrThrow throws error for workflow with dynamic category",
-  (t) => {
-    process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
-    t.throws(
-      () =>
-        getCategoryInputOrThrow(
-          yaml.load(`
-          jobs:
-            analysis:
-              steps:
-                - uses: actions/checkout@v4
-                - uses: github/codeql-action/init@v4
-                - uses: github/codeql-action/analyze@v4
-                  with:
-                    category: "\${{ github.workflow }}"
-        `) as Workflow,
-          "analysis",
-          {},
-        ),
-      {
-        message:
-          "Could not get category input to github/codeql-action/analyze since it contained " +
-          "an unrecognized dynamic value.",
-      },
-    );
-  },
-);
-
-test.serial(
-  "getCategoryInputOrThrow throws error for workflow with multiple calls to analyze",
-  (t) => {
-    process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
-    t.throws(
-      () =>
-        getCategoryInputOrThrow(
-          yaml.load(`
-          jobs:
-            analysis:
-              runs-on: ubuntu-latest
-              steps:
-                - uses: actions/checkout@v4
-                - uses: github/codeql-action/init@v4
-                - uses: github/codeql-action/analyze@v4
-                  with:
-                    category: some-category
-                - uses: github/codeql-action/analyze@v4
-                  with:
-                    category: another-category
-        `) as Workflow,
-          "analysis",
-          {},
-        ),
-      {
-        message:
-          "Could not get category input to github/codeql-action/analyze since the analysis job " +
-          "calls github/codeql-action/analyze multiple times.",
-      },
-    );
-  },
-);
-
-test.serial(
-  "checkWorkflow - validates workflow if `SKIP_WORKFLOW_VALIDATION` is not set",
-  async (t) => {
-    const messages: LoggedMessage[] = [];
-    const codeql = createStubCodeQL({});
-
-    sinon.stub(actionsUtil, "isDynamicWorkflow").returns(false);
-    const validateWorkflow = sinon.stub(workflow.internal, "validateWorkflow");
-    validateWorkflow.resolves(undefined);
-
-    await checkWorkflow(getRecordingLogger(messages), codeql);
-
-    t.assert(
-      validateWorkflow.calledOnce,
-      "`checkWorkflow` unexpectedly did not call `validateWorkflow`",
-    );
-    checkExpectedLogMessages(t, messages, [
-      "Detected no issues with the code scanning workflow.",
-    ]);
-  },
-);
-
-test.serial(
-  "checkWorkflow - logs problems with workflow validation",
-  async (t) => {
-    const messages: LoggedMessage[] = [];
-    const codeql = createStubCodeQL({});
-
-    sinon.stub(actionsUtil, "isDynamicWorkflow").returns(false);
-    const validateWorkflow = sinon.stub(workflow.internal, "validateWorkflow");
-    validateWorkflow.resolves("problem");
-
-    await checkWorkflow(getRecordingLogger(messages), codeql);
-
-    t.assert(
-      validateWorkflow.calledOnce,
-      "`checkWorkflow` unexpectedly did not call `validateWorkflow`",
-    );
-    checkExpectedLogMessages(t, messages, [
-      "Unable to validate code scanning workflow: problem",
-    ]);
-  },
-);
-
-test.serial(
-  "checkWorkflow - skips validation if `SKIP_WORKFLOW_VALIDATION` is `true`",
-  async (t) => {
-    process.env[EnvVar.SKIP_WORKFLOW_VALIDATION] = "true";
-
-    const messages: LoggedMessage[] = [];
-    const codeql = createStubCodeQL({});
-
-    sinon.stub(actionsUtil, "isDynamicWorkflow").returns(false);
-    const validateWorkflow = sinon.stub(workflow.internal, "validateWorkflow");
-
-    await checkWorkflow(getRecordingLogger(messages), codeql);
-
-    t.assert(
-      validateWorkflow.notCalled,
-      "`checkWorkflow` called `validateWorkflow` unexpectedly",
-    );
-    t.is(messages.length, 0);
-  },
-);
-
-test.serial(
-  "checkWorkflow - skips validation for `dynamic` workflows",
-  async (t) => {
-    const messages: LoggedMessage[] = [];
-    const codeql = createStubCodeQL({});
-
-    const isDynamicWorkflow = sinon
-      .stub(actionsUtil, "isDynamicWorkflow")
-      .returns(true);
-    const validateWorkflow = sinon.stub(workflow.internal, "validateWorkflow");
-
-    await checkWorkflow(getRecordingLogger(messages), codeql);
-
-    t.assert(isDynamicWorkflow.calledOnce);
-    t.assert(
-      validateWorkflow.notCalled,
-      "`checkWorkflow` called `validateWorkflow` unexpectedly",
-    );
-    t.is(messages.length, 0);
-  },
-);
diff --git a/src/workflow.ts b/src/workflow.ts
deleted file mode 100644
index 151cfd5c5d..0000000000
--- a/src/workflow.ts
+++ /dev/null
@@ -1,499 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-import zlib from "zlib";
-
-import * as core from "@actions/core";
-import * as yaml from "js-yaml";
-
-import { isDynamicWorkflow } from "./actions-util";
-import * as api from "./api-client";
-import { CodeQL } from "./codeql";
-import { EnvVar } from "./environment";
-import { Logger } from "./logging";
-import {
-  getRequiredEnvParam,
-  getTestingEnvironment,
-  isInTestMode,
-} from "./util";
-
-export interface WorkflowJobStep {
-  name?: string;
-  run?: any;
-  uses?: string;
-  with?: { [key: string]: boolean | number | string };
-}
-
-interface WorkflowJob {
-  name?: string;
-  "runs-on"?: string;
-  steps?: WorkflowJobStep[];
-  strategy?: { matrix: { [key: string]: string[] } };
-  uses?: string;
-}
-
-interface WorkflowTrigger {
-  branches?: string[] | string;
-  paths?: string[];
-}
-
-// on: {} then push/pull_request are undefined
-// on:
-//   push:
-//   pull_request:
-// then push/pull_request are null
-interface WorkflowTriggers {
-  push?: WorkflowTrigger | null;
-  pull_request?: WorkflowTrigger | null;
-}
-
-export interface Workflow {
-  name?: string;
-  jobs?: { [key: string]: WorkflowJob };
-  on?: string | string[] | WorkflowTriggers;
-}
-
-export interface CodedError {
-  message: string;
-  code: string;
-}
-
-function toCodedErrors(errors: {
-  [code: string]: string;
-}): Record {
-  return Object.entries(errors).reduce(
-    (acc, [code, message]) => {
-      acc[code] = { message, code };
-      return acc;
-    },
-    {} as Record,
-  );
-}
-
-// code to send back via status report
-// message to add as a warning annotation to the run
-export const WorkflowErrors = toCodedErrors({
-  MissingPushHook: `Please specify an on.push hook to analyze and see code scanning alerts from the default branch on the Security tab.`,
-  CheckoutWrongHead: `git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.`,
-  InconsistentActionVersion: `Not all workflow steps that use \`github/codeql-action\` actions use the same version. Please ensure that all such steps use the same version to avoid compatibility issues.`,
-});
-
-/**
- * Groups the given list of CodeQL languages by their extractor name.
- *
- * Resolves to `undefined` if the CodeQL version does not support language aliasing.
- */
-async function groupLanguagesByExtractor(
-  languages: string[],
-  codeql: CodeQL,
-): Promise<{ [extractorName: string]: string[] } | undefined> {
-  const resolveResult = await codeql.resolveLanguages();
-  if (!resolveResult.aliases) {
-    return undefined;
-  }
-  const aliases = resolveResult.aliases;
-  const languagesByExtractor: {
-    [extractorName: string]: string[];
-  } = {};
-  for (const language of languages) {
-    const extractorName = aliases[language] || language;
-    if (!languagesByExtractor[extractorName]) {
-      languagesByExtractor[extractorName] = [];
-    }
-    languagesByExtractor[extractorName].push(language);
-  }
-  return languagesByExtractor;
-}
-
-export async function getWorkflowErrors(
-  doc: Workflow,
-  codeql: CodeQL,
-): Promise {
-  const errors: CodedError[] = [];
-
-  const jobName = process.env.GITHUB_JOB;
-
-  if (jobName) {
-    const job = doc?.jobs?.[jobName];
-
-    if (job?.strategy?.matrix?.language) {
-      const matrixLanguages = job.strategy.matrix.language;
-      if (Array.isArray(matrixLanguages)) {
-        // Map extractors to entries in the `language` matrix parameter. This will allow us to
-        // detect languages which are analyzed in more than one job.
-        const matrixLanguagesByExtractor = await groupLanguagesByExtractor(
-          matrixLanguages,
-          codeql,
-        );
-        // If the CodeQL version does not support language aliasing, then `matrixLanguagesByExtractor`
-        // will be `undefined`. In this case, we cannot detect duplicate languages in the matrix.
-        if (matrixLanguagesByExtractor !== undefined) {
-          // Check for duplicate languages in the matrix
-          for (const [extractor, languages] of Object.entries(
-            matrixLanguagesByExtractor,
-          )) {
-            if (languages.length > 1) {
-              errors.push({
-                message:
-                  `CodeQL language '${extractor}' is referenced by more than one entry in the ` +
-                  `'language' matrix parameter for job '${jobName}'. This may result in duplicate alerts. ` +
-                  `Please edit the 'language' matrix parameter to keep only one of the following: ${languages
-                    .map((language) => `'${language}'`)
-                    .join(", ")}.`,
-                code: "DuplicateLanguageInMatrix",
-              });
-            }
-          }
-        }
-      }
-    }
-
-    const steps = job?.steps;
-
-    if (Array.isArray(steps)) {
-      for (const step of steps) {
-        // this was advice that we used to give in the README
-        // we actually want to run the analysis on the merge commit
-        // to produce results that are more inline with expectations
-        // (i.e: this is what will happen if you merge this PR)
-        // and avoid some race conditions
-        if (step?.run === "git checkout HEAD^2") {
-          errors.push(WorkflowErrors.CheckoutWrongHead);
-          break;
-        }
-      }
-    }
-  }
-
-  // Check that all `github/codeql-action` steps use the same ref, i.e. the same version.
-  // Mixing different versions of the actions can lead to unpredictable behaviour.
-  const codeqlStepRefs: string[] = [];
-  for (const job of Object.values(doc?.jobs || {})) {
-    if (Array.isArray(job.steps)) {
-      for (const step of job.steps) {
-        if (step.uses?.startsWith("github/codeql-action/")) {
-          const parts = step.uses.split("@");
-          if (parts.length >= 2) {
-            codeqlStepRefs.push(parts[parts.length - 1]);
-          }
-        }
-      }
-    }
-  }
-
-  if (
-    codeqlStepRefs.length > 0 &&
-    !codeqlStepRefs.every((ref) => ref === codeqlStepRefs[0])
-  ) {
-    errors.push(WorkflowErrors.InconsistentActionVersion);
-  }
-
-  // If there is no push trigger, we will not be able to analyze the default branch.
-  // So add a warning to the user to add a push trigger.
-  // If there is a workflow_call trigger, we don't need a push trigger since we assume
-  // that the workflow_call trigger is called from a workflow that has a push trigger.
-  const hasPushTrigger = hasWorkflowTrigger("push", doc);
-  const hasPullRequestTrigger = hasWorkflowTrigger("pull_request", doc);
-  const hasWorkflowCallTrigger = hasWorkflowTrigger("workflow_call", doc);
-
-  if (hasPullRequestTrigger && !hasPushTrigger && !hasWorkflowCallTrigger) {
-    errors.push(WorkflowErrors.MissingPushHook);
-  }
-
-  return errors;
-}
-
-function hasWorkflowTrigger(triggerName: string, doc: Workflow): boolean {
-  if (!doc.on) {
-    return false;
-  }
-
-  if (typeof doc.on === "string") {
-    return doc.on === triggerName;
-  }
-
-  if (Array.isArray(doc.on)) {
-    return doc.on.includes(triggerName);
-  }
-
-  return Object.prototype.hasOwnProperty.call(doc.on, triggerName);
-}
-
-async function validateWorkflow(
-  codeql: CodeQL,
-  logger: Logger,
-): Promise {
-  let workflow: Workflow;
-  try {
-    workflow = await getWorkflow(logger);
-  } catch (e) {
-    return `error: getWorkflow() failed: ${String(e)}`;
-  }
-  let workflowErrors: CodedError[];
-  try {
-    workflowErrors = await getWorkflowErrors(workflow, codeql);
-  } catch (e) {
-    return `error: getWorkflowErrors() failed: ${String(e)}`;
-  }
-
-  if (workflowErrors.length > 0) {
-    let message: string;
-    try {
-      message = formatWorkflowErrors(workflowErrors);
-    } catch (e) {
-      return `error: formatWorkflowErrors() failed: ${String(e)}`;
-    }
-    core.warning(message);
-  }
-
-  return formatWorkflowCause(workflowErrors);
-}
-
-export function formatWorkflowErrors(errors: CodedError[]): string {
-  const issuesWere = errors.length === 1 ? "issue was" : "issues were";
-
-  const errorsList = errors.map((e) => e.message).join(" ");
-
-  return `${errors.length} ${issuesWere} detected with this workflow: ${errorsList}`;
-}
-
-export function formatWorkflowCause(errors: CodedError[]): undefined | string {
-  if (errors.length === 0) {
-    return undefined;
-  }
-  return errors.map((e) => e.code).join(",");
-}
-
-export async function getWorkflow(logger: Logger): Promise {
-  // In default setup, the currently executing workflow is not checked into the repository.
-  // Instead, a gzipped then base64 encoded version of the workflow file is provided via the
-  // `CODE_SCANNING_WORKFLOW_FILE` environment variable.
-  const maybeWorkflow = process.env["CODE_SCANNING_WORKFLOW_FILE"];
-  if (maybeWorkflow) {
-    logger.debug(
-      "Using the workflow specified by the CODE_SCANNING_WORKFLOW_FILE environment variable.",
-    );
-    return yaml.load(
-      zlib.gunzipSync(Buffer.from(maybeWorkflow, "base64")).toString(),
-    ) as Workflow;
-  }
-
-  const workflowPath = await getWorkflowAbsolutePath(logger);
-  return yaml.load(fs.readFileSync(workflowPath, "utf-8")) as Workflow;
-}
-
-/**
- * Get the absolute path of the currently executing workflow.
- */
-async function getWorkflowAbsolutePath(logger: Logger): Promise {
-  const relativePath = await api.getWorkflowRelativePath();
-  const absolutePath = path.join(
-    getRequiredEnvParam("GITHUB_WORKSPACE"),
-    relativePath,
-  );
-
-  if (fs.existsSync(absolutePath)) {
-    logger.debug(
-      `Derived the following absolute path for the currently executing workflow: ${absolutePath}.`,
-    );
-    return absolutePath;
-  }
-
-  throw new Error(
-    `Expected to find a code scanning workflow file at ${absolutePath}, but no such file existed. ` +
-      "This can happen if the currently running workflow checks out a branch that doesn't contain " +
-      "the corresponding workflow file.",
-  );
-}
-
-function getStepsCallingAction(
-  job: WorkflowJob,
-  actionName: string,
-): WorkflowJobStep[] {
-  if (job.uses) {
-    throw new Error(
-      `Could not get steps calling ${actionName} since the job calls a reusable workflow.`,
-    );
-  }
-  const steps = job.steps;
-  if (!Array.isArray(steps)) {
-    throw new Error(
-      `Could not get steps calling ${actionName} since job.steps was not an array.`,
-    );
-  }
-  return steps.filter((step) => step.uses?.includes(actionName));
-}
-
-/**
- * Makes a best effort attempt to retrieve the value of a particular input with which
- * an Action in the workflow would be invoked.
- *
- * Typically you'll want to wrap this function in a try/catch block and handle the error.
- *
- * @returns the value of the input, or undefined if no such input is passed to the Action
- * @throws an error if the value of the input could not be determined, or we could not
- * determine that no such input is passed to the Action.
- */
-function getInputOrThrow(
-  workflow: Workflow,
-  jobName: string,
-  actionName: string,
-  inputName: string,
-  matrixVars: { [key: string]: string } | undefined,
-) {
-  const preamble = `Could not get ${inputName} input to ${actionName} since`;
-  if (!workflow.jobs) {
-    throw new Error(`${preamble} the workflow has no jobs.`);
-  }
-  if (!workflow.jobs[jobName]) {
-    throw new Error(`${preamble} the workflow has no job named ${jobName}.`);
-  }
-
-  const stepsCallingAction = getStepsCallingAction(
-    workflow.jobs[jobName],
-    actionName,
-  );
-
-  if (stepsCallingAction.length === 0) {
-    throw new Error(
-      `${preamble} the ${jobName} job does not call ${actionName}.`,
-    );
-  } else if (stepsCallingAction.length > 1) {
-    throw new Error(
-      `${preamble} the ${jobName} job calls ${actionName} multiple times.`,
-    );
-  }
-
-  let input = stepsCallingAction[0].with?.[inputName]?.toString();
-
-  if (input !== undefined && matrixVars !== undefined) {
-    // Normalize by removing whitespace
-    input = input.replace(/\${{\s+/, "${{").replace(/\s+}}/, "}}");
-    // Make a basic attempt to substitute matrix variables
-    for (const [key, value] of Object.entries(matrixVars)) {
-      input = input.replace(`\${{matrix.${key}}}`, value);
-    }
-  }
-  if (input?.includes("${{")) {
-    throw new Error(
-      `Could not get ${inputName} input to ${actionName} since it contained an unrecognized dynamic value.`,
-    );
-  }
-  return input;
-}
-
-/**
- * Get the expected name of the analyze Action.
- *
- * This allows us to test workflow parsing functionality as a CodeQL Action PR check.
- */
-function getAnalyzeActionName() {
-  if (isInTestMode() || getTestingEnvironment() === "codeql-action-pr-checks") {
-    return "./analyze";
-  } else {
-    return "github/codeql-action/analyze";
-  }
-}
-
-/**
- * Makes a best effort attempt to retrieve the category input for the particular job,
- * given a set of matrix variables.
- *
- * Typically you'll want to wrap this function in a try/catch block and handle the error.
- *
- * @returns the category input, or undefined if the category input is not defined
- * @throws an error if the category input could not be determined
- */
-export function getCategoryInputOrThrow(
-  workflow: Workflow,
-  jobName: string,
-  matrixVars: { [key: string]: string } | undefined,
-): string | undefined {
-  return getInputOrThrow(
-    workflow,
-    jobName,
-    getAnalyzeActionName(),
-    "category",
-    matrixVars,
-  );
-}
-
-/**
- * Makes a best effort attempt to retrieve the upload input for the particular job,
- * given a set of matrix variables.
- *
- * Typically you'll want to wrap this function in a try/catch block and handle the error.
- *
- * @returns the user input to upload, or undefined if input was unspecified
- * @throws an error if the upload input could not be determined
- */
-export function getUploadInputOrThrow(
-  workflow: Workflow,
-  jobName: string,
-  matrixVars: { [key: string]: string } | undefined,
-): string | undefined {
-  return getInputOrThrow(
-    workflow,
-    jobName,
-    getAnalyzeActionName(),
-    "upload",
-    matrixVars,
-  );
-}
-
-/**
- * Makes a best effort attempt to retrieve the checkout_path input for the
- * particular job, given a set of matrix variables.
- *
- * Typically you'll want to wrap this function in a try/catch block and handle the error.
- *
- * @returns the checkout_path input
- * @throws an error if the checkout_path input could not be determined
- */
-export function getCheckoutPathInputOrThrow(
-  workflow: Workflow,
-  jobName: string,
-  matrixVars: { [key: string]: string } | undefined,
-): string {
-  return (
-    getInputOrThrow(
-      workflow,
-      jobName,
-      getAnalyzeActionName(),
-      "checkout_path",
-      matrixVars,
-    ) || getRequiredEnvParam("GITHUB_WORKSPACE") // if unspecified, checkout_path defaults to ${{ github.workspace }}
-  );
-}
-
-/**
- * A wrapper around `validateWorkflow` which reports the outcome.
- *
- * @param logger The logger to use.
- * @param codeql The CodeQL instance.
- */
-export async function checkWorkflow(logger: Logger, codeql: CodeQL) {
-  // Check the workflow for problems, unless `SKIP_WORKFLOW_VALIDATION` is `true`
-  // or the workflow trigger is `dynamic`.
-  if (
-    !isDynamicWorkflow() &&
-    process.env[EnvVar.SKIP_WORKFLOW_VALIDATION] !== "true"
-  ) {
-    core.startGroup("Validating workflow");
-    const validateWorkflowResult = await internal.validateWorkflow(
-      codeql,
-      logger,
-    );
-    if (validateWorkflowResult === undefined) {
-      logger.info("Detected no issues with the code scanning workflow.");
-    } else {
-      logger.debug(
-        `Unable to validate code scanning workflow: ${validateWorkflowResult}`,
-      );
-    }
-    core.endGroup();
-  }
-}
-
-export const internal = {
-  validateWorkflow,
-};
diff --git a/start-proxy/action.yml b/start-proxy/action.yml
deleted file mode 100644
index 4b6e9a3f9e..0000000000
--- a/start-proxy/action.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: "CodeQL: Start proxy"
-description: "[Experimental] Start HTTP proxy server. This action is for internal GitHub used only and will change without notice."
-author: "GitHub"
-inputs:
-  registry_secrets:
-    description: The URLs and credentials of package registries
-    required: false
-    default: "[]"
-  registries_credentials:
-    description: Base64 encoded JSON configuration for the URLs and credentials of the package registries
-    required: false
-  token:
-    description: "GitHub token to use for authenticating with this instance of GitHub. The token must be the built-in GitHub Actions token, and the workflow must have the `security-events: write` permission. Most of the time it is advisable to avoid specifying this input so that the workflow falls back to using the default value."
-    default: ${{ github.token }}
-    required: false
-  language:
-    description: The programming language to setup the proxy for the correct ecosystem
-    required: false
-  matrix:
-    default: ${{ toJson(matrix) }}
-    required: false
-outputs:
-  proxy_host:
-    description: The IP address of the proxy
-  proxy_port:
-    description: The port of the proxy
-  proxy_ca_certificate:
-    description: The proxy's internal CA certificate in PEM format
-  proxy_urls:
-    description: A stringified JSON array of objects containing the types and URLs of the configured registries.
-runs:
-  using: node24
-  main: "../lib/start-proxy-entry.js"
-  post: "../lib/start-proxy-post-entry.js"
diff --git a/tests/cpp-autobuild/src/build.sh b/tests/cpp-autobuild/src/build.sh
deleted file mode 100755
index 8a8ae2683c..0000000000
--- a/tests/cpp-autobuild/src/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-errno || true  # just a command to check its autoinstallation by deptrace
-
-gcc -o main main.c
diff --git a/tests/cpp-autobuild/src/main.c b/tests/cpp-autobuild/src/main.c
deleted file mode 100644
index 846028e8f2..0000000000
--- a/tests/cpp-autobuild/src/main.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "stdio.h"
-
-int main(int argc, char **argv) {
-    if (1) {
-        printf("Hello, World!\n");
-    }
-}
-
diff --git a/tests/java-repo/build.gradle b/tests/java-repo/build.gradle
deleted file mode 100644
index 591d77bda1..0000000000
--- a/tests/java-repo/build.gradle
+++ /dev/null
@@ -1,12 +0,0 @@
-plugins {
-    id 'application'
-}
-
-repositories {
-    mavenCentral()
-}
-
-application {
-    mainClass = 'Main'
-}
-
diff --git a/tests/java-repo/src/main/java/Main.java b/tests/java-repo/src/main/java/Main.java
deleted file mode 100644
index 9c8b016543..0000000000
--- a/tests/java-repo/src/main/java/Main.java
+++ /dev/null
@@ -1,8 +0,0 @@
-class Main {
-    public static void main(String args[]) {
-        if (true) {
-            System.out.println("Hello, World!");
-        }
-    }
-}
-
diff --git a/tests/multi-language-repo/.github/codeql/codeql-config-packaging.yml b/tests/multi-language-repo/.github/codeql/codeql-config-packaging.yml
deleted file mode 100644
index 8d560bdcb6..0000000000
--- a/tests/multi-language-repo/.github/codeql/codeql-config-packaging.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: Pack testing in the CodeQL Action
-
-disable-default-queries: true
-packs:
-  javascript:
-    - codeql-testing/codeql-pack1@1.0.0
-    - codeql-testing/codeql-pack2
-    - codeql-testing/codeql-pack3:other-query.ql
-
-paths-ignore:
-  - lib
-  - pr-checks
-  - tests
diff --git a/tests/multi-language-repo/.github/codeql/codeql-config-packaging2.yml b/tests/multi-language-repo/.github/codeql/codeql-config-packaging2.yml
deleted file mode 100644
index 3442d3ee1b..0000000000
--- a/tests/multi-language-repo/.github/codeql/codeql-config-packaging2.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-name: Pack testing in the CodeQL Action
-
-disable-default-queries: true
-paths-ignore:
-  - lib
-  - pr-checks
-  - tests
diff --git a/tests/multi-language-repo/.github/codeql/codeql-config-packaging3.yml b/tests/multi-language-repo/.github/codeql/codeql-config-packaging3.yml
deleted file mode 100644
index 2a75653212..0000000000
--- a/tests/multi-language-repo/.github/codeql/codeql-config-packaging3.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: Pack testing in the CodeQL Action
-
-disable-default-queries: true
-packs:
-  javascript:
-    - codeql-testing/codeql-pack2
-    - codeql-testing/codeql-pack3:other-query.ql
-paths-ignore:
-  - lib
-  - pr-checks
-  - tests
diff --git a/tests/multi-language-repo/.github/codeql/codeql-config-query-filters1.yml b/tests/multi-language-repo/.github/codeql/codeql-config-query-filters1.yml
deleted file mode 100644
index 91a8dce370..0000000000
--- a/tests/multi-language-repo/.github/codeql/codeql-config-query-filters1.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: "Check SARIF for default queries with Single include, Single exclude"
-
-query-filters:
-# This should run js/path-injection and js/zipslip
-- include:
-    tags contain:
-        - external/cwe/cwe-022
-
-# Removes js/path-injection
-- exclude:
-    id:
-        - js/path-injection
diff --git a/tests/multi-language-repo/.github/codeql/codeql-config-query-filters2.yml b/tests/multi-language-repo/.github/codeql/codeql-config-query-filters2.yml
deleted file mode 100644
index c0d6869624..0000000000
--- a/tests/multi-language-repo/.github/codeql/codeql-config-query-filters2.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: "Check SARIF for query packs with Single include, Single exclude"
-
-disable-default-queries: true
-
-packs:
-  javascript:
-    - codeql/javascript-queries
-    - codeql-testing/codeql-pack1@1.0.0
-
-query-filters:
-# This should run js/path-injection and js/zipslip
-- include:
-    tags contain:
-        - external/cwe/cwe-022
-
-# Removes js/path-injection
-- exclude:
-    id:
-        - js/path-injection
-
-# Query from extra pack
-- include:
-    id:
-        - javascript/example/empty-or-one-block
diff --git a/tests/multi-language-repo/.github/codeql/codeql-config-query-filters3.yml b/tests/multi-language-repo/.github/codeql/codeql-config-query-filters3.yml
deleted file mode 100644
index 619442d0fd..0000000000
--- a/tests/multi-language-repo/.github/codeql/codeql-config-query-filters3.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-name: "Check SARIF for query packs and local queries with Single include, Single exclude"
-
-disable-default-queries: true
-
-queries:
-# Local query
-  - name: Run an extra local query
-    uses: ./codeql-qlpacks/javascript-qlpack/show_ifs.ql
-
-# These queries are ignored
-  - name: Ignored queries
-    uses: ./codeql-qlpacks/complex-python-qlpack/rootAndBar.qls
-
-
-packs:
-  javascript:
-    - codeql/javascript-queries
-    - codeql-testing/codeql-pack1@1.0.0
-
-query-filters:
-# This should run js/path-injection and js/zipslip
-- include:
-    tags contain:
-      - external/cwe/cwe-022
-
-# Removes js/path-injection
-- exclude:
-    id:
-      - js/path-injection
-
-# Query from extra pack
-- include:
-    id:
-      - javascript/example/empty-or-one-block
-
-# Local query
-- include:
-    id:
-      - inrepo-javascript-querypack/show-ifs
diff --git a/tests/multi-language-repo/.github/codeql/codeql-config-registries.yml b/tests/multi-language-repo/.github/codeql/codeql-config-registries.yml
deleted file mode 100644
index dcd8358185..0000000000
--- a/tests/multi-language-repo/.github/codeql/codeql-config-registries.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-name: Pack testing in the CodeQL Action
-
-disable-default-queries: true
-packs:
-  javascript:
-    - codeql-testing/private-pack
-    - codeql-testing/codeql-pack1
diff --git a/tests/multi-language-repo/.github/codeql/custom-queries.yml b/tests/multi-language-repo/.github/codeql/custom-queries.yml
deleted file mode 100644
index fc80426f70..0000000000
--- a/tests/multi-language-repo/.github/codeql/custom-queries.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: Use custom queries
-
-disable-default-queries: true
-
-queries:
-# Query suites
-  - name: Select a query suite
-    uses: ./codeql-qlpacks/complex-python-qlpack/rootAndBar.qls
-# QL pack subset
-  - name: Select a ql file
-    uses: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
-  - name: Select a subfolder
-    uses: ./codeql-qlpacks/complex-javascript-qlpack/foo
-  - name: Select a folder with two subfolders
-    uses: ./codeql-qlpacks/complex-javascript-qlpack/foo2
-# Inrepo QL pack
-  - name: Select an inrepo ql pack
-    uses: ./codeql-qlpacks/csharp-qlpack
-  - name: Java queries
-    uses: ./codeql-qlpacks/java-qlpack
-# External QL packs
-  - name: Go queries
-    uses: codeql-testing/go-querypack@master
-  - name: Cpp queries
-    uses: codeql-testing/cpp-querypack@second-branch
-  - name: JavaScript queries
-    uses: codeql-testing/javascript-querypack/show_ifs2.ql@master
-  - name: Python queries
-    uses: codeql-testing/python-querypack/show_ifs2.ql@second-branch
diff --git a/tests/multi-language-repo/.github/codeql/multi-language-packs-config.yml b/tests/multi-language-repo/.github/codeql/multi-language-packs-config.yml
deleted file mode 100644
index dcf3337b3c..0000000000
--- a/tests/multi-language-repo/.github/codeql/multi-language-packs-config.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-packs:
-  javascript:
-    - codeql-testing/codeql-pack1@1.0.0
-    - codeql-testing/codeql-pack2
-  ruby:
-    - codeql/ruby-queries
-
-queries:
-  - uses: ./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql
diff --git a/tests/multi-language-repo/.github/codeql/other-config-properties.yml b/tests/multi-language-repo/.github/codeql/other-config-properties.yml
deleted file mode 100644
index ff7c281c23..0000000000
--- a/tests/multi-language-repo/.github/codeql/other-config-properties.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-name: Config using all properties
-
-disable-default-queries: true
-
-paths-ignore:
-  - xxx
-
-paths:
-  - yyy
diff --git a/tests/multi-language-repo/.github/codeql/queries-and-packs-config.yml b/tests/multi-language-repo/.github/codeql/queries-and-packs-config.yml
deleted file mode 100644
index 7a6b3a1c8f..0000000000
--- a/tests/multi-language-repo/.github/codeql/queries-and-packs-config.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-packs:
-  javascript:
-    - codeql-testing/codeql-pack1@1.0.0
-    - codeql-testing/codeql-pack2
-
-queries:
-  - uses: ./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql
diff --git a/tests/multi-language-repo/.gitignore b/tests/multi-language-repo/.gitignore
deleted file mode 100644
index b8703de742..0000000000
--- a/tests/multi-language-repo/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.DS_Store
-/.build
-/Packages
-/obj
-/*.xcodeproj
-xcuserdata/
-DerivedData/
-.swiftpm/config/registries.json
-.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
-.netrc
-multi-language-repo.sln
diff --git a/tests/multi-language-repo/Cargo.lock b/tests/multi-language-repo/Cargo.lock
deleted file mode 100644
index b9856cfaf7..0000000000
--- a/tests/multi-language-repo/Cargo.lock
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "test"
-version = "0.0.1"
diff --git a/tests/multi-language-repo/Cargo.toml b/tests/multi-language-repo/Cargo.toml
deleted file mode 100644
index 21db844f36..0000000000
--- a/tests/multi-language-repo/Cargo.toml
+++ /dev/null
@@ -1,8 +0,0 @@
-[package]
-name = "test"
-version = "0.0.1"
-edition = "2021"
-[[bin]]
-name = "main"
-path = "main.rs"
-
diff --git a/tests/multi-language-repo/Gemfile b/tests/multi-language-repo/Gemfile
deleted file mode 100644
index 106e356628..0000000000
--- a/tests/multi-language-repo/Gemfile
+++ /dev/null
@@ -1,4 +0,0 @@
-source "https://rubygems.org" do
-end
-
-gem "bundler"
diff --git a/tests/multi-language-repo/Gemfile.lock b/tests/multi-language-repo/Gemfile.lock
deleted file mode 100644
index 327e320b4f..0000000000
--- a/tests/multi-language-repo/Gemfile.lock
+++ /dev/null
@@ -1,12 +0,0 @@
-GEM
-  remote: https://rubygems.org/
-  specs:
-
-PLATFORMS
-  x86_64-linux
-
-DEPENDENCIES
-  bundler (= 2.2.9)
-
-BUNDLED WITH
-   2.2.9
diff --git a/tests/multi-language-repo/Main.java b/tests/multi-language-repo/Main.java
deleted file mode 100644
index 9c8b016543..0000000000
--- a/tests/multi-language-repo/Main.java
+++ /dev/null
@@ -1,8 +0,0 @@
-class Main {
-    public static void main(String args[]) {
-        if (true) {
-            System.out.println("Hello, World!");
-        }
-    }
-}
-
diff --git a/tests/multi-language-repo/Package.swift b/tests/multi-language-repo/Package.swift
deleted file mode 100644
index ff2b07e41c..0000000000
--- a/tests/multi-language-repo/Package.swift
+++ /dev/null
@@ -1,15 +0,0 @@
-// swift-tools-version: 5.8
-// The swift-tools-version declares the minimum version of Swift required to build this package.
-
-import PackageDescription
-
-let package = Package(
-    name: "multi-language-repo",
-    targets: [
-        // Targets are the basic building blocks of a package, defining a module or a test suite.
-        // Targets can depend on other targets in this package and products from dependencies.
-        .executableTarget(
-            name: "multi-language-repo",
-            path: "Sources"),
-    ]
-)
diff --git a/tests/multi-language-repo/Sources/main.swift b/tests/multi-language-repo/Sources/main.swift
deleted file mode 100644
index 44e20d5acc..0000000000
--- a/tests/multi-language-repo/Sources/main.swift
+++ /dev/null
@@ -1,4 +0,0 @@
-// The Swift Programming Language
-// https://docs.swift.org/swift-book
-
-print("Hello, world!")
diff --git a/tests/multi-language-repo/build.sh b/tests/multi-language-repo/build.sh
deleted file mode 100755
index e0c4a55390..0000000000
--- a/tests/multi-language-repo/build.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-set -eo pipefail
-
-gcc -o main main.c
-
-dotnet build -p:UseSharedCompilation=false
-
-javac Main.java
-
-go build main.go
-
-# Not all platforms support Swift
-if [[ "$OSTYPE" == "darwin"* ]]; then
-    echo "Compiling Swift"
-    swift build
-fi
-
-kotlinc main.kt
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo/show_ifs.ql
deleted file mode 100644
index bc58378831..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Foo Show Ifs
- * @description Foo Show Ifs
- * @kind problem
- * @id complex-javascript-querypack/foo-show-ifs
- */
-
-import javascript
-
-from IfStmt i
-select i, "foo if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/bar/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/bar/show_ifs.ql
deleted file mode 100644
index 13fde86ec9..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/bar/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Bar Show Ifs
- * @description Bar Show Ifs
- * @kind problem
- * @id complex-javascript-querypack/bar-ifs
- */
-
-import javascript
-
-from IfStmt i
-select i, "bar if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/barfoo/barfoobar/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/barfoo/barfoobar/show_ifs.ql
deleted file mode 100644
index b9f79d4c46..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/barfoo/barfoobar/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Barfoobar Show Ifs
- * @description Barfoobar Show Ifs
- * @kind problem
- * @id complex-javascript-querypack/barfoobar-ifs
- */
-
-import javascript
-
-from IfStmt i
-select i, "barfoobar if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql
deleted file mode 100644
index 36bd0262c3..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Foo2 Show Ifs
- * @description Foo2 Show Ifs
- * @kind problem
- * @id complex-javascript-querypack/foo2-ifs
- */
-
-import javascript
-
-from IfStmt i
-select i, "foo2 if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/qlpack.yml
deleted file mode 100644
index 95acb04f05..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/qlpack.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: complex-javascript-querypack
-version: 0.0.1
-libraryPathDependencies: codeql-javascript
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
deleted file mode 100644
index 7b7d436a94..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Root Show Ifs
- * @description Root Show Ifs
- * @kind problem
- * @id complex-javascript-querypack/root-show-ifs
- */
-
-import javascript
-
-from IfStmt i
-select i, "root if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/bar/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/bar/show_ifs.ql
deleted file mode 100644
index 1e12ee2e0c..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/bar/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Foo/Bar Show Ifs
- * @description Foo/Bar Show Ifs
- * @kind problem
- * @id complex-python-querypack/foo/bar/show-ifs
- */
-
-import python
-
-from If i
-select i, "foo/bar if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/show_ifs.ql
deleted file mode 100644
index 85d6b2ff3f..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Foo Show Ifs
- * @description Foo Show Ifs
- * @kind problem
- * @id complex-python-querypack/foo/show-ifs
- */
-
-import python
-
-from If i
-select i, "foo if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/qlpack.yml
deleted file mode 100644
index 349294dcfc..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/qlpack.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: inrepo-python-querypack
-version: 0.0.1
-libraryPathDependencies: codeql-python
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/rootAndBar.qls b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/rootAndBar.qls
deleted file mode 100644
index 6cac869168..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/rootAndBar.qls
+++ /dev/null
@@ -1,2 +0,0 @@
-- query: show_ifs.ql
-- query: foo/bar/show_ifs.ql
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/show_ifs.ql
deleted file mode 100644
index 719eabf693..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Show Ifs
- * @description Show Ifs
- * @kind problem
- * @id complex-python-querypack/show-ifs
- */
-
-import python
-
-from If i
-select i, "hello if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/qlpack.yml
deleted file mode 100644
index 7c2ea26cde..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/qlpack.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: inrepo-cpp-querypack
-version: 0.0.1
-libraryPathDependencies: codeql-cpp
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/show_ifs.ql
deleted file mode 100644
index 745a8bb289..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Show Cpp Ifs
- * @description Show Cpp Ifs
- * @kind problem
- * @id inrepo-cpp-querypack/show-ifs
- */
-
-import cpp
-
-from IfStmt i
-select i, "hello if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/qlpack.yml
deleted file mode 100644
index 9a54e7e92f..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/qlpack.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: inrepo-csharp-querypack
-version: 0.0.1
-libraryPathDependencies: codeql-csharp
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/show_ifs.ql
deleted file mode 100644
index d67d01ffcd..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Show Csharp Ifs
- * @description Show Csharp Ifs
- * @kind problem
- * @id inrepo-csharp-querypack/show-ifs
- */
-
-import csharp
-
-from IfStmt i
-select i, "hello if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/go-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/go-qlpack/qlpack.yml
deleted file mode 100644
index 59ccb68818..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/go-qlpack/qlpack.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: inrepo-go-querypack
-version: 0.0.1
-libraryPathDependencies: codeql-go
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/go-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/go-qlpack/show_ifs.ql
deleted file mode 100644
index 8b0c198fc4..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/go-qlpack/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Show Go Ifs
- * @description Show Go Ifs
- * @kind problem
- * @id inrepo-go-querypack/show-ifs
- */
-
-import go
-
-from IfStmt i
-select i, "hello if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/java-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/java-qlpack/qlpack.yml
deleted file mode 100644
index 06e8cae7d3..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/java-qlpack/qlpack.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: inrepo-java-querypack
-version: 0.0.1
-libraryPathDependencies: codeql-java
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/java-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/java-qlpack/show_ifs.ql
deleted file mode 100644
index eafc48cd11..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/java-qlpack/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Show Java Ifs
- * @description Show Java Ifs
- * @kind problem
- * @id inrepo-java-querypack/show-ifs
- */
-
-import java
-
-from IfStmt i
-select i, "hello if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/qlpack.yml
deleted file mode 100644
index f6d5a7b6db..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/qlpack.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: inrepo-javascript-querypack
-version: 0.0.1
-libraryPathDependencies: codeql-javascript
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/show_ifs.ql
deleted file mode 100644
index 8ed97a584f..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Show JavaScript Ifs
- * @description Show JavaScript Ifs
- * @kind problem
- * @id inrepo-javascript-querypack/show-ifs
- */
-
-import javascript
-
-from IfStmt i
-select i, "hello if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/python-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/python-qlpack/qlpack.yml
deleted file mode 100644
index 349294dcfc..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/python-qlpack/qlpack.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: inrepo-python-querypack
-version: 0.0.1
-libraryPathDependencies: codeql-python
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-qlpacks/python-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/python-qlpack/show_ifs.ql
deleted file mode 100644
index d0fd384da8..0000000000
--- a/tests/multi-language-repo/codeql-qlpacks/python-qlpack/show_ifs.ql
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @name Show Python Ifs
- * @description Show Python Ifs
- * @kind problem
- * @id inrepo-python-querypack/show-ifs
- */
-
-import python
-
-from If i
-select i, "hello if"
\ No newline at end of file
diff --git a/tests/multi-language-repo/codeql-swift-autobuild-test.xcodeproj/project.pbxproj b/tests/multi-language-repo/codeql-swift-autobuild-test.xcodeproj/project.pbxproj
deleted file mode 100644
index efc3540536..0000000000
--- a/tests/multi-language-repo/codeql-swift-autobuild-test.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,310 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 56;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		46D4896F291B98000029E1E2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D4896E291B98000029E1E2 /* AppDelegate.swift */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
-		46D4896B291B98000029E1E2 /* codeql-swift-autobuild-test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "codeql-swift-autobuild-test.app"; sourceTree = BUILT_PRODUCTS_DIR; };
-		46D4896E291B98000029E1E2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		46D48968291B98000029E1E2 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		46D48962291B98000029E1E2 = {
-			isa = PBXGroup;
-			children = (
-				46D4896D291B98000029E1E2 /* codeql-swift-autobuild-test */,
-				46D4896C291B98000029E1E2 /* Products */,
-			);
-			sourceTree = "";
-		};
-		46D4896C291B98000029E1E2 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				46D4896B291B98000029E1E2 /* codeql-swift-autobuild-test.app */,
-			);
-			name = Products;
-			sourceTree = "";
-		};
-		46D4896D291B98000029E1E2 /* codeql-swift-autobuild-test */ = {
-			isa = PBXGroup;
-			children = (
-				46D4896E291B98000029E1E2 /* AppDelegate.swift */,
-			);
-			path = "codeql-swift-autobuild-test";
-			sourceTree = "";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		46D4896A291B98000029E1E2 /* codeql-swift-autobuild-test */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 46D4897A291B98020029E1E2 /* Build configuration list for PBXNativeTarget "codeql-swift-autobuild-test" */;
-			buildPhases = (
-				46D48967291B98000029E1E2 /* Sources */,
-				46D48968291B98000029E1E2 /* Frameworks */,
-				46D48969291B98000029E1E2 /* Resources */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = "codeql-swift-autobuild-test";
-			productName = "codeql-swift-autobuild-test";
-			productReference = 46D4896B291B98000029E1E2 /* codeql-swift-autobuild-test.app */;
-			productType = "com.apple.product-type.application";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		46D48963291B98000029E1E2 /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				BuildIndependentTargetsInParallel = 1;
-				LastSwiftUpdateCheck = 1400;
-				LastUpgradeCheck = 1400;
-				TargetAttributes = {
-					46D4896A291B98000029E1E2 = {
-						CreatedOnToolsVersion = 14.0;
-					};
-				};
-			};
-			buildConfigurationList = 46D48966291B98000029E1E2 /* Build configuration list for PBXProject "codeql-swift-autobuild-test" */;
-			compatibilityVersion = "Xcode 14.0";
-			developmentRegion = en;
-			hasScannedForEncodings = 0;
-			knownRegions = (
-				en,
-			);
-			mainGroup = 46D48962291B98000029E1E2;
-			productRefGroup = 46D4896C291B98000029E1E2 /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				46D4896A291B98000029E1E2 /* codeql-swift-autobuild-test */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-		46D48969291B98000029E1E2 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		46D48967291B98000029E1E2 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				46D4896F291B98000029E1E2 /* AppDelegate.swift in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		46D48978291B98020029E1E2 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				CLANG_ANALYZER_NONNULL = YES;
-				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
-				CLANG_ENABLE_MODULES = YES;
-				CLANG_ENABLE_OBJC_ARC = YES;
-				CLANG_ENABLE_OBJC_WEAK = YES;
-				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
-				CLANG_WARN_BOOL_CONVERSION = YES;
-				CLANG_WARN_COMMA = YES;
-				CLANG_WARN_CONSTANT_CONVERSION = YES;
-				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
-				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN_ENUM_CONVERSION = YES;
-				CLANG_WARN_INFINITE_RECURSION = YES;
-				CLANG_WARN_INT_CONVERSION = YES;
-				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
-				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
-				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
-				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
-				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
-				CLANG_WARN_STRICT_PROTOTYPES = YES;
-				CLANG_WARN_SUSPICIOUS_MOVE = YES;
-				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
-				CLANG_WARN_UNREACHABLE_CODE = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				COPY_PHASE_STRIP = NO;
-				DEBUG_INFORMATION_FORMAT = dwarf;
-				ENABLE_STRICT_OBJC_MSGSEND = YES;
-				ENABLE_TESTABILITY = YES;
-				GCC_C_LANGUAGE_STANDARD = gnu11;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_NO_COMMON_BLOCKS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"DEBUG=1",
-					"$(inherited)",
-				);
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-				GCC_WARN_UNUSED_FUNCTION = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 11.0;
-				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
-				MTL_FAST_MATH = YES;
-				ONLY_ACTIVE_ARCH = YES;
-				SDKROOT = macosx;
-				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
-				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-			};
-			name = Debug;
-		};
-		46D48979291B98020029E1E2 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				CLANG_ANALYZER_NONNULL = YES;
-				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
-				CLANG_ENABLE_MODULES = YES;
-				CLANG_ENABLE_OBJC_ARC = YES;
-				CLANG_ENABLE_OBJC_WEAK = YES;
-				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
-				CLANG_WARN_BOOL_CONVERSION = YES;
-				CLANG_WARN_COMMA = YES;
-				CLANG_WARN_CONSTANT_CONVERSION = YES;
-				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
-				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN_ENUM_CONVERSION = YES;
-				CLANG_WARN_INFINITE_RECURSION = YES;
-				CLANG_WARN_INT_CONVERSION = YES;
-				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
-				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
-				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
-				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
-				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
-				CLANG_WARN_STRICT_PROTOTYPES = YES;
-				CLANG_WARN_SUSPICIOUS_MOVE = YES;
-				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
-				CLANG_WARN_UNREACHABLE_CODE = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				COPY_PHASE_STRIP = NO;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				ENABLE_NS_ASSERTIONS = NO;
-				ENABLE_STRICT_OBJC_MSGSEND = YES;
-				GCC_C_LANGUAGE_STANDARD = gnu11;
-				GCC_NO_COMMON_BLOCKS = YES;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-				GCC_WARN_UNUSED_FUNCTION = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 11.0;
-				MTL_ENABLE_DEBUG_INFO = NO;
-				MTL_FAST_MATH = YES;
-				SDKROOT = macosx;
-				SWIFT_COMPILATION_MODE = wholemodule;
-				SWIFT_OPTIMIZATION_LEVEL = "-O";
-			};
-			name = Release;
-		};
-		46D4897B291B98020029E1E2 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
-				CODE_SIGN_STYLE = Automatic;
-				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 1;
-				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_KEY_NSHumanReadableCopyright = "";
-				INFOPLIST_KEY_NSMainStoryboardFile = Main;
-				INFOPLIST_KEY_NSPrincipalClass = NSApplication;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/../Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = "com.github.codeql-swift-autobuild-test";
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = YES;
-				SWIFT_VERSION = 5.0;
-			};
-			name = Debug;
-		};
-		46D4897C291B98020029E1E2 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
-				CODE_SIGN_STYLE = Automatic;
-				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 1;
-				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_KEY_NSHumanReadableCopyright = "";
-				INFOPLIST_KEY_NSMainStoryboardFile = Main;
-				INFOPLIST_KEY_NSPrincipalClass = NSApplication;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/../Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = "com.github.codeql-swift-autobuild-test";
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = YES;
-				SWIFT_VERSION = 5.0;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		46D48966291B98000029E1E2 /* Build configuration list for PBXProject "codeql-swift-autobuild-test" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				46D48978291B98020029E1E2 /* Debug */,
-				46D48979291B98020029E1E2 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		46D4897A291B98020029E1E2 /* Build configuration list for PBXNativeTarget "codeql-swift-autobuild-test" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				46D4897B291B98020029E1E2 /* Debug */,
-				46D4897C291B98020029E1E2 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 46D48963291B98000029E1E2 /* Project object */;
-}
diff --git a/tests/multi-language-repo/codeql-swift-autobuild-test/AppDelegate.swift b/tests/multi-language-repo/codeql-swift-autobuild-test/AppDelegate.swift
deleted file mode 100644
index b098bd9fcf..0000000000
--- a/tests/multi-language-repo/codeql-swift-autobuild-test/AppDelegate.swift
+++ /dev/null
@@ -1,4 +0,0 @@
-import Cocoa
-
-@main
-class AppDelegate: NSObject, NSApplicationDelegate {}
diff --git a/tests/multi-language-repo/csharp.csproj b/tests/multi-language-repo/csharp.csproj
deleted file mode 100644
index 438ab8a4dd..0000000000
--- a/tests/multi-language-repo/csharp.csproj
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-  
-    Exe
-    netcoreapp3.1
-    multi_language_test
-    $(DefaultItemExcludes);codeql-runner/**
-  
-
-
diff --git a/tests/multi-language-repo/global.json b/tests/multi-language-repo/global.json
deleted file mode 100644
index 764fdd82be..0000000000
--- a/tests/multi-language-repo/global.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "sdk": {
-    "version": "9.0.307",
-    "rollForward": "latestFeature"
-  }
-}
diff --git a/tests/multi-language-repo/main.c b/tests/multi-language-repo/main.c
deleted file mode 100644
index 846028e8f2..0000000000
--- a/tests/multi-language-repo/main.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "stdio.h"
-
-int main(int argc, char **argv) {
-    if (1) {
-        printf("Hello, World!\n");
-    }
-}
-
diff --git a/tests/multi-language-repo/main.cs b/tests/multi-language-repo/main.cs
deleted file mode 100644
index 6dbbddab41..0000000000
--- a/tests/multi-language-repo/main.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace HelloWorldApp {
-    class Geeks {
-        static void Main(string[] args) {
-            if (true) {
-                Console.WriteLine("Hello World!");
-            }
-        }
-    }
-}
-
diff --git a/tests/multi-language-repo/main.go b/tests/multi-language-repo/main.go
deleted file mode 100644
index 2c881f49f7..0000000000
--- a/tests/multi-language-repo/main.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package main
-
-import "fmt"
-
-func main() {
-	if true {
-		fmt.Println("hello world")
-	}
-}
diff --git a/tests/multi-language-repo/main.js b/tests/multi-language-repo/main.js
deleted file mode 100644
index 6512e2b969..0000000000
--- a/tests/multi-language-repo/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-if (true) {
-    console.log("Hello, World!");
-    console.log("Good-bye, World!");
-}
-
-if (true) {
-    console.log("Hello, World!");
-}
-
-if (true) {
-    // empty
-}
diff --git a/tests/multi-language-repo/main.kt b/tests/multi-language-repo/main.kt
deleted file mode 100644
index 52b23a2879..0000000000
--- a/tests/multi-language-repo/main.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-fun main() {
-    if (true) {
-        println("Hello, World!")
-    }
-}
diff --git a/tests/multi-language-repo/main.py b/tests/multi-language-repo/main.py
deleted file mode 100755
index 194ad6a655..0000000000
--- a/tests/multi-language-repo/main.py
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/python3
-
-def main():
-    if True:
-        print("Hello, World!")
-
-if __name__ == '__main__':
-    main()
-
diff --git a/tests/multi-language-repo/main.rb b/tests/multi-language-repo/main.rb
deleted file mode 100755
index 234a56f7d0..0000000000
--- a/tests/multi-language-repo/main.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/ruby
-# frozen_string_literal: true
-
-def main
-  v = ARGV[0]
-
-  puts 'with arg?' unless v.nil?
-  puts 'hello there'
-end
-
-main
diff --git a/tests/multi-language-repo/main.rs b/tests/multi-language-repo/main.rs
deleted file mode 100644
index 8b6cef9580..0000000000
--- a/tests/multi-language-repo/main.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-fn main() {
-  if true {
-    println!("Hello world!")
-  }
-}
-
diff --git a/tests/multi-language-repo/swift-custom-build/helloWorld/helloWorld.swift b/tests/multi-language-repo/swift-custom-build/helloWorld/helloWorld.swift
deleted file mode 100644
index a4e16f8b15..0000000000
--- a/tests/multi-language-repo/swift-custom-build/helloWorld/helloWorld.swift
+++ /dev/null
@@ -1,9 +0,0 @@
-public struct main {
-    public private(set) var text = "Hello, World!"
-
-    public init() {
-        if (true) {
-            print(text)
-        }
-    }
-}
diff --git a/tsconfig.json b/tsconfig.json
deleted file mode 100644
index 66545447c5..0000000000
--- a/tsconfig.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-  "compilerOptions": {
-    /* Basic Options */
-    "lib": ["ES2022"],
-    "target": "ES2022",
-    "module": "commonjs",
-    "moduleResolution": "bundler",
-    "outDir": "./build",
-    "rootDir": "./src",
-    "sourceMap": true,
-    "types": ["node"],
-
-    /* Strict Type-Checking Options */
-    "strict": true,                           /* Enable all strict type-checking options. */
-    "noImplicitAny": false,                   /* Raise error on expressions and declarations with an implied 'any' type. */
-    "strictNullChecks": true,                 /* Enable strict null checks. */
-    "strictFunctionTypes": true,              /* Enable strict checking of function types. */
-    "strictBindCallApply": true,              /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
-    "strictPropertyInitialization": true,     /* Enable strict checking of property initialization in classes. */
-    "noImplicitThis": true,                   /* Raise error on 'this' expressions with an implied 'any' type. */
-
-    /* Additional Checks */
-    "noUnusedLocals": false,                   /* Report errors on unused locals. */
-    "noUnusedParameters": false,               /* Report errors on unused parameters. */
-    "noImplicitReturns": true,                /* Report error when not all code paths in function return a value. */
-    "noFallthroughCasesInSwitch": true,       /* Report errors for fallthrough cases in switch statement. */
-
-    /* Module Resolution Options */
-    "esModuleInterop": true,                  /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
-    "resolveJsonModule": true,
-    "skipLibCheck": true,
-    // @actions/github imports this path from @octokit/core but it's not in @octokit/core's
-    // exports map (only "@octokit/core/types" is). Under moduleResolution: "bundler", TypeScript
-    // checks exports maps and can't find it, causing all GitHub/Octokit types to degrade to `any`.
-    // This paths override restores the direct filesystem resolution that moduleResolution: "node10" used.
-    "paths": {
-      "@octokit/core/dist-types/types": ["./node_modules/@octokit/core/dist-types/types.d.ts"]
-    },
-  },
-  "exclude": ["node_modules", "pr-checks"]
-}
diff --git a/upload-sarif/action.yml b/upload-sarif/action.yml
deleted file mode 100644
index dae34ec528..0000000000
--- a/upload-sarif/action.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-name: 'Code Scanning : Upload SARIF'
-description: 'Upload the analysis results'
-author: 'GitHub'
-inputs:
-  sarif_file:
-    description: |
-      The SARIF file or directory of SARIF files to be uploaded to GitHub code scanning.
-      See https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github#uploading-a-code-scanning-analysis-with-github-actions
-      for information on the maximum number of results and maximum file size supported by code scanning.
-    required: false
-    default: '../results'
-  checkout_path:
-    description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file."
-    required: false
-    default: ${{ github.workspace }}
-  ref:
-    description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is ignored for pull requests from forks. Expected format: refs/heads/, refs/tags/, refs/pull//merge, or refs/pull//head."
-    required: false
-  sha:
-    description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is ignored for pull requests from forks."
-    required: false
-  token:
-    description: "GitHub token to use for authenticating with this instance of GitHub. The token must be the built-in GitHub Actions token, and the workflow must have the `security-events: write` permission. Most of the time it is advisable to avoid specifying this input so that the workflow falls back to using the default value."
-    required: false
-    default: ${{ github.token }}
-  matrix:
-    default: ${{ toJson(matrix) }}
-  category:
-    description: String used by Code Scanning for matching the analyses
-    required: false
-  wait-for-processing:
-    description: If true, the Action will wait for the uploaded SARIF to be processed before completing.
-    required: true
-    default: "true"
-outputs:
-  sarif-id:
-    description: The ID of the uploaded Code Scanning SARIF file, if any.
-  sarif-ids:
-    description: |
-      A stringified JSON object containing the SARIF ID for each kind of analysis. For example:
-
-      { "code-scanning": "some-id", "code-quality": "some-other-id" }
-runs:
-  using: node24
-  main: '../lib/upload-sarif-entry.js'
-  post: '../lib/upload-sarif-post-entry.js'